From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mx.groups.io with SMTP id smtpd.web09.2517.1665432442142677096 for ; Mon, 10 Oct 2022 13:07:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pLrpOxMP; spf=pass (domain: gmail.com, ip: 209.85.214.170, mailfrom: ayushdevel1325@gmail.com) Received: by mail-pl1-f170.google.com with SMTP id f23so11305918plr.6 for ; Mon, 10 Oct 2022 13:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=RRcKcJ2vo74/I0fK+ICPC7Xpd180T+phdDfVG7rURlI=; b=pLrpOxMP4vzmDAF5h83aibATZDhUau3dYcnhCuRLE7wrazqNNGhi0KRb7cQGkPAzhh He4cXPuKZ1Rg9qXL/fU6B2veHMmD2gCCJt1T8eBZjDK7tVCF/LgcsXL9MBxllMIERDKc ph7MFbfacaSCp/k7PP+u5V44n3Rsv0cuYJnAC+SViLJiiqGwjhkgLMs6B/+DJc46w8Qj qcaYQZ4/AoZ8ASOzNgHdm7Sxp4SOS5CIlMLEiBim1wZrDlPFxrPuwXcGoPOHnGJG42It 8SIGbWtTKRgo/42oC00YNlegBQERjIuEr5uyI54WQ/KYvcB2S2nx30Xy+9gL6C4uaxx7 zb1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RRcKcJ2vo74/I0fK+ICPC7Xpd180T+phdDfVG7rURlI=; b=JsPL37qXsGhGrXPCOKvQXcSDc/5xiw4sl572Q0sPLrXImM95vLbP+auJBuIjQ+x/y2 KuqVESf6kiHkcSvZTLyQvRhgzw7uZCnC/ssmbJCrDpwD5u4+1XmVHmHGSZojcFX6/1DG plfMVZmJQzt0m1m+60upjGMD6ZYcZetqnkvULUY07xnPKvuYMAErtzG833T+kMEpbm6f 2fup248OZawFrwhBuwcd4Y19V7sKj+nd5PKiSLT3n0r4mNrsYnvcDTyPVaEBFT+Sx+4f 6Rlh4M30f79JGkGufV4J4gMX3j+G1PnvP5nKvv2kceKve6pKNbm5Lj80Fgn/G9S1D1yB 2u5g== X-Gm-Message-State: ACrzQf2Cv7lGDAjxc+/pvksyp883/CVrfCaejf9F1h4G7G/lJTopYnz9 js94tgVE2h62zTlBjww6iGHVcmCBzkqFV5C/ X-Google-Smtp-Source: AMsMyM6C5B+TQ7GFmGDelUq6hnp6BvQOaqsuOQCVfzyhns5beJ8w5zhvE/MnbuojEUQrAIjp+nHPuA== X-Received: by 2002:a17:90b:4c8c:b0:20b:d3f:3c8a with SMTP id my12-20020a17090b4c8c00b0020b0d3f3c8amr22067960pjb.219.1665432435304; Mon, 10 Oct 2022 13:07:15 -0700 (PDT) Return-Path: Received: from toolbox.iitism.net ([103.15.228.66]) by smtp.gmail.com with ESMTPSA id l14-20020a170903120e00b0017f74cab9eesm7125298plh.128.2022.10.10.13.06.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 13:07:13 -0700 (PDT) From: "Ayush Singh" To: devel@edk2.groups.io Subject: [PATCH v1 1/1] Format BaseTools python files using autopep8 Date: Tue, 11 Oct 2022 01:35:50 +0530 Message-Id: <20221010200550.243688-2-ayushdevel1325@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010200550.243688-1-ayushdevel1325@gmail.com> References: <20221010200550.243688-1-ayushdevel1325@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Format all python files in BaseTools using the following commands: $ find . -name '*.py' -exec autopep8 --in-place '{}' \; This is to make the Python code PEP8 compilant as stated in EDK II Python Development Process Specification Signed-off-by: Ayush Singh --- BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py = | 74 +- BaseTools/Edk2ToolsBuild.py = | 4 +- BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py = | 15 +- BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py = | 6 +- BaseTools/Plugin/WindowsResourceCompiler/WinRcPath.py = | 8 +- BaseTools/Scripts/BinToPcd.py = | 185 +- BaseTools/Scripts/ConvertFceToStructurePcd.py = | 1312 ++-- BaseTools/Scripts/ConvertMasmToNasm.py = | 7 +- BaseTools/Scripts/ConvertUni.py = | 14 +- BaseTools/Scripts/DetectNotUsedItem.py = | 23 +- BaseTools/Scripts/FormatDosFiles.py = | 25 +- BaseTools/Scripts/GetMaintainer.py = | 19 +- BaseTools/Scripts/GetUtcDateTime.py = | 18 +- BaseTools/Scripts/MemoryProfileSymbolGen.py = | 162 +- BaseTools/Scripts/PackageDocumentTools/__init__.py = | 2 +- BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py = | 138 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__init__.py = | 2 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/__init= __.py | 2 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/doxyge= n.py | 79 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/efibin= ary.py | 96 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/ini.py= | 92 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/inidoc= view.py | 3 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/messag= e.py | 12 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/__init__.py= | 2 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/__ini= t__.py | 2 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/baseo= bject.py | 165 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dec.p= y | 41 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxyg= engen.py | 374 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/doxyg= engen_spec.py | 372 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/dsc.p= y | 25 +- BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/inf.p= y | 59 +- BaseTools/Scripts/PackageDocumentTools/plugins/__init__.py = | 2 +- BaseTools/Scripts/PatchCheck.py = | 90 +- BaseTools/Scripts/RunMakefile.py = | 258 +- BaseTools/Scripts/SetupGit.py = | 23 +- BaseTools/Scripts/SmiHandlerProfileSymbolGen.py = | 165 +- BaseTools/Scripts/UpdateBuildVersions.py = | 64 +- BaseTools/Scripts/efi_debugging.py = | 4 +- BaseTools/Scripts/efi_gdb.py = | 1 + BaseTools/Source/C/Makefiles/NmakeSubdirs.py = | 43 +- BaseTools/Source/C/PyEfiCompressor/setup.py = | 16 +- BaseTools/Source/Python/AmlToC/AmlToC.py = | 29 +- BaseTools/Source/Python/AutoGen/AutoGen.py = | 58 +- BaseTools/Source/Python/AutoGen/AutoGenWorker.py = | 145 +- BaseTools/Source/Python/AutoGen/BuildEngine.py = | 158 +- BaseTools/Source/Python/AutoGen/DataPipe.py = | 152 +- BaseTools/Source/Python/AutoGen/GenC.py = | 944 ++- BaseTools/Source/Python/AutoGen/GenDepex.py = | 211 +- BaseTools/Source/Python/AutoGen/GenMake.py = | 738 +- BaseTools/Source/Python/AutoGen/GenPcdDb.py = | 533 +- BaseTools/Source/Python/AutoGen/GenVar.py = | 182 +- BaseTools/Source/Python/AutoGen/IdfClassObject.py = | 97 +- BaseTools/Source/Python/AutoGen/IncludesAutoGen.py = | 109 +- BaseTools/Source/Python/AutoGen/InfSectionParser.py = | 47 +- BaseTools/Source/Python/AutoGen/ModuleAutoGen.py = | 945 ++- BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py = | 255 +- BaseTools/Source/Python/AutoGen/PlatformAutoGen.py = | 554 +- BaseTools/Source/Python/AutoGen/StrGather.py = | 221 +- BaseTools/Source/Python/AutoGen/UniClassObject.py = | 261 +- BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py = | 23 +- BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py = | 405 +- BaseTools/Source/Python/AutoGen/__init__.py = | 2 +- BaseTools/Source/Python/BPDG/BPDG.py = | 37 +- BaseTools/Source/Python/BPDG/GenVpd.py = | 348 +- BaseTools/Source/Python/BPDG/StringTable.py = | 47 +- BaseTools/Source/Python/BPDG/__init__.py = | 2 +- BaseTools/Source/Python/Capsule/GenerateCapsule.py = | 1329 ++-- BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py = | 119 +- BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py = | 83 +- BaseTools/Source/Python/Common/BuildToolError.py = | 109 +- BaseTools/Source/Python/Common/BuildVersion.py = | 2 +- BaseTools/Source/Python/Common/DataType.py = | 187 +- BaseTools/Source/Python/Common/Edk2/Capsule/FmpPayloadHeader.py = | 84 +- BaseTools/Source/Python/Common/Edk2/Capsule/__init__.py = | 2 +- BaseTools/Source/Python/Common/Edk2/__init__.py = | 2 +- BaseTools/Source/Python/Common/EdkLogger.py = | 112 +- BaseTools/Source/Python/Common/Expression.py = | 243 +- BaseTools/Source/Python/Common/GlobalData.py = | 24 +- BaseTools/Source/Python/Common/LongFilePathOs.py = | 31 +- BaseTools/Source/Python/Common/LongFilePathOsPath.py = | 10 +- BaseTools/Source/Python/Common/LongFilePathSupport.py = | 11 +- BaseTools/Source/Python/Common/Misc.py = | 479 +- BaseTools/Source/Python/Common/MultipleWorkspace.py = | 32 +- BaseTools/Source/Python/Common/Parsing.py = | 332 +- BaseTools/Source/Python/Common/RangeExpression.py = | 89 +- BaseTools/Source/Python/Common/StringUtils.py = | 194 +- BaseTools/Source/Python/Common/TargetTxtClassObject.py = | 73 +- BaseTools/Source/Python/Common/ToolDefClassObject.py = | 89 +- BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py = | 394 +- BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py = | 117 +- BaseTools/Source/Python/Common/Uefi/Capsule/FmpCapsuleHeader.py = | 286 +- BaseTools/Source/Python/Common/Uefi/Capsule/UefiCapsuleHeader.py = | 110 +- BaseTools/Source/Python/Common/Uefi/Capsule/__init__.py = | 2 +- BaseTools/Source/Python/Common/Uefi/__init__.py = | 2 +- BaseTools/Source/Python/Common/VariableAttributes.py = | 14 +- BaseTools/Source/Python/Common/VpdInfoFile.py = | 96 +- BaseTools/Source/Python/Common/__init__.py = | 2 +- BaseTools/Source/Python/Common/caching.py = | 29 +- BaseTools/Source/Python/CommonDataClass/CommonClass.py = | 29 +- BaseTools/Source/Python/CommonDataClass/DataClass.py = | 88 +- BaseTools/Source/Python/CommonDataClass/Exceptions.py = | 12 +- BaseTools/Source/Python/CommonDataClass/FdfClass.py = | 129 +- BaseTools/Source/Python/CommonDataClass/__init__.py = | 2 +- BaseTools/Source/Python/Ecc/CParser3/CLexer.py = | 1908 ++--- BaseTools/Source/Python/Ecc/CParser3/CParser.py = | 7876 +++++++++----------- BaseTools/Source/Python/Ecc/CParser4/CLexer.py = | 140 +- BaseTools/Source/Python/Ecc/CParser4/CListener.py = | 359 +- BaseTools/Source/Python/Ecc/CParser4/CParser.py = | 2451 +++--- BaseTools/Source/Python/Ecc/Check.py = | 404 +- BaseTools/Source/Python/Ecc/CodeFragment.py = | 68 +- BaseTools/Source/Python/Ecc/CodeFragmentCollector.py = | 151 +- BaseTools/Source/Python/Ecc/Configuration.py = | 245 +- BaseTools/Source/Python/Ecc/Database.py = | 111 +- BaseTools/Source/Python/Ecc/EccGlobalData.py = | 2 +- BaseTools/Source/Python/Ecc/EccMain.py = | 144 +- BaseTools/Source/Python/Ecc/EccToolError.py = | 177 +- BaseTools/Source/Python/Ecc/Exception.py = | 16 +- BaseTools/Source/Python/Ecc/FileProfile.py = | 10 +- BaseTools/Source/Python/Ecc/MetaDataParser.py = | 62 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py = | 43 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py = | 827 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py = | 181 +- BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py = | 2 +- BaseTools/Source/Python/Ecc/ParserWarning.py = | 8 +- BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py = | 39 +- BaseTools/Source/Python/Ecc/Xml/__init__.py = | 2 +- BaseTools/Source/Python/Ecc/__init__.py = | 2 +- BaseTools/Source/Python/Ecc/c.py = | 512 +- BaseTools/Source/Python/Eot/CParser3/CLexer.py = | 1908 ++--- BaseTools/Source/Python/Eot/CParser3/CParser.py = | 7876 +++++++++----------- BaseTools/Source/Python/Eot/CParser4/CLexer.py = | 139 +- BaseTools/Source/Python/Eot/CParser4/CListener.py = | 358 +- BaseTools/Source/Python/Eot/CParser4/CParser.py = | 2451 +++--- BaseTools/Source/Python/Eot/CodeFragment.py = | 78 +- BaseTools/Source/Python/Eot/CodeFragmentCollector.py = | 119 +- BaseTools/Source/Python/Eot/Database.py = | 77 +- BaseTools/Source/Python/Eot/EotGlobalData.py = | 5 +- BaseTools/Source/Python/Eot/EotMain.py = | 544 +- BaseTools/Source/Python/Eot/EotToolError.py = | 7 +- BaseTools/Source/Python/Eot/FileProfile.py = | 10 +- BaseTools/Source/Python/Eot/Identification.py = | 11 +- BaseTools/Source/Python/Eot/InfParserLite.py = | 52 +- BaseTools/Source/Python/Eot/Parser.py = | 244 +- BaseTools/Source/Python/Eot/ParserWarning.py = | 6 +- BaseTools/Source/Python/Eot/Report.py = | 63 +- BaseTools/Source/Python/Eot/__init__.py = | 2 +- BaseTools/Source/Python/Eot/c.py = | 100 +- BaseTools/Source/Python/FMMT/FMMT.py = | 57 +- BaseTools/Source/Python/FMMT/__init__.py = | 4 +- BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py = | 151 +- BaseTools/Source/Python/FMMT/core/BiosTree.py = | 47 +- BaseTools/Source/Python/FMMT/core/BiosTreeNode.py = | 77 +- BaseTools/Source/Python/FMMT/core/FMMTOperation.py = | 40 +- BaseTools/Source/Python/FMMT/core/FMMTParser.py = | 30 +- BaseTools/Source/Python/FMMT/core/FvHandler.py = | 201 +- BaseTools/Source/Python/FMMT/core/GuidTools.py = | 47 +- BaseTools/Source/Python/FMMT/utils/FmmtLogger.py = | 10 +- BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py = | 29 +- BaseTools/Source/Python/FirmwareStorageFormat/Common.py = | 20 +- BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py = | 5 +- BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py = | 31 +- BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py = | 9 +- BaseTools/Source/Python/FirmwareStorageFormat/__init__.py = | 4 +- BaseTools/Source/Python/GenFds/AprioriSection.py = | 48 +- BaseTools/Source/Python/GenFds/Capsule.py = | 103 +- BaseTools/Source/Python/GenFds/CapsuleData.py = | 111 +- BaseTools/Source/Python/GenFds/CompressSection.py = | 42 +- BaseTools/Source/Python/GenFds/DataSection.py = | 63 +- BaseTools/Source/Python/GenFds/DepexSection.py = | 40 +- BaseTools/Source/Python/GenFds/EfiSection.py = | 167 +- BaseTools/Source/Python/GenFds/Fd.py = | 80 +- BaseTools/Source/Python/GenFds/FdfParser.py = | 1680 +++-- BaseTools/Source/Python/GenFds/Ffs.py = | 58 +- BaseTools/Source/Python/GenFds/FfsFileStatement.py = | 67 +- BaseTools/Source/Python/GenFds/FfsInfStatement.py = | 572 +- BaseTools/Source/Python/GenFds/Fv.py = | 240 +- BaseTools/Source/Python/GenFds/FvImageSection.py = | 77 +- BaseTools/Source/Python/GenFds/GenFds.py = | 353 +- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py = | 355 +- BaseTools/Source/Python/GenFds/GuidSection.py = | 90 +- BaseTools/Source/Python/GenFds/OptRomFileStatement.py = | 16 +- BaseTools/Source/Python/GenFds/OptRomInfStatement.py = | 56 +- BaseTools/Source/Python/GenFds/OptionRom.py = | 46 +- BaseTools/Source/Python/GenFds/Region.py = | 113 +- BaseTools/Source/Python/GenFds/Rule.py = | 8 +- BaseTools/Source/Python/GenFds/RuleComplexFile.py = | 12 +- BaseTools/Source/Python/GenFds/RuleSimpleFile.py = | 10 +- BaseTools/Source/Python/GenFds/Section.py = | 121 +- BaseTools/Source/Python/GenFds/UiSection.py = | 23 +- BaseTools/Source/Python/GenFds/VerSection.py = | 15 +- BaseTools/Source/Python/GenFds/__init__.py = | 2 +- BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py = | 61 +- BaseTools/Source/Python/GenPatchPcdTable/__init__.py = | 2 +- BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py = | 49 +- BaseTools/Source/Python/PatchPcdValue/__init__.py = | 2 +- BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py = | 408 +- BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py = | 259 +- BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py = | 350 +- BaseTools/Source/Python/Split/Split.py = | 17 +- BaseTools/Source/Python/Table/Table.py = | 25 +- BaseTools/Source/Python/Table/TableDataModel.py = | 17 +- BaseTools/Source/Python/Table/TableDec.py = | 15 +- BaseTools/Source/Python/Table/TableDsc.py = | 15 +- BaseTools/Source/Python/Table/TableEotReport.py = | 19 +- BaseTools/Source/Python/Table/TableFdf.py = | 15 +- BaseTools/Source/Python/Table/TableFile.py = | 26 +- BaseTools/Source/Python/Table/TableFunction.py = | 15 +- BaseTools/Source/Python/Table/TableIdentifier.py = | 15 +- BaseTools/Source/Python/Table/TableInf.py = | 15 +- BaseTools/Source/Python/Table/TablePcd.py = | 15 +- BaseTools/Source/Python/Table/TableQuery.py = | 12 +- BaseTools/Source/Python/Table/TableReport.py = | 37 +- BaseTools/Source/Python/Table/__init__.py = | 2 +- BaseTools/Source/Python/TargetTool/TargetTool.py = | 107 +- BaseTools/Source/Python/TargetTool/__init__.py = | 2 +- BaseTools/Source/Python/Trim/Trim.py = | 224 +- BaseTools/Source/Python/UPT/BuildVersion.py = | 2 +- BaseTools/Source/Python/UPT/Core/DependencyRules.py = | 82 +- BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py = | 78 +- BaseTools/Source/Python/UPT/Core/FileHook.py = | 50 +- BaseTools/Source/Python/UPT/Core/IpiDb.py = | 230 +- BaseTools/Source/Python/UPT/Core/PackageFile.py = | 61 +- BaseTools/Source/Python/UPT/Core/__init__.py = | 2 +- BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py = | 149 +- BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py = | 181 +- BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py = | 40 +- BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py = | 2 +- BaseTools/Source/Python/UPT/GenMetaFile/__init__.py = | 2 +- BaseTools/Source/Python/UPT/InstallPkg.py = | 295 +- BaseTools/Source/Python/UPT/InventoryWs.py = | 45 +- BaseTools/Source/Python/UPT/Library/CommentGenerating.py = | 88 +- BaseTools/Source/Python/UPT/Library/CommentParsing.py = | 177 +- BaseTools/Source/Python/UPT/Library/DataType.py = | 379 +- BaseTools/Source/Python/UPT/Library/ExpressionValidate.py = | 147 +- BaseTools/Source/Python/UPT/Library/GlobalData.py = | 2 +- BaseTools/Source/Python/UPT/Library/Misc.py = | 227 +- BaseTools/Source/Python/UPT/Library/ParserValidate.py = | 130 +- BaseTools/Source/Python/UPT/Library/Parsing.py = | 363 +- BaseTools/Source/Python/UPT/Library/StringUtils.py = | 203 +- BaseTools/Source/Python/UPT/Library/UniClassObject.py = | 447 +- BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py = | 37 +- BaseTools/Source/Python/UPT/Library/Xml/__init__.py = | 2 +- BaseTools/Source/Python/UPT/Library/__init__.py = | 2 +- BaseTools/Source/Python/UPT/Logger/Log.py = | 97 +- BaseTools/Source/Python/UPT/Logger/StringTable.py = | 933 +-- BaseTools/Source/Python/UPT/Logger/ToolError.py = | 117 +- BaseTools/Source/Python/UPT/Logger/__init__.py = | 2 +- BaseTools/Source/Python/UPT/MkPkg.py = | 73 +- BaseTools/Source/Python/UPT/Object/POM/CommonObject.py = | 93 +- BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py = | 35 +- BaseTools/Source/Python/UPT/Object/POM/PackageObject.py = | 13 +- BaseTools/Source/Python/UPT/Object/POM/__init__.py = | 2 +- BaseTools/Source/Python/UPT/Object/Parser/DecObject.py = | 186 +- BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py = | 138 +- BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py = | 15 +- BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py = | 46 +- BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py = | 36 +- BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py = | 334 +- BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py = | 21 +- BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py = | 51 +- BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py = | 34 +- BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py = | 35 +- BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py = | 23 +- BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py = | 35 +- BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py = | 116 +- BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py = | 46 +- BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py = | 42 +- BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py = | 66 +- BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py = | 24 +- BaseTools/Source/Python/UPT/Object/Parser/__init__.py = | 2 +- BaseTools/Source/Python/UPT/Object/__init__.py = | 2 +- BaseTools/Source/Python/UPT/Parser/DecParser.py = | 280 +- BaseTools/Source/Python/UPT/Parser/DecParserMisc.py = | 56 +- BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py = | 47 +- BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py = | 44 +- BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py = | 53 +- BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py = | 45 +- BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py = | 15 +- BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py = | 73 +- BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py = | 38 +- BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py = | 34 +- BaseTools/Source/Python/UPT/Parser/InfParser.py = | 164 +- BaseTools/Source/Python/UPT/Parser/InfParserMisc.py = | 122 +- BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py = | 45 +- BaseTools/Source/Python/UPT/Parser/InfSectionParser.py = | 94 +- BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py = | 39 +- BaseTools/Source/Python/UPT/Parser/__init__.py = | 2 +- BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py = | 236 +- BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py = | 183 +- BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py = | 35 +- BaseTools/Source/Python/UPT/PomAdapter/__init__.py = | 2 +- BaseTools/Source/Python/UPT/ReplacePkg.py = | 60 +- BaseTools/Source/Python/UPT/RmPkg.py = | 66 +- BaseTools/Source/Python/UPT/TestInstall.py = | 27 +- BaseTools/Source/Python/UPT/UPT.py = | 150 +- BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py = | 86 +- BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py = | 91 +- BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py = | 23 +- BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py = | 118 +- BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py = | 131 +- BaseTools/Source/Python/UPT/Xml/CommonXml.py = | 265 +- BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py = | 139 +- BaseTools/Source/Python/UPT/Xml/IniToXml.py = | 152 +- BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py = | 143 +- BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py = | 87 +- BaseTools/Source/Python/UPT/Xml/PcdXml.py = | 141 +- BaseTools/Source/Python/UPT/Xml/XmlParser.py = | 363 +- BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py = | 22 +- BaseTools/Source/Python/UPT/Xml/__init__.py = | 2 +- BaseTools/Source/Python/Workspace/BuildClassObject.py = | 303 +- BaseTools/Source/Python/Workspace/DecBuildData.py = | 184 +- BaseTools/Source/Python/Workspace/DscBuildData.py = | 2007 +++-- BaseTools/Source/Python/Workspace/InfBuildData.py = | 426 +- BaseTools/Source/Python/Workspace/MetaDataTable.py = | 98 +- BaseTools/Source/Python/Workspace/MetaFileCommentParser.py = | 21 +- BaseTools/Source/Python/Workspace/MetaFileParser.py = | 885 ++- BaseTools/Source/Python/Workspace/MetaFileTable.py = | 217 +- BaseTools/Source/Python/Workspace/WorkspaceCommon.py = | 60 +- BaseTools/Source/Python/Workspace/WorkspaceDatabase.py = | 67 +- BaseTools/Source/Python/Workspace/__init__.py = | 2 +- BaseTools/Source/Python/build/BuildReport.py = | 766 +- BaseTools/Source/Python/build/__init__.py = | 2 +- BaseTools/Source/Python/build/build.py = | 1145 +-- BaseTools/Source/Python/build/buildoptions.py = | 113 +- BaseTools/Source/Python/sitecustomize.py = | 11 +- BaseTools/Source/Python/tests/Split/test_split.py = | 37 +- BaseTools/Tests/CToolsTests.py = | 6 +- BaseTools/Tests/CheckPythonSyntax.py = | 15 +- BaseTools/Tests/CheckUnicodeSourceFiles.py = | 4 +- BaseTools/Tests/PythonTest.py = | 2 +- BaseTools/Tests/PythonToolsTests.py = | 4 +- BaseTools/Tests/RunTests.py = | 7 +- BaseTools/Tests/TestRegularExpression.py = | 7 +- BaseTools/Tests/TestTools.py = | 54 +- BaseTools/Tests/TianoCompress.py = | 15 +- 335 files changed, 35765 insertions(+), 32705 deletions(-) diff --git a/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py b/BaseTools/= Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py index 3035732d5c81..cd0577e22c0e 100755 --- a/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py +++ b/BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.py @@ -26,22 +26,27 @@ import pipes # Convert using cygpath command line tool=0D # Currently not used, but just in case we need it in the future=0D #=0D +=0D +=0D def ConvertCygPathToDosViacygpath(CygPath):=0D - p =3D subprocess.Popen("cygpath -m " + pipes.quote(CygPath), shell=3DTru= e, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT, close_fds=3DTrue)= =0D - return p.stdout.read().strip()=0D + p =3D subprocess.Popen("cygpath -m " + pipes.quote(CygPath), shell=3DT= rue,=0D + stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STD= OUT, close_fds=3DTrue)=0D + return p.stdout.read().strip()=0D =0D #=0D #=0D #=0D +=0D +=0D def ConvertCygPathToDos(CygPath):=0D - if CygPath.find("/cygdrive/") =3D=3D 0:=0D - # convert /cygdrive/c/Xyz to c:/Xyz=0D - DosPath =3D CygPath[10] + ':' + CygPath[11:]=0D - else:=0D - DosPath =3D CygPath=0D + if CygPath.find("/cygdrive/") =3D=3D 0:=0D + # convert /cygdrive/c/Xyz to c:/Xyz=0D + DosPath =3D CygPath[10] + ':' + CygPath[11:]=0D + else:=0D + DosPath =3D CygPath=0D =0D - # pipes.quote will add the extra \\ for us.=0D - return DosPath.replace('/', '\\')=0D + # pipes.quote will add the extra \\ for us.=0D + return DosPath.replace('/', '\\')=0D =0D =0D # we receive our options as a list, but we will be passing them to the she= ll as a line=0D @@ -50,38 +55,37 @@ def ConvertCygPathToDos(CygPath): # if you don't use the shell you don't get a PATH search.=0D def main(argv):=0D =0D - # use 1st argument as name of tool to call=0D - Command =3D pipes.quote(sys.argv[1]);=0D + # use 1st argument as name of tool to call=0D + Command =3D pipes.quote(sys.argv[1])=0D =0D - ExceptionList =3D ["/interwork"]=0D + ExceptionList =3D ["/interwork"]=0D =0D - for arg in argv:=0D - if arg.find('/') =3D=3D -1:=0D - # if we don't need to convert just add to the command line=0D - Command =3D Command + ' ' + pipes.quote(arg)=0D - elif arg in ExceptionList:=0D - # if it is in the list, then don't do a cygpath=0D - # assembler stuff after --apcs has the /.=0D - Command =3D Command + ' ' + pipes.quote(arg)=0D - else:=0D - if ((arg[0] =3D=3D '-') and (arg[1] =3D=3D 'I' or arg[1] =3D=3D 'i')= ):=0D - CygPath =3D arg[0] + arg[1] + ConvertCygPathToDos(arg[2:])=0D - else:=0D - CygPath =3D ConvertCygPathToDos(arg)=0D + for arg in argv:=0D + if arg.find('/') =3D=3D -1:=0D + # if we don't need to convert just add to the command line=0D + Command =3D Command + ' ' + pipes.quote(arg)=0D + elif arg in ExceptionList:=0D + # if it is in the list, then don't do a cygpath=0D + # assembler stuff after --apcs has the /.=0D + Command =3D Command + ' ' + pipes.quote(arg)=0D + else:=0D + if ((arg[0] =3D=3D '-') and (arg[1] =3D=3D 'I' or arg[1] =3D= =3D 'i')):=0D + CygPath =3D arg[0] + arg[1] + ConvertCygPathToDos(arg[2:])= =0D + else:=0D + CygPath =3D ConvertCygPathToDos(arg)=0D =0D - Command =3D Command + ' ' + pipes.quote(CygPath)=0D + Command =3D Command + ' ' + pipes.quote(CygPath)=0D =0D - # call the real tool with the converted paths=0D - return subprocess.call(Command, shell=3DTrue)=0D + # call the real tool with the converted paths=0D + return subprocess.call(Command, shell=3DTrue)=0D =0D =0D if __name__ =3D=3D "__main__":=0D - try:=0D - ret =3D main(sys.argv[2:])=0D + try:=0D + ret =3D main(sys.argv[2:])=0D =0D - except:=0D - print("exiting: exception from " + sys.argv[0])=0D - ret =3D 2=0D -=0D - sys.exit(ret)=0D + except:=0D + print("exiting: exception from " + sys.argv[0])=0D + ret =3D 2=0D =0D + sys.exit(ret)=0D diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py index f862468ce275..f719924c2c0e 100644 --- a/BaseTools/Edk2ToolsBuild.py +++ b/BaseTools/Edk2ToolsBuild.py @@ -143,7 +143,8 @@ class Edk2ToolsBuild(BaseAbstractInvocable): =0D elif self.tool_chain_tag.lower().startswith("gcc"):=0D cpu_count =3D self.GetCpuThreads()=0D - ret =3D RunCmd("make", f"-C . -j {cpu_count}", workingdir=3Ds= hell_env.get_shell_var("EDK_TOOLS_PATH"))=0D + ret =3D RunCmd(=0D + "make", f"-C . -j {cpu_count}", workingdir=3Dshell_env.ge= t_shell_var("EDK_TOOLS_PATH"))=0D if ret !=3D 0:=0D raise Exception("Failed to build.")=0D =0D @@ -168,7 +169,6 @@ class Edk2ToolsBuild(BaseAbstractInvocable): return cpus=0D =0D =0D -=0D def main():=0D Edk2ToolsBuild().Invoke()=0D =0D diff --git a/BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py= b/BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py index 9f86b1c35885..5c826a9e7104 100644 --- a/BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py +++ b/BaseTools/Plugin/BuildToolsReport/BuildToolsReportGenerator.py @@ -14,16 +14,19 @@ try: try:=0D from edk2toolext.environment import version_aggregator=0D except ImportError:=0D - logging.critical("Loading BuildToolsReportGenerator failed= , please update your Edk2-PyTool-Extensions")=0D + logging.critical(=0D + "Loading BuildToolsReportGenerator failed, please upda= te your Edk2-PyTool-Extensions")=0D return 0=0D =0D - OutputReport =3D os.path.join(thebuilder.env.GetValue("BUILD_O= UTPUT_BASE"), "BUILD_TOOLS_REPORT")=0D + OutputReport =3D os.path.join(thebuilder.env.GetValue(=0D + "BUILD_OUTPUT_BASE"), "BUILD_TOOLS_REPORT")=0D OutputReport =3D os.path.normpath(OutputReport)=0D if not os.path.isdir(os.path.dirname(OutputReport)):=0D os.makedirs(os.path.dirname(OutputReport))=0D =0D Report =3D BuildToolsReport()=0D - Report.MakeReport(version_aggregator.GetVersionAggregator().Ge= tAggregatedVersionInformation(), OutputReport=3DOutputReport)=0D + Report.MakeReport(version_aggregator.GetVersionAggregator(=0D + ).GetAggregatedVersionInformation(), OutputReport=3DOutputRepo= rt)=0D =0D def do_pre_build(self, thebuilder):=0D self.do_report(thebuilder)=0D @@ -55,11 +58,13 @@ class BuildToolsReport(object): =0D htmlfile =3D open(OutputReport + ".html", "w")=0D jsonfile =3D open(OutputReport + ".json", "w")=0D - template =3D open(os.path.join(BuildToolsReport.MY_FOLDER, "BuildT= oolsReport_Template.html"), "r")=0D + template =3D open(os.path.join(BuildToolsReport.MY_FOLDER,=0D + "BuildToolsReport_Template.html"), "r")=0D =0D for line in template.readlines():=0D if "%TO_BE_FILLED_IN_BY_PYTHON_SCRIPT%" in line:=0D - line =3D line.replace("%TO_BE_FILLED_IN_BY_PYTHON_SCRIPT%"= , json.dumps(json_dict))=0D + line =3D line.replace(=0D + "%TO_BE_FILLED_IN_BY_PYTHON_SCRIPT%", json.dumps(json_= dict))=0D htmlfile.write(line)=0D =0D jsonfile.write(json.dumps(versions_list, indent=3D4))=0D diff --git a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py b/Ba= seTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py index f0685d804029..8d5b0e0d3fba 100644 --- a/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py +++ b/BaseTools/Plugin/LinuxGcc5ToolChain/LinuxGcc5ToolChain.py @@ -57,7 +57,8 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): return 0=0D =0D # make GCC5_ARM_PREFIX to align with tools_def.txt=0D - prefix =3D os.path.join(install_path, "bin", "arm-none-linux-g= nueabihf-")=0D + prefix =3D os.path.join(install_path, "bin",=0D + "arm-none-linux-gnueabihf-")=0D shell_environment.GetEnvironment().set_shell_var("GCC5_ARM_PRE= FIX", prefix)=0D =0D # now confirm it exists=0D @@ -80,7 +81,8 @@ class LinuxGcc5ToolChain(IUefiBuildPlugin): return 0=0D =0D # make GCC5_AARCH64_PREFIX to align with tools_def.txt=0D - prefix =3D os.path.join(install_path, "bin", "aarch64-none-lin= ux-gnu-")=0D + prefix =3D os.path.join(install_path, "bin",=0D + "aarch64-none-linux-gnu-")=0D shell_environment.GetEnvironment().set_shell_var("GCC5_AARCH64= _PREFIX", prefix)=0D =0D # now confirm it exists=0D diff --git a/BaseTools/Plugin/WindowsResourceCompiler/WinRcPath.py b/BaseTo= ols/Plugin/WindowsResourceCompiler/WinRcPath.py index ec2f2d1298f9..f6da2312f4bd 100644 --- a/BaseTools/Plugin/WindowsResourceCompiler/WinRcPath.py +++ b/BaseTools/Plugin/WindowsResourceCompiler/WinRcPath.py @@ -1,4 +1,4 @@ -## @file WinRcPath.py=0D +# @file WinRcPath.py=0D # Plugin to find Windows SDK Resource Compiler rc.exe=0D ##=0D # This plugin works in conjuncture with the tools_def to support rc.exe=0D @@ -12,18 +12,20 @@ import edk2toollib.windows.locate_tools as locate_tools from edk2toolext.environment import shell_environment=0D from edk2toolext.environment import version_aggregator=0D =0D +=0D class WinRcPath(IUefiBuildPlugin):=0D =0D def do_post_build(self, thebuilder):=0D return 0=0D =0D def do_pre_build(self, thebuilder):=0D - #get the locate tools module=0D + # get the locate tools module=0D path =3D locate_tools.FindToolInWinSdk("rc.exe")=0D if path is None:=0D thebuilder.logging.warning("Failed to find rc.exe")=0D else:=0D p =3D os.path.abspath(os.path.dirname(path))=0D shell_environment.GetEnvironment().set_shell_var("WINSDK_PATH_= FOR_RC_EXE", p)=0D - version_aggregator.GetVersionAggregator().ReportVersion("WINSD= K_PATH_FOR_RC_EXE", p, version_aggregator.VersionTypes.INFO)=0D + version_aggregator.GetVersionAggregator().ReportVersion(=0D + "WINSDK_PATH_FOR_RC_EXE", p, version_aggregator.VersionTyp= es.INFO)=0D return 0=0D diff --git a/BaseTools/Scripts/BinToPcd.py b/BaseTools/Scripts/BinToPcd.py index 3bc557b8412c..0e82a349d26d 100644 --- a/BaseTools/Scripts/BinToPcd.py +++ b/BaseTools/Scripts/BinToPcd.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Convert a binary file to a VOID* PCD value or DSC file VOID* PCD stateme= nt.=0D #=0D # Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
=0D @@ -18,89 +18,93 @@ import xdrlib #=0D # Globals for help information=0D #=0D -__prog__ =3D 'BinToPcd'=0D -__copyright__ =3D 'Copyright (c) 2016 - 2018, Intel Corporation. All rig= hts reserved.'=0D +__prog__ =3D 'BinToPcd'=0D +__copyright__ =3D 'Copyright (c) 2016 - 2018, Intel Corporation. All right= s reserved.'=0D __description__ =3D 'Convert one or more binary files to a VOID* PCD value= or DSC file VOID* PCD statement.\n'=0D =0D if __name__ =3D=3D '__main__':=0D - def ValidateUnsignedInteger (Argument):=0D + def ValidateUnsignedInteger(Argument):=0D try:=0D - Value =3D int (Argument, 0)=0D + Value =3D int(Argument, 0)=0D except:=0D - Message =3D '{Argument} is not a valid integer value.'.format = (Argument =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + Message =3D '{Argument} is not a valid integer value.'.format(= =0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D if Value < 0:=0D - Message =3D '{Argument} is a negative value.'.format (Argument= =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + Message =3D '{Argument} is a negative value.'.format(=0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D return Value=0D =0D - def ValidatePcdName (Argument):=0D - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*',= Argument) !=3D ['', '']:=0D - Message =3D '{Argument} is not in the form .'.format (Argument =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + def ValidatePcdName(Argument):=0D + if re.split('[a-zA-Z\_][a-zA-Z0-9\_]*\.[a-zA-Z\_][a-zA-Z0-9\_]*', = Argument) !=3D ['', '']:=0D + Message =3D '{Argument} is not in the form .'.format(=0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D return Argument=0D =0D - def ValidateGuidName (Argument):=0D - if re.split ('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) !=3D ['', '']:= =0D - Message =3D '{Argument} is not a valid GUID C name'.format (Ar= gument =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + def ValidateGuidName(Argument):=0D + if re.split('[a-zA-Z\_][a-zA-Z0-9\_]*', Argument) !=3D ['', '']:=0D + Message =3D '{Argument} is not a valid GUID C name'.format(=0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D return Argument=0D =0D - def ByteArray (Buffer, Xdr =3D False):=0D + def ByteArray(Buffer, Xdr=3DFalse):=0D if Xdr:=0D #=0D # If Xdr flag is set then encode data using the Variable-Lengt= h Opaque=0D # Data format of RFC 4506 External Data Representation Standar= d (XDR).=0D #=0D - XdrEncoder =3D xdrlib.Packer ()=0D + XdrEncoder =3D xdrlib.Packer()=0D for Item in Buffer:=0D - XdrEncoder.pack_bytes (Item)=0D - Buffer =3D bytearray (XdrEncoder.get_buffer ())=0D + XdrEncoder.pack_bytes(Item)=0D + Buffer =3D bytearray(XdrEncoder.get_buffer())=0D else:=0D #=0D # If Xdr flag is not set, then concatenate all the data=0D #=0D - Buffer =3D bytearray (b''.join (Buffer))=0D + Buffer =3D bytearray(b''.join(Buffer))=0D #=0D # Return a PCD value of the form '{0x01, 0x02, ...}' along with th= e PCD length in bytes=0D #=0D - return '{' + (', '.join (['0x{Byte:02X}'.format (Byte =3D Item) fo= r Item in Buffer])) + '}', len (Buffer)=0D + return '{' + (', '.join(['0x{Byte:02X}'.format(Byte=3DItem) for It= em in Buffer])) + '}', len(Buffer)=0D =0D #=0D # Create command line argument parser object=0D #=0D - parser =3D argparse.ArgumentParser (prog =3D __prog__,=0D - description =3D __description__ + __= copyright__,=0D - conflict_handler =3D 'resolve')=0D - parser.add_argument ("-i", "--input", dest =3D 'InputFile', type =3D a= rgparse.FileType ('rb'), action=3D'append', required =3D True,=0D - help =3D "Input binary filename. Multiple input = files are combined into a single PCD.")=0D - parser.add_argument ("-o", "--output", dest =3D 'OutputFile', type =3D= argparse.FileType ('w'),=0D - help =3D "Output filename for PCD value or PCD st= atement")=0D - parser.add_argument ("-p", "--pcd", dest =3D 'PcdName', type =3D Valid= atePcdName,=0D - help =3D "Name of the PCD in the form .")=0D - parser.add_argument ("-t", "--type", dest =3D 'PcdType', default =3D N= one, choices =3D ['VPD', 'HII'],=0D - help =3D "PCD statement type (HII or VPD). Defau= lt is standard.")=0D - parser.add_argument ("-m", "--max-size", dest =3D 'MaxSize', type =3D = ValidateUnsignedInteger,=0D - help =3D "Maximum size of the PCD. Ignored with = --type HII.")=0D - parser.add_argument ("-f", "--offset", dest =3D 'Offset', type =3D Val= idateUnsignedInteger,=0D - help =3D "VPD offset if --type is VPD. UEFI Vari= able offset if --type is HII. Must be 8-byte aligned.")=0D - parser.add_argument ("-n", "--variable-name", dest =3D 'VariableName',= =0D - help =3D "UEFI variable name. Only used with --t= ype HII.")=0D - parser.add_argument ("-g", "--variable-guid", type =3D ValidateGuidNam= e, dest =3D 'VariableGuid',=0D - help =3D "UEFI variable GUID C name. Only used w= ith --type HII.")=0D - parser.add_argument ("-x", "--xdr", dest =3D 'Xdr', action =3D "store_= true",=0D - help =3D "Encode PCD using the Variable-Length Op= aque Data format of RFC 4506 External Data Representation Standard (XDR)")= =0D - parser.add_argument ("-v", "--verbose", dest =3D 'Verbose', action =3D= "store_true",=0D - help =3D "Increase output messages")=0D - parser.add_argument ("-q", "--quiet", dest =3D 'Quiet', action =3D "st= ore_true",=0D - help =3D "Reduce output messages")=0D - parser.add_argument ("--debug", dest =3D 'Debug', type =3D int, metava= r =3D '[0-9]', choices =3D range (0, 10), default =3D 0,=0D - help =3D "Set debug level")=0D + parser =3D argparse.ArgumentParser(prog=3D__prog__,=0D + description=3D__description__ + __cop= yright__,=0D + conflict_handler=3D'resolve')=0D + parser.add_argument("-i", "--input", dest=3D'InputFile', type=3Dargpar= se.FileType('rb'), action=3D'append', required=3DTrue,=0D + help=3D"Input binary filename. Multiple input fil= es are combined into a single PCD.")=0D + parser.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dargp= arse.FileType('w'),=0D + help=3D"Output filename for PCD value or PCD state= ment")=0D + parser.add_argument("-p", "--pcd", dest=3D'PcdName', type=3DValidatePc= dName,=0D + help=3D"Name of the PCD in the form .")=0D + parser.add_argument("-t", "--type", dest=3D'PcdType', default=3DNone, = choices=3D['VPD', 'HII'],=0D + help=3D"PCD statement type (HII or VPD). Default = is standard.")=0D + parser.add_argument("-m", "--max-size", dest=3D'MaxSize', type=3DValid= ateUnsignedInteger,=0D + help=3D"Maximum size of the PCD. Ignored with --t= ype HII.")=0D + parser.add_argument("-f", "--offset", dest=3D'Offset', type=3DValidate= UnsignedInteger,=0D + help=3D"VPD offset if --type is VPD. UEFI Variabl= e offset if --type is HII. Must be 8-byte aligned.")=0D + parser.add_argument("-n", "--variable-name", dest=3D'VariableName',=0D + help=3D"UEFI variable name. Only used with --type= HII.")=0D + parser.add_argument("-g", "--variable-guid", type=3DValidateGuidName, = dest=3D'VariableGuid',=0D + help=3D"UEFI variable GUID C name. Only used with= --type HII.")=0D + parser.add_argument("-x", "--xdr", dest=3D'Xdr', action=3D"store_true"= ,=0D + help=3D"Encode PCD using the Variable-Length Opaqu= e Data format of RFC 4506 External Data Representation Standard (XDR)")=0D + parser.add_argument("-v", "--verbose", dest=3D'Verbose', action=3D"sto= re_true",=0D + help=3D"Increase output messages")=0D + parser.add_argument("-q", "--quiet", dest=3D'Quiet', action=3D"store_t= rue",=0D + help=3D"Reduce output messages")=0D + parser.add_argument("--debug", dest=3D'Debug', type=3Dint, metavar=3D'= [0-9]', choices=3Drange(0, 10), default=3D0,=0D + help=3D"Set debug level")=0D =0D #=0D # Parse command line arguments=0D #=0D - args =3D parser.parse_args ()=0D + args =3D parser.parse_args()=0D =0D #=0D # Read all binary input files=0D @@ -108,17 +112,18 @@ if __name__ =3D=3D '__main__': Buffer =3D []=0D for File in args.InputFile:=0D try:=0D - Buffer.append (File.read ())=0D - File.close ()=0D + Buffer.append(File.read())=0D + File.close()=0D except:=0D - print ('BinToPcd: error: can not read binary input file {File}= '.format (File =3D File))=0D - sys.exit (1)=0D + print(=0D + 'BinToPcd: error: can not read binary input file {File}'.f= ormat(File=3DFile))=0D + sys.exit(1)=0D =0D #=0D # Convert PCD to an encoded string of hex values and determine the siz= e of=0D # the encoded PCD in bytes.=0D #=0D - PcdValue, PcdSize =3D ByteArray (Buffer, args.Xdr)=0D + PcdValue, PcdSize =3D ByteArray(Buffer, args.Xdr)=0D =0D #=0D # Convert binary buffer to a DSC file PCD statement=0D @@ -129,7 +134,7 @@ if __name__ =3D=3D '__main__': #=0D Pcd =3D PcdValue=0D if args.Verbose:=0D - print ('BinToPcd: Convert binary file to PCD Value')=0D + print('BinToPcd: Convert binary file to PCD Value')=0D elif args.PcdType is None:=0D #=0D # If --type is neither VPD nor HII, then use PCD statement syntax = that is=0D @@ -141,19 +146,21 @@ if __name__ =3D=3D '__main__': # If --max-size is not provided, then do not generate the synt= ax that=0D # includes the maximum size.=0D #=0D - Pcd =3D ' {Name}|{Value}'.format (Name =3D args.PcdName, Valu= e =3D PcdValue)=0D + Pcd =3D ' {Name}|{Value}'.format(Name=3Dargs.PcdName, Value= =3DPcdValue)=0D elif args.MaxSize < PcdSize:=0D - print ('BinToPcd: error: argument --max-size is smaller than i= nput file.')=0D - sys.exit (1)=0D + print('BinToPcd: error: argument --max-size is smaller than in= put file.')=0D + sys.exit(1)=0D else:=0D - Pcd =3D ' {Name}|{Value}|VOID*|{Size}'.format (Name =3D args.= PcdName, Value =3D PcdValue, Size =3D args.MaxSize)=0D + Pcd =3D ' {Name}|{Value}|VOID*|{Size}'.format(=0D + Name=3Dargs.PcdName, Value=3DPcdValue, Size=3Dargs.MaxSize= )=0D =0D if args.Verbose:=0D - print ('BinToPcd: Convert binary file to PCD statement compati= ble with PCD sections:')=0D - print (' [PcdsFixedAtBuild]')=0D - print (' [PcdsPatchableInModule]')=0D - print (' [PcdsDynamicDefault]')=0D - print (' [PcdsDynamicExDefault]')=0D + print(=0D + 'BinToPcd: Convert binary file to PCD statement compatible= with PCD sections:')=0D + print(' [PcdsFixedAtBuild]')=0D + print(' [PcdsPatchableInModule]')=0D + print(' [PcdsDynamicDefault]')=0D + print(' [PcdsDynamicExDefault]')=0D elif args.PcdType =3D=3D 'VPD':=0D if args.MaxSize is None:=0D #=0D @@ -162,33 +169,37 @@ if __name__ =3D=3D '__main__': #=0D args.MaxSize =3D PcdSize=0D if args.MaxSize < PcdSize:=0D - print ('BinToPcd: error: argument --max-size is smaller than i= nput file.')=0D - sys.exit (1)=0D + print('BinToPcd: error: argument --max-size is smaller than in= put file.')=0D + sys.exit(1)=0D if args.Offset is None:=0D #=0D # if --offset is not provided, then set offset field to '*' so= build=0D # tools will compute offset of PCD in VPD region.=0D #=0D - Pcd =3D ' {Name}|*|{Size}|{Value}'.format (Name =3D args.PcdN= ame, Size =3D args.MaxSize, Value =3D PcdValue)=0D + Pcd =3D ' {Name}|*|{Size}|{Value}'.format(=0D + Name=3Dargs.PcdName, Size=3Dargs.MaxSize, Value=3DPcdValue= )=0D else:=0D #=0D # --offset value must be 8-byte aligned=0D #=0D if (args.Offset % 8) !=3D 0:=0D - print ('BinToPcd: error: argument --offset must be 8-byte = aligned.')=0D - sys.exit (1)=0D + print('BinToPcd: error: argument --offset must be 8-byte a= ligned.')=0D + sys.exit(1)=0D #=0D # Use the --offset value provided.=0D #=0D - Pcd =3D ' {Name}|{Offset}|{Size}|{Value}'.format (Name =3D ar= gs.PcdName, Offset =3D args.Offset, Size =3D args.MaxSize, Value =3D PcdVal= ue)=0D + Pcd =3D ' {Name}|{Offset}|{Size}|{Value}'.format(=0D + Name=3Dargs.PcdName, Offset=3Dargs.Offset, Size=3Dargs.Max= Size, Value=3DPcdValue)=0D if args.Verbose:=0D - print ('BinToPcd: Convert binary file to PCD statement compati= ble with PCD sections')=0D - print (' [PcdsDynamicVpd]')=0D - print (' [PcdsDynamicExVpd]')=0D + print(=0D + 'BinToPcd: Convert binary file to PCD statement compatible= with PCD sections')=0D + print(' [PcdsDynamicVpd]')=0D + print(' [PcdsDynamicExVpd]')=0D elif args.PcdType =3D=3D 'HII':=0D if args.VariableGuid is None or args.VariableName is None:=0D - print ('BinToPcd: error: arguments --variable-guid and --varia= ble-name are required for --type HII.')=0D - sys.exit (1)=0D + print(=0D + 'BinToPcd: error: arguments --variable-guid and --variable= -name are required for --type HII.')=0D + sys.exit(1)=0D if args.Offset is None:=0D #=0D # Use UEFI Variable offset of 0 if --offset is not provided=0D @@ -198,23 +209,25 @@ if __name__ =3D=3D '__main__': # --offset value must be 8-byte aligned=0D #=0D if (args.Offset % 8) !=3D 0:=0D - print ('BinToPcd: error: argument --offset must be 8-byte alig= ned.')=0D - sys.exit (1)=0D - Pcd =3D ' {Name}|L"{VarName}"|{VarGuid}|{Offset}|{Value}'.format = (Name =3D args.PcdName, VarName =3D args.VariableName, VarGuid =3D args.Var= iableGuid, Offset =3D args.Offset, Value =3D PcdValue)=0D + print('BinToPcd: error: argument --offset must be 8-byte align= ed.')=0D + sys.exit(1)=0D + Pcd =3D ' {Name}|L"{VarName}"|{VarGuid}|{Offset}|{Value}'.format(= =0D + Name=3Dargs.PcdName, VarName=3Dargs.VariableName, VarGuid=3Dar= gs.VariableGuid, Offset=3Dargs.Offset, Value=3DPcdValue)=0D if args.Verbose:=0D - print ('BinToPcd: Convert binary file to PCD statement compati= ble with PCD sections')=0D - print (' [PcdsDynamicHii]')=0D - print (' [PcdsDynamicExHii]')=0D + print(=0D + 'BinToPcd: Convert binary file to PCD statement compatible= with PCD sections')=0D + print(' [PcdsDynamicHii]')=0D + print(' [PcdsDynamicExHii]')=0D =0D #=0D # Write PCD value or PCD statement to the output file=0D #=0D try:=0D - args.OutputFile.write (Pcd)=0D - args.OutputFile.close ()=0D + args.OutputFile.write(Pcd)=0D + args.OutputFile.close()=0D except:=0D #=0D # If output file is not specified or it can not be written, then w= rite the=0D # PCD value or PCD statement to the console=0D #=0D - print (Pcd)=0D + print(Pcd)=0D diff --git a/BaseTools/Scripts/ConvertFceToStructurePcd.py b/BaseTools/Scri= pts/ConvertFceToStructurePcd.py index 9e7fe58768b1..066ddccbc245 100644 --- a/BaseTools/Scripts/ConvertFceToStructurePcd.py +++ b/BaseTools/Scripts/ConvertFceToStructurePcd.py @@ -1,5 +1,5 @@ #!/usr/bin/python=0D -## @file=0D +# @file=0D # Firmware Configuration Editor (FCE) from https://firmware.intel.com/deve= lop=0D # can parse BIOS image and generate Firmware Configuration file.=0D # This script bases on Firmware Configuration file, and generate the struc= ture=0D @@ -21,13 +21,13 @@ import argparse #=0D # Globals for help information=0D #=0D -__prog__ =3D 'ConvertFceToStructurePcd'=0D -__version__ =3D '%s Version %s' % (__prog__, '0.1 ')=0D -__copyright__ =3D 'Copyright (c) 2018, Intel Corporation. All rights res= erved.'=0D +__prog__ =3D 'ConvertFceToStructurePcd'=0D +__version__ =3D '%s Version %s' % (__prog__, '0.1 ')=0D +__copyright__ =3D 'Copyright (c) 2018, Intel Corporation. All rights reser= ved.'=0D __description__ =3D 'Generate Structure PCD in DEC/DSC/INF based on Firmwa= re Configuration.\n'=0D =0D =0D -dscstatement=3D'''[Defines]=0D +dscstatement =3D '''[Defines]=0D VPD_TOOL_GUID =3D 8C3D856A-9BE6-468E-850A-24F7A8D38E08= =0D =0D [SkuIds]=0D @@ -50,693 +50,747 @@ decstatement =3D '''[Guids] infstatement =3D '''[Pcd]=0D '''=0D =0D -SECTION=3D'PcdsDynamicHii'=0D -PCD_NAME=3D'gStructPcdTokenSpaceGuid.Pcd'=0D +SECTION =3D 'PcdsDynamicHii'=0D +PCD_NAME =3D 'gStructPcdTokenSpaceGuid.Pcd'=0D Max_Pcd_Len =3D 100=0D =0D -WARNING=3D[]=0D -ERRORMSG=3D[]=0D +WARNING =3D []=0D +ERRORMSG =3D []=0D +=0D =0D class parser_lst(object):=0D =0D - def __init__(self,filelist):=0D - self._ignore=3D['BOOLEAN', 'UINT8', 'UINT16', 'UINT32', 'UINT64']=0D - self.file=3Dfilelist=0D - self.text=3Dself.megre_lst()[0]=0D - self.content=3Dself.megre_lst()[1]=0D + def __init__(self, filelist):=0D + self._ignore =3D ['BOOLEAN', 'UINT8', 'UINT16', 'UINT32', 'UINT64'= ]=0D + self.file =3D filelist=0D + self.text =3D self.megre_lst()[0]=0D + self.content =3D self.megre_lst()[1]=0D =0D - def megre_lst(self):=0D - alltext=3D''=0D - content=3D{}=0D - for file in self.file:=0D - with open(file,'r') as f:=0D - read =3Df.read()=0D - alltext +=3D read=0D - content[file]=3Dread=0D - return alltext,content=0D + def megre_lst(self):=0D + alltext =3D ''=0D + content =3D {}=0D + for file in self.file:=0D + with open(file, 'r') as f:=0D + read =3D f.read()=0D + alltext +=3D read=0D + content[file] =3D read=0D + return alltext, content=0D =0D - def struct_lst(self):#{struct:lst file}=0D - structs_file=3D{}=0D - name_format =3D re.compile(r'(?')=0D - name_format =3D re.compile(r'(?')=0D + name_format =3D re.compile(r'(? each or each > "\x7E":=0D - if bytes(each, 'utf-16') =3D=3D b'\xff\xfe\xae\x00':=0D - each =3D '(R)'=0D - else:=0D - each =3D ""=0D - comment +=3D each=0D - line=3Dvalue_re.sub('',line) #delete \\... in "Q...." line=0D - list1=3Dline.split(' ')=0D - value=3Dself.value_parser(list1)=0D - offset =3D offset_re.findall(x.replace(' ',''))=0D - name =3D name_re.findall(x.replace(' ',''))=0D - guid =3D guid_re.findall(x.replace(' ',''))=0D - attribute =3Dattribute_re.findall(x.replace(' ',''))=0D - if offset and name and guid and value and attribute:=0D - if attribute[0] in ['0x3','0x7']:=0D - offset =3D int(offset[0], 16)=0D - #help =3D help_re.findall(x)=0D - text_without_comment =3D offset, name[0], guid[0], value, attr= ibute[0]=0D - if text_without_comment in part_without_comment:=0D - # check if exists same Pcd with different comments, add di= fferent comments in one line with "|".=0D - dupl_index =3D part_without_comment.index(text_without_com= ment)=0D - part[dupl_index] =3D list(part[dupl_index])=0D - if comment not in part[dupl_index][-1]:=0D - part[dupl_index][-1] +=3D " | " + comment=0D - part[dupl_index] =3D tuple(part[dupl_index])=0D + def section_parser(self, section):=0D + offset_re =3D re.compile(r'offset=3D(\w+)')=0D + name_re =3D re.compile(r'name=3D(\S+)')=0D + guid_re =3D re.compile(r'guid=3D(\S+)')=0D + # help_re =3D re.compile(r'help =3D (.*)')=0D + attribute_re =3D re.compile(r'attribute=3D(\w+)')=0D + value_re =3D re.compile(r'(//.*)')=0D + part =3D []=0D + part_without_comment =3D []=0D + for x in section[1:]:=0D + line =3D x.split('\n')[0]=0D + # the string \\... in "Q...." line=0D + comment_list =3D value_re.findall(line)=0D + comment_list[0] =3D comment_list[0].replace('//', '')=0D + comment_ori =3D comment_list[0].strip()=0D + comment =3D ""=0D + for each in comment_ori:=0D + if each !=3D " " and "\x21" > each or each > "\x7E":=0D + if bytes(each, 'utf-16') =3D=3D b'\xff\xfe\xae\x00':=0D + each =3D '(R)'=0D + else:=0D + each =3D ""=0D + comment +=3D each=0D + line =3D value_re.sub('', line) # delete \\... in "Q...." lin= e=0D + list1 =3D line.split(' ')=0D + value =3D self.value_parser(list1)=0D + offset =3D offset_re.findall(x.replace(' ', ''))=0D + name =3D name_re.findall(x.replace(' ', ''))=0D + guid =3D guid_re.findall(x.replace(' ', ''))=0D + attribute =3D attribute_re.findall(x.replace(' ', ''))=0D + if offset and name and guid and value and attribute:=0D + if attribute[0] in ['0x3', '0x7']:=0D + offset =3D int(offset[0], 16)=0D + #help =3D help_re.findall(x)=0D + text_without_comment =3D offset, name[0], guid[0], val= ue, attribute[0]=0D + if text_without_comment in part_without_comment:=0D + # check if exists same Pcd with different comments= , add different comments in one line with "|".=0D + dupl_index =3D part_without_comment.index(=0D + text_without_comment)=0D + part[dupl_index] =3D list(part[dupl_index])=0D + if comment not in part[dupl_index][-1]:=0D + part[dupl_index][-1] +=3D " | " + comment=0D + part[dupl_index] =3D tuple(part[dupl_index])=0D + else:=0D + text =3D offset, name[0], guid[0], value, attribut= e[0], comment=0D + part_without_comment.append(text_without_comment)= =0D + part.append(text)=0D + return(part)=0D +=0D + def value_parser(self, list1):=0D + list1 =3D [t for t in list1 if t !=3D ''] # remove '' form list=0D + first_num =3D int(list1[0], 16)=0D + if list1[first_num + 1] =3D=3D 'STRING': # parser STRING=0D + if list1[-1] =3D=3D '""':=0D + value =3D "{0x0, 0x0}"=0D else:=0D - text =3D offset, name[0], guid[0], value, attribute[0], co= mment=0D - part_without_comment.append(text_without_comment)=0D - part.append(text)=0D - return(part)=0D -=0D - def value_parser(self, list1):=0D - list1 =3D [t for t in list1 if t !=3D ''] # remove '' form list=0D - first_num =3D int(list1[0], 16)=0D - if list1[first_num + 1] =3D=3D 'STRING': # parser STRING=0D - if list1[-1] =3D=3D '""':=0D - value =3D "{0x0, 0x0}"=0D - else:=0D - value =3D 'L%s' % list1[-1]=0D - elif list1[first_num + 1] =3D=3D 'ORDERED_LIST': # parser ORDERED_LIS= T=0D - value_total =3D int(list1[first_num + 2])=0D - list2 =3D list1[-value_total:]=0D - tmp =3D []=0D - line =3D ''=0D - for i in list2:=0D - if len(i) % 2 =3D=3D 0 and len(i) !=3D 2:=0D - for m in range(0, len(i) // 2):=0D - tmp.append('0x%02x' % (int('0x%s' % i, 16) >> m * 8 & 0xff))=0D + value =3D 'L%s' % list1[-1]=0D + elif list1[first_num + 1] =3D=3D 'ORDERED_LIST': # parser ORDERED= _LIST=0D + value_total =3D int(list1[first_num + 2])=0D + list2 =3D list1[-value_total:]=0D + tmp =3D []=0D + line =3D ''=0D + for i in list2:=0D + if len(i) % 2 =3D=3D 0 and len(i) !=3D 2:=0D + for m in range(0, len(i) // 2):=0D + tmp.append('0x%02x' %=0D + (int('0x%s' % i, 16) >> m * 8 & 0xff))= =0D + else:=0D + tmp.append('0x%s' % i)=0D + for i in tmp:=0D + line +=3D '%s,' % i=0D + value =3D '{%s}' % line[:-1]=0D else:=0D - tmp.append('0x%s' % i)=0D - for i in tmp:=0D - line +=3D '%s,' % i=0D - value =3D '{%s}' % line[:-1]=0D - else:=0D - value =3D "0x%01x" % int(list1[-1], 16)=0D - return value=0D + value =3D "0x%01x" % int(list1[-1], 16)=0D + return value=0D =0D =0D -#parser Guid file, get guid name form guid value=0D +# parser Guid file, get guid name form guid value=0D class GUID(object):=0D =0D - def __init__(self,path):=0D - self.path =3D path=0D - self.guidfile =3D self.gfile()=0D - self.guiddict =3D self.guid_dict()=0D + def __init__(self, path):=0D + self.path =3D path=0D + self.guidfile =3D self.gfile()=0D + self.guiddict =3D self.guid_dict()=0D =0D - def gfile(self):=0D - for root, dir, file in os.walk(self.path, topdown=3DTrue, followlinks= =3DFalse):=0D - if 'FV' in dir:=0D - gfile =3D os.path.join(root,'Fv','Guid.xref')=0D - if os.path.isfile(gfile):=0D - return gfile=0D + def gfile(self):=0D + for root, dir, file in os.walk(self.path, topdown=3DTrue, followli= nks=3DFalse):=0D + if 'FV' in dir:=0D + gfile =3D os.path.join(root, 'Fv', 'Guid.xref')=0D + if os.path.isfile(gfile):=0D + return gfile=0D + else:=0D + print("ERROR: Guid.xref file not found")=0D + ERRORMSG.append("ERROR: Guid.xref file not found")=0D + exit()=0D +=0D + def guid_dict(self):=0D + guiddict =3D {}=0D + with open(self.guidfile, 'r') as file:=0D + lines =3D file.readlines()=0D + guidinfo =3D lines=0D + for line in guidinfo:=0D + list =3D line.strip().split(' ')=0D + if list:=0D + if len(list) > 1:=0D + guiddict[list[0].upper()] =3D list[1]=0D + elif list[0] !=3D '' and len(list) =3D=3D 1:=0D + print("Error: line %s can't be parser in %s" %=0D + (line.strip(), self.guidfile))=0D + ERRORMSG.append("Error: line %s can't be parser in %s"= % (=0D + line.strip(), self.guidfile))=0D + else:=0D + print("ERROR: No data in %s" % self.guidfile)=0D + ERRORMSG.append("ERROR: No data in %s" % self.guidfile)=0D + return guiddict=0D +=0D + def guid_parser(self, guid):=0D + if guid.upper() in self.guiddict:=0D + return self.guiddict[guid.upper()]=0D else:=0D - print("ERROR: Guid.xref file not found")=0D - ERRORMSG.append("ERROR: Guid.xref file not found")=0D - exit()=0D + print("ERROR: GUID %s not found in file %s" %=0D + (guid, self.guidfile))=0D + ERRORMSG.append("ERROR: GUID %s not found in file %s" %=0D + (guid, self.guidfile))=0D + return guid=0D =0D - def guid_dict(self):=0D - guiddict=3D{}=0D - with open(self.guidfile,'r') as file:=0D - lines =3D file.readlines()=0D - guidinfo=3Dlines=0D - for line in guidinfo:=0D - list=3Dline.strip().split(' ')=0D - if list:=0D - if len(list)>1:=0D - guiddict[list[0].upper()]=3Dlist[1]=0D - elif list[0] !=3D ''and len(list)=3D=3D1:=0D - print("Error: line %s can't be parser in %s"%(line.strip(),self.= guidfile))=0D - ERRORMSG.append("Error: line %s can't be parser in %s"%(line.str= ip(),self.guidfile))=0D - else:=0D - print("ERROR: No data in %s" %self.guidfile)=0D - ERRORMSG.append("ERROR: No data in %s" %self.guidfile)=0D - return guiddict=0D -=0D - def guid_parser(self,guid):=0D - if guid.upper() in self.guiddict:=0D - return self.guiddict[guid.upper()]=0D - else:=0D - print("ERROR: GUID %s not found in file %s"%(guid, self.guidfile))=0D - ERRORMSG.append("ERROR: GUID %s not found in file %s"%(guid, self.gu= idfile))=0D - return guid=0D =0D class PATH(object):=0D =0D - def __init__(self,path):=0D - self.path=3Dpath=0D - self.rootdir=3Dself.get_root_dir()=0D - self.usefuldir=3Dset()=0D - self.lstinf =3D {}=0D - for path in self.rootdir:=0D - for o_root, o_dir, o_file in os.walk(os.path.join(path, "OUTPUT"), t= opdown=3DTrue, followlinks=3DFalse):=0D - for INF in o_file:=0D - if os.path.splitext(INF)[1] =3D=3D '.inf':=0D - for l_root, l_dir, l_file in os.walk(os.path.join(path, "DEBUG= "), topdown=3DTrue,=0D - followlinks=3DFalse):=0D - for LST in l_file:=0D - if os.path.splitext(LST)[1] =3D=3D '.lst':=0D - self.lstinf[os.path.join(l_root, LST)] =3D os.path.join(= o_root, INF)=0D - self.usefuldir.add(path)=0D + def __init__(self, path):=0D + self.path =3D path=0D + self.rootdir =3D self.get_root_dir()=0D + self.usefuldir =3D set()=0D + self.lstinf =3D {}=0D + for path in self.rootdir:=0D + for o_root, o_dir, o_file in os.walk(os.path.join(path, "OUTPU= T"), topdown=3DTrue, followlinks=3DFalse):=0D + for INF in o_file:=0D + if os.path.splitext(INF)[1] =3D=3D '.inf':=0D + for l_root, l_dir, l_file in os.walk(os.path.join(= path, "DEBUG"), topdown=3DTrue,=0D + followlinks= =3DFalse):=0D + for LST in l_file:=0D + if os.path.splitext(LST)[1] =3D=3D '.lst':= =0D + self.lstinf[os.path.join(l_root, LST)]= =3D os.path.join(=0D + o_root, INF)=0D + self.usefuldir.add(path)=0D =0D - def get_root_dir(self):=0D - rootdir=3D[]=0D - for root,dir,file in os.walk(self.path,topdown=3DTrue,followlinks=3DFa= lse):=0D - if "OUTPUT" in root:=0D - updir=3Droot.split("OUTPUT",1)[0]=0D - rootdir.append(updir)=0D - rootdir=3Dlist(set(rootdir))=0D - return rootdir=0D + def get_root_dir(self):=0D + rootdir =3D []=0D + for root, dir, file in os.walk(self.path, topdown=3DTrue, followli= nks=3DFalse):=0D + if "OUTPUT" in root:=0D + updir =3D root.split("OUTPUT", 1)[0]=0D + rootdir.append(updir)=0D + rootdir =3D list(set(rootdir))=0D + return rootdir=0D =0D - def lst_inf(self):=0D - return self.lstinf=0D + def lst_inf(self):=0D + return self.lstinf=0D =0D - def package(self):=0D - package=3D{}=0D - package_re=3Dre.compile(r'Packages\.\w+]\n(.*)',re.S)=0D - for i in list(self.lstinf.values()):=0D - with open(i,'r') as inf:=0D - read=3Dinf.read()=0D - section=3Dread.split('[')=0D - for j in section:=0D - p=3Dpackage_re.findall(j)=0D - if p:=0D - package[i]=3Dp[0].rstrip()=0D - return package=0D + def package(self):=0D + package =3D {}=0D + package_re =3D re.compile(r'Packages\.\w+]\n(.*)', re.S)=0D + for i in list(self.lstinf.values()):=0D + with open(i, 'r') as inf:=0D + read =3D inf.read()=0D + section =3D read.split('[')=0D + for j in section:=0D + p =3D package_re.findall(j)=0D + if p:=0D + package[i] =3D p[0].rstrip()=0D + return package=0D =0D - def header(self,struct):=0D - header=3D{}=0D - head_re =3D re.compile('typedef.*} %s;[\n]+(.*)(?:typedef|formset)'%st= ruct,re.M|re.S)=0D - head_re2 =3D re.compile(r'#line[\s\d]+"(\S+h)"')=0D - for i in list(self.lstinf.keys()):=0D - with open(i,'r') as lst:=0D - read =3D lst.read()=0D - h =3D head_re.findall(read)=0D - if h:=0D - head=3Dhead_re2.findall(h[0])=0D - if head:=0D - format =3D head[0].replace('\\\\','/').replace('\\','/')=0D - name =3Dformat.split('/')[-1]=0D - head =3D self.headerfileset.get(name)=0D - if head:=0D - head =3D head.replace('\\','/')=0D - header[struct] =3D head=0D - return header=0D - @property=0D - def headerfileset(self):=0D - headerset =3D dict()=0D - for root,dirs,files in os.walk(self.path):=0D - for file in files:=0D - if os.path.basename(file) =3D=3D 'deps.txt':=0D - with open(os.path.join(root,file),"r") as fr:=0D - for line in fr.readlines():=0D - headerset[os.path.basename(line).strip()] =3D line.strip()=0D - return headerset=0D + def header(self, struct):=0D + header =3D {}=0D + head_re =3D re.compile(=0D + 'typedef.*} %s;[\n]+(.*)(?:typedef|formset)' % struct, re.M | = re.S)=0D + head_re2 =3D re.compile(r'#line[\s\d]+"(\S+h)"')=0D + for i in list(self.lstinf.keys()):=0D + with open(i, 'r') as lst:=0D + read =3D lst.read()=0D + h =3D head_re.findall(read)=0D + if h:=0D + head =3D head_re2.findall(h[0])=0D + if head:=0D + format =3D head[0].replace('\\\\', '/').replace('\\', = '/')=0D + name =3D format.split('/')[-1]=0D + head =3D self.headerfileset.get(name)=0D + if head:=0D + head =3D head.replace('\\', '/')=0D + header[struct] =3D head=0D + return header=0D +=0D + @property=0D + def headerfileset(self):=0D + headerset =3D dict()=0D + for root, dirs, files in os.walk(self.path):=0D + for file in files:=0D + if os.path.basename(file) =3D=3D 'deps.txt':=0D + with open(os.path.join(root, file), "r") as fr:=0D + for line in fr.readlines():=0D + headerset[os.path.basename(=0D + line).strip()] =3D line.strip()=0D + return headerset=0D +=0D + def makefile(self, filename):=0D + re_format =3D re.compile(r'DEBUG_DIR.*(?:\S+Pkg)\\(.*\\%s)' % file= name)=0D + for i in self.usefuldir:=0D + with open(os.path.join(i, 'Makefile'), 'r') as make:=0D + read =3D make.read()=0D + dir =3D re_format.findall(read)=0D + if dir:=0D + return dir[0]=0D + return None=0D =0D - def makefile(self,filename):=0D - re_format =3D re.compile(r'DEBUG_DIR.*(?:\S+Pkg)\\(.*\\%s)'%filename)= =0D - for i in self.usefuldir:=0D - with open(os.path.join(i,'Makefile'),'r') as make:=0D - read =3D make.read()=0D - dir =3D re_format.findall(read)=0D - if dir:=0D - return dir[0]=0D - return None=0D =0D class mainprocess(object):=0D =0D - def __init__(self,InputPath,Config,OutputPath):=0D - self.init =3D 0xFCD00000=0D - self.inputpath =3D os.path.abspath(InputPath)=0D - self.outputpath =3D os.path.abspath(OutputPath)=0D - self.LST =3D PATH(self.inputpath)=0D - self.lst_dict =3D self.LST.lst_inf()=0D - self.Config =3D Config=0D - self.attribute_dict =3D {'0x3': 'NV, BS', '0x7': 'NV, BS, RT'}=0D - self.guid =3D GUID(self.inputpath)=0D - self.header=3D{}=0D + def __init__(self, InputPath, Config, OutputPath):=0D + self.init =3D 0xFCD00000=0D + self.inputpath =3D os.path.abspath(InputPath)=0D + self.outputpath =3D os.path.abspath(OutputPath)=0D + self.LST =3D PATH(self.inputpath)=0D + self.lst_dict =3D self.LST.lst_inf()=0D + self.Config =3D Config=0D + self.attribute_dict =3D {'0x3': 'NV, BS', '0x7': 'NV, BS, RT'}=0D + self.guid =3D GUID(self.inputpath)=0D + self.header =3D {}=0D =0D - def main(self):=0D - conf=3DConfig(self.Config)=0D - config_dict=3Dconf.config_parser() #get {'0_0':[offset,name,guid,value= ,attribute]...,'1_0':....}=0D - lst=3Dparser_lst(list(self.lst_dict.keys()))=0D - efi_dict=3Dlst.efivarstore_parser() #get {name:struct} form lst file=0D - keys=3Dsorted(config_dict.keys())=0D - all_struct=3Dlst.struct()=0D - stru_lst=3Dlst.struct_lst()=0D - title_list=3D[]=0D - info_list=3D[]=0D - header_list=3D[]=0D - inf_list =3D[]=0D - for i in stru_lst:=0D - tmp =3D self.LST.header(i)=0D - self.header.update(tmp)=0D - for id_key in keys:=0D - tmp_id=3D[id_key] #['0_0',[(struct,[name...]),(struct,[name...])]]=0D - tmp_info=3D{} #{name:struct}=0D - for section in config_dict[id_key]:=0D - c_offset,c_name,c_guid,c_value,c_attribute,c_comment =3D section=0D - if c_name in efi_dict:=0D - struct =3D efi_dict[c_name]=0D - title=3D'%s%s|L"%s"|%s|0x00||%s\n'%(PCD_NAME,c_name,c_name,self.= guid.guid_parser(c_guid),self.attribute_dict[c_attribute])=0D - if struct in all_struct:=0D - lstfile =3D stru_lst[struct]=0D - struct_dict=3Dall_struct[struct]=0D - try:=0D - title2 =3D '%s%s|{0}|%s|0xFCD00000{\n \n %s\n = \n%s\n}\n' % (PCD_NAME, c_name, struct, self.header[struct], self= .LST.package()[self.lst_dict[lstfile]])=0D - except KeyError:=0D - WARNING.append("Warning: No for struct %s"%str= uct)=0D - title2 =3D '%s%s|{0}|%s|0xFCD00000{\n \n %s\n = \n%s\n}\n' % (PCD_NAME, c_name, struct, '', self.LST.package()[se= lf.lst_dict[lstfile]])=0D - header_list.append(title2)=0D - elif struct not in lst._ignore:=0D - struct_dict =3D{}=0D - print("ERROR: Struct %s can't found in lst file" %struct)=0D - ERRORMSG.append("ERROR: Struct %s can't found in lst file" %st= ruct)=0D - if c_offset in struct_dict:=0D - offset_name=3Dstruct_dict[c_offset]=0D - info =3D "%s%s.%s|%s\n"%(PCD_NAME,c_name,offset_name,c_value)= =0D - blank_length =3D Max_Pcd_Len - len(info)=0D - if blank_length <=3D 0:=0D - info_comment =3D "%s%s.%s|%s%s# %s\n"%(PCD_NAME,c_name,off= set_name,c_value," ",c_comment)=0D - else:=0D - info_comment =3D "%s%s.%s|%s%s# %s\n"%(PCD_NAME,c_name,off= set_name,c_value,blank_length*" ",c_comment)=0D - inf =3D "%s%s\n"%(PCD_NAME,c_name)=0D - inf_list.append(inf)=0D - tmp_info[info_comment]=3Dtitle=0D - else:=0D - print("ERROR: Can't find offset %s with struct name %s"%(c_off= set,struct))=0D - ERRORMSG.append("ERROR: Can't find offset %s with name %s"%(c_= offset,struct))=0D + def main(self):=0D + conf =3D Config(self.Config)=0D + # get {'0_0':[offset,name,guid,value,attribute]...,'1_0':....}=0D + config_dict =3D conf.config_parser()=0D + lst =3D parser_lst(list(self.lst_dict.keys()))=0D + efi_dict =3D lst.efivarstore_parser() # get {name:struct} form ls= t file=0D + keys =3D sorted(config_dict.keys())=0D + all_struct =3D lst.struct()=0D + stru_lst =3D lst.struct_lst()=0D + title_list =3D []=0D + info_list =3D []=0D + header_list =3D []=0D + inf_list =3D []=0D + for i in stru_lst:=0D + tmp =3D self.LST.header(i)=0D + self.header.update(tmp)=0D + for id_key in keys:=0D + # ['0_0',[(struct,[name...]),(struct,[name...])]]=0D + tmp_id =3D [id_key]=0D + tmp_info =3D {} # {name:struct}=0D + for section in config_dict[id_key]:=0D + c_offset, c_name, c_guid, c_value, c_attribute, c_comment = =3D section=0D + if c_name in efi_dict:=0D + struct =3D efi_dict[c_name]=0D + title =3D '%s%s|L"%s"|%s|0x00||%s\n' % (PCD_NAME, c_na= me, c_name, self.guid.guid_parser(=0D + c_guid), self.attribute_dict[c_attribute])=0D + if struct in all_struct:=0D + lstfile =3D stru_lst[struct]=0D + struct_dict =3D all_struct[struct]=0D + try:=0D + title2 =3D '%s%s|{0}|%s|0xFCD00000{\n \n %s\n \n%s\n}\n' % (=0D + PCD_NAME, c_name, struct, self.header[stru= ct], self.LST.package()[self.lst_dict[lstfile]])=0D + except KeyError:=0D + WARNING.append(=0D + "Warning: No for struct %s" = % struct)=0D + title2 =3D '%s%s|{0}|%s|0xFCD00000{\n \n %s\n \n%s\n}\n' % (=0D + PCD_NAME, c_name, struct, '', self.LST.pac= kage()[self.lst_dict[lstfile]])=0D + header_list.append(title2)=0D + elif struct not in lst._ignore:=0D + struct_dict =3D {}=0D + print("ERROR: Struct %s can't found in lst file" %= struct)=0D + ERRORMSG.append(=0D + "ERROR: Struct %s can't found in lst file" % s= truct)=0D + if c_offset in struct_dict:=0D + offset_name =3D struct_dict[c_offset]=0D + info =3D "%s%s.%s|%s\n" % (=0D + PCD_NAME, c_name, offset_name, c_value)=0D + blank_length =3D Max_Pcd_Len - len(info)=0D + if blank_length <=3D 0:=0D + info_comment =3D "%s%s.%s|%s%s# %s\n" % (=0D + PCD_NAME, c_name, offset_name, c_value, " = ", c_comment)=0D + else:=0D + info_comment =3D "%s%s.%s|%s%s# %s\n" % (=0D + PCD_NAME, c_name, offset_name, c_value, bl= ank_length*" ", c_comment)=0D + inf =3D "%s%s\n" % (PCD_NAME, c_name)=0D + inf_list.append(inf)=0D + tmp_info[info_comment] =3D title=0D + else:=0D + print("ERROR: Can't find offset %s with struct nam= e %s" % (=0D + c_offset, struct))=0D + ERRORMSG.append(=0D + "ERROR: Can't find offset %s with name %s" % (= c_offset, struct))=0D + else:=0D + print("ERROR: Can't find name %s in lst file" % (c_nam= e))=0D + ERRORMSG.append(=0D + "ERROR: Can't find name %s in lst file" % (c_name)= )=0D + tmp_id.append(list(self.reverse_dict(tmp_info).items()))=0D + id, tmp_title_list, tmp_info_list =3D self.read_list(tmp_id)=0D + title_list +=3D tmp_title_list=0D + info_list.append(tmp_info_list)=0D + inf_list =3D self.del_repeat(inf_list)=0D + header_list =3D self.plus(self.del_repeat(header_list))=0D + title_all =3D list(set(title_list))=0D + info_list =3D self.remove_bracket(self.del_repeat(info_list))=0D + for i in range(len(info_list)-1, -1, -1):=0D + if len(info_list[i]) =3D=3D 0:=0D + info_list.remove(info_list[i])=0D + for i in (inf_list, title_all, header_list):=0D + i.sort()=0D + return keys, title_all, info_list, header_list, inf_list=0D +=0D + def correct_sort(self, PcdString):=0D + # sort the Pcd list with two rules:=0D + # First sort through Pcd name;=0D + # Second if the Pcd exists several elements, sort them through ind= ex value.=0D + if ("]|") in PcdString:=0D + Pcdname =3D PcdString.split("[")[0]=0D + Pcdindex =3D int(PcdString.split("[")[1].split("]")[0])=0D else:=0D - print("ERROR: Can't find name %s in lst file"%(c_name))=0D - ERRORMSG.append("ERROR: Can't find name %s in lst file"%(c_name)= )=0D - tmp_id.append(list(self.reverse_dict(tmp_info).items()))=0D - id,tmp_title_list,tmp_info_list =3D self.read_list(tmp_id)=0D - title_list +=3Dtmp_title_list=0D - info_list.append(tmp_info_list)=0D - inf_list =3D self.del_repeat(inf_list)=0D - header_list =3D self.plus(self.del_repeat(header_list))=0D - title_all=3Dlist(set(title_list))=0D - info_list =3D self.remove_bracket(self.del_repeat(info_list))=0D - for i in range(len(info_list)-1,-1,-1):=0D - if len(info_list[i]) =3D=3D 0:=0D - info_list.remove(info_list[i])=0D - for i in (inf_list, title_all, header_list):=0D - i.sort()=0D - return keys,title_all,info_list,header_list,inf_list=0D + Pcdname =3D PcdString.split("|")[0]=0D + Pcdindex =3D 0=0D + return Pcdname, Pcdindex=0D =0D - def correct_sort(self, PcdString):=0D - # sort the Pcd list with two rules:=0D - # First sort through Pcd name;=0D - # Second if the Pcd exists several elements, sort them through index v= alue.=0D - if ("]|") in PcdString:=0D - Pcdname =3D PcdString.split("[")[0]=0D - Pcdindex =3D int(PcdString.split("[")[1].split("]")[0])=0D - else:=0D - Pcdname =3D PcdString.split("|")[0]=0D - Pcdindex =3D 0=0D - return Pcdname, Pcdindex=0D + def remove_bracket(self, List):=0D + for i in List:=0D + for j in i:=0D + tmp =3D j.split("|")=0D + if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].s= trip() =3D=3D '{0x0, 0x0}'):=0D + tmp[0] =3D tmp[0][:tmp[0].index('[')]=0D + List[List.index(i)][i.index(j)] =3D "|".join(tmp)=0D + else:=0D + List[List.index(i)][i.index(j)] =3D j=0D + for i in List:=0D + if type(i) =3D=3D type([0, 0]):=0D + i.sort(key=3Dlambda x: (self.correct_sort(=0D + x)[0], self.correct_sort(x)[1]))=0D + return List=0D =0D - def remove_bracket(self,List):=0D - for i in List:=0D - for j in i:=0D - tmp =3D j.split("|")=0D - if (('L"' in j) and ("[" in j)) or (tmp[1].split("#")[0].strip() = =3D=3D '{0x0, 0x0}'):=0D - tmp[0] =3D tmp[0][:tmp[0].index('[')]=0D - List[List.index(i)][i.index(j)] =3D "|".join(tmp)=0D - else:=0D - List[List.index(i)][i.index(j)] =3D j=0D - for i in List:=0D - if type(i) =3D=3D type([0,0]):=0D - i.sort(key =3D lambda x:(self.correct_sort(x)[0], self.correct_sor= t(x)[1]))=0D - return List=0D + def write_all(self):=0D + title_flag =3D 1=0D + info_flag =3D 1=0D + if not os.path.isdir(self.outputpath):=0D + os.makedirs(self.outputpath)=0D + decwrite =3D write2file(os.path.join(=0D + self.outputpath, 'StructurePcd.dec'))=0D + dscwrite =3D write2file(os.path.join(=0D + self.outputpath, 'StructurePcd.dsc'))=0D + infwrite =3D write2file(os.path.join(=0D + self.outputpath, 'StructurePcd.inf'))=0D + conf =3D Config(self.Config)=0D + ids, title, info, header, inf =3D self.main()=0D + decwrite.add2file(decstatement)=0D + decwrite.add2file(header)=0D + infwrite.add2file(infstatement)=0D + infwrite.add2file(inf)=0D + dscwrite.add2file(dscstatement)=0D + for id in ids:=0D + dscwrite.add2file(conf.eval_id(id))=0D + if title_flag:=0D + dscwrite.add2file(title)=0D + title_flag =3D 0=0D + if len(info) =3D=3D 1:=0D + dscwrite.add2file(info)=0D + elif len(info) =3D=3D 2:=0D + if info_flag:=0D + dscwrite.add2file(info[0])=0D + info_flag =3D 0=0D + else:=0D + dscwrite.add2file(info[1])=0D =0D - def write_all(self):=0D - title_flag=3D1=0D - info_flag=3D1=0D - if not os.path.isdir(self.outputpath):=0D - os.makedirs(self.outputpath)=0D - decwrite =3D write2file(os.path.join(self.outputpath,'StructurePcd.dec= '))=0D - dscwrite =3D write2file(os.path.join(self.outputpath,'StructurePcd.dsc= '))=0D - infwrite =3D write2file(os.path.join(self.outputpath, 'StructurePcd.in= f'))=0D - conf =3D Config(self.Config)=0D - ids,title,info,header,inf=3Dself.main()=0D - decwrite.add2file(decstatement)=0D - decwrite.add2file(header)=0D - infwrite.add2file(infstatement)=0D - infwrite.add2file(inf)=0D - dscwrite.add2file(dscstatement)=0D - for id in ids:=0D - dscwrite.add2file(conf.eval_id(id))=0D - if title_flag:=0D - dscwrite.add2file(title)=0D - title_flag=3D0=0D - if len(info) =3D=3D 1:=0D - dscwrite.add2file(info)=0D - elif len(info) =3D=3D 2:=0D - if info_flag:=0D - dscwrite.add2file(info[0])=0D - info_flag =3D0=0D + def del_repeat(self, List):=0D + if len(List) =3D=3D 1 or len(List) =3D=3D 0:=0D + return List=0D else:=0D - dscwrite.add2file(info[1])=0D -=0D - def del_repeat(self,List):=0D - if len(List) =3D=3D 1 or len(List) =3D=3D 0:=0D - return List=0D - else:=0D - if type(List[0]) !=3D type('xxx'):=0D - alist=3D[]=0D - for i in range(len(List)):=0D - if i =3D=3D 0:=0D - alist.append(List[0])=0D - else:=0D - plist =3D []=0D - for j in range(i):=0D - plist +=3D List[j]=0D - alist.append(self.__del(list(set(plist)), List[i]))=0D - return alist=0D - else:=0D - return list(set(List))=0D + if type(List[0]) !=3D type('xxx'):=0D + alist =3D []=0D + for i in range(len(List)):=0D + if i =3D=3D 0:=0D + alist.append(List[0])=0D + else:=0D + plist =3D []=0D + for j in range(i):=0D + plist +=3D List[j]=0D + alist.append(self.__del(list(set(plist)), List[i])= )=0D + return alist=0D + else:=0D + return list(set(List))=0D =0D + def __del(self, list1, list2):=0D + return list(set(list2).difference(set(list1)))=0D =0D - def __del(self,list1,list2):=0D - return list(set(list2).difference(set(list1)))=0D + def reverse_dict(self, dict):=0D + data =3D {}=0D + for i in list(dict.items()):=0D + if i[1] not in list(data.keys()):=0D + data[i[1]] =3D [i[0]]=0D + else:=0D + data[i[1]].append(i[0])=0D + return data=0D =0D - def reverse_dict(self,dict):=0D - data=3D{}=0D - for i in list(dict.items()):=0D - if i[1] not in list(data.keys()):=0D - data[i[1]]=3D[i[0]]=0D - else:=0D - data[i[1]].append(i[0])=0D - return data=0D + def read_list(self, list):=0D + title_list =3D []=0D + info_list =3D []=0D + for i in list[1]:=0D + title_list.append(i[0])=0D + for j in i[1]:=0D + info_list.append(j)=0D + return list[0], title_list, info_list=0D =0D - def read_list(self,list):=0D - title_list=3D[]=0D - info_list=3D[]=0D - for i in list[1]:=0D - title_list.append(i[0])=0D - for j in i[1]:=0D - info_list.append(j)=0D - return list[0],title_list,info_list=0D + def plus(self, list):=0D + nums =3D []=0D + for i in list:=0D + if type(i) !=3D type([0]):=0D + self.init +=3D 1=0D + num =3D "0x%01x" % self.init=0D + j =3D i.replace('0xFCD00000', num.upper())=0D + nums.append(j)=0D + return nums=0D =0D - def plus(self,list):=0D - nums=3D[]=0D - for i in list:=0D - if type(i) !=3D type([0]):=0D - self.init +=3D 1=0D - num =3D "0x%01x" % self.init=0D - j=3Di.replace('0xFCD00000',num.upper())=0D - nums.append(j)=0D - return nums=0D =0D class write2file(object):=0D =0D - def __init__(self,Output):=0D - self.output=3DOutput=0D - self.text=3D''=0D - if os.path.exists(self.output):=0D - os.remove(self.output)=0D + def __init__(self, Output):=0D + self.output =3D Output=0D + self.text =3D ''=0D + if os.path.exists(self.output):=0D + os.remove(self.output)=0D =0D - def add2file(self,content):=0D - self.text =3D ''=0D - with open(self.output,'a+') as file:=0D - file.write(self.__gen(content))=0D + def add2file(self, content):=0D + self.text =3D ''=0D + with open(self.output, 'a+') as file:=0D + file.write(self.__gen(content))=0D =0D - def __gen(self,content):=0D - if type(content) =3D=3D type(''):=0D - return content=0D - elif type(content) =3D=3D type([0,0])or type(content) =3D=3D type((0,0= )):=0D - return self.__readlist(content)=0D - elif type(content) =3D=3D type({0:0}):=0D - return self.__readdict(content)=0D + def __gen(self, content):=0D + if type(content) =3D=3D type(''):=0D + return content=0D + elif type(content) =3D=3D type([0, 0]) or type(content) =3D=3D typ= e((0, 0)):=0D + return self.__readlist(content)=0D + elif type(content) =3D=3D type({0: 0}):=0D + return self.__readdict(content)=0D =0D - def __readlist(self,list):=0D - for i in list:=0D - if type(i) =3D=3D type([0,0])or type(i) =3D=3D type((0,0)):=0D - self.__readlist(i)=0D - elif type(i) =3D=3D type('') :=0D - self.text +=3Di=0D - return self.text=0D + def __readlist(self, list):=0D + for i in list:=0D + if type(i) =3D=3D type([0, 0]) or type(i) =3D=3D type((0, 0)):= =0D + self.__readlist(i)=0D + elif type(i) =3D=3D type(''):=0D + self.text +=3D i=0D + return self.text=0D +=0D + def __readdict(self, dict):=0D + content =3D list(dict.items())=0D + return self.__readlist(content)=0D =0D - def __readdict(self,dict):=0D - content=3Dlist(dict.items())=0D - return self.__readlist(content)=0D =0D def stamp():=0D - return datetime.datetime.now()=0D + return datetime.datetime.now()=0D =0D -def dtime(start,end,id=3DNone):=0D - if id:=0D - pass=0D - print("%s time:%s" % (id,str(end - start)))=0D - else:=0D - print("Total time:%s" %str(end-start)[:-7])=0D +=0D +def dtime(start, end, id=3DNone):=0D + if id:=0D + pass=0D + print("%s time:%s" % (id, str(end - start)))=0D + else:=0D + print("Total time:%s" % str(end-start)[:-7])=0D =0D =0D def main():=0D - start =3D stamp()=0D - parser =3D argparse.ArgumentParser(prog =3D __prog__,=0D - description =3D __description__ + __cop= yright__,=0D - conflict_handler =3D 'resolve')=0D - parser.add_argument('-v', '--version', action =3D 'version',version =3D = __version__, help=3D"show program's version number and exit")=0D - parser.add_argument('-p', '--path', metavar=3D'PATH', dest=3D'path', hel= p=3D"platform build output directory")=0D - parser.add_argument('-c', '--config',metavar=3D'FILENAME', dest=3D'confi= g', help=3D"firmware configuration file")=0D - parser.add_argument('-o', '--outputdir', metavar=3D'PATH', dest=3D'outpu= t', help=3D"output directoy")=0D - options =3D parser.parse_args()=0D - if options.config:=0D - if options.path:=0D - if options.output:=0D - run =3D mainprocess(options.path, options.config, options.output)= =0D - print("Running...")=0D - run.write_all()=0D - if WARNING:=0D - warning =3D list(set(WARNING))=0D - for j in warning:=0D - print(j)=0D - if ERRORMSG:=0D - ERROR =3D list(set(ERRORMSG))=0D - with open("ERROR.log", 'w+') as error:=0D - for i in ERROR:=0D - error.write(i + '\n')=0D - print("Some error find, error log in ERROR.log")=0D - print('Finished, Output files in directory %s'%os.path.abspath(opt= ions.output))=0D - else:=0D - print('Error command, no output path, use -h for help')=0D + start =3D stamp()=0D + parser =3D argparse.ArgumentParser(prog=3D__prog__,=0D + description=3D__description__ + __cop= yright__,=0D + conflict_handler=3D'resolve')=0D + parser.add_argument('-v', '--version', action=3D'version',=0D + version=3D__version__, help=3D"show program's vers= ion number and exit")=0D + parser.add_argument('-p', '--path', metavar=3D'PATH',=0D + dest=3D'path', help=3D"platform build output direc= tory")=0D + parser.add_argument('-c', '--config', metavar=3D'FILENAME',=0D + dest=3D'config', help=3D"firmware configuration fi= le")=0D + parser.add_argument('-o', '--outputdir', metavar=3D'PATH',=0D + dest=3D'output', help=3D"output directoy")=0D + options =3D parser.parse_args()=0D + if options.config:=0D + if options.path:=0D + if options.output:=0D + run =3D mainprocess(options.path, options.config, options.= output)=0D + print("Running...")=0D + run.write_all()=0D + if WARNING:=0D + warning =3D list(set(WARNING))=0D + for j in warning:=0D + print(j)=0D + if ERRORMSG:=0D + ERROR =3D list(set(ERRORMSG))=0D + with open("ERROR.log", 'w+') as error:=0D + for i in ERROR:=0D + error.write(i + '\n')=0D + print("Some error find, error log in ERROR.log")=0D + print('Finished, Output files in directory %s' %=0D + os.path.abspath(options.output))=0D + else:=0D + print('Error command, no output path, use -h for help')=0D + else:=0D + print('Error command, no build path input, use -h for help')=0D else:=0D - print('Error command, no build path input, use -h for help')=0D - else:=0D - print('Error command, no output file, use -h for help')=0D - end =3D stamp()=0D - dtime(start, end)=0D + print('Error command, no output file, use -h for help')=0D + end =3D stamp()=0D + dtime(start, end)=0D +=0D =0D if __name__ =3D=3D '__main__':=0D - main()=0D + main()=0D diff --git a/BaseTools/Scripts/ConvertMasmToNasm.py b/BaseTools/Scripts/Con= vertMasmToNasm.py index 0ef5a8badb94..c4439dd5c5bc 100755 --- a/BaseTools/Scripts/ConvertMasmToNasm.py +++ b/BaseTools/Scripts/ConvertMasmToNasm.py @@ -834,7 +834,8 @@ class ConvertInfFile(CommonUtils): reldst =3D self.RootRelative(dst)=0D print('Unabled to convert', reldst)=0D if unsupportedArchCount > 0 and not self.args.quiet:=0D - print('Skipped', unsupportedArchCount, 'files based on archite= cture')=0D + print('Skipped', unsupportedArchCount,=0D + 'files based on architecture')=0D =0D def UpdateInfAsmFile(self, dst, IgnoreMissingAsm=3DFalse):=0D infPath =3D os.path.split(os.path.realpath(self.inf))[0]=0D @@ -961,7 +962,8 @@ class ConvertInfFiles(CommonUtils): reldst =3D self.RootRelative(dst)=0D print('Unabled to convert', reldst)=0D if unsupportedArchCount > 0 and not self.args.quiet:=0D - print('Skipped', unsupportedArchCount, 'files based on archite= cture')=0D + print('Skipped', unsupportedArchCount,=0D + 'files based on architecture')=0D =0D =0D class ConvertDirectories(CommonUtils):=0D @@ -1002,4 +1004,5 @@ class ConvertAsmApp(CommonUtils): elif not self.dirmode:=0D ConvertAsmFile(src, dst, self)=0D =0D +=0D ConvertAsmApp()=0D diff --git a/BaseTools/Scripts/ConvertUni.py b/BaseTools/Scripts/ConvertUni= .py index d87550b63132..c4980f1e1a6f 100755 --- a/BaseTools/Scripts/ConvertUni.py +++ b/BaseTools/Scripts/ConvertUni.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Check a patch for various format issues=0D #=0D # Copyright (c) 2015, Intel Corporation. All rights reserved.
=0D @@ -7,14 +7,14 @@ #=0D =0D from __future__ import print_function=0D +import sys=0D +import os=0D +import codecs=0D +import argparse=0D =0D VersionNumber =3D '0.1'=0D __copyright__ =3D "Copyright (c) 2015, Intel Corporation All rights reser= ved."=0D =0D -import argparse=0D -import codecs=0D -import os=0D -import sys=0D =0D class ConvertOneArg:=0D """Converts utf-16 to utf-8 for one command line argument.=0D @@ -82,7 +82,8 @@ class ConvertOneArg: f.write(new_content)=0D f.close()=0D =0D - print(source + ": converted, size", len(file_content), '=3D>', len= (new_content))=0D + print(source + ": converted, size",=0D + len(file_content), '=3D>', len(new_content))=0D return True=0D =0D =0D @@ -121,5 +122,6 @@ class ConvertUniApp: self.args =3D parser.parse_args()=0D self.utf8 =3D not self.args.utf_16=0D =0D +=0D if __name__ =3D=3D "__main__":=0D sys.exit(ConvertUniApp().retval)=0D diff --git a/BaseTools/Scripts/DetectNotUsedItem.py b/BaseTools/Scripts/Det= ectNotUsedItem.py index 61481fb9187c..807627d5e9fe 100644 --- a/BaseTools/Scripts/DetectNotUsedItem.py +++ b/BaseTools/Scripts/DetectNotUsedItem.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Detect unreferenced PCD and GUID/Protocols/PPIs.=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.=0D @@ -73,7 +73,8 @@ class PROCESS(object): Comment_Line.append(Index)=0D if NotComment:=0D if content !=3D "\n" and content !=3D "\r\n":=0D - ItemName[Index] =3D content.split('=3D')[0].sp= lit('|')[0].split('#')[0].strip()=0D + ItemName[Index] =3D content.split('=3D')[0].sp= lit('|')[=0D + 0].split('#')[0].strip()=0D Comments[Index] =3D Comment_Line=0D Comment_Line =3D []=0D return ItemName, Comments=0D @@ -103,7 +104,8 @@ class PROCESS(object): InfDscFdfContent =3D self.ParserDscFdfInfFile()=0D for LineNum in list(DecItem.keys()):=0D DecItemName =3D DecItem[LineNum]=0D - Match_reg =3D re.compile("(?=0D @@ -25,6 +25,7 @@ EXPRESSIONS =3D { 'webpage': re.compile(r'^W:\s*(?P.*?)\r*$')=0D }=0D =0D +=0D def printsection(section):=0D """Prints out the dictionary describing a Maintainers.txt section."""= =0D print('=3D=3D=3D')=0D @@ -33,6 +34,7 @@ def printsection(section): for item in section[key]:=0D print(' %s' % item)=0D =0D +=0D def pattern_to_regex(pattern):=0D """Takes a string containing regular UNIX path wildcards=0D and returns a string suitable for matching with regex."""=0D @@ -49,6 +51,7 @@ def pattern_to_regex(pattern): =0D return pattern=0D =0D +=0D def path_in_section(path, section):=0D """Returns True of False indicating whether the path is covered by=0D the current section."""=0D @@ -72,6 +75,7 @@ def path_in_section(path, section): =0D return False=0D =0D +=0D def get_section_maintainers(path, section):=0D """Returns a list with email addresses to any M: and R: entries=0D matching the provided path in the provided section."""=0D @@ -82,7 +86,8 @@ def get_section_maintainers(path, section): if path_in_section(path, section):=0D for status in section['status']:=0D if status not in nowarn_status:=0D - print('WARNING: Maintained status for "%s" is \'%s\'!' % (= path, status))=0D + print('WARNING: Maintained status for "%s" is \'%s\'!' %=0D + (path, status))=0D for address in section['maintainer'], section['reviewer']:=0D # Convert to list if necessary=0D if isinstance(address, list):=0D @@ -98,6 +103,7 @@ def get_section_maintainers(path, section): =0D return maintainers, lists=0D =0D +=0D def get_maintainers(path, sections, level=3D0):=0D """For 'path', iterates over all sections, returning maintainers=0D for matching ones."""=0D @@ -115,7 +121,8 @@ def get_maintainers(path, sections, level=3D0): # REPO.working_dir/=0D print('"%s": no maintainers found, looking for default' % path)=0D if level =3D=3D 0:=0D - maintainers =3D get_maintainers('', sections, level= =3Dlevel + 1)=0D + maintainers =3D get_maintainers(=0D + '', sections, level=3Dlevel + 1)=0D else:=0D print("No maintainers set for project.")=0D if not maintainers:=0D @@ -123,6 +130,7 @@ def get_maintainers(path, sections, level=3D0): =0D return maintainers + lists=0D =0D +=0D def parse_maintainers_line(line):=0D """Parse one line of Maintainers.txt, returning any match group and it= s key."""=0D for key, expression in EXPRESSIONS.items():=0D @@ -131,6 +139,7 @@ def parse_maintainers_line(line): return key, match.group(key)=0D return None, None=0D =0D +=0D def parse_maintainers_file(filename):=0D """Parse the Maintainers.txt from top-level of repo and=0D return a list containing dictionaries of all sections."""=0D @@ -153,11 +162,13 @@ def parse_maintainers_file(filename): =0D return sectionlist=0D =0D +=0D def get_modified_files(repo, args):=0D """Returns a list of the files modified by the commit specified in 'ar= gs'."""=0D commit =3D repo.commit(args.commit)=0D return commit.stats.files=0D =0D +=0D if __name__ =3D=3D '__main__':=0D PARSER =3D argparse.ArgumentParser(=0D description=3D'Retrieves information on who to cc for review on a = given commit')=0D @@ -178,7 +189,7 @@ if __name__ =3D=3D '__main__': SECTIONS =3D parse_maintainers_file(CONFIG_FILE)=0D =0D if ARGS.lookup:=0D - FILES =3D [ARGS.lookup.replace('\\','/')]=0D + FILES =3D [ARGS.lookup.replace('\\', '/')]=0D else:=0D FILES =3D get_modified_files(REPO, ARGS)=0D =0D diff --git a/BaseTools/Scripts/GetUtcDateTime.py b/BaseTools/Scripts/GetUtc= DateTime.py index 3cfb6ac2ae77..8327854835c5 100644 --- a/BaseTools/Scripts/GetUtcDateTime.py +++ b/BaseTools/Scripts/GetUtcDateTime.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Get current UTC date and time information and output as ascii code.=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D @@ -6,10 +6,11 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -VersionNumber =3D '0.1'=0D -import sys=0D -import datetime=0D import argparse=0D +import datetime=0D +import sys=0D +VersionNumber =3D '0.1'=0D +=0D =0D def Main():=0D PARSER =3D argparse.ArgumentParser(=0D @@ -26,19 +27,20 @@ def Main(): =0D ARGS =3D PARSER.parse_args()=0D if len(sys.argv) =3D=3D 1:=0D - print ("ERROR: At least one argument is required!\n")=0D + print("ERROR: At least one argument is required!\n")=0D PARSER.print_help()=0D =0D today =3D datetime.datetime.utcnow()=0D if ARGS.year:=0D ReversedNumber =3D str(today.year)[::-1]=0D - print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNu= mber))=0D + print(''.join(hex(ord(HexString))[2:] for HexString in ReversedNum= ber))=0D if ARGS.date:=0D ReversedNumber =3D str(today.strftime("%m%d"))[::-1]=0D - print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNu= mber))=0D + print(''.join(hex(ord(HexString))[2:] for HexString in ReversedNum= ber))=0D if ARGS.time:=0D ReversedNumber =3D str(today.strftime("%H%M"))[::-1]=0D - print (''.join(hex(ord(HexString))[2:] for HexString in ReversedNu= mber))=0D + print(''.join(hex(ord(HexString))[2:] for HexString in ReversedNum= ber))=0D +=0D =0D if __name__ =3D=3D '__main__':=0D Main()=0D diff --git a/BaseTools/Scripts/MemoryProfileSymbolGen.py b/BaseTools/Script= s/MemoryProfileSymbolGen.py index 69df2fb99b30..0a2ee3f20311 100644 --- a/BaseTools/Scripts/MemoryProfileSymbolGen.py +++ b/BaseTools/Scripts/MemoryProfileSymbolGen.py @@ -17,6 +17,7 @@ from optparse import OptionParser versionNumber =3D "1.1"=0D __copyright__ =3D "Copyright (c) 2016 - 2018, Intel Corporation. All right= s reserved."=0D =0D +=0D class Symbols:=0D def __init__(self):=0D self.listLineAddress =3D []=0D @@ -26,36 +27,36 @@ class Symbols: # Cache for line=0D self.sourceName =3D ""=0D =0D -=0D - def getSymbol (self, rva):=0D + def getSymbol(self, rva):=0D index =3D 0=0D - lineName =3D 0=0D + lineName =3D 0=0D sourceName =3D "??"=0D - while index + 1 < self.lineCount :=0D - if self.listLineAddress[index][0] <=3D rva and self.listLineAd= dress[index + 1][0] > rva :=0D + while index + 1 < self.lineCount:=0D + if self.listLineAddress[index][0] <=3D rva and self.listLineAd= dress[index + 1][0] > rva:=0D offset =3D rva - self.listLineAddress[index][0]=0D functionName =3D self.listLineAddress[index][1]=0D lineName =3D self.listLineAddress[index][2]=0D sourceName =3D self.listLineAddress[index][3]=0D - if lineName =3D=3D 0 :=0D - return " (" + self.listLineAddress[index][1] + "() - " += ")"=0D - else :=0D - return " (" + self.listLineAddress[index][1] + "() - " += sourceName + ":" + str(lineName) + ")"=0D + if lineName =3D=3D 0:=0D + return " (" + self.listLineAddress[index][1] + "() - "= + ")"=0D + else:=0D + return " (" + self.listLineAddress[index][1] + "() - "= + sourceName + ":" + str(lineName) + ")"=0D index +=3D 1=0D =0D return " (unknown)"=0D =0D def parse_debug_file(self, driverName, pdbName):=0D - if cmp (pdbName, "") =3D=3D 0 :=0D + if cmp(pdbName, "") =3D=3D 0:=0D return=0D - self.pdbName =3D pdbName;=0D + self.pdbName =3D pdbName=0D =0D try:=0D nmCommand =3D "nm"=0D nmLineOption =3D "-l"=0D print("parsing (debug) - " + pdbName)=0D - os.system ('%s %s %s > nmDump.line.log' % (nmCommand, nmLineOp= tion, pdbName))=0D - except :=0D + os.system('%s %s %s > nmDump.line.log' %=0D + (nmCommand, nmLineOption, pdbName))=0D + except:=0D print('ERROR: nm command not available. Please verify PATH')= =0D return=0D =0D @@ -70,36 +71,38 @@ class Symbols: patchLineFileMatchString =3D "([0-9a-fA-F]*)\s+[T|D|t|d]\s+(\w+)\s= *((?:[a-zA-Z]:)?[\w+\-./_a-zA-Z0-9\\\\]*):?([0-9]*)"=0D =0D for reportLine in reportLines:=0D - #print "check - " + reportLine=0D + # print "check - " + reportLine=0D match =3D re.match(patchLineFileMatchString, reportLine)=0D if match is not None:=0D - #print "match - " + reportLine[:-1]=0D - #print "0 - " + match.group(0)=0D - #print "1 - " + match.group(1)=0D - #print "2 - " + match.group(2)=0D - #print "3 - " + match.group(3)=0D - #print "4 - " + match.group(4)=0D + # print "match - " + reportLine[:-1]=0D + # print "0 - " + match.group(0)=0D + # print "1 - " + match.group(1)=0D + # print "2 - " + match.group(2)=0D + # print "3 - " + match.group(3)=0D + # print "4 - " + match.group(4)=0D =0D - rva =3D int (match.group(1), 16)=0D + rva =3D int(match.group(1), 16)=0D functionName =3D match.group(2)=0D sourceName =3D match.group(3)=0D - if cmp (match.group(4), "") !=3D 0 :=0D - lineName =3D int (match.group(4))=0D - else :=0D + if cmp(match.group(4), "") !=3D 0:=0D + lineName =3D int(match.group(4))=0D + else:=0D lineName =3D 0=0D - self.listLineAddress.append ([rva, functionName, lineName,= sourceName])=0D + self.listLineAddress.append(=0D + [rva, functionName, lineName, sourceName])=0D =0D - self.lineCount =3D len (self.listLineAddress)=0D + self.lineCount =3D len(self.listLineAddress)=0D =0D - self.listLineAddress =3D sorted(self.listLineAddress, key=3Dlambda= symbolAddress:symbolAddress[0])=0D + self.listLineAddress =3D sorted(=0D + self.listLineAddress, key=3Dlambda symbolAddress: symbolAddres= s[0])=0D =0D - #for key in self.listLineAddress :=0D - #print "rva - " + "%x"%(key[0]) + ", func - " + key[1] + ", li= ne - " + str(key[2]) + ", source - " + key[3]=0D + # for key in self.listLineAddress :=0D + # print "rva - " + "%x"%(key[0]) + ", func - " + key[1] + ", line = - " + str(key[2]) + ", source - " + key[3]=0D =0D def parse_pdb_file(self, driverName, pdbName):=0D - if cmp (pdbName, "") =3D=3D 0 :=0D + if cmp(pdbName, "") =3D=3D 0:=0D return=0D - self.pdbName =3D pdbName;=0D + self.pdbName =3D pdbName=0D =0D try:=0D #DIA2DumpCommand =3D "\"C:\\Program Files (x86)\Microsoft Visu= al Studio 14.0\\DIA SDK\\Samples\\DIA2Dump\\x64\\Debug\\Dia2Dump.exe\""=0D @@ -108,8 +111,9 @@ class Symbols: DIA2LinesOption =3D "-l"=0D print("parsing (pdb) - " + pdbName)=0D #os.system ('%s %s %s > DIA2Dump.symbol.log' % (DIA2DumpComman= d, DIA2SymbolOption, pdbName))=0D - os.system ('%s %s %s > DIA2Dump.line.log' % (DIA2DumpCommand, = DIA2LinesOption, pdbName))=0D - except :=0D + os.system('%s %s %s > DIA2Dump.line.log' %=0D + (DIA2DumpCommand, DIA2LinesOption, pdbName))=0D + except:=0D print('ERROR: DIA2Dump command not available. Please verify P= ATH')=0D return=0D =0D @@ -129,108 +133,120 @@ class Symbols: patchLineFileMatchStringFunc =3D "\*\*\s+(\w+)\s*"=0D =0D for reportLine in reportLines:=0D - #print "check line - " + reportLine=0D + # print "check line - " + reportLine=0D match =3D re.match(patchLineFileMatchString, reportLine)=0D if match is not None:=0D - #print "match - " + reportLine[:-1]=0D - #print "0 - " + match.group(0)=0D - #print "1 - " + match.group(1)=0D - #print "2 - " + match.group(2)=0D - if cmp (match.group(3), "") !=3D 0 :=0D + # print "match - " + reportLine[:-1]=0D + # print "0 - " + match.group(0)=0D + # print "1 - " + match.group(1)=0D + # print "2 - " + match.group(2)=0D + if cmp(match.group(3), "") !=3D 0:=0D self.sourceName =3D match.group(3)=0D sourceName =3D self.sourceName=0D functionName =3D self.functionName=0D =0D - rva =3D int (match.group(2), 16)=0D - lineName =3D int (match.group(1))=0D - self.listLineAddress.append ([rva, functionName, lineName,= sourceName])=0D - else :=0D + rva =3D int(match.group(2), 16)=0D + lineName =3D int(match.group(1))=0D + self.listLineAddress.append(=0D + [rva, functionName, lineName, sourceName])=0D + else:=0D match =3D re.match(patchLineFileMatchStringFunc, reportLin= e)=0D if match is not None:=0D self.functionName =3D match.group(1)=0D =0D - self.lineCount =3D len (self.listLineAddress)=0D - self.listLineAddress =3D sorted(self.listLineAddress, key=3Dlambda= symbolAddress:symbolAddress[0])=0D + self.lineCount =3D len(self.listLineAddress)=0D + self.listLineAddress =3D sorted(=0D + self.listLineAddress, key=3Dlambda symbolAddress: symbolAddres= s[0])=0D +=0D + # for key in self.listLineAddress :=0D + # print "rva - " + "%x"%(key[0]) + ", func - " + key[1] + ", line = - " + str(key[2]) + ", source - " + key[3]=0D =0D - #for key in self.listLineAddress :=0D - #print "rva - " + "%x"%(key[0]) + ", func - " + key[1] + ", li= ne - " + str(key[2]) + ", source - " + key[3]=0D =0D class SymbolsFile:=0D def __init__(self):=0D self.symbolsTable =3D {}=0D =0D +=0D symbolsFile =3D ""=0D =0D driverName =3D ""=0D rvaName =3D ""=0D symbolName =3D ""=0D =0D +=0D def getSymbolName(driverName, rva):=0D global symbolsFile=0D =0D - #print "driverName - " + driverName=0D + # print "driverName - " + driverName=0D =0D - try :=0D + try:=0D symbolList =3D symbolsFile.symbolsTable[driverName]=0D if symbolList is not None:=0D - return symbolList.getSymbol (rva)=0D + return symbolList.getSymbol(rva)=0D else:=0D return " (???)"=0D except Exception:=0D return " (???)"=0D =0D +=0D def processLine(newline):=0D global driverName=0D global rvaName=0D =0D driverPrefixLen =3D len("Driver - ")=0D # get driver name=0D - if cmp(newline[0:driverPrefixLen], "Driver - ") =3D=3D 0 :=0D + if cmp(newline[0:driverPrefixLen], "Driver - ") =3D=3D 0:=0D driverlineList =3D newline.split(" ")=0D driverName =3D driverlineList[2]=0D - #print "Checking : ", driverName=0D + # print "Checking : ", driverName=0D =0D # EDKII application output=0D pdbMatchString =3D "Driver - \w* \(Usage - 0x[0-9a-fA-F]+\) \(Pdb = - ([:\-.\w\\\\/]*)\)\s*"=0D pdbName =3D ""=0D match =3D re.match(pdbMatchString, newline)=0D if match is not None:=0D - #print "match - " + newline=0D - #print "0 - " + match.group(0)=0D - #print "1 - " + match.group(1)=0D + # print "match - " + newline=0D + # print "0 - " + match.group(0)=0D + # print "1 - " + match.group(1)=0D pdbName =3D match.group(1)=0D - #print "PDB - " + pdbName=0D + # print "PDB - " + pdbName=0D =0D symbolsFile.symbolsTable[driverName] =3D Symbols()=0D =0D - if cmp (pdbName[-3:], "pdb") =3D=3D 0 :=0D - symbolsFile.symbolsTable[driverName].parse_pdb_file (driverNam= e, pdbName)=0D - else :=0D - symbolsFile.symbolsTable[driverName].parse_debug_file (driverN= ame, pdbName)=0D + if cmp(pdbName[-3:], "pdb") =3D=3D 0:=0D + symbolsFile.symbolsTable[driverName].parse_pdb_file(=0D + driverName, pdbName)=0D + else:=0D + symbolsFile.symbolsTable[driverName].parse_debug_file(=0D + driverName, pdbName)=0D =0D - elif cmp(newline, "") =3D=3D 0 :=0D + elif cmp(newline, "") =3D=3D 0:=0D driverName =3D ""=0D =0D # check entry line=0D - if newline.find ("<=3D=3D") !=3D -1 :=0D + if newline.find("<=3D=3D") !=3D -1:=0D entry_list =3D newline.split(" ")=0D rvaName =3D entry_list[4]=0D - #print "rva : ", rvaName=0D - symbolName =3D getSymbolName (driverName, int(rvaName, 16))=0D - else :=0D + # print "rva : ", rvaName=0D + symbolName =3D getSymbolName(driverName, int(rvaName, 16))=0D + else:=0D rvaName =3D ""=0D symbolName =3D ""=0D =0D - if cmp(rvaName, "") =3D=3D 0 :=0D + if cmp(rvaName, "") =3D=3D 0:=0D return newline=0D - else :=0D + else:=0D return newline + symbolName=0D =0D +=0D def myOptionParser():=0D usage =3D "%prog [--version] [-h] [--help] [-i inputfile [-o outputfil= e]]"=0D - Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__, ve= rsion=3D"%prog " + str(versionNumber))=0D - Parser.add_option("-i", "--inputfile", dest=3D"inputfilename", type=3D= "string", help=3D"The input memory profile info file output from MemoryProf= ileInfo application in MdeModulePkg")=0D - Parser.add_option("-o", "--outputfile", dest=3D"outputfilename", type= =3D"string", help=3D"The output memory profile info file with symbol, Memor= yProfileInfoSymbol.txt will be used if it is not specified")=0D + Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__,=0D + version=3D"%prog " + str(versionNumber))=0D + Parser.add_option("-i", "--inputfile", dest=3D"inputfilename", type=3D= "string",=0D + help=3D"The input memory profile info file output fr= om MemoryProfileInfo application in MdeModulePkg")=0D + Parser.add_option("-o", "--outputfile", dest=3D"outputfilename", type= =3D"string",=0D + help=3D"The output memory profile info file with sym= bol, MemoryProfileInfoSymbol.txt will be used if it is not specified")=0D =0D (Options, args) =3D Parser.parse_args()=0D if Options.inputfilename is None:=0D @@ -239,6 +255,7 @@ def myOptionParser(): Options.outputfilename =3D "MemoryProfileInfoSymbol.txt"=0D return Options=0D =0D +=0D def main():=0D global symbolsFile=0D global Options=0D @@ -246,12 +263,12 @@ def main(): =0D symbolsFile =3D SymbolsFile()=0D =0D - try :=0D + try:=0D file =3D open(Options.inputfilename)=0D except Exception:=0D print("fail to open " + Options.inputfilename)=0D return 1=0D - try :=0D + try:=0D newfile =3D open(Options.outputfilename, "w")=0D except Exception:=0D print("fail to open " + Options.outputfilename)=0D @@ -272,5 +289,6 @@ def main(): file.close()=0D newfile.close()=0D =0D +=0D if __name__ =3D=3D '__main__':=0D sys.exit(main())=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/__init__.py b/BaseTools= /Scripts/PackageDocumentTools/__init__.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/__init__.py +++ b/BaseTools/Scripts/PackageDocumentTools/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
=0D #=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py b/Bas= eTools/Scripts/PackageDocumentTools/packagedoc_cli.py index eb3164a553fa..3e7b6742c155 100644 --- a/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py +++ b/BaseTools/Scripts/PackageDocumentTools/packagedoc_cli.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This module provide command line entry for generating package document!= =0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
=0D @@ -7,23 +7,29 @@ #=0D =0D from __future__ import print_function=0D -import os, sys, logging, traceback, subprocess=0D +import os=0D +import sys=0D +import logging=0D +import traceback=0D +import subprocess=0D from optparse import OptionParser=0D =0D from plugins.EdkPlugins.edk2.model import baseobject=0D from plugins.EdkPlugins.edk2.model import doxygengen=0D =0D -gArchMarcoDict =3D {'ALL' : 'MDE_CPU_IA32 MDE_CPU_X64 MDE_CPU_EBC MDE= _CPU_IPF _MSC_EXTENSIONS __GNUC__ __INTEL_COMPILER',=0D +gArchMarcoDict =3D {'ALL': 'MDE_CPU_IA32 MDE_CPU_X64 MDE_CPU_EBC MDE_CPU_I= PF _MSC_EXTENSIONS __GNUC__ __INTEL_COMPILER',=0D 'IA32_MSFT': 'MDE_CPU_IA32 _MSC_EXTENSIONS',=0D - 'IA32_GNU' : 'MDE_CPU_IA32 __GNUC__',=0D - 'X64_MSFT' : 'MDE_CPU_X64 _MSC_EXTENSIONS ASM_PFX=3D OP= TIONAL=3D ',=0D - 'X64_GNU' : 'MDE_CPU_X64 __GNUC__ ASM_PFX=3D OPTIONAL= =3D ',=0D - 'IPF_MSFT' : 'MDE_CPU_IPF _MSC_EXTENSIONS ASM_PFX=3D OP= TIONAL=3D ',=0D - 'IPF_GNU' : 'MDE_CPU_IPF __GNUC__ ASM_PFX=3D OPTIONAL= =3D ',=0D + 'IA32_GNU': 'MDE_CPU_IA32 __GNUC__',=0D + 'X64_MSFT': 'MDE_CPU_X64 _MSC_EXTENSIONS ASM_PFX=3D OPT= IONAL=3D ',=0D + 'X64_GNU': 'MDE_CPU_X64 __GNUC__ ASM_PFX=3D OPTIONAL=3D= ',=0D + 'IPF_MSFT': 'MDE_CPU_IPF _MSC_EXTENSIONS ASM_PFX=3D OPT= IONAL=3D ',=0D + 'IPF_GNU': 'MDE_CPU_IPF __GNUC__ ASM_PFX=3D OPTIONAL=3D= ',=0D 'EBC_INTEL': 'MDE_CPU_EBC __INTEL_COMPILER ASM_PFX=3D O= PTIONAL=3D '}=0D =0D +=0D def parseCmdArgs():=0D - parser =3D OptionParser(version=3D"Package Document Generation Tools -= Version 0.1")=0D + parser =3D OptionParser(=0D + version=3D"Package Document Generation Tools - Version 0.1")=0D parser.add_option('-w', '--workspace', action=3D'store', type=3D'strin= g', dest=3D'WorkspacePath',=0D help=3D'Specify workspace absolute path. For example= : c:\\tianocore')=0D parser.add_option('-p', '--decfile', action=3D'store', dest=3D'Package= Path',=0D @@ -47,22 +53,27 @@ def parseCmdArgs(): if options.WorkspacePath is None:=0D errors.append('- Please specify workspace path via option -w!')=0D elif not os.path.exists(options.WorkspacePath):=0D - errors.append("- Invalid workspace path %s! The workspace path sho= uld be exist in absolute path!" % options.WorkspacePath)=0D + errors.append(=0D + "- Invalid workspace path %s! The workspace path should be exi= st in absolute path!" % options.WorkspacePath)=0D =0D if options.PackagePath is None:=0D errors.append('- Please specify package DEC file path via option -= p!')=0D elif not os.path.exists(options.PackagePath):=0D - errors.append("- Invalid package's DEC file path %s! The DEC path = should be exist in absolute path!" % options.PackagePath)=0D + errors.append(=0D + "- Invalid package's DEC file path %s! The DEC path should be = exist in absolute path!" % options.PackagePath)=0D =0D default =3D "C:\\Program Files\\doxygen\\bin\\doxygen.exe"=0D if options.DoxygenPath is None:=0D if os.path.exists(default):=0D - print("Warning: Assume doxygen tool is installed at %s. If not= , please specify via -x" % default)=0D + print(=0D + "Warning: Assume doxygen tool is installed at %s. If not, = please specify via -x" % default)=0D options.DoxygenPath =3D default=0D else:=0D - errors.append('- Please specify the path of doxygen tool insta= llation via option -x! or install it in default path %s' % default)=0D + errors.append(=0D + '- Please specify the path of doxygen tool installation vi= a option -x! or install it in default path %s' % default)=0D elif not os.path.exists(options.DoxygenPath):=0D - errors.append("- Invalid doxygen tool path %s! The doxygen tool pa= th should be exist in absolute path!" % options.DoxygenPath)=0D + errors.append(=0D + "- Invalid doxygen tool path %s! The doxygen tool path should = be exist in absolute path!" % options.DoxygenPath)=0D =0D if options.OutputPath is not None:=0D if not os.path.exists(options.OutputPath):=0D @@ -70,20 +81,24 @@ def parseCmdArgs(): try:=0D os.makedirs(options.OutputPath)=0D except:=0D - errors.append('- Fail to create the output directory %s' %= options.OutputPath)=0D + errors.append(=0D + '- Fail to create the output directory %s' % options.O= utputPath)=0D else:=0D if options.PackagePath is not None and os.path.exists(options.Pack= agePath):=0D dirpath =3D os.path.dirname(options.PackagePath)=0D - default =3D os.path.join (dirpath, "Document")=0D - print('Warning: Assume document output at %s. If not, please s= pecify via option -o' % default)=0D + default =3D os.path.join(dirpath, "Document")=0D + print(=0D + 'Warning: Assume document output at %s. If not, please spe= cify via option -o' % default)=0D options.OutputPath =3D default=0D if not os.path.exists(default):=0D try:=0D os.makedirs(default)=0D except:=0D - errors.append('- Fail to create default output directo= ry %s! Please specify document output diretory via option -o' % default)=0D + errors.append(=0D + '- Fail to create default output directory %s! Ple= ase specify document output diretory via option -o' % default)=0D else:=0D - errors.append('- Please specify document output path via optio= n -o!')=0D + errors.append(=0D + '- Please specify document output path via option -o!')=0D =0D if options.Arch is None:=0D options.Arch =3D 'ALL'=0D @@ -104,29 +119,35 @@ def parseCmdArgs(): print('Warning: Assume the installation path of Microsoft = HTML Workshop is %s. If not, specify via option -c.' % default)=0D options.HtmlWorkshopPath =3D default=0D else:=0D - errors.append('- Please specify the installation path of M= icrosoft HTML Workshop via option -c!')=0D + errors.append(=0D + '- Please specify the installation path of Microsoft H= TML Workshop via option -c!')=0D elif not os.path.exists(options.HtmlWorkshopPath):=0D - errors.append('- The installation path of Microsoft HTML Works= hop %s does not exists. ' % options.HtmlWorkshopPath)=0D + errors.append(=0D + '- The installation path of Microsoft HTML Workshop %s doe= s not exists. ' % options.HtmlWorkshopPath)=0D =0D if len(errors) !=3D 0:=0D print('\n')=0D - parser.error('Fail to start due to following reasons: \n%s' %'\n'.= join(errors))=0D + parser.error('Fail to start due to following reasons: \n%s' %=0D + '\n'.join(errors))=0D return (options.WorkspacePath, options.PackagePath, options.DoxygenPat= h, options.OutputPath,=0D options.Arch, options.DocumentMode, options.IncludeOnly, optio= ns.HtmlWorkshopPath)=0D =0D +=0D def createPackageObject(wsPath, pkgPath):=0D try:=0D pkgObj =3D baseobject.Package(None, wsPath)=0D pkgObj.Load(pkgPath)=0D except:=0D - logging.getLogger().error ('Fail to create package object!')=0D + logging.getLogger().error('Fail to create package object!')=0D return None=0D =0D return pkgObj=0D =0D +=0D def callbackLogMessage(msg, level):=0D print(msg.strip())=0D =0D +=0D def callbackCreateDoxygenProcess(doxPath, configPath):=0D if sys.platform =3D=3D 'win32':=0D cmd =3D '"%s" %s' % (doxPath, configPath)=0D @@ -146,7 +167,8 @@ def DocumentFixup(outPath, arch): if dir.lower() in ['.svn', '_svn', 'cvs']:=0D dirs.remove(dir)=0D for file in files:=0D - if not file.lower().endswith('.html'): continue=0D + if not file.lower().endswith('.html'):=0D + continue=0D fullpath =3D os.path.join(outPath, root, file)=0D try:=0D f =3D open(fullpath, 'r')=0D @@ -169,6 +191,7 @@ def DocumentFixup(outPath, arch): =0D print(' >>> Finish all document fixing up! \n')=0D =0D +=0D def FixPageBaseLib(path, text):=0D print(' >>> Fixup BaseLib file page at file %s \n' % path)=0D lines =3D text.split('\n')=0D @@ -184,13 +207,13 @@ def FixPageBaseLib(path, text): lines[index] =3D '#define BASE_LIBRARY_J= UMP_BUFFER_ALIGNMENT   9 [EBC, x64] '=0D if line.find('BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  &n= bsp;4') !=3D -1:=0D lines[index] =3D lines[index].replace('BASE_LIBRARY_JUMP_BUFFE= R_ALIGNMENT   4',=0D - 'BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT&n= bsp;  4 [IA32]')=0D + 'BASE_LIBRARY_JUMP_BUFFER_= ALIGNMENT   4 [IA32]')=0D if line.find('BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  &n= bsp;0x10') !=3D -1:=0D lines[index] =3D lines[index].replace('BASE_LIBRARY_JUMP_BUFFE= R_ALIGNMENT   0x10',=0D - 'BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT&n= bsp;  0x10 [IPF]')=0D + 'BASE_LIBRARY_JUMP_BUFFER_= ALIGNMENT   0x10 [IPF]')=0D if line.find('BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT  &n= bsp;8') !=3D -1:=0D lines[index] =3D lines[index].replace('BASE_LIBRARY_JUMP_BUFFE= R_ALIGNMENT   8',=0D - 'BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT&n= bsp;  8 [x64, EBC]')=0D + 'BASE_LIBRARY_JUMP_BUFFER_= ALIGNMENT   8 [x64, EBC]')=0D if line.find('>BASE_LIBRARY_JUMP_BUFFER') !=3D -1:=0D if lastBaseJumpIndex !=3D -1:=0D del lines[lastBaseJumpIndex]=0D @@ -208,15 +231,18 @@ def FixPageBaseLib(path, text): return=0D print(" <<< Finish to fixup file %s\n" % path)=0D =0D +=0D def FixPageIA32_IDT_GATE_DESCRIPTOR(path, text):=0D print(' >>> Fixup structure reference IA32_IDT_GATE_DESCRIPTOR at f= ile %s \n' % path)=0D lines =3D text.split('\n')=0D for index in range(len(lines) - 1, -1, -1):=0D line =3D lines[index].strip()=0D if line.find('struct {') !=3D -1 and lines[index - 2].find('>= Uint64') !=3D -1:=0D - lines.insert(index, '

Data Fields= For X64

')=0D + lines.insert(=0D + index, '

Data Fields For X64<= /h2>')=0D if line.find('struct {') !=3D -1 and lines[index - 1].find('D= ata Fields') !=3D -1:=0D - lines.insert(index, '

Data Fields= For IA32

')=0D + lines.insert(=0D + index, '

Data Fields For IA32=

')=0D try:=0D f =3D open(path, 'w')=0D f.write('\n'.join(lines))=0D @@ -226,6 +252,7 @@ def FixPageIA32_IDT_GATE_DESCRIPTOR(path, text): return=0D print(" <<< Finish to fixup file %s\n" % path)=0D =0D +=0D def FixPageBASE_LIBRARY_JUMP_BUFFER(path, text):=0D print(' >>> Fixup structure reference BASE_LIBRARY_JUMP_BUFFER at f= ile %s \n' % path)=0D lines =3D text.split('\n')=0D @@ -237,23 +264,27 @@ def FixPageBASE_LIBRARY_JUMP_BUFFER(path, text): bInDetail =3D False=0D if line.startswith('EBC context buffer used by') and lines[index -= 1].startswith('x64 context buffer'):=0D lines[index] =3D "IA32/IPF/X64/" + line=0D - bNeedRemove =3D True=0D + bNeedRemove =3D True=0D if line.startswith("x64 context buffer") or line.startswith('IPF c= ontext buffer used by') or \=0D line.startswith('IA32 context buffer used by'):=0D if bNeedRemove:=0D lines.remove(line)=0D if line.find('>R0') !=3D -1 and not bInDetail:=0D if lines[index - 1] !=3D '

Data F= ields For EBC

':=0D - lines.insert(index, '

Data Fi= elds For EBC

')=0D + lines.insert(=0D + index, '

Data Fields For = EBC

')=0D if line.find('>Rbx') !=3D -1 and not bInDetail:=0D if lines[index - 1] !=3D '

Data F= ields For X64

':=0D - lines.insert(index, '

Data Fi= elds For X64

')=0D + lines.insert(=0D + index, '

Data Fields For = X64

')=0D if line.find('>F2') !=3D -1 and not bInDetail:=0D if lines[index - 1] !=3D '

Data F= ields For IPF

':=0D - lines.insert(index, '

Data Fi= elds For IPF

')=0D + lines.insert(=0D + index, '

Data Fields For = IPF

')=0D if line.find('>Ebx') !=3D -1 and not bInDetail:=0D if lines[index - 1] !=3D '

Data F= ields For IA32

':=0D - lines.insert(index, '

Data Fi= elds For IA32

')=0D + lines.insert(=0D + index, '

Data Fields For = IA32

')=0D try:=0D f =3D open(path, 'w')=0D f.write('\n'.join(lines))=0D @@ -263,17 +294,18 @@ def FixPageBASE_LIBRARY_JUMP_BUFFER(path, text): return=0D print(" <<< Finish to fixup file %s\n" % path)=0D =0D +=0D def FixPageUefiDriverEntryPoint(path, text):=0D print(' >>> Fixup file reference MdePkg/Include/Library/UefiDriverE= ntryPoint.h at file %s \n' % path)=0D lines =3D text.split('\n')=0D bInModuleEntry =3D False=0D - bInEfiMain =3D False=0D - ModuleEntryDlCount =3D 0=0D + bInEfiMain =3D False=0D + ModuleEntryDlCount =3D 0=0D ModuleEntryDelStart =3D 0=0D - ModuleEntryDelEnd =3D 0=0D - EfiMainDlCount =3D 0=0D - EfiMainDelStart =3D 0=0D - EfiMainDelEnd =3D 0=0D + ModuleEntryDelEnd =3D 0=0D + EfiMainDlCount =3D 0=0D + EfiMainDelStart =3D 0=0D + EfiMainDelEnd =3D 0=0D =0D for index in range(len(lines)):=0D line =3D lines[index].strip()=0D @@ -320,13 +352,13 @@ def FixPageUefiApplicationEntryPoint(path, text): print(' >>> Fixup file reference MdePkg/Include/Library/UefiApplica= tionEntryPoint.h at file %s \n' % path)=0D lines =3D text.split('\n')=0D bInModuleEntry =3D False=0D - bInEfiMain =3D False=0D - ModuleEntryDlCount =3D 0=0D + bInEfiMain =3D False=0D + ModuleEntryDlCount =3D 0=0D ModuleEntryDelStart =3D 0=0D - ModuleEntryDelEnd =3D 0=0D - EfiMainDlCount =3D 0=0D - EfiMainDelStart =3D 0=0D - EfiMainDelEnd =3D 0=0D + ModuleEntryDelEnd =3D 0=0D + EfiMainDlCount =3D 0=0D + EfiMainDelStart =3D 0=0D + EfiMainDelEnd =3D 0=0D =0D for index in range(len(lines)):=0D line =3D lines[index].strip()=0D @@ -368,12 +400,14 @@ def FixPageUefiApplicationEntryPoint(path, text): return=0D print(" <<< Finish to fixup file %s\n" % path)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D wspath, pkgpath, doxpath, outpath, archtag, docmode, isinc, hwpath =3D= parseCmdArgs()=0D =0D # configure logging system=0D logfilepath =3D os.path.join(outpath, 'log.txt')=0D - logging.basicConfig(format=3D'%(levelname)-8s %(message)s', level=3Dlo= gging.DEBUG)=0D + logging.basicConfig(=0D + format=3D'%(levelname)-8s %(message)s', level=3Dlogging.DEBUG)=0D =0D # create package model object firstly=0D pkgObj =3D createPackageObject(wspath, pkgpath)=0D @@ -381,13 +415,13 @@ if __name__ =3D=3D '__main__': sys.exit(-1)=0D =0D # create doxygen action model=0D - arch =3D None=0D + arch =3D None=0D tooltag =3D None=0D if archtag.lower() !=3D 'all':=0D arch =3D archtag.split('_')[0]=0D tooltag =3D archtag.split('_')[1]=0D else:=0D - arch =3D 'all'=0D + arch =3D 'all'=0D tooltag =3D 'all'=0D =0D # preprocess package and call doxygen=0D @@ -419,6 +453,8 @@ if __name__ =3D=3D '__main__': else:=0D cmd =3D '%s %s' % (hwpath, indexpath)=0D subprocess.call(cmd)=0D - print('\nFinish to generate package document! Please open %s for r= eview' % os.path.join(outpath, 'html', 'index.chm'))=0D + print('\nFinish to generate package document! Please open %s for r= eview' %=0D + os.path.join(outpath, 'html', 'index.chm'))=0D else:=0D - print('\nFinish to generate package document! Please open %s for r= eview' % os.path.join(outpath, 'html', 'index.html'))=0D + print('\nFinish to generate package document! Please open %s for r= eview' %=0D + os.path.join(outpath, 'html', 'index.html'))=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__in= it__.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__init_= _.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__init__.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
=0D #=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/__init__.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugi= ns/basemodel/__init__.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/_= _init__.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/_= _init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
=0D #=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/doxygen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugin= s/basemodel/doxygen.py index a8f87751a0fa..9081234a9088 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/d= oxygen.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/d= oxygen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
=0D #=0D @@ -11,10 +11,11 @@ import os =0D from .message import *=0D =0D +=0D class BaseDoxygeItem:=0D def __init__(self, name, tag=3D''):=0D self.mName =3D name=0D - self.mTag =3D tag=0D + self.mTag =3D tag=0D self.mDescription =3D ''=0D self.mText =3D []=0D =0D @@ -27,6 +28,7 @@ class BaseDoxygeItem: def Generate(self):=0D """This interface need to be override"""=0D =0D +=0D class Section(BaseDoxygeItem):=0D def Generate(self):=0D """This interface need to be override"""=0D @@ -38,13 +40,14 @@ class Section(BaseDoxygeItem): self.mText.append(self.mDescription)=0D return self.mText=0D =0D +=0D class Page(BaseDoxygeItem):=0D def __init__(self, name, tag=3DNone, isSort=3DTrue):=0D BaseDoxygeItem.__init__(self, name, tag)=0D - self.mSubPages =3D []=0D - self.mIsMainPage =3D False=0D - self.mSections =3D []=0D - self.mIsSort =3D isSort=0D + self.mSubPages =3D []=0D + self.mIsMainPage =3D False=0D + self.mSections =3D []=0D + self.mIsSort =3D isSort=0D =0D def GetSubpageCount(self):=0D return len(self.mSubPages)=0D @@ -88,7 +91,8 @@ class Page(BaseDoxygeItem): if self.mIsSort:=0D self.mSubPages.sort(key=3Dlambda x: x.mName.lower())=0D for page in self.mSubPages:=0D - self.mText.insert(endIndex, '
  • \subpage %s \"%s\"
  • '= % (page.mTag, page.mName))=0D + self.mText.insert(=0D + endIndex, '
  • \subpage %s \"%s\"
  • ' % (page.mTag,= page.mName))=0D endIndex +=3D 1=0D self.mText +=3D page.Generate()=0D self.mText.insert(endIndex, '')=0D @@ -96,10 +100,11 @@ class Page(BaseDoxygeItem): self.mText.insert(endIndex, ' **/')=0D return self.mText=0D =0D +=0D class DoxygenFile(Page):=0D def __init__(self, name, file):=0D Page.__init__(self, name)=0D - self.mFilename =3D file=0D + self.mFilename =3D file=0D self.mIsMainPage =3D True=0D =0D def GetFilename(self):=0D @@ -112,11 +117,12 @@ class DoxygenFile(Page): f.write('\n'.join(str))=0D f.close()=0D except IOError as e:=0D - ErrorMsg ('Fail to write file %s' % self.mFilename)=0D + ErrorMsg('Fail to write file %s' % self.mFilename)=0D return False=0D =0D return True=0D =0D +=0D doxygenConfigTemplate =3D """=0D DOXYFILE_ENCODING =3D UTF-8=0D PROJECT_NAME =3D %(ProjectName)s=0D @@ -326,19 +332,21 @@ DOT_CLEANUP =3D YES SEARCHENGINE =3D NO=0D =0D """=0D +=0D +=0D class DoxygenConfigFile:=0D def __init__(self):=0D - self.mProjectName =3D ''=0D - self.mOutputDir =3D ''=0D - self.mFileList =3D []=0D - self.mIncludeList =3D []=0D - self.mStripPath =3D ''=0D - self.mExamplePath =3D ''=0D - self.mPattern =3D ['*.c', '*.h',=0D - '*.asm', '*.s', '.nasm', '*.html', '*.dox']= =0D - self.mMode =3D 'HTML'=0D - self.mWarningFile =3D ''=0D - self.mPreDefined =3D []=0D + self.mProjectName =3D ''=0D + self.mOutputDir =3D ''=0D + self.mFileList =3D []=0D + self.mIncludeList =3D []=0D + self.mStripPath =3D ''=0D + self.mExamplePath =3D ''=0D + self.mPattern =3D ['*.c', '*.h',=0D + '*.asm', '*.s', '.nasm', '*.html', '*.dox']=0D + self.mMode =3D 'HTML'=0D + self.mWarningFile =3D ''=0D + self.mPreDefined =3D []=0D self.mProjectVersion =3D 0.1=0D =0D def SetChmMode(self):=0D @@ -399,7 +407,7 @@ class DoxygenConfigFile: self.mPreDefined.append(macro)=0D =0D def Generate(self, path):=0D - files =3D ' \\\n'.join(self.mFileList)=0D + files =3D ' \\\n'.join(self.mFileList)=0D includes =3D ' \\\n'.join(self.mIncludeList)=0D patterns =3D ' \\\n'.join(self.mPattern)=0D if self.mMode.lower() =3D=3D 'html':=0D @@ -409,32 +417,33 @@ class DoxygenConfigFile: sHtmlHelp =3D 'YES'=0D sTreeView =3D 'NO'=0D =0D - text =3D doxygenConfigTemplate % {'ProjectName':self.mProjectName,= =0D - 'OutputDir':self.mOutputDir,=0D - 'StripPath':self.mStripPath,=0D - 'ExamplePath':self.mExamplePath,=0D - 'FileList':files,=0D - 'Pattern':patterns,=0D - 'WhetherGenerateHtmlHelp':sHtmlHel= p,=0D - 'WhetherGenerateTreeView':sTreeVie= w,=0D - 'IncludePath':includes,=0D - 'WarningFile':self.mWarningFile,=0D - 'PreDefined':' '.join(self.mPreDef= ined),=0D - 'ProjectVersion':self.mProjectVers= ion}=0D + text =3D doxygenConfigTemplate % {'ProjectName': self.mProjectName= ,=0D + 'OutputDir': self.mOutputDir,=0D + 'StripPath': self.mStripPath,=0D + 'ExamplePath': self.mExamplePath,= =0D + 'FileList': files,=0D + 'Pattern': patterns,=0D + 'WhetherGenerateHtmlHelp': sHtmlHe= lp,=0D + 'WhetherGenerateTreeView': sTreeVi= ew,=0D + 'IncludePath': includes,=0D + 'WarningFile': self.mWarningFile,= =0D + 'PreDefined': ' '.join(self.mPreDe= fined),=0D + 'ProjectVersion': self.mProjectVer= sion}=0D try:=0D f =3D open(path, 'w')=0D f.write(text)=0D f.close()=0D except IOError as e:=0D - ErrorMsg ('Fail to generate doxygen config file %s' % path)=0D + ErrorMsg('Fail to generate doxygen config file %s' % path)=0D return False=0D =0D return True=0D =0D +=0D ########################################################################=0D # TEST CODE=0D ########################################################################=0D -if __name__=3D=3D '__main__':=0D +if __name__ =3D=3D '__main__':=0D df =3D DoxygenFile('Platform Document', 'm:\tree')=0D df.AddPage(Page('Module', 'module'))=0D p =3D df.AddPage(Page('Library', 'library'))=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/efibinary.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlug= ins/basemodel/efibinary.py index 1bc4938bfcdf..c0d7518317e3 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/e= fibinary.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/e= fibinary.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -13,9 +13,11 @@ import os import logging=0D import core.pe as pe=0D =0D +=0D def GetLogger():=0D return logging.getLogger('EFI Binary File')=0D =0D +=0D class EFIBinaryError(Exception):=0D def __init__(self, message):=0D Exception.__init__(self)=0D @@ -24,6 +26,7 @@ class EFIBinaryError(Exception): def GetMessage(self):=0D return self._message=0D =0D +=0D class EfiFd(object):=0D EFI_FV_HEADER_SIZE =3D 0x48=0D =0D @@ -43,28 +46,29 @@ class EfiFd(object): def GetFvs(self):=0D return self._fvs=0D =0D +=0D class EfiFv(object):=0D FILE_SYSTEM_GUID =3D uuid.UUID('{8c8ce578-8a3d-4f1c-9935-896185c32dd3}= ')=0D =0D def __init__(self, parent=3DNone):=0D - self._size =3D 0=0D - self._filename =3D None=0D - self._fvheader =3D None=0D + self._size =3D 0=0D + self._filename =3D None=0D + self._fvheader =3D None=0D self._blockentries =3D []=0D - self._ffs =3D []=0D + self._ffs =3D []=0D =0D # following field is for FV in FD=0D - self._parent =3D parent=0D - self._offset =3D 0=0D - self._raw =3D array.array('B')=0D + self._parent =3D parent=0D + self._offset =3D 0=0D + self._raw =3D array.array('B')=0D =0D def Load(self, fd):=0D - self._offset =3D fd.tell()=0D + self._offset =3D fd.tell()=0D self._filename =3D fd.name=0D =0D # get file header=0D self._fvheader =3D EfiFirmwareVolumeHeader.Read(fd)=0D - #self._fvheader.Dump()=0D + # self._fvheader.Dump()=0D =0D self._size =3D self._fvheader.GetFvLength()=0D =0D @@ -80,10 +84,10 @@ class EfiFv(object): self._blockentries.append(blockentry)=0D blockentry =3D BlockMapEntry.Read(fd)=0D =0D -=0D if self._fvheader.GetSize() + (len(self._blockentries)) * 8 !=3D \= =0D self._fvheader.GetHeaderLength():=0D - raise EFIBinaryError("Volume Header length not consistent with= block map!")=0D + raise EFIBinaryError(=0D + "Volume Header length not consistent with block map!")=0D =0D index =3D align(fd.tell(), 8)=0D count =3D 0=0D @@ -120,10 +124,11 @@ class EfiFv(object): def GetRawData(self):=0D return self._raw.tolist()=0D =0D +=0D class BinaryItem(object):=0D def __init__(self, parent=3DNone):=0D self._size =3D 0=0D - self._arr =3D array.array('B')=0D + self._arr =3D array.array('B')=0D self._parent =3D parent=0D =0D @classmethod=0D @@ -144,6 +149,7 @@ class BinaryItem(object): def GetParent(self):=0D return self._parent=0D =0D +=0D class EfiFirmwareVolumeHeader(BinaryItem):=0D def GetSize(self):=0D return 56=0D @@ -267,6 +273,7 @@ class EfiFirmwareVolumeHeader(BinaryItem): def GetRawData(self):=0D return self._arr.tolist()=0D =0D +=0D class BlockMapEntry(BinaryItem):=0D def GetSize(self):=0D return 8=0D @@ -285,15 +292,16 @@ class BlockMapEntry(BinaryItem): def __str__(self):=0D return '[BlockEntry] Number =3D 0x%X, length=3D0x%X' % (self.GetNu= mberBlocks(), self.GetLength())=0D =0D +=0D class EfiFfs(object):=0D - FFS_HEADER_SIZE =3D 24=0D + FFS_HEADER_SIZE =3D 24=0D =0D def __init__(self, parent=3DNone):=0D self._header =3D None=0D =0D # following field is for FFS in FV file.=0D - self._parent =3D parent=0D - self._offset =3D 0=0D + self._parent =3D parent=0D + self._offset =3D 0=0D self._sections =3D []=0D =0D def Load(self, fd):=0D @@ -335,8 +343,8 @@ class EfiFfs(object): return self._header.GetNameGuid()=0D =0D def DumpContent(self):=0D - list =3D self._content.tolist()=0D - line =3D []=0D + list =3D self._content.tolist()=0D + line =3D []=0D count =3D 0=0D for item in list:=0D if count < 32:=0D @@ -358,13 +366,14 @@ class EfiFfs(object): def GetSections(self):=0D return self._sections=0D =0D +=0D class EfiFfsHeader(BinaryItem):=0D - ffs_state_map =3D {0x01:'EFI_FILE_HEADER_CONSTRUCTION',=0D - 0x02:'EFI_FILE_HEADER_VALID',=0D - 0x04:'EFI_FILE_DATA_VALID',=0D - 0x08:'EFI_FILE_MARKED_FOR_UPDATE',=0D - 0x10:'EFI_FILE_DELETED',=0D - 0x20:'EFI_FILE_HEADER_INVALID'}=0D + ffs_state_map =3D {0x01: 'EFI_FILE_HEADER_CONSTRUCTION',=0D + 0x02: 'EFI_FILE_HEADER_VALID',=0D + 0x04: 'EFI_FILE_DATA_VALID',=0D + 0x08: 'EFI_FILE_MARKED_FOR_UPDATE',=0D + 0x10: 'EFI_FILE_DELETED',=0D + 0x20: 'EFI_FILE_HEADER_INVALID'}=0D =0D def GetSize(self):=0D return 24=0D @@ -377,7 +386,6 @@ class EfiFfsHeader(BinaryItem): list =3D self._arr.tolist()=0D return int(list[18])=0D =0D -=0D def GetTypeString(self):=0D value =3D self.GetType()=0D if value =3D=3D 0x01:=0D @@ -454,7 +462,7 @@ class EfiSection(object): EFI_SECTION_HEADER_SIZE =3D 4=0D =0D def __init__(self, parent=3DNone):=0D - self._size =3D 0=0D + self._size =3D 0=0D self._parent =3D parent=0D self._offset =3D 0=0D self._contents =3D array.array('B')=0D @@ -465,8 +473,8 @@ class EfiSection(object): self._header =3D EfiSectionHeader.Read(fd, self)=0D =0D if self._header.GetTypeString() =3D=3D "EFI_SECTION_PE32":=0D - pefile =3D pe.PEFile(self)=0D - pefile.Load(fd, self.GetContentSize())=0D + pefile =3D pe.PEFile(self)=0D + pefile.Load(fd, self.GetContentSize())=0D =0D fd.seek(self._offset)=0D self._contents.fromfile(fd, self.GetContentSize())=0D @@ -491,6 +499,7 @@ class EfiSection(object): def GetSectionOffset(self):=0D return self._offset + self.EFI_SECTION_HEADER_SIZE=0D =0D +=0D class EfiSectionHeader(BinaryItem):=0D section_type_map =3D {0x01: 'EFI_SECTION_COMPRESSION',=0D 0x02: 'EFI_SECTION_GUID_DEFINED',=0D @@ -505,6 +514,7 @@ class EfiSectionHeader(BinaryItem): 0x18: 'EFI_SECTION_FREEFORM_SUBTYPE_GUID',=0D 0x19: 'EFI_SECTION_RAW',=0D 0x1B: 'EFI_SECTION_PEI_DEPEX'}=0D +=0D def GetSize(self):=0D return 4=0D =0D @@ -527,8 +537,10 @@ class EfiSectionHeader(BinaryItem): print('type =3D 0x%X' % self.GetType())=0D =0D =0D +rMapEntry =3D re.compile(=0D + '^(\w+)[ \(\w\)]* \(BaseAddress=3D([0-9a-fA-F]+), EntryPoint=3D([0-9a-= fA-F]+), GUID=3D([0-9a-fA-F\-]+)')=0D +=0D =0D -rMapEntry =3D re.compile('^(\w+)[ \(\w\)]* \(BaseAddress=3D([0-9a-fA-F]+),= EntryPoint=3D([0-9a-fA-F]+), GUID=3D([0-9a-fA-F\-]+)')=0D class EfiFvMapFile(object):=0D def __init__(self):=0D self._mapentries =3D {}=0D @@ -549,12 +561,13 @@ class EfiFvMapFile(object): # new entry=0D ret =3D rMapEntry.match(line)=0D if ret is not None:=0D - name =3D ret.groups()[0]=0D + name =3D ret.groups()[0]=0D baseaddr =3D int(ret.groups()[1], 16)=0D - entry =3D int(ret.groups()[2], 16)=0D - guidstr =3D '{' + ret.groups()[3] + '}'=0D - guid =3D uuid.UUID(guidstr)=0D - self._mapentries[guid] =3D EfiFvMapFileEntry(name, bas= eaddr, entry, guid)=0D + entry =3D int(ret.groups()[2], 16)=0D + guidstr =3D '{' + ret.groups()[3] + '}'=0D + guid =3D uuid.UUID(guidstr)=0D + self._mapentries[guid] =3D EfiFvMapFileEntry(=0D + name, baseaddr, entry, guid)=0D return True=0D =0D def GetEntry(self, guid):=0D @@ -562,12 +575,13 @@ class EfiFvMapFile(object): return self._mapentries[guid]=0D return None=0D =0D +=0D class EfiFvMapFileEntry(object):=0D def __init__(self, name, baseaddr, entry, guid):=0D - self._name =3D name=0D + self._name =3D name=0D self._baseaddr =3D baseaddr=0D - self._entry =3D entry=0D - self._guid =3D guid=0D + self._entry =3D entry=0D + self._guid =3D guid=0D =0D def GetName(self):=0D return self._name=0D @@ -578,6 +592,7 @@ class EfiFvMapFileEntry(object): def GetEntryPoint(self):=0D return self._entry=0D =0D +=0D def list2guid(list):=0D val1 =3D list2int(list[0:4])=0D val2 =3D list2int(list[4:6])=0D @@ -586,20 +601,25 @@ def list2guid(list): for item in list[8:16]:=0D val4 =3D (val4 << 8) | int(item)=0D =0D - val =3D val1 << 12 * 8 | val2 << 10 * 8 | val3 << 8 * 8 | val4=0D + val =3D val1 << 12 * 8 | val2 << 10 * 8 | val3 << 8 * 8 | val4=0D guid =3D uuid.UUID(int=3Dval)=0D return guid=0D =0D +=0D def list2int(list):=0D val =3D 0=0D for index in range(len(list) - 1, -1, -1):=0D val =3D (val << 8) | int(list[index])=0D return val=0D =0D +=0D def align(value, alignment):=0D return (value + ((alignment - value) & (alignment - 1)))=0D =0D +=0D gInvalidGuid =3D uuid.UUID(int=3D0xffffffffffffffffffffffffffffffff)=0D +=0D +=0D def isValidGuid(guid):=0D if guid =3D=3D gInvalidGuid:=0D return False=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/ini.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/ba= semodel/ini.py index 7facb9aa24c7..c51195d58336 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/i= ni.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/i= ni.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -12,16 +12,19 @@ import os =0D section_re =3D re.compile(r'^\[([\w., "]+)\]')=0D =0D +=0D class BaseINIFile(object):=0D _objs =3D {}=0D +=0D def __new__(cls, *args, **kwargs):=0D """Maintain only a single instance of this object=0D @return: instance of this class=0D =0D """=0D - if len(args) =3D=3D 0: return object.__new__(cls)=0D + if len(args) =3D=3D 0:=0D + return object.__new__(cls)=0D filename =3D args[0]=0D - parent =3D None=0D + parent =3D None=0D if len(args) > 1:=0D parent =3D args[1]=0D =0D @@ -35,19 +38,21 @@ class BaseINIFile(object): return cls._objs[key]=0D =0D def __init__(self, filename=3DNone, parent=3DNone):=0D - self._lines =3D []=0D + self._lines =3D []=0D self._sections =3D {}=0D self._filename =3D filename=0D - self._globals =3D []=0D + self._globals =3D []=0D self._isModify =3D True=0D =0D def AddParent(self, parent):=0D - if parent is None: return=0D + if parent is None:=0D + return=0D if not hasattr(self, "_parents"):=0D self._parents =3D []=0D =0D if parent in self._parents:=0D - ErrorMsg("Duplicate parent is found for INI file %s" % self._f= ilename)=0D + ErrorMsg("Duplicate parent is found for INI file %s" %=0D + self._filename)=0D return=0D self._parents.append(parent)=0D =0D @@ -58,7 +63,8 @@ class BaseINIFile(object): return self._isModify=0D =0D def Modify(self, modify=3DTrue, obj=3DNone):=0D - if modify =3D=3D self._isModify: return=0D + if modify =3D=3D self._isModify:=0D + return=0D self._isModify =3D modify=0D if modify:=0D for parent in self._parents:=0D @@ -73,7 +79,7 @@ class BaseINIFile(object): =0D try:=0D handle =3D open(filename, 'r')=0D - self._lines =3D handle.readlines()=0D + self._lines =3D handle.readlines()=0D handle.close()=0D except:=0D raise EdkException("Fail to open file %s" % filename)=0D @@ -102,22 +108,25 @@ class BaseINIFile(object): return arr=0D =0D def Parse(self):=0D - if not self._isModify: return True=0D - if not self._ReadLines(self._filename): return False=0D + if not self._isModify:=0D + return True=0D + if not self._ReadLines(self._filename):=0D + return False=0D =0D - sObjs =3D []=0D + sObjs =3D []=0D inGlobal =3D True=0D # process line=0D for index in range(len(self._lines)):=0D templine =3D self._lines[index].strip()=0D # skip comments=0D - if len(templine) =3D=3D 0: continue=0D + if len(templine) =3D=3D 0:=0D + continue=0D if re.match("^\[=3D*\]", templine) or re.match("^#", templine)= or \=0D re.match("\*+/", templine):=0D continue=0D =0D m =3D section_re.match(templine)=0D - if m is not None: # found a section=0D + if m is not None: # found a section=0D inGlobal =3D False=0D # Finish the latest section first=0D if len(sObjs) !=3D 0:=0D @@ -132,7 +141,8 @@ class BaseINIFile(object): sname_arr =3D m.groups()[0].split(',')=0D sObjs =3D []=0D for name in sname_arr:=0D - sObj =3D self.GetSectionInstance(self, name, (len(snam= e_arr) > 1))=0D + sObj =3D self.GetSectionInstance(=0D + self, name, (len(sname_arr) > 1))=0D sObj._start =3D index=0D sObjs.append(sObj)=0D if name.lower() not in self._sections:=0D @@ -164,14 +174,16 @@ class BaseINIFile(object): assert parent in self._parents, "when destory ini object, can = not found parent reference!"=0D self._parents.remove(parent)=0D =0D - if len(self._parents) !=3D 0: return=0D + if len(self._parents) !=3D 0:=0D + return=0D =0D for sects in self._sections.values():=0D for sect in sects:=0D sect.Destroy()=0D =0D # dereference from _objs array=0D - assert self.GetFilename() in self._objs.keys(), "When destroy ini = object, can not find obj reference!"=0D + assert self.GetFilename() in self._objs.keys(=0D + ), "When destroy ini object, can not find obj reference!"=0D assert self in self._objs.values(), "When destroy ini object, can = not find obj reference!"=0D del self._objs[self.GetFilename()]=0D =0D @@ -208,12 +220,13 @@ class BaseINIFile(object): =0D def AddNewSection(self, sectName):=0D if sectName.lower() in self._sections.keys():=0D - ErrorMsg('Section %s can not be created for conflict with exis= ting section')=0D + ErrorMsg(=0D + 'Section %s can not be created for conflict with existing = section')=0D return None=0D =0D sectionObj =3D self.GetSectionInstance(self, sectName)=0D sectionObj._start =3D len(self._lines)=0D - sectionObj._end =3D len(self._lines) + 1=0D + sectionObj._end =3D len(self._lines) + 1=0D self._lines.append('[%s]\n' % sectName)=0D self._lines.append('\n\n')=0D self._sections[sectName.lower()] =3D sectionObj=0D @@ -228,19 +241,19 @@ class BaseINIFile(object): def __str__(self):=0D return ''.join(self._lines)=0D =0D - ## Get file header's comment from basic INI file.=0D + # Get file header's comment from basic INI file.=0D # The file comments has two style:=0D # 1) #/** @file=0D # 2) ## @file=0D #=0D def GetFileHeader(self):=0D desc =3D []=0D - lineArr =3D self._lines=0D + lineArr =3D self._lines=0D inHeader =3D False=0D for num in range(len(self._lines)):=0D line =3D lineArr[num].strip()=0D if not inHeader and (line.startswith("#/**") or line.startswit= h("##")) and \=0D - line.find("@file") !=3D -1:=0D + line.find("@file") !=3D -1:=0D inHeader =3D True=0D continue=0D if inHeader and (line.startswith("#**/") or line.startswith('#= #')):=0D @@ -254,14 +267,15 @@ class BaseINIFile(object): desc.append(line[prefixIndex + 1:])=0D return '
    \n'.join(desc)=0D =0D +=0D class BaseINISection(object):=0D def __init__(self, parent, name, isCombined=3DFalse):=0D - self._parent =3D parent=0D - self._name =3D name=0D + self._parent =3D parent=0D + self._name =3D name=0D self._isCombined =3D isCombined=0D - self._start =3D 0=0D - self._end =3D 0=0D - self._objs =3D []=0D + self._start =3D 0=0D + self._end =3D 0=0D + self._objs =3D []=0D =0D def __del__(self):=0D for obj in self._objs:=0D @@ -354,7 +368,7 @@ class BaseINISection(object): =0D def GetComment(self):=0D comments =3D []=0D - start =3D self._start - 1=0D + start =3D self._start - 1=0D bFound =3D False=0D =0D while (start > 0):=0D @@ -376,18 +390,21 @@ class BaseINISection(object): end =3D start + 1=0D while (end < self._start):=0D line =3D self.GetLine(end).strip()=0D - if len(line) =3D=3D 0: break=0D - if not line.startswith('#'): break=0D + if len(line) =3D=3D 0:=0D + break=0D + if not line.startswith('#'):=0D + break=0D index =3D line.rfind('#')=0D if (index + 1) < len(line):=0D comments.append(line[index + 1:])=0D end +=3D 1=0D return comments=0D =0D +=0D class BaseINIGlobalObject(object):=0D def __init__(self, parent):=0D self._start =3D 0=0D - self._end =3D 0=0D + self._end =3D 0=0D =0D def Parse(self):=0D return True=0D @@ -398,10 +415,11 @@ class BaseINIGlobalObject(object): def __del__(self):=0D pass=0D =0D +=0D class BaseINISectionObject(object):=0D def __init__(self, parent):=0D - self._start =3D 0=0D - self._end =3D 0=0D + self._start =3D 0=0D + self._end =3D 0=0D self._parent =3D parent=0D =0D def __del__(self):=0D @@ -444,7 +462,7 @@ class BaseINISectionObject(object): =0D def GetComment(self):=0D comments =3D []=0D - start =3D self.GetStartLinenumber() - 1=0D + start =3D self.GetStartLinenumber() - 1=0D bFound =3D False=0D =0D while (start > 0):=0D @@ -466,8 +484,10 @@ class BaseINISectionObject(object): end =3D start + 1=0D while (end <=3D self.GetStartLinenumber() - 1):=0D line =3D self.GetParent().GetLine(end).strip()=0D - if len(line) =3D=3D 0: break=0D - if not line.startswith('#'): break=0D + if len(line) =3D=3D 0:=0D + break=0D + if not line.startswith('#'):=0D + break=0D index =3D line.rfind('#')=0D if (index + 1) < len(line):=0D comments.append(line[index + 1:])=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/inidocview.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlu= gins/basemodel/inidocview.py index 849d0fc91a53..43e053fc0c60 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/i= nidocview.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/i= nidocview.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -7,6 +7,7 @@ =0D import core.editor=0D =0D +=0D class INIDoc(core.editor.EditorDocument):=0D def __init__(self):=0D core.editor.EditorDocument.__init__(self)=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/base= model/message.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugin= s/basemodel/message.py index 882538a1711b..636aa4d40378 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/m= essage.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/basemodel/m= essage.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -9,23 +9,28 @@ def GetEdkLogger(): import logging=0D return logging.getLogger('edk')=0D =0D +=0D class EdkException(Exception):=0D def __init__(self, message, fName=3DNone, fNo=3DNone):=0D self._message =3D message=0D ErrorMsg(message, fName, fNo)=0D =0D def GetMessage(self):=0D - return '[EDK Failure]: %s' %self._message=0D + return '[EDK Failure]: %s' % self._message=0D +=0D =0D def ErrorMsg(mess, fName=3DNone, fNo=3DNone):=0D GetEdkLogger().error(NormalMessage('#ERR#', mess, fName, fNo))=0D =0D +=0D def LogMsg(mess, fName=3DNone, fNo=3DNone):=0D GetEdkLogger().info(NormalMessage('@LOG@', mess, fName, fNo))=0D =0D +=0D def WarnMsg(mess, fName=3DNone, fNo=3DNone):=0D GetEdkLogger().warning(NormalMessage('!WAR!', mess, fName, fNo))=0D =0D +=0D def NormalMessage(type, mess, fName=3DNone, fNo=3DNone):=0D strMsg =3D type=0D =0D @@ -41,6 +46,3 @@ def NormalMessage(type, mess, fName=3DNone, fNo=3DNone): strMsg +=3D mess=0D =0D return strMsg=0D -=0D -=0D -=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /__init__.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/ed= k2/__init__.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/__init= __.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/__init= __.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/__init__.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlug= ins/edk2/model/__init__.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= __init__.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= __init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/baseobject.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPl= ugins/edk2/model/baseobject.py index ee00529f464b..307dac9949af 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= baseobject.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= baseobject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -11,6 +11,7 @@ from plugins.EdkPlugins.edk2.model import dec import os=0D from plugins.EdkPlugins.basemodel.message import *=0D =0D +=0D class SurfaceObject(object):=0D _objs =3D {}=0D =0D @@ -27,10 +28,10 @@ class SurfaceObject(object): return obj=0D =0D def __init__(self, parent, workspace):=0D - self._parent =3D parent=0D - self._fileObj =3D None=0D + self._parent =3D parent=0D + self._fileObj =3D None=0D self._workspace =3D workspace=0D - self._isModify =3D False=0D + self._isModify =3D False=0D self._modifiedObjs =3D []=0D =0D def __del__(self):=0D @@ -68,7 +69,8 @@ class SurfaceObject(object): =0D def Load(self, relativePath):=0D # if has been loaded, directly return=0D - if self._fileObj is not None: return True=0D + if self._fileObj is not None:=0D + return True=0D =0D relativePath =3D os.path.normpath(relativePath)=0D fullPath =3D os.path.join(self._workspace, relativePath)=0D @@ -133,11 +135,12 @@ class SurfaceObject(object): continue=0D return arr=0D =0D +=0D class Platform(SurfaceObject):=0D def __init__(self, parent, workspace):=0D SurfaceObject.__init__(self, parent, workspace)=0D - self._modules =3D []=0D - self._packages =3D []=0D + self._modules =3D []=0D + self._packages =3D []=0D =0D def Destroy(self):=0D for module in self._modules:=0D @@ -201,7 +204,8 @@ class Platform(SurfaceObject): =0D return obj.GetInstance()=0D =0D - ErrorMsg("Fail to get library class %s [%s][%s] from platform %s" = % (classname, arch, type, self.GetFilename()))=0D + ErrorMsg("Fail to get library class %s [%s][%s] from platform %s" = % (=0D + classname, arch, type, self.GetFilename()))=0D return None=0D =0D def GetPackage(self, path):=0D @@ -224,7 +228,8 @@ class Platform(SurfaceObject): # do not care force paramter for platform object=0D isFileChanged =3D self.GetFileObj().IsModified()=0D ret =3D SurfaceObject.Reload(self, False)=0D - if not ret: return False=0D + if not ret:=0D + return False=0D if isFileChanged:=0D # destroy all modules and reload them again=0D for obj in self._modules:=0D @@ -285,8 +290,10 @@ class Platform(SurfaceObject): for oldSect in sects:=0D newSect =3D newDsc.AddNewSection(oldSect.GetName())=0D for oldComObj in oldSect.GetObjects():=0D - module =3D self.GetModuleObject(oldComObj.GetFilename(), o= ldSect.GetArch())=0D - if module is None: continue=0D + module =3D self.GetModuleObject(=0D + oldComObj.GetFilename(), oldSect.GetArch())=0D + if module is None:=0D + continue=0D =0D newComObj =3D dsc.DSCComponentObject(newSect)=0D newComObj.SetFilename(oldComObj.GetFilename())=0D @@ -295,13 +302,14 @@ class Platform(SurfaceObject): libdict =3D module.GetLibraries()=0D for libclass in libdict.keys():=0D if libdict[libclass] is not None:=0D - newComObj.AddOverideLib(libclass, libdict[libclass= ].GetRelativeFilename().replace('\\', '/'))=0D + newComObj.AddOverideLib(=0D + libclass, libdict[libclass].GetRelativeFilenam= e().replace('\\', '/'))=0D =0D # add all pcds for override section=0D pcddict =3D module.GetPcds()=0D for pcd in pcddict.values():=0D - buildPcd =3D pcd.GetBuildObj()=0D - buildType =3D buildPcd.GetPcdType()=0D + buildPcd =3D pcd.GetBuildObj()=0D + buildType =3D buildPcd.GetPcdType()=0D buildValue =3D None=0D if buildType.lower() =3D=3D 'pcdsdynamichii' or \=0D buildType.lower() =3D=3D 'pcdsdynamicvpd' or \=0D @@ -315,20 +323,21 @@ class Platform(SurfaceObject): newSect.AddObject(newComObj)=0D return newDsc=0D =0D +=0D class Module(SurfaceObject):=0D def __init__(self, parent, workspace):=0D SurfaceObject.__init__(self, parent, workspace)=0D - self._arch =3D 'common'=0D - self._parent =3D parent=0D + self._arch =3D 'common'=0D + self._parent =3D parent=0D self._overidePcds =3D {}=0D self._overideLibs =3D {}=0D - self._libs =3D {}=0D - self._pcds =3D {}=0D - self._ppis =3D []=0D - self._protocols =3D []=0D - self._depexs =3D []=0D - self._guids =3D []=0D - self._packages =3D []=0D + self._libs =3D {}=0D + self._pcds =3D {}=0D + self._ppis =3D []=0D + self._protocols =3D []=0D + self._depexs =3D []=0D + self._guids =3D []=0D + self._packages =3D []=0D =0D def Destroy(self):=0D for lib in self._libs.values():=0D @@ -397,7 +406,8 @@ class Module(SurfaceObject): def GetPcds(self):=0D pcds =3D self._pcds.copy()=0D for lib in self._libs.values():=0D - if lib is None: continue=0D + if lib is None:=0D + continue=0D for name in lib._pcds.keys():=0D pcds[name] =3D lib._pcds[name]=0D return pcds=0D @@ -406,7 +416,8 @@ class Module(SurfaceObject): ppis =3D []=0D ppis +=3D self._ppis=0D for lib in self._libs.values():=0D - if lib is None: continue=0D + if lib is None:=0D + continue=0D ppis +=3D lib._ppis=0D return ppis=0D =0D @@ -414,7 +425,8 @@ class Module(SurfaceObject): pros =3D []=0D pros =3D self._protocols=0D for lib in self._libs.values():=0D - if lib is None: continue=0D + if lib is None:=0D + continue=0D pros +=3D lib._protocols=0D return pros=0D =0D @@ -422,7 +434,8 @@ class Module(SurfaceObject): guids =3D []=0D guids +=3D self._guids=0D for lib in self._libs.values():=0D - if lib is None: continue=0D + if lib is None:=0D + continue=0D guids +=3D lib._guids=0D return guids=0D =0D @@ -430,7 +443,8 @@ class Module(SurfaceObject): deps =3D []=0D deps +=3D self._depexs=0D for lib in self._libs.values():=0D - if lib is None: continue=0D + if lib is None:=0D + continue=0D deps +=3D lib._depexs=0D return deps=0D =0D @@ -449,13 +463,15 @@ class Module(SurfaceObject): if issubclass(parent.__class__, Platform):=0D path =3D parent.GetLibraryPath(classname, arch, type)=0D if path is None:=0D - ErrorMsg('Fail to get library instance for %s' % class= name, self.GetFilename())=0D + ErrorMsg('Fail to get library instance for %s' %=0D + classname, self.GetFilename())=0D return None=0D self._libs[classname] =3D Library(self, self.GetWorkspace(= ))=0D if not self._libs[classname].Load(path, self.GetArch()):=0D self._libs[classname] =3D None=0D else:=0D - self._libs[classname] =3D parent.GetLibraryInstance(classn= ame, arch, type)=0D + self._libs[classname] =3D parent.GetLibraryInstance(=0D + classname, arch, type)=0D return self._libs[classname]=0D =0D def GetSourceObjs(self):=0D @@ -479,14 +495,14 @@ class Module(SurfaceObject): =0D def _SearchSurfaceItems(self):=0D # get surface item from self's inf=0D - pcds =3D []=0D - ppis =3D []=0D - pros =3D []=0D - deps =3D []=0D + pcds =3D []=0D + ppis =3D []=0D + pros =3D []=0D + deps =3D []=0D guids =3D []=0D if self.GetFileObj() is not None:=0D pcds =3D self.FilterObjsByArch(self.GetFileObj().GetSectionObj= ectsByName('pcd'),=0D - self.GetArch())=0D + self.GetArch())=0D for pcd in pcds:=0D if pcd.GetPcdName() not in self._pcds.keys():=0D pcdItem =3D PcdItem(pcd.GetPcdName(), self, pcd)=0D @@ -518,7 +534,7 @@ class Module(SurfaceObject): self._depexs.append(item)=0D =0D guids +=3D self.FilterObjsByArch(self.GetFileObj().GetSectionO= bjectsByName('guids'),=0D - self.GetArch())=0D + self.GetArch())=0D for guid in guids:=0D item =3D GuidItem(guid.GetName(), self, guid)=0D if item not in self._guids:=0D @@ -542,7 +558,8 @@ class Module(SurfaceObject): =0D def GetLibraryClassHeaderFilePath(self):=0D lcname =3D self.GetFileObj().GetProduceLibraryClass()=0D - if lcname is None: return None=0D + if lcname is None:=0D + return None=0D =0D pkgs =3D self.GetPackages()=0D for package in pkgs:=0D @@ -556,7 +573,8 @@ class Module(SurfaceObject): callback(self, "Starting reload...")=0D =0D ret =3D SurfaceObject.Reload(self, force)=0D - if not ret: return False=0D + if not ret:=0D + return False=0D =0D if not force and not self.IsModified():=0D return True=0D @@ -612,6 +630,7 @@ class Module(SurfaceObject): self._isModify =3D modify=0D self.GetParent().Modify(modify, self)=0D =0D +=0D class Library(Module):=0D def __init__(self, parent, workspace):=0D Module.__init__(self, parent, workspace)=0D @@ -637,13 +656,14 @@ class Library(Module): self._pcds.clear()=0D SurfaceObject.Destroy(self)=0D =0D +=0D class Package(SurfaceObject):=0D def __init__(self, parent, workspace):=0D SurfaceObject.__init__(self, parent, workspace)=0D - self._pcds =3D {}=0D - self._guids =3D {}=0D + self._pcds =3D {}=0D + self._guids =3D {}=0D self._protocols =3D {}=0D - self._ppis =3D {}=0D + self._ppis =3D {}=0D =0D def GetPcds(self):=0D return self._pcds=0D @@ -679,19 +699,22 @@ class Package(SurfaceObject): =0D def Load(self, relativePath):=0D ret =3D SurfaceObject.Load(self, relativePath)=0D - if not ret: return False=0D + if not ret:=0D + return False=0D pcds =3D self.GetFileObj().GetSectionObjectsByName('pcds')=0D for pcd in pcds:=0D if pcd.GetPcdName() in self._pcds.keys():=0D if self._pcds[pcd.GetPcdName()] is not None:=0D self._pcds[pcd.GetPcdName()].AddDecObj(pcd)=0D else:=0D - self._pcds[pcd.GetPcdName()] =3D PcdItem(pcd.GetPcdName(),= self, pcd)=0D + self._pcds[pcd.GetPcdName()] =3D PcdItem(=0D + pcd.GetPcdName(), self, pcd)=0D =0D guids =3D self.GetFileObj().GetSectionObjectsByName('guids')=0D for guid in guids:=0D if guid.GetName() not in self._guids.keys():=0D - self._guids[guid.GetName()] =3D GuidItem(guid.GetName(), s= elf, guid)=0D + self._guids[guid.GetName()] =3D GuidItem(=0D + guid.GetName(), self, guid)=0D else:=0D WarnMsg("Duplicate definition for %s" % guid.GetName())=0D =0D @@ -705,7 +728,8 @@ class Package(SurfaceObject): protocols =3D self.GetFileObj().GetSectionObjectsByName('protocols= ')=0D for protocol in protocols:=0D if protocol.GetName() not in self._protocols.keys():=0D - self._protocols[protocol.GetName()] =3D ProtocolItem(proto= col.GetName(), self, protocol)=0D + self._protocols[protocol.GetName()] =3D ProtocolItem(=0D + protocol.GetName(), self, protocol)=0D else:=0D WarnMsg("Duplicate definition for %s" % protocol.GetName()= )=0D =0D @@ -720,7 +744,8 @@ class Package(SurfaceObject): def GetPcdDefineObjs(self, name=3DNone):=0D arr =3D []=0D objs =3D self.GetFileObj().GetSectionObjectsByName('pcds')=0D - if name is None: return objs=0D + if name is None:=0D + return objs=0D =0D for obj in objs:=0D if obj.GetPcdName().lower() =3D=3D name.lower():=0D @@ -748,6 +773,7 @@ class Package(SurfaceObject): return obj.GetHeaderFile()=0D return None=0D =0D +=0D class DepexItem(object):=0D def __init__(self, parent, infObj):=0D self._parent =3D parent=0D @@ -759,19 +785,21 @@ class DepexItem(object): def GetInfObject(self):=0D return self._infObj=0D =0D +=0D class ModulePcd(object):=0D _type_mapping =3D {'FeaturePcd': 'PcdsFeatureFlag',=0D 'FixedPcd': 'PcdsFixedAtBuild',=0D 'PatchPcd': 'PcdsPatchableInModule'}=0D =0D def __init__(self, parent, name, infObj, pcdItem):=0D - assert issubclass(parent.__class__, Module), "Module's PCD's paren= t must be module!"=0D + assert issubclass(parent.__class__,=0D + Module), "Module's PCD's parent must be module!"= =0D assert pcdItem is not None, 'Pcd %s does not in some package!' % n= ame=0D =0D - self._name =3D name=0D - self._parent =3D parent=0D - self._pcdItem =3D pcdItem=0D - self._infObj =3D infObj=0D + self._name =3D name=0D + self._parent =3D parent=0D + self._pcdItem =3D pcdItem=0D + self._infObj =3D infObj=0D =0D def GetName(self):=0D return self._name=0D @@ -787,7 +815,8 @@ class ModulePcd(object): self._infObj =3D None=0D =0D def GetBuildObj(self):=0D - platformInfos =3D self._parent.GetPlatform().GetPcdBuildObjs(self.= _name, self.GetArch())=0D + platformInfos =3D self._parent.GetPlatform(=0D + ).GetPcdBuildObjs(self._name, self.GetArch())=0D modulePcdType =3D self._infObj.GetPcdType()=0D =0D # if platform do not gives pcd's value, get default value from pac= kage=0D @@ -802,12 +831,12 @@ class ModulePcd(object): =0D if self._type_mapping[modulePcdType] =3D=3D obj.GetPcd= Type():=0D return obj=0D - ErrorMsg ('Module PCD type %s does not in valied range [%s= ] in package!' % \=0D - (modulePcdType))=0D + ErrorMsg('Module PCD type %s does not in valied range [%s]= in package!' %=0D + (modulePcdType))=0D else:=0D if modulePcdType.lower() =3D=3D 'pcd':=0D if len(platformInfos) > 1:=0D - WarnMsg("Find more than one value for PCD %s in platfo= rm %s" % \=0D + WarnMsg("Find more than one value for PCD %s in platfo= rm %s" %=0D (self._name, self._parent.GetPlatform().GetFil= ename()))=0D return platformInfos[0]=0D else:=0D @@ -819,7 +848,7 @@ class ModulePcd(object): if self._type_mapping[modulePcdType] =3D=3D obj.GetPcd= Type():=0D return obj=0D =0D - ErrorMsg('Can not find value for pcd %s in pcd type %s' % = \=0D + ErrorMsg('Can not find value for pcd %s in pcd type %s' %= =0D (self._name, modulePcdType))=0D return None=0D =0D @@ -832,8 +861,8 @@ class SurfaceItem(object): @return: instance of this class=0D =0D """=0D - name =3D args[0]=0D - parent =3D args[1]=0D + name =3D args[0]=0D + parent =3D args[1]=0D fileObj =3D args[2]=0D if issubclass(parent.__class__, Package):=0D if name in cls._objs.keys():=0D @@ -845,19 +874,18 @@ class SurfaceItem(object): return obj=0D elif issubclass(parent.__class__, Module):=0D if name not in cls._objs.keys():=0D - ErrorMsg("%s item does not defined in any package! It is u= sed by module %s" % \=0D + ErrorMsg("%s item does not defined in any package! It is u= sed by module %s" %=0D (name, parent.GetFilename()))=0D return None=0D return cls._objs[name]=0D =0D return None=0D =0D -=0D def __init__(self, name, parent, fileObj):=0D if issubclass(parent.__class__, Package):=0D - self._name =3D name=0D - self._parent =3D parent=0D - self._decObj =3D [fileObj]=0D + self._name =3D name=0D + self._parent =3D parent=0D + self._decObj =3D [fileObj]=0D self._refMods =3D {}=0D else:=0D self.RefModule(parent, fileObj)=0D @@ -879,7 +907,8 @@ class SurfaceItem(object): =0D def DeRef(self, mObj):=0D if mObj not in self._refMods.keys():=0D - WarnMsg("%s is not referenced by module %s" % (self._name, mOb= j.GetFilename()))=0D + WarnMsg("%s is not referenced by module %s" %=0D + (self._name, mObj.GetFilename()))=0D return=0D del self._refMods[mObj]=0D =0D @@ -897,16 +926,17 @@ class SurfaceItem(object): def GetDecObjects(self):=0D return self._decObj=0D =0D +=0D class PcdItem(SurfaceItem):=0D def AddDecObj(self, fileObj):=0D for decObj in self._decObj:=0D if decObj.GetFilename() !=3D fileObj.GetFilename():=0D - ErrorMsg("Pcd %s defined in more than one packages : %s an= d %s" % \=0D + ErrorMsg("Pcd %s defined in more than one packages : %s an= d %s" %=0D (self._name, decObj.GetFilename(), fileObj.GetFil= ename()))=0D return=0D if decObj.GetPcdType() =3D=3D fileObj.GetPcdType() and \=0D decObj.GetArch().lower() =3D=3D fileObj.GetArch():=0D - ErrorMsg("Pcd %s is duplicated defined in pcd type %s in p= ackage %s" % \=0D + ErrorMsg("Pcd %s is duplicated defined in pcd type %s in p= ackage %s" %=0D (self._name, decObj.GetPcdType(), decObj.GetFilen= ame()))=0D return=0D self._decObj.append(fileObj)=0D @@ -918,11 +948,14 @@ class PcdItem(SurfaceItem): types +=3D obj.GetPcdType()=0D return types=0D =0D +=0D class GuidItem(SurfaceItem):=0D pass=0D =0D +=0D class PpiItem(SurfaceItem):=0D pass=0D =0D +=0D class ProtocolItem(SurfaceItem):=0D pass=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/dec.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/dec.py index c25ab322efd9..879c63c12f23 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dec.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dec.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
    =0D #=0D @@ -6,9 +6,11 @@ #=0D =0D from plugins.EdkPlugins.basemodel import ini=0D -import re, os=0D +import re=0D +import os=0D from plugins.EdkPlugins.basemodel.message import *=0D =0D +=0D class DECFile(ini.BaseINIFile):=0D =0D def GetSectionInstance(self, parent, name, isCombined=3DFalse):=0D @@ -39,6 +41,7 @@ class DECFile(ini.BaseINIFile): =0D return arr=0D =0D +=0D class DECSection(ini.BaseINISection):=0D def GetSectionINIObject(self, parent):=0D type =3D self.GetType()=0D @@ -79,10 +82,12 @@ class DECSection(ini.BaseINISection): =0D return True=0D =0D +=0D class DECSectionObject(ini.BaseINISectionObject):=0D def GetArch(self):=0D return self.GetParent().GetArch()=0D =0D +=0D class DECDefineSectionObject(DECSectionObject):=0D def __init__(self, parent):=0D DECSectionObject.__init__(self, parent)=0D @@ -90,20 +95,21 @@ class DECDefineSectionObject(DECSectionObject): self._value =3D None=0D =0D def Parse(self):=0D - assert (self._start =3D=3D self._end), 'The object in define secti= on must be in single line'=0D + assert (self._start =3D=3D=0D + self._end), 'The object in define section must be in singl= e line'=0D =0D line =3D self.GetLineByOffset(self._start).strip()=0D =0D line =3D line.split('#')[0]=0D - arr =3D line.split('=3D')=0D + arr =3D line.split('=3D')=0D if len(arr) !=3D 2:=0D ErrorMsg('Invalid define section object',=0D - self.GetFilename(),=0D - self.GetParent().GetName()=0D - )=0D + self.GetFilename(),=0D + self.GetParent().GetName()=0D + )=0D return False=0D =0D - self._key =3D arr[0].strip()=0D + self._key =3D arr[0].strip()=0D self._value =3D arr[1].strip()=0D =0D return True=0D @@ -114,6 +120,7 @@ class DECDefineSectionObject(DECSectionObject): def GetValue(self):=0D return self._value=0D =0D +=0D class DECGuidObject(DECSectionObject):=0D _objs =3D {}=0D =0D @@ -149,8 +156,10 @@ class DECGuidObject(DECSectionObject): def GetObjectDict():=0D return DECGuidObject._objs=0D =0D +=0D class DECPpiObject(DECSectionObject):=0D _objs =3D {}=0D +=0D def __init__(self, parent):=0D DECSectionObject.__init__(self, parent)=0D self._name =3D None=0D @@ -183,6 +192,7 @@ class DECPpiObject(DECSectionObject): def GetObjectDict():=0D return DECPpiObject._objs=0D =0D +=0D class DECProtocolObject(DECSectionObject):=0D _objs =3D {}=0D =0D @@ -214,11 +224,11 @@ class DECProtocolObject(DECSectionObject): if len(objdict[self._name]) =3D=3D 0:=0D del objdict[self._name]=0D =0D -=0D @staticmethod=0D def GetObjectDict():=0D return DECProtocolObject._objs=0D =0D +=0D class DECLibraryClassObject(DECSectionObject):=0D _objs =3D {}=0D =0D @@ -256,6 +266,7 @@ class DECLibraryClassObject(DECSectionObject): def GetObjectDict():=0D return DECLibraryClassObject._objs=0D =0D +=0D class DECIncludeObject(DECSectionObject):=0D def __init__(self, parent):=0D DECSectionObject.__init__(self, parent)=0D @@ -263,19 +274,21 @@ class DECIncludeObject(DECSectionObject): def GetPath(self):=0D return self.GetLineByOffset(self._start).split('#')[0].strip()=0D =0D +=0D class DECPcdObject(DECSectionObject):=0D _objs =3D {}=0D =0D def __init__(self, parent):=0D DECSectionObject.__init__(self, parent)=0D - self.mPcdName =3D None=0D - self.mPcdDefaultValue =3D None=0D - self.mPcdDataType =3D None=0D - self.mPcdToken =3D None=0D + self.mPcdName =3D None=0D + self.mPcdDefaultValue =3D None=0D + self.mPcdDataType =3D None=0D + self.mPcdToken =3D None=0D =0D def Parse(self):=0D line =3D self.GetLineByOffset(self._start).strip().split('#')[0]=0D - (self.mPcdName, self.mPcdDefaultValue, self.mPcdDataType, self.mPc= dToken) =3D line.split('|')=0D + (self.mPcdName, self.mPcdDefaultValue,=0D + self.mPcdDataType, self.mPcdToken) =3D line.split('|')=0D objdict =3D DECPcdObject._objs=0D if self.mPcdName not in objdict.keys():=0D objdict[self.mPcdName] =3D [self]=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/doxygengen.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPl= ugins/edk2/model/doxygengen.py index 89833043c6b1..9d7d03b5749c 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This file produce action class to generate doxygen document for edk2 cod= ebase.=0D # The action classes are shared by GUI and command line tools.=0D @@ -24,22 +24,24 @@ from plugins.EdkPlugins.basemodel.message import * =0D _ignore_dir =3D ['.svn', '_svn', 'cvs']=0D _inf_key_description_mapping_table =3D {=0D - 'INF_VERSION':'Version of INF file specification',=0D - #'BASE_NAME':'Module Name',=0D - 'FILE_GUID':'Module Guid',=0D - 'MODULE_TYPE': 'Module Type',=0D - 'VERSION_STRING': 'Module Version',=0D - 'LIBRARY_CLASS': 'Produced Library Class',=0D - 'EFI_SPECIFICATION_VERSION': 'UEFI Specification Version',=0D - 'PI_SPECIFICATION_VERSION': 'PI Specification Version',=0D - 'ENTRY_POINT': 'Module Entry Point Function',=0D - 'CONSTRUCTOR': 'Library Constructor Function'=0D + 'INF_VERSION': 'Version of INF file specification',=0D + # 'BASE_NAME':'Module Name',=0D + 'FILE_GUID': 'Module Guid',=0D + 'MODULE_TYPE': 'Module Type',=0D + 'VERSION_STRING': 'Module Version',=0D + 'LIBRARY_CLASS': 'Produced Library Class',=0D + 'EFI_SPECIFICATION_VERSION': 'UEFI Specification Version',=0D + 'PI_SPECIFICATION_VERSION': 'PI Specification Version',=0D + 'ENTRY_POINT': 'Module Entry Point Function',=0D + 'CONSTRUCTOR': 'Library Constructor Function'=0D }=0D =0D _dec_key_description_mapping_table =3D {=0D - 'DEC_SPECIFICATION': 'Version of DEC file specification',=0D - 'PACKAGE_GUID': 'Package Guid'=0D + 'DEC_SPECIFICATION': 'Version of DEC file specification',=0D + 'PACKAGE_GUID': 'Package Guid'=0D }=0D +=0D +=0D class DoxygenAction:=0D """This is base class for all doxygen action.=0D """=0D @@ -50,17 +52,17 @@ class DoxygenAction: @param outputPath the obosolution output path.=0D @param log log function for output message=0D """=0D - self._doxPath =3D doxPath=0D - self._chmPath =3D chmPath=0D - self._outputPath =3D outputPath=0D - self._projname =3D projname=0D - self._configFile =3D None # doxygen config file is use= d by doxygen exe file=0D + self._doxPath =3D doxPath=0D + self._chmPath =3D chmPath=0D + self._outputPath =3D outputPath=0D + self._projname =3D projname=0D + self._configFile =3D None # doxygen config file is used b= y doxygen exe file=0D self._indexPageFile =3D None # doxygen page file for inde= x page.=0D - self._log =3D log=0D - self._mode =3D mode=0D - self._verbose =3D verbose=0D + self._log =3D log=0D + self._mode =3D mode=0D + self._verbose =3D verbose=0D self._doxygenCallback =3D None=0D - self._chmCallback =3D None=0D + self._chmCallback =3D None=0D =0D def Log(self, message, level=3D'info'):=0D if self._log is not None:=0D @@ -71,13 +73,15 @@ class DoxygenAction: =0D def Generate(self):=0D """Generate interface called by outer directly"""=0D - self.Log(">>>>>> Start generate doxygen document for %s... Zzz....= \n" % self._projname)=0D + self.Log(=0D + ">>>>>> Start generate doxygen document for %s... Zzz....\n" %= self._projname)=0D =0D # create doxygen config file at first=0D self._configFile =3D doxygen.DoxygenConfigFile()=0D self._configFile.SetOutputDir(self._outputPath)=0D =0D - self._configFile.SetWarningFilePath(os.path.join(self._outputPath,= 'warning.txt'))=0D + self._configFile.SetWarningFilePath(=0D + os.path.join(self._outputPath, 'warning.txt'))=0D if self._mode.lower() =3D=3D 'html':=0D self._configFile.SetHtmlMode()=0D else:=0D @@ -92,15 +96,18 @@ class DoxygenAction: self.Log("Fail to generate index page!\n", 'error')=0D return False=0D else:=0D - self.Log("Success to create doxygen index page file %s \n" % i= ndexPagePath)=0D + self.Log("Success to create doxygen index page file %s \n" %=0D + indexPagePath)=0D =0D # Add index page doxygen file to file list.=0D self._configFile.AddFile(indexPagePath)=0D =0D # save config file to output path=0D - configFilePath =3D os.path.join(self._outputPath, self._projname += '.doxygen_config')=0D + configFilePath =3D os.path.join(=0D + self._outputPath, self._projname + '.doxygen_config')=0D self._configFile.Generate(configFilePath)=0D - self.Log(" <<<<<< Success Save doxygen config file to %s...\n" = % configFilePath)=0D + self.Log(" <<<<<< Success Save doxygen config file to %s...\n" = %=0D + configFilePath)=0D =0D # launch doxygen tool to generate document=0D if self._doxygenCallback is not None:=0D @@ -128,17 +135,20 @@ class DoxygenAction: def RegisterCallbackCHMProcess(self, callback):=0D self._chmCallback =3D callback=0D =0D +=0D class PlatformDocumentAction(DoxygenAction):=0D """Generate platform doxygen document, will be implement at future."""= =0D =0D +=0D class PackageDocumentAction(DoxygenAction):=0D """Generate package reference document"""=0D =0D def __init__(self, doxPath, chmPath, outputPath, pObj, mode=3D'html', = log=3DNone, arch=3DNone, tooltag=3DNone,=0D - onlyInclude=3DFalse, verbose=3DFalse):=0D - DoxygenAction.__init__(self, doxPath, chmPath, outputPath, pObj.Ge= tName(), mode, log, verbose)=0D - self._pObj =3D pObj=0D - self._arch =3D arch=0D + onlyInclude=3DFalse, verbose=3DFalse):=0D + DoxygenAction.__init__(self, doxPath, chmPath,=0D + outputPath, pObj.GetName(), mode, log, verb= ose)=0D + self._pObj =3D pObj=0D + self._arch =3D arch=0D self._tooltag =3D tooltag=0D self._onlyIncludeDocument =3D onlyInclude=0D =0D @@ -166,7 +176,8 @@ class PackageDocumentAction(DoxygenAction): namestr +=3D '[%s]' % self._tooltag=0D self._configFile.SetProjectName(namestr)=0D self._configFile.SetStripPath(self._pObj.GetWorkspace())=0D - self._configFile.SetProjectVersion(self._pObj.GetFileObj().GetVers= ion())=0D + self._configFile.SetProjectVersion(=0D + self._pObj.GetFileObj().GetVersion())=0D self._configFile.AddPattern('*.decdoxygen')=0D =0D if self._tooltag.lower() =3D=3D 'msft':=0D @@ -186,28 +197,32 @@ class PackageDocumentAction(DoxygenAction): =0D def GenerateIndexPage(self):=0D """Generate doxygen index page. Inherited class should implement i= t."""=0D - fObj =3D self._pObj.GetFileObj()=0D - pdObj =3D doxygen.DoxygenFile('%s Package Document' % self._pObj.= GetName(),=0D - '%s.decdoxygen' % self._pObj.GetFilen= ame())=0D + fObj =3D self._pObj.GetFileObj()=0D + pdObj =3D doxygen.DoxygenFile('%s Package Document' % self._pObj.G= etName(),=0D + '%s.decdoxygen' % self._pObj.GetFilena= me())=0D self._configFile.AddFile(pdObj.GetFilename())=0D pdObj.AddDescription(fObj.GetFileHeader())=0D =0D defSection =3D fObj.GetSectionByName('defines')[0]=0D - baseSection =3D doxygen.Section('PackageBasicInformation', 'Packag= e Basic Information')=0D + baseSection =3D doxygen.Section(=0D + 'PackageBasicInformation', 'Package Basic Information')=0D descr =3D ''=0D for obj in defSection.GetObjects():=0D if obj.GetKey() in _dec_key_description_mapping_table.keys():= =0D descr +=3D ''=0D - descr +=3D '' % _dec_key_description_map= ping_table[obj.GetKey()]=0D + descr +=3D '' % _dec_key_description_map= ping_table[obj.GetKey(=0D + )]=0D descr +=3D '' % obj.GetValue()=0D descr +=3D ''=0D descr +=3D '
    %s%s%s

    '=0D baseSection.AddDescription(descr)=0D pdObj.AddSection(baseSection)=0D =0D - knownIssueSection =3D doxygen.Section('Known_Issue_section', 'Know= n Issue')=0D + knownIssueSection =3D doxygen.Section(=0D + 'Known_Issue_section', 'Known Issue')=0D knownIssueSection.AddDescription('
      ')=0D - knownIssueSection.AddDescription('
    • OPTIONAL macro for function= parameter can not be dealed with doxygen, so it disapear in this document!=
    • ')=0D + knownIssueSection.AddDescription(=0D + '
    • OPTIONAL macro for function parameter can not be dealed = with doxygen, so it disapear in this document!
    • ')=0D knownIssueSection.AddDescription('
    ')=0D pdObj.AddSection(knownIssueSection)=0D =0D @@ -215,7 +230,8 @@ class PackageDocumentAction(DoxygenAction): pages =3D self.GenerateIncludesSubPage(self._pObj, self._configFil= e)=0D if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D - pages =3D self.GenerateLibraryClassesSubPage(self._pObj, self._con= figFile)=0D + pages =3D self.GenerateLibraryClassesSubPage(=0D + self._pObj, self._configFile)=0D if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D pages =3D self.GeneratePcdSubPages(self._pObj, self._configFile)=0D @@ -231,7 +247,8 @@ class PackageDocumentAction(DoxygenAction): if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D if not self._onlyIncludeDocument:=0D - pdObj.AddPages(self.GenerateModulePages(self._pObj, self._conf= igFile))=0D + pdObj.AddPages(self.GenerateModulePages(=0D + self._pObj, self._configFile))=0D =0D pdObj.Save()=0D return pdObj.GetFilename()=0D @@ -244,16 +261,20 @@ class PackageDocumentAction(DoxygenAction): configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Protoco= l'))=0D configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Ppi'))= =0D configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Guid'))= =0D - configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Industr= yStandard'))=0D + configFile.AddIncludePath(os.path.join(=0D + pkpath, 'Include', 'IndustryStandard'))=0D =0D rootArray =3D []=0D - pageRoot =3D doxygen.Page("Public Includes", "%s_public_includes" = % pObj.GetName())=0D + pageRoot =3D doxygen.Page(=0D + "Public Includes", "%s_public_includes" % pObj.GetName())=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('includes')=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D =0D for obj in objs:=0D # Add path to include path=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath(), = obj.GetPath())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetPath())=0D configFile.AddIncludePath(path)=0D =0D # only list common folder's include file=0D @@ -261,27 +282,35 @@ class PackageDocumentAction(DoxygenAction): continue=0D =0D bNeedAddIncludePage =3D False=0D - topPage =3D doxygen.Page(self._ConvertPathToDoxygen(path, pObj= ), 'public_include_top')=0D + topPage =3D doxygen.Page(self._ConvertPathToDoxygen(=0D + path, pObj), 'public_include_top')=0D =0D topPage.AddDescription('
      \n')=0D for file in os.listdir(path):=0D - if file.lower() in _ignore_dir: continue=0D + if file.lower() in _ignore_dir:=0D + continue=0D fullpath =3D os.path.join(path, file)=0D if os.path.isfile(fullpath):=0D - self.ProcessSourceFileForInclude(fullpath, pObj, confi= gFile)=0D - topPage.AddDescription('
    • \link %s\endlink
    • \n'= % self._ConvertPathToDoxygen(fullpath, pObj))=0D + self.ProcessSourceFileForInclude(=0D + fullpath, pObj, configFile)=0D + topPage.AddDescription(=0D + '
    • \link %s\endlink
    • \n' % self._ConvertPat= hToDoxygen(fullpath, pObj))=0D else:=0D if file.lower() in ['library', 'protocol', 'guid', 'pp= i', 'ia32', 'x64', 'ipf', 'ebc', 'arm', 'pi', 'uefi', 'aarch64']:=0D continue=0D bNeedAddSubPage =3D False=0D - subpage =3D doxygen.Page(self._ConvertPathToDoxygen(fu= llpath, pObj), 'public_include_%s' % file)=0D + subpage =3D doxygen.Page(self._ConvertPathToDoxygen(=0D + fullpath, pObj), 'public_include_%s' % file)=0D subpage.AddDescription('
        \n')=0D for subfile in os.listdir(fullpath):=0D - if subfile.lower() in _ignore_dir: continue=0D + if subfile.lower() in _ignore_dir:=0D + continue=0D bNeedAddSubPage =3D True=0D subfullpath =3D os.path.join(fullpath, subfile)=0D - self.ProcessSourceFileForInclude(subfullpath, pObj= , configFile)=0D - subpage.AddDescription('
      • \link %s \endlink \n' % self._ConvertPathToDoxygen(subfullpath, pObj))=0D + self.ProcessSourceFileForInclude(=0D + subfullpath, pObj, configFile)=0D + subpage.AddDescription(=0D + '
      • \link %s \endlink
      • \n' % self._Conve= rtPathToDoxygen(subfullpath, pObj))=0D subpage.AddDescription('
      \n')=0D if bNeedAddSubPage:=0D bNeedAddIncludePage =3D True=0D @@ -304,9 +333,11 @@ class PackageDocumentAction(DoxygenAction): @param fObj DEC file object.=0D """=0D rootArray =3D []=0D - pageRoot =3D doxygen.Page("Library Class", "%s_libraryclass" % pOb= j.GetName())=0D + pageRoot =3D doxygen.Page(=0D + "Library Class", "%s_libraryclass" % pObj.GetName())=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('libraryclass',= self._arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D =0D if self._arch is not None:=0D for obj in objs:=0D @@ -314,17 +345,21 @@ class PackageDocumentAction(DoxygenAction): "lc_%s" % obj.GetClassName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D - classPage.AddDescription('
      \n'.join(comments) + '\n')=0D + classPage.AddDescription(=0D + '
      \n'.join(comments) + '
      \n')=0D pageRoot.AddPage(classPage)=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath= (), obj.GetHeaderFile())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D path =3D path[len(pObj.GetWorkspace()) + 1:]=0D if len(comments) =3D=3D 0:=0D - classPage.AddDescription('\copydoc %s

      ' % obj.GetHea= derFile())=0D + classPage.AddDescription(=0D + '\copydoc %s

      ' % obj.GetHeaderFile())=0D section =3D doxygen.Section('ref', 'Refer to Header File')= =0D section.AddDescription('\link %s\n' % obj.GetHeaderFile())= =0D section.AddDescription(' \endlink

      \n')=0D classPage.AddSection(section)=0D - fullPath =3D os.path.join(pObj.GetFileObj().GetPackageRoot= Path(), obj.GetHeaderFile())=0D + fullPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e)=0D else:=0D archPageDict =3D {}=0D @@ -338,17 +373,21 @@ class PackageDocumentAction(DoxygenAction): "lc_%s" % obj.GetClassName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D - classPage.AddDescription('
      \n'.join(comments) + '\n')=0D + classPage.AddDescription(=0D + '
      \n'.join(comments) + '
      \n')=0D subArchRoot.AddPage(classPage)=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath= (), obj.GetHeaderFile())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D path =3D path[len(pObj.GetWorkspace()) + 1:]=0D if len(comments) =3D=3D 0:=0D - classPage.AddDescription('\copydoc %s

      ' % obj.GetHea= derFile())=0D + classPage.AddDescription(=0D + '\copydoc %s

      ' % obj.GetHeaderFile())=0D section =3D doxygen.Section('ref', 'Refer to Header File')= =0D section.AddDescription('\link %s\n' % obj.GetHeaderFile())= =0D section.AddDescription(' \endlink

      \n')=0D classPage.AddSection(section)=0D - fullPath =3D os.path.join(pObj.GetFileObj().GetPackageRoot= Path(), obj.GetHeaderFile())=0D + fullPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D =0D self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e)=0D rootArray.append(pageRoot)=0D @@ -388,10 +427,12 @@ class PackageDocumentAction(DoxygenAction): continue=0D index =3D lines[no].lower().find('include')=0D #mo =3D IncludePattern.finditer(lines[no].lower())=0D - mo =3D re.match(r"^#\s*include\s+[<\"]([\\/\w.]+)[>\"]$", line= s[no].strip().lower())=0D + mo =3D re.match(=0D + r"^#\s*include\s+[<\"]([\\/\w.]+)[>\"]$", lines[no].strip(= ).lower())=0D if not mo:=0D continue=0D - mo =3D re.match(r"^[#\w\s]+[<\"]([\\/\w.]+)[>\"]$", lines[no].= strip())=0D + mo =3D re.match(r"^[#\w\s]+[<\"]([\\/\w.]+)[>\"]$",=0D + lines[no].strip())=0D filePath =3D mo.groups()[0]=0D =0D if filePath is None or len(filePath) =3D=3D 0:=0D @@ -402,49 +443,60 @@ class PackageDocumentAction(DoxygenAction): =0D if os.path.exists(os.path.join(os.path.dirname(path), filePath= )):=0D # Find the file in current directory=0D - fullPath =3D os.path.join(os.path.dirname(path), filePath)= .replace('\\', '/')=0D + fullPath =3D os.path.join(os.path.dirname(=0D + path), filePath).replace('\\', '/')=0D else:=0D # find in depedent package's include path=0D incObjs =3D pObj.GetFileObj().GetSectionObjectsByName('inc= ludes')=0D for incObj in incObjs:=0D - incPath =3D os.path.join(pObj.GetFileObj().GetPackageR= ootPath(), incObj.GetPath()).strip()=0D + incPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), incObj.Get= Path()).strip()=0D incPath =3D os.path.realpath(os.path.join(incPath, fil= ePath))=0D if os.path.exists(incPath):=0D fullPath =3D incPath=0D break=0D if infObj is not None:=0D pkgInfObjs =3D infObj.GetSectionObjectsByName('package= s')=0D - for obj in pkgInfObjs:=0D - decObj =3D dec.DECFile(os.path.join(pObj.GetWorksp= ace(), obj.GetPath()))=0D + for obj in pkgInfObjs:=0D + decObj =3D dec.DECFile(os.path.join(=0D + pObj.GetWorkspace(), obj.GetPath()))=0D if not decObj:=0D - ErrorMsg ('Fail to create pacakge object for %= s' % obj.GetPackageName())=0D + ErrorMsg('Fail to create pacakge object for %s= ' %=0D + obj.GetPackageName())=0D continue=0D if not decObj.Parse():=0D - ErrorMsg ('Fail to load package object for %s'= % obj.GetPackageName())=0D + ErrorMsg('Fail to load package object for %s' = %=0D + obj.GetPackageName())=0D continue=0D incObjs =3D decObj.GetSectionObjectsByName('includ= es')=0D for incObj in incObjs:=0D - incPath =3D os.path.join(decObj.GetPackageRoot= Path(), incObj.GetPath()).replace('\\', '/')=0D + incPath =3D os.path.join(=0D + decObj.GetPackageRootPath(), incObj.GetPat= h()).replace('\\', '/')=0D if os.path.exists(os.path.join(incPath, filePa= th)):=0D - fullPath =3D os.path.join(os.path.join(inc= Path, filePath))=0D + fullPath =3D os.path.join(=0D + os.path.join(incPath, filePath))=0D break=0D if fullPath is not None:=0D break=0D =0D if fullPath is None and self.IsVerbose():=0D - self.Log('Can not resolve header file %s for file %s in pa= ckage %s\n' % (filePath, path, pObj.GetFileObj().GetFilename()), 'error')=0D + self.Log('Can not resolve header file %s for file %s in pa= ckage %s\n' % (=0D + filePath, path, pObj.GetFileObj().GetFilename()), 'err= or')=0D return=0D else:=0D fullPath =3D fullPath.replace('\\', '/')=0D if self.IsVerbose():=0D - self.Log('Preprocessing: Add include file %s for file = %s\n' % (fullPath, path))=0D + self.Log('Preprocessing: Add include file %s for file = %s\n' % (=0D + fullPath, path))=0D #LogMsg ('Preprocessing: Add include file %s for file %s' = % (fullPath, path))=0D - self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e, infObj)=0D + self.ProcessSourceFileForInclude(=0D + fullPath, pObj, configFile, infObj)=0D =0D def AddAllIncludeFiles(self, pObj, configFile):=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('includes')=0D for obj in objs:=0D - incPath =3D os.path.join(pObj.GetFileObj().GetPackageRootPath(= ), obj.GetPath())=0D + incPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetPath())=0D for root, dirs, files in os.walk(incPath):=0D for dir in dirs:=0D if dir.lower() in _ignore_dir:=0D @@ -469,15 +521,17 @@ class PackageDocumentAction(DoxygenAction): typeArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetPcdType() not in typeRootPageDict.keys():=0D - typeRootPageDict[obj.GetPcdType()] =3D doxygen.Page(obj.Ge= tPcdType(), 'pcd_%s_root_page' % obj.GetPcdType())=0D + typeRootPageDict[obj.GetPcdType()] =3D doxygen.Page(=0D + obj.GetPcdType(), 'pcd_%s_root_page' % obj.GetPcdType(= ))=0D pcdRootPage.AddPage(typeRootPageDict[obj.GetPcdType()])=0D typeRoot =3D typeRootPageDict[obj.GetPcdType()]=0D if self._arch is not None:=0D pcdPage =3D doxygen.Page('%s' % obj.GetPcdName(),=0D - 'pcd_%s_%s_%s' % (obj.GetPcdType()= , obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D - pcdPage.AddDescription('
      \n'.join(obj.GetComment()) + '=
      \n')=0D + 'pcd_%s_%s_%s' % (obj.GetPcdType(),= obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D + pcdPage.AddDescription(=0D + '
      \n'.join(obj.GetComment()) + '
      \n')=0D section =3D doxygen.Section('PCDinformation', 'PCD Informa= tion')=0D - desc =3D ''=0D + desc =3D '
      '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -486,8 +540,10 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[1]=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[0]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 1]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 0]=0D desc +=3D '' % obj.GetPcdTok= en()=0D desc +=3D '' % obj.GetPcdDat= aType()=0D desc +=3D '' % obj.GetPcdVal= ue()=0D @@ -499,15 +555,17 @@ class PackageDocumentAction(DoxygenAction): else:=0D keystr =3D obj.GetPcdType() + obj.GetArch()=0D if keystr not in typeArchRootPageDict.keys():=0D - typeArchRootPage =3D doxygen.Page(obj.GetArch(), 'pcd_= %s_%s_root_page' % (obj.GetPcdType(), obj.GetArch()))=0D + typeArchRootPage =3D doxygen.Page(=0D + obj.GetArch(), 'pcd_%s_%s_root_page' % (obj.GetPcd= Type(), obj.GetArch()))=0D typeArchRootPageDict[keystr] =3D typeArchRootPage=0D typeRoot.AddPage(typeArchRootPage)=0D typeArchRoot =3D typeArchRootPageDict[keystr]=0D pcdPage =3D doxygen.Page('%s' % obj.GetPcdName(),=0D - 'pcd_%s_%s_%s' % (obj.GetPcdType()= , obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D - pcdPage.AddDescription('
      \n'.join(obj.GetComment()) + '=
      \n')=0D + 'pcd_%s_%s_%s' % (obj.GetPcdType(),= obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D + pcdPage.AddDescription(=0D + '
      \n'.join(obj.GetComment()) + '
      \n')=0D section =3D doxygen.Section('PCDinformation', 'PCD Informa= tion')=0D - desc =3D '
      Name
      Token Space
      Default Value
      %s
      %s
      %s
      %s
      %s
      %s
      %s
      '=0D + desc =3D '
      '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -516,8 +574,10 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[1]=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[0]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 1]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 0]=0D desc +=3D '' % obj.GetPcdTok= en()=0D desc +=3D '' % obj.GetPcdDat= aType()=0D desc +=3D '' % obj.GetPcdVal= ue()=0D @@ -535,7 +595,7 @@ class PackageDocumentAction(DoxygenAction): if len(comments) !=3D 0:=0D guidPage.AddDescription('
      '.join(obj.GetComment()) + '
      '= )=0D section =3D doxygen.Section('BasicGuidInfo', 'GUID Information')=0D - desc =3D '
      Name
      Token Space
      Default Value
      %s
      %s
      %s
      %s
      %s
      %s
      %s
      '=0D + desc =3D '
      '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -567,19 +627,23 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('GUID', 'guid_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('guids', self._= arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GenerateGuidSubPage(pObj, obj, conf= igFile))=0D + pageRoot.AddPage(=0D + self._GenerateGuidSubPage(pObj, obj, configFile))=0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'guid_arc= h_root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'guid_arch_root_%s' % obj.GetArch()= )=0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GenerateGuidSubPage(pObj, obj, = configFile))=0D + guidArchRoot.AddPage(=0D + self._GenerateGuidSubPage(pObj, obj, configFile))=0D return [pageRoot]=0D =0D def _GeneratePpiSubPage(self, pObj, obj, configFile):=0D @@ -588,7 +652,7 @@ class PackageDocumentAction(DoxygenAction): if len(comments) !=3D 0:=0D guidPage.AddDescription('
      '.join(obj.GetComment()) + '
      '= )=0D section =3D doxygen.Section('BasicPpiInfo', 'PPI Information')=0D - desc =3D '
      GUID\'s Guid Name
      GUID\'s Guid
      '=0D + desc =3D '
      '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -620,28 +684,33 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('PPI', 'ppi_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('ppis', self._a= rch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GeneratePpiSubPage(pObj, obj, confi= gFile))=0D + pageRoot.AddPage(=0D + self._GeneratePpiSubPage(pObj, obj, configFile))=0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'ppi_arch= _root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'ppi_arch_root_%s' % obj.GetArch())= =0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GeneratePpiSubPage(pObj, obj, c= onfigFile))=0D + guidArchRoot.AddPage(=0D + self._GeneratePpiSubPage(pObj, obj, configFile))=0D return [pageRoot]=0D =0D def _GenerateProtocolSubPage(self, pObj, obj, configFile):=0D - guidPage =3D doxygen.Page(obj.GetName(), 'protocol_page_%s' % obj.= GetName())=0D + guidPage =3D doxygen.Page(=0D + obj.GetName(), 'protocol_page_%s' % obj.GetName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D guidPage.AddDescription('
      '.join(obj.GetComment()) + '
      '= )=0D section =3D doxygen.Section('BasicProtocolInfo', 'PROTOCOL Informa= tion')=0D - desc =3D '
      PPI\'s Guid Name
      PPI\'s Guid
      '=0D + desc =3D '
      '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -674,19 +743,23 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('PROTOCOL', 'protocol_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('protocols', se= lf._arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GenerateProtocolSubPage(pObj, obj, = configFile))=0D + pageRoot.AddPage(=0D + self._GenerateProtocolSubPage(pObj, obj, configFile))= =0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'protocol= _arch_root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'protocol_arch_root_%s' % obj.GetAr= ch())=0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GenerateProtocolSubPage(pObj, o= bj, configFile))=0D + guidArchRoot.AddPage(=0D + self._GenerateProtocolSubPage(pObj, obj, configFile))= =0D return [pageRoot]=0D =0D def FindHeaderFileForGuid(self, pObj, name, configFile):=0D @@ -699,8 +772,8 @@ class PackageDocumentAction(DoxygenAction): =0D @return full path of header file and None if not found.=0D """=0D - startPath =3D pObj.GetFileObj().GetPackageRootPath()=0D - incPath =3D os.path.join(startPath, 'Include').replace('\\', '/= ')=0D + startPath =3D pObj.GetFileObj().GetPackageRootPath()=0D + incPath =3D os.path.join(startPath, 'Include').replace('\\', '/')= =0D # if /include exist, then search header under it.=0D if os.path.exists(incPath):=0D startPath =3D incPath=0D @@ -760,7 +833,7 @@ class PackageDocumentAction(DoxygenAction): modObjs =3D []=0D for infpath in infList:=0D infObj =3D inf.INFFile(infpath)=0D - #infObj =3D INFFileObject.INFFile (pObj.GetWorkspacePath(),=0D + # infObj =3D INFFileObject.INFFile (pObj.GetWorkspacePath(),=0D # inf)=0D if not infObj:=0D self.Log('Fail create INF object for %s' % inf)=0D @@ -777,13 +850,15 @@ class PackageDocumentAction(DoxygenAction): libRootPage =3D doxygen.Page('Libraries', 'lib_root_page')=0D rootPages.append(libRootPage)=0D for libInf in libObjs:=0D - libRootPage.AddPage(self.GenerateModulePage(pObj, libInf, = configFile, True))=0D + libRootPage.AddPage(self.GenerateModulePage(=0D + pObj, libInf, configFile, True))=0D =0D if len(modObjs) !=3D 0:=0D modRootPage =3D doxygen.Page('Modules', 'module_root_page')=0D rootPages.append(modRootPage)=0D for modInf in modObjs:=0D - modRootPage.AddPage(self.GenerateModulePage(pObj, modInf, = configFile, False))=0D + modRootPage.AddPage(self.GenerateModulePage(=0D + pObj, modInf, configFile, False))=0D =0D return rootPages=0D =0D @@ -798,13 +873,15 @@ class PackageDocumentAction(DoxygenAction): """=0D workspace =3D pObj.GetWorkspace()=0D refDecObjs =3D []=0D - for obj in infObj.GetSectionObjectsByName('packages'):=0D + for obj in infObj.GetSectionObjectsByName('packages'):=0D decObj =3D dec.DECFile(os.path.join(workspace, obj.GetPath()))= =0D if not decObj:=0D - ErrorMsg ('Fail to create pacakge object for %s' % obj.Get= PackageName())=0D + ErrorMsg('Fail to create pacakge object for %s' %=0D + obj.GetPackageName())=0D continue=0D if not decObj.Parse():=0D - ErrorMsg ('Fail to load package object for %s' % obj.GetPa= ckageName())=0D + ErrorMsg('Fail to load package object for %s' %=0D + obj.GetPackageName())=0D continue=0D refDecObjs.append(decObj)=0D =0D @@ -812,12 +889,14 @@ class PackageDocumentAction(DoxygenAction): 'module_%s' % infObj.GetBaseName())=0D modPage.AddDescription(infObj.GetFileHeader())=0D =0D - basicInfSection =3D doxygen.Section('BasicModuleInformation', 'Bas= ic Module Information')=0D + basicInfSection =3D doxygen.Section(=0D + 'BasicModuleInformation', 'Basic Module Information')=0D desc =3D "
      PROTOCOL\'s Guid Name
      PROTOCOL\'s Guid
      "=0D for obj in infObj.GetSectionObjectsByName('defines'):=0D key =3D obj.GetKey()=0D value =3D obj.GetValue()=0D - if key not in _inf_key_description_mapping_table.keys(): conti= nue=0D + if key not in _inf_key_description_mapping_table.keys():=0D + continue=0D if key =3D=3D 'LIBRARY_CLASS' and value.find('|') !=3D -1:=0D clsname, types =3D value.split('|')=0D desc +=3D ''=0D @@ -841,7 +920,7 @@ class PackageDocumentAction(DoxygenAction): modPage.AddSection(basicInfSection)=0D =0D # Add protocol section=0D - data =3D []=0D + data =3D []=0D for obj in infObj.GetSectionObjectsByName('pcd', self._arch):=0D data.append(obj.GetPcdName().strip())=0D if len(data) !=3D 0:=0D @@ -852,7 +931,8 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D '' % item.split('.')[1]=0D desc +=3D '' % item.split('.')[0]=0D - pkgbasename =3D self.SearchPcdPackage(item, workspace, ref= DecObjs)=0D + pkgbasename =3D self.SearchPcdPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '' % pkgbasename=0D desc +=3D ''=0D desc +=3D "
      %s%s%s
      "=0D @@ -861,8 +941,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add protocol section=0D #sects =3D infObj.GetSectionByString('protocol')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('protocol', self._arch):= =0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -872,7 +952,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchProtocolPackage(item, workspace= , refDecObjs)=0D + pkgbasename =3D self.SearchProtocolPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -881,8 +962,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add ppi section=0D #sects =3D infObj.GetSectionByString('ppi')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('ppi', self._arch):=0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -892,7 +973,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchPpiPackage(item, workspace, ref= DecObjs)=0D + pkgbasename =3D self.SearchPpiPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -901,8 +983,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add guid section=0D #sects =3D infObj.GetSectionByString('guid')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('guid', self._arch):=0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -912,7 +994,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchGuidPackage(item, workspace, re= fDecObjs)=0D + pkgbasename =3D self.SearchGuidPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -928,12 +1011,13 @@ class PackageDocumentAction(DoxygenAction): desc +=3D 'Produce'=0D try:=0D pkgname, hPath =3D self.SearchLibraryClassHeaderFile(infOb= j.GetProduceLibraryClass(),=0D - workspace,=0D - refDecObjs)= =0D + workspa= ce,=0D + refDecO= bjs)=0D except:=0D - self.Log ('fail to get package header file for lib class %= s' % infObj.GetProduceLibraryClass())=0D + self.Log('fail to get package header file for lib class %s= ' %=0D + infObj.GetProduceLibraryClass())=0D pkgname =3D 'NULL'=0D - hPath =3D 'NULL'=0D + hPath =3D 'NULL'=0D desc +=3D '%s' % pkgname=0D if hPath !=3D "NULL":=0D desc +=3D '\link %s \endlink' % hPath=0D @@ -949,9 +1033,10 @@ class PackageDocumentAction(DoxygenAction): if retarr is not None:=0D pkgname, hPath =3D retarr=0D else:=0D - self.Log('Fail find the library class %s definition from m= odule %s dependent package!' % (lcObj.GetClass(), infObj.GetFilename()), 'e= rror')=0D + self.Log('Fail find the library class %s definition from m= odule %s dependent package!' % (=0D + lcObj.GetClass(), infObj.GetFilename()), 'error')=0D pkgname =3D 'NULL'=0D - hPath =3D 'NULL'=0D + hPath =3D 'NULL'=0D desc +=3D 'Consume'=0D desc +=3D '%s' % pkgname=0D desc +=3D '\link %s \endlink' % hPath=0D @@ -964,22 +1049,25 @@ class PackageDocumentAction(DoxygenAction): section.AddDescription('

        \n')=0D for obj in infObj.GetSourceObjects(self._arch, self._tooltag):=0D sPath =3D infObj.GetModuleRootPath()=0D - sPath =3D os.path.join(sPath, obj.GetSourcePath()).replace('\\= ', '/').strip()=0D + sPath =3D os.path.join(sPath, obj.GetSourcePath()=0D + ).replace('\\', '/').strip()=0D if sPath.lower().endswith('.uni') or sPath.lower().endswith('.= s') or sPath.lower().endswith('.asm') or sPath.lower().endswith('.nasm'):=0D newPath =3D self.TranslateUniFile(sPath)=0D configFile.AddFile(newPath)=0D newPath =3D newPath[len(pObj.GetWorkspace()) + 1:]=0D - section.AddDescription('
      • \link %s \endlink
      • ' % n= ewPath)=0D + section.AddDescription(=0D + '
      • \link %s \endlink
      • ' % newPath)=0D else:=0D - self.ProcessSourceFileForInclude(sPath, pObj, configFile, = infObj)=0D + self.ProcessSourceFileForInclude(=0D + sPath, pObj, configFile, infObj)=0D sPath =3D sPath[len(pObj.GetWorkspace()) + 1:]=0D section.AddDescription('
      • \link %s \endlink
      • ' % sPa= th)=0D section.AddDescription('
      \n')=0D modPage.AddSection(section)=0D =0D #sects =3D infObj.GetSectionByString('depex')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('depex'):=0D data.append(str(obj))=0D if len(data) !=3D 0:=0D @@ -1029,35 +1117,35 @@ class PackageDocumentAction(DoxygenAction): return newpath=0D =0D def SearchPcdPackage(self, pcdname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for pcd in decObj.GetSectionObjectsByName('pcd'):=0D if pcdname =3D=3D pcd.GetPcdName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchProtocolPackage(self, protname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for proto in decObj.GetSectionObjectsByName('protocol'):=0D if protname =3D=3D proto.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchPpiPackage(self, ppiname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for ppi in decObj.GetSectionObjectsByName('ppi'):=0D if ppiname =3D=3D ppi.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchGuidPackage(self, guidname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for guid in decObj.GetSectionObjectsByName('guid'):=0D if guidname =3D=3D guid.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchLibraryClassHeaderFile(self, className, workspace, decObjs):= =0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for cls in decObj.GetSectionObjectsByName('libraryclasses'):=0D if cls.GetClassName().strip() =3D=3D className:=0D path =3D cls.GetHeaderFile().strip()=0D @@ -1072,9 +1160,11 @@ class PackageDocumentAction(DoxygenAction): path =3D path[len(pRootPath) + 1:]=0D return path.replace('\\', '/')=0D =0D +=0D def IsCHeaderFile(path):=0D return CheckPathPostfix(path, 'h')=0D =0D +=0D def CheckPathPostfix(path, str):=0D index =3D path.rfind('.')=0D if index =3D=3D -1:=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/doxygengen_spec.py b/BaseTools/Scripts/PackageDocumentTools/plugins/= EdkPlugins/edk2/model/doxygengen_spec.py index e37938c466a2..56e1a637c0ff 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen_spec.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= doxygengen_spec.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This file produce action class to generate doxygen document for edk2 cod= ebase.=0D # The action classes are shared by GUI and command line tools.=0D @@ -21,22 +21,24 @@ from plugins.EdkPlugins.basemodel.message import * =0D _ignore_dir =3D ['.svn', '_svn', 'cvs']=0D _inf_key_description_mapping_table =3D {=0D - 'INF_VERSION':'Version of INF file specification',=0D - #'BASE_NAME':'Module Name',=0D - 'FILE_GUID':'Module Guid',=0D - 'MODULE_TYPE': 'Module Type',=0D - 'VERSION_STRING': 'Module Version',=0D - 'LIBRARY_CLASS': 'Produced Library Class',=0D - 'EFI_SPECIFICATION_VERSION': 'UEFI Specification Version',=0D - 'PI_SPECIFICATION_VERSION': 'PI Specification Version',=0D - 'ENTRY_POINT': 'Module Entry Point Function',=0D - 'CONSTRUCTOR': 'Library Constructor Function'=0D + 'INF_VERSION': 'Version of INF file specification',=0D + # 'BASE_NAME':'Module Name',=0D + 'FILE_GUID': 'Module Guid',=0D + 'MODULE_TYPE': 'Module Type',=0D + 'VERSION_STRING': 'Module Version',=0D + 'LIBRARY_CLASS': 'Produced Library Class',=0D + 'EFI_SPECIFICATION_VERSION': 'UEFI Specification Version',=0D + 'PI_SPECIFICATION_VERSION': 'PI Specification Version',=0D + 'ENTRY_POINT': 'Module Entry Point Function',=0D + 'CONSTRUCTOR': 'Library Constructor Function'=0D }=0D =0D _dec_key_description_mapping_table =3D {=0D - 'DEC_SPECIFICATION': 'Version of DEC file specification',=0D - 'PACKAGE_GUID': 'Package Guid'=0D + 'DEC_SPECIFICATION': 'Version of DEC file specification',=0D + 'PACKAGE_GUID': 'Package Guid'=0D }=0D +=0D +=0D class DoxygenAction:=0D """This is base class for all doxygen action.=0D """=0D @@ -47,17 +49,17 @@ class DoxygenAction: @param outputPath the obosolution output path.=0D @param log log function for output message=0D """=0D - self._doxPath =3D doxPath=0D - self._chmPath =3D chmPath=0D - self._outputPath =3D outputPath=0D - self._projname =3D projname=0D - self._configFile =3D None # doxygen config file is use= d by doxygen exe file=0D + self._doxPath =3D doxPath=0D + self._chmPath =3D chmPath=0D + self._outputPath =3D outputPath=0D + self._projname =3D projname=0D + self._configFile =3D None # doxygen config file is used b= y doxygen exe file=0D self._indexPageFile =3D None # doxygen page file for inde= x page.=0D - self._log =3D log=0D - self._mode =3D mode=0D - self._verbose =3D verbose=0D + self._log =3D log=0D + self._mode =3D mode=0D + self._verbose =3D verbose=0D self._doxygenCallback =3D None=0D - self._chmCallback =3D None=0D + self._chmCallback =3D None=0D =0D def Log(self, message, level=3D'info'):=0D if self._log is not None:=0D @@ -68,13 +70,15 @@ class DoxygenAction: =0D def Generate(self):=0D """Generate interface called by outer directly"""=0D - self.Log(">>>>>> Start generate doxygen document for %s... Zzz....= \n" % self._projname)=0D + self.Log(=0D + ">>>>>> Start generate doxygen document for %s... Zzz....\n" %= self._projname)=0D =0D # create doxygen config file at first=0D self._configFile =3D doxygen.DoxygenConfigFile()=0D self._configFile.SetOutputDir(self._outputPath)=0D =0D - self._configFile.SetWarningFilePath(os.path.join(self._outputPath,= 'warning.txt'))=0D + self._configFile.SetWarningFilePath(=0D + os.path.join(self._outputPath, 'warning.txt'))=0D if self._mode.lower() =3D=3D 'html':=0D self._configFile.SetHtmlMode()=0D else:=0D @@ -89,15 +93,18 @@ class DoxygenAction: self.Log("Fail to generate index page!\n", 'error')=0D return False=0D else:=0D - self.Log("Success to create doxygen index page file %s \n" % i= ndexPagePath)=0D + self.Log("Success to create doxygen index page file %s \n" %=0D + indexPagePath)=0D =0D # Add index page doxygen file to file list.=0D self._configFile.AddFile(indexPagePath)=0D =0D # save config file to output path=0D - configFilePath =3D os.path.join(self._outputPath, self._projname += '.doxygen_config')=0D + configFilePath =3D os.path.join(=0D + self._outputPath, self._projname + '.doxygen_config')=0D self._configFile.Generate(configFilePath)=0D - self.Log(" <<<<<< Success Save doxygen config file to %s...\n" = % configFilePath)=0D + self.Log(" <<<<<< Success Save doxygen config file to %s...\n" = %=0D + configFilePath)=0D =0D # launch doxygen tool to generate document=0D if self._doxygenCallback is not None:=0D @@ -125,17 +132,20 @@ class DoxygenAction: def RegisterCallbackCHMProcess(self, callback):=0D self._chmCallback =3D callback=0D =0D +=0D class PlatformDocumentAction(DoxygenAction):=0D """Generate platform doxygen document, will be implement at future."""= =0D =0D +=0D class PackageDocumentAction(DoxygenAction):=0D """Generate package reference document"""=0D =0D def __init__(self, doxPath, chmPath, outputPath, pObj, mode=3D'html', = log=3DNone, arch=3DNone, tooltag=3DNone,=0D macros=3D[], onlyInclude=3DFalse, verbose=3DFalse):=0D - DoxygenAction.__init__(self, doxPath, chmPath, outputPath, pObj.Ge= tName(), mode, log, verbose)=0D - self._pObj =3D pObj=0D - self._arch =3D arch=0D + DoxygenAction.__init__(self, doxPath, chmPath,=0D + outputPath, pObj.GetName(), mode, log, verb= ose)=0D + self._pObj =3D pObj=0D + self._arch =3D arch=0D self._tooltag =3D tooltag=0D self._macros =3D macros=0D self._onlyIncludeDocument =3D onlyInclude=0D @@ -167,7 +177,8 @@ class PackageDocumentAction(DoxygenAction): namestr +=3D '[%s]' % self._tooltag=0D self._configFile.SetProjectName(namestr)=0D self._configFile.SetStripPath(self._pObj.GetWorkspace())=0D - self._configFile.SetProjectVersion(self._pObj.GetFileObj().GetVers= ion())=0D + self._configFile.SetProjectVersion(=0D + self._pObj.GetFileObj().GetVersion())=0D self._configFile.AddPattern('*.decdoxygen')=0D =0D if self._tooltag.lower() =3D=3D 'msft':=0D @@ -187,28 +198,32 @@ class PackageDocumentAction(DoxygenAction): =0D def GenerateIndexPage(self):=0D """Generate doxygen index page. Inherited class should implement i= t."""=0D - fObj =3D self._pObj.GetFileObj()=0D - pdObj =3D doxygen.DoxygenFile('%s Package Document' % self._pObj.= GetName(),=0D - '%s.decdoxygen' % self._pObj.GetFilen= ame())=0D + fObj =3D self._pObj.GetFileObj()=0D + pdObj =3D doxygen.DoxygenFile('%s Package Document' % self._pObj.G= etName(),=0D + '%s.decdoxygen' % self._pObj.GetFilena= me())=0D self._configFile.AddFile(pdObj.GetFilename())=0D pdObj.AddDescription(fObj.GetFileHeader())=0D =0D defSection =3D fObj.GetSectionByName('defines')[0]=0D - baseSection =3D doxygen.Section('PackageBasicInformation', 'Packag= e Basic Information')=0D + baseSection =3D doxygen.Section(=0D + 'PackageBasicInformation', 'Package Basic Information')=0D descr =3D ''=0D for obj in defSection.GetObjects():=0D if obj.GetKey() in _dec_key_description_mapping_table.keys():= =0D descr +=3D ''=0D - descr +=3D '' % _dec_key_description_map= ping_table[obj.GetKey()]=0D + descr +=3D '' % _dec_key_description_map= ping_table[obj.GetKey(=0D + )]=0D descr +=3D '' % obj.GetValue()=0D descr +=3D ''=0D descr +=3D '
      %s%s%s

      '=0D baseSection.AddDescription(descr)=0D pdObj.AddSection(baseSection)=0D =0D - knownIssueSection =3D doxygen.Section('Known_Issue_section', 'Know= n Issue')=0D + knownIssueSection =3D doxygen.Section(=0D + 'Known_Issue_section', 'Known Issue')=0D knownIssueSection.AddDescription('
        ')=0D - knownIssueSection.AddDescription('
      • OPTIONAL macro for function= parameter can not be dealed with doxygen, so it disapear in this document!=
      • ')=0D + knownIssueSection.AddDescription(=0D + '
      • OPTIONAL macro for function parameter can not be dealed = with doxygen, so it disapear in this document!
      • ')=0D knownIssueSection.AddDescription('
      ')=0D pdObj.AddSection(knownIssueSection)=0D =0D @@ -216,7 +231,8 @@ class PackageDocumentAction(DoxygenAction): pages =3D self.GenerateIncludesSubPage(self._pObj, self._configFil= e)=0D if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D - pages =3D self.GenerateLibraryClassesSubPage(self._pObj, self._con= figFile)=0D + pages =3D self.GenerateLibraryClassesSubPage(=0D + self._pObj, self._configFile)=0D if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D pages =3D self.GeneratePcdSubPages(self._pObj, self._configFile)=0D @@ -232,7 +248,8 @@ class PackageDocumentAction(DoxygenAction): if len(pages) !=3D 0:=0D pdObj.AddPages(pages)=0D if not self._onlyIncludeDocument:=0D - pdObj.AddPages(self.GenerateModulePages(self._pObj, self._conf= igFile))=0D + pdObj.AddPages(self.GenerateModulePages(=0D + self._pObj, self._configFile))=0D =0D pdObj.Save()=0D return pdObj.GetFilename()=0D @@ -245,16 +262,20 @@ class PackageDocumentAction(DoxygenAction): configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Protoco= l'))=0D configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Ppi'))= =0D configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Guid'))= =0D - configFile.AddIncludePath(os.path.join(pkpath, 'Include', 'Industr= yStandard'))=0D + configFile.AddIncludePath(os.path.join(=0D + pkpath, 'Include', 'IndustryStandard'))=0D =0D rootArray =3D []=0D - pageRoot =3D doxygen.Page("Public Includes", "%s_public_includes" = % pObj.GetName())=0D + pageRoot =3D doxygen.Page(=0D + "Public Includes", "%s_public_includes" % pObj.GetName())=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('includes')=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D =0D for obj in objs:=0D # Add path to include path=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath(), = obj.GetPath())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetPath())=0D configFile.AddIncludePath(path)=0D =0D # only list common folder's include file=0D @@ -262,27 +283,35 @@ class PackageDocumentAction(DoxygenAction): continue=0D =0D bNeedAddIncludePage =3D False=0D - topPage =3D doxygen.Page(self._ConvertPathToDoxygen(path, pObj= ), 'public_include_top')=0D + topPage =3D doxygen.Page(self._ConvertPathToDoxygen(=0D + path, pObj), 'public_include_top')=0D =0D topPage.AddDescription('
        \n')=0D for file in os.listdir(path):=0D - if file.lower() in _ignore_dir: continue=0D + if file.lower() in _ignore_dir:=0D + continue=0D fullpath =3D os.path.join(path, file)=0D if os.path.isfile(fullpath):=0D - self.ProcessSourceFileForInclude(fullpath, pObj, confi= gFile)=0D - topPage.AddDescription('
      • \link %s\endlink
      • \n'= % self._ConvertPathToDoxygen(fullpath, pObj))=0D + self.ProcessSourceFileForInclude(=0D + fullpath, pObj, configFile)=0D + topPage.AddDescription(=0D + '
      • \link %s\endlink
      • \n' % self._ConvertPat= hToDoxygen(fullpath, pObj))=0D else:=0D if file.lower() in ['library', 'protocol', 'guid', 'pp= i', 'ia32', 'x64', 'ipf', 'ebc', 'arm', 'pi', 'uefi', 'aarch64']:=0D continue=0D bNeedAddSubPage =3D False=0D - subpage =3D doxygen.Page(self._ConvertPathToDoxygen(fu= llpath, pObj), 'public_include_%s' % file)=0D + subpage =3D doxygen.Page(self._ConvertPathToDoxygen(=0D + fullpath, pObj), 'public_include_%s' % file)=0D subpage.AddDescription('
          \n')=0D for subfile in os.listdir(fullpath):=0D - if subfile.lower() in _ignore_dir: continue=0D + if subfile.lower() in _ignore_dir:=0D + continue=0D bNeedAddSubPage =3D True=0D subfullpath =3D os.path.join(fullpath, subfile)=0D - self.ProcessSourceFileForInclude(subfullpath, pObj= , configFile)=0D - subpage.AddDescription('
        • \link %s \endlink \n' % self._ConvertPathToDoxygen(subfullpath, pObj))=0D + self.ProcessSourceFileForInclude(=0D + subfullpath, pObj, configFile)=0D + subpage.AddDescription(=0D + '
        • \link %s \endlink
        • \n' % self._Conve= rtPathToDoxygen(subfullpath, pObj))=0D subpage.AddDescription('
        \n')=0D if bNeedAddSubPage:=0D bNeedAddIncludePage =3D True=0D @@ -305,9 +334,11 @@ class PackageDocumentAction(DoxygenAction): @param fObj DEC file object.=0D """=0D rootArray =3D []=0D - pageRoot =3D doxygen.Page("Library Class", "%s_libraryclass" % pOb= j.GetName())=0D + pageRoot =3D doxygen.Page(=0D + "Library Class", "%s_libraryclass" % pObj.GetName())=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('libraryclass',= self._arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D =0D if self._arch is not None:=0D for obj in objs:=0D @@ -315,17 +346,21 @@ class PackageDocumentAction(DoxygenAction): "lc_%s" % obj.GetClassName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D - classPage.AddDescription('
        \n'.join(comments) + '\n')=0D + classPage.AddDescription(=0D + '
        \n'.join(comments) + '
        \n')=0D pageRoot.AddPage(classPage)=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath= (), obj.GetHeaderFile())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D path =3D path[len(pObj.GetWorkspace()) + 1:]=0D if len(comments) =3D=3D 0:=0D - classPage.AddDescription('\copydoc %s

        ' % obj.GetHea= derFile())=0D + classPage.AddDescription(=0D + '\copydoc %s

        ' % obj.GetHeaderFile())=0D section =3D doxygen.Section('ref', 'Refer to Header File')= =0D section.AddDescription('\link %s\n' % obj.GetHeaderFile())= =0D section.AddDescription(' \endlink

        \n')=0D classPage.AddSection(section)=0D - fullPath =3D os.path.join(pObj.GetFileObj().GetPackageRoot= Path(), obj.GetHeaderFile())=0D + fullPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e)=0D else:=0D archPageDict =3D {}=0D @@ -339,17 +374,21 @@ class PackageDocumentAction(DoxygenAction): "lc_%s" % obj.GetClassName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D - classPage.AddDescription('
        \n'.join(comments) + '\n')=0D + classPage.AddDescription(=0D + '
        \n'.join(comments) + '
        \n')=0D subArchRoot.AddPage(classPage)=0D - path =3D os.path.join(pObj.GetFileObj().GetPackageRootPath= (), obj.GetHeaderFile())=0D + path =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D path =3D path[len(pObj.GetWorkspace()) + 1:]=0D if len(comments) =3D=3D 0:=0D - classPage.AddDescription('\copydoc %s

        ' % obj.GetHea= derFile())=0D + classPage.AddDescription(=0D + '\copydoc %s

        ' % obj.GetHeaderFile())=0D section =3D doxygen.Section('ref', 'Refer to Header File')= =0D section.AddDescription('\link %s\n' % obj.GetHeaderFile())= =0D section.AddDescription(' \endlink

        \n')=0D classPage.AddSection(section)=0D - fullPath =3D os.path.join(pObj.GetFileObj().GetPackageRoot= Path(), obj.GetHeaderFile())=0D + fullPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetHeaderF= ile())=0D =0D self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e)=0D rootArray.append(pageRoot)=0D @@ -389,10 +428,12 @@ class PackageDocumentAction(DoxygenAction): continue=0D index =3D lines[no].lower().find('include')=0D #mo =3D IncludePattern.finditer(lines[no].lower())=0D - mo =3D re.match(r"^#\s*include\s+[<\"]([\\/\w.]+)[>\"]$", line= s[no].strip().lower())=0D + mo =3D re.match(=0D + r"^#\s*include\s+[<\"]([\\/\w.]+)[>\"]$", lines[no].strip(= ).lower())=0D if not mo:=0D continue=0D - mo =3D re.match(r"^[#\w\s]+[<\"]([\\/\w.]+)[>\"]$", lines[no].= strip())=0D + mo =3D re.match(r"^[#\w\s]+[<\"]([\\/\w.]+)[>\"]$",=0D + lines[no].strip())=0D filePath =3D mo.groups()[0]=0D =0D if filePath is None or len(filePath) =3D=3D 0:=0D @@ -403,49 +444,60 @@ class PackageDocumentAction(DoxygenAction): =0D if os.path.exists(os.path.join(os.path.dirname(path), filePath= )):=0D # Find the file in current directory=0D - fullPath =3D os.path.join(os.path.dirname(path), filePath)= .replace('\\', '/')=0D + fullPath =3D os.path.join(os.path.dirname(=0D + path), filePath).replace('\\', '/')=0D else:=0D # find in depedent package's include path=0D incObjs =3D pObj.GetFileObj().GetSectionObjectsByName('inc= ludes')=0D for incObj in incObjs:=0D - incPath =3D os.path.join(pObj.GetFileObj().GetPackageR= ootPath(), incObj.GetPath()).strip()=0D + incPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), incObj.Get= Path()).strip()=0D incPath =3D os.path.realpath(os.path.join(incPath, fil= ePath))=0D if os.path.exists(incPath):=0D fullPath =3D incPath=0D break=0D if infObj is not None:=0D pkgInfObjs =3D infObj.GetSectionObjectsByName('package= s')=0D - for obj in pkgInfObjs:=0D - decObj =3D dec.DECFile(os.path.join(pObj.GetWorksp= ace(), obj.GetPath()))=0D + for obj in pkgInfObjs:=0D + decObj =3D dec.DECFile(os.path.join(=0D + pObj.GetWorkspace(), obj.GetPath()))=0D if not decObj:=0D - ErrorMsg ('Fail to create pacakge object for %= s' % obj.GetPackageName())=0D + ErrorMsg('Fail to create pacakge object for %s= ' %=0D + obj.GetPackageName())=0D continue=0D if not decObj.Parse():=0D - ErrorMsg ('Fail to load package object for %s'= % obj.GetPackageName())=0D + ErrorMsg('Fail to load package object for %s' = %=0D + obj.GetPackageName())=0D continue=0D incObjs =3D decObj.GetSectionObjectsByName('includ= es')=0D for incObj in incObjs:=0D - incPath =3D os.path.join(decObj.GetPackageRoot= Path(), incObj.GetPath()).replace('\\', '/')=0D + incPath =3D os.path.join(=0D + decObj.GetPackageRootPath(), incObj.GetPat= h()).replace('\\', '/')=0D if os.path.exists(os.path.join(incPath, filePa= th)):=0D - fullPath =3D os.path.join(os.path.join(inc= Path, filePath))=0D + fullPath =3D os.path.join(=0D + os.path.join(incPath, filePath))=0D break=0D if fullPath is not None:=0D break=0D =0D if fullPath is None and self.IsVerbose():=0D - self.Log('Can not resolve header file %s for file %s in pa= ckage %s\n' % (filePath, path, pObj.GetFileObj().GetFilename()), 'error')=0D + self.Log('Can not resolve header file %s for file %s in pa= ckage %s\n' % (=0D + filePath, path, pObj.GetFileObj().GetFilename()), 'err= or')=0D return=0D else:=0D fullPath =3D fullPath.replace('\\', '/')=0D if self.IsVerbose():=0D - self.Log('Preprocessing: Add include file %s for file = %s\n' % (fullPath, path))=0D + self.Log('Preprocessing: Add include file %s for file = %s\n' % (=0D + fullPath, path))=0D #LogMsg ('Preprocessing: Add include file %s for file %s' = % (fullPath, path))=0D - self.ProcessSourceFileForInclude(fullPath, pObj, configFil= e, infObj)=0D + self.ProcessSourceFileForInclude(=0D + fullPath, pObj, configFile, infObj)=0D =0D def AddAllIncludeFiles(self, pObj, configFile):=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('includes')=0D for obj in objs:=0D - incPath =3D os.path.join(pObj.GetFileObj().GetPackageRootPath(= ), obj.GetPath())=0D + incPath =3D os.path.join(=0D + pObj.GetFileObj().GetPackageRootPath(), obj.GetPath())=0D for root, dirs, files in os.walk(incPath):=0D for dir in dirs:=0D if dir.lower() in _ignore_dir:=0D @@ -470,15 +522,17 @@ class PackageDocumentAction(DoxygenAction): typeArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetPcdType() not in typeRootPageDict.keys():=0D - typeRootPageDict[obj.GetPcdType()] =3D doxygen.Page(obj.Ge= tPcdType(), 'pcd_%s_root_page' % obj.GetPcdType())=0D + typeRootPageDict[obj.GetPcdType()] =3D doxygen.Page(=0D + obj.GetPcdType(), 'pcd_%s_root_page' % obj.GetPcdType(= ))=0D pcdRootPage.AddPage(typeRootPageDict[obj.GetPcdType()])=0D typeRoot =3D typeRootPageDict[obj.GetPcdType()]=0D if self._arch is not None:=0D pcdPage =3D doxygen.Page('%s' % obj.GetPcdName(),=0D - 'pcd_%s_%s_%s' % (obj.GetPcdType()= , obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D - pcdPage.AddDescription('
        \n'.join(obj.GetComment()) + '=
        \n')=0D + 'pcd_%s_%s_%s' % (obj.GetPcdType(),= obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D + pcdPage.AddDescription(=0D + '
        \n'.join(obj.GetComment()) + '
        \n')=0D section =3D doxygen.Section('PCDinformation', 'PCD Informa= tion')=0D - desc =3D ''=0D + desc =3D '
        '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -487,8 +541,10 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[1]=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[0]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 1]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 0]=0D desc +=3D '' % obj.GetPcdTok= en()=0D desc +=3D '' % obj.GetPcdDat= aType()=0D desc +=3D '' % obj.GetPcdVal= ue()=0D @@ -500,15 +556,17 @@ class PackageDocumentAction(DoxygenAction): else:=0D keystr =3D obj.GetPcdType() + obj.GetArch()=0D if keystr not in typeArchRootPageDict.keys():=0D - typeArchRootPage =3D doxygen.Page(obj.GetArch(), 'pcd_= %s_%s_root_page' % (obj.GetPcdType(), obj.GetArch()))=0D + typeArchRootPage =3D doxygen.Page(=0D + obj.GetArch(), 'pcd_%s_%s_root_page' % (obj.GetPcd= Type(), obj.GetArch()))=0D typeArchRootPageDict[keystr] =3D typeArchRootPage=0D typeRoot.AddPage(typeArchRootPage)=0D typeArchRoot =3D typeArchRootPageDict[keystr]=0D pcdPage =3D doxygen.Page('%s' % obj.GetPcdName(),=0D - 'pcd_%s_%s_%s' % (obj.GetPcdType()= , obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D - pcdPage.AddDescription('
        \n'.join(obj.GetComment()) + '=
        \n')=0D + 'pcd_%s_%s_%s' % (obj.GetPcdType(),= obj.GetArch(), obj.GetPcdName().split('.')[1]))=0D + pcdPage.AddDescription(=0D + '
        \n'.join(obj.GetComment()) + '
        \n')=0D section =3D doxygen.Section('PCDinformation', 'PCD Informa= tion')=0D - desc =3D '
        Name
        Token Space
        Default Value
        %s
        %s
        %s
        %s
        %s
        %s
        %s
        '=0D + desc =3D '
        '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -517,8 +575,10 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[1]=0D - desc +=3D '' % obj.GetPcdNam= e().split('.')[0]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 1]=0D + desc +=3D '' % obj.GetPcdNam= e().split('.')[=0D + 0]=0D desc +=3D '' % obj.GetPcdTok= en()=0D desc +=3D '' % obj.GetPcdDat= aType()=0D desc +=3D '' % obj.GetPcdVal= ue()=0D @@ -536,7 +596,7 @@ class PackageDocumentAction(DoxygenAction): if len(comments) !=3D 0:=0D guidPage.AddDescription('
        '.join(obj.GetComment()) + '
        '= )=0D section =3D doxygen.Section('BasicGuidInfo', 'GUID Information')=0D - desc =3D '
        Name
        Token Space
        Default Value
        %s
        %s
        %s
        %s
        %s
        %s
        %s
        '=0D + desc =3D '
        '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -568,19 +628,23 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('GUID', 'guid_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('guids', self._= arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GenerateGuidSubPage(pObj, obj, conf= igFile))=0D + pageRoot.AddPage(=0D + self._GenerateGuidSubPage(pObj, obj, configFile))=0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'guid_arc= h_root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'guid_arch_root_%s' % obj.GetArch()= )=0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GenerateGuidSubPage(pObj, obj, = configFile))=0D + guidArchRoot.AddPage(=0D + self._GenerateGuidSubPage(pObj, obj, configFile))=0D return [pageRoot]=0D =0D def _GeneratePpiSubPage(self, pObj, obj, configFile):=0D @@ -589,7 +653,7 @@ class PackageDocumentAction(DoxygenAction): if len(comments) !=3D 0:=0D guidPage.AddDescription('
        '.join(obj.GetComment()) + '
        '= )=0D section =3D doxygen.Section('BasicPpiInfo', 'PPI Information')=0D - desc =3D '
        GUID\'s Guid Name
        GUID\'s Guid
        '=0D + desc =3D '
        '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -621,28 +685,33 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('PPI', 'ppi_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('ppis', self._a= rch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GeneratePpiSubPage(pObj, obj, confi= gFile))=0D + pageRoot.AddPage(=0D + self._GeneratePpiSubPage(pObj, obj, configFile))=0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'ppi_arch= _root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'ppi_arch_root_%s' % obj.GetArch())= =0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GeneratePpiSubPage(pObj, obj, c= onfigFile))=0D + guidArchRoot.AddPage(=0D + self._GeneratePpiSubPage(pObj, obj, configFile))=0D return [pageRoot]=0D =0D def _GenerateProtocolSubPage(self, pObj, obj, configFile):=0D - guidPage =3D doxygen.Page(obj.GetName(), 'protocol_page_%s' % obj.= GetName())=0D + guidPage =3D doxygen.Page(=0D + obj.GetName(), 'protocol_page_%s' % obj.GetName())=0D comments =3D obj.GetComment()=0D if len(comments) !=3D 0:=0D guidPage.AddDescription('
        '.join(obj.GetComment()) + '
        '= )=0D section =3D doxygen.Section('BasicProtocolInfo', 'PROTOCOL Informa= tion')=0D - desc =3D '
        PPI\'s Guid Name
        PPI\'s Guid
        '=0D + desc =3D '
        '=0D desc +=3D ''=0D desc +=3D ''=0D desc +=3D ''=0D @@ -675,19 +744,23 @@ class PackageDocumentAction(DoxygenAction): """=0D pageRoot =3D doxygen.Page('PROTOCOL', 'protocol_root_page')=0D objs =3D pObj.GetFileObj().GetSectionObjectsByName('protocols', se= lf._arch)=0D - if len(objs) =3D=3D 0: return []=0D + if len(objs) =3D=3D 0:=0D + return []=0D if self._arch is not None:=0D for obj in objs:=0D - pageRoot.AddPage(self._GenerateProtocolSubPage(pObj, obj, = configFile))=0D + pageRoot.AddPage(=0D + self._GenerateProtocolSubPage(pObj, obj, configFile))= =0D else:=0D guidArchRootPageDict =3D {}=0D for obj in objs:=0D if obj.GetArch() not in guidArchRootPageDict.keys():=0D - guidArchRoot =3D doxygen.Page(obj.GetArch(), 'protocol= _arch_root_%s' % obj.GetArch())=0D + guidArchRoot =3D doxygen.Page(=0D + obj.GetArch(), 'protocol_arch_root_%s' % obj.GetAr= ch())=0D pageRoot.AddPage(guidArchRoot)=0D guidArchRootPageDict[obj.GetArch()] =3D guidArchRoot=0D guidArchRoot =3D guidArchRootPageDict[obj.GetArch()]=0D - guidArchRoot.AddPage(self._GenerateProtocolSubPage(pObj, o= bj, configFile))=0D + guidArchRoot.AddPage(=0D + self._GenerateProtocolSubPage(pObj, obj, configFile))= =0D return [pageRoot]=0D =0D def FindHeaderFileForGuid(self, pObj, name, configFile):=0D @@ -700,8 +773,8 @@ class PackageDocumentAction(DoxygenAction): =0D @return full path of header file and None if not found.=0D """=0D - startPath =3D pObj.GetFileObj().GetPackageRootPath()=0D - incPath =3D os.path.join(startPath, 'Include').replace('\\', '/= ')=0D + startPath =3D pObj.GetFileObj().GetPackageRootPath()=0D + incPath =3D os.path.join(startPath, 'Include').replace('\\', '/')= =0D # if /include exist, then search header under it.=0D if os.path.exists(incPath):=0D startPath =3D incPath=0D @@ -761,7 +834,7 @@ class PackageDocumentAction(DoxygenAction): modObjs =3D []=0D for infpath in infList:=0D infObj =3D inf.INFFile(infpath)=0D - #infObj =3D INFFileObject.INFFile (pObj.GetWorkspacePath(),=0D + # infObj =3D INFFileObject.INFFile (pObj.GetWorkspacePath(),=0D # inf)=0D if not infObj:=0D self.Log('Fail create INF object for %s' % inf)=0D @@ -778,13 +851,15 @@ class PackageDocumentAction(DoxygenAction): libRootPage =3D doxygen.Page('Libraries', 'lib_root_page')=0D rootPages.append(libRootPage)=0D for libInf in libObjs:=0D - libRootPage.AddPage(self.GenerateModulePage(pObj, libInf, = configFile, True))=0D + libRootPage.AddPage(self.GenerateModulePage(=0D + pObj, libInf, configFile, True))=0D =0D if len(modObjs) !=3D 0:=0D modRootPage =3D doxygen.Page('Modules', 'module_root_page')=0D rootPages.append(modRootPage)=0D for modInf in modObjs:=0D - modRootPage.AddPage(self.GenerateModulePage(pObj, modInf, = configFile, False))=0D + modRootPage.AddPage(self.GenerateModulePage(=0D + pObj, modInf, configFile, False))=0D =0D return rootPages=0D =0D @@ -799,13 +874,15 @@ class PackageDocumentAction(DoxygenAction): """=0D workspace =3D pObj.GetWorkspace()=0D refDecObjs =3D []=0D - for obj in infObj.GetSectionObjectsByName('packages'):=0D + for obj in infObj.GetSectionObjectsByName('packages'):=0D decObj =3D dec.DECFile(os.path.join(workspace, obj.GetPath()))= =0D if not decObj:=0D - ErrorMsg ('Fail to create pacakge object for %s' % obj.Get= PackageName())=0D + ErrorMsg('Fail to create pacakge object for %s' %=0D + obj.GetPackageName())=0D continue=0D if not decObj.Parse():=0D - ErrorMsg ('Fail to load package object for %s' % obj.GetPa= ckageName())=0D + ErrorMsg('Fail to load package object for %s' %=0D + obj.GetPackageName())=0D continue=0D refDecObjs.append(decObj)=0D =0D @@ -813,12 +890,14 @@ class PackageDocumentAction(DoxygenAction): 'module_%s' % infObj.GetBaseName())=0D modPage.AddDescription(infObj.GetFileHeader())=0D =0D - basicInfSection =3D doxygen.Section('BasicModuleInformation', 'Bas= ic Module Information')=0D + basicInfSection =3D doxygen.Section(=0D + 'BasicModuleInformation', 'Basic Module Information')=0D desc =3D "
        PROTOCOL\'s Guid Name
        PROTOCOL\'s Guid
        "=0D for obj in infObj.GetSectionObjectsByName('defines'):=0D key =3D obj.GetKey()=0D value =3D obj.GetValue()=0D - if key not in _inf_key_description_mapping_table.keys(): conti= nue=0D + if key not in _inf_key_description_mapping_table.keys():=0D + continue=0D if key =3D=3D 'LIBRARY_CLASS' and value.find('|') !=3D -1:=0D clsname, types =3D value.split('|')=0D desc +=3D ''=0D @@ -842,7 +921,7 @@ class PackageDocumentAction(DoxygenAction): modPage.AddSection(basicInfSection)=0D =0D # Add protocol section=0D - data =3D []=0D + data =3D []=0D for obj in infObj.GetSectionObjectsByName('pcd', self._arch):=0D data.append(obj.GetPcdName().strip())=0D if len(data) !=3D 0:=0D @@ -853,7 +932,8 @@ class PackageDocumentAction(DoxygenAction): desc +=3D ''=0D desc +=3D '' % item.split('.')[1]=0D desc +=3D '' % item.split('.')[0]=0D - pkgbasename =3D self.SearchPcdPackage(item, workspace, ref= DecObjs)=0D + pkgbasename =3D self.SearchPcdPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '' % pkgbasename=0D desc +=3D ''=0D desc +=3D "
        %s%s%s
        "=0D @@ -862,8 +942,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add protocol section=0D #sects =3D infObj.GetSectionByString('protocol')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('protocol', self._arch):= =0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -873,7 +953,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchProtocolPackage(item, workspace= , refDecObjs)=0D + pkgbasename =3D self.SearchProtocolPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -882,8 +963,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add ppi section=0D #sects =3D infObj.GetSectionByString('ppi')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('ppi', self._arch):=0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -893,7 +974,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchPpiPackage(item, workspace, ref= DecObjs)=0D + pkgbasename =3D self.SearchPpiPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -902,8 +984,8 @@ class PackageDocumentAction(DoxygenAction): =0D # Add guid section=0D #sects =3D infObj.GetSectionByString('guid')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('guid', self._arch):=0D data.append(obj.GetName().strip())=0D if len(data) !=3D 0:=0D @@ -913,7 +995,8 @@ class PackageDocumentAction(DoxygenAction): for item in data:=0D desc +=3D ''=0D desc +=3D '%s' % item=0D - pkgbasename =3D self.SearchGuidPackage(item, workspace, re= fDecObjs)=0D + pkgbasename =3D self.SearchGuidPackage(=0D + item, workspace, refDecObjs)=0D desc +=3D '%s' % pkgbasename=0D desc +=3D ''=0D desc +=3D ""=0D @@ -929,12 +1012,13 @@ class PackageDocumentAction(DoxygenAction): desc +=3D 'Produce'=0D try:=0D pkgname, hPath =3D self.SearchLibraryClassHeaderFile(infOb= j.GetProduceLibraryClass(),=0D - workspace,=0D - refDecObjs)= =0D + workspa= ce,=0D + refDecO= bjs)=0D except:=0D - self.Log ('fail to get package header file for lib class %= s' % infObj.GetProduceLibraryClass())=0D + self.Log('fail to get package header file for lib class %s= ' %=0D + infObj.GetProduceLibraryClass())=0D pkgname =3D 'NULL'=0D - hPath =3D 'NULL'=0D + hPath =3D 'NULL'=0D desc +=3D '%s' % pkgname=0D if hPath !=3D "NULL":=0D #desc +=3D '\link %s \endlink' % hPath=0D @@ -951,9 +1035,10 @@ class PackageDocumentAction(DoxygenAction): if retarr is not None:=0D pkgname, hPath =3D retarr=0D else:=0D - self.Log('Fail find the library class %s definition from m= odule %s dependent package!' % (lcObj.GetClass(), infObj.GetFilename()), 'e= rror')=0D + self.Log('Fail find the library class %s definition from m= odule %s dependent package!' % (=0D + lcObj.GetClass(), infObj.GetFilename()), 'error')=0D pkgname =3D 'NULL'=0D - hPath =3D 'NULL'=0D + hPath =3D 'NULL'=0D desc +=3D 'Consume'=0D desc +=3D '%s' % pkgname=0D desc +=3D '%s' % hPath=0D @@ -966,22 +1051,25 @@ class PackageDocumentAction(DoxygenAction): section.AddDescription('

          \n')=0D for obj in infObj.GetSourceObjects(self._arch, self._tooltag):=0D sPath =3D infObj.GetModuleRootPath()=0D - sPath =3D os.path.join(sPath, obj.GetSourcePath()).replace('\\= ', '/').strip()=0D + sPath =3D os.path.join(sPath, obj.GetSourcePath()=0D + ).replace('\\', '/').strip()=0D if sPath.lower().endswith('.uni') or sPath.lower().endswith('.= s') or sPath.lower().endswith('.asm') or sPath.lower().endswith('.nasm'):=0D newPath =3D self.TranslateUniFile(sPath)=0D configFile.AddFile(newPath)=0D newPath =3D newPath[len(pObj.GetWorkspace()) + 1:]=0D - section.AddDescription('
        • \link %s \endlink
        • ' % n= ewPath)=0D + section.AddDescription(=0D + '
        • \link %s \endlink
        • ' % newPath)=0D else:=0D - self.ProcessSourceFileForInclude(sPath, pObj, configFile, = infObj)=0D + self.ProcessSourceFileForInclude(=0D + sPath, pObj, configFile, infObj)=0D sPath =3D sPath[len(pObj.GetWorkspace()) + 1:]=0D section.AddDescription('
        • \link %s \endlink
        • ' % sPa= th)=0D section.AddDescription('
        \n')=0D modPage.AddSection(section)=0D =0D #sects =3D infObj.GetSectionByString('depex')=0D - data =3D []=0D - #for sect in sects:=0D + data =3D []=0D + # for sect in sects:=0D for obj in infObj.GetSectionObjectsByName('depex'):=0D data.append(str(obj))=0D if len(data) !=3D 0:=0D @@ -1031,35 +1119,35 @@ class PackageDocumentAction(DoxygenAction): return newpath=0D =0D def SearchPcdPackage(self, pcdname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for pcd in decObj.GetSectionObjectsByName('pcd'):=0D if pcdname =3D=3D pcd.GetPcdName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchProtocolPackage(self, protname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for proto in decObj.GetSectionObjectsByName('protocol'):=0D if protname =3D=3D proto.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchPpiPackage(self, ppiname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for ppi in decObj.GetSectionObjectsByName('ppi'):=0D if ppiname =3D=3D ppi.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchGuidPackage(self, guidname, workspace, decObjs):=0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for guid in decObj.GetSectionObjectsByName('guid'):=0D if guidname =3D=3D guid.GetName():=0D return decObj.GetBaseName()=0D return None=0D =0D def SearchLibraryClassHeaderFile(self, className, workspace, decObjs):= =0D - for decObj in decObjs:=0D + for decObj in decObjs:=0D for cls in decObj.GetSectionObjectsByName('libraryclasses'):=0D if cls.GetClassName().strip() =3D=3D className:=0D path =3D cls.GetHeaderFile().strip()=0D @@ -1074,9 +1162,11 @@ class PackageDocumentAction(DoxygenAction): path =3D path[len(pRootPath) + 1:]=0D return path.replace('\\', '/')=0D =0D +=0D def IsCHeaderFile(path):=0D return CheckPathPostfix(path, 'h')=0D =0D +=0D def CheckPathPostfix(path, str):=0D index =3D path.rfind('.')=0D if index =3D=3D -1:=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/dsc.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/dsc.py index a2d23a7732f4..566531035307 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dsc.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= dsc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D #=0D @@ -6,9 +6,11 @@ #=0D =0D from plugins.EdkPlugins.basemodel import ini=0D -import re, os=0D +import re=0D +import os=0D from plugins.EdkPlugins.basemodel.message import *=0D =0D +=0D class DSCFile(ini.BaseINIFile):=0D def GetSectionInstance(self, parent, name, isCombined=3DFalse):=0D return DSCSection(parent, name, isCombined)=0D @@ -16,6 +18,7 @@ class DSCFile(ini.BaseINIFile): def GetComponents(self):=0D return self.GetSectionObjectsByName('Components')=0D =0D +=0D class DSCSection(ini.BaseINISection):=0D def GetSectionINIObject(self, parent):=0D type =3D self.GetType()=0D @@ -53,10 +56,12 @@ class DSCSection(ini.BaseINISection): return 'common'=0D return arr[2]=0D =0D +=0D class DSCSectionObject(ini.BaseINISectionObject):=0D def GetArch(self):=0D return self.GetParent().GetArch()=0D =0D +=0D class DSCPcdObject(DSCSectionObject):=0D =0D def __init__(self, parent):=0D @@ -65,8 +70,8 @@ class DSCPcdObject(DSCSectionObject): =0D def Parse(self):=0D line =3D self.GetLineByOffset(self._start).strip().split('#')[0]=0D - self._name =3D line.split('|')[0]=0D - self._value =3D line.split('|')[1]=0D + self._name =3D line.split('|')[0]=0D + self._value =3D line.split('|')[1]=0D return True=0D =0D def GetPcdName(self):=0D @@ -78,6 +83,7 @@ class DSCPcdObject(DSCSectionObject): def GetPcdValue(self):=0D return self._value=0D =0D +=0D class DSCLibraryClassObject(DSCSectionObject):=0D def __init__(self, parent):=0D ini.BaseINISectionObject.__init__(self, parent)=0D @@ -96,13 +102,14 @@ class DSCLibraryClassObject(DSCSectionObject): def GetModuleType(self):=0D return self.GetParent().GetModuleType()=0D =0D +=0D class DSCComponentObject(DSCSectionObject):=0D =0D def __init__(self, parent):=0D ini.BaseINISectionObject.__init__(self, parent)=0D - self._OveridePcds =3D {}=0D + self._OveridePcds =3D {}=0D self._OverideLibraries =3D {}=0D - self._Filename =3D ''=0D + self._Filename =3D ''=0D =0D def __del__(self):=0D self._OverideLibraries.clear()=0D @@ -140,7 +147,7 @@ class DSCComponentObject(DSCSectionObject): # The end line is '}' and could be ignored=0D #=0D curr =3D self._start + 1=0D - end =3D self._end - 1=0D + end =3D self._end - 1=0D OverideName =3D ''=0D while (curr <=3D end):=0D line =3D self.GetLineByOffset(curr).strip()=0D @@ -176,7 +183,8 @@ class DSCComponentObject(DSCSectionObject): if hasLib:=0D lines.append(' \n')=0D for libKey in self._OverideLibraries.keys():=0D - lines.append(' %s|%s\n' % (libKey, self._OverideLibra= ries[libKey]))=0D + lines.append(' %s|%s\n' %=0D + (libKey, self._OverideLibraries[libKey]))=0D =0D if hasPcd:=0D for key in self._OveridePcds.keys():=0D @@ -192,4 +200,3 @@ class DSCComponentObject(DSCSectionObject): lines.append(' }\n')=0D =0D return lines=0D -=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2= /model/inf.py b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/e= dk2/model/inf.py index 430e71af2d89..259e8a409fac 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= inf.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/EdkPlugins/edk2/model/= inf.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D #=0D @@ -6,9 +6,11 @@ #=0D =0D from plugins.EdkPlugins.basemodel import ini=0D -import re, os=0D +import re=0D +import os=0D from plugins.EdkPlugins.basemodel.message import *=0D =0D +=0D class INFFile(ini.BaseINIFile):=0D _libobjs =3D {}=0D =0D @@ -17,7 +19,8 @@ class INFFile(ini.BaseINIFile): =0D def GetProduceLibraryClass(self):=0D obj =3D self.GetDefine("LIBRARY_CLASS")=0D - if obj is None: return None=0D + if obj is None:=0D + return None=0D =0D return obj.split('|')[0].strip()=0D =0D @@ -116,10 +119,12 @@ class INFSection(ini.BaseINISection): =0D return True=0D =0D +=0D class INFSectionObject(ini.BaseINISectionObject):=0D def GetArch(self):=0D return self.GetParent().GetArch()=0D =0D +=0D class INFDefineSectionObject(INFSectionObject):=0D def __init__(self, parent):=0D INFSectionObject.__init__(self, parent)=0D @@ -127,20 +132,21 @@ class INFDefineSectionObject(INFSectionObject): self._value =3D None=0D =0D def Parse(self):=0D - assert (self._start =3D=3D self._end), 'The object in define secti= on must be in single line'=0D + assert (self._start =3D=3D=0D + self._end), 'The object in define section must be in singl= e line'=0D =0D line =3D self.GetLineByOffset(self._start).strip()=0D =0D line =3D line.split('#')[0]=0D - arr =3D line.split('=3D')=0D + arr =3D line.split('=3D')=0D if len(arr) !=3D 2:=0D ErrorMsg('Invalid define section object',=0D - self.GetFilename(),=0D - self._start=0D - )=0D + self.GetFilename(),=0D + self._start=0D + )=0D return False=0D =0D - self._key =3D arr[0].strip()=0D + self._key =3D arr[0].strip()=0D self._value =3D arr[1].strip()=0D =0D return True=0D @@ -151,8 +157,10 @@ class INFDefineSectionObject(INFSectionObject): def GetValue(self):=0D return self._value=0D =0D +=0D class INFLibraryClassObject(INFSectionObject):=0D _objs =3D {}=0D +=0D def __init__(self, parent):=0D INFSectionObject.__init__(self, parent)=0D self._classname =3D None=0D @@ -161,7 +169,8 @@ class INFLibraryClassObject(INFSectionObject): return self._classname=0D =0D def Parse(self):=0D - self._classname =3D self.GetLineByOffset(self._start).split('#')[0= ].strip()=0D + self._classname =3D self.GetLineByOffset(=0D + self._start).split('#')[0].strip()=0D objdict =3D INFLibraryClassObject._objs=0D if self._classname in objdict:=0D objdict[self._classname].append(self)=0D @@ -182,21 +191,24 @@ class INFLibraryClassObject(INFSectionObject): def GetObjectDict():=0D return INFLibraryClassObject._objs=0D =0D +=0D class INFDependentPackageObject(INFSectionObject):=0D def GetPath(self):=0D return self.GetLineByOffset(self._start).split('#')[0].strip()=0D =0D +=0D class INFSourceObject(INFSectionObject):=0D _objs =3D {}=0D +=0D def __init__(self, parent):=0D INFSectionObject.__init__(self, parent)=0D =0D - self.mSourcename =3D None=0D - self.mToolCode =3D None=0D - self.mFamily =3D None=0D - self.mTagName =3D None=0D - self.mFeaturePcd =3D None=0D - self.mFilename =3D None=0D + self.mSourcename =3D None=0D + self.mToolCode =3D None=0D + self.mFamily =3D None=0D + self.mTagName =3D None=0D + self.mFeaturePcd =3D None=0D + self.mFilename =3D None=0D =0D def GetSourcePath(self):=0D return self.mSourcename=0D @@ -273,15 +285,16 @@ class INFSourceObject(INFSectionObject): def GetObjectDict():=0D return INFSourceObject._objs=0D =0D +=0D class INFPcdObject(INFSectionObject):=0D _objs =3D {}=0D =0D def __init__(self, parent):=0D INFSectionObject.__init__(self, parent)=0D =0D - self.mPcdType =3D None=0D + self.mPcdType =3D None=0D self.mDefaultValue =3D None=0D - self.mPcdName =3D None=0D + self.mPcdName =3D None=0D =0D @staticmethod=0D def GetObjectDict():=0D @@ -291,7 +304,7 @@ class INFPcdObject(INFSectionObject): line =3D self.GetLineByOffset(self._start).strip().split('#')[0]=0D =0D arr =3D line.split('|')=0D - self.mPcdName =3D arr[0].strip()=0D + self.mPcdName =3D arr[0].strip()=0D =0D if len(arr) >=3D 2:=0D self.mDefaultValue =3D arr[1].strip()=0D @@ -319,17 +332,17 @@ class INFPcdObject(INFSectionObject): if len(objdict[self.GetName()]) =3D=3D 0:=0D del objdict[self.GetName()]=0D =0D +=0D class INFGuidObject(INFSectionObject):=0D def __init__(self, parent):=0D INFSectionObject.__init__(self, parent)=0D self._name =3D None=0D =0D def Parse(self):=0D - line =3D self.GetLineByOffset(self._start).strip().split('#')[0].s= plit("|")[0]=0D - self._name =3D line.strip()=0D + line =3D self.GetLineByOffset(self._start).strip().split('#')[=0D + 0].split("|")[0]=0D + self._name =3D line.strip()=0D return True=0D =0D def GetName(self):=0D return self._name=0D -=0D -=0D diff --git a/BaseTools/Scripts/PackageDocumentTools/plugins/__init__.py b/B= aseTools/Scripts/PackageDocumentTools/plugins/__init__.py index 57dfebde5916..dd93c30888c4 100644 --- a/BaseTools/Scripts/PackageDocumentTools/plugins/__init__.py +++ b/BaseTools/Scripts/PackageDocumentTools/plugins/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D #=0D diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index 63e6223f8ebc..551bc3d26fdf 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Check a patch for various format issues=0D #=0D # Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
        = =0D @@ -9,23 +9,23 @@ #=0D =0D from __future__ import print_function=0D +import email.header=0D +import sys=0D +import subprocess=0D +import re=0D +import os=0D +import argparse=0D +import email=0D =0D VersionNumber =3D '0.1'=0D __copyright__ =3D "Copyright (c) 2015 - 2016, Intel Corporation All right= s reserved."=0D =0D -import email=0D -import argparse=0D -import os=0D -import re=0D -import subprocess=0D -import sys=0D -=0D -import email.header=0D =0D class Verbose:=0D SILENT, ONELINE, NORMAL =3D range(3)=0D level =3D NORMAL=0D =0D +=0D class EmailAddressCheck:=0D """Checks an email address."""=0D =0D @@ -55,7 +55,7 @@ class EmailAddressCheck: count +=3D 1=0D =0D email_re1 =3D re.compile(r'(?:\s*)(.*?)(\s*)<(.+)>\s*$',=0D - re.MULTILINE|re.IGNORECASE)=0D + re.MULTILINE | re.IGNORECASE)=0D =0D def check_email_address(self, email):=0D email =3D email.strip()=0D @@ -86,13 +86,14 @@ class EmailAddressCheck: self.error("Email rewritten by lists DMARC / DKIM / SPF: " +=0D email)=0D =0D +=0D class CommitMessageCheck:=0D """Checks the contents of a git commit message."""=0D =0D def __init__(self, subject, message, author_email):=0D self.ok =3D True=0D =0D - if subject is None and message is None:=0D + if subject is None and message is None:=0D self.error('Commit message is missing!')=0D return=0D =0D @@ -104,7 +105,7 @@ class CommitMessageCheck: self.subject =3D subject=0D self.msg =3D message=0D =0D - print (subject)=0D + print(subject)=0D =0D self.check_contributed_under()=0D if not MergifyMerge:=0D @@ -143,7 +144,7 @@ class CommitMessageCheck: # requires ':' to be present. Matches if there is white space before= =0D # the tag or between the tag and the ':'.=0D contributed_under_re =3D \=0D - re.compile(r'^\s*contributed-under\s*:', re.MULTILINE|re.IGNORECAS= E)=0D + re.compile(r'^\s*contributed-under\s*:', re.MULTILINE | re.IGNOREC= ASE)=0D =0D def check_contributed_under(self):=0D match =3D self.contributed_under_re.search(self.msg)=0D @@ -160,7 +161,7 @@ class CommitMessageCheck: re_str =3D (r'^(?P' + sub_re +=0D r')(\s*):(\s*)(?P\S.*?)(?:\s*)$')=0D try:=0D - return re.compile(re_str, re.MULTILINE|re.IGNORECASE)=0D + return re.compile(re_str, re.MULTILINE | re.IGNORECASE)=0D except Exception:=0D print("Tried to compile re:", re_str)=0D raise=0D @@ -184,7 +185,7 @@ class CommitMessageCheck: =0D bad_case_sigs =3D filter(lambda m: m[0] !=3D sig, sigs)=0D for s in bad_case_sigs:=0D - self.error("'" +s[0] + "' should be '" + sig + "'")=0D + self.error("'" + s[0] + "' should be '" + sig + "'")=0D =0D for s in sigs:=0D if s[1] !=3D '':=0D @@ -198,7 +199,7 @@ class CommitMessageCheck: return sigs=0D =0D def check_signed_off_by(self):=0D - sob=3D'Signed-off-by'=0D + sob =3D 'Signed-off-by'=0D if self.msg.find(sob) < 0:=0D self.error('Missing Signed-off-by! (Note: this must be ' +=0D 'added by the code contributor!)')=0D @@ -217,7 +218,7 @@ class CommitMessageCheck: 'Suggested',=0D 'Acked',=0D 'Cc'=0D - )=0D + )=0D =0D def check_misc_signatures(self):=0D for sig in self.sig_types:=0D @@ -251,7 +252,7 @@ class CommitMessageCheck: self.error(=0D 'First line of commit message (subject line) is too lo= ng (%d >=3D 93).' %=0D (len(lines[0].rstrip()))=0D - )=0D + )=0D else:=0D #=0D # If CVE-xxxx-xxxxx is not present in subject line, then limit= =0D @@ -261,7 +262,7 @@ class CommitMessageCheck: self.error(=0D 'First line of commit message (subject line) is too lo= ng (%d >=3D 76).' %=0D (len(lines[0].rstrip()))=0D - )=0D + )=0D =0D if count >=3D 1 and len(lines[0].strip()) =3D=3D 0:=0D self.error('First line of commit message (subject line) ' +=0D @@ -281,14 +282,14 @@ class CommitMessageCheck: not lines[i].startswith('Reported-by:') and=0D not lines[i].startswith('Suggested-by:') and=0D not lines[i].startswith('Signed-off-by:') and=0D - not lines[i].startswith('Cc:')):=0D + not lines[i].startswith('Cc:')):=0D #=0D # Print a warning if body line is longer than 75 character= s=0D #=0D print(=0D 'WARNING - Line %d of commit message is too long (%d >= =3D 76).' %=0D (i + 1, len(lines[i]))=0D - )=0D + )=0D print(lines[i])=0D =0D last_sig_line =3D None=0D @@ -307,8 +308,10 @@ class CommitMessageCheck: break=0D last_sig_line =3D line.strip()=0D =0D +=0D (START, PRE_PATCH, PATCH) =3D range(3)=0D =0D +=0D class GitDiffCheck:=0D """Checks the contents of a git diff."""=0D =0D @@ -347,8 +350,8 @@ class GitDiffCheck: if line.startswith('@@ '):=0D self.state =3D PRE_PATCH=0D elif len(line) >=3D 1 and line[0] not in ' -+' and \=0D - not line.startswith('\r\n') and \=0D - not line.startswith(r'\ No newline ') and not self.binary= :=0D + not line.startswith('\r\n') and \=0D + not line.startswith(r'\ No newline ') and not self.bin= ary:=0D for line in self.lines[self.line_num + 1:]:=0D if line.startswith('diff --git'):=0D self.format_error('diff found after end of patch')= =0D @@ -364,10 +367,10 @@ class GitDiffCheck: self.force_crlf =3D True=0D self.force_notabs =3D True=0D if self.filename.endswith('.sh') or \=0D - self.filename.startswith('BaseTools/BinWrappers/PosixL= ike/') or \=0D - self.filename.startswith('BaseTools/BinPipWrappers/Pos= ixLike/') or \=0D - self.filename.startswith('BaseTools/Bin/CYGWIN_NT-5.1-= i686/') or \=0D - self.filename =3D=3D 'BaseTools/BuildEnv':=0D + self.filename.startswith('BaseTools/BinWrappers/Po= sixLike/') or \=0D + self.filename.startswith('BaseTools/BinPipWrappers= /PosixLike/') or \=0D + self.filename.startswith('BaseTools/Bin/CYGWIN_NT-= 5.1-i686/') or \=0D + self.filename =3D=3D 'BaseTools/BuildEnv':=0D #=0D # Do not enforce CR/LF line endings for linux shell sc= ripts.=0D # Some linux shell scripts don't end with the ".sh" ex= tension,=0D @@ -391,7 +394,7 @@ class GitDiffCheck: self.state =3D PATCH=0D self.binary =3D False=0D elif line.startswith('GIT binary patch') or \=0D - line.startswith('Binary files'):=0D + line.startswith('Binary files'):=0D self.state =3D PATCH=0D self.binary =3D True=0D if self.is_newfile:=0D @@ -437,7 +440,7 @@ class GitDiffCheck: 'copy from ',=0D 'copy to ',=0D 'rename ',=0D - )=0D + )=0D =0D line_endings =3D ('\r\n', '\n\r', '\n', '\r')=0D =0D @@ -448,7 +451,7 @@ class GitDiffCheck: re.VERBOSE)=0D =0D def added_line_error(self, msg, line):=0D - lines =3D [ msg ]=0D + lines =3D [msg]=0D if self.filename is not None:=0D lines.append('File: ' + self.filename)=0D lines.append('Line: ' + line)=0D @@ -514,6 +517,7 @@ class GitDiffCheck: print(prefix, line)=0D count +=3D 1=0D =0D +=0D class CheckOnePatch:=0D """Checks the contents of a git email formatted patch.=0D =0D @@ -528,7 +532,8 @@ class CheckOnePatch: email_check =3D EmailAddressCheck(self.author_email, 'Author')=0D email_ok =3D email_check.ok=0D =0D - msg_check =3D CommitMessageCheck(self.commit_subject, self.commit_= msg, self.author_email)=0D + msg_check =3D CommitMessageCheck(=0D + self.commit_subject, self.commit_msg, self.author_email)=0D msg_ok =3D msg_check.ok=0D =0D diff_ok =3D True=0D @@ -550,7 +555,6 @@ class CheckOnePatch: result =3D 'bad ' + ' and '.join(result)=0D print(name, result)=0D =0D -=0D git_diff_re =3D re.compile(r'''=0D ^ diff \s+ --git \s+ a/.+ \s+ b/.+ $=0D ''',=0D @@ -629,10 +633,12 @@ class CheckOnePatch: =0D self.commit_subject =3D subject.replace('\r\n', '')=0D self.commit_subject =3D self.commit_subject.replace('\n', '')=0D - self.commit_subject =3D self.subject_prefix_re.sub('', self.commit= _subject, 1)=0D + self.commit_subject =3D self.subject_prefix_re.sub(=0D + '', self.commit_subject, 1)=0D =0D self.author_email =3D pmail['from']=0D =0D +=0D class CheckGitCommits:=0D """Reads patches from git based on the specified git revision range.=0D =0D @@ -642,7 +648,7 @@ class CheckGitCommits: def __init__(self, rev_spec, max_count):=0D commits =3D self.read_commit_list_from_git(rev_spec, max_count)=0D if len(commits) =3D=3D 1 and Verbose.level > Verbose.ONELINE:=0D - commits =3D [ rev_spec ]=0D + commits =3D [rev_spec]=0D self.ok =3D True=0D blank_line =3D False=0D for commit in commits:=0D @@ -661,7 +667,7 @@ class CheckGitCommits: =0D def read_commit_list_from_git(self, rev_spec, max_count):=0D # Run git to get the commit patch=0D - cmd =3D [ 'rev-list', '--abbrev-commit', '--no-walk' ]=0D + cmd =3D ['rev-list', '--abbrev-commit', '--no-walk']=0D if max_count is not None:=0D cmd.append('--max-count=3D' + str(max_count))=0D cmd.append(rev_spec)=0D @@ -679,13 +685,14 @@ class CheckGitCommits: '--no-use-mailmap', commit)=0D =0D def run_git(self, *args):=0D - cmd =3D [ 'git' ]=0D + cmd =3D ['git']=0D cmd +=3D args=0D p =3D subprocess.Popen(cmd,=0D - stdout=3Dsubprocess.PIPE,=0D - stderr=3Dsubprocess.STDOUT)=0D + stdout=3Dsubprocess.PIPE,=0D + stderr=3Dsubprocess.STDOUT)=0D Result =3D p.communicate()=0D - return Result[0].decode('utf-8', 'ignore') if Result[0] and Result= [0].find(b"fatal")!=3D0 else None=0D + return Result[0].decode('utf-8', 'ignore') if Result[0] and Result= [0].find(b"fatal") !=3D 0 else None=0D +=0D =0D class CheckOnePatchFile:=0D """Performs a patch check for a single file.=0D @@ -705,6 +712,7 @@ class CheckOnePatchFile: print('Checking patch file:', patch_filename)=0D self.ok =3D CheckOnePatch(patch_filename, patch).ok=0D =0D +=0D class CheckOneArg:=0D """Performs a patch check for a single command line argument.=0D =0D @@ -720,6 +728,7 @@ class CheckOneArg: checker =3D CheckGitCommits(param, max_count)=0D self.ok =3D checker.ok=0D =0D +=0D class PatchCheckApp:=0D """Checks patches based on the command line arguments."""=0D =0D @@ -728,7 +737,7 @@ class PatchCheckApp: patches =3D self.args.patches=0D =0D if len(patches) =3D=3D 0:=0D - patches =3D [ 'HEAD' ]=0D + patches =3D ['HEAD']=0D =0D self.ok =3D True=0D self.count =3D None=0D @@ -772,5 +781,6 @@ class PatchCheckApp: if self.args.silent:=0D Verbose.level =3D Verbose.SILENT=0D =0D +=0D if __name__ =3D=3D "__main__":=0D sys.exit(PatchCheckApp().retval)=0D diff --git a/BaseTools/Scripts/RunMakefile.py b/BaseTools/Scripts/RunMakefi= le.py index 0e0a0114f9c7..a65cd0717495 100644 --- a/BaseTools/Scripts/RunMakefile.py +++ b/BaseTools/Scripts/RunMakefile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Run a makefile as part of a PREBUILD or POSTBUILD action.=0D #=0D # Copyright (c) 2017, Intel Corporation. All rights reserved.
        =0D @@ -17,9 +17,9 @@ import subprocess #=0D # Globals for help information=0D #=0D -__prog__ =3D 'RunMakefile'=0D -__version__ =3D '%s Version %s' % (__prog__, '1.0')=0D -__copyright__ =3D 'Copyright (c) 2017, Intel Corporation. All rights res= erved.'=0D +__prog__ =3D 'RunMakefile'=0D +__version__ =3D '%s Version %s' % (__prog__, '1.0')=0D +__copyright__ =3D 'Copyright (c) 2017, Intel Corporation. All rights reser= ved.'=0D __description__ =3D 'Run a makefile as part of a PREBUILD or POSTBUILD act= ion.\n'=0D =0D #=0D @@ -27,146 +27,152 @@ __description__ =3D 'Run a makefile as part of a PREB= UILD or POSTBUILD action.\n' #=0D gArgs =3D None=0D =0D +=0D def Log(Message):=0D - if not gArgs.Verbose:=0D - return=0D - sys.stdout.write (__prog__ + ': ' + Message + '\n')=0D + if not gArgs.Verbose:=0D + return=0D + sys.stdout.write(__prog__ + ': ' + Message + '\n')=0D +=0D =0D def Error(Message, ExitValue=3D1):=0D - sys.stderr.write (__prog__ + ': ERROR: ' + Message + '\n')=0D - sys.exit (ExitValue)=0D + sys.stderr.write(__prog__ + ': ERROR: ' + Message + '\n')=0D + sys.exit(ExitValue)=0D +=0D =0D def RelativePath(target):=0D - return os.path.relpath (target, gWorkspace)=0D + return os.path.relpath(target, gWorkspace)=0D +=0D =0D def NormalizePath(target):=0D - if isinstance(target, tuple):=0D - return os.path.normpath (os.path.join (*target))=0D - else:=0D - return os.path.normpath (target)=0D + if isinstance(target, tuple):=0D + return os.path.normpath(os.path.join(*target))=0D + else:=0D + return os.path.normpath(target)=0D +=0D =0D if __name__ =3D=3D '__main__':=0D - #=0D - # Create command line argument parser object=0D - #=0D - parser =3D argparse.ArgumentParser (=0D - prog =3D __prog__,=0D - version =3D __version__,=0D - description =3D __description__ + __copyright__,=0D - conflict_handler =3D 'resolve'=0D - )=0D - parser.add_argument (=0D - '-a', '--arch', dest =3D 'Arch', nargs =3D '+', action =3D 'app= end',=0D - required =3D True,=0D - help =3D '''ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 = or EBC,=0D + #=0D + # Create command line argument parser object=0D + #=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__,=0D + version=3D__version__,=0D + description=3D__description__ + __copyright__,=0D + conflict_handler=3D'resolve'=0D + )=0D + parser.add_argument(=0D + '-a', '--arch', dest=3D'Arch', nargs=3D'+', action=3D'append',=0D + required=3DTrue,=0D + help=3D'''ARCHS is one of list: IA32, X64, IPF, ARM, AARCH64 or EB= C,=0D which overrides target.txt's TARGET_ARCH definition. = To=0D specify more archs, please repeat this option.'''=0D - )=0D - parser.add_argument (=0D - '-t', '--tagname', dest =3D 'ToolChain', required =3D True,=0D - help =3D '''Using the Tool Chain Tagname to build the platform,= =0D + )=0D + parser.add_argument(=0D + '-t', '--tagname', dest=3D'ToolChain', required=3DTrue,=0D + help=3D'''Using the Tool Chain Tagname to build the platform,=0D overriding target.txt's TOOL_CHAIN_TAG definition.'''= =0D - )=0D - parser.add_argument (=0D - '-p', '--platform', dest =3D 'PlatformFile', required =3D True,= =0D - help =3D '''Build the platform specified by the DSC file name a= rgument,=0D + )=0D + parser.add_argument(=0D + '-p', '--platform', dest=3D'PlatformFile', required=3DTrue,=0D + help=3D'''Build the platform specified by the DSC file name argume= nt,=0D overriding target.txt's ACTIVE_PLATFORM definition.''= '=0D - )=0D - parser.add_argument (=0D - '-b', '--buildtarget', dest =3D 'BuildTarget', required =3D Tru= e,=0D - help =3D '''Using the TARGET to build the platform, overriding= =0D + )=0D + parser.add_argument(=0D + '-b', '--buildtarget', dest=3D'BuildTarget', required=3DTrue,=0D + help=3D'''Using the TARGET to build the platform, overriding=0D target.txt's TARGET definition.'''=0D - )=0D - parser.add_argument (=0D - '--conf=3D', dest =3D 'ConfDirectory', required =3D True,=0D - help =3D '''Specify the customized Conf directory.'''=0D - )=0D - parser.add_argument (=0D - '-D', '--define', dest =3D 'Define', nargs=3D'*', action =3D 'a= ppend',=0D - help =3D '''Macro: "Name [=3D Value]".'''=0D - )=0D - parser.add_argument (=0D - '--makefile', dest =3D 'Makefile', required =3D True,=0D - help =3D '''Makefile to run passing in arguments as makefile de= fines.'''=0D - )=0D - parser.add_argument (=0D - '-v', '--verbose', dest =3D 'Verbose', action =3D 'store_true',= =0D - help =3D '''Turn on verbose output with informational messages = printed'''=0D - )=0D + )=0D + parser.add_argument(=0D + '--conf=3D', dest=3D'ConfDirectory', required=3DTrue,=0D + help=3D'''Specify the customized Conf directory.'''=0D + )=0D + parser.add_argument(=0D + '-D', '--define', dest=3D'Define', nargs=3D'*', action=3D'append',= =0D + help=3D'''Macro: "Name [=3D Value]".'''=0D + )=0D + parser.add_argument(=0D + '--makefile', dest=3D'Makefile', required=3DTrue,=0D + help=3D'''Makefile to run passing in arguments as makefile defines= .'''=0D + )=0D + parser.add_argument(=0D + '-v', '--verbose', dest=3D'Verbose', action=3D'store_true',=0D + help=3D'''Turn on verbose output with informational messages print= ed'''=0D + )=0D =0D - #=0D - # Parse command line arguments=0D - #=0D - gArgs, remaining =3D parser.parse_known_args()=0D - gArgs.BuildType =3D 'all'=0D - for BuildType in ['all', 'fds', 'genc', 'genmake', 'clean', 'cleanall', = 'modules', 'libraries', 'run']:=0D - if BuildType in remaining:=0D - gArgs.BuildType =3D BuildType=0D - remaining.remove(BuildType)=0D - break=0D - gArgs.Remaining =3D ' '.join(remaining)=0D + #=0D + # Parse command line arguments=0D + #=0D + gArgs, remaining =3D parser.parse_known_args()=0D + gArgs.BuildType =3D 'all'=0D + for BuildType in ['all', 'fds', 'genc', 'genmake', 'clean', 'cleanall'= , 'modules', 'libraries', 'run']:=0D + if BuildType in remaining:=0D + gArgs.BuildType =3D BuildType=0D + remaining.remove(BuildType)=0D + break=0D + gArgs.Remaining =3D ' '.join(remaining)=0D =0D - #=0D - # Start=0D - #=0D - Log ('Start')=0D + #=0D + # Start=0D + #=0D + Log('Start')=0D =0D - #=0D - # Find makefile in WORKSPACE or PACKAGES_PATH=0D - #=0D - PathList =3D ['']=0D - try:=0D - PathList.append(os.environ['WORKSPACE'])=0D - except:=0D - Error ('WORKSPACE environment variable not set')=0D - try:=0D - PathList +=3D os.environ['PACKAGES_PATH'].split(os.pathsep)=0D - except:=0D - pass=0D - for Path in PathList:=0D - Makefile =3D NormalizePath((Path, gArgs.Makefile))=0D - if os.path.exists (Makefile):=0D - break=0D - if not os.path.exists(Makefile):=0D - Error ('makefile %s not found' % (gArgs.Makefile))=0D + #=0D + # Find makefile in WORKSPACE or PACKAGES_PATH=0D + #=0D + PathList =3D ['']=0D + try:=0D + PathList.append(os.environ['WORKSPACE'])=0D + except:=0D + Error('WORKSPACE environment variable not set')=0D + try:=0D + PathList +=3D os.environ['PACKAGES_PATH'].split(os.pathsep)=0D + except:=0D + pass=0D + for Path in PathList:=0D + Makefile =3D NormalizePath((Path, gArgs.Makefile))=0D + if os.path.exists(Makefile):=0D + break=0D + if not os.path.exists(Makefile):=0D + Error('makefile %s not found' % (gArgs.Makefile))=0D =0D - #=0D - # Build command line arguments converting build arguments to makefile de= fines=0D - #=0D - CommandLine =3D [Makefile]=0D - CommandLine.append('TARGET_ARCH=3D"%s"' % (' '.join([Item[0] for Item in= gArgs.Arch])))=0D - CommandLine.append('TOOL_CHAIN_TAG=3D"%s"' % (gArgs.ToolChain))=0D - CommandLine.append('TARGET=3D"%s"' % (gArgs.BuildTarget))=0D - CommandLine.append('ACTIVE_PLATFORM=3D"%s"' % (gArgs.PlatformFile))=0D - CommandLine.append('CONF_DIRECTORY=3D"%s"' % (gArgs.ConfDirectory))=0D - if gArgs.Define:=0D - for Item in gArgs.Define:=0D - if '=3D' not in Item[0]:=0D - continue=0D - Item =3D Item[0].split('=3D', 1)=0D - CommandLine.append('%s=3D"%s"' % (Item[0], Item[1]))=0D - CommandLine.append('EXTRA_FLAGS=3D"%s"' % (gArgs.Remaining))=0D - CommandLine.append(gArgs.BuildType)=0D - if sys.platform =3D=3D "win32":=0D - CommandLine =3D 'nmake /f %s' % (' '.join(CommandLine))=0D - else:=0D - CommandLine =3D 'make -f %s' % (' '.join(CommandLine))=0D + #=0D + # Build command line arguments converting build arguments to makefile = defines=0D + #=0D + CommandLine =3D [Makefile]=0D + CommandLine.append('TARGET_ARCH=3D"%s"' %=0D + (' '.join([Item[0] for Item in gArgs.Arch])))=0D + CommandLine.append('TOOL_CHAIN_TAG=3D"%s"' % (gArgs.ToolChain))=0D + CommandLine.append('TARGET=3D"%s"' % (gArgs.BuildTarget))=0D + CommandLine.append('ACTIVE_PLATFORM=3D"%s"' % (gArgs.PlatformFile))=0D + CommandLine.append('CONF_DIRECTORY=3D"%s"' % (gArgs.ConfDirectory))=0D + if gArgs.Define:=0D + for Item in gArgs.Define:=0D + if '=3D' not in Item[0]:=0D + continue=0D + Item =3D Item[0].split('=3D', 1)=0D + CommandLine.append('%s=3D"%s"' % (Item[0], Item[1]))=0D + CommandLine.append('EXTRA_FLAGS=3D"%s"' % (gArgs.Remaining))=0D + CommandLine.append(gArgs.BuildType)=0D + if sys.platform =3D=3D "win32":=0D + CommandLine =3D 'nmake /f %s' % (' '.join(CommandLine))=0D + else:=0D + CommandLine =3D 'make -f %s' % (' '.join(CommandLine))=0D =0D - #=0D - # Run the makefile=0D - #=0D - try:=0D - Process =3D subprocess.Popen(CommandLine, shell=3DTrue)=0D - except:=0D - Error ('make command not available. Please verify PATH')=0D - Process.communicate()=0D + #=0D + # Run the makefile=0D + #=0D + try:=0D + Process =3D subprocess.Popen(CommandLine, shell=3DTrue)=0D + except:=0D + Error('make command not available. Please verify PATH')=0D + Process.communicate()=0D =0D - #=0D - # Done=0D - #=0D - Log ('Done')=0D + #=0D + # Done=0D + #=0D + Log('Done')=0D =0D - #=0D - # Return status from running the makefile=0D - #=0D - sys.exit(Process.returncode)=0D + #=0D + # Return status from running the makefile=0D + #=0D + sys.exit(Process.returncode)=0D diff --git a/BaseTools/Scripts/SetupGit.py b/BaseTools/Scripts/SetupGit.py index 91814199bfb9..a1bcd185bf0f 100644 --- a/BaseTools/Scripts/SetupGit.py +++ b/BaseTools/Scripts/SetupGit.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Set up the git configuration for contributing to TianoCore projects=0D #=0D # Copyright (c) 2019, Linaro Ltd. All rights reserved.
        =0D @@ -50,7 +50,7 @@ UPSTREAMS =3D [ {'name': 'edk2-test',=0D 'repo': 'https://github.com/tianocore/edk2-test.git',=0D 'list': 'devel@edk2.groups.io', 'prefix': 'edk2-test'}=0D - ]=0D +]=0D =0D # The minimum version required for all of the below options to work=0D MIN_GIT_VERSION =3D (1, 9, 0)=0D @@ -78,11 +78,12 @@ OPTIONS =3D [ {'section': 'format', 'option': 'numbered', 'value': Tru= e},=0D {'section': 'format', 'option': 'signoff', 'value': Fal= se},=0D {'section': 'log', 'option': 'mailmap', 'value': Tru= e},=0D - {'section': 'notes', 'option': 'rewriteRef', 'value': 're= fs/notes/commits'},=0D + {'section': 'notes', 'option': 'rewriteRef',=0D + 'value': 'refs/notes/commits'},=0D {'section': 'sendemail', 'option': 'chainreplyto', 'value': Fal= se},=0D {'section': 'sendemail', 'option': 'thread', 'value': Tru= e},=0D {'section': 'sendemail', 'option': 'transferEncoding', 'value': '8b= it'},=0D - ]=0D +]=0D =0D =0D def locate_repo():=0D @@ -97,7 +98,7 @@ def locate_repo(): =0D def fuzzy_match_repo_url(one, other):=0D """Compares two repository URLs, ignoring protocol and optional traili= ng '.git'."""=0D - oneresult =3D re.match(r'.*://(?P.*?)(\.git)*$', one)=0D + oneresult =3D re.match(r'.*://(?P.*?)(\.git)*$', one)=0D otherresult =3D re.match(r'.*://(?P.*?)(\.git)*$', other)= =0D =0D if oneresult and otherresult:=0D @@ -204,13 +205,17 @@ if __name__ =3D=3D '__main__': entry['option']= , value))=0D else:=0D if ARGS.force:=0D - write_config_value(REPO, entry['section'], entry['opti= on'], entry['value'])=0D + write_config_value(=0D + REPO, entry['section'], entry['option'], entry['va= lue'])=0D else:=0D print("Not overwriting existing %s.%s value:" % (entry= ['section'],=0D entry= ['option']))=0D print(" '%s' !=3D '%s'" % (value, entry['value']))=0D - print(" add '-f' to command line to force overwriting= existing settings")=0D + print(=0D + " add '-f' to command line to force overwriting e= xisting settings")=0D else:=0D - print("%s.%s =3D> '%s'" % (entry['section'], entry['option'], = entry['value']))=0D + print("%s.%s =3D> '%s'" %=0D + (entry['section'], entry['option'], entry['value']))=0D if not ARGS.check:=0D - write_config_value(REPO, entry['section'], entry['option']= , entry['value'])=0D + write_config_value(=0D + REPO, entry['section'], entry['option'], entry['value'= ])=0D diff --git a/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py b/BaseTools/Sc= ripts/SmiHandlerProfileSymbolGen.py index 1e2e7fd1049b..4caea88c68e2 100644 --- a/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py +++ b/BaseTools/Scripts/SmiHandlerProfileSymbolGen.py @@ -20,6 +20,7 @@ import xml.dom.minidom versionNumber =3D "1.1"=0D __copyright__ =3D "Copyright (c) 2016, Intel Corporation. All rights reser= ved."=0D =0D +=0D class Symbols:=0D def __init__(self):=0D self.listLineAddress =3D []=0D @@ -29,36 +30,36 @@ class Symbols: # Cache for line=0D self.sourceName =3D ""=0D =0D -=0D - def getSymbol (self, rva):=0D + def getSymbol(self, rva):=0D index =3D 0=0D - lineName =3D 0=0D + lineName =3D 0=0D sourceName =3D "??"=0D - while index + 1 < self.lineCount :=0D - if self.listLineAddress[index][0] <=3D rva and self.listLineAd= dress[index + 1][0] > rva :=0D + while index + 1 < self.lineCount:=0D + if self.listLineAddress[index][0] <=3D rva and self.listLineAd= dress[index + 1][0] > rva:=0D offset =3D rva - self.listLineAddress[index][0]=0D functionName =3D self.listLineAddress[index][1]=0D lineName =3D self.listLineAddress[index][2]=0D sourceName =3D self.listLineAddress[index][3]=0D - if lineName =3D=3D 0 :=0D - return [functionName]=0D - else :=0D - return [functionName, sourceName, lineName]=0D + if lineName =3D=3D 0:=0D + return [functionName]=0D + else:=0D + return [functionName, sourceName, lineName]=0D index +=3D 1=0D =0D return []=0D =0D def parse_debug_file(self, driverName, pdbName):=0D - if cmp (pdbName, "") =3D=3D 0 :=0D + if cmp(pdbName, "") =3D=3D 0:=0D return=0D - self.pdbName =3D pdbName;=0D + self.pdbName =3D pdbName=0D =0D try:=0D nmCommand =3D "nm"=0D nmLineOption =3D "-l"=0D print("parsing (debug) - " + pdbName)=0D - os.system ('%s %s %s > nmDump.line.log' % (nmCommand, nmLineOp= tion, pdbName))=0D - except :=0D + os.system('%s %s %s > nmDump.line.log' %=0D + (nmCommand, nmLineOption, pdbName))=0D + except:=0D print('ERROR: nm command not available. Please verify PATH')= =0D return=0D =0D @@ -75,23 +76,25 @@ class Symbols: for reportLine in reportLines:=0D match =3D re.match(patchLineFileMatchString, reportLine)=0D if match is not None:=0D - rva =3D int (match.group(1), 16)=0D + rva =3D int(match.group(1), 16)=0D functionName =3D match.group(2)=0D sourceName =3D match.group(3)=0D - if cmp (match.group(4), "") !=3D 0 :=0D - lineName =3D int (match.group(4))=0D - else :=0D + if cmp(match.group(4), "") !=3D 0:=0D + lineName =3D int(match.group(4))=0D + else:=0D lineName =3D 0=0D - self.listLineAddress.append ([rva, functionName, lineName,= sourceName])=0D + self.listLineAddress.append(=0D + [rva, functionName, lineName, sourceName])=0D =0D - self.lineCount =3D len (self.listLineAddress)=0D + self.lineCount =3D len(self.listLineAddress)=0D =0D - self.listLineAddress =3D sorted(self.listLineAddress, key=3Dlambda= symbolAddress:symbolAddress[0])=0D + self.listLineAddress =3D sorted(=0D + self.listLineAddress, key=3Dlambda symbolAddress: symbolAddres= s[0])=0D =0D def parse_pdb_file(self, driverName, pdbName):=0D - if cmp (pdbName, "") =3D=3D 0 :=0D + if cmp(pdbName, "") =3D=3D 0:=0D return=0D - self.pdbName =3D pdbName;=0D + self.pdbName =3D pdbName=0D =0D try:=0D #DIA2DumpCommand =3D "\"C:\\Program Files (x86)\Microsoft Visu= al Studio 14.0\\DIA SDK\\Samples\\DIA2Dump\\x64\\Debug\\Dia2Dump.exe\""=0D @@ -100,8 +103,9 @@ class Symbols: DIA2LinesOption =3D "-l"=0D print("parsing (pdb) - " + pdbName)=0D #os.system ('%s %s %s > DIA2Dump.symbol.log' % (DIA2DumpComman= d, DIA2SymbolOption, pdbName))=0D - os.system ('%s %s %s > DIA2Dump.line.log' % (DIA2DumpCommand, = DIA2LinesOption, pdbName))=0D - except :=0D + os.system('%s %s %s > DIA2Dump.line.log' %=0D + (DIA2DumpCommand, DIA2LinesOption, pdbName))=0D + except:=0D print('ERROR: DIA2Dump command not available. Please verify P= ATH')=0D return=0D =0D @@ -123,50 +127,60 @@ class Symbols: for reportLine in reportLines:=0D match =3D re.match(patchLineFileMatchString, reportLine)=0D if match is not None:=0D - if cmp (match.group(3), "") !=3D 0 :=0D + if cmp(match.group(3), "") !=3D 0:=0D self.sourceName =3D match.group(3)=0D sourceName =3D self.sourceName=0D functionName =3D self.functionName=0D =0D - rva =3D int (match.group(2), 16)=0D - lineName =3D int (match.group(1))=0D - self.listLineAddress.append ([rva, functionName, lineName,= sourceName])=0D - else :=0D + rva =3D int(match.group(2), 16)=0D + lineName =3D int(match.group(1))=0D + self.listLineAddress.append(=0D + [rva, functionName, lineName, sourceName])=0D + else:=0D match =3D re.match(patchLineFileMatchStringFunc, reportLin= e)=0D if match is not None:=0D self.functionName =3D match.group(1)=0D =0D - self.lineCount =3D len (self.listLineAddress)=0D - self.listLineAddress =3D sorted(self.listLineAddress, key=3Dlambda= symbolAddress:symbolAddress[0])=0D + self.lineCount =3D len(self.listLineAddress)=0D + self.listLineAddress =3D sorted(=0D + self.listLineAddress, key=3Dlambda symbolAddress: symbolAddres= s[0])=0D +=0D =0D class SymbolsFile:=0D def __init__(self):=0D self.symbolsTable =3D {}=0D =0D +=0D symbolsFile =3D ""=0D =0D driverName =3D ""=0D rvaName =3D ""=0D symbolName =3D ""=0D =0D +=0D def getSymbolName(driverName, rva):=0D global symbolsFile=0D =0D - try :=0D + try:=0D symbolList =3D symbolsFile.symbolsTable[driverName]=0D if symbolList is not None:=0D - return symbolList.getSymbol (rva)=0D + return symbolList.getSymbol(rva)=0D else:=0D return []=0D except Exception:=0D return []=0D =0D +=0D def myOptionParser():=0D usage =3D "%prog [--version] [-h] [--help] [-i inputfile [-o outputfil= e] [-g guidreffile]]"=0D - Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__, ve= rsion=3D"%prog " + str(versionNumber))=0D - Parser.add_option("-i", "--inputfile", dest=3D"inputfilename", type=3D= "string", help=3D"The input memory profile info file output from MemoryProf= ileInfo application in MdeModulePkg")=0D - Parser.add_option("-o", "--outputfile", dest=3D"outputfilename", type= =3D"string", help=3D"The output memory profile info file with symbol, Memor= yProfileInfoSymbol.txt will be used if it is not specified")=0D - Parser.add_option("-g", "--guidref", dest=3D"guidreffilename", type=3D= "string", help=3D"The input guid ref file output from build")=0D + Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__,=0D + version=3D"%prog " + str(versionNumber))=0D + Parser.add_option("-i", "--inputfile", dest=3D"inputfilename", type=3D= "string",=0D + help=3D"The input memory profile info file output fr= om MemoryProfileInfo application in MdeModulePkg")=0D + Parser.add_option("-o", "--outputfile", dest=3D"outputfilename", type= =3D"string",=0D + help=3D"The output memory profile info file with sym= bol, MemoryProfileInfoSymbol.txt will be used if it is not specified")=0D + Parser.add_option("-g", "--guidref", dest=3D"guidreffilename",=0D + type=3D"string", help=3D"The input guid ref file out= put from build")=0D =0D (Options, args) =3D Parser.parse_args()=0D if Options.inputfilename is None:=0D @@ -175,22 +189,24 @@ def myOptionParser(): Options.outputfilename =3D "SmiHandlerProfileInfoSymbol.xml"=0D return Options=0D =0D +=0D dictGuid =3D {=0D - '00000000-0000-0000-0000-000000000000':'gZeroGuid',=0D - '2A571201-4966-47F6-8B86-F31E41F32F10':'gEfiEventLegacyBootGuid',=0D - '27ABF055-B1B8-4C26-8048-748F37BAA2DF':'gEfiEventExitBootServicesGuid',= =0D - '7CE88FB3-4BD7-4679-87A8-A8D8DEE50D2B':'gEfiEventReadyToBootGuid',=0D - '02CE967A-DD7E-4FFC-9EE7-810CF0470880':'gEfiEndOfDxeEventGroupGuid',=0D - '60FF8964-E906-41D0-AFED-F241E974E08E':'gEfiDxeSmmReadyToLockProtocolGui= d',=0D - '18A3C6DC-5EEA-48C8-A1C1-B53389F98999':'gEfiSmmSwDispatch2ProtocolGuid',= =0D - '456D2859-A84B-4E47-A2EE-3276D886997D':'gEfiSmmSxDispatch2ProtocolGuid',= =0D - '4CEC368E-8E8E-4D71-8BE1-958C45FC8A53':'gEfiSmmPeriodicTimerDispatch2Pro= tocolGuid',=0D - 'EE9B8D90-C5A6-40A2-BDE2-52558D33CCA1':'gEfiSmmUsbDispatch2ProtocolGuid'= ,=0D - '25566B03-B577-4CBF-958C-ED663EA24380':'gEfiSmmGpiDispatch2ProtocolGuid'= ,=0D - '7300C4A1-43F2-4017-A51B-C81A7F40585B':'gEfiSmmStandbyButtonDispatch2Pro= tocolGuid',=0D - '1B1183FA-1823-46A7-8872-9C578755409D':'gEfiSmmPowerButtonDispatch2Proto= colGuid',=0D - '58DC368D-7BFA-4E77-ABBC-0E29418DF930':'gEfiSmmIoTrapDispatch2ProtocolGu= id',=0D - }=0D + '00000000-0000-0000-0000-000000000000': 'gZeroGuid',=0D + '2A571201-4966-47F6-8B86-F31E41F32F10': 'gEfiEventLegacyBootGuid',=0D + '27ABF055-B1B8-4C26-8048-748F37BAA2DF': 'gEfiEventExitBootServicesGuid= ',=0D + '7CE88FB3-4BD7-4679-87A8-A8D8DEE50D2B': 'gEfiEventReadyToBootGuid',=0D + '02CE967A-DD7E-4FFC-9EE7-810CF0470880': 'gEfiEndOfDxeEventGroupGuid',= =0D + '60FF8964-E906-41D0-AFED-F241E974E08E': 'gEfiDxeSmmReadyToLockProtocol= Guid',=0D + '18A3C6DC-5EEA-48C8-A1C1-B53389F98999': 'gEfiSmmSwDispatch2ProtocolGui= d',=0D + '456D2859-A84B-4E47-A2EE-3276D886997D': 'gEfiSmmSxDispatch2ProtocolGui= d',=0D + '4CEC368E-8E8E-4D71-8BE1-958C45FC8A53': 'gEfiSmmPeriodicTimerDispatch2= ProtocolGuid',=0D + 'EE9B8D90-C5A6-40A2-BDE2-52558D33CCA1': 'gEfiSmmUsbDispatch2ProtocolGu= id',=0D + '25566B03-B577-4CBF-958C-ED663EA24380': 'gEfiSmmGpiDispatch2ProtocolGu= id',=0D + '7300C4A1-43F2-4017-A51B-C81A7F40585B': 'gEfiSmmStandbyButtonDispatch2= ProtocolGuid',=0D + '1B1183FA-1823-46A7-8872-9C578755409D': 'gEfiSmmPowerButtonDispatch2Pr= otocolGuid',=0D + '58DC368D-7BFA-4E77-ABBC-0E29418DF930': 'gEfiSmmIoTrapDispatch2Protoco= lGuid',=0D +}=0D +=0D =0D def genGuidString(guidreffile):=0D guidLines =3D guidreffile.readlines()=0D @@ -199,27 +215,32 @@ def genGuidString(guidreffile): if len(guidLineList) =3D=3D 2:=0D guid =3D guidLineList[0]=0D guidName =3D guidLineList[1]=0D - if guid not in dictGuid :=0D + if guid not in dictGuid:=0D dictGuid[guid] =3D guidName=0D =0D +=0D def createSym(symbolName):=0D SymbolNode =3D xml.dom.minidom.Document().createElement("Symbol")=0D SymbolFunction =3D xml.dom.minidom.Document().createElement("Function"= )=0D - SymbolFunctionData =3D xml.dom.minidom.Document().createTextNode(symbo= lName[0])=0D + SymbolFunctionData =3D xml.dom.minidom.Document(=0D + ).createTextNode(symbolName[0])=0D SymbolFunction.appendChild(SymbolFunctionData)=0D SymbolNode.appendChild(SymbolFunction)=0D if (len(symbolName)) >=3D 2:=0D SymbolSourceFile =3D xml.dom.minidom.Document().createElement("Sou= rceFile")=0D - SymbolSourceFileData =3D xml.dom.minidom.Document().createTextNode= (symbolName[1])=0D + SymbolSourceFileData =3D xml.dom.minidom.Document(=0D + ).createTextNode(symbolName[1])=0D SymbolSourceFile.appendChild(SymbolSourceFileData)=0D SymbolNode.appendChild(SymbolSourceFile)=0D if (len(symbolName)) >=3D 3:=0D SymbolLineNumber =3D xml.dom.minidom.Document().createElement(= "LineNumber")=0D - SymbolLineNumberData =3D xml.dom.minidom.Document().createText= Node(str(symbolName[2]))=0D + SymbolLineNumberData =3D xml.dom.minidom.Document(=0D + ).createTextNode(str(symbolName[2]))=0D SymbolLineNumber.appendChild(SymbolLineNumberData)=0D SymbolNode.appendChild(SymbolLineNumber)=0D return SymbolNode=0D =0D +=0D def main():=0D global symbolsFile=0D global Options=0D @@ -227,14 +248,14 @@ def main(): =0D symbolsFile =3D SymbolsFile()=0D =0D - try :=0D + try:=0D DOMTree =3D xml.dom.minidom.parse(Options.inputfilename)=0D except Exception:=0D print("fail to open input " + Options.inputfilename)=0D return 1=0D =0D if Options.guidreffilename is not None:=0D - try :=0D + try:=0D guidreffile =3D open(Options.guidreffilename)=0D except Exception:=0D print("fail to open guidref" + Options.guidreffilename)=0D @@ -244,8 +265,10 @@ def main(): =0D SmiHandlerProfile =3D DOMTree.documentElement=0D =0D - SmiHandlerDatabase =3D SmiHandlerProfile.getElementsByTagName("SmiHand= lerDatabase")=0D - SmiHandlerCategory =3D SmiHandlerDatabase[0].getElementsByTagName("Smi= HandlerCategory")=0D + SmiHandlerDatabase =3D SmiHandlerProfile.getElementsByTagName(=0D + "SmiHandlerDatabase")=0D + SmiHandlerCategory =3D SmiHandlerDatabase[0].getElementsByTagName(=0D + "SmiHandlerCategory")=0D for smiHandlerCategory in SmiHandlerCategory:=0D SmiEntry =3D smiHandlerCategory.getElementsByTagName("SmiEntry")=0D for smiEntry in SmiEntry:=0D @@ -265,10 +288,12 @@ def main(): =0D symbolsFile.symbolsTable[driverName] =3D Symbols()=0D =0D - if cmp (pdbName[-3:], "pdb") =3D=3D 0 :=0D - symbolsFile.symbolsTable[driverName].parse_pdb_fil= e (driverName, pdbName)=0D - else :=0D - symbolsFile.symbolsTable[driverName].parse_debug_f= ile (driverName, pdbName)=0D + if cmp(pdbName[-3:], "pdb") =3D=3D 0:=0D + symbolsFile.symbolsTable[driverName].parse_pdb_fil= e(=0D + driverName, pdbName)=0D + else:=0D + symbolsFile.symbolsTable[driverName].parse_debug_f= ile(=0D + driverName, pdbName)=0D =0D Handler =3D smiHandler.getElementsByTagName("Handler")= =0D RVA =3D Handler[0].getElementsByTagName("RVA")=0D @@ -276,7 +301,8 @@ def main(): =0D if (len(RVA)) >=3D 1:=0D rvaName =3D RVA[0].childNodes[0].data=0D - symbolName =3D getSymbolName (driverName, int(rvaN= ame, 16))=0D + symbolName =3D getSymbolName(=0D + driverName, int(rvaName, 16))=0D =0D if (len(symbolName)) >=3D 1:=0D SymbolNode =3D createSym(symbolName)=0D @@ -288,20 +314,23 @@ def main(): =0D if (len(RVA)) >=3D 1:=0D rvaName =3D RVA[0].childNodes[0].data=0D - symbolName =3D getSymbolName (driverName, int(rvaN= ame, 16))=0D + symbolName =3D getSymbolName(=0D + driverName, int(rvaName, 16))=0D =0D if (len(symbolName)) >=3D 1:=0D SymbolNode =3D createSym(symbolName)=0D Caller[0].appendChild(SymbolNode)=0D =0D - try :=0D + try:=0D newfile =3D open(Options.outputfilename, "w")=0D except Exception:=0D print("fail to open output" + Options.outputfilename)=0D return 1=0D =0D - newfile.write(DOMTree.toprettyxml(indent =3D "\t", newl =3D "\n", enco= ding =3D "utf-8"))=0D + newfile.write(DOMTree.toprettyxml(=0D + indent=3D"\t", newl=3D"\n", encoding=3D"utf-8"))=0D newfile.close()=0D =0D +=0D if __name__ =3D=3D '__main__':=0D sys.exit(main())=0D diff --git a/BaseTools/Scripts/UpdateBuildVersions.py b/BaseTools/Scripts/U= pdateBuildVersions.py index 0f019f25cf50..d5174d040b44 100755 --- a/BaseTools/Scripts/UpdateBuildVersions.py +++ b/BaseTools/Scripts/UpdateBuildVersions.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Update build revisions of the tools when performing a developer build=0D #=0D # This script will modife the C/Include/Common/BuildVersion.h file and the= two=0D @@ -27,7 +27,8 @@ SYS_ENV_ERR =3D "ERROR : %s system environment variable m= ust be set prior to runni =0D __execname__ =3D "UpdateBuildVersions.py"=0D SVN_REVISION =3D "$LastChangedRevision: 3 $"=0D -SVN_REVISION =3D SVN_REVISION.replace("$LastChangedRevision:", "").replace= ("$", "").strip()=0D +SVN_REVISION =3D SVN_REVISION.replace(=0D + "$LastChangedRevision:", "").replace("$", "").strip()=0D __copyright__ =3D "Copyright (c) 2014, Intel Corporation. All rights reser= ved."=0D VERSION_NUMBER =3D "0.7.0"=0D __version__ =3D "Version %s.%s" % (VERSION_NUMBER, SVN_REVISION)=0D @@ -74,13 +75,16 @@ def ShellCommandResults(CmdLine, Opt): =0D returnValue =3D 0=0D try:=0D - subprocess.check_call(args=3Dshlex.split(CmdLine), stderr=3Dsubpro= cess.STDOUT, stdout=3Dfile_list)=0D + subprocess.check_call(args=3Dshlex.split(CmdLine),=0D + stderr=3Dsubprocess.STDOUT, stdout=3Dfile_li= st)=0D except subprocess.CalledProcessError as err_val:=0D file_list.close()=0D if not Opt.silent:=0D - sys.stderr.write("ERROR : %d : %s\n" % (err_val.returncode, er= r_val.__str__()))=0D + sys.stderr.write("ERROR : %d : %s\n" %=0D + (err_val.returncode, err_val.__str__()))=0D if os.path.exists(filename):=0D - sys.stderr.write(" : Partial results may be in this f= ile: %s\n" % filename)=0D + sys.stderr.write(=0D + " : Partial results may be in this file: %s\n" % = filename)=0D sys.stderr.flush()=0D returnValue =3D err_val.returncode=0D =0D @@ -91,7 +95,8 @@ def ShellCommandResults(CmdLine, Opt): sys.stderr.write("I/O ERROR : %s : %s\n" % (str(errno), strerr= or))=0D sys.stderr.write("ERROR : this command failed : %s\n" % CmdLin= e)=0D if os.path.exists(filename):=0D - sys.stderr.write(" : Partial results may be in this f= ile: %s\n" % filename)=0D + sys.stderr.write(=0D + " : Partial results may be in this file: %s\n" % = filename)=0D sys.stderr.flush()=0D returnValue =3D errno=0D =0D @@ -102,16 +107,19 @@ def ShellCommandResults(CmdLine, Opt): sys.stderr.write("OS ERROR : %s : %s\n" % (str(errno), strerro= r))=0D sys.stderr.write("ERROR : this command failed : %s\n" % CmdLin= e)=0D if os.path.exists(filename):=0D - sys.stderr.write(" : Partial results may be in this f= ile: %s\n" % filename)=0D + sys.stderr.write(=0D + " : Partial results may be in this file: %s\n" % = filename)=0D sys.stderr.flush()=0D returnValue =3D errno=0D =0D except KeyboardInterrupt:=0D file_list.close()=0D if not Opt.silent:=0D - sys.stderr.write("ERROR : Command terminated by user : %s\n" %= CmdLine)=0D + sys.stderr.write(=0D + "ERROR : Command terminated by user : %s\n" % CmdLine)=0D if os.path.exists(filename):=0D - sys.stderr.write(" : Partial results may be in this f= ile: %s\n" % filename)=0D + sys.stderr.write(=0D + " : Partial results may be in this file: %s\n" % = filename)=0D sys.stderr.flush()=0D returnValue =3D 1=0D =0D @@ -136,14 +144,15 @@ def ShellCommandResults(CmdLine, Opt): def UpdateBuildVersionPython(Rev, UserModified, opts):=0D """ This routine will update the BuildVersion.h files in the C source = tree """=0D for SubDir in ["Common", "UPT"]:=0D - PyPath =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source", "= Python", SubDir)=0D + PyPath =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "Python", SubDir)=0D BuildVersionPy =3D os.path.join(PyPath, "BuildVersion.py")=0D fd_ =3D open(os.path.normpath(BuildVersionPy), 'r')=0D contents =3D fd_.readlines()=0D fd_.close()=0D if opts.HAVE_SVN is False:=0D BuildVersionOrig =3D os.path.join(PyPath, "orig_BuildVersion.p= y")=0D - fd_ =3D open (BuildVersionOrig, 'w')=0D + fd_ =3D open(BuildVersionOrig, 'w')=0D for line in contents:=0D fd_.write(line)=0D fd_.flush()=0D @@ -166,7 +175,8 @@ def UpdateBuildVersionPython(Rev, UserModified, opts): =0D def UpdateBuildVersionH(Rev, UserModified, opts):=0D """ This routine will update the BuildVersion.h files in the C source = tree """=0D - CPath =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source", "C", "= Include", "Common")=0D + CPath =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "C", "Include", "Common")= =0D BuildVersionH =3D os.path.join(CPath, "BuildVersion.h")=0D fd_ =3D open(os.path.normpath(BuildVersionH), 'r')=0D contents =3D fd_.readlines()=0D @@ -185,7 +195,7 @@ def UpdateBuildVersionH(Rev, UserModified, opts): new_line =3D "#define __BUILD_VERSION \"Developer Build based = on Revision: %s\"" % Rev=0D if UserModified:=0D new_line =3D "#define __BUILD_VERSION \"Developer Build ba= sed on Revision: %s with Modified Sources\"" % \=0D - Rev=0D + Rev=0D new_content.append(new_line)=0D continue=0D new_content.append(line)=0D @@ -222,7 +232,8 @@ def RevertCmd(Filename, Opt): =0D except KeyboardInterrupt:=0D if not Opt.silent:=0D - sys.stderr.write("ERROR : Command terminated by user : %s\n" %= CmdLine)=0D + sys.stderr.write(=0D + "ERROR : Command terminated by user : %s\n" % CmdLine)=0D sys.stderr.flush()=0D =0D if Opt.verbose:=0D @@ -236,7 +247,8 @@ def GetSvnRevision(opts): Modified =3D False=0D =0D if opts.HAVE_SVN is False:=0D - sys.stderr.write("WARNING: the svn command-line tool is not availa= ble.\n")=0D + sys.stderr.write(=0D + "WARNING: the svn command-line tool is not available.\n")=0D return (Revision, Modified)=0D =0D SrcPath =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source")=0D @@ -323,7 +335,8 @@ def CheckOriginals(Opts): Returns 0 if this succeeds, or 1 if the copy function fails. It will a= lso return 0 if the orig_BuildVersion.* file=0D does not exist.=0D """=0D - CPath =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source", "C", "= Include", "Common")=0D + CPath =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "C", "Include", "Common")= =0D BuildVersionH =3D os.path.join(CPath, "BuildVersion.h")=0D OrigBuildVersionH =3D os.path.join(CPath, "orig_BuildVersion.h")=0D if not os.path.exists(OrigBuildVersionH):=0D @@ -331,7 +344,8 @@ def CheckOriginals(Opts): if CopyOrig(OrigBuildVersionH, BuildVersionH, Opts):=0D return 1=0D for SubDir in ["Common", "UPT"]:=0D - PyPath =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source", "= Python", SubDir)=0D + PyPath =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "Python", SubDir)=0D BuildVersionPy =3D os.path.join(PyPath, "BuildVersion.h")=0D OrigBuildVersionPy =3D os.path.join(PyPath, "orig_BuildVersion.h")= =0D if not os.path.exists(OrigBuildVersionPy):=0D @@ -351,12 +365,15 @@ def RevertBuildVersionFiles(opts): return 1=0D return 0=0D # SVN is available=0D - BuildVersionH =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "Source"= , "C", "Include", "Common", "BuildVersion.h")=0D + BuildVersionH =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "C", "Include", "Common",= "BuildVersion.h")=0D RevertCmd(BuildVersionH, opts)=0D for SubDir in ["Common", "UPT"]:=0D - BuildVersionPy =3D os.path.join(os.environ['BASE_TOOLS_PATH'], "So= urce", "Python", SubDir, "BuildVersion.py")=0D + BuildVersionPy =3D os.path.join(=0D + os.environ['BASE_TOOLS_PATH'], "Source", "Python", SubDir, "Bu= ildVersion.py")=0D RevertCmd(BuildVersionPy, opts)=0D =0D +=0D def UpdateRevisionFiles():=0D """ Main routine that will update the BuildVersion.py and BuildVersion= .h files."""=0D options =3D ParseOptions()=0D @@ -368,10 +385,10 @@ def UpdateRevisionFiles(): sys.stderr.write(SYS_ENV_ERR % 'BASE_TOOLS_PATH')=0D return 1=0D if not os.path.exists(os.environ['BASE_TOOLS_PATH']):=0D - sys.stderr.write("Unable to locate the %s directory." % os.environ= ['BASE_TOOLS_PATH'])=0D + sys.stderr.write("Unable to locate the %s directory." %=0D + os.environ['BASE_TOOLS_PATH'])=0D return 1=0D =0D -=0D options.HAVE_SVN =3D CheckSvn(options)=0D if options.TEST_SVN:=0D return (not options.HAVE_SVN)=0D @@ -384,7 +401,8 @@ def UpdateRevisionFiles(): RevertBuildVersionFiles(options)=0D Revision, Modified =3D GetSvnRevision(options)=0D if options.verbose:=0D - sys.stdout.write("Revision: %s is Modified: %s\n" % (Revision,= Modified))=0D + sys.stdout.write("Revision: %s is Modified: %s\n" %=0D + (Revision, Modified))=0D sys.stdout.flush()=0D UpdateBuildVersionH(Revision, Modified, options)=0D UpdateBuildVersionPython(Revision, Modified, options)=0D @@ -394,5 +412,3 @@ def UpdateRevisionFiles(): =0D if __name__ =3D=3D "__main__":=0D sys.exit(UpdateRevisionFiles())=0D -=0D -=0D diff --git a/BaseTools/Scripts/efi_debugging.py b/BaseTools/Scripts/efi_deb= ugging.py index 9848cd5968c7..8ea0184097e8 100755 --- a/BaseTools/Scripts/efi_debugging.py +++ b/BaseTools/Scripts/efi_debugging.py @@ -1668,11 +1668,11 @@ class EfiDevicePath: node, extra =3D self._ctype_read_ex(type_str, ptr, hdr.Len= gth)=0D if 'VENDOR_DEVICE_PATH' in type(node).__name__:=0D guid_type =3D self.guid_override_dict.get(=0D - GuidNames.to_uuid(node.Guid), None= )=0D + GuidNames.to_uuid(node.Guid), None)=0D if guid_type:=0D # use the ctype associated with the GUID=0D node, extra =3D self._ctype_read_ex(=0D - guid_type, ptr, hdr.Length= )=0D + guid_type, ptr, hdr.Length)=0D =0D instance.append((type(node).__name__, hdr.Type,=0D hdr.SubType, hdr.Length, node, extra))=0D diff --git a/BaseTools/Scripts/efi_gdb.py b/BaseTools/Scripts/efi_gdb.py index f3e7fd9d0c28..7cf62067a051 100755 --- a/BaseTools/Scripts/efi_gdb.py +++ b/BaseTools/Scripts/efi_gdb.py @@ -852,6 +852,7 @@ class LoadEmulatorEfiSymbols(gdb.Breakpoint): Note: make sure SecGdbScriptBreak is not optimized away!=0D Also turn off the dlopen() flow like on macOS.=0D '''=0D +=0D def stop(self):=0D symbols =3D EfiSymbols()=0D # Emulator adds SizeOfHeaders so we need file alignment to search= =0D diff --git a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py b/BaseTools/Sourc= e/C/Makefiles/NmakeSubdirs.py index 1f4a45004f4b..717cb700ac4f 100644 --- a/BaseTools/Source/C/Makefiles/NmakeSubdirs.py +++ b/BaseTools/Source/C/Makefiles/NmakeSubdirs.py @@ -20,13 +20,15 @@ import subprocess import multiprocessing=0D import copy=0D import sys=0D -__prog__ =3D 'NmakeSubdirs'=0D -__version__ =3D '%s Version %s' % (__prog__, '0.10 ')=0D -__copyright__ =3D 'Copyright (c) 2018, Intel Corporation. All rights res= erved.'=0D +__prog__ =3D 'NmakeSubdirs'=0D +__version__ =3D '%s Version %s' % (__prog__, '0.10 ')=0D +__copyright__ =3D 'Copyright (c) 2018, Intel Corporation. All rights reser= ved.'=0D __description__ =3D 'Replace for NmakeSubdirs.bat in windows ,support para= llel build for nmake.\n'=0D =0D cpu_count =3D multiprocessing.cpu_count()=0D output_lock =3D threading.Lock()=0D +=0D +=0D def RunCommand(WorkDir=3DNone, *Args, **kwargs):=0D if WorkDir is None:=0D WorkDir =3D os.curdir=0D @@ -34,17 +36,21 @@ def RunCommand(WorkDir=3DNone, *Args, **kwargs): kwargs["stderr"] =3D subprocess.STDOUT=0D if "stdout" not in kwargs:=0D kwargs["stdout"] =3D subprocess.PIPE=0D - p =3D subprocess.Popen(Args, cwd=3DWorkDir, stderr=3Dkwargs["stderr"],= stdout=3Dkwargs["stdout"])=0D + p =3D subprocess.Popen(=0D + Args, cwd=3DWorkDir, stderr=3Dkwargs["stderr"], stdout=3Dkwargs["s= tdout"])=0D stdout, stderr =3D p.communicate()=0D message =3D ""=0D if stdout is not None:=0D - message =3D stdout.decode(errors=3D'ignore') #for compatibility in= python 2 and 3=0D + # for compatibility in python 2 and 3=0D + message =3D stdout.decode(errors=3D'ignore')=0D =0D if p.returncode !=3D 0:=0D - raise RuntimeError("Error while execute command \'{0}\' in direcot= ry {1}\n{2}".format(" ".join(Args), WorkDir, message))=0D + raise RuntimeError("Error while execute command \'{0}\' in direcot= ry {1}\n{2}".format(=0D + " ".join(Args), WorkDir, message))=0D =0D output_lock.acquire(True)=0D - print("execute command \"{0}\" in directory {1}".format(" ".join(Args)= , WorkDir))=0D + print("execute command \"{0}\" in directory {1}".format(=0D + " ".join(Args), WorkDir))=0D try:=0D print(message)=0D except:=0D @@ -53,6 +59,7 @@ def RunCommand(WorkDir=3DNone, *Args, **kwargs): =0D return p.returncode, stdout=0D =0D +=0D class TaskUnit(object):=0D def __init__(self, func, args, kwargs):=0D self.func =3D func=0D @@ -71,6 +78,7 @@ class TaskUnit(object): =0D return "{0}({1})".format(self.func.__name__, ",".join(para))=0D =0D +=0D class ThreadControl(object):=0D =0D def __init__(self, maxthread):=0D @@ -123,7 +131,8 @@ class ThreadControl(object): try:=0D task.run()=0D except RuntimeError as e:=0D - if self.error: break=0D + if self.error:=0D + break=0D self.errorLock.acquire(True)=0D self.error =3D True=0D self.errorMsg =3D str(e)=0D @@ -135,6 +144,7 @@ class ThreadControl(object): self.running.remove(threading.currentThread())=0D self.runningLock.release()=0D =0D +=0D def Run():=0D curdir =3D os.path.abspath(os.curdir)=0D if len(args.subdirs) =3D=3D 1:=0D @@ -142,25 +152,30 @@ def Run(): if args.jobs =3D=3D 1:=0D try:=0D for dir in args.subdirs:=0D - RunCommand(os.path.join(curdir, dir), "nmake", args.target= , stdout=3Dsys.stdout, stderr=3Dsubprocess.STDOUT)=0D + RunCommand(os.path.join(curdir, dir), "nmake", args.target= ,=0D + stdout=3Dsys.stdout, stderr=3Dsubprocess.STDOUT= )=0D except RuntimeError:=0D exit(1)=0D else:=0D controller =3D ThreadControl(args.jobs)=0D for dir in args.subdirs:=0D - controller.addTask(RunCommand, os.path.join(curdir, dir), "nma= ke", args.target)=0D + controller.addTask(RunCommand, os.path.join(=0D + curdir, dir), "nmake", args.target)=0D controller.startSchedule()=0D controller.waitComplete()=0D if controller.error:=0D exit(1)=0D =0D +=0D if __name__ =3D=3D "__main__":=0D - parser =3D argparse.ArgumentParser(prog=3D__prog__, description=3D__de= scription__ + __copyright__, conflict_handler=3D'resolve')=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__, description=3D__description__ + __copyright__, co= nflict_handler=3D'resolve')=0D =0D parser.add_argument("target", help=3D"the target for nmake")=0D - parser.add_argument("subdirs", nargs=3D"+", help=3D"the relative dir p= ath of makefile")=0D - parser.add_argument("--jobs", type=3Dint, dest=3D"jobs", default=3Dcpu= _count, help=3D"thread number")=0D + parser.add_argument("subdirs", nargs=3D"+",=0D + help=3D"the relative dir path of makefile")=0D + parser.add_argument("--jobs", type=3Dint, dest=3D"jobs",=0D + default=3Dcpu_count, help=3D"thread number")=0D parser.add_argument('--version', action=3D'version', version=3D__versi= on__)=0D args =3D parser.parse_args()=0D Run()=0D -=0D diff --git a/BaseTools/Source/C/PyEfiCompressor/setup.py b/BaseTools/Source= /C/PyEfiCompressor/setup.py index 3daf178b5401..506bace9cb7e 100644 --- a/BaseTools/Source/C/PyEfiCompressor/setup.py +++ b/BaseTools/Source/C/PyEfiCompressor/setup.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # package and install PyEfiCompressor extension=0D #=0D # Copyright (c) 2008, Intel Corporation. All rights reserved.
        =0D @@ -23,15 +23,15 @@ setup( Extension(=0D 'EfiCompressor',=0D sources=3D[=0D - os.path.join(BaseToolsDir, 'Source', 'C', 'Common', 'Decom= press.c'),=0D + os.path.join(BaseToolsDir, 'Source', 'C',=0D + 'Common', 'Decompress.c'),=0D 'EfiCompressor.c'=0D - ],=0D + ],=0D include_dirs=3D[=0D os.path.join(BaseToolsDir, 'Source', 'C', 'Include'),=0D os.path.join(BaseToolsDir, 'Source', 'C', 'Include', 'Ia32= '),=0D os.path.join(BaseToolsDir, 'Source', 'C', 'Common')=0D - ],=0D - )=0D - ],=0D - )=0D -=0D + ],=0D + )=0D + ],=0D +)=0D diff --git a/BaseTools/Source/Python/AmlToC/AmlToC.py b/BaseTools/Source/Py= thon/AmlToC/AmlToC.py index 346de7159de7..80f18c04b049 100644 --- a/BaseTools/Source/Python/AmlToC/AmlToC.py +++ b/BaseTools/Source/Python/AmlToC/AmlToC.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # Convert an AML file to a .c file containing the AML bytecode stored in a= =0D # C array.=0D @@ -24,10 +24,12 @@ Tables\Dsdt.c will contain a C array named "dsdt_aml_co= de" that contains the AML bytecode.=0D """=0D =0D -## Parse the command line arguments.=0D +# Parse the command line arguments.=0D #=0D # @retval A argparse.NameSpace instance, containing parsed values.=0D #=0D +=0D +=0D def ParseArgs():=0D # Initialize the parser.=0D Parser =3D argparse.ArgumentParser(description=3D__description__)=0D @@ -50,7 +52,8 @@ def ParseArgs(): with open(Args.InputFile, "rb") as fIn:=0D Signature =3D str(fIn.read(4))=0D if ("DSDT" not in Signature) and ("SSDT" not in Signature):=0D - EdkLogger.info("Invalid file type. File does not have a va= lid DSDT or SSDT signature: {}".format(Args.InputFile))=0D + EdkLogger.info(=0D + "Invalid file type. File does not have a valid DSDT or= SSDT signature: {}".format(Args.InputFile))=0D return None=0D =0D # Get the basename of the input file.=0D @@ -70,7 +73,7 @@ def ParseArgs(): =0D return Args=0D =0D -## Convert an AML file to a .c file containing the AML bytecode stored=0D +# Convert an AML file to a .c file containing the AML bytecode stored=0D # in a C array.=0D #=0D # @param InputFile Path to the input AML file.=0D @@ -78,11 +81,13 @@ def ParseArgs(): # @param BaseName Base name of the input file.=0D # This is also the name of the generated .c file.=0D #=0D +=0D +=0D def AmlToC(InputFile, OutputFile, BaseName):=0D =0D ArrayName =3D BaseName.lower() + "_aml_code"=0D FileHeader =3D\=0D -"""=0D + """=0D // This file has been generated from:=0D // -Python script: {}=0D // -Input AML file: {}=0D @@ -91,7 +96,8 @@ def AmlToC(InputFile, OutputFile, BaseName): =0D with open(InputFile, "rb") as fIn, open(OutputFile, "w") as fOut:=0D # Write header.=0D - fOut.write(FileHeader.format(os.path.abspath(InputFile), os.path.a= bspath(__file__)))=0D + fOut.write(FileHeader.format(os.path.abspath(=0D + InputFile), os.path.abspath(__file__)))=0D =0D # Write the array and its content.=0D fOut.write("unsigned char {}[] =3D {{\n ".format(ArrayName))=0D @@ -105,7 +111,7 @@ def AmlToC(InputFile, OutputFile, BaseName): byte =3D fIn.read(1)=0D fOut.write("\n};\n")=0D =0D -## Main method=0D +# Main method=0D #=0D # This method:=0D # 1- Initialize an EdkLogger instance.=0D @@ -116,6 +122,8 @@ def AmlToC(InputFile, OutputFile, BaseName): # @retval 0 Success.=0D # @retval 1 Error.=0D #=0D +=0D +=0D def Main():=0D # Initialize an EdkLogger instance.=0D EdkLogger.Initialize()=0D @@ -128,15 +136,18 @@ def Main(): =0D # Convert an AML file to a .c file containing the AML bytecode sto= red=0D # in a C array.=0D - AmlToC(CommandArguments.InputFile, CommandArguments.OutputFile, Co= mmandArguments.BaseName)=0D + AmlToC(CommandArguments.InputFile,=0D + CommandArguments.OutputFile, CommandArguments.BaseName)=0D except Exception as e:=0D print(e)=0D return 1=0D =0D return 0=0D =0D +=0D if __name__ =3D=3D '__main__':=0D r =3D Main()=0D # 0-127 is a safe return range, and 1 is a standard default error=0D - if r < 0 or r > 127: r =3D 1=0D + if r < 0 or r > 127:=0D + r =3D 1=0D sys.exit(r)=0D diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index d9ee699d8f30..2181cf521215 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Generate AutoGen.h, AutoGen.c and *.depex files=0D #=0D # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
        =0D @@ -8,20 +8,23 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import print_function=0D from __future__ import absolute_import=0D from Common.DataType import TAB_STAR=0D -## Base class for AutoGen=0D +# Base class for AutoGen=0D #=0D # This class just implements the cache mechanism of AutoGen objects.=0D #=0D +=0D +=0D class AutoGen(object):=0D # database to maintain the objects in each child class=0D - __ObjectCache =3D {} # (BuildTarget, ToolChain, ARCH, platform file= ): AutoGen object=0D + # (BuildTarget, ToolChain, ARCH, platform file): AutoGen object=0D + __ObjectCache =3D {}=0D =0D - ## Factory method=0D + # Factory method=0D #=0D # @param Class class object of real AutoGen class=0D # (WorkspaceAutoGen, ModuleAutoGen or Platfo= rmAutoGen)=0D @@ -44,17 +47,17 @@ class AutoGen(object): RetVal =3D cls.__ObjectCache[Key] =3D super(AutoGen, cls).__new__(= cls)=0D return RetVal=0D =0D -=0D - ## hash() operator=0D + # hash() operator=0D #=0D # The file path of platform file will be used to represent hash value= of this object=0D #=0D # @retval int Hash value of the file path of platform file=0D #=0D +=0D def __hash__(self):=0D return hash(self.MetaFile)=0D =0D - ## str() operator=0D + # str() operator=0D #=0D # The file path of platform file will be used to represent this objec= t=0D #=0D @@ -63,7 +66,7 @@ class AutoGen(object): def __str__(self):=0D return str(self.MetaFile)=0D =0D - ## "=3D=3D" operator=0D + # "=3D=3D" operator=0D def __eq__(self, Other):=0D return Other and self.MetaFile =3D=3D Other=0D =0D @@ -71,31 +74,34 @@ class AutoGen(object): def Cache(cls):=0D return cls.__ObjectCache=0D =0D +=0D #=0D # The priority list while override build option=0D #=0D -PrioList =3D {"0x11111" : 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_AT= TRIBUTE (Highest)=0D - "0x01111" : 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x10111" : 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x11011" : 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x01011" : 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x10011" : 10, # TARGET_*********_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x00011" : 9, # ******_*********_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x11101" : 8, # TARGET_TOOLCHAIN_ARCH_***********_ATTR= IBUTE=0D - "0x01101" : 7, # ******_TOOLCHAIN_ARCH_***********_ATTR= IBUTE=0D - "0x10101" : 6, # TARGET_*********_ARCH_***********_ATTR= IBUTE=0D - "0x00101" : 5, # ******_*********_ARCH_***********_ATTR= IBUTE=0D - "0x11001" : 4, # TARGET_TOOLCHAIN_****_***********_ATTR= IBUTE=0D - "0x01001" : 3, # ******_TOOLCHAIN_****_***********_ATTR= IBUTE=0D - "0x10001" : 2, # TARGET_*********_****_***********_ATTR= IBUTE=0D - "0x00001" : 1} # ******_*********_****_***********_ATTR= IBUTE (Lowest)=0D -## Calculate the priority value of the build option=0D +PrioList =3D {"0x11111": 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUT= E (Highest)=0D + "0x01111": 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x10111": 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x00111": 13, # ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x11011": 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x01011": 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x10011": 10, # TARGET_*********_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x00011": 9, # ******_*********_****_COMMANDTYPE_ATTRIBUTE=0D + "0x11101": 8, # TARGET_TOOLCHAIN_ARCH_***********_ATTRIBUTE=0D + "0x01101": 7, # ******_TOOLCHAIN_ARCH_***********_ATTRIBUTE=0D + "0x10101": 6, # TARGET_*********_ARCH_***********_ATTRIBUTE=0D + "0x00101": 5, # ******_*********_ARCH_***********_ATTRIBUTE=0D + "0x11001": 4, # TARGET_TOOLCHAIN_****_***********_ATTRIBUTE=0D + "0x01001": 3, # ******_TOOLCHAIN_****_***********_ATTRIBUTE=0D + "0x10001": 2, # TARGET_*********_****_***********_ATTRIBUTE=0D + "0x00001": 1} # ******_*********_****_***********_ATTRIBUTE (= Lowest)=0D +# Calculate the priority value of the build option=0D #=0D # @param Key Build option definition contain: TARGET_TOOLCHAIN_ARCH_= COMMANDTYPE_ATTRIBUTE=0D #=0D # @retval Value Priority value based on the priority list.=0D #=0D +=0D +=0D def CalculatePriorityValue(Key):=0D Target, ToolChain, Arch, CommandType, Attr =3D Key.split('_')=0D PriorityValue =3D 0x11111=0D diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py b/BaseTools/S= ource/Python/AutoGen/AutoGenWorker.py index 0ba2339bed64..3b90571d505f 100755 --- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py +++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
        =0D @@ -9,7 +9,7 @@ import multiprocessing as mp import threading=0D from Common.Misc import PathClass=0D from AutoGen.ModuleAutoGen import ModuleAutoGen=0D -from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo,AutoGenInfo=0D +from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, AutoGenInfo=0D import Common.GlobalData as GlobalData=0D import Common.EdkLogger as EdkLogger=0D import os=0D @@ -26,6 +26,7 @@ from AutoGen.DataPipe import MemoryDataPipe import logging=0D import time=0D =0D +=0D def clearQ(q):=0D try:=0D while True:=0D @@ -33,16 +34,19 @@ def clearQ(q): except Empty:=0D pass=0D =0D +=0D class LogAgent(threading.Thread):=0D - def __init__(self,log_q,log_level,log_file=3DNone):=0D - super(LogAgent,self).__init__()=0D + def __init__(self, log_q, log_level, log_file=3DNone):=0D + super(LogAgent, self).__init__()=0D self.log_q =3D log_q=0D self.log_level =3D log_level=0D self.log_file =3D log_file=0D +=0D def InitLogger(self):=0D # For DEBUG level (All DEBUG_0~9 are applicable)=0D self._DebugLogger_agent =3D logging.getLogger("tool_debug_agent")= =0D - _DebugFormatter =3D logging.Formatter("[%(asctime)s.%(msecs)d]: %(= message)s", datefmt=3D"%H:%M:%S")=0D + _DebugFormatter =3D logging.Formatter(=0D + "[%(asctime)s.%(msecs)d]: %(message)s", datefmt=3D"%H:%M:%S")= =0D self._DebugLogger_agent.setLevel(self.log_level)=0D _DebugChannel =3D logging.StreamHandler(sys.stdout)=0D _DebugChannel.setFormatter(_DebugFormatter)=0D @@ -71,7 +75,7 @@ class LogAgent(threading.Thread): _Ch.setFormatter(_DebugFormatter)=0D self._DebugLogger_agent.addHandler(_Ch)=0D =0D - _Ch=3D logging.FileHandler(self.log_file)=0D + _Ch =3D logging.FileHandler(self.log_file)=0D _Ch.setFormatter(_InfoFormatter)=0D self._InfoLogger_agent.addHandler(_Ch)=0D =0D @@ -86,23 +90,30 @@ class LogAgent(threading.Thread): if log_message is None:=0D break=0D if log_message.name =3D=3D "tool_error":=0D - self._ErrorLogger_agent.log(log_message.levelno,log_messag= e.getMessage())=0D + self._ErrorLogger_agent.log(=0D + log_message.levelno, log_message.getMessage())=0D elif log_message.name =3D=3D "tool_info":=0D - self._InfoLogger_agent.log(log_message.levelno,log_message= .getMessage())=0D + self._InfoLogger_agent.log(=0D + log_message.levelno, log_message.getMessage())=0D elif log_message.name =3D=3D "tool_debug":=0D - self._DebugLogger_agent.log(log_message.levelno,log_messag= e.getMessage())=0D + self._DebugLogger_agent.log(=0D + log_message.levelno, log_message.getMessage())=0D else:=0D - self._InfoLogger_agent.log(log_message.levelno,log_message= .getMessage())=0D + self._InfoLogger_agent.log(=0D + log_message.levelno, log_message.getMessage())=0D =0D def kill(self):=0D self.log_q.put(None)=0D +=0D +=0D class AutoGenManager(threading.Thread):=0D - def __init__(self,autogen_workers, feedback_q,error_event):=0D - super(AutoGenManager,self).__init__()=0D + def __init__(self, autogen_workers, feedback_q, error_event):=0D + super(AutoGenManager, self).__init__()=0D self.autogen_workers =3D autogen_workers=0D self.feedback_q =3D feedback_q=0D self.Status =3D True=0D self.error_event =3D error_event=0D +=0D def run(self):=0D try:=0D fin_num =3D 0=0D @@ -113,10 +124,12 @@ class AutoGenManager(threading.Thread): if badnews =3D=3D "Done":=0D fin_num +=3D 1=0D elif badnews =3D=3D "QueueEmpty":=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= os.getpid(), badnews))=0D + EdkLogger.debug(EdkLogger.DEBUG_9,=0D + "Worker %s: %s" % (os.getpid(), badnew= s))=0D self.TerminateWorkers()=0D else:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= os.getpid(), badnews))=0D + EdkLogger.debug(EdkLogger.DEBUG_9,=0D + "Worker %s: %s" % (os.getpid(), badnew= s))=0D self.Status =3D False=0D self.TerminateWorkers()=0D if fin_num =3D=3D len(self.autogen_workers):=0D @@ -143,20 +156,23 @@ class AutoGenManager(threading.Thread): cache_num +=3D 1=0D else:=0D GlobalData.gModuleAllCacheStatus.add(item)=0D - if cache_num =3D=3D len(self.autogen_workers):=0D + if cache_num =3D=3D len(self.autogen_workers):=0D break=0D except:=0D - print ("cache_q error")=0D + print("cache_q error")=0D =0D def TerminateWorkers(self):=0D self.error_event.set()=0D +=0D def kill(self):=0D self.feedback_q.put(None)=0D +=0D +=0D class AutoGenWorkerInProcess(mp.Process):=0D - def __init__(self,module_queue,data_pipe_file_path,feedback_q,file_loc= k,cache_q,log_q,error_event):=0D + def __init__(self, module_queue, data_pipe_file_path, feedback_q, file= _lock, cache_q, log_q, error_event):=0D mp.Process.__init__(self)=0D self.module_queue =3D module_queue=0D - self.data_pipe_file_path =3Ddata_pipe_file_path=0D + self.data_pipe_file_path =3D data_pipe_file_path=0D self.data_pipe =3D None=0D self.feedback_q =3D feedback_q=0D self.PlatformMetaFileSet =3D {}=0D @@ -164,12 +180,14 @@ class AutoGenWorkerInProcess(mp.Process): self.cache_q =3D cache_q=0D self.log_q =3D log_q=0D self.error_event =3D error_event=0D - def GetPlatformMetaFile(self,filepath,root):=0D +=0D + def GetPlatformMetaFile(self, filepath, root):=0D try:=0D - return self.PlatformMetaFileSet[(filepath,root)]=0D + return self.PlatformMetaFileSet[(filepath, root)]=0D except:=0D - self.PlatformMetaFileSet[(filepath,root)] =3D filepath=0D - return self.PlatformMetaFileSet[(filepath,root)]=0D + self.PlatformMetaFileSet[(filepath, root)] =3D filepath=0D + return self.PlatformMetaFileSet[(filepath, root)]=0D +=0D def run(self):=0D try:=0D taskname =3D "Init"=0D @@ -178,7 +196,8 @@ class AutoGenWorkerInProcess(mp.Process): self.data_pipe =3D MemoryDataPipe()=0D self.data_pipe.load(self.data_pipe_file_path)=0D except:=0D - self.feedback_q.put(taskname + ":" + "load data pipe %= s failed." % self.data_pipe_file_path)=0D + self.feedback_q.put(=0D + taskname + ":" + "load data pipe %s failed." % sel= f.data_pipe_file_path)=0D EdkLogger.LogClientInitialize(self.log_q)=0D loglevel =3D self.data_pipe.Get("LogLevel")=0D if not loglevel:=0D @@ -193,12 +212,13 @@ class AutoGenWorkerInProcess(mp.Process): PackagesPath =3D os.getenv("PACKAGES_PATH")=0D mws.setWs(workspacedir, PackagesPath)=0D self.Wa =3D WorkSpaceInfo(=0D - workspacedir,active_p,target,toolchain,archlist=0D - )=0D + workspacedir, active_p, target, toolchain, archlist=0D + )=0D self.Wa._SrcTimeStamp =3D self.data_pipe.Get("Workspace_timest= amp")=0D GlobalData.gGlobalDefines =3D self.data_pipe.Get("G_defines")= =0D GlobalData.gCommandLineDefines =3D self.data_pipe.Get("CL_defi= nes")=0D - GlobalData.gCommandMaxLength =3D self.data_pipe.Get('gCommandM= axLength')=0D + GlobalData.gCommandMaxLength =3D self.data_pipe.Get(=0D + 'gCommandMaxLength')=0D os.environ._data =3D self.data_pipe.Get("Env_Var")=0D GlobalData.gWorkspace =3D workspacedir=0D GlobalData.gDisableIncludePathCheck =3D False=0D @@ -208,23 +228,26 @@ class AutoGenWorkerInProcess(mp.Process): GlobalData.gUseHashCache =3D self.data_pipe.Get("UseHashCache"= )=0D GlobalData.gBinCacheSource =3D self.data_pipe.Get("BinCacheSou= rce")=0D GlobalData.gBinCacheDest =3D self.data_pipe.Get("BinCacheDest"= )=0D - GlobalData.gPlatformHashFile =3D self.data_pipe.Get("PlatformH= ashFile")=0D + GlobalData.gPlatformHashFile =3D self.data_pipe.Get(=0D + "PlatformHashFile")=0D GlobalData.gModulePreMakeCacheStatus =3D dict()=0D GlobalData.gModuleMakeCacheStatus =3D dict()=0D GlobalData.gHashChainStatus =3D dict()=0D GlobalData.gCMakeHashFile =3D dict()=0D GlobalData.gModuleHashFile =3D dict()=0D GlobalData.gFileHashDict =3D dict()=0D - GlobalData.gEnableGenfdsMultiThread =3D self.data_pipe.Get("En= ableGenfdsMultiThread")=0D - GlobalData.gPlatformFinalPcds =3D self.data_pipe.Get("gPlatfor= mFinalPcds")=0D + GlobalData.gEnableGenfdsMultiThread =3D self.data_pipe.Get(=0D + "EnableGenfdsMultiThread")=0D + GlobalData.gPlatformFinalPcds =3D self.data_pipe.Get(=0D + "gPlatformFinalPcds")=0D GlobalData.file_lock =3D self.file_lock=0D CommandTarget =3D self.data_pipe.Get("CommandTarget")=0D pcd_from_build_option =3D []=0D for pcd_tuple in self.data_pipe.Get("BuildOptPcd"):=0D - pcd_id =3D ".".join((pcd_tuple[0],pcd_tuple[1]))=0D + pcd_id =3D ".".join((pcd_tuple[0], pcd_tuple[1]))=0D if pcd_tuple[2].strip():=0D - pcd_id =3D ".".join((pcd_id,pcd_tuple[2]))=0D - pcd_from_build_option.append("=3D".join((pcd_id,pcd_tuple[= 3])))=0D + pcd_id =3D ".".join((pcd_id, pcd_tuple[2]))=0D + pcd_from_build_option.append("=3D".join((pcd_id, pcd_tuple= [3])))=0D GlobalData.BuildOptionPcd =3D pcd_from_build_option=0D module_count =3D 0=0D FfsCmd =3D self.data_pipe.Get("FfsCommand")=0D @@ -232,36 +255,40 @@ class AutoGenWorkerInProcess(mp.Process): FfsCmd =3D {}=0D GlobalData.FfsCmd =3D FfsCmd=0D PlatformMetaFile =3D self.GetPlatformMetaFile(self.data_pipe.G= et("P_Info").get("ActivePlatform"),=0D - self.data_pipe.Get("P_Info").= get("WorkspaceDir"))=0D + self.data_pipe.Get= ("P_Info").get("WorkspaceDir"))=0D while True:=0D if self.error_event.is_set():=0D break=0D module_count +=3D 1=0D try:=0D - module_file,module_root,module_path,module_basename,mo= dule_originalpath,module_arch,IsLib =3D self.module_queue.get_nowait()=0D + module_file, module_root, module_path, module_basename= , module_originalpath, module_arch, IsLib =3D self.module_queue.get_nowait(= )=0D except Empty:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= os.getpid(), "Fake Empty."))=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= =0D + os.getpid(), "Fake Empty."))=0D time.sleep(0.01)=0D continue=0D if module_file is None:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= os.getpid(), "Worker get the last item in the queue."))=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (= =0D + os.getpid(), "Worker get the last item in the queu= e."))=0D self.feedback_q.put("QueueEmpty")=0D time.sleep(0.01)=0D continue=0D =0D - modulefullpath =3D os.path.join(module_root,module_file)=0D - taskname =3D " : ".join((modulefullpath,module_arch))=0D - module_metafile =3D PathClass(module_file,module_root)=0D + modulefullpath =3D os.path.join(module_root, module_file)= =0D + taskname =3D " : ".join((modulefullpath, module_arch))=0D + module_metafile =3D PathClass(module_file, module_root)=0D if module_path:=0D module_metafile.Path =3D module_path=0D if module_basename:=0D module_metafile.BaseName =3D module_basename=0D if module_originalpath:=0D - module_metafile.OriginalPath =3D PathClass(module_orig= inalpath,module_root)=0D + module_metafile.OriginalPath =3D PathClass(=0D + module_originalpath, module_root)=0D arch =3D module_arch=0D target =3D self.data_pipe.Get("P_Info").get("Target")=0D toolchain =3D self.data_pipe.Get("P_Info").get("ToolChain"= )=0D - Ma =3D ModuleAutoGen(self.Wa,module_metafile,target,toolch= ain,arch,PlatformMetaFile,self.data_pipe)=0D + Ma =3D ModuleAutoGen(self.Wa, module_metafile, target,=0D + toolchain, arch, PlatformMetaFile, self= .data_pipe)=0D Ma.IsLibrary =3D IsLib=0D # SourceFileList calling sequence impact the makefile stri= ng sequence.=0D # Create cached SourceFileList here to unify its calling s= equence for both=0D @@ -275,13 +302,16 @@ class AutoGenWorkerInProcess(mp.Process): self.feedback_q.put(taskname)=0D =0D if CacheResult:=0D - self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "PreM= akeCache", True))=0D + self.cache_q.put(=0D + (Ma.MetaFile.Path, Ma.Arch, "PreMakeCache", Tr= ue))=0D continue=0D else:=0D - self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "PreM= akeCache", False))=0D + self.cache_q.put(=0D + (Ma.MetaFile.Path, Ma.Arch, "PreMakeCache", Fa= lse))=0D =0D Ma.CreateCodeFile(False)=0D - Ma.CreateMakeFile(False,GenFfsList=3DFfsCmd.get((Ma.MetaFi= le.Path, Ma.Arch),[]))=0D + Ma.CreateMakeFile(False, GenFfsList=3DFfsCmd.get(=0D + (Ma.MetaFile.Path, Ma.Arch), []))=0D Ma.CreateAsBuiltInf()=0D if GlobalData.gBinCacheSource and CommandTarget in [None, = "", "all"]:=0D try:=0D @@ -291,22 +321,28 @@ class AutoGenWorkerInProcess(mp.Process): self.feedback_q.put(taskname)=0D =0D if CacheResult:=0D - self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "Make= Cache", True))=0D + self.cache_q.put(=0D + (Ma.MetaFile.Path, Ma.Arch, "MakeCache", True)= )=0D continue=0D else:=0D - self.cache_q.put((Ma.MetaFile.Path, Ma.Arch, "Make= Cache", False))=0D + self.cache_q.put(=0D + (Ma.MetaFile.Path, Ma.Arch, "MakeCache", False= ))=0D =0D except Exception as e:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (os.getpi= d(), str(e)))=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" %=0D + (os.getpid(), str(e)))=0D self.feedback_q.put(taskname)=0D finally:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" % (os.getpi= d(), "Done"))=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "Worker %s: %s" %=0D + (os.getpid(), "Done"))=0D self.feedback_q.put("Done")=0D self.cache_q.put("CacheDone")=0D =0D def printStatus(self):=0D - print("Processs ID: %d Run %d modules in AutoGen " % (os.getpid(),= len(AutoGen.Cache())))=0D - print("Processs ID: %d Run %d modules in AutoGenInfo " % (os.getpi= d(),len(AutoGenInfo.GetCache())))=0D + print("Processs ID: %d Run %d modules in AutoGen " %=0D + (os.getpid(), len(AutoGen.Cache())))=0D + print("Processs ID: %d Run %d modules in AutoGenInfo " %=0D + (os.getpid(), len(AutoGenInfo.GetCache())))=0D groupobj =3D {}=0D for buildobj in BuildDB.BuildObject.GetCache().values():=0D if str(buildobj).lower().endswith("dec"):=0D @@ -326,6 +362,9 @@ class AutoGenWorkerInProcess(mp.Process): except:=0D groupobj['inf'] =3D [str(buildobj)]=0D =0D - print("Processs ID: %d Run %d pkg in WDB " % (os.getpid(),len(grou= pobj.get("dec",[]))))=0D - print("Processs ID: %d Run %d pla in WDB " % (os.getpid(),len(grou= pobj.get("dsc",[]))))=0D - print("Processs ID: %d Run %d inf in WDB " % (os.getpid(),len(grou= pobj.get("inf",[]))))=0D + print("Processs ID: %d Run %d pkg in WDB " %=0D + (os.getpid(), len(groupobj.get("dec", []))))=0D + print("Processs ID: %d Run %d pla in WDB " %=0D + (os.getpid(), len(groupobj.get("dsc", []))))=0D + print("Processs ID: %d Run %d inf in WDB " %=0D + (os.getpid(), len(groupobj.get("inf", []))))=0D diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Sou= rce/Python/AutoGen/BuildEngine.py index 752a1a1f6a86..7f810dce97de 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # The engine for building files=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -9,6 +9,7 @@ # Import Modules=0D #=0D from __future__ import print_function=0D +import Common.EdkLogger as EdkLogger=0D import Common.LongFilePathOs as os=0D import re=0D import copy=0D @@ -24,26 +25,29 @@ from Common.TargetTxtClassObject import TargetTxtDict gDefaultBuildRuleFile =3D 'build_rule.txt'=0D AutoGenReqBuildRuleVerNum =3D '0.1'=0D =0D -import Common.EdkLogger as EdkLogger=0D =0D -## Convert file type to file list macro name=0D +# Convert file type to file list macro name=0D #=0D # @param FileType The name of file type=0D #=0D # @retval string The name of macro=0D #=0D +=0D def FileListMacro(FileType):=0D return "%sS" % FileType.replace("-", "_").upper()=0D =0D -## Convert file type to list file macro name=0D +# Convert file type to list file macro name=0D #=0D # @param FileType The name of file type=0D #=0D # @retval string The name of macro=0D #=0D +=0D +=0D def ListFileMacro(FileType):=0D return "%s_LIST" % FileListMacro(FileType)=0D =0D +=0D class TargetDescBlock(object):=0D def __init__(self, Inputs, Outputs, Commands, Dependencies):=0D self.InitWorker(Inputs, Outputs, Commands, Dependencies)=0D @@ -77,17 +81,19 @@ class TargetDescBlock(object): def IsMultipleInput(self):=0D return len(self.Inputs) > 1=0D =0D -## Class for one build rule=0D +# Class for one build rule=0D #=0D # This represents a build rule which can give out corresponding command li= st for=0D # building the given source file(s). The result can be used for generating= the=0D # target for makefile.=0D #=0D +=0D +=0D class FileBuildRule:=0D INC_LIST_MACRO =3D "INC_LIST"=0D INC_MACRO =3D "INC"=0D =0D - ## constructor=0D + # constructor=0D #=0D # @param Input The dictionary representing input file(s) for = a rule=0D # @param Output The list representing output file(s) for a rul= e=0D @@ -165,28 +171,30 @@ class FileBuildRule: # All build targets generated by this rule for a module=0D self.BuildTargets =3D {}=0D =0D - ## str() function support=0D + # str() function support=0D #=0D # @retval string=0D #=0D def __str__(self):=0D SourceString =3D ""=0D - SourceString +=3D " %s %s %s" % (self.SourceFileType, " ".join(sel= f.SourceFileExtList), self.ExtraSourceFileList)=0D + SourceString +=3D " %s %s %s" % (self.SourceFileType, " ".join(=0D + self.SourceFileExtList), self.ExtraSourceFileList)=0D DestString =3D ", ".join([str(i) for i in self.DestFileList])=0D CommandString =3D "\n\t".join(self.CommandList)=0D return "%s : %s\n\t%s" % (DestString, SourceString, CommandString)= =0D =0D - def Instantiate(self, Macros =3D None):=0D + def Instantiate(self, Macros=3DNone):=0D if Macros is None:=0D Macros =3D {}=0D NewRuleObject =3D copy.copy(self)=0D NewRuleObject.BuildTargets =3D {}=0D NewRuleObject.DestFileList =3D []=0D for File in self.DestFileList:=0D - NewRuleObject.DestFileList.append(PathClass(NormPath(File, Mac= ros)))=0D + NewRuleObject.DestFileList.append(=0D + PathClass(NormPath(File, Macros)))=0D return NewRuleObject=0D =0D - ## Apply the rule to given source file(s)=0D + # Apply the rule to given source file(s)=0D #=0D # @param SourceFile One file or a list of files to be built=0D # @param RelativeToDir The relative path of the source file=0D @@ -233,24 +241,26 @@ class FileBuildRule: =0D BuildRulePlaceholderDict =3D {=0D # source file=0D - "src" : SrcFile,=0D - "s_path" : SrcPath,=0D - "s_dir" : SrcFileDir,=0D - "s_name" : SrcFileName,=0D - "s_base" : SrcFileBase,=0D - "s_ext" : SrcFileExt,=0D + "src": SrcFile,=0D + "s_path": SrcPath,=0D + "s_dir": SrcFileDir,=0D + "s_name": SrcFileName,=0D + "s_base": SrcFileBase,=0D + "s_ext": SrcFileExt,=0D # destination file=0D - "dst" : DestFile,=0D - "d_path" : DestPath,=0D - "d_name" : DestFileName,=0D - "d_base" : DestFileBase,=0D - "d_ext" : DestFileExt,=0D + "dst": DestFile,=0D + "d_path": DestPath,=0D + "d_name": DestFileName,=0D + "d_base": DestFileBase,=0D + "d_ext": DestFileExt,=0D }=0D =0D DstFile =3D []=0D for File in self.DestFileList:=0D - File =3D string.Template(str(File)).safe_substitute(BuildRuleP= laceholderDict)=0D - File =3D string.Template(str(File)).safe_substitute(BuildRuleP= laceholderDict)=0D + File =3D string.Template(str(File)).safe_substitute(=0D + BuildRulePlaceholderDict)=0D + File =3D string.Template(str(File)).safe_substitute(=0D + BuildRulePlaceholderDict)=0D DstFile.append(PathClass(File, IsBinary=3DTrue))=0D =0D if DstFile[0] in self.BuildTargets:=0D @@ -262,14 +272,17 @@ class FileBuildRule: #=0D # Command line should be regenerated since some ma= cros are different=0D #=0D - CommandList =3D self._BuildCommand(BuildRulePlaceh= olderDict)=0D - TargetDesc.InitWorker([SourceFile], DstFile, Comma= ndList, self.ExtraSourceFileList)=0D + CommandList =3D self._BuildCommand(=0D + BuildRulePlaceholderDict)=0D + TargetDesc.InitWorker(=0D + [SourceFile], DstFile, CommandList, self.Extra= SourceFileList)=0D break=0D else:=0D TargetDesc.AddInput(SourceFile)=0D else:=0D CommandList =3D self._BuildCommand(BuildRulePlaceholderDict)=0D - TargetDesc =3D TargetDescBlock([SourceFile], DstFile, CommandL= ist, self.ExtraSourceFileList)=0D + TargetDesc =3D TargetDescBlock(=0D + [SourceFile], DstFile, CommandList, self.ExtraSourceFileLi= st)=0D TargetDesc.ListFileMacro =3D self.ListFileMacro=0D TargetDesc.FileListMacro =3D self.FileListMacro=0D TargetDesc.IncListFileMacro =3D self.IncListFileMacro=0D @@ -282,16 +295,20 @@ class FileBuildRule: def _BuildCommand(self, Macros):=0D CommandList =3D []=0D for CommandString in self.CommandList:=0D - CommandString =3D string.Template(CommandString).safe_substitu= te(Macros)=0D - CommandString =3D string.Template(CommandString).safe_substitu= te(Macros)=0D + CommandString =3D string.Template(=0D + CommandString).safe_substitute(Macros)=0D + CommandString =3D string.Template(=0D + CommandString).safe_substitute(Macros)=0D CommandList.append(CommandString)=0D return CommandList=0D =0D -## Class for build rules=0D +# Class for build rules=0D #=0D # BuildRule class parses rules defined in a file or passed by caller, and = converts=0D # the rule into FileBuildRule object.=0D #=0D +=0D +=0D class BuildRule:=0D _SectionHeader =3D "SECTIONHEADER"=0D _Section =3D "SECTION"=0D @@ -310,7 +327,7 @@ class BuildRule: _BinaryFileRule =3D FileBuildRule(TAB_DEFAULT_BINARY_FILE, [], [os.pat= h.join("$(OUTPUT_DIR)", "${s_name}")],=0D ["$(CP) ${src} ${dst}"], [])=0D =0D - ## Constructor=0D + # Constructor=0D #=0D # @param File The file containing build rules in a w= ell defined format=0D # @param Content The string list of build rules in a we= ll defined format=0D @@ -328,42 +345,48 @@ class BuildRule: elif Content is not None:=0D self.RuleContent =3D Content=0D else:=0D - EdkLogger.error("build", PARAMETER_MISSING, ExtraData=3D"No ru= le file or string given")=0D + EdkLogger.error("build", PARAMETER_MISSING,=0D + ExtraData=3D"No rule file or string given")=0D =0D self.SupportedToolChainFamilyList =3D SupportedFamily=0D - self.RuleDatabase =3D tdict(True, 4) # {FileExt, ModuleType, Arch= , Family : FileBuildRule object}=0D + # {FileExt, ModuleType, Arch, Family : FileBuildRule object}=0D + self.RuleDatabase =3D tdict(True, 4)=0D self.Ext2FileType =3D {} # {ext : file-type}=0D self.FileTypeList =3D set()=0D =0D self._LineIndex =3D LineIndex=0D self._State =3D ""=0D - self._RuleInfo =3D tdict(True, 2) # {toolchain family : {"Inpu= tFile": {}, "OutputFile" : [], "Command" : []}}=0D + # {toolchain family : {"InputFile": {}, "OutputFile" : [], "Comman= d" : []}}=0D + self._RuleInfo =3D tdict(True, 2)=0D self._FileType =3D ''=0D self._BuildTypeList =3D set()=0D self._ArchList =3D set()=0D self._FamilyList =3D []=0D self._TotalToolChainFamilySet =3D set()=0D - self._RuleObjectList =3D [] # FileBuildRule object list=0D + self._RuleObjectList =3D [] # FileBuildRule object list=0D self._FileVersion =3D ""=0D =0D self.Parse()=0D =0D # some intrinsic rules=0D - self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, TAB_COMMON, TAB_COMMON,= TAB_COMMON] =3D self._BinaryFileRule=0D + self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, TAB_COMMON,=0D + TAB_COMMON, TAB_COMMON] =3D self._BinaryFileRule= =0D self.FileTypeList.add(TAB_DEFAULT_BINARY_FILE)=0D =0D - ## Parse the build rule strings=0D + # Parse the build rule strings=0D def Parse(self):=0D self._State =3D self._Section=0D for Index in range(self._LineIndex, len(self.RuleContent)):=0D # Clean up the line and replace path separator with native one= =0D - Line =3D self.RuleContent[Index].strip().replace(self._PATH_SE= P, os.path.sep)=0D + Line =3D self.RuleContent[Index].strip().replace(=0D + self._PATH_SEP, os.path.sep)=0D self.RuleContent[Index] =3D Line=0D =0D # find the build_rule_version=0D if Line and Line[0] =3D=3D "#" and Line.find(TAB_BUILD_RULE_VE= RSION) !=3D -1:=0D if Line.find("=3D") !=3D -1 and Line.find("=3D") < (len(Li= ne) - 1) and (Line[(Line.find("=3D") + 1):]).split():=0D - self._FileVersion =3D (Line[(Line.find("=3D") + 1):]).= split()[0]=0D + self._FileVersion =3D (=0D + Line[(Line.find("=3D") + 1):]).split()[0]=0D # skip empty or comment line=0D if Line =3D=3D "" or Line[0] =3D=3D "#":=0D continue=0D @@ -383,14 +406,14 @@ class BuildRule: # merge last section information into rule database=0D self.EndOfSection()=0D =0D - ## Parse definitions under a section=0D + # Parse definitions under a section=0D #=0D # @param LineIndex The line index of build rule text=0D #=0D def ParseSection(self, LineIndex):=0D pass=0D =0D - ## Parse definitions under a subsection=0D + # Parse definitions under a subsection=0D #=0D # @param LineIndex The line index of build rule text=0D #=0D @@ -398,14 +421,14 @@ class BuildRule: # currently nothing here=0D pass=0D =0D - ## Placeholder for not supported sections=0D + # Placeholder for not supported sections=0D #=0D # @param LineIndex The line index of build rule text=0D #=0D def SkipSection(self, LineIndex):=0D pass=0D =0D - ## Merge section information just got into rule database=0D + # Merge section information just got into rule database=0D def EndOfSection(self):=0D Database =3D self.RuleDatabase=0D # if there's specific toolchain family, 'COMMON' doesn't make sens= e any more=0D @@ -417,14 +440,16 @@ class BuildRule: Command =3D self._RuleInfo[Family, self._Command]=0D ExtraDependency =3D self._RuleInfo[Family, self._ExtraDependen= cy]=0D =0D - BuildRule =3D FileBuildRule(self._FileType, Input, Output, Com= mand, ExtraDependency)=0D + BuildRule =3D FileBuildRule(=0D + self._FileType, Input, Output, Command, ExtraDependency)=0D for BuildType in self._BuildTypeList:=0D for Arch in self._ArchList:=0D - Database[self._FileType, BuildType, Arch, Family] =3D = BuildRule=0D + Database[self._FileType, BuildType,=0D + Arch, Family] =3D BuildRule=0D for FileExt in BuildRule.SourceFileExtList:=0D self.Ext2FileType[FileExt] =3D self._FileType=0D =0D - ## Parse section header=0D + # Parse section header=0D #=0D # @param LineIndex The line index of build rule text=0D #=0D @@ -439,7 +464,8 @@ class BuildRule: for RuleName in RuleNameList:=0D Arch =3D TAB_COMMON=0D BuildType =3D TAB_COMMON=0D - TokenList =3D [Token.strip().upper() for Token in RuleName.spl= it('.')]=0D + TokenList =3D [Token.strip().upper()=0D + for Token in RuleName.split('.')]=0D # old format: Build.File-Type=0D if TokenList[0] =3D=3D "BUILD":=0D if len(TokenList) =3D=3D 1:=0D @@ -486,7 +512,7 @@ class BuildRule: self._State =3D self._Section=0D self.FileTypeList.add(FileType)=0D =0D - ## Parse sub-section header=0D + # Parse sub-section header=0D #=0D # @param LineIndex The line index of build rule text=0D #=0D @@ -529,8 +555,10 @@ class BuildRule: #=0D # @param LineIndex The line index of build rule text=0D #=0D +=0D def ParseInputFileSubSection(self, LineIndex):=0D - FileList =3D [File.strip() for File in self.RuleContent[LineIndex]= .split(",")]=0D + FileList =3D [File.strip()=0D + for File in self.RuleContent[LineIndex].split(",")]=0D for ToolChainFamily in self._FamilyList:=0D if self._RuleInfo[ToolChainFamily, self._State] is None:=0D self._RuleInfo[ToolChainFamily, self._State] =3D []=0D @@ -546,9 +574,10 @@ class BuildRule: for ToolChainFamily in self._FamilyList:=0D if self._RuleInfo[ToolChainFamily, self._State] is None:=0D self._RuleInfo[ToolChainFamily, self._State] =3D []=0D - self._RuleInfo[ToolChainFamily, self._State].append(self.RuleC= ontent[LineIndex])=0D + self._RuleInfo[ToolChainFamily, self._State].append(=0D + self.RuleContent[LineIndex])=0D =0D - ## Get a build rule via [] operator=0D + # Get a build rule via [] operator=0D #=0D # @param FileExt The extension of a file=0D # @param ToolChainFamily The tool chain family name=0D @@ -577,17 +606,18 @@ class BuildRule: return self.RuleDatabase[Key]=0D =0D _StateHandler =3D {=0D - _SectionHeader : ParseSectionHeader,=0D - _Section : ParseSection,=0D - _SubSectionHeader : ParseSubSectionHeader,=0D - _SubSection : ParseSubSection,=0D - _InputFile : ParseInputFileSubSection,=0D - _OutputFile : ParseCommonSubSection,=0D - _ExtraDependency : ParseCommonSubSection,=0D - _Command : ParseCommonSubSection,=0D - _UnknownSection : SkipSection,=0D + _SectionHeader: ParseSectionHeader,=0D + _Section: ParseSection,=0D + _SubSectionHeader: ParseSubSectionHeader,=0D + _SubSection: ParseSubSection,=0D + _InputFile: ParseInputFileSubSection,=0D + _OutputFile: ParseCommonSubSection,=0D + _ExtraDependency: ParseCommonSubSection,=0D + _Command: ParseCommonSubSection,=0D + _UnknownSection: SkipSection,=0D }=0D =0D +=0D class ToolBuildRule():=0D =0D def __new__(cls, *args, **kw):=0D @@ -618,13 +648,14 @@ class ToolBuildRule(): if RetVal._FileVersion =3D=3D "":=0D RetVal._FileVersion =3D AutoGenReqBuildRuleVerNum=0D else:=0D - if RetVal._FileVersion < AutoGenReqBuildRuleVerNum :=0D + if RetVal._FileVersion < AutoGenReqBuildRuleVerNum:=0D # If Build Rule's version is less than the version number = required by the tools, halting the build.=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - ExtraData=3D"The version number [%s] of bu= ild_rule.txt is less than the version number required by the AutoGen.(the m= inimum required version number is [%s])"\=0D - % (RetVal._FileVersion, AutoGenReqBuildRu= leVerNum))=0D + ExtraData=3D"The version number [%s] of bu= ild_rule.txt is less than the version number required by the AutoGen.(the m= inimum required version number is [%s])"=0D + % (RetVal._FileVersion, AutoGenReqBuildRul= eVerNum))=0D self._ToolBuildRule =3D RetVal=0D =0D +=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D # script.=0D if __name__ =3D=3D '__main__':=0D @@ -647,4 +678,3 @@ if __name__ =3D=3D '__main__': print(str(Br[".s", SUP_MODULE_SEC, "IPF", "COMMON"][1]))=0D print()=0D print(str(Br[".s", SUP_MODULE_SEC][1]))=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/DataPipe.py b/BaseTools/Source= /Python/AutoGen/DataPipe.py index 848c7a82963e..5ae948f5b5ab 100755 --- a/BaseTools/Source/Python/AutoGen/DataPipe.py +++ b/BaseTools/Source/Python/AutoGen/DataPipe.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
        =0D @@ -13,10 +13,11 @@ import pickle from pickle import HIGHEST_PROTOCOL=0D from Common import EdkLogger=0D =0D +=0D class PCD_DATA():=0D - def __init__(self,TokenCName,TokenSpaceGuidCName,Type,DatumType,SkuInf= oList,DefaultValue,=0D - MaxDatumSize,UserDefinedDefaultStoresFlag,validateranges,= =0D - validlists,expressions,CustomAttribute,TokenValue):=0D + def __init__(self, TokenCName, TokenSpaceGuidCName, Type, DatumType, S= kuInfoList, DefaultValue,=0D + MaxDatumSize, UserDefinedDefaultStoresFlag, validaterange= s,=0D + validlists, expressions, CustomAttribute, TokenValue):=0D self.TokenCName =3D TokenCName=0D self.TokenSpaceGuidCName =3D TokenSpaceGuidCName=0D self.Type =3D Type=0D @@ -31,143 +32,156 @@ class PCD_DATA(): self.CustomAttribute =3D CustomAttribute=0D self.TokenValue =3D TokenValue=0D =0D +=0D class DataPipe(object):=0D def __init__(self, BuildDir=3DNone):=0D self.data_container =3D {}=0D self.BuildDir =3D BuildDir=0D self.dump_file =3D ""=0D =0D +=0D class MemoryDataPipe(DataPipe):=0D =0D - def Get(self,key):=0D + def Get(self, key):=0D return self.data_container.get(key)=0D =0D - def dump(self,file_path):=0D + def dump(self, file_path):=0D self.dump_file =3D file_path=0D - with open(file_path,'wb') as fd:=0D - pickle.dump(self.data_container,fd,pickle.HIGHEST_PROTOCOL)=0D + with open(file_path, 'wb') as fd:=0D + pickle.dump(self.data_container, fd, pickle.HIGHEST_PROTOCOL)= =0D =0D - def load(self,file_path):=0D - with open(file_path,'rb') as fd:=0D + def load(self, file_path):=0D + with open(file_path, 'rb') as fd:=0D self.data_container =3D pickle.load(fd)=0D =0D @property=0D def DataContainer(self):=0D return self.data_container=0D +=0D @DataContainer.setter=0D - def DataContainer(self,data):=0D + def DataContainer(self, data):=0D self.data_container.update(data)=0D =0D - def FillData(self,PlatformInfo):=0D - #Platform Pcds=0D + def FillData(self, PlatformInfo):=0D + # Platform Pcds=0D self.DataContainer =3D {=0D - "PLA_PCD" : [PCD_DATA(=0D - pcd.TokenCName,pcd.TokenSpaceGuidCName,pcd.Type,=0D - pcd.DatumType,pcd.SkuInfoList,pcd.DefaultValue,=0D - pcd.MaxDatumSize,pcd.UserDefinedDefaultStoresFlag,pcd.validate= ranges,=0D - pcd.validlists,pcd.expressions,pcd.CustomAttribute,pcd.To= kenValue)=0D - for pcd in PlatformInfo.Platform.Pcds.values()]=0D - }=0D + "PLA_PCD": [PCD_DATA(=0D + pcd.TokenCName, pcd.TokenSpaceGuidCName, pcd.Type,=0D + pcd.DatumType, pcd.SkuInfoList, pcd.DefaultValue,=0D + pcd.MaxDatumSize, pcd.UserDefinedDefaultStoresFlag, pcd.va= lidateranges,=0D + pcd.validlists, pcd.expressions, pcd.CustomAttribute, pcd.= TokenValue)=0D + for pcd in PlatformInfo.Platform.Pcds.values()]=0D + }=0D =0D - #Platform Module Pcds=0D + # Platform Module Pcds=0D ModulePcds =3D {}=0D for m in PlatformInfo.Platform.Modules:=0D module =3D PlatformInfo.Platform.Modules[m]=0D - m_pcds =3D module.Pcds=0D + m_pcds =3D module.Pcds=0D if m_pcds:=0D ModulePcds[module.Guid] =3D [PCD_DATA(=0D - pcd.TokenCName,pcd.TokenSpaceGuidCName,pcd.Type,=0D - pcd.DatumType,pcd.SkuInfoList,pcd.DefaultValue,=0D - pcd.MaxDatumSize,pcd.UserDefinedDefaultStoresFlag,pcd.validate= ranges,=0D - pcd.validlists,pcd.expressions,pcd.CustomAttribute,pcd.To= kenValue)=0D - for pcd in PlatformInfo.Platform.Modules[m].Pcds.values()]=0D + pcd.TokenCName, pcd.TokenSpaceGuidCName, pcd.Type,=0D + pcd.DatumType, pcd.SkuInfoList, pcd.DefaultValue,=0D + pcd.MaxDatumSize, pcd.UserDefinedDefaultStoresFlag, pc= d.validateranges,=0D + pcd.validlists, pcd.expressions, pcd.CustomAttribute, = pcd.TokenValue)=0D + for pcd in PlatformInfo.Platform.Modules[m].Pcds.value= s()]=0D =0D + self.DataContainer =3D {"MOL_PCDS": ModulePcds}=0D =0D - self.DataContainer =3D {"MOL_PCDS":ModulePcds}=0D -=0D - #Module's Library Instance=0D + # Module's Library Instance=0D ModuleLibs =3D {}=0D libModules =3D {}=0D for m in PlatformInfo.Platform.Modules:=0D - module_obj =3D BuildDB.BuildObject[m,PlatformInfo.Arch,Platfor= mInfo.BuildTarget,PlatformInfo.ToolChain]=0D - Libs =3D GetModuleLibInstances(module_obj, PlatformInfo.Platfo= rm, BuildDB.BuildObject, PlatformInfo.Arch,PlatformInfo.BuildTarget,Platfor= mInfo.ToolChain,PlatformInfo.MetaFile,EdkLogger)=0D + module_obj =3D BuildDB.BuildObject[m, PlatformInfo.Arch,=0D + PlatformInfo.BuildTarget, Pla= tformInfo.ToolChain]=0D + Libs =3D GetModuleLibInstances(module_obj, PlatformInfo.Platfo= rm, BuildDB.BuildObject, PlatformInfo.Arch,=0D + PlatformInfo.BuildTarget, Platfor= mInfo.ToolChain, PlatformInfo.MetaFile, EdkLogger)=0D for lib in Libs:=0D try:=0D - libModules[(lib.MetaFile.File,lib.MetaFile.Root,lib.Ar= ch,lib.MetaFile.Path)].append((m.File,m.Root,module_obj.Arch,m.Path))=0D + libModules[(lib.MetaFile.File, lib.MetaFile.Root, lib.= Arch, lib.MetaFile.Path)].append(=0D + (m.File, m.Root, module_obj.Arch, m.Path))=0D except:=0D - libModules[(lib.MetaFile.File,lib.MetaFile.Root,lib.Ar= ch,lib.MetaFile.Path)] =3D [(m.File,m.Root,module_obj.Arch,m.Path)]=0D - ModuleLibs[(m.File,m.Root,module_obj.Arch,m.Path)] =3D [(l.Met= aFile.File,l.MetaFile.Root,l.Arch,l.MetaFile.Path) for l in Libs]=0D - self.DataContainer =3D {"DEPS":ModuleLibs}=0D - self.DataContainer =3D {"REFS":libModules}=0D + libModules[(lib.MetaFile.File, lib.MetaFile.Root, lib.= Arch, lib.MetaFile.Path)] =3D [=0D + (m.File, m.Root, module_obj.Arch, m.Path)]=0D + ModuleLibs[(m.File, m.Root, module_obj.Arch, m.Path)] =3D [=0D + (l.MetaFile.File, l.MetaFile.Root, l.Arch, l.MetaFile.Path= ) for l in Libs]=0D + self.DataContainer =3D {"DEPS": ModuleLibs}=0D + self.DataContainer =3D {"REFS": libModules}=0D =0D - #Platform BuildOptions=0D + # Platform BuildOptions=0D =0D - platform_build_opt =3D PlatformInfo.EdkIIBuildOption=0D + platform_build_opt =3D PlatformInfo.EdkIIBuildOption=0D =0D ToolDefinition =3D PlatformInfo.ToolDefinition=0D module_build_opt =3D {}=0D for m in PlatformInfo.Platform.Modules:=0D - ModuleTypeOptions, PlatformModuleOptions =3D PlatformInfo.GetG= lobalBuildOptions(BuildDB.BuildObject[m,PlatformInfo.Arch,PlatformInfo.Buil= dTarget,PlatformInfo.ToolChain])=0D + ModuleTypeOptions, PlatformModuleOptions =3D PlatformInfo.GetG= lobalBuildOptions(=0D + BuildDB.BuildObject[m, PlatformInfo.Arch, PlatformInfo.Bui= ldTarget, PlatformInfo.ToolChain])=0D if ModuleTypeOptions or PlatformModuleOptions:=0D - module_build_opt.update({(m.File,m.Root): {"ModuleTypeOpti= ons":ModuleTypeOptions, "PlatformModuleOptions":PlatformModuleOptions}})=0D + module_build_opt.update({(m.File, m.Root): {=0D + "ModuleTypeOptions": ModuleTypeOpt= ions, "PlatformModuleOptions": PlatformModuleOptions}})=0D =0D - self.DataContainer =3D {"PLA_BO":platform_build_opt,=0D - "TOOLDEF":ToolDefinition,=0D - "MOL_BO":module_build_opt=0D + self.DataContainer =3D {"PLA_BO": platform_build_opt,=0D + "TOOLDEF": ToolDefinition,=0D + "MOL_BO": module_build_opt=0D }=0D =0D -=0D -=0D - #Platform Info=0D + # Platform Info=0D PInfo =3D {=0D - "WorkspaceDir":PlatformInfo.Workspace.WorkspaceDir,=0D - "Target":PlatformInfo.BuildTarget,=0D - "ToolChain":PlatformInfo.Workspace.ToolChain,=0D - "BuildRuleFile":PlatformInfo.BuildRule,=0D + "WorkspaceDir": PlatformInfo.Workspace.WorkspaceDir,=0D + "Target": PlatformInfo.BuildTarget,=0D + "ToolChain": PlatformInfo.Workspace.ToolChain,=0D + "BuildRuleFile": PlatformInfo.BuildRule,=0D "Arch": PlatformInfo.Arch,=0D - "ArchList":PlatformInfo.Workspace.ArchList,=0D - "ActivePlatform":PlatformInfo.MetaFile=0D - }=0D - self.DataContainer =3D {'P_Info':PInfo}=0D + "ArchList": PlatformInfo.Workspace.ArchList,=0D + "ActivePlatform": PlatformInfo.MetaFile=0D + }=0D + self.DataContainer =3D {'P_Info': PInfo}=0D =0D - self.DataContainer =3D {'M_Name':PlatformInfo.UniqueBaseName}=0D + self.DataContainer =3D {'M_Name': PlatformInfo.UniqueBaseName}=0D =0D self.DataContainer =3D {"ToolChainFamily": PlatformInfo.ToolChainF= amily}=0D =0D self.DataContainer =3D {"BuildRuleFamily": PlatformInfo.BuildRuleF= amily}=0D =0D - self.DataContainer =3D {"MixedPcd":GlobalData.MixedPcd}=0D + self.DataContainer =3D {"MixedPcd": GlobalData.MixedPcd}=0D =0D - self.DataContainer =3D {"BuildOptPcd":GlobalData.BuildOptionPcd}=0D + self.DataContainer =3D {"BuildOptPcd": GlobalData.BuildOptionPcd}= =0D =0D self.DataContainer =3D {"BuildCommand": PlatformInfo.BuildCommand}= =0D =0D - self.DataContainer =3D {"AsBuildModuleList": PlatformInfo._AsBuild= ModuleList}=0D + self.DataContainer =3D {=0D + "AsBuildModuleList": PlatformInfo._AsBuildModuleList}=0D =0D self.DataContainer =3D {"G_defines": GlobalData.gGlobalDefines}=0D =0D self.DataContainer =3D {"CL_defines": GlobalData.gCommandLineDefin= es}=0D =0D - self.DataContainer =3D {"gCommandMaxLength": GlobalData.gCommandMa= xLength}=0D + self.DataContainer =3D {=0D + "gCommandMaxLength": GlobalData.gCommandMaxLength}=0D =0D - self.DataContainer =3D {"Env_Var": {k:v for k, v in os.environ.ite= ms()}}=0D + self.DataContainer =3D {"Env_Var": {k: v for k, v in os.environ.it= ems()}}=0D =0D - self.DataContainer =3D {"PackageList": [(dec.MetaFile,dec.Arch) fo= r dec in PlatformInfo.PackageList]}=0D + self.DataContainer =3D {"PackageList": [=0D + (dec.MetaFile, dec.Arch) for dec in PlatformInfo.PackageList]}= =0D =0D self.DataContainer =3D {"GuidDict": PlatformInfo.Platform._GuidDic= t}=0D =0D - self.DataContainer =3D {"DatabasePath":GlobalData.gDatabasePath}=0D + self.DataContainer =3D {"DatabasePath": GlobalData.gDatabasePath}= =0D =0D - self.DataContainer =3D {"FdfParser": True if GlobalData.gFdfParser= else False}=0D + self.DataContainer =3D {=0D + "FdfParser": True if GlobalData.gFdfParser else False}=0D =0D self.DataContainer =3D {"LogLevel": EdkLogger.GetLevel()}=0D =0D - self.DataContainer =3D {"UseHashCache":GlobalData.gUseHashCache}=0D + self.DataContainer =3D {"UseHashCache": GlobalData.gUseHashCache}= =0D =0D - self.DataContainer =3D {"BinCacheSource":GlobalData.gBinCacheSourc= e}=0D + self.DataContainer =3D {"BinCacheSource": GlobalData.gBinCacheSour= ce}=0D =0D - self.DataContainer =3D {"BinCacheDest":GlobalData.gBinCacheDest}=0D + self.DataContainer =3D {"BinCacheDest": GlobalData.gBinCacheDest}= =0D =0D - self.DataContainer =3D {"EnableGenfdsMultiThread":GlobalData.gEnab= leGenfdsMultiThread}=0D + self.DataContainer =3D {=0D + "EnableGenfdsMultiThread": GlobalData.gEnableGenfdsMultiThread= }=0D =0D - self.DataContainer =3D {"gPlatformFinalPcds":GlobalData.gPlatformF= inalPcds}=0D + self.DataContainer =3D {=0D + "gPlatformFinalPcds": GlobalData.gPlatformFinalPcds}=0D diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Pyt= hon/AutoGen/GenC.py index a2053d548521..fe02f160fd01 100755 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1,11 +1,11 @@ -## @file=0D +# @file=0D # Routines for generating AutoGen.h and AutoGen.c=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import absolute_import=0D import string=0D @@ -21,28 +21,31 @@ from .StrGather import * from .GenPcdDb import CreatePcdDatabaseCode=0D from .IdfClassObject import *=0D =0D -## PCD type string=0D -gItemTypeStringDatabase =3D {=0D - TAB_PCDS_FEATURE_FLAG : TAB_PCDS_FIXED_AT_BUILD,=0D - TAB_PCDS_FIXED_AT_BUILD : TAB_PCDS_FIXED_AT_BUILD,=0D +# PCD type string=0D +gItemTypeStringDatabase =3D {=0D + TAB_PCDS_FEATURE_FLAG: TAB_PCDS_FIXED_AT_BUILD,=0D + TAB_PCDS_FIXED_AT_BUILD: TAB_PCDS_FIXED_AT_BUILD,=0D TAB_PCDS_PATCHABLE_IN_MODULE: 'BinaryPatch',=0D - TAB_PCDS_DYNAMIC : '',=0D - TAB_PCDS_DYNAMIC_DEFAULT : '',=0D - TAB_PCDS_DYNAMIC_VPD : '',=0D - TAB_PCDS_DYNAMIC_HII : '',=0D - TAB_PCDS_DYNAMIC_EX : '',=0D - TAB_PCDS_DYNAMIC_EX_DEFAULT : '',=0D - TAB_PCDS_DYNAMIC_EX_VPD : '',=0D - TAB_PCDS_DYNAMIC_EX_HII : '',=0D + TAB_PCDS_DYNAMIC: '',=0D + TAB_PCDS_DYNAMIC_DEFAULT: '',=0D + TAB_PCDS_DYNAMIC_VPD: '',=0D + TAB_PCDS_DYNAMIC_HII: '',=0D + TAB_PCDS_DYNAMIC_EX: '',=0D + TAB_PCDS_DYNAMIC_EX_DEFAULT: '',=0D + TAB_PCDS_DYNAMIC_EX_VPD: '',=0D + TAB_PCDS_DYNAMIC_EX_HII: '',=0D }=0D =0D =0D -## Datum size=0D -gDatumSizeStringDatabase =3D {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:'32= ',TAB_UINT64:'64','BOOLEAN':'BOOLEAN',TAB_VOID:'8'}=0D -gDatumSizeStringDatabaseH =3D {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:'3= 2',TAB_UINT64:'64','BOOLEAN':'BOOL',TAB_VOID:'PTR'}=0D -gDatumSizeStringDatabaseLib =3D {TAB_UINT8:'8',TAB_UINT16:'16',TAB_UINT32:= '32',TAB_UINT64:'64','BOOLEAN':'Bool',TAB_VOID:'Ptr'}=0D +# Datum size=0D +gDatumSizeStringDatabase =3D {TAB_UINT8: '8', TAB_UINT16: '16',=0D + TAB_UINT32: '32', TAB_UINT64: '64', 'BOOLEAN':= 'BOOLEAN', TAB_VOID: '8'}=0D +gDatumSizeStringDatabaseH =3D {TAB_UINT8: '8', TAB_UINT16: '16',=0D + TAB_UINT32: '32', TAB_UINT64: '64', 'BOOLEAN'= : 'BOOL', TAB_VOID: 'PTR'}=0D +gDatumSizeStringDatabaseLib =3D {TAB_UINT8: '8', TAB_UINT16: '16',=0D + TAB_UINT32: '32', TAB_UINT64: '64', 'BOOLEA= N': 'Bool', TAB_VOID: 'Ptr'}=0D =0D -## AutoGen File Header Templates=0D +# AutoGen File Header Templates=0D gAutoGenHeaderString =3D TemplateString("""\=0D /**=0D DO NOT EDIT=0D @@ -75,7 +78,7 @@ gAutoGenHEpilogueString =3D """ #endif=0D """=0D =0D -## PEI Core Entry Point Templates=0D +# PEI Core Entry Point Templates=0D gPeiCoreEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D VOID=0D @@ -105,7 +108,7 @@ ${END} """)=0D =0D =0D -## DXE Core Entry Point Templates=0D +# DXE Core Entry Point Templates=0D gDxeCoreEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D VOID=0D @@ -130,7 +133,7 @@ ProcessModuleEntryPointList ( ${END}=0D """)=0D =0D -## PEIM Entry Point Templates=0D +# PEIM Entry Point Templates=0D gPeimEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -143,7 +146,7 @@ ${END} """)=0D =0D gPeimEntryPointString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision =3D ${PiSpecVers= ion};=0D =0D EFI_STATUS=0D @@ -157,7 +160,7 @@ ProcessModuleEntryPointList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision =3D ${PiSpecVers= ion};=0D ${BEGIN}=0D EFI_STATUS=0D @@ -172,7 +175,7 @@ ProcessModuleEntryPointList ( }=0D ${END}=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision =3D ${PiSpecVers= ion};=0D =0D EFI_STATUS=0D @@ -198,7 +201,7 @@ ${END} """)=0D ]=0D =0D -## SMM_CORE Entry Point Templates=0D +# SMM_CORE Entry Point Templates=0D gSmmCoreEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -227,7 +230,7 @@ ProcessModuleEntryPointList ( ${END}=0D """)=0D =0D -## MM_CORE_STANDALONE Entry Point Templates=0D +# MM_CORE_STANDALONE Entry Point Templates=0D gMmCoreStandaloneEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -253,7 +256,7 @@ ProcessModuleEntryPointList ( ${END}=0D """)=0D =0D -## MM_STANDALONE Entry Point Templates=0D +# MM_STANDALONE Entry Point Templates=0D gMmStandaloneEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -266,7 +269,7 @@ ${END} """)=0D =0D gMmStandaloneEntryPointString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision =3D ${PiSpecVersio= n};=0D =0D EFI_STATUS=0D @@ -280,7 +283,7 @@ ProcessModuleEntryPointList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision =3D ${PiSpecVersio= n};=0D ${BEGIN}=0D EFI_STATUS=0D @@ -295,7 +298,7 @@ ProcessModuleEntryPointList ( }=0D ${END}=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gMmRevision =3D ${PiSpecVersio= n};=0D =0D EFI_STATUS=0D @@ -321,7 +324,7 @@ ${END} """)=0D ]=0D =0D -## DXE SMM Entry Point Templates=0D +# DXE SMM Entry Point Templates=0D gDxeSmmEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -334,7 +337,7 @@ ${END} """)=0D =0D gDxeSmmEntryPointString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D const UINT32 _gDxeRevision =3D ${PiSpecVersion};=0D =0D @@ -349,7 +352,7 @@ ProcessModuleEntryPointList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D const UINT32 _gDxeRevision =3D ${PiSpecVersion};=0D =0D @@ -390,7 +393,7 @@ ${END} """)=0D ]=0D =0D -## UEFI Driver Entry Point Templates=0D +# UEFI Driver Entry Point Templates=0D gUefiDriverEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -403,7 +406,7 @@ ${END} """)=0D =0D gUefiDriverEntryPointString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D const UINT32 _gDxeRevision =3D ${PiSpecVersion};=0D =0D @@ -417,7 +420,7 @@ ProcessModuleEntryPointList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D const UINT32 _gDxeRevision =3D ${PiSpecVersion};=0D =0D @@ -445,7 +448,7 @@ ExitDriver ( gBS->Exit (gImageHandle, Status, 0, NULL);=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D const UINT32 _gDxeRevision =3D ${PiSpecVersion};=0D =0D @@ -485,7 +488,7 @@ ExitDriver ( ]=0D =0D =0D -## UEFI Application Entry Point Templates=0D +# UEFI Application Entry Point Templates=0D gUefiApplicationEntryPointPrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -498,7 +501,7 @@ ${END} """)=0D =0D gUefiApplicationEntryPointString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D =0D EFI_STATUS=0D @@ -511,7 +514,7 @@ ProcessModuleEntryPointList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D =0D ${BEGIN}=0D @@ -538,7 +541,7 @@ ExitDriver ( gBS->Exit (gImageHandle, Status, 0, NULL);=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D const UINT32 _gUefiDriverRevision =3D ${UefiSpecVersion};=0D =0D EFI_STATUS=0D @@ -576,7 +579,7 @@ ExitDriver ( """)=0D ]=0D =0D -## UEFI Unload Image Templates=0D +# UEFI Unload Image Templates=0D gUefiUnloadImagePrototype =3D TemplateString("""=0D ${BEGIN}=0D EFI_STATUS=0D @@ -588,7 +591,7 @@ ${END} """)=0D =0D gUefiUnloadImageString =3D [=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount =3D ${C= ount};=0D =0D EFI_STATUS=0D @@ -600,7 +603,7 @@ ProcessModuleUnloadList ( return EFI_SUCCESS;=0D }=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount =3D ${C= ount};=0D =0D ${BEGIN}=0D @@ -614,7 +617,7 @@ ProcessModuleUnloadList ( }=0D ${END}=0D """),=0D -TemplateString("""=0D + TemplateString("""=0D GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount =3D ${C= ount};=0D =0D EFI_STATUS=0D @@ -639,7 +642,7 @@ ${END} ]=0D =0D gLibraryStructorPrototype =3D {=0D -SUP_MODULE_BASE : TemplateString("""${BEGIN}=0D + SUP_MODULE_BASE: TemplateString("""${BEGIN}=0D RETURN_STATUS=0D EFIAPI=0D ${Function} (=0D @@ -647,7 +650,7 @@ ${Function} ( );${END}=0D """),=0D =0D -'PEI' : TemplateString("""${BEGIN}=0D + 'PEI': TemplateString("""${BEGIN}=0D EFI_STATUS=0D EFIAPI=0D ${Function} (=0D @@ -656,7 +659,7 @@ ${Function} ( );${END}=0D """),=0D =0D -'DXE' : TemplateString("""${BEGIN}=0D + 'DXE': TemplateString("""${BEGIN}=0D EFI_STATUS=0D EFIAPI=0D ${Function} (=0D @@ -665,7 +668,7 @@ ${Function} ( );${END}=0D """),=0D =0D -'MM' : TemplateString("""${BEGIN}=0D + 'MM': TemplateString("""${BEGIN}=0D EFI_STATUS=0D EFIAPI=0D ${Function} (=0D @@ -676,30 +679,30 @@ ${Function} ( }=0D =0D gLibraryStructorCall =3D {=0D -SUP_MODULE_BASE : TemplateString("""${BEGIN}=0D + SUP_MODULE_BASE: TemplateString("""${BEGIN}=0D Status =3D ${Function} ();=0D ASSERT_RETURN_ERROR (Status);${END}=0D """),=0D =0D -'PEI' : TemplateString("""${BEGIN}=0D + 'PEI': TemplateString("""${BEGIN}=0D Status =3D ${Function} (FileHandle, PeiServices);=0D ASSERT_EFI_ERROR (Status);${END}=0D """),=0D =0D -'DXE' : TemplateString("""${BEGIN}=0D + 'DXE': TemplateString("""${BEGIN}=0D Status =3D ${Function} (ImageHandle, SystemTable);=0D ASSERT_EFI_ERROR (Status);${END}=0D """),=0D =0D -'MM' : TemplateString("""${BEGIN}=0D + 'MM': TemplateString("""${BEGIN}=0D Status =3D ${Function} (ImageHandle, MmSystemTable);=0D ASSERT_EFI_ERROR (Status);${END}=0D """),=0D }=0D =0D -## Library Constructor and Destructor Templates=0D +# Library Constructor and Destructor Templates=0D gLibraryString =3D {=0D -SUP_MODULE_BASE : TemplateString("""=0D + SUP_MODULE_BASE: TemplateString("""=0D ${BEGIN}${FunctionPrototype}${END}=0D =0D VOID=0D @@ -713,7 +716,7 @@ ${FunctionCall}${END} }=0D """),=0D =0D -'PEI' : TemplateString("""=0D + 'PEI': TemplateString("""=0D ${BEGIN}${FunctionPrototype}${END}=0D =0D VOID=0D @@ -728,7 +731,7 @@ ${FunctionCall}${END} }=0D """),=0D =0D -'DXE' : TemplateString("""=0D + 'DXE': TemplateString("""=0D ${BEGIN}${FunctionPrototype}${END}=0D =0D VOID=0D @@ -743,7 +746,7 @@ ${FunctionCall}${END} }=0D """),=0D =0D -'MM' : TemplateString("""=0D + 'MM': TemplateString("""=0D ${BEGIN}${FunctionPrototype}${END}=0D =0D VOID=0D @@ -762,34 +765,36 @@ ${FunctionCall}${END} gBasicHeaderFile =3D "Base.h"=0D =0D gModuleTypeHeaderFile =3D {=0D - SUP_MODULE_BASE : [gBasicHeaderFile, "Library/DebugLib.= h"],=0D - SUP_MODULE_SEC : ["PiPei.h", "Library/DebugLib.h"],=0D - SUP_MODULE_PEI_CORE : ["PiPei.h", "Library/DebugLib.h", "Li= brary/PeiCoreEntryPoint.h"],=0D - SUP_MODULE_PEIM : ["PiPei.h", "Library/DebugLib.h", "Li= brary/PeimEntryPoint.h"],=0D - SUP_MODULE_DXE_CORE : ["PiDxe.h", "Library/DebugLib.h", "Li= brary/DxeCoreEntryPoint.h"],=0D - SUP_MODULE_DXE_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriver= EntryPoint.h"],=0D - SUP_MODULE_DXE_SMM_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriver= EntryPoint.h"],=0D + SUP_MODULE_BASE: [gBasicHeaderFile, "Library/DebugLib.h"],=0D + SUP_MODULE_SEC: ["PiPei.h", "Library/DebugLib.h"],=0D + SUP_MODULE_PEI_CORE: ["PiPei.h", "Library/DebugLib.h", "Library/PeiC= oreEntryPoint.h"],=0D + SUP_MODULE_PEIM: ["PiPei.h", "Library/DebugLib.h", "Library/PeimEntr= yPoint.h"],=0D + SUP_MODULE_DXE_CORE: ["PiDxe.h", "Library/DebugLib.h", "Library/DxeC= oreEntryPoint.h"],=0D + SUP_MODULE_DXE_DRIVER: ["PiDxe.h", "Library/BaseLib.h", "Library/Deb= ugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPoi= nt.h"],=0D + SUP_MODULE_DXE_SMM_DRIVER: ["PiDxe.h", "Library/BaseLib.h", "Library= /DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntr= yPoint.h"],=0D SUP_MODULE_DXE_RUNTIME_DRIVER: ["PiDxe.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriver= EntryPoint.h"],=0D - SUP_MODULE_DXE_SAL_DRIVER : ["PiDxe.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriver= EntryPoint.h"],=0D - SUP_MODULE_UEFI_DRIVER : ["Uefi.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriver= EntryPoint.h"],=0D - SUP_MODULE_UEFI_APPLICATION : ["Uefi.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplic= ationEntryPoint.h"],=0D - SUP_MODULE_SMM_CORE : ["PiDxe.h", "Library/BaseLib.h", "Lib= rary/DebugLib.h", "Library/UefiDriverEntryPoint.h"],=0D - SUP_MODULE_MM_STANDALONE : ["PiMm.h", "Library/BaseLib.h", "Libr= ary/DebugLib.h", "Library/StandaloneMmDriverEntryPoint.h"],=0D - SUP_MODULE_MM_CORE_STANDALONE : ["PiMm.h", "Library/BaseLib.h", "Libr= ary/DebugLib.h", "Library/StandaloneMmCoreEntryPoint.h"],=0D - SUP_MODULE_USER_DEFINED : [gBasicHeaderFile, "Library/DebugLib.= h"],=0D - SUP_MODULE_HOST_APPLICATION : [gBasicHeaderFile, "Library/DebugLib.= h"]=0D + SUP_MODULE_DXE_SAL_DRIVER: ["PiDxe.h", "Library/BaseLib.h", "Library= /DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntr= yPoint.h"],=0D + SUP_MODULE_UEFI_DRIVER: ["Uefi.h", "Library/BaseLib.h", "Library/De= bugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiDriverEntryPo= int.h"],=0D + SUP_MODULE_UEFI_APPLICATION: ["Uefi.h", "Library/BaseLib.h", "Libra= ry/DebugLib.h", "Library/UefiBootServicesTableLib.h", "Library/UefiApplicat= ionEntryPoint.h"],=0D + SUP_MODULE_SMM_CORE: ["PiDxe.h", "Library/BaseLib.h", "Library/Debug= Lib.h", "Library/UefiDriverEntryPoint.h"],=0D + SUP_MODULE_MM_STANDALONE: ["PiMm.h", "Library/BaseLib.h", "Library/D= ebugLib.h", "Library/StandaloneMmDriverEntryPoint.h"],=0D + SUP_MODULE_MM_CORE_STANDALONE: ["PiMm.h", "Library/BaseLib.h", "Libra= ry/DebugLib.h", "Library/StandaloneMmCoreEntryPoint.h"],=0D + SUP_MODULE_USER_DEFINED: [gBasicHeaderFile, "Library/DebugLib.h"],=0D + SUP_MODULE_HOST_APPLICATION: [gBasicHeaderFile, "Library/DebugLib.h"= ]=0D }=0D =0D -## Autogen internal worker macro to define DynamicEx PCD name includes bot= h the TokenSpaceGuidName=0D +# Autogen internal worker macro to define DynamicEx PCD name includes both= the TokenSpaceGuidName=0D # the TokenName and Guid comparison to avoid define name collisions.=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenH The TemplateString object for header file=0D #=0D #=0D +=0D +=0D def DynExPcdTokenNumberMapping(Info, AutoGenH):=0D ExTokenCNameList =3D []=0D - PcdExList =3D []=0D + PcdExList =3D []=0D # Even it is the Library, the PCD is saved in the ModulePcdList=0D PcdList =3D Info.ModulePcdList=0D for Pcd in PcdList:=0D @@ -817,7 +822,8 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): if Pcd.TokenCName =3D=3D TokenCName:=0D Index =3D Index + 1=0D if Index =3D=3D 1:=0D - AutoGenH.Append('\n#define __PCD_%s_ADDR_CMP(GuidPtr) = (' % (RealTokenCName))=0D + AutoGenH.Append(=0D + '\n#define __PCD_%s_ADDR_CMP(GuidPtr) (' % (RealT= okenCName))=0D AutoGenH.Append('\\\n (GuidPtr =3D=3D &%s) ? _PCD_TOK= EN_%s_%s:'=0D % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName))=0D else:=0D @@ -842,7 +848,8 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET and Pcd.TokenCName =3D= =3D TokenCName:=0D Index =3D Index + 1=0D if Index =3D=3D 1:=0D - AutoGenH.Append('\n#define __PCD_%s_VAL_CMP(GuidPtr) = (' % (RealTokenCName))=0D + AutoGenH.Append(=0D + '\n#define __PCD_%s_VAL_CMP(GuidPtr) (' % (RealTo= kenCName))=0D AutoGenH.Append('\\\n (GuidPtr =3D=3D NULL) ? 0:')=0D AutoGenH.Append('\\\n COMPAREGUID (GuidPtr, &%s) ? _P= CD_TOKEN_%s_%s:'=0D % (Pcd.TokenSpaceGuidCName, Pcd.TokenS= paceGuidCName, RealTokenCName))=0D @@ -859,15 +866,18 @@ def DynExPcdTokenNumberMapping(Info, AutoGenH): % (RealTokenCName, RealTokenCName, Rea= lTokenCName, RealTokenCName))=0D TokenCNameList.add(TokenCName)=0D =0D -## Create code for module PCDs=0D +# Create code for module PCDs=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D # @param Pcd The PCD object=0D #=0D +=0D +=0D def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd):=0D - TokenSpaceGuidValue =3D Pcd.TokenSpaceGuidValue #Info.GuidList[Pcd.T= okenSpaceGuidCName]=0D + # Info.GuidList[Pcd.TokenSpaceGuidCName]=0D + TokenSpaceGuidValue =3D Pcd.TokenSpaceGuidValue=0D PcdTokenNumber =3D Info.PlatformInfo.PcdTokenNumber=0D #=0D # Write PCDs=0D @@ -878,7 +888,7 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd): TokenCName =3D PcdItem[0]=0D break=0D PcdTokenName =3D '_PCD_TOKEN_' + TokenCName=0D - PatchPcdSizeTokenName =3D '_PCD_PATCHABLE_' + TokenCName +'_SIZE'=0D + PatchPcdSizeTokenName =3D '_PCD_PATCHABLE_' + TokenCName + '_SIZE'=0D PatchPcdSizeVariableName =3D '_gPcd_BinaryPatch_Size_' + TokenCName=0D PatchPcdMaxSizeVariable =3D '_gPcd_BinaryPatch_MaxSize_' + TokenCName= =0D FixPcdSizeTokenName =3D '_PCD_SIZE_' + TokenCName=0D @@ -909,23 +919,33 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): TokenNumber =3D 0=0D else:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "No generated token number for %s.%s\n" % = (Pcd.TokenSpaceGuidCName, TokenCName),=0D + "No generated token number for %s.%s\n" % = (=0D + Pcd.TokenSpaceGuidCName, TokenCName),= =0D ExtraData=3D"[%s]" % str(Info))=0D else:=0D - TokenNumber =3D PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceG= uidCName]=0D + TokenNumber =3D PcdTokenNumber[Pcd.TokenCName,=0D + Pcd.TokenSpaceGuidCName]=0D AutoGenH.Append('\n#define %s %dU\n' % (PcdTokenName, TokenNumber= ))=0D =0D - EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " + TokenCName += "." + Pcd.TokenSpaceGuidCName)=0D + EdkLogger.debug(EdkLogger.DEBUG_3, "Creating code for " +=0D + TokenCName + "." + Pcd.TokenSpaceGuidCName)=0D if Pcd.Type not in gItemTypeStringDatabase:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, = Pcd.TokenSpaceGuidCName, TokenCName),=0D + "Unknown PCD type [%s] of PCD %s.%s" % (=0D + Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName)= ,=0D ExtraData=3D"[%s]" % str(Info))=0D =0D DatumSize =3D gDatumSizeStringDatabase[Pcd.DatumType] if Pcd.DatumType= in gDatumSizeStringDatabase else gDatumSizeStringDatabase[TAB_VOID]=0D DatumSizeLib =3D gDatumSizeStringDatabaseLib[Pcd.DatumType] if Pcd.Dat= umType in gDatumSizeStringDatabaseLib else gDatumSizeStringDatabaseLib[TAB_= VOID]=0D - GetModeName =3D '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else= '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName= =0D - SetModeName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else= '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName= =0D - 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=0D + GetModeName =3D '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_GET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName=0D + SetModeName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_SET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName=0D + SetModeStatusName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd= .DatumType] + '_S_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_SET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_S_' + TokenCName=0D GetModeSizeName =3D '_PCD_GET_MODE_SIZE' + '_' + TokenCName=0D =0D if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D @@ -944,26 +964,41 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): # If only PcdToken and PcdGet/Set used in all Pcds with different = CName, it should succeed to build.=0D # If PcdToken and PcdGet/Set used in the Pcds with different Guids= but same CName, it should failed to build.=0D if PcdExCNameTest > 1:=0D - AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGe= t/Set are not allowed in the case that more than one DynamicEx Pcds are dif= ferent Guids but same CName.\n')=0D - AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTo= kenName))=0D - AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (G= etModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % = (GetModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append(=0D + '// Disabled the macros, as PcdToken and PcdGet/Set are no= t allowed in the case that more than one DynamicEx Pcds are different Guids= but same CName.\n')=0D + AutoGenH.Append('// #define %s %s\n' %=0D + (PcdTokenName, PcdExTokenName))=0D + AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' %=0D + (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuid= CName, PcdTokenName))=0D + AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' %= =0D + (GetModeSizeName, Pcd.TokenSpaceGuidCName, Pcd= TokenName))=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLi= b, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, Datu= mSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeName, DatumSizeLib, Pcd.TokenSpace= GuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeStatusName, DatumSizeLib, Pcd.Toke= nSpaceGuidCName, PcdTokenName))=0D else:=0D - AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s, = %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdT= okenName))=0D - AutoGenH.Append('// #define %s(Value) LibPcdSetEx%sS(&%s,= %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNam= e, PcdTokenName))=0D + AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s, = %s, (Value))\n' %=0D + (SetModeName, DatumSizeLib, Pcd.TokenSpace= GuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(Value) LibPcdSetEx%sS(&%s,= %s, (Value))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s %s\n' % (PcdTokenName, PcdExToken= Name))=0D - AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetM= odeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (Get= ModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PcdTokenName, PcdExTokenName))=0D + AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (=0D + GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTok= enName))=0D + AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (=0D + GetModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, = Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSi= zeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, Pc= dTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s,= (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdToke= nName))=0D - AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s= , (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, = PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s,= (Value))\n' % (=0D + SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, Pc= dTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s= , (Value))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D elif Pcd.Type in PCD_DYNAMIC_TYPE_SET:=0D PcdCNameTest =3D 0=0D for PcdModule in Info.LibraryPcdList + Info.ModulePcdList:=0D @@ -973,18 +1008,26 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pc= d): if PcdCNameTest > 1:=0D break=0D if PcdCNameTest > 1:=0D - EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic= Pcds [%s] are different Guids but same CName. They need to be changed to D= ynamicEx type to avoid the confliction.\n" % (TokenCName), ExtraData=3D"[%s= ]" % str(Info.MetaFile.Path))=0D + EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic= Pcds [%s] are different Guids but same CName. They need to be changed to D= ynamicEx type to avoid the confliction.\n" % (=0D + TokenCName), ExtraData=3D"[%s]" % str(Info.MetaFile.Path))= =0D else:=0D - AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName= , DatumSizeLib, PcdTokenName))=0D - AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' % (GetModeSi= zeName, PcdTokenName))=0D + AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' %=0D + (GetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' %=0D + (GetModeSizeName, PcdTokenName))=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdToken= Name))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, = PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%s(%s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%sS(%s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeStatusName, DatumSizeLib, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value= ))\n' % (SetModeName, DatumSizeLib, PcdTokenName))=0D - AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Valu= e))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value= ))\n' % (=0D + SetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Valu= e))\n' % (=0D + SetModeStatusName, DatumSizeLib, PcdTokenName))=0D else:=0D - PcdVariableName =3D '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] += '_' + TokenCName=0D + PcdVariableName =3D '_gPcd_' + \=0D + gItemTypeStringDatabase[Pcd.Type] + '_' + TokenCName=0D Const =3D 'const'=0D if Pcd.Type =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D Const =3D ''=0D @@ -1007,18 +1050,21 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, P= cd): Value =3D Value[:-1]=0D if Value.startswith('0') and not Value.lower().startswith(= '0x') and len(Value) > 1 and Value.lstrip('0'):=0D Value =3D Value.lstrip('0')=0D - ValueNumber =3D int (Value, 0)=0D + ValueNumber =3D int(Value, 0)=0D except:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "PCD value is not valid dec or hex number = for datum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName= , TokenCName),=0D + "PCD value is not valid dec or hex number = for datum type [%s] of PCD %s.%s" % (=0D + Pcd.DatumType, Pcd.TokenSpaceGuidCName= , TokenCName),=0D ExtraData=3D"[%s]" % str(Info))=0D if ValueNumber < 0:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "PCD can't be set to negative value for da= tum type [%s] of PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, Toke= nCName),=0D + "PCD can't be set to negative value for da= tum type [%s] of PCD %s.%s" % (=0D + Pcd.DatumType, Pcd.TokenSpaceGuidCName= , TokenCName),=0D ExtraData=3D"[%s]" % str(Info))=0D elif ValueNumber > MAX_VAL_TYPE[Pcd.DatumType]:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "Too large PCD value for datum type [%s] o= f PCD %s.%s" % (Pcd.DatumType, Pcd.TokenSpaceGuidCName, TokenCName),=0D + "Too large PCD value for datum type [%s] o= f PCD %s.%s" % (=0D + Pcd.DatumType, Pcd.TokenSpaceGuidCName= , TokenCName),=0D ExtraData=3D"[%s]" % str(Info))=0D if Pcd.DatumType =3D=3D TAB_UINT64 and not Value.endswith('ULL= '):=0D Value +=3D 'ULL'=0D @@ -1028,7 +1074,8 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd= ): if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D if not Pcd.MaxDatumSize:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "Unknown [MaxDatumSize] of PCD [%s.%s]" % = (Pcd.TokenSpaceGuidCName, TokenCName),=0D + "Unknown [MaxDatumSize] of PCD [%s.%s]" % = (=0D + Pcd.TokenSpaceGuidCName, TokenCName),= =0D ExtraData=3D"[%s]" % str(Info))=0D =0D ArraySize =3D int(Pcd.MaxDatumSize, 0)=0D @@ -1038,23 +1085,26 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, P= cd): else:=0D if Value[0] =3D=3D 'L':=0D Unicode =3D True=0D - Value =3D Value.lstrip('L') #.strip('"')=0D + Value =3D Value.lstrip('L') # .strip('"')=0D Value =3D eval(Value) # translate escape character= =0D ValueSize =3D len(Value) + 1=0D NewValue =3D '{'=0D for Index in range(0, len(Value)):=0D if Unicode:=0D - NewValue =3D NewValue + str(ord(Value[Index]) % 0x= 10000) + ', '=0D + NewValue =3D NewValue + \=0D + str(ord(Value[Index]) % 0x10000) + ', '=0D else:=0D - NewValue =3D NewValue + str(ord(Value[Index]) % 0x= 100) + ', '=0D + NewValue =3D NewValue + \=0D + str(ord(Value[Index]) % 0x100) + ', '=0D if Unicode:=0D ArraySize =3D ArraySize // 2=0D Value =3D NewValue + '0 }'=0D if ArraySize < ValueSize:=0D if Pcd.MaxSizeUserSet:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "The maximum size of VOID* type PCD '%s.%s= ' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Token= CName),=0D - ExtraData=3D"[%s]" % str(Info))=0D + "The maximum size of VOID* type PCD '%= s.%s' is less than its actual size occupied." % (=0D + Pcd.TokenSpaceGuidCName, TokenCNam= e),=0D + ExtraData=3D"[%s]" % str(Info))=0D else:=0D ArraySize =3D Pcd.GetPcdSize()=0D if Unicode:=0D @@ -1076,76 +1126,108 @@ def CreateModulePcdCode(Info, AutoGenC, AutoGenH, = Pcd): #=0D # For unicode, UINT16 array will be generated, so the alignmen= t of unicode is guaranteed.=0D #=0D - AutoGenH.Append('#define %s %s%s\n' %(PcdValueName, Type, Pcd= VariableName))=0D + AutoGenH.Append('#define %s %s%s\n' %=0D + (PcdValueName, Type, PcdVariableName))=0D if Unicode:=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %= s%s =3D %s;\n' % (Const, PcdVariableName, Array, Value))=0D - AutoGenH.Append('extern %s UINT16 %s%s;\n' %(Const, PcdVar= iableName, Array))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT16 %= s%s =3D %s;\n' % (=0D + Const, PcdVariableName, Array, Value))=0D + AutoGenH.Append('extern %s UINT16 %s%s;\n' %=0D + (Const, PcdVariableName, Array))=0D else:=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s= %s =3D %s;\n' % (Const, PcdVariableName, Array, Value))=0D - AutoGenH.Append('extern %s UINT8 %s%s;\n' %(Const, PcdVari= ableName, Array))=0D - AutoGenH.Append('#define %s %s%s\n' %(GetModeName, Type, PcdV= ariableName))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s UINT8 %s= %s =3D %s;\n' % (=0D + Const, PcdVariableName, Array, Value))=0D + AutoGenH.Append('extern %s UINT8 %s%s;\n' %=0D + (Const, PcdVariableName, Array))=0D + AutoGenH.Append('#define %s %s%s\n' %=0D + (GetModeName, Type, PcdVariableName))=0D =0D PcdDataSize =3D Pcd.GetPcdSize()=0D if Pcd.Type =3D=3D TAB_PCDS_FIXED_AT_BUILD:=0D - AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, = PcdDataSize))=0D - AutoGenH.Append('#define %s %s \n' % (GetModeSizeName, Fi= xPcdSizeTokenName))=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN= %s =3D %s;\n' % (FixedPcdSizeVariableName, PcdDataSize))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (FixPcdSizeTokenName, PcdDataSize))=0D + AutoGenH.Append('#define %s %s \n' %=0D + (GetModeSizeName, FixPcdSizeTokenName))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN= %s =3D %s;\n' % (=0D + FixedPcdSizeVariableName, PcdDataSize))=0D if Pcd.Type =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D - AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName= , Pcd.MaxDatumSize))=0D - AutoGenH.Append('#define %s %s \n' % (GetModeSizeName, Pa= tchPcdSizeVariableName))=0D - AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariab= leName)=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s = =3D %s;\n' % (PatchPcdSizeVariableName, PcdDataSize))=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN= %s =3D %s;\n' % (PatchPcdMaxSizeVariable, Pcd.MaxDatumSize))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PatchPcdSizeTokenName, Pcd.MaxDatumSize))= =0D + AutoGenH.Append('#define %s %s \n' %=0D + (GetModeSizeName, PatchPcdSizeVariableName= ))=0D + AutoGenH.Append('extern UINTN %s; \n' %=0D + PatchPcdSizeVariableName)=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s = =3D %s;\n' % (=0D + PatchPcdSizeVariableName, PcdDataSize))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED const UINTN= %s =3D %s;\n' % (=0D + PatchPcdMaxSizeVariable, Pcd.MaxDatumSize))=0D elif Pcd.Type =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D - AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value))=0D - AutoGenC.Append('volatile %s %s %s =3D %s;\n' %(Const, Pcd.Dat= umType, PcdVariableName, PcdValueName))=0D - AutoGenH.Append('extern volatile %s %s %s%s;\n' % (Const, Pc= d.DatumType, PcdVariableName, Array))=0D - AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, Pcd= VariableName))=0D + AutoGenH.Append('#define %s %s\n' % (PcdValueName, Value))=0D + AutoGenC.Append('volatile %s %s %s =3D %s;\n' % (=0D + Const, Pcd.DatumType, PcdVariableName, PcdValueName))=0D + AutoGenH.Append('extern volatile %s %s %s%s;\n' %=0D + (Const, Pcd.DatumType, PcdVariableName, Array)= )=0D + AutoGenH.Append('#define %s %s%s\n' %=0D + (GetModeName, Type, PcdVariableName))=0D =0D PcdDataSize =3D Pcd.GetPcdSize()=0D - AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pc= dDataSize))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PatchPcdSizeTokenName, PcdDataSize))=0D =0D - AutoGenH.Append('#define %s %s \n' % (GetModeSizeName, PatchP= cdSizeVariableName))=0D + AutoGenH.Append('#define %s %s \n' %=0D + (GetModeSizeName, PatchPcdSizeVariableName))=0D AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableNa= me)=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s =3D %s= ;\n' % (PatchPcdSizeVariableName, PcdDataSize))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED UINTN %s =3D %s= ;\n' % (=0D + PatchPcdSizeVariableName, PcdDataSize))=0D else:=0D PcdDataSize =3D Pcd.GetPcdSize()=0D - AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, PcdD= ataSize))=0D - AutoGenH.Append('#define %s %s \n' % (GetModeSizeName, FixPcd= SizeTokenName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (FixPcdSizeTokenName, PcdDataSize))=0D + AutoGenH.Append('#define %s %s \n' %=0D + (GetModeSizeName, FixPcdSizeTokenName))=0D =0D - AutoGenH.Append('#define %s %s\n' %(PcdValueName, Value))=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s %s =3D %s= ;\n' %(Const, Pcd.DatumType, PcdVariableName, PcdValueName))=0D - AutoGenH.Append('extern %s %s %s%s;\n' % (Const, Pcd.DatumTy= pe, PcdVariableName, Array))=0D - AutoGenH.Append('#define %s %s%s\n' % (GetModeName, Type, Pcd= VariableName))=0D + AutoGenH.Append('#define %s %s\n' % (PcdValueName, Value))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s %s =3D %s= ;\n' % (=0D + Const, Pcd.DatumType, PcdVariableName, PcdValueName))=0D + AutoGenH.Append('extern %s %s %s%s;\n' %=0D + (Const, Pcd.DatumType, PcdVariableName, Array)= )=0D + AutoGenH.Append('#define %s %s%s\n' %=0D + (GetModeName, Type, PcdVariableName))=0D =0D if Pcd.Type =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatc= hPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s,= (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeName= , Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatc= hPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s= , (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' % (SetModeSta= tusName, Pcd.TokenCName, Pcd.TokenCName, Pcd.TokenCName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatc= hPcdSetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s,= (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeName, Pcd.TokenCName, Pcd.TokenCNa= me, Pcd.TokenCName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatc= hPcdSetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &_gPcd_BinaryPatch_Size_%s= , (UINTN)_PCD_PATCHABLE_%s_SIZE, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeStatusName, Pcd.TokenCName, Pcd.To= kenCName, Pcd.TokenCName))=0D else:=0D - AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' % = (SetModeName, PcdVariableName))=0D - AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), RET= URN_SUCCESS) \n' % (SetModeStatusName, PcdVariableName))=0D + AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' %= =0D + (SetModeName, PcdVariableName))=0D + AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), RET= URN_SUCCESS) \n' % (=0D + SetModeStatusName, PcdVariableName))=0D else:=0D - AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not all= owed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)=0D + AutoGenH.Append(=0D + '//#define %s ASSERT(FALSE) // It is not allowed to set = value for a FIXED_AT_BUILD PCD\n' % SetModeName)=0D =0D -## Create code for library module PCDs=0D +# Create code for library module PCDs=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D # @param Pcd The PCD object=0D #=0D +=0D +=0D def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):=0D PcdTokenNumber =3D Info.PlatformInfo.PcdTokenNumber=0D TokenSpaceGuidCName =3D Pcd.TokenSpaceGuidCName=0D - TokenCName =3D Pcd.TokenCName=0D + TokenCName =3D Pcd.TokenCName=0D for PcdItem in GlobalData.MixedPcd:=0D if (TokenCName, TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdIte= m]:=0D TokenCName =3D PcdItem[0]=0D break=0D PcdTokenName =3D '_PCD_TOKEN_' + TokenCName=0D FixPcdSizeTokenName =3D '_PCD_SIZE_' + TokenCName=0D - PatchPcdSizeTokenName =3D '_PCD_PATCHABLE_' + TokenCName +'_SIZE'=0D + PatchPcdSizeTokenName =3D '_PCD_PATCHABLE_' + TokenCName + '_SIZE'=0D PatchPcdSizeVariableName =3D '_gPcd_BinaryPatch_Size_' + TokenCName=0D PatchPcdMaxSizeVariable =3D '_gPcd_BinaryPatch_MaxSize_' + TokenCName= =0D FixedPcdSizeVariableName =3D '_gPcd_FixedAtBuild_Size_' + TokenCName=0D @@ -1173,28 +1255,37 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): TokenNumber =3D 0=0D else:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "No generated token number for %s.%s\n" % = (Pcd.TokenSpaceGuidCName, TokenCName),=0D + "No generated token number for %s.%s\n" % = (=0D + Pcd.TokenSpaceGuidCName, TokenCName),= =0D ExtraData=3D"[%s]" % str(Info))=0D else:=0D - TokenNumber =3D PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceG= uidCName]=0D + TokenNumber =3D PcdTokenNumber[Pcd.TokenCName,=0D + Pcd.TokenSpaceGuidCName]=0D =0D if Pcd.Type not in gItemTypeStringDatabase:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "Unknown PCD type [%s] of PCD %s.%s" % (Pcd.Type, = Pcd.TokenSpaceGuidCName, TokenCName),=0D + "Unknown PCD type [%s] of PCD %s.%s" % (=0D + Pcd.Type, Pcd.TokenSpaceGuidCName, TokenCName)= ,=0D ExtraData=3D"[%s]" % str(Info))=0D =0D - DatumType =3D Pcd.DatumType=0D + DatumType =3D Pcd.DatumType=0D DatumSize =3D gDatumSizeStringDatabase[Pcd.DatumType] if Pcd.DatumType= in gDatumSizeStringDatabase else gDatumSizeStringDatabase[TAB_VOID]=0D DatumSizeLib =3D gDatumSizeStringDatabaseLib[Pcd.DatumType] if Pcd.Dat= umType in gDatumSizeStringDatabaseLib else gDatumSizeStringDatabaseLib[TAB_= VOID]=0D - GetModeName =3D '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else= '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName= =0D - SetModeName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else= '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName= =0D - 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=0D + GetModeName =3D '_PCD_GET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_GET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName=0D + SetModeName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd.Datum= Type] + '_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_SET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_' + TokenCName=0D + SetModeStatusName =3D '_PCD_SET_MODE_' + gDatumSizeStringDatabaseH[Pcd= .DatumType] + '_S_' + \=0D + TokenCName if Pcd.DatumType in gDatumSizeStringDatabaseH else '_PC= D_SET_MODE_' + \=0D + gDatumSizeStringDatabaseH[TAB_VOID] + '_S_' + TokenCName=0D GetModeSizeName =3D '_PCD_GET_MODE_SIZE' + '_' + TokenCName=0D =0D Type =3D ''=0D Array =3D ''=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - if Pcd.DefaultValue[0]=3D=3D '{':=0D + if Pcd.DefaultValue[0] =3D=3D '{':=0D Type =3D '(VOID *)'=0D Array =3D '[]'=0D PcdItemType =3D Pcd.Type=0D @@ -1217,28 +1308,44 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): # If only PcdGet/Set used in all Pcds with different CName, it sho= uld succeed to build.=0D # If PcdGet/Set used in the Pcds with different Guids but same CNa= me, it should failed to build.=0D if PcdExCNameTest > 1:=0D - AutoGenH.Append('// Disabled the macros, as PcdToken and PcdGe= t/Set are not allowed in the case that more than one DynamicEx Pcds are dif= ferent Guids but same CName.\n')=0D - AutoGenH.Append('// #define %s %s\n' % (PcdTokenName, PcdExTo= kenName))=0D - AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' % (G= etModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' % = (GetModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append(=0D + '// Disabled the macros, as PcdToken and PcdGet/Set are no= t allowed in the case that more than one DynamicEx Pcds are different Guids= but same CName.\n')=0D + AutoGenH.Append('// #define %s %s\n' %=0D + (PcdTokenName, PcdExTokenName))=0D + AutoGenH.Append('// #define %s LibPcdGetEx%s(&%s, %s)\n' %=0D + (GetModeName, DatumSizeLib, Pcd.TokenSpaceGuid= CName, PcdTokenName))=0D + AutoGenH.Append('// #define %s LibPcdGetExSize(&%s, %s)\n' %= =0D + (GetModeSizeName, Pcd.TokenSpaceGuidCName, Pcd= TokenName))=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLi= b, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, Datu= mSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeName, DatumSizeLib, Pcd.TokenSpace= GuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(SizeOfBuffer, Buffer) LibP= cdSetEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' %=0D + (SetModeStatusName, DatumSizeLib, Pcd.Toke= nSpaceGuidCName, PcdTokenName))=0D else:=0D - AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s, = %s, (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdT= okenName))=0D - AutoGenH.Append('// #define %s(Value) LibPcdSetEx%sS(&%s,= %s, (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNam= e, PcdTokenName))=0D + AutoGenH.Append('// #define %s(Value) LibPcdSetEx%s(&%s, = %s, (Value))\n' %=0D + (SetModeName, DatumSizeLib, Pcd.TokenSpace= GuidCName, PcdTokenName))=0D + AutoGenH.Append('// #define %s(Value) LibPcdSetEx%sS(&%s,= %s, (Value))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s %s\n' % (PcdTokenName, PcdExToken= Name))=0D - AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (GetM= odeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (Get= ModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PcdTokenName, PcdExTokenName))=0D + AutoGenH.Append('#define %s LibPcdGetEx%s(&%s, %s)\n' % (=0D + GetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdTok= enName))=0D + AutoGenH.Append('#define %s LibPcdGetExSize(&%s, %s)\n' % (=0D + GetModeSizeName, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeName, DatumSizeLib, = Pcd.TokenSpaceGuidCName, PcdTokenName))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSi= zeLib, Pcd.TokenSpaceGuidCName, PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%s(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, Pc= dTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= etEx%sS(&%s, %s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s,= (Value))\n' % (SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, PcdToke= nName))=0D - AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s= , (Value))\n' % (SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCName, = PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSetEx%s(&%s, %s,= (Value))\n' % (=0D + SetModeName, DatumSizeLib, Pcd.TokenSpaceGuidCName, Pc= dTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSetEx%sS(&%s, %s= , (Value))\n' % (=0D + SetModeStatusName, DatumSizeLib, Pcd.TokenSpaceGuidCNa= me, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' % (TokenCName, Toke= nNumber))=0D + AutoGenH.Append('#define _PCD_TOKEN_%s %dU\n' %=0D + (TokenCName, TokenNumber))=0D if PcdItemType in PCD_DYNAMIC_TYPE_SET:=0D PcdList =3D []=0D PcdCNameList =3D []=0D @@ -1248,51 +1355,75 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): if PcdModule.Type in PCD_DYNAMIC_TYPE_SET:=0D PcdCNameList.append(PcdModule.TokenCName)=0D if PcdCNameList.count(Pcd.TokenCName) > 1:=0D - EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic= Pcds [%s] are different Guids but same CName.They need to be changed to Dy= namicEx type to avoid the confliction.\n" % (TokenCName), ExtraData=3D"[%s]= " % str(Info.MetaFile.Path))=0D + EdkLogger.error("build", AUTOGEN_ERROR, "More than one Dynamic= Pcds [%s] are different Guids but same CName.They need to be changed to Dy= namicEx type to avoid the confliction.\n" % (=0D + TokenCName), ExtraData=3D"[%s]" % str(Info.MetaFile.Path))= =0D else:=0D - AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' % (GetModeName= , DatumSizeLib, PcdTokenName))=0D - AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' % (GetModeSi= zeName, PcdTokenName))=0D + AutoGenH.Append('#define %s LibPcdGet%s(%s)\n' %=0D + (GetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s LibPcdGetSize(%s)\n' %=0D + (GetModeSizeName, PcdTokenName))=0D if DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%s(%s, (SizeOfBuffer), (Buffer))\n' %(SetModeName, DatumSizeLib, PcdToken= Name))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%sS(%s, (SizeOfBuffer), (Buffer))\n' % (SetModeStatusName, DatumSizeLib, = PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%s(%s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPcdS= et%sS(%s, (SizeOfBuffer), (Buffer))\n' % (=0D + SetModeStatusName, DatumSizeLib, PcdTokenName))=0D else:=0D - AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value= ))\n' % (SetModeName, DatumSizeLib, PcdTokenName))=0D - AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Valu= e))\n' % (SetModeStatusName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSet%s(%s, (Value= ))\n' % (=0D + SetModeName, DatumSizeLib, PcdTokenName))=0D + AutoGenH.Append('#define %s(Value) LibPcdSet%sS(%s, (Valu= e))\n' % (=0D + SetModeStatusName, DatumSizeLib, PcdTokenName))=0D if PcdItemType =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D - PcdVariableName =3D '_gPcd_' + gItemTypeStringDatabase[TAB_PCDS_PA= TCHABLE_IN_MODULE] + '_' + TokenCName=0D + PcdVariableName =3D '_gPcd_' + \=0D + gItemTypeStringDatabase[TAB_PCDS_PATCHABLE_IN_MODULE] + \=0D + '_' + TokenCName=0D if DatumType not in TAB_PCD_NUMERIC_TYPES:=0D if DatumType =3D=3D TAB_VOID and Array =3D=3D '[]':=0D DatumType =3D [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0] = =3D=3D 'L']=0D else:=0D DatumType =3D TAB_UINT8=0D - AutoGenH.Append('extern %s _gPcd_BinaryPatch_%s%s;\n' %(DatumT= ype, TokenCName, Array))=0D + AutoGenH.Append('extern %s _gPcd_BinaryPatch_%s%s;\n' %=0D + (DatumType, TokenCName, Array))=0D else:=0D - AutoGenH.Append('extern volatile %s %s%s;\n' % (DatumType, P= cdVariableName, Array))=0D - AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeNa= me, Type, TokenCName))=0D + AutoGenH.Append('extern volatile %s %s%s;\n' %=0D + (DatumType, PcdVariableName, Array))=0D + AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %=0D + (GetModeName, Type, TokenCName))=0D PcdDataSize =3D Pcd.GetPcdSize()=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffe= r))\n' % (SetModeName, TokenCName, PatchPcdSizeVariableName, PatchPcdMaxSiz= eVariable))=0D - AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buff= er))\n' % (SetModeStatusName, TokenCName, PatchPcdSizeVariableName, PatchPc= dMaxSizeVariable))=0D - AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pa= tchPcdMaxSizeVariable))=0D - AutoGenH.Append('extern const UINTN %s; \n' % PatchPcdMaxSizeV= ariable)=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSize((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buffe= r))\n' %=0D + (SetModeName, TokenCName, PatchPcdSizeVariable= Name, PatchPcdMaxSizeVariable))=0D + AutoGenH.Append('#define %s(SizeOfBuffer, Buffer) LibPatchPcd= SetPtrAndSizeS((VOID *)_gPcd_BinaryPatch_%s, &%s, %s, (SizeOfBuffer), (Buff= er))\n' %=0D + (SetModeStatusName, TokenCName, PatchPcdSizeVa= riableName, PatchPcdMaxSizeVariable))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PatchPcdSizeTokenName, PatchPcdMaxSizeVariabl= e))=0D + AutoGenH.Append('extern const UINTN %s; \n' %=0D + PatchPcdMaxSizeVariable)=0D else:=0D - AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' % (Set= ModeName, PcdVariableName))=0D - AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), RETURN_= SUCCESS)\n' % (SetModeStatusName, PcdVariableName))=0D - AutoGenH.Append('#define %s %s\n' % (PatchPcdSizeTokenName, Pc= dDataSize))=0D + AutoGenH.Append('#define %s(Value) (%s =3D (Value))\n' %=0D + (SetModeName, PcdVariableName))=0D + AutoGenH.Append('#define %s(Value) ((%s =3D (Value)), RETURN_= SUCCESS)\n' % (=0D + SetModeStatusName, PcdVariableName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (PatchPcdSizeTokenName, PcdDataSize))=0D =0D - AutoGenH.Append('#define %s %s\n' % (GetModeSizeName, PatchPcdSize= VariableName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (GetModeSizeName, PatchPcdSizeVariableName))=0D AutoGenH.Append('extern UINTN %s; \n' % PatchPcdSizeVariableName)= =0D =0D if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD or PcdItemType =3D=3D TA= B_PCDS_FEATURE_FLAG:=0D key =3D ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName))=0D - PcdVariableName =3D '_gPcd_' + gItemTypeStringDatabase[Pcd.Type] += '_' + TokenCName=0D + PcdVariableName =3D '_gPcd_' + \=0D + gItemTypeStringDatabase[Pcd.Type] + '_' + TokenCName=0D if DatumType =3D=3D TAB_VOID and Array =3D=3D '[]':=0D DatumType =3D [TAB_UINT8, TAB_UINT16][Pcd.DefaultValue[0] =3D= =3D 'L']=0D if DatumType not in TAB_PCD_NUMERIC_TYPES_VOID:=0D DatumType =3D TAB_UINT8=0D - AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(Dat= umType, TokenCName, Array))=0D - AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeN= ame, Type, TokenCName))=0D - AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed= to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)=0D + AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %=0D + (DatumType, TokenCName, Array))=0D + AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %=0D + (GetModeName, Type, TokenCName))=0D + AutoGenH.Append(=0D + '//#define %s ASSERT(FALSE) // It is not allowed to set valu= e for a FIXED_AT_BUILD PCD\n' % SetModeName)=0D =0D ConstFixedPcd =3D False=0D if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD and (key in Info.Con= stPcd or (Info.IsLibrary and not Info.ReferenceModules)):=0D @@ -1300,29 +1431,40 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, = Pcd): if key in Info.ConstPcd:=0D Pcd.DefaultValue =3D Info.ConstPcd[key]=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D - AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %(TokenCNam= e, Type, PcdVariableName))=0D + AutoGenH.Append('#define _PCD_VALUE_%s %s%s\n' %=0D + (TokenCName, Type, PcdVariableName))=0D else:=0D - AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName,= Pcd.DefaultValue))=0D + AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %=0D + (TokenCName, Pcd.DefaultValue))=0D PcdDataSize =3D Pcd.GetPcdSize()=0D if PcdItemType =3D=3D TAB_PCDS_FIXED_AT_BUILD:=0D if Pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D if ConstFixedPcd:=0D - AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenNa= me, PcdDataSize))=0D - AutoGenH.Append('#define %s %s\n' % (GetModeSizeName, = FixPcdSizeTokenName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (FixPcdSizeTokenName, PcdDataSize))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (GetModeSizeName, FixPcdSizeTokenName)= )=0D else:=0D - AutoGenH.Append('#define %s %s\n' % (GetModeSizeName, = FixedPcdSizeVariableName))=0D - AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenNa= me, FixedPcdSizeVariableName))=0D - AutoGenH.Append('extern const UINTN %s; \n' % FixedPcd= SizeVariableName)=0D + AutoGenH.Append('#define %s %s\n' %=0D + (GetModeSizeName, FixedPcdSizeVariable= Name))=0D + AutoGenH.Append('#define %s %s\n' % (=0D + FixPcdSizeTokenName, FixedPcdSizeVariableName))=0D + AutoGenH.Append('extern const UINTN %s; \n' %=0D + FixedPcdSizeVariableName)=0D else:=0D - AutoGenH.Append('#define %s %s\n' % (FixPcdSizeTokenName, = PcdDataSize))=0D - AutoGenH.Append('#define %s %s\n' % (GetModeSizeName, FixP= cdSizeTokenName))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (FixPcdSizeTokenName, PcdDataSize))=0D + AutoGenH.Append('#define %s %s\n' %=0D + (GetModeSizeName, FixPcdSizeTokenName))=0D =0D -## Create code for library constructor=0D +# Create code for library constructor=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateLibraryConstructorCode(Info, AutoGenC, AutoGenH):=0D #=0D # Library Constructors=0D @@ -1336,21 +1478,29 @@ def CreateLibraryConstructorCode(Info, AutoGenC, Au= toGenH): for Lib in DependentLibraryList:=0D if len(Lib.ConstructorList) <=3D 0:=0D continue=0D - Dict =3D {'Function':Lib.ConstructorList}=0D + Dict =3D {'Function': Lib.ConstructorList}=0D if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:=0D - ConstructorPrototypeString.Append(gLibraryStructorPrototype[SU= P_MODULE_BASE].Replace(Dict))=0D - ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODUL= E_BASE].Replace(Dict))=0D + ConstructorPrototypeString.Append(=0D + gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))= =0D + ConstructorCallingString.Append(=0D + gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))=0D if Info.ModuleType not in [SUP_MODULE_BASE, SUP_MODULE_USER_DEFINE= D, SUP_MODULE_HOST_APPLICATION]:=0D if Lib.ModuleType in SUP_MODULE_SET_PEI:=0D - ConstructorPrototypeString.Append(gLibraryStructorPrototyp= e['PEI'].Replace(Dict))=0D - ConstructorCallingString.Append(gLibraryStructorCall['PEI'= ].Replace(Dict))=0D + ConstructorPrototypeString.Append(=0D + gLibraryStructorPrototype['PEI'].Replace(Dict))=0D + ConstructorCallingString.Append(=0D + gLibraryStructorCall['PEI'].Replace(Dict))=0D elif Lib.ModuleType in [SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DR= IVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_DXE_RUNTIME_DRIVER,=0D SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_= UEFI_DRIVER, SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_SMM_CORE]:=0D - ConstructorPrototypeString.Append(gLibraryStructorPrototyp= e['DXE'].Replace(Dict))=0D - ConstructorCallingString.Append(gLibraryStructorCall['DXE'= ].Replace(Dict))=0D + ConstructorPrototypeString.Append(=0D + gLibraryStructorPrototype['DXE'].Replace(Dict))=0D + ConstructorCallingString.Append(=0D + gLibraryStructorCall['DXE'].Replace(Dict))=0D elif Lib.ModuleType in [SUP_MODULE_MM_STANDALONE, SUP_MODULE_M= M_CORE_STANDALONE]:=0D - ConstructorPrototypeString.Append(gLibraryStructorPrototyp= e['MM'].Replace(Dict))=0D - ConstructorCallingString.Append(gLibraryStructorCall['MM']= .Replace(Dict))=0D + ConstructorPrototypeString.Append(=0D + gLibraryStructorPrototype['MM'].Replace(Dict))=0D + ConstructorCallingString.Append(=0D + gLibraryStructorCall['MM'].Replace(Dict))=0D =0D if str(ConstructorPrototypeString) =3D=3D '':=0D ConstructorPrototypeList =3D []=0D @@ -1362,9 +1512,9 @@ def CreateLibraryConstructorCode(Info, AutoGenC, Auto= GenH): ConstructorCallingList =3D [str(ConstructorCallingString)]=0D =0D Dict =3D {=0D - 'Type' : 'Constructor',=0D - 'FunctionPrototype' : ConstructorPrototypeList,=0D - 'FunctionCall' : ConstructorCallingList=0D + 'Type': 'Constructor',=0D + 'FunctionPrototype': ConstructorPrototypeList,=0D + 'FunctionCall': ConstructorCallingList=0D }=0D if Info.IsLibrary:=0D AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)=0D @@ -1379,12 +1529,14 @@ def CreateLibraryConstructorCode(Info, AutoGenC, Au= toGenH): elif Info.ModuleType in [SUP_MODULE_MM_STANDALONE, SUP_MODULE_MM_C= ORE_STANDALONE]:=0D AutoGenC.Append(gLibraryString['MM'].Replace(Dict))=0D =0D -## Create code for library destructor=0D +# Create code for library destructor=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateLibraryDestructorCode(Info, AutoGenC, AutoGenH):=0D #=0D # Library Destructors=0D @@ -1399,21 +1551,29 @@ def CreateLibraryDestructorCode(Info, AutoGenC, Aut= oGenH): Lib =3D DependentLibraryList[Index]=0D if len(Lib.DestructorList) <=3D 0:=0D continue=0D - Dict =3D {'Function':Lib.DestructorList}=0D + Dict =3D {'Function': Lib.DestructorList}=0D if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:=0D - DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP= _MODULE_BASE].Replace(Dict))=0D - DestructorCallingString.Append(gLibraryStructorCall[SUP_MODULE= _BASE].Replace(Dict))=0D + DestructorPrototypeString.Append(=0D + gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))= =0D + DestructorCallingString.Append(=0D + gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))=0D if Info.ModuleType not in [SUP_MODULE_BASE, SUP_MODULE_USER_DEFINE= D, SUP_MODULE_HOST_APPLICATION]:=0D if Lib.ModuleType in SUP_MODULE_SET_PEI:=0D - DestructorPrototypeString.Append(gLibraryStructorPrototype= ['PEI'].Replace(Dict))=0D - DestructorCallingString.Append(gLibraryStructorCall['PEI']= .Replace(Dict))=0D + DestructorPrototypeString.Append(=0D + gLibraryStructorPrototype['PEI'].Replace(Dict))=0D + DestructorCallingString.Append(=0D + gLibraryStructorCall['PEI'].Replace(Dict))=0D elif Lib.ModuleType in [SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DR= IVER, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_DXE_RUNTIME_DRIVER,=0D SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_= UEFI_DRIVER, SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_SMM_CORE]:=0D - DestructorPrototypeString.Append(gLibraryStructorPrototype= ['DXE'].Replace(Dict))=0D - DestructorCallingString.Append(gLibraryStructorCall['DXE']= .Replace(Dict))=0D + DestructorPrototypeString.Append(=0D + gLibraryStructorPrototype['DXE'].Replace(Dict))=0D + DestructorCallingString.Append(=0D + gLibraryStructorCall['DXE'].Replace(Dict))=0D elif Lib.ModuleType in [SUP_MODULE_MM_STANDALONE, SUP_MODULE_M= M_CORE_STANDALONE]:=0D - DestructorPrototypeString.Append(gLibraryStructorPrototype= ['MM'].Replace(Dict))=0D - DestructorCallingString.Append(gLibraryStructorCall['MM'].= Replace(Dict))=0D + DestructorPrototypeString.Append(=0D + gLibraryStructorPrototype['MM'].Replace(Dict))=0D + DestructorCallingString.Append(=0D + gLibraryStructorCall['MM'].Replace(Dict))=0D =0D if str(DestructorPrototypeString) =3D=3D '':=0D DestructorPrototypeList =3D []=0D @@ -1425,9 +1585,9 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoG= enH): DestructorCallingList =3D [str(DestructorCallingString)]=0D =0D Dict =3D {=0D - 'Type' : 'Destructor',=0D - 'FunctionPrototype' : DestructorPrototypeList,=0D - 'FunctionCall' : DestructorCallingList=0D + 'Type': 'Destructor',=0D + 'FunctionPrototype': DestructorPrototypeList,=0D + 'FunctionCall': DestructorCallingList=0D }=0D if Info.IsLibrary:=0D AutoGenH.Append("${BEGIN}${FunctionPrototype}${END}", Dict)=0D @@ -1443,7 +1603,7 @@ def CreateLibraryDestructorCode(Info, AutoGenC, AutoG= enH): AutoGenC.Append(gLibraryString['MM'].Replace(Dict))=0D =0D =0D -## Create code for ModuleEntryPoint=0D +# Create code for ModuleEntryPoint=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D @@ -1465,8 +1625,8 @@ def CreateModuleEntryPointCode(Info, AutoGenC, AutoGe= nH): else:=0D UefiSpecVersion =3D '0x00000000'=0D Dict =3D {=0D - 'Function' : Info.Module.ModuleEntryPointList,=0D - 'PiSpecVersion' : PiSpecVersion + 'U',=0D + 'Function': Info.Module.ModuleEntryPointList,=0D + 'PiSpecVersion': PiSpecVersion + 'U',=0D 'UefiSpecVersion': UefiSpecVersion + 'U'=0D }=0D =0D @@ -1474,12 +1634,12 @@ def CreateModuleEntryPointCode(Info, AutoGenC, Auto= GenH): if Info.SourceFileList:=0D if NumEntryPoints !=3D 1:=0D EdkLogger.error(=0D - "build",=0D - AUTOGEN_ERROR,=0D - '%s must have exactly one entry point' % Info.ModuleType= ,=0D - File=3Dstr(Info),=0D - ExtraData=3D ", ".join(Info.Module.ModuleEntryPointList)= =0D - )=0D + "build",=0D + AUTOGEN_ERROR,=0D + '%s must have exactly one entry point' % Info.ModuleTy= pe,=0D + File=3Dstr(Info),=0D + ExtraData=3D", ".join(Info.Module.ModuleEntryPointList= )=0D + )=0D if Info.ModuleType =3D=3D SUP_MODULE_PEI_CORE:=0D AutoGenC.Append(gPeiCoreEntryPointString.Replace(Dict))=0D AutoGenH.Append(gPeiCoreEntryPointPrototype.Replace(Dict))=0D @@ -1494,13 +1654,15 @@ def CreateModuleEntryPointCode(Info, AutoGenC, Auto= GenH): AutoGenH.Append(gMmCoreStandaloneEntryPointPrototype.Replace(Dict)= )=0D elif Info.ModuleType =3D=3D SUP_MODULE_PEIM:=0D if NumEntryPoints < 2:=0D - AutoGenC.Append(gPeimEntryPointString[NumEntryPoints].Replace(= Dict))=0D + AutoGenC.Append(=0D + gPeimEntryPointString[NumEntryPoints].Replace(Dict))=0D else:=0D AutoGenC.Append(gPeimEntryPointString[2].Replace(Dict))=0D AutoGenH.Append(gPeimEntryPointPrototype.Replace(Dict))=0D elif Info.ModuleType in [SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE= _DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_UEFI_DRIVER]:=0D if NumEntryPoints < 2:=0D - AutoGenC.Append(gUefiDriverEntryPointString[NumEntryPoints].Re= place(Dict))=0D + AutoGenC.Append(=0D + gUefiDriverEntryPointString[NumEntryPoints].Replace(Dict))= =0D else:=0D AutoGenC.Append(gUefiDriverEntryPointString[2].Replace(Dict))= =0D AutoGenH.Append(gUefiDriverEntryPointPrototype.Replace(Dict))=0D @@ -1512,23 +1674,27 @@ def CreateModuleEntryPointCode(Info, AutoGenC, Auto= GenH): AutoGenH.Append(gDxeSmmEntryPointPrototype.Replace(Dict))=0D elif Info.ModuleType =3D=3D SUP_MODULE_MM_STANDALONE:=0D if NumEntryPoints < 2:=0D - AutoGenC.Append(gMmStandaloneEntryPointString[NumEntryPoints].= Replace(Dict))=0D + AutoGenC.Append(=0D + gMmStandaloneEntryPointString[NumEntryPoints].Replace(Dict= ))=0D else:=0D AutoGenC.Append(gMmStandaloneEntryPointString[2].Replace(Dict)= )=0D AutoGenH.Append(gMmStandaloneEntryPointPrototype.Replace(Dict))=0D elif Info.ModuleType =3D=3D SUP_MODULE_UEFI_APPLICATION:=0D if NumEntryPoints < 2:=0D - AutoGenC.Append(gUefiApplicationEntryPointString[NumEntryPoint= s].Replace(Dict))=0D + AutoGenC.Append(=0D + gUefiApplicationEntryPointString[NumEntryPoints].Replace(D= ict))=0D else:=0D AutoGenC.Append(gUefiApplicationEntryPointString[2].Replace(Di= ct))=0D AutoGenH.Append(gUefiApplicationEntryPointPrototype.Replace(Dict))= =0D =0D -## Create code for ModuleUnloadImage=0D +# Create code for ModuleUnloadImage=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH):=0D if Info.IsLibrary or Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_= MODULE_HOST_APPLICATION, SUP_MODULE_BASE, SUP_MODULE_SEC]:=0D return=0D @@ -1536,19 +1702,22 @@ def CreateModuleUnloadImageCode(Info, AutoGenC, Aut= oGenH): # Unload Image Handlers=0D #=0D NumUnloadImage =3D len(Info.Module.ModuleUnloadImageList)=0D - Dict =3D {'Count':str(NumUnloadImage) + 'U', 'Function':Info.Module.Mo= duleUnloadImageList}=0D + Dict =3D {'Count': str(NumUnloadImage) + 'U',=0D + 'Function': Info.Module.ModuleUnloadImageList}=0D if NumUnloadImage < 2:=0D AutoGenC.Append(gUefiUnloadImageString[NumUnloadImage].Replace(Dic= t))=0D else:=0D AutoGenC.Append(gUefiUnloadImageString[2].Replace(Dict))=0D AutoGenH.Append(gUefiUnloadImagePrototype.Replace(Dict))=0D =0D -## Create code for GUID=0D +# Create code for GUID=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):=0D if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_HOST_APPLIC= ATION, SUP_MODULE_BASE]:=0D GuidType =3D TAB_GUID=0D @@ -1564,15 +1733,18 @@ def CreateGuidDefinitionCode(Info, AutoGenC, AutoGe= nH): #=0D for Key in Info.GuidList:=0D if not Info.IsLibrary:=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (GuidType, Key, Info.GuidList[Key]))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (=0D + GuidType, Key, Info.GuidList[Key]))=0D AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))=0D =0D -## Create code for protocol=0D +# Create code for protocol=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):=0D if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_HOST_APPLIC= ATION, SUP_MODULE_BASE]:=0D GuidType =3D TAB_GUID=0D @@ -1588,15 +1760,18 @@ def CreateProtocolDefinitionCode(Info, AutoGenC, Au= toGenH): #=0D for Key in Info.ProtocolList:=0D if not Info.IsLibrary:=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (GuidType, Key, Info.ProtocolList[Key]))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (=0D + GuidType, Key, Info.ProtocolList[Key]))=0D AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))=0D =0D -## Create code for PPI=0D +# Create code for PPI=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):=0D if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_HOST_APPLIC= ATION, SUP_MODULE_BASE]:=0D GuidType =3D TAB_GUID=0D @@ -1612,15 +1787,18 @@ def CreatePpiDefinitionCode(Info, AutoGenC, AutoGen= H): #=0D for Key in Info.PpiList:=0D if not Info.IsLibrary:=0D - AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (GuidType, Key, Info.PpiList[Key]))=0D + AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s =3D %s;\n= ' % (=0D + GuidType, Key, Info.PpiList[Key]))=0D AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))=0D =0D -## Create code for PCD=0D +# Create code for PCD=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreatePcdCode(Info, AutoGenC, AutoGenH):=0D =0D # Collect Token Space GUIDs used by DynamicEc PCDs=0D @@ -1634,7 +1812,8 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): AutoGenH.Append("extern UINT64 _gPcd_SkuId_Array[];\n")=0D # Add extern declarations to AutoGen.h if one or more Token Space GUID= s were found=0D if TokenSpaceList:=0D - AutoGenH.Append("\n// Definition of PCD Token Space GUIDs used in = this module\n\n")=0D + AutoGenH.Append(=0D + "\n// Definition of PCD Token Space GUIDs used in this module\= n\n")=0D if Info.ModuleType in [SUP_MODULE_USER_DEFINED, SUP_MODULE_HOST_AP= PLICATION, SUP_MODULE_BASE]:=0D GuidType =3D TAB_GUID=0D else:=0D @@ -1647,24 +1826,26 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): AutoGenH.Append("\n// PCD definitions\n")=0D for Pcd in Info.ModulePcdList:=0D CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd)=0D - DynExPcdTokenNumberMapping (Info, AutoGenH)=0D + DynExPcdTokenNumberMapping(Info, AutoGenH)=0D else:=0D AutoGenC.Append("\n// Definition of SkuId Array\n")=0D - AutoGenC.Append("GLOBAL_REMOVE_IF_UNREFERENCED UINT64 _gPcd_SkuId_= Array[] =3D %s;\n" % SkuMgr.DumpSkuIdArrary())=0D + AutoGenC.Append(=0D + "GLOBAL_REMOVE_IF_UNREFERENCED UINT64 _gPcd_SkuId_Array[] =3D = %s;\n" % SkuMgr.DumpSkuIdArrary())=0D if Info.ModulePcdList:=0D AutoGenH.Append("\n// Definition of PCDs used in this module\n= ")=0D AutoGenC.Append("\n// Definition of PCDs used in this module\n= ")=0D for Pcd in Info.ModulePcdList:=0D CreateModulePcdCode(Info, AutoGenC, AutoGenH, Pcd)=0D - DynExPcdTokenNumberMapping (Info, AutoGenH)=0D + DynExPcdTokenNumberMapping(Info, AutoGenH)=0D if Info.LibraryPcdList:=0D - AutoGenH.Append("\n// Definition of PCDs used in libraries is = in AutoGen.c\n")=0D + AutoGenH.Append(=0D + "\n// Definition of PCDs used in libraries is in AutoGen.c= \n")=0D AutoGenC.Append("\n// Definition of PCDs used in libraries\n")= =0D for Pcd in Info.LibraryPcdList:=0D CreateModulePcdCode(Info, AutoGenC, AutoGenC, Pcd)=0D CreatePcdDatabaseCode(Info, AutoGenC, AutoGenH)=0D =0D -## Create code for unicode string definition=0D +# Create code for unicode string definition=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D @@ -1672,6 +1853,8 @@ def CreatePcdCode(Info, AutoGenC, AutoGenH): # @param UniGenCFlag UniString is generated into AutoGen C file= when it is set to True=0D # @param UniGenBinBuffer Buffer to store uni string package data=0D #=0D +=0D +=0D def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH, UniGenCFlag, UniGenB= inBuffer):=0D WorkingDir =3D os.getcwd()=0D os.chdir(Info.WorkspaceDir)=0D @@ -1698,12 +1881,13 @@ def CreateUnicodeStringCode(Info, AutoGenC, AutoGen= H, UniGenCFlag, UniGenBinBuff else:=0D ShellMode =3D False=0D =0D - #RFC4646 is only for EDKII modules and ISO639-2 for EDK modules=0D + # RFC4646 is only for EDKII modules and ISO639-2 for EDK modules=0D if EDK2Module:=0D FilterInfo =3D [EDK2Module] + [Info.PlatformInfo.Platform.RFCLangu= ages]=0D else:=0D FilterInfo =3D [EDK2Module] + [Info.PlatformInfo.Platform.ISOLangu= ages]=0D - Header, Code =3D GetStringFiles(Info.UnicodeFileList, SrcList, IncList= , Info.IncludePathList, ['.uni', '.inf'], Info.Name, CompatibleMode, ShellM= ode, UniGenCFlag, UniGenBinBuffer, FilterInfo)=0D + Header, Code =3D GetStringFiles(Info.UnicodeFileList, SrcList, IncList= , Info.IncludePathList, [=0D + '.uni', '.inf'], Info.Name, CompatibleMo= de, ShellMode, UniGenCFlag, UniGenBinBuffer, FilterInfo)=0D if CompatibleMode or UniGenCFlag:=0D AutoGenC.Append("\n//\n//Unicode String Pack Definition\n//\n")=0D AutoGenC.Append(Code)=0D @@ -1714,9 +1898,10 @@ def CreateUnicodeStringCode(Info, AutoGenC, AutoGenH= , UniGenCFlag, UniGenBinBuff AutoGenH.Append("\n#define STRING_ARRAY_NAME %sStrings\n" % Info.N= ame)=0D os.chdir(WorkingDir)=0D =0D +=0D def CreateIdfFileCode(Info, AutoGenC, StringH, IdfGenCFlag, IdfGenBinBuffe= r):=0D if len(Info.IdfFileList) > 0:=0D - ImageFiles =3D IdfFileClassObject(sorted (Info.IdfFileList))=0D + ImageFiles =3D IdfFileClassObject(sorted(Info.IdfFileList))=0D if ImageFiles.ImageFilesDict:=0D Index =3D 1=0D PaletteIndex =3D 1=0D @@ -1739,32 +1924,41 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfG= enCFlag, IdfGenBinBuffer): for sourcefile in Info.SourceFileList:=0D if FileObj.FileName =3D=3D sourcefile.File:=0D if not sourcefile.Ext.upper() in ['.PNG', = '.BMP', '.JPG']:=0D - EdkLogger.error("build", AUTOGEN_ERROR= , "The %s's postfix must be one of .bmp, .jpg, .png" % (FileObj.FileName), = ExtraData=3D"[%s]" % str(Info))=0D + EdkLogger.error("build", AUTOGEN_ERROR= , "The %s's postfix must be one of .bmp, .jpg, .png" % (=0D + FileObj.FileName), ExtraData=3D"[%= s]" % str(Info))=0D FileObj.File =3D sourcefile=0D break=0D else:=0D - EdkLogger.error("build", AUTOGEN_ERROR, "The %= s in %s is not defined in the driver's [Sources] section" % (FileObj.FileNa= me, Idf), ExtraData=3D"[%s]" % str(Info))=0D + EdkLogger.error("build", AUTOGEN_ERROR, "The %= s in %s is not defined in the driver's [Sources] section" % (=0D + FileObj.FileName, Idf), ExtraData=3D"[%s]"= % str(Info))=0D =0D for FileObj in ImageFiles.ImageFilesDict[Idf]:=0D ID =3D FileObj.ImageID=0D File =3D FileObj.File=0D try:=0D - SearchImageID (FileObj, FileList)=0D + SearchImageID(FileObj, FileList)=0D if FileObj.Referenced:=0D if (ValueStartPtr - len(DEFINE_STR + ID)) = <=3D 0:=0D - Line =3D DEFINE_STR + ' ' + ID + ' ' += DecToHexStr(Index, 4) + '\n'=0D + Line =3D DEFINE_STR + ' ' + ID + ' ' += \=0D + DecToHexStr(Index, 4) + '\n'=0D else:=0D - Line =3D DEFINE_STR + ' ' + ID + ' ' *= (ValueStartPtr - len(DEFINE_STR + ID)) + DecToHexStr(Index, 4) + '\n'=0D + Line =3D DEFINE_STR + ' ' + ID + ' ' *= \=0D + (ValueStartPtr - len(DEFINE_STR + = ID)=0D + ) + DecToHexStr(Index, 4) + '\n'= =0D =0D if File not in FileDict:=0D FileDict[File] =3D Index=0D else:=0D - DuplicateBlock =3D pack('B', EFI_HII_I= IBT_DUPLICATE)=0D + DuplicateBlock =3D pack(=0D + 'B', EFI_HII_IIBT_DUPLICATE)=0D DuplicateBlock +=3D pack('H', FileDict= [File])=0D ImageBuffer +=3D DuplicateBlock=0D - BufferStr =3D WriteLine(BufferStr, '//= %s: %s: %s' % (DecToHexStr(Index, 4), ID, DecToHexStr(Index, 4)))=0D - TempBufferList =3D AscToHexList(Duplic= ateBlock)=0D - BufferStr =3D WriteLine(BufferStr, Cre= ateArrayItem(TempBufferList, 16) + '\n')=0D + BufferStr =3D WriteLine(=0D + BufferStr, '// %s: %s: %s' % (DecT= oHexStr(Index, 4), ID, DecToHexStr(Index, 4)))=0D + TempBufferList =3D AscToHexList(=0D + DuplicateBlock)=0D + BufferStr =3D WriteLine(=0D + BufferStr, CreateArrayItem(TempBuf= ferList, 16) + '\n')=0D StringH.Append(Line)=0D Index +=3D 1=0D continue=0D @@ -1773,50 +1967,65 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfG= enCFlag, IdfGenBinBuffer): Buffer =3D TmpFile.read()=0D TmpFile.close()=0D if File.Ext.upper() =3D=3D '.PNG':=0D - TempBuffer =3D pack('B', EFI_HII_IIBT_= IMAGE_PNG)=0D + TempBuffer =3D pack(=0D + 'B', EFI_HII_IIBT_IMAGE_PNG)=0D TempBuffer +=3D pack('I', len(Buffer))= =0D TempBuffer +=3D Buffer=0D elif File.Ext.upper() =3D=3D '.JPG':=0D - ImageType, =3D struct.unpack('4s', Buf= fer[6:10])=0D + ImageType, =3D struct.unpack(=0D + '4s', Buffer[6:10])=0D if ImageType !=3D b'JFIF':=0D - EdkLogger.error("build", FILE_TYPE= _MISMATCH, "The file %s is not a standard JPG file." % File.Path)=0D - TempBuffer =3D pack('B', EFI_HII_IIBT_= IMAGE_JPEG)=0D + EdkLogger.error(=0D + "build", FILE_TYPE_MISMATCH, "= The file %s is not a standard JPG file." % File.Path)=0D + TempBuffer =3D pack(=0D + 'B', EFI_HII_IIBT_IMAGE_JPEG)=0D TempBuffer +=3D pack('I', len(Buffer))= =0D TempBuffer +=3D Buffer=0D elif File.Ext.upper() =3D=3D '.BMP':=0D - TempBuffer, TempPalette =3D BmpImageDe= coder(File, Buffer, PaletteIndex, FileObj.TransParent)=0D + TempBuffer, TempPalette =3D BmpImageDe= coder(=0D + File, Buffer, PaletteIndex, FileOb= j.TransParent)=0D if len(TempPalette) > 1:=0D PaletteIndex +=3D 1=0D - NewPalette =3D pack('H', len(TempP= alette))=0D + NewPalette =3D pack(=0D + 'H', len(TempPalette))=0D NewPalette +=3D TempPalette=0D PaletteBuffer +=3D NewPalette=0D - PaletteStr =3D WriteLine(PaletteSt= r, '// %s: %s: %s' % (DecToHexStr(PaletteIndex - 1, 4), ID, DecToHexStr(Pal= etteIndex - 1, 4)))=0D - TempPaletteList =3D AscToHexList(N= ewPalette)=0D - PaletteStr =3D WriteLine(PaletteSt= r, CreateArrayItem(TempPaletteList, 16) + '\n')=0D + PaletteStr =3D WriteLine(PaletteSt= r, '// %s: %s: %s' % (=0D + DecToHexStr(PaletteIndex - 1, = 4), ID, DecToHexStr(PaletteIndex - 1, 4)))=0D + TempPaletteList =3D AscToHexList(= =0D + NewPalette)=0D + PaletteStr =3D WriteLine(=0D + PaletteStr, CreateArrayItem(Te= mpPaletteList, 16) + '\n')=0D ImageBuffer +=3D TempBuffer=0D - BufferStr =3D WriteLine(BufferStr, '// %s:= %s: %s' % (DecToHexStr(Index, 4), ID, DecToHexStr(Index, 4)))=0D + BufferStr =3D WriteLine(=0D + BufferStr, '// %s: %s: %s' % (DecToHex= Str(Index, 4), ID, DecToHexStr(Index, 4)))=0D TempBufferList =3D AscToHexList(TempBuffer= )=0D - BufferStr =3D WriteLine(BufferStr, CreateA= rrayItem(TempBufferList, 16) + '\n')=0D + BufferStr =3D WriteLine(=0D + BufferStr, CreateArrayItem(TempBufferL= ist, 16) + '\n')=0D =0D StringH.Append(Line)=0D Index +=3D 1=0D except IOError:=0D - EdkLogger.error("build", FILE_NOT_FOUND, Extra= Data=3DFile.Path)=0D + EdkLogger.error(=0D + "build", FILE_NOT_FOUND, ExtraData=3DFile.= Path)=0D =0D BufferStr =3D WriteLine(BufferStr, '// End of the Image Info')= =0D - BufferStr =3D WriteLine(BufferStr, CreateArrayItem(DecToHexLis= t(EFI_HII_IIBT_END, 2)) + '\n')=0D + BufferStr =3D WriteLine(BufferStr, CreateArrayItem(=0D + DecToHexList(EFI_HII_IIBT_END, 2)) + '\n')=0D ImageEnd =3D pack('B', EFI_HII_IIBT_END)=0D ImageBuffer +=3D ImageEnd=0D =0D if len(ImageBuffer) > 1:=0D ImageInfoOffset =3D 12=0D if len(PaletteBuffer) > 1:=0D - PaletteInfoOffset =3D 12 + len(ImageBuffer) - 1 # -1 is fo= r the first empty pad byte of ImageBuffer=0D + # -1 is for the first empty pad byte of ImageBuffer=0D + PaletteInfoOffset =3D 12 + len(ImageBuffer) - 1=0D =0D IMAGE_PACKAGE_HDR =3D pack('=3DII', ImageInfoOffset, PaletteIn= foOffset)=0D # PACKAGE_HEADER_Length =3D PACKAGE_HEADER + ImageInfoOffset += PaletteInfoOffset + ImageBuffer Length + PaletteCount + PaletteBuffer Leng= th=0D if len(PaletteBuffer) > 1:=0D - PACKAGE_HEADER_Length =3D 4 + 4 + 4 + len(ImageBuffer) - 1= + 2 + len(PaletteBuffer) - 1=0D + PACKAGE_HEADER_Length =3D 4 + 4 + 4 + \=0D + len(ImageBuffer) - 1 + 2 + len(PaletteBuffer) - 1=0D else:=0D PACKAGE_HEADER_Length =3D 4 + 4 + 4 + len(ImageBuffer) - 1= =0D if PaletteIndex > 1:=0D @@ -1824,12 +2033,14 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfG= enCFlag, IdfGenBinBuffer): # EFI_HII_PACKAGE_HEADER length max value is 0xFFFFFF=0D Hex_Length =3D '%06X' % PACKAGE_HEADER_Length=0D if PACKAGE_HEADER_Length > 0xFFFFFF:=0D - EdkLogger.error("build", AUTOGEN_ERROR, "The Length of EFI= _HII_PACKAGE_HEADER exceed its maximum value", ExtraData=3D"[%s]" % str(Inf= o))=0D - PACKAGE_HEADER =3D pack('=3DHBB', int('0x' + Hex_Length[2:], 1= 6), int('0x' + Hex_Length[0:2], 16), EFI_HII_PACKAGE_IMAGES)=0D + EdkLogger.error(=0D + "build", AUTOGEN_ERROR, "The Length of EFI_HII_PACKAGE= _HEADER exceed its maximum value", ExtraData=3D"[%s]" % str(Info))=0D + PACKAGE_HEADER =3D pack('=3DHBB', int(=0D + '0x' + Hex_Length[2:], 16), int('0x' + Hex_Length[0:2], 16= ), EFI_HII_PACKAGE_IMAGES)=0D =0D IdfGenBinBuffer.write(PACKAGE_HEADER)=0D IdfGenBinBuffer.write(IMAGE_PACKAGE_HDR)=0D - if len(ImageBuffer) > 1 :=0D + if len(ImageBuffer) > 1:=0D IdfGenBinBuffer.write(ImageBuffer[1:])=0D if PaletteIndex > 1:=0D IdfGenBinBuffer.write(PALETTE_INFO_HEADER)=0D @@ -1839,27 +2050,34 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfG= enCFlag, IdfGenBinBuffer): if IdfGenCFlag:=0D TotalLength =3D EFI_HII_ARRAY_SIZE_LENGTH + PACKAGE_HEADER= _Length=0D AutoGenC.Append("\n//\n//Image Pack Definition\n//\n")=0D - AllStr =3D WriteLine('', CHAR_ARRAY_DEFIN + ' ' + Info.Mod= ule.BaseName + 'Images' + '[] =3D {\n')=0D + AllStr =3D WriteLine('', CHAR_ARRAY_DEFIN + ' ' +=0D + Info.Module.BaseName + 'Images' + '[] = =3D {\n')=0D AllStr =3D WriteLine(AllStr, '// STRGATHER_OUTPUT_HEADER')= =0D - AllStr =3D WriteLine(AllStr, CreateArrayItem(DecToHexList(= TotalLength)) + '\n')=0D + AllStr =3D WriteLine(AllStr, CreateArrayItem(=0D + DecToHexList(TotalLength)) + '\n')=0D AllStr =3D WriteLine(AllStr, '// Image PACKAGE HEADER\n')= =0D IMAGE_PACKAGE_HDR_List =3D AscToHexList(PACKAGE_HEADER)=0D IMAGE_PACKAGE_HDR_List +=3D AscToHexList(IMAGE_PACKAGE_HDR= )=0D - AllStr =3D WriteLine(AllStr, CreateArrayItem(IMAGE_PACKAGE= _HDR_List, 16) + '\n')=0D + AllStr =3D WriteLine(AllStr, CreateArrayItem(=0D + IMAGE_PACKAGE_HDR_List, 16) + '\n')=0D AllStr =3D WriteLine(AllStr, '// Image DATA\n')=0D if BufferStr:=0D AllStr =3D WriteLine(AllStr, BufferStr)=0D if PaletteStr:=0D AllStr =3D WriteLine(AllStr, '// Palette Header\n')=0D - PALETTE_INFO_HEADER_List =3D AscToHexList(PALETTE_INFO= _HEADER)=0D - AllStr =3D WriteLine(AllStr, CreateArrayItem(PALETTE_I= NFO_HEADER_List, 16) + '\n')=0D + PALETTE_INFO_HEADER_List =3D AscToHexList(=0D + PALETTE_INFO_HEADER)=0D + AllStr =3D WriteLine(AllStr, CreateArrayItem(=0D + PALETTE_INFO_HEADER_List, 16) + '\n')=0D AllStr =3D WriteLine(AllStr, '// Palette Data\n')=0D AllStr =3D WriteLine(AllStr, PaletteStr)=0D AllStr =3D WriteLine(AllStr, '};')=0D AutoGenC.Append(AllStr)=0D AutoGenC.Append("\n")=0D - StringH.Append('\nextern unsigned char ' + Info.Module.Bas= eName + 'Images[];\n')=0D - StringH.Append("\n#define IMAGE_ARRAY_NAME %sImages\n" % I= nfo.Module.BaseName)=0D + StringH.Append('\nextern unsigned char ' +=0D + Info.Module.BaseName + 'Images[];\n')=0D + StringH.Append(=0D + "\n#define IMAGE_ARRAY_NAME %sImages\n" % Info.Module.= BaseName)=0D =0D # typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {=0D # EFI_HII_PACKAGE_HEADER Header; # Standard package header, wh= ere Header.Type =3D EFI_HII_PACKAGE_IMAGES=0D @@ -1878,24 +2096,31 @@ def CreateIdfFileCode(Info, AutoGenC, StringH, IdfG= enCFlag, IdfGenBinBuffer): # UINT8 BlockBody[];=0D # } EFI_HII_IMAGE_BLOCK;=0D =0D +=0D def BmpImageDecoder(File, Buffer, PaletteIndex, TransParent):=0D ImageType, =3D struct.unpack('2s', Buffer[0:2])=0D - if ImageType!=3D b'BM': # BMP file type is 'BM'=0D - EdkLogger.error("build", FILE_TYPE_MISMATCH, "The file %s is not a= standard BMP file." % File.Path)=0D - BMP_IMAGE_HEADER =3D collections.namedtuple('BMP_IMAGE_HEADER', ['bfSi= ze', 'bfReserved1', 'bfReserved2', 'bfOffBits', 'biSize', 'biWidth', 'biHei= ght', 'biPlanes', 'biBitCount', 'biCompression', 'biSizeImage', 'biXPelsPer= Meter', 'biYPelsPerMeter', 'biClrUsed', 'biClrImportant'])=0D + if ImageType !=3D b'BM': # BMP file type is 'BM'=0D + EdkLogger.error("build", FILE_TYPE_MISMATCH,=0D + "The file %s is not a standard BMP file." % File.P= ath)=0D + BMP_IMAGE_HEADER =3D collections.namedtuple('BMP_IMAGE_HEADER', ['bfSi= ze', 'bfReserved1', 'bfReserved2', 'bfOffBits', 'biSize', 'biWidth',=0D + 'biHeight', 'biPlanes', 'biB= itCount', 'biCompression', 'biSizeImage', 'biXPelsPerMeter', 'biYPelsPerMet= er', 'biClrUsed', 'biClrImportant'])=0D BMP_IMAGE_HEADER_STRUCT =3D struct.Struct('IHHIIIIHHIIIIII')=0D - BmpHeader =3D BMP_IMAGE_HEADER._make(BMP_IMAGE_HEADER_STRUCT.unpack_fr= om(Buffer[2:]))=0D + BmpHeader =3D BMP_IMAGE_HEADER._make(=0D + BMP_IMAGE_HEADER_STRUCT.unpack_from(Buffer[2:]))=0D #=0D # Doesn't support compress.=0D #=0D if BmpHeader.biCompression !=3D 0:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "The compress BMP f= ile %s is not support." % File.Path)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "The compress BMP file %s is not support." % File.= Path)=0D =0D # The Width and Height is UINT16 type in Image Package=0D if BmpHeader.biWidth > 0xFFFF:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "The BMP file %s Wi= dth is exceed 0xFFFF." % File.Path)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "The BMP file %s Width is exceed 0xFFFF." % File.P= ath)=0D if BmpHeader.biHeight > 0xFFFF:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "The BMP file %s He= ight is exceed 0xFFFF." % File.Path)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "The BMP file %s Height is exceed 0xFFFF." % File.= Path)=0D =0D PaletteBuffer =3D pack('x')=0D if BmpHeader.biBitCount =3D=3D 1:=0D @@ -1906,7 +2131,8 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Trans= Parent): ImageBuffer +=3D pack('B', PaletteIndex)=0D Width =3D (BmpHeader.biWidth + 7)//8=0D if BmpHeader.bfOffBits > BMP_IMAGE_HEADER_STRUCT.size + 2:=0D - PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size + 2 : Bm= pHeader.bfOffBits]=0D + PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size +=0D + 2: BmpHeader.bfOffBits]=0D elif BmpHeader.biBitCount =3D=3D 4:=0D if TransParent:=0D ImageBuffer =3D pack('B', EFI_HII_IIBT_IMAGE_4BIT_TRANS)=0D @@ -1915,7 +2141,8 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Trans= Parent): ImageBuffer +=3D pack('B', PaletteIndex)=0D Width =3D (BmpHeader.biWidth + 1)//2=0D if BmpHeader.bfOffBits > BMP_IMAGE_HEADER_STRUCT.size + 2:=0D - PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size + 2 : Bm= pHeader.bfOffBits]=0D + PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size +=0D + 2: BmpHeader.bfOffBits]=0D elif BmpHeader.biBitCount =3D=3D 8:=0D if TransParent:=0D ImageBuffer =3D pack('B', EFI_HII_IIBT_IMAGE_8BIT_TRANS)=0D @@ -1924,7 +2151,8 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Trans= Parent): ImageBuffer +=3D pack('B', PaletteIndex)=0D Width =3D BmpHeader.biWidth=0D if BmpHeader.bfOffBits > BMP_IMAGE_HEADER_STRUCT.size + 2:=0D - PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size + 2 : Bm= pHeader.bfOffBits]=0D + PaletteBuffer =3D Buffer[BMP_IMAGE_HEADER_STRUCT.size +=0D + 2: BmpHeader.bfOffBits]=0D elif BmpHeader.biBitCount =3D=3D 24:=0D if TransParent:=0D ImageBuffer =3D pack('B', EFI_HII_IIBT_IMAGE_24BIT_TRANS)=0D @@ -1932,7 +2160,8 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Trans= Parent): ImageBuffer =3D pack('B', EFI_HII_IIBT_IMAGE_24BIT)=0D Width =3D BmpHeader.biWidth * 3=0D else:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "Only support the 1= bit, 4 bit, 8bit, 24 bit BMP files.", ExtraData=3D"[%s]" % str(File.Path))= =0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "Only support the 1 bit, 4 bit, 8bit, 24 bit BMP f= iles.", ExtraData=3D"[%s]" % str(File.Path))=0D =0D ImageBuffer +=3D pack('H', BmpHeader.biWidth)=0D ImageBuffer +=3D pack('H', BmpHeader.biHeight)=0D @@ -1943,7 +2172,7 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Trans= Parent): Start =3D End + (Width % 4) - 4 - Width=0D else:=0D Start =3D End - Width=0D - ImageBuffer +=3D Buffer[Start + 1 : Start + Width + 1]=0D + ImageBuffer +=3D Buffer[Start + 1: Start + Width + 1]=0D End =3D Start=0D =0D # handle the Palette info, BMP use 4 bytes for R, G, B and Reserved i= nfo while EFI_HII_RGB_PIXEL only have the R, G, B info=0D @@ -1956,22 +2185,26 @@ def BmpImageDecoder(File, Buffer, PaletteIndex, Tra= nsParent): PaletteBuffer =3D PaletteTemp[1:]=0D return ImageBuffer, PaletteBuffer=0D =0D -## Create common code=0D +# Create common code=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateHeaderCode(Info, AutoGenC, AutoGenH):=0D # file header=0D - AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'})= )=0D + AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName': 'AutoGen.h'}= ))=0D # header file Prologue=0D - AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Gu= id':Info.Guid.replace('-', '_')}))=0D + AutoGenH.Append(gAutoGenHPrologueString.Replace(=0D + {'File': 'AUTOGENH', 'Guid': Info.Guid.replace('-', '_')}))=0D AutoGenH.Append(gAutoGenHCppPrologueString)=0D =0D # header files includes=0D if Info.ModuleType in gModuleTypeHeaderFile:=0D - AutoGenH.Append("#include <%s>\n" % gModuleTypeHeaderFile[Info.Mod= uleType][0])=0D + AutoGenH.Append("#include <%s>\n" %=0D + gModuleTypeHeaderFile[Info.ModuleType][0])=0D #=0D # if either PcdLib in [LibraryClasses] sections or there exist Pcd sec= tion, add PcdLib.h=0D # As if modules only uses FixedPcd, then PcdLib is not needed in [Libr= aryClasses] section.=0D @@ -1986,13 +2219,15 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): if Info.IsLibrary:=0D return=0D =0D - AutoGenH.Append("#define EFI_CALLER_ID_GUID \\\n %s\n" % GuidStringTo= GuidStructureString(Info.Guid))=0D - AutoGenH.Append("#define EDKII_DSC_PLATFORM_GUID \\\n %s\n" % GuidStr= ingToGuidStructureString(Info.PlatformInfo.Guid))=0D + AutoGenH.Append("#define EFI_CALLER_ID_GUID \\\n %s\n" %=0D + GuidStringToGuidStructureString(Info.Guid))=0D + AutoGenH.Append("#define EDKII_DSC_PLATFORM_GUID \\\n %s\n" %=0D + GuidStringToGuidStructureString(Info.PlatformInfo.Guid= ))=0D =0D if Info.IsLibrary:=0D return=0D # C file header=0D - AutoGenC.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.c'})= )=0D + AutoGenC.Append(gAutoGenHeaderString.Replace({'FileName': 'AutoGen.c'}= ))=0D # C file header files includes=0D if Info.ModuleType in gModuleTypeHeaderFile:=0D for Inc in gModuleTypeHeaderFile[Info.ModuleType]:=0D @@ -2003,20 +2238,25 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH): #=0D # Publish the CallerId Guid=0D #=0D - AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid= =3D %s;\n' % GuidStringToGuidStructureString(Info.Guid))=0D - AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEdkiiDscPlatfor= mGuid =3D %s;\n' % GuidStringToGuidStructureString(Info.PlatformInfo.Guid))= =0D - AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBase= Name =3D "%s";\n' % Info.Name)=0D + AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid= =3D %s;\n' %=0D + GuidStringToGuidStructureString(Info.Guid))=0D + AutoGenC.Append('\nGLOBAL_REMOVE_IF_UNREFERENCED GUID gEdkiiDscPlatfor= mGuid =3D %s;\n' %=0D + GuidStringToGuidStructureString(Info.PlatformInfo.Guid= ))=0D + AutoGenC.Append(=0D + '\nGLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *gEfiCallerBaseName =3D "%s= ";\n' % Info.Name)=0D =0D -## Create common code for header file=0D +# Create common code for header file=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D +=0D +=0D def CreateFooterCode(Info, AutoGenC, AutoGenH):=0D AutoGenH.Append(gAutoGenHEpilogueString)=0D =0D -## Create code for a module=0D +# Create code for a module=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D @@ -2028,6 +2268,8 @@ def CreateFooterCode(Info, AutoGenC, AutoGenH): # @param IdfGenCFlag IdfString is generated into AutoGen C file= when it is set to True=0D # @param IdfGenBinBuffer Buffer to store Idf string package data=0D #=0D +=0D +=0D def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBu= ffer, StringIdf, IdfGenCFlag, IdfGenBinBuffer):=0D CreateHeaderCode(Info, AutoGenC, AutoGenH)=0D =0D @@ -2042,25 +2284,34 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, U= niGenCFlag, UniGenBinBuffer, =0D if Info.UnicodeFileList:=0D FileName =3D "%sStrDefs.h" % Info.Name=0D - StringH.Append(gAutoGenHeaderString.Replace({'FileName':FileName})= )=0D - StringH.Append(gAutoGenHPrologueString.Replace({'File':'STRDEFS', = 'Guid':Info.Guid.replace('-', '_')}))=0D - CreateUnicodeStringCode(Info, AutoGenC, StringH, UniGenCFlag, UniG= enBinBuffer)=0D + StringH.Append(gAutoGenHeaderString.Replace({'FileName': FileName}= ))=0D + StringH.Append(gAutoGenHPrologueString.Replace(=0D + {'File': 'STRDEFS', 'Guid': Info.Guid.replace('-', '_')}))=0D + CreateUnicodeStringCode(Info, AutoGenC, StringH,=0D + UniGenCFlag, UniGenBinBuffer)=0D =0D GuidMacros =3D []=0D for Guid in Info.Module.Guids:=0D if Guid in Info.Module.GetGuidsUsedByPcd():=0D continue=0D - GuidMacros.append('#define %s %s' % (Guid, Info.Module.Guids[G= uid]))=0D + GuidMacros.append('#define %s %s' %=0D + (Guid, Info.Module.Guids[Guid]))=0D for Guid, Value in list(Info.Module.Protocols.items()) + list(Info= .Module.Ppis.items()):=0D GuidMacros.append('#define %s %s' % (Guid, Value))=0D # supports FixedAtBuild and FeaturePcd usage in VFR file=0D if Info.VfrFileList and Info.ModulePcdList:=0D - GuidMacros.append('#define %s %s' % ('FixedPcdGetBool(TokenNam= e)', '_PCD_VALUE_##TokenName'))=0D - GuidMacros.append('#define %s %s' % ('FixedPcdGet8(TokenName)'= , '_PCD_VALUE_##TokenName'))=0D - GuidMacros.append('#define %s %s' % ('FixedPcdGet16(TokenName)= ', '_PCD_VALUE_##TokenName'))=0D - GuidMacros.append('#define %s %s' % ('FixedPcdGet32(TokenName)= ', '_PCD_VALUE_##TokenName'))=0D - GuidMacros.append('#define %s %s' % ('FixedPcdGet64(TokenName)= ', '_PCD_VALUE_##TokenName'))=0D - GuidMacros.append('#define %s %s' % ('FeaturePcdGet(TokenName)= ', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FixedPcdGetBool(TokenName)', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FixedPcdGet8(TokenName)', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FixedPcdGet16(TokenName)', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FixedPcdGet32(TokenName)', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FixedPcdGet64(TokenName)', '_PCD_VALUE_##TokenName'))=0D + GuidMacros.append('#define %s %s' % (=0D + 'FeaturePcdGet(TokenName)', '_PCD_VALUE_##TokenName'))=0D for Pcd in Info.ModulePcdList:=0D if Pcd.Type in [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_FEATURE_= FLAG]:=0D TokenCName =3D Pcd.TokenCName=0D @@ -2075,29 +2326,33 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, U= niGenCFlag, UniGenBinBuffer, if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in Gl= obalData.MixedPcd[PcdItem]:=0D TokenCName =3D PcdItem[0]=0D break=0D - GuidMacros.append('#define %s %s' % ('_PCD_VALUE_'+Tok= enCName, Value))=0D + GuidMacros.append('#define %s %s' %=0D + ('_PCD_VALUE_'+TokenCName, Value))=0D =0D if Info.IdfFileList:=0D GuidMacros.append('#include "%sImgDefs.h"' % Info.Name)=0D =0D if GuidMacros:=0D - StringH.Append('\n#ifdef VFRCOMPILE\n%s\n#endif\n' % '\n'.join= (GuidMacros))=0D + StringH.Append('\n#ifdef VFRCOMPILE\n%s\n#endif\n' %=0D + '\n'.join(GuidMacros))=0D =0D StringH.Append("\n#endif\n")=0D AutoGenH.Append('#include "%s"\n' % FileName)=0D =0D if Info.IdfFileList:=0D FileName =3D "%sImgDefs.h" % Info.Name=0D - StringIdf.Append(gAutoGenHeaderString.Replace({'FileName':FileName= }))=0D - StringIdf.Append(gAutoGenHPrologueString.Replace({'File':'IMAGEDEF= S', 'Guid':Info.Guid.replace('-', '_')}))=0D - CreateIdfFileCode(Info, AutoGenC, StringIdf, IdfGenCFlag, IdfGenBi= nBuffer)=0D + StringIdf.Append(gAutoGenHeaderString.Replace({'FileName': FileNam= e}))=0D + StringIdf.Append(gAutoGenHPrologueString.Replace(=0D + {'File': 'IMAGEDEFS', 'Guid': Info.Guid.replace('-', '_')}))=0D + CreateIdfFileCode(Info, AutoGenC, StringIdf,=0D + IdfGenCFlag, IdfGenBinBuffer)=0D =0D StringIdf.Append("\n#endif\n")=0D AutoGenH.Append('#include "%s"\n' % FileName)=0D =0D CreateFooterCode(Info, AutoGenC, AutoGenH)=0D =0D -## Create the code file=0D +# Create the code file=0D #=0D # @param FilePath The path of code file=0D # @param Content The content of code file=0D @@ -2106,6 +2361,7 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, Uni= GenCFlag, UniGenBinBuffer, # @retval True If file content is changed or file doesn't exi= st=0D # @retval False If the file exists and the content is not chan= ged=0D #=0D +=0D +=0D def Generate(FilePath, Content, IsBinaryFile):=0D return SaveFileOnChange(FilePath, Content, IsBinaryFile)=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/GenDepex.py b/BaseTools/Source= /Python/AutoGen/GenDepex.py index f2f2e9d65b5f..31be6e897cb9 100644 --- a/BaseTools/Source/Python/AutoGen/GenDepex.py +++ b/BaseTools/Source/Python/AutoGen/GenDepex.py @@ -1,10 +1,10 @@ -## @file=0D +# @file=0D # This file is used to generate DEPEX file for module's dependency express= ion=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D import sys=0D import Common.LongFilePathOs as os=0D @@ -22,113 +22,120 @@ from Common import EdkLogger as EdkLogger from Common.BuildVersion import gBUILD_VERSION=0D from Common.DataType import *=0D =0D -## Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END"=0D +# Regular expression for matching "DEPENDENCY_START ... DEPENDENCY_END"=0D gStartClosePattern =3D re.compile(".*DEPENDENCY_START(.+)DEPENDENCY_END.*"= , re.S)=0D =0D -## Mapping between module type and EFI phase=0D +# Mapping between module type and EFI phase=0D gType2Phase =3D {=0D - SUP_MODULE_BASE : None,=0D - SUP_MODULE_SEC : "PEI",=0D - SUP_MODULE_PEI_CORE : "PEI",=0D - SUP_MODULE_PEIM : "PEI",=0D - SUP_MODULE_DXE_CORE : "DXE",=0D - SUP_MODULE_DXE_DRIVER : "DXE",=0D - SUP_MODULE_DXE_SMM_DRIVER : "DXE",=0D + SUP_MODULE_BASE: None,=0D + SUP_MODULE_SEC: "PEI",=0D + SUP_MODULE_PEI_CORE: "PEI",=0D + SUP_MODULE_PEIM: "PEI",=0D + SUP_MODULE_DXE_CORE: "DXE",=0D + SUP_MODULE_DXE_DRIVER: "DXE",=0D + SUP_MODULE_DXE_SMM_DRIVER: "DXE",=0D SUP_MODULE_DXE_RUNTIME_DRIVER: "DXE",=0D - SUP_MODULE_DXE_SAL_DRIVER : "DXE",=0D - SUP_MODULE_UEFI_DRIVER : "DXE",=0D - SUP_MODULE_UEFI_APPLICATION : "DXE",=0D - SUP_MODULE_SMM_CORE : "DXE",=0D - SUP_MODULE_MM_STANDALONE : "MM",=0D - SUP_MODULE_MM_CORE_STANDALONE : "MM",=0D + SUP_MODULE_DXE_SAL_DRIVER: "DXE",=0D + SUP_MODULE_UEFI_DRIVER: "DXE",=0D + SUP_MODULE_UEFI_APPLICATION: "DXE",=0D + SUP_MODULE_SMM_CORE: "DXE",=0D + SUP_MODULE_MM_STANDALONE: "MM",=0D + SUP_MODULE_MM_CORE_STANDALONE: "MM",=0D }=0D =0D -## Convert dependency expression string into EFI internal representation=0D +# Convert dependency expression string into EFI internal representation=0D #=0D # DependencyExpression class is used to parse dependency expression stri= ng and=0D # convert it into its binary form.=0D #=0D +=0D +=0D class DependencyExpression:=0D =0D ArchProtocols =3D {=0D - '665e3ff6-46cc-11d4-9a38-0090273fc14d', # 'g= EfiBdsArchProtocolGuid'=0D - '26baccb1-6f42-11d4-bce7-0080c73c8881', # 'g= EfiCpuArchProtocolGuid'=0D - '26baccb2-6f42-11d4-bce7-0080c73c8881', # 'g= EfiMetronomeArchProtocolGuid'=0D - '1da97072-bddc-4b30-99f1-72a0b56fff2a', # 'g= EfiMonotonicCounterArchProtocolGuid'=0D - '27cfac87-46cc-11d4-9a38-0090273fc14d', # 'g= EfiRealTimeClockArchProtocolGuid'=0D - '27cfac88-46cc-11d4-9a38-0090273fc14d', # 'g= EfiResetArchProtocolGuid'=0D - 'b7dfb4e1-052f-449f-87be-9818fc91b733', # 'g= EfiRuntimeArchProtocolGuid'=0D - 'a46423e3-4617-49f1-b9ff-d1bfa9115839', # 'g= EfiSecurityArchProtocolGuid'=0D - '26baccb3-6f42-11d4-bce7-0080c73c8881', # 'g= EfiTimerArchProtocolGuid'=0D - '6441f818-6362-4e44-b570-7dba31dd2453', # 'g= EfiVariableWriteArchProtocolGuid'=0D - '1e5668e2-8481-11d4-bcf1-0080c73c8881', # 'g= EfiVariableArchProtocolGuid'=0D - '665e3ff5-46cc-11d4-9a38-0090273fc14d' # 'g= EfiWatchdogTimerArchProtocolGuid'=0D - }=0D + '665e3ff6-46cc-11d4-9a38-0090273fc14d', # 'gEfiBdsArchProtocolGui= d'=0D + '26baccb1-6f42-11d4-bce7-0080c73c8881', # 'gEfiCpuArchProtocolGui= d'=0D + '26baccb2-6f42-11d4-bce7-0080c73c8881', # 'gEfiMetronomeArchProto= colGuid'=0D + # 'gEfiMonotonicCounterArchProtocolGuid'=0D + '1da97072-bddc-4b30-99f1-72a0b56fff2a',=0D + '27cfac87-46cc-11d4-9a38-0090273fc14d', # 'gEfiRealTimeClockArchP= rotocolGuid'=0D + '27cfac88-46cc-11d4-9a38-0090273fc14d', # 'gEfiResetArchProtocolG= uid'=0D + 'b7dfb4e1-052f-449f-87be-9818fc91b733', # 'gEfiRuntimeArchProtoco= lGuid'=0D + 'a46423e3-4617-49f1-b9ff-d1bfa9115839', # 'gEfiSecurityArchProtoc= olGuid'=0D + '26baccb3-6f42-11d4-bce7-0080c73c8881', # 'gEfiTimerArchProtocolG= uid'=0D + '6441f818-6362-4e44-b570-7dba31dd2453', # 'gEfiVariableWriteArchP= rotocolGuid'=0D + '1e5668e2-8481-11d4-bcf1-0080c73c8881', # 'gEfiVariableArchProtoc= olGuid'=0D + '665e3ff5-46cc-11d4-9a38-0090273fc14d' # 'gEfiWatchdogTimerArchPr= otocolGuid'=0D + }=0D =0D OpcodePriority =3D {=0D - DEPEX_OPCODE_AND : 1,=0D - DEPEX_OPCODE_OR : 1,=0D - DEPEX_OPCODE_NOT : 2,=0D + DEPEX_OPCODE_AND: 1,=0D + DEPEX_OPCODE_OR: 1,=0D + DEPEX_OPCODE_NOT: 2,=0D }=0D =0D Opcode =3D {=0D - "PEI" : {=0D - DEPEX_OPCODE_PUSH : 0x02,=0D - DEPEX_OPCODE_AND : 0x03,=0D - DEPEX_OPCODE_OR : 0x04,=0D - DEPEX_OPCODE_NOT : 0x05,=0D - DEPEX_OPCODE_TRUE : 0x06,=0D - DEPEX_OPCODE_FALSE : 0x07,=0D - DEPEX_OPCODE_END : 0x08=0D + "PEI": {=0D + DEPEX_OPCODE_PUSH: 0x02,=0D + DEPEX_OPCODE_AND: 0x03,=0D + DEPEX_OPCODE_OR: 0x04,=0D + DEPEX_OPCODE_NOT: 0x05,=0D + DEPEX_OPCODE_TRUE: 0x06,=0D + DEPEX_OPCODE_FALSE: 0x07,=0D + DEPEX_OPCODE_END: 0x08=0D },=0D =0D - "DXE" : {=0D + "DXE": {=0D DEPEX_OPCODE_BEFORE: 0x00,=0D - DEPEX_OPCODE_AFTER : 0x01,=0D - DEPEX_OPCODE_PUSH : 0x02,=0D - DEPEX_OPCODE_AND : 0x03,=0D - DEPEX_OPCODE_OR : 0x04,=0D - DEPEX_OPCODE_NOT : 0x05,=0D - DEPEX_OPCODE_TRUE : 0x06,=0D - DEPEX_OPCODE_FALSE : 0x07,=0D - DEPEX_OPCODE_END : 0x08,=0D - DEPEX_OPCODE_SOR : 0x09=0D + DEPEX_OPCODE_AFTER: 0x01,=0D + DEPEX_OPCODE_PUSH: 0x02,=0D + DEPEX_OPCODE_AND: 0x03,=0D + DEPEX_OPCODE_OR: 0x04,=0D + DEPEX_OPCODE_NOT: 0x05,=0D + DEPEX_OPCODE_TRUE: 0x06,=0D + DEPEX_OPCODE_FALSE: 0x07,=0D + DEPEX_OPCODE_END: 0x08,=0D + DEPEX_OPCODE_SOR: 0x09=0D },=0D =0D - "MM" : {=0D + "MM": {=0D DEPEX_OPCODE_BEFORE: 0x00,=0D - DEPEX_OPCODE_AFTER : 0x01,=0D - DEPEX_OPCODE_PUSH : 0x02,=0D - DEPEX_OPCODE_AND : 0x03,=0D - DEPEX_OPCODE_OR : 0x04,=0D - DEPEX_OPCODE_NOT : 0x05,=0D - DEPEX_OPCODE_TRUE : 0x06,=0D - DEPEX_OPCODE_FALSE : 0x07,=0D - DEPEX_OPCODE_END : 0x08,=0D - DEPEX_OPCODE_SOR : 0x09=0D + DEPEX_OPCODE_AFTER: 0x01,=0D + DEPEX_OPCODE_PUSH: 0x02,=0D + DEPEX_OPCODE_AND: 0x03,=0D + DEPEX_OPCODE_OR: 0x04,=0D + DEPEX_OPCODE_NOT: 0x05,=0D + DEPEX_OPCODE_TRUE: 0x06,=0D + DEPEX_OPCODE_FALSE: 0x07,=0D + DEPEX_OPCODE_END: 0x08,=0D + DEPEX_OPCODE_SOR: 0x09=0D }=0D }=0D =0D # all supported op codes and operands=0D - 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]=0D + SupportedOpcode =3D [DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER, DEPEX_OP= CODE_PUSH,=0D + DEPEX_OPCODE_AND, DEPEX_OPCODE_OR, DEPEX_OPCODE_NOT= , DEPEX_OPCODE_END, DEPEX_OPCODE_SOR]=0D SupportedOperand =3D [DEPEX_OPCODE_TRUE, DEPEX_OPCODE_FALSE]=0D =0D - OpcodeWithSingleOperand =3D [DEPEX_OPCODE_NOT, DEPEX_OPCODE_BEFORE, DE= PEX_OPCODE_AFTER]=0D + OpcodeWithSingleOperand =3D [DEPEX_OPCODE_NOT,=0D + DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER]=0D OpcodeWithTwoOperand =3D [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR]=0D =0D # op code that should not be the last one=0D - NonEndingOpcode =3D [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR, DEPEX_OPCODE_N= OT, DEPEX_OPCODE_SOR]=0D + NonEndingOpcode =3D [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR,=0D + DEPEX_OPCODE_NOT, DEPEX_OPCODE_SOR]=0D # op code must not present at the same time=0D ExclusiveOpcode =3D [DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER]=0D # op code that should be the first one if it presents=0D - AboveAllOpcode =3D [DEPEX_OPCODE_SOR, DEPEX_OPCODE_BEFORE, DEPEX_OPCOD= E_AFTER]=0D + AboveAllOpcode =3D [DEPEX_OPCODE_SOR,=0D + DEPEX_OPCODE_BEFORE, DEPEX_OPCODE_AFTER]=0D =0D #=0D # open and close brace must be taken as individual tokens=0D #=0D TokenPattern =3D re.compile("(\(|\)|\{[^{}]+\{?[^{}]+\}?[ ]*\}|\w+)")= =0D =0D - ## Constructor=0D + # Constructor=0D #=0D # @param Expression The list or string of dependency expression=0D # @param ModuleType The type of the module using the dependency ex= pression=0D @@ -152,7 +159,8 @@ class DependencyExpression: EdkLogger.debug(EdkLogger.DEBUG_8, repr(self))=0D if Optimize:=0D self.Optimize()=0D - EdkLogger.debug(EdkLogger.DEBUG_8, "\n Optimized: " + repr(= self))=0D + EdkLogger.debug(EdkLogger.DEBUG_8,=0D + "\n Optimized: " + repr(self))=0D =0D def __str__(self):=0D return " ".join(self.TokenList)=0D @@ -166,11 +174,11 @@ class DependencyExpression: WellForm +=3D ' ' + Token=0D return WellForm=0D =0D - ## Split the expression string into token list=0D + # Split the expression string into token list=0D def GetExpressionTokenList(self):=0D self.TokenList =3D self.TokenPattern.findall(self.ExpressionString= )=0D =0D - ## Convert token list into postfix notation=0D + # Convert token list into postfix notation=0D def GetPostfixNotation(self):=0D Stack =3D []=0D LastToken =3D ''=0D @@ -198,8 +206,8 @@ class DependencyExpression: EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid= dependency expression: missing operator before NOT",=0D ExtraData=3D"Near %s" % LastToken)= =0D elif LastToken in self.SupportedOpcode + ['(', '', None]:= =0D - EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid= dependency expression: missing operand before " + Token,=0D - ExtraData=3D"Near %s" % LastToken)= =0D + EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid dep= endency expression: missing operand before " + Token,=0D + ExtraData=3D"Near %s" % LastToken)=0D =0D while len(Stack) > 0:=0D if Stack[-1] =3D=3D "(" or self.OpcodePriority[Token] = >=3D self.OpcodePriority[Stack[-1]]:=0D @@ -223,7 +231,8 @@ class DependencyExpression: self.OpcodeList.append(Token)=0D else:=0D EdkLogger.error("GenDepex", PARSER_ERROR,=0D - "Opcode=3D%s doesn't supported in %s s= tage " % (Token, self.Phase),=0D + "Opcode=3D%s doesn't supported in %s s= tage " % (=0D + Token, self.Phase),=0D ExtraData=3Dstr(self))=0D self.PostfixNotation.append(Token)=0D LastToken =3D Token=0D @@ -237,7 +246,7 @@ class DependencyExpression: if self.PostfixNotation[-1] !=3D DEPEX_OPCODE_END:=0D self.PostfixNotation.append(DEPEX_OPCODE_END)=0D =0D - ## Validate the dependency expression=0D + # Validate the dependency expression=0D def ValidateOpcode(self):=0D for Op in self.AboveAllOpcode:=0D if Op in self.PostfixNotation:=0D @@ -265,14 +274,14 @@ class DependencyExpression: EdkLogger.error("GenDepex", PARSER_ERROR, "Extra expressions a= fter END",=0D ExtraData=3Dstr(self))=0D =0D - ## Simply optimize the dependency expression by removing duplicated op= erands=0D + # Simply optimize the dependency expression by removing duplicated ope= rands=0D def Optimize(self):=0D OpcodeSet =3D set(self.OpcodeList)=0D # if there are isn't one in the set, return=0D if len(OpcodeSet) !=3D 1:=0D - return=0D + return=0D Op =3D OpcodeSet.pop()=0D - #if Op isn't either OR or AND, return=0D + # if Op isn't either OR or AND, return=0D if Op not in [DEPEX_OPCODE_AND, DEPEX_OPCODE_OR]:=0D return=0D NewOperand =3D []=0D @@ -319,25 +328,29 @@ class DependencyExpression: self.PostfixNotation =3D []=0D self.GetPostfixNotation()=0D =0D -=0D - ## Convert a GUID value in C structure format into its binary form=0D + # Convert a GUID value in C structure format into its binary form=0D #=0D # @param Guid The GUID value in C structure format=0D #=0D # @retval array The byte array representing the GUID value=0D #=0D +=0D def GetGuidValue(self, Guid):=0D - GuidValueString =3D Guid.replace("{", "").replace("}", "").replace= (" ", "")=0D + GuidValueString =3D Guid.replace(=0D + "{", "").replace("}", "").replace(" ", "")=0D GuidValueList =3D GuidValueString.split(",")=0D if len(GuidValueList) !=3D 11 and len(GuidValueList) =3D=3D 16:=0D - GuidValueString =3D GuidStringToGuidStructureString(GuidStruct= ureByteArrayToGuidString(Guid))=0D - GuidValueString =3D GuidValueString.replace("{", "").replace("= }", "").replace(" ", "")=0D + GuidValueString =3D GuidStringToGuidStructureString(=0D + GuidStructureByteArrayToGuidString(Guid))=0D + GuidValueString =3D GuidValueString.replace(=0D + "{", "").replace("}", "").replace(" ", "")=0D GuidValueList =3D GuidValueString.split(",")=0D if len(GuidValueList) !=3D 11:=0D - EdkLogger.error("GenDepex", PARSER_ERROR, "Invalid GUID value = string or opcode: %s" % Guid)=0D + EdkLogger.error("GenDepex", PARSER_ERROR,=0D + "Invalid GUID value string or opcode: %s" % Gu= id)=0D return pack("1I2H8B", *(int(value, 16) for value in GuidValueList)= )=0D =0D - ## Save the binary form of dependency expression in file=0D + # Save the binary form of dependency expression in file=0D #=0D # @param File The path of file. If None is given, put the data o= n console=0D #=0D @@ -354,7 +367,8 @@ class DependencyExpression: Buffer.write(pack("B", self.Opcode[self.Phase][Item]))=0D elif Item in self.SupportedOpcode:=0D EdkLogger.error("GenDepex", FORMAT_INVALID,=0D - "Opcode [%s] is not expected in %s phase" = % (Item, self.Phase),=0D + "Opcode [%s] is not expected in %s phase" = % (=0D + Item, self.Phase),=0D ExtraData=3Dself.ExpressionString)=0D else:=0D Buffer.write(self.GetGuidValue(Item))=0D @@ -370,19 +384,23 @@ class DependencyExpression: Buffer.close()=0D return FileChangeFlag=0D =0D +=0D versionNumber =3D ("0.04" + " " + gBUILD_VERSION)=0D __version__ =3D "%prog Version " + versionNumber=0D __copyright__ =3D "Copyright (c) 2007-2018, Intel Corporation All rights = reserved."=0D __usage__ =3D "%prog [options] [dependency_expression_file]"=0D =0D -## Parse command line options=0D +# Parse command line options=0D #=0D # @retval OptionParser=0D #=0D +=0D +=0D def GetOptions():=0D from optparse import OptionParser=0D =0D - Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__, usage=3D__usage__)=0D + Parser =3D OptionParser(description=3D__copyright__,=0D + version=3D__version__, usage=3D__usage__)=0D =0D Parser.add_option("-o", "--output", dest=3D"OutputFile", default=3DNon= e, metavar=3D"FILE",=0D help=3D"Specify the name of depex file to be generat= ed")=0D @@ -394,14 +412,15 @@ def GetOptions(): help=3D"Do some simple optimization on the expressio= n.")=0D Parser.add_option("-v", "--verbose", dest=3D"verbose", default=3DFalse= , action=3D"store_true",=0D help=3D"build with verbose information")=0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int", hel= p=3D"Enable debug messages at specified level.")=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",=0D + help=3D"Enable debug messages at specified level.")= =0D Parser.add_option("-q", "--quiet", dest=3D"quiet", default=3DFalse, ac= tion=3D"store_true",=0D help=3D"build with little information")=0D =0D return Parser.parse_args()=0D =0D =0D -## Entrance method=0D +# Entrance method=0D #=0D # @retval 0 Tool was successful=0D # @retval 1 Tool failed=0D @@ -422,12 +441,14 @@ def Main(): =0D try:=0D if Option.ModuleType is None or Option.ModuleType not in gType2Pha= se:=0D - EdkLogger.error("GenDepex", OPTION_MISSING, "Module type is no= t specified or supported")=0D + EdkLogger.error("GenDepex", OPTION_MISSING,=0D + "Module type is not specified or supported")=0D =0D DxsFile =3D ''=0D if len(Input) > 0 and Option.Expression =3D=3D "":=0D DxsFile =3D Input[0]=0D - DxsString =3D open(DxsFile, 'r').read().replace("\n", " ").rep= lace("\r", " ")=0D + DxsString =3D open(DxsFile, 'r').read().replace(=0D + "\n", " ").replace("\r", " ")=0D DxsString =3D gStartClosePattern.sub("\\1", DxsString)=0D elif Option.Expression !=3D "":=0D if Option.Expression[0] =3D=3D '"':=0D @@ -435,9 +456,11 @@ def Main(): else:=0D DxsString =3D Option.Expression=0D else:=0D - EdkLogger.error("GenDepex", OPTION_MISSING, "No expression str= ing or file given")=0D + EdkLogger.error("GenDepex", OPTION_MISSING,=0D + "No expression string or file given")=0D =0D - Dpx =3D DependencyExpression(DxsString, Option.ModuleType, Option.= Optimize)=0D + Dpx =3D DependencyExpression(=0D + DxsString, Option.ModuleType, Option.Optimize)=0D if Option.OutputFile is not None:=0D FileChangeFlag =3D Dpx.Generate(Option.OutputFile)=0D if not FileChangeFlag and DxsFile:=0D @@ -459,6 +482,6 @@ def Main(): =0D return 0=0D =0D +=0D if __name__ =3D=3D '__main__':=0D sys.exit(Main())=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index daec9c6d54b2..acbc3056d918 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
        =0D @@ -6,7 +6,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import absolute_import=0D import Common.LongFilePathOs as os=0D @@ -24,33 +24,34 @@ import Common.GlobalData as GlobalData from collections import OrderedDict=0D from Common.DataType import TAB_COMPILER_MSFT=0D =0D -## Regular expression for finding header file inclusions=0D -gIncludePattern =3D re.compile(r"^[ \t]*[#%]?[ \t]*include(?:[ \t]*(?:\\(?= :\r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)= ?)", re.MULTILINE | re.UNICODE | re.IGNORECASE)=0D +# Regular expression for finding header file inclusions=0D +gIncludePattern =3D re.compile(=0D + r"^[ \t]*[#%]?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(= ?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNIC= ODE | re.IGNORECASE)=0D =0D -## Regular expression for matching macro used in header file inclusion=0D +# Regular expression for matching macro used in header file inclusion=0D gMacroPattern =3D re.compile("([_A-Z][_A-Z0-9]*)[ \t]*\((.+)\)", re.UNICOD= E)=0D =0D gIsFileMap =3D {}=0D =0D -## pattern for include style in Edk.x code=0D +# pattern for include style in Edk.x code=0D gProtocolDefinition =3D "Protocol/%(HeaderKey)s/%(HeaderKey)s.h"=0D gGuidDefinition =3D "Guid/%(HeaderKey)s/%(HeaderKey)s.h"=0D gArchProtocolDefinition =3D "ArchProtocol/%(HeaderKey)s/%(HeaderKey)s.h"=0D gPpiDefinition =3D "Ppi/%(HeaderKey)s/%(HeaderKey)s.h"=0D gIncludeMacroConversion =3D {=0D - "EFI_PROTOCOL_DEFINITION" : gProtocolDefinition,=0D - "EFI_GUID_DEFINITION" : gGuidDefinition,=0D - "EFI_ARCH_PROTOCOL_DEFINITION" : gArchProtocolDefinition,=0D - "EFI_PROTOCOL_PRODUCER" : gProtocolDefinition,=0D - "EFI_PROTOCOL_CONSUMER" : gProtocolDefinition,=0D - "EFI_PROTOCOL_DEPENDENCY" : gProtocolDefinition,=0D - "EFI_ARCH_PROTOCOL_PRODUCER" : gArchProtocolDefinition,=0D - "EFI_ARCH_PROTOCOL_CONSUMER" : gArchProtocolDefinition,=0D - "EFI_ARCH_PROTOCOL_DEPENDENCY" : gArchProtocolDefinition,=0D - "EFI_PPI_DEFINITION" : gPpiDefinition,=0D - "EFI_PPI_PRODUCER" : gPpiDefinition,=0D - "EFI_PPI_CONSUMER" : gPpiDefinition,=0D - "EFI_PPI_DEPENDENCY" : gPpiDefinition,=0D + "EFI_PROTOCOL_DEFINITION": gProtocolDefinition,=0D + "EFI_GUID_DEFINITION": gGuidDefinition,=0D + "EFI_ARCH_PROTOCOL_DEFINITION": gArchProtocolDefinition,=0D + "EFI_PROTOCOL_PRODUCER": gProtocolDefinition,=0D + "EFI_PROTOCOL_CONSUMER": gProtocolDefinition,=0D + "EFI_PROTOCOL_DEPENDENCY": gProtocolDefinition,=0D + "EFI_ARCH_PROTOCOL_PRODUCER": gArchProtocolDefinition,=0D + "EFI_ARCH_PROTOCOL_CONSUMER": gArchProtocolDefinition,=0D + "EFI_ARCH_PROTOCOL_DEPENDENCY": gArchProtocolDefinition,=0D + "EFI_PPI_DEFINITION": gPpiDefinition,=0D + "EFI_PPI_PRODUCER": gPpiDefinition,=0D + "EFI_PPI_CONSUMER": gPpiDefinition,=0D + "EFI_PPI_DEPENDENCY": gPpiDefinition,=0D }=0D =0D NMAKE_FILETYPE =3D "nmake"=0D @@ -58,21 +59,23 @@ GMAKE_FILETYPE =3D "gmake" WIN32_PLATFORM =3D "win32"=0D POSIX_PLATFORM =3D "posix"=0D =0D -## BuildFile class=0D +# BuildFile class=0D #=0D # This base class encapsules build file and its generation. It uses templ= ate to generate=0D # the content of build file. The content of build file will be got from A= utoGen objects.=0D #=0D +=0D +=0D class BuildFile(object):=0D - ## template used to generate the build file (i.e. makefile if using ma= ke)=0D + # template used to generate the build file (i.e. makefile if using mak= e)=0D _TEMPLATE_ =3D TemplateString('')=0D =0D _DEFAULT_FILE_NAME_ =3D "Makefile"=0D =0D - ## default file name for each type of build file=0D + # default file name for each type of build file=0D _FILE_NAME_ =3D {=0D - NMAKE_FILETYPE : "Makefile",=0D - GMAKE_FILETYPE : "GNUmakefile"=0D + NMAKE_FILETYPE: "Makefile",=0D + GMAKE_FILETYPE: "GNUmakefile"=0D }=0D =0D # Get Makefile name.=0D @@ -82,7 +85,7 @@ class BuildFile(object): else:=0D return self._FILE_NAME_[self._FileType]=0D =0D - ## Fixed header string for makefile=0D + # Fixed header string for makefile=0D _MAKEFILE_HEADER =3D '''#=0D # DO NOT EDIT=0D # This file is auto-generated by build utility=0D @@ -97,13 +100,13 @@ class BuildFile(object): #=0D '''=0D =0D - ## Header string for each type of build file=0D + # Header string for each type of build file=0D _FILE_HEADER_ =3D {=0D - NMAKE_FILETYPE : _MAKEFILE_HEADER % _FILE_NAME_[NMAKE_FILETYPE],= =0D - GMAKE_FILETYPE : _MAKEFILE_HEADER % _FILE_NAME_[GMAKE_FILETYPE]= =0D + NMAKE_FILETYPE: _MAKEFILE_HEADER % _FILE_NAME_[NMAKE_FILETYPE],= =0D + GMAKE_FILETYPE: _MAKEFILE_HEADER % _FILE_NAME_[GMAKE_FILETYPE]=0D }=0D =0D - ## shell commands which can be used in build file in the form of macro= =0D + # shell commands which can be used in build file in the form of macro= =0D # $(CP) copy file command=0D # $(MV) move file command=0D # $(RM) remove file command=0D @@ -111,64 +114,65 @@ class BuildFile(object): # $(RD) remove dir command=0D #=0D _SHELL_CMD_ =3D {=0D - WIN32_PLATFORM : {=0D - "CP" : "copy /y",=0D - "MV" : "move /y",=0D - "RM" : "del /f /q",=0D - "MD" : "mkdir",=0D - "RD" : "rmdir /s /q",=0D + WIN32_PLATFORM: {=0D + "CP": "copy /y",=0D + "MV": "move /y",=0D + "RM": "del /f /q",=0D + "MD": "mkdir",=0D + "RD": "rmdir /s /q",=0D },=0D =0D - POSIX_PLATFORM : {=0D - "CP" : "cp -p -f",=0D - "MV" : "mv -f",=0D - "RM" : "rm -f",=0D - "MD" : "mkdir -p",=0D - "RD" : "rm -r -f",=0D + POSIX_PLATFORM: {=0D + "CP": "cp -p -f",=0D + "MV": "mv -f",=0D + "RM": "rm -f",=0D + "MD": "mkdir -p",=0D + "RD": "rm -r -f",=0D }=0D }=0D =0D - ## directory separator=0D + # directory separator=0D _SEP_ =3D {=0D - WIN32_PLATFORM : "\\",=0D - POSIX_PLATFORM : "/"=0D + WIN32_PLATFORM: "\\",=0D + POSIX_PLATFORM: "/"=0D }=0D =0D - ## directory creation template=0D + # directory creation template=0D _MD_TEMPLATE_ =3D {=0D - WIN32_PLATFORM : 'if not exist %(dir)s $(MD) %(dir)s',=0D - POSIX_PLATFORM : "$(MD) %(dir)s"=0D + WIN32_PLATFORM: 'if not exist %(dir)s $(MD) %(dir)s',=0D + POSIX_PLATFORM: "$(MD) %(dir)s"=0D }=0D =0D - ## directory removal template=0D + # directory removal template=0D _RD_TEMPLATE_ =3D {=0D - WIN32_PLATFORM : 'if exist %(dir)s $(RD) %(dir)s',=0D - POSIX_PLATFORM : "$(RD) %(dir)s"=0D + WIN32_PLATFORM: 'if exist %(dir)s $(RD) %(dir)s',=0D + POSIX_PLATFORM: "$(RD) %(dir)s"=0D }=0D - ## cp if exist=0D + # cp if exist=0D _CP_TEMPLATE_ =3D {=0D - WIN32_PLATFORM : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s',=0D - POSIX_PLATFORM : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s"=0D + WIN32_PLATFORM: 'if exist %(Src)s $(CP) %(Src)s %(Dst)s',=0D + POSIX_PLATFORM: "test -f %(Src)s && $(CP) %(Src)s %(Dst)s"=0D }=0D =0D _CD_TEMPLATE_ =3D {=0D - WIN32_PLATFORM : 'if exist %(dir)s cd %(dir)s',=0D - POSIX_PLATFORM : "test -e %(dir)s && cd %(dir)s"=0D + WIN32_PLATFORM: 'if exist %(dir)s cd %(dir)s',=0D + POSIX_PLATFORM: "test -e %(dir)s && cd %(dir)s"=0D }=0D =0D _MAKE_TEMPLATE_ =3D {=0D - WIN32_PLATFORM : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %= (file)s',=0D - POSIX_PLATFORM : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f= %(file)s'=0D + WIN32_PLATFORM: 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(= file)s',=0D + POSIX_PLATFORM: 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f = %(file)s'=0D }=0D =0D _INCLUDE_CMD_ =3D {=0D - NMAKE_FILETYPE : '!INCLUDE',=0D - GMAKE_FILETYPE : "include"=0D + NMAKE_FILETYPE: '!INCLUDE',=0D + GMAKE_FILETYPE: "include"=0D }=0D =0D - _INC_FLAG_ =3D {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-I"= , "NASM" : "-I"}=0D + _INC_FLAG_ =3D {TAB_COMPILER_MSFT: "/I",=0D + "GCC": "-I", "INTEL": "-I", "NASM": "-I"}=0D =0D - ## Constructor of BuildFile=0D + # Constructor of BuildFile=0D #=0D # @param AutoGenObject Object of AutoGen class=0D #=0D @@ -188,7 +192,7 @@ class BuildFile(object): else:=0D self._Platform =3D POSIX_PLATFORM=0D =0D - ## Create build file.=0D + # Create build file.=0D #=0D # Only nmake and gmake are supported.=0D #=0D @@ -199,33 +203,33 @@ class BuildFile(object): FileContent =3D self._TEMPLATE_.Replace(self._TemplateDict)=0D FileName =3D self.getMakefileName()=0D if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir= , "deps.txt")):=0D - with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps.= txt"),"w+") as fd:=0D + with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps.= txt"), "w+") as fd:=0D fd.write("")=0D if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir= , "dependency")):=0D - with open(os.path.join(self._AutoGenObject.MakeFileDir, "depen= dency"),"w+") as fd:=0D + with open(os.path.join(self._AutoGenObject.MakeFileDir, "depen= dency"), "w+") as fd:=0D fd.write("")=0D if not os.path.exists(os.path.join(self._AutoGenObject.MakeFileDir= , "deps_target")):=0D - with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps_= target"),"w+") as fd:=0D + with open(os.path.join(self._AutoGenObject.MakeFileDir, "deps_= target"), "w+") as fd:=0D fd.write("")=0D return SaveFileOnChange(os.path.join(self._AutoGenObject.MakeFileD= ir, FileName), FileContent, False)=0D =0D - ## Return a list of directory creation command string=0D + # Return a list of directory creation command string=0D #=0D # @param DirList The list of directory to be created=0D #=0D # @retval list The directory creation command list=0D #=0D def GetCreateDirectoryCommand(self, DirList):=0D - return [self._MD_TEMPLATE_[self._Platform] % {'dir':Dir} for Dir i= n DirList]=0D + return [self._MD_TEMPLATE_[self._Platform] % {'dir': Dir} for Dir = in DirList]=0D =0D - ## Return a list of directory removal command string=0D + # Return a list of directory removal command string=0D #=0D # @param DirList The list of directory to be removed=0D #=0D # @retval list The directory removal command list=0D #=0D def GetRemoveDirectoryCommand(self, DirList):=0D - return [self._RD_TEMPLATE_[self._Platform] % {'dir':Dir} for Dir i= n DirList]=0D + return [self._RD_TEMPLATE_[self._Platform] % {'dir': Dir} for Dir = in DirList]=0D =0D def PlaceMacro(self, Path, MacroDefinitions=3DNone):=0D if Path.startswith("$("):=0D @@ -244,13 +248,15 @@ class BuildFile(object): break=0D return Path=0D =0D -## ModuleMakefile class=0D +# ModuleMakefile class=0D #=0D # This class encapsules makefie and its generation for module. It uses te= mplate to generate=0D # the content of makefile. The content of makefile will be got from Modul= eAutoGen object.=0D #=0D +=0D +=0D class ModuleMakefile(BuildFile):=0D - ## template used to generate the makefile for module=0D + # template used to generate the makefile for module=0D _TEMPLATE_ =3D TemplateString('''\=0D ${makefile_header}=0D =0D @@ -432,10 +438,12 @@ cleanlib: \t${BEGIN}-@${library_build_command} cleanall=0D \t${END}@cd $(MODULE_BUILD_DIR)\n\n''')=0D =0D - _FILE_MACRO_TEMPLATE =3D TemplateString("${macro_name} =3D ${BEGIN} \\= \n ${source_file}${END}\n")=0D - _BUILD_TARGET_TEMPLATE =3D TemplateString("${BEGIN}${target} : ${deps}= \n${END}\t${cmd}\n")=0D + _FILE_MACRO_TEMPLATE =3D TemplateString(=0D + "${macro_name} =3D ${BEGIN} \\\n ${source_file}${END}\n")=0D + _BUILD_TARGET_TEMPLATE =3D TemplateString(=0D + "${BEGIN}${target} : ${deps}\n${END}\t${cmd}\n")=0D =0D - ## Constructor of ModuleMakefile=0D + # Constructor of ModuleMakefile=0D #=0D # @param ModuleAutoGen Object of ModuleAutoGen class=0D #=0D @@ -460,14 +468,14 @@ cleanlib: self.LibraryBuildDirectoryList =3D []=0D self.SystemLibraryList =3D []=0D self.Macros =3D OrderedDict()=0D - self.Macros["OUTPUT_DIR" ] =3D self._AutoGenObject.Macros["OU= TPUT_DIR"]=0D - self.Macros["DEBUG_DIR" ] =3D self._AutoGenObject.Macros["DE= BUG_DIR"]=0D + self.Macros["OUTPUT_DIR"] =3D self._AutoGenObject.Macros["OUTPUT_D= IR"]=0D + self.Macros["DEBUG_DIR"] =3D self._AutoGenObject.Macros["DEBUG_DIR= "]=0D self.Macros["MODULE_BUILD_DIR"] =3D self._AutoGenObject.Macros["MO= DULE_BUILD_DIR"]=0D - self.Macros["BIN_DIR" ] =3D self._AutoGenObject.Macros["BI= N_DIR"]=0D - self.Macros["BUILD_DIR" ] =3D self._AutoGenObject.Macros["BU= ILD_DIR"]=0D - self.Macros["WORKSPACE" ] =3D self._AutoGenObject.Macros["WO= RKSPACE"]=0D - self.Macros["FFS_OUTPUT_DIR" ] =3D self._AutoGenObject.Macros["FF= S_OUTPUT_DIR"]=0D - self.GenFfsList =3D ModuleAutoGen.GenFfsList=0D + self.Macros["BIN_DIR"] =3D self._AutoGenObject.Macros["BIN_DIR"]=0D + self.Macros["BUILD_DIR"] =3D self._AutoGenObject.Macros["BUILD_DIR= "]=0D + self.Macros["WORKSPACE"] =3D self._AutoGenObject.Macros["WORKSPACE= "]=0D + self.Macros["FFS_OUTPUT_DIR"] =3D self._AutoGenObject.Macros["FFS_= OUTPUT_DIR"]=0D + self.GenFfsList =3D ModuleAutoGen.GenFfsList=0D self.MacroList =3D ['FFS_OUTPUT_DIR', 'MODULE_GUID', 'OUTPUT_DIR']= =0D self.FfsOutputFileList =3D []=0D self.DependencyHeaderFileSet =3D set()=0D @@ -534,7 +542,8 @@ cleanlib: continue=0D # Remove duplicated include path, if any=0D if Attr =3D=3D "FLAGS":=0D - Value =3D RemoveDupOption(Value, IncPrefix, MyAgo.= IncludePathList)=0D + Value =3D RemoveDupOption(=0D + Value, IncPrefix, MyAgo.IncludePathList)=0D if Tool =3D=3D "OPTROM" and PCI_COMPRESS_Flag:=0D ValueList =3D Value.split()=0D if ValueList:=0D @@ -554,7 +563,8 @@ cleanlib: if RespDict:=0D RespFileListContent =3D ''=0D for Resp in RespDict:=0D - RespFile =3D os.path.join(MyAgo.OutputDir, str(Resp).lower= () + '.txt')=0D + RespFile =3D os.path.join(=0D + MyAgo.OutputDir, str(Resp).lower() + '.txt')=0D StrList =3D RespDict[Resp].split(' ')=0D UnexpandMacro =3D []=0D NewStr =3D []=0D @@ -566,7 +576,8 @@ cleanlib: UnexpandMacroStr =3D ' '.join(UnexpandMacro)=0D NewRespStr =3D ' '.join(NewStr)=0D SaveFileOnChange(RespFile, NewRespStr, False)=0D - ToolsDef.append("%s =3D %s" % (Resp, UnexpandMacroStr + ' = @' + RespFile))=0D + ToolsDef.append("%s =3D %s" %=0D + (Resp, UnexpandMacroStr + ' @' + RespFile)= )=0D RespFileListContent +=3D '@' + RespFile + TAB_LINE_BREAK=0D RespFileListContent +=3D NewRespStr + TAB_LINE_BREAK=0D SaveFileOnChange(RespFileList, RespFileListContent, False)=0D @@ -584,36 +595,39 @@ cleanlib: self.ParserGenerateFfsCmd()=0D =0D # Generate macros used to represent input files=0D - FileMacroList =3D [] # macro name =3D file list=0D + FileMacroList =3D [] # macro name =3D file list=0D for FileListMacro in self.FileListMacros:=0D FileMacro =3D self._FILE_MACRO_TEMPLATE.Replace(=0D - {=0D - "macro_name" : Fi= leListMacro,=0D - "source_file" : se= lf.FileListMacros[FileListMacro]=0D - }=0D - )=0D + {=0D + "macro_name": FileListMacro,=0D + "source_file": self.FileListMacros[FileListMacro]=0D + }=0D + )=0D FileMacroList.append(FileMacro)=0D =0D # INC_LIST is special=0D FileMacro =3D ""=0D IncludePathList =3D []=0D - for P in MyAgo.IncludePathList:=0D + for P in MyAgo.IncludePathList:=0D IncludePathList.append(IncPrefix + self.PlaceMacro(P, self.Mac= ros))=0D if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros:=0D - self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(I= ncPrefix + P)=0D + self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(= =0D + IncPrefix + P)=0D FileMacro +=3D self._FILE_MACRO_TEMPLATE.Replace(=0D - {=0D - "macro_name" : "INC"= ,=0D - "source_file" : Includ= ePathList=0D - }=0D - )=0D + {=0D + "macro_name": "INC",=0D + "source_file": IncludePathList=0D + }=0D + )=0D FileMacroList.append(FileMacro)=0D # Add support when compiling .nasm source files=0D IncludePathList =3D []=0D - asmsource =3D [item for item in MyAgo.SourceFileList if item.File.= upper().endswith((".NASM",".ASM",".NASMB","S"))]=0D + asmsource =3D [item for item in MyAgo.SourceFileList if item.File.= upper(=0D + ).endswith((".NASM", ".ASM", ".NASMB", "S"))]=0D if asmsource:=0D - for P in MyAgo.IncludePathList:=0D - IncludePath =3D self._INC_FLAG_['NASM'] + self.PlaceMacro(= P, self.Macros)=0D + for P in MyAgo.IncludePathList:=0D + IncludePath =3D self._INC_FLAG_[=0D + 'NASM'] + self.PlaceMacro(P, self.Macros)=0D if IncludePath.endswith(os.sep):=0D IncludePath =3D IncludePath.rstrip(os.sep)=0D # When compiling .nasm files, need to add a literal backsl= ash at each path.=0D @@ -624,29 +638,33 @@ cleanlib: else:=0D IncludePath =3D os.path.join(IncludePath, '')=0D IncludePathList.append(IncludePath)=0D - FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace({"macro= _name": "NASM_INC", "source_file": IncludePathList}))=0D + FileMacroList.append(self._FILE_MACRO_TEMPLATE.Replace(=0D + {"macro_name": "NASM_INC", "source_file": IncludePathList}= ))=0D =0D # Generate macros used to represent files containing list of input= files=0D for ListFileMacro in self.ListFileMacros:=0D - ListFileName =3D os.path.join(MyAgo.OutputDir, "%s.lst" % List= FileMacro.lower()[:len(ListFileMacro) - 5])=0D + ListFileName =3D os.path.join(MyAgo.OutputDir, "%s.lst" % List= FileMacro.lower()[=0D + :len(ListFileMacro) - 5])=0D FileMacroList.append("%s =3D %s" % (ListFileMacro, ListFileNam= e))=0D SaveFileOnChange(=0D ListFileName,=0D "\n".join(self.ListFileMacros[ListFileMacro]),=0D False=0D - )=0D + )=0D =0D # Generate objlist used to create .obj file=0D for Type in self.ObjTargetDict:=0D NewLine =3D ' '.join(list(self.ObjTargetDict[Type]))=0D - FileMacroList.append("OBJLIST_%s =3D %s" % (list(self.ObjTarge= tDict.keys()).index(Type), NewLine))=0D + FileMacroList.append("OBJLIST_%s =3D %s" % (=0D + list(self.ObjTargetDict.keys()).index(Type), NewLine))=0D =0D BcTargetList =3D []=0D =0D MakefileName =3D self.getMakefileName()=0D LibraryMakeCommandList =3D []=0D for D in self.LibraryBuildDirectoryList:=0D - Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file":os.= path.join(D, MakefileName)}=0D + Command =3D self._MAKE_TEMPLATE_[self._Platform] % {=0D + "file": os.path.join(D, MakefileName)}=0D LibraryMakeCommandList.append(Command)=0D =0D package_rel_dir =3D MyAgo.SourceDir=0D @@ -663,66 +681,67 @@ cleanlib: package_rel_dir =3D package_rel_dir[index + 1:]=0D =0D MakefileTemplateDict =3D {=0D - "makefile_header" : self._FILE_HEADER_[self._FileTyp= e],=0D - "makefile_path" : os.path.join("$(MODULE_BUILD_DIR= )", MakefileName),=0D - "makefile_name" : MakefileName,=0D - "platform_name" : self.PlatformInfo.Name,=0D - "platform_guid" : self.PlatformInfo.Guid,=0D - "platform_version" : self.PlatformInfo.Version,=0D + "makefile_header": self._FILE_HEADER_[self._FileType],=0D + "makefile_path": os.path.join("$(MODULE_BUILD_DIR)", MakefileN= ame),=0D + "makefile_name": MakefileName,=0D + "platform_name": self.PlatformInfo.Name,=0D + "platform_guid": self.PlatformInfo.Guid,=0D + "platform_version": self.PlatformInfo.Version,=0D "platform_relative_directory": self.PlatformInfo.SourceDir,=0D - "platform_output_directory" : self.PlatformInfo.OutputDir,=0D - "ffs_output_directory" : MyAgo.Macros["FFS_OUTPUT_DIR"],= =0D - "platform_dir" : MyAgo.Macros["PLATFORM_DIR"],=0D + "platform_output_directory": self.PlatformInfo.OutputDir,=0D + "ffs_output_directory": MyAgo.Macros["FFS_OUTPUT_DIR"],=0D + "platform_dir": MyAgo.Macros["PLATFORM_DIR"],=0D =0D - "module_name" : MyAgo.Name,=0D - "module_guid" : MyAgo.Guid,=0D - "module_name_guid" : MyAgo.UniqueBaseName,=0D - "module_version" : MyAgo.Version,=0D - "module_type" : MyAgo.ModuleType,=0D - "module_file" : MyAgo.MetaFile.Name,=0D - "module_file_base_name" : MyAgo.MetaFile.BaseName,=0D - "module_relative_directory" : MyAgo.SourceDir,=0D - "module_dir" : mws.join (self.Macros["WORKSPACE= "], MyAgo.SourceDir),=0D + "module_name": MyAgo.Name,=0D + "module_guid": MyAgo.Guid,=0D + "module_name_guid": MyAgo.UniqueBaseName,=0D + "module_version": MyAgo.Version,=0D + "module_type": MyAgo.ModuleType,=0D + "module_file": MyAgo.MetaFile.Name,=0D + "module_file_base_name": MyAgo.MetaFile.BaseName,=0D + "module_relative_directory": MyAgo.SourceDir,=0D + "module_dir": mws.join(self.Macros["WORKSPACE"], MyAgo.SourceD= ir),=0D "package_relative_directory": package_rel_dir,=0D - "module_extra_defines" : ["%s =3D %s" % (k, v) for k, v i= n MyAgo.Module.Defines.items()],=0D + "module_extra_defines": ["%s =3D %s" % (k, v) for k, v in MyAg= o.Module.Defines.items()],=0D =0D - "architecture" : MyAgo.Arch,=0D - "toolchain_tag" : MyAgo.ToolChain,=0D - "build_target" : MyAgo.BuildTarget,=0D + "architecture": MyAgo.Arch,=0D + "toolchain_tag": MyAgo.ToolChain,=0D + "build_target": MyAgo.BuildTarget,=0D =0D - "platform_build_directory" : self.PlatformInfo.BuildDir,=0D - "module_build_directory" : MyAgo.BuildDir,=0D - "module_output_directory" : MyAgo.OutputDir,=0D - "module_debug_directory" : MyAgo.DebugDir,=0D + "platform_build_directory": self.PlatformInfo.BuildDir,=0D + "module_build_directory": MyAgo.BuildDir,=0D + "module_output_directory": MyAgo.OutputDir,=0D + "module_debug_directory": MyAgo.DebugDir,=0D =0D - "separator" : Separator,=0D - "module_tool_definitions" : ToolsDef,=0D + "separator": Separator,=0D + "module_tool_definitions": ToolsDef,=0D =0D - "shell_command_code" : list(self._SHELL_CMD_[self._Plat= form].keys()),=0D - "shell_command" : list(self._SHELL_CMD_[self._Plat= form].values()),=0D + "shell_command_code": list(self._SHELL_CMD_[self._Platform].ke= ys()),=0D + "shell_command": list(self._SHELL_CMD_[self._Platform].values(= )),=0D =0D - "module_entry_point" : ModuleEntryPoint,=0D - "image_entry_point" : ImageEntryPoint,=0D - "arch_entry_point" : ArchEntryPoint,=0D - "remaining_build_target" : self.ResultFileList,=0D - "common_dependency_file" : self.CommonFileDependency,=0D - "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "clean_command" : self.GetRemoveDirectoryCommand([= "$(OUTPUT_DIR)"]),=0D - "cleanall_command" : self.GetRemoveDirectoryCommand([= "$(DEBUG_DIR)", "$(OUTPUT_DIR)"]),=0D - "dependent_library_build_directory" : self.LibraryBuildDirecto= ryList,=0D - "library_build_command" : LibraryMakeCommandList,=0D - "file_macro" : FileMacroList,=0D - "file_build_target" : self.BuildTargetList,=0D + "module_entry_point": ModuleEntryPoint,=0D + "image_entry_point": ImageEntryPoint,=0D + "arch_entry_point": ArchEntryPoint,=0D + "remaining_build_target": self.ResultFileList,=0D + "common_dependency_file": self.CommonFileDependency,=0D + "create_directory_command": self.GetCreateDirectoryCommand(sel= f.IntermediateDirectoryList),=0D + "clean_command": self.GetRemoveDirectoryCommand(["$(OUTPUT_DIR= )"]),=0D + "cleanall_command": self.GetRemoveDirectoryCommand(["$(DEBUG_D= IR)", "$(OUTPUT_DIR)"]),=0D + "dependent_library_build_directory": self.LibraryBuildDirector= yList,=0D + "library_build_command": LibraryMakeCommandList,=0D + "file_macro": FileMacroList,=0D + "file_build_target": self.BuildTargetList,=0D "backward_compatible_target": BcTargetList,=0D - "INCLUDETAG" : "\n".join([self._INCLUDE_CMD_= [self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","dependency"),= =0D - self._INCLUD= E_CMD_[self._FileType] + " " + os.path.join("$(MODULE_BUILD_DIR)","deps_tar= get")=0D - ])=0D + "INCLUDETAG": "\n".join([self._INCLUDE_CMD_[self._FileType] + = " " + os.path.join("$(MODULE_BUILD_DIR)", "dependency"),=0D + self._INCLUDE_CMD_[=0D + self._FileType] + " " + os.path.j= oin("$(MODULE_BUILD_DIR)", "deps_target")=0D + ])=0D }=0D =0D return MakefileTemplateDict=0D =0D def ParserGenerateFfsCmd(self):=0D - #Add Ffs cmd to self.BuildTargetList=0D + # Add Ffs cmd to self.BuildTargetList=0D OutputFile =3D ''=0D DepsFileList =3D []=0D =0D @@ -734,9 +753,10 @@ cleanlib: Dst =3D self.ReplaceMacro(Dst)=0D if Dst not in self.ResultFileList:=0D self.ResultFileList.append(Dst)=0D - if '%s :' %(Dst) not in self.BuildTargetList:=0D - self.BuildTargetList.append("%s : %s" %(Dst,Src))= =0D - self.BuildTargetList.append('\t' + self._CP_TEMPLA= TE_[self._Platform] %{'Src': Src, 'Dst': Dst})=0D + if '%s :' % (Dst) not in self.BuildTargetList:=0D + self.BuildTargetList.append("%s : %s" % (Dst, Src)= )=0D + self.BuildTargetList.append(=0D + '\t' + self._CP_TEMPLATE_[self._Platform] % {'= Src': Src, 'Dst': Dst})=0D =0D FfsCmdList =3D Cmd[0]=0D for index, Str in enumerate(FfsCmdList):=0D @@ -753,14 +773,16 @@ cleanlib: OutputFile =3D self.ReplaceMacro(OutputFile)=0D self.ResultFileList.append(OutputFile)=0D DepsFileString =3D self.ReplaceMacro(DepsFileString)=0D - self.BuildTargetList.append('%s : %s' % (OutputFile, DepsFileS= tring))=0D + self.BuildTargetList.append(=0D + '%s : %s' % (OutputFile, DepsFileString))=0D CmdString =3D ' '.join(FfsCmdList).strip()=0D CmdString =3D self.ReplaceMacro(CmdString)=0D self.BuildTargetList.append('\t%s' % CmdString)=0D =0D self.ParseSecCmd(DepsFileList, Cmd[1])=0D - for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileLi= st :=0D - self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro= (SecOutputFile), self.ReplaceMacro(SecDepsFile)))=0D + for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileLi= st:=0D + self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro= (=0D + SecOutputFile), self.ReplaceMacro(SecDepsFile)))=0D self.BuildTargetList.append('\t%s' % self.ReplaceMacro(Sec= Cmd))=0D self.FfsOutputFileList =3D []=0D =0D @@ -778,10 +800,13 @@ cleanlib: SecDepsFileList.append(SecCmdList[index + = 1])=0D index =3D index + 1=0D if CmdName =3D=3D 'Trim':=0D - SecDepsFileList.append(os.path.join('$(DEBUG_D= IR)', os.path.basename(OutputFile).replace('offset', 'efi')))=0D + SecDepsFileList.append(os.path.join(=0D + '$(DEBUG_DIR)', os.path.basename(OutputFil= e).replace('offset', 'efi')))=0D if OutputFile.endswith('.ui') or OutputFile.endswi= th('.ver'):=0D - SecDepsFileList.append(os.path.join('$(MODULE_= DIR)', '$(MODULE_FILE)'))=0D - self.FfsOutputFileList.append((OutputFile, ' '.joi= n(SecDepsFileList), SecCmdStr))=0D + SecDepsFileList.append(os.path.join(=0D + '$(MODULE_DIR)', '$(MODULE_FILE)'))=0D + self.FfsOutputFileList.append(=0D + (OutputFile, ' '.join(SecDepsFileList), SecCmd= Str))=0D if len(SecDepsFileList) > 0:=0D self.ParseSecCmd(SecDepsFileList, CmdTuple)=0D break=0D @@ -798,14 +823,14 @@ cleanlib: =0D def CommandExceedLimit(self):=0D FlagDict =3D {=0D - 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : Fal= se},=0D - 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : Fal= se},=0D - 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : Fal= se},=0D - 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : Fal= se},=0D - 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : Fal= se},=0D - 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : Fal= se},=0D - 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : Fal= se},=0D - }=0D + 'CC': {'Macro': '$(CC_FLAGS)', 'Value': False},=0D + 'PP': {'Macro': '$(PP_FLAGS)', 'Value': False},=0D + 'APP': {'Macro': '$(APP_FLAGS)', 'Value': False},=0D + 'ASLPP': {'Macro': '$(ASLPP_FLAGS)', 'Value': False},=0D + 'VFRPP': {'Macro': '$(VFRPP_FLAGS)', 'Value': False},=0D + 'ASM': {'Macro': '$(ASM_FLAGS)', 'Value': False},=0D + 'ASLCC': {'Macro': '$(ASLCC_FLAGS)', 'Value': False},=0D + }=0D =0D RespDict =3D {}=0D FileTypeList =3D []=0D @@ -830,44 +855,53 @@ cleanlib: SingleCommandList =3D SingleCommand.split()=0D if len(SingleCommandList) > 0:=0D for Flag in FlagDict:=0D - if '$('+ Flag +')' in SingleCommandList[0]= :=0D + if '$(' + Flag + ')' in SingleCommandList[= 0]:=0D Tool =3D Flag=0D break=0D if Tool:=0D if 'PATH' not in self._AutoGenObject.BuildOpti= on[Tool]:=0D - EdkLogger.error("build", AUTOGEN_ERROR, "%= s_PATH doesn't exist in %s ToolChain and %s Arch." %(Tool, self._AutoGenObj= ect.ToolChain, self._AutoGenObject.Arch), ExtraData=3D"[%s]" % str(self._Au= toGenObject))=0D - SingleCommandLength +=3D len(self._AutoGenObje= ct.BuildOption[Tool]['PATH'])=0D + EdkLogger.error("build", AUTOGEN_ERROR, "%= s_PATH doesn't exist in %s ToolChain and %s Arch." % (=0D + Tool, self._AutoGenObject.ToolChain, s= elf._AutoGenObject.Arch), ExtraData=3D"[%s]" % str(self._AutoGenObject))=0D + SingleCommandLength +=3D len(=0D + self._AutoGenObject.BuildOption[Tool]['PAT= H'])=0D for item in SingleCommandList[1:]:=0D if FlagDict[Tool]['Macro'] in item:=0D if 'FLAGS' not in self._AutoGenObject.= BuildOption[Tool]:=0D - EdkLogger.error("build", AUTOGEN_E= RROR, "%s_FLAGS doesn't exist in %s ToolChain and %s Arch." %(Tool, self._A= utoGenObject.ToolChain, self._AutoGenObject.Arch), ExtraData=3D"[%s]" % str= (self._AutoGenObject))=0D + EdkLogger.error("build", AUTOGEN_E= RROR, "%s_FLAGS doesn't exist in %s ToolChain and %s Arch." % (=0D + Tool, self._AutoGenObject.Tool= Chain, self._AutoGenObject.Arch), ExtraData=3D"[%s]" % str(self._AutoGenObj= ect))=0D Str =3D self._AutoGenObject.BuildOptio= n[Tool]['FLAGS']=0D for Option in self._AutoGenObject.Buil= dOption:=0D for Attr in self._AutoGenObject.Bu= ildOption[Option]:=0D if Str.find(Option + '_' + Att= r) !=3D -1:=0D - Str =3D Str.replace('$(' += Option + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])= =0D + Str =3D Str.replace(=0D + '$(' + Option + '_' + = Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])=0D while(Str.find('$(') !=3D -1):=0D for macro in self._AutoGenObject.M= acros:=0D - MacroName =3D '$('+ macro + ')= '=0D + MacroName =3D '$(' + macro + '= )'=0D if (Str.find(MacroName) !=3D -= 1):=0D - Str =3D Str.replace(MacroN= ame, self._AutoGenObject.Macros[macro])=0D + Str =3D Str.replace(=0D + MacroName, self._AutoG= enObject.Macros[macro])=0D break=0D else:=0D break=0D SingleCommandLength +=3D len(Str)=0D elif '$(INC)' in item:=0D - SingleCommandLength +=3D self._AutoGen= Object.IncludePathLength + len(IncPrefix) * len(self._AutoGenObject.Include= PathList)=0D + SingleCommandLength +=3D self._AutoGen= Object.IncludePathLength + \=0D + len(IncPrefix) * \=0D + len(self._AutoGenObject.IncludePat= hList)=0D elif item.find('$(') !=3D -1:=0D Str =3D item=0D for Option in self._AutoGenObject.Buil= dOption:=0D for Attr in self._AutoGenObject.Bu= ildOption[Option]:=0D if Str.find(Option + '_' + Att= r) !=3D -1:=0D - Str =3D Str.replace('$(' += Option + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])= =0D + Str =3D Str.replace(=0D + '$(' + Option + '_' + = Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])=0D while(Str.find('$(') !=3D -1):=0D for macro in self._AutoGenObject.M= acros:=0D - MacroName =3D '$('+ macro + ')= '=0D + MacroName =3D '$(' + macro + '= )'=0D if (Str.find(MacroName) !=3D -= 1):=0D - Str =3D Str.replace(MacroN= ame, self._AutoGenObject.Macros[macro])=0D + Str =3D Str.replace(=0D + MacroName, self._AutoG= enObject.Macros[macro])=0D break=0D else:=0D break=0D @@ -880,19 +914,22 @@ cleanlib: for Flag in FlagDict:=0D if FlagDict[Flag]['Value']:=0D Key =3D Flag + '_RESP'=0D - RespMacro =3D FlagDict[Flag]['Macro'].replace('FLA= GS', 'RESP')=0D + RespMacro =3D FlagDict[Flag]['Macro'].replace(=0D + 'FLAGS', 'RESP')=0D Value =3D self._AutoGenObject.BuildOption[Flag]['F= LAGS']=0D for inc in self._AutoGenObject.IncludePathList:=0D Value +=3D ' ' + IncPrefix + inc=0D for Option in self._AutoGenObject.BuildOption:=0D for Attr in self._AutoGenObject.BuildOption[Op= tion]:=0D if Value.find(Option + '_' + Attr) !=3D -1= :=0D - Value =3D Value.replace('$(' + Option = + '_' + Attr + ')', self._AutoGenObject.BuildOption[Option][Attr])=0D + Value =3D Value.replace(=0D + '$(' + Option + '_' + Attr + ')', = self._AutoGenObject.BuildOption[Option][Attr])=0D while (Value.find('$(') !=3D -1):=0D for macro in self._AutoGenObject.Macros:=0D - MacroName =3D '$('+ macro + ')'=0D + MacroName =3D '$(' + macro + ')'=0D if (Value.find(MacroName) !=3D -1):=0D - Value =3D Value.replace(MacroName, sel= f._AutoGenObject.Macros[macro])=0D + Value =3D Value.replace(=0D + MacroName, self._AutoGenObject.Mac= ros[macro])=0D break=0D else:=0D break=0D @@ -904,7 +941,8 @@ cleanlib: for Target in BuildTargets:=0D for i, SingleCommand in enumerate(BuildTargets= [Target].Commands):=0D if FlagDict[Flag]['Macro'] in SingleComman= d:=0D - BuildTargets[Target].Commands[i] =3D S= ingleCommand.replace('$(INC)', '').replace(FlagDict[Flag]['Macro'], RespMac= ro)=0D + BuildTargets[Target].Commands[i] =3D S= ingleCommand.replace(=0D + '$(INC)', '').replace(FlagDict[Fla= g]['Macro'], RespMacro)=0D return RespDict=0D =0D def ProcessBuildTargetList(self, RespFile, ToolsDef):=0D @@ -926,7 +964,8 @@ cleanlib: if Item in SourceFileList:=0D SourceFileList.remove(Item)=0D =0D - FileDependencyDict =3D {item:ForceIncludedFile for item in SourceF= ileList}=0D + FileDependencyDict =3D {=0D + item: ForceIncludedFile for item in SourceFileList}=0D =0D for Dependency in FileDependencyDict.values():=0D self.DependencyHeaderFileSet.update(set(Dependency))=0D @@ -985,11 +1024,12 @@ cleanlib: continue=0D if GlobalData.gUseHashCache:=0D GlobalData.gModuleBuildTracking[self._AutoGenObject] =3D '= FAIL_METAFILE'=0D - EdkLogger.warn("build","Module MetaFile [Sources] is missing l= ocal header!",=0D - ExtraData =3D "Local Header: " + aFile + " not fou= nd in " + self._AutoGenObject.MetaFile.Path=0D - )=0D + EdkLogger.warn("build", "Module MetaFile [Sources] is missing = local header!",=0D + ExtraData=3D"Local Header: " + aFile +=0D + " not found in " + self._AutoGenObject.MetaFile= .Path=0D + )=0D =0D - for File,Dependency in FileDependencyDict.items():=0D + for File, Dependency in FileDependencyDict.items():=0D if not Dependency:=0D continue=0D =0D @@ -1024,7 +1064,8 @@ cleanlib: for Dep in T.Dependencies:=0D Deps.append(self.PlaceMacro(str(Dep), self.Macros))=0D if Dep !=3D '$(MAKE_FILE)':=0D - CCodeDeps.append(self.PlaceMacro(str(Dep), self.Ma= cros))=0D + CCodeDeps.append(=0D + self.PlaceMacro(str(Dep), self.Macros))=0D # Add inclusion-dependencies=0D if len(T.Inputs) =3D=3D 1 and T.Inputs[0] in FileDependenc= yDict:=0D for F in FileDependencyDict[T.Inputs[0]]:=0D @@ -1035,7 +1076,8 @@ cleanlib: # In order to use file list macro as dependency=0D if T.GenListFile:=0D # gnu tools need forward slash path separator, eve= n on Windows=0D - self.ListFileMacros[T.ListFileMacro].append(str(F)= .replace ('\\', '/'))=0D + self.ListFileMacros[T.ListFileMacro].append(=0D + str(F).replace('\\', '/'))=0D self.FileListMacros[T.FileListMacro].append(NewFil= e)=0D elif T.GenFileListMacro:=0D self.FileListMacros[T.FileListMacro].append(NewFil= e)=0D @@ -1054,25 +1096,32 @@ cleanlib: = CmdCppDict, DependencyDict, RespFile,=0D = ToolsDef, resp_file_number)=0D resp_file_number +=3D 1=0D - TargetDict =3D {"target": self.PlaceMacro(T.Target.Pat= h, self.Macros), "cmd": "\n\t".join(T.Commands),"deps": CCodeDeps}=0D - CmdLine =3D self._BUILD_TARGET_TEMPLATE.Replace(Target= Dict).rstrip().replace('\t$(OBJLIST', '$(OBJLIST')=0D + TargetDict =3D {"target": self.PlaceMacro(=0D + T.Target.Path, self.Macros), "cmd": "\n\t".join(T.= Commands), "deps": CCodeDeps}=0D + CmdLine =3D self._BUILD_TARGET_TEMPLATE.Replace(=0D + TargetDict).rstrip().replace('\t$(OBJLIST', '$(OBJ= LIST')=0D if T.Commands:=0D - CmdLine =3D '%s%s' %(CmdLine, TAB_LINE_BREAK)=0D + CmdLine =3D '%s%s' % (CmdLine, TAB_LINE_BREAK)=0D if CCodeDeps or CmdLine:=0D self.BuildTargetList.append(CmdLine)=0D else:=0D - TargetDict =3D {"target": self.PlaceMacro(T.Target.Pat= h, self.Macros), "cmd": "\n\t".join(T.Commands),"deps": Deps}=0D - self.BuildTargetList.append(self._BUILD_TARGET_TEMPLAT= E.Replace(TargetDict))=0D + TargetDict =3D {"target": self.PlaceMacro(=0D + T.Target.Path, self.Macros), "cmd": "\n\t".join(T.= Commands), "deps": Deps}=0D + self.BuildTargetList.append(=0D + self._BUILD_TARGET_TEMPLATE.Replace(TargetDict))=0D =0D # Add a Makefile rule for targets generating multiple = files.=0D # The main output is a prerequisite for the other outp= ut files.=0D for i in T.Outputs[1:]:=0D - AnnexeTargetDict =3D {"target": self.PlaceMacro(i.= Path, self.Macros), "cmd": "", "deps": self.PlaceMacro(T.Target.Path, self.= Macros)}=0D - self.BuildTargetList.append(self._BUILD_TARGET_TEM= PLATE.Replace(AnnexeTargetDict))=0D + AnnexeTargetDict =3D {"target": self.PlaceMacro(=0D + i.Path, self.Macros), "cmd": "", "deps": self.= PlaceMacro(T.Target.Path, self.Macros)}=0D + self.BuildTargetList.append(=0D + self._BUILD_TARGET_TEMPLATE.Replace(AnnexeTarg= etDict))=0D =0D def ParserCCodeFile(self, T, Type, CmdSumDict, CmdTargetDict, CmdCppDi= ct, DependencyDict, RespFile, ToolsDef,=0D - resp_file_number):=0D - SaveFilePath =3D os.path.join(RespFile, "cc_resp_%s.txt" % resp_fi= le_number)=0D + resp_file_number):=0D + SaveFilePath =3D os.path.join(=0D + RespFile, "cc_resp_%s.txt" % resp_file_number)=0D if not CmdSumDict:=0D for item in self._AutoGenObject.Targets[Type]:=0D CmdSumDict[item.Target.SubDir] =3D item.Target.BaseName=0D @@ -1097,39 +1146,47 @@ cleanlib: if len(SingleCommandList) > 0 and self.CheckCCCmd(SingleCo= mmandList):=0D for Temp in SingleCommandList:=0D if Temp.startswith('/Fo'):=0D - CmdSign =3D '%s%s' % (Temp.rsplit(TAB_SLASH, 1= )[0], TAB_SLASH)=0D + CmdSign =3D '%s%s' % (Temp.rsplit(=0D + TAB_SLASH, 1)[0], TAB_SLASH)=0D break=0D else:=0D continue=0D if CmdSign not in list(CmdTargetDict.keys()):=0D cmd =3D Item.replace(Temp, CmdSign)=0D if SingleCommandList[-1] in cmd:=0D - CmdTargetDict[CmdSign] =3D [cmd.replace(Single= CommandList[-1], "").rstrip(), SingleCommandList[-1]]=0D + CmdTargetDict[CmdSign] =3D [cmd.replace(=0D + SingleCommandList[-1], "").rstrip(), Singl= eCommandList[-1]]=0D else:=0D # CmdTargetDict[CmdSign] =3D "%s %s" % (CmdTargetD= ict[CmdSign], SingleCommandList[-1])=0D CmdTargetDict[CmdSign].append(SingleCommandList[-1= ])=0D Index =3D CommandList.index(Item)=0D CommandList.pop(Index)=0D - BaseName =3D SingleCommandList[-1].rsplit('.',1)[0]=0D + BaseName =3D SingleCommandList[-1].rsplit('.', 1)[0]=0D if BaseName.endswith("%s%s" % (TAB_SLASH, CmdSumDict[C= mdSign[3:].rsplit(TAB_SLASH, 1)[0]])):=0D Cpplist =3D CmdCppDict[T.Target.SubDir]=0D - Cpplist.insert(0, '$(OBJLIST_%d): ' % list(self.Ob= jTargetDict.keys()).index(T.Target.SubDir))=0D + Cpplist.insert(0, '$(OBJLIST_%d): ' % list(=0D + self.ObjTargetDict.keys()).index(T.Target.SubD= ir))=0D source_files =3D CmdTargetDict[CmdSign][1:]=0D source_files.insert(0, " ")=0D - if len(source_files)>2:=0D - SaveFileOnChange(SaveFilePath, " ".join(source= _files), False)=0D + if len(source_files) > 2:=0D + SaveFileOnChange(=0D + SaveFilePath, " ".join(source_files), Fals= e)=0D T.Commands[Index] =3D '%s\n\t%s $(cc_resp_%s)'= % (=0D - ' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign= ][0], resp_file_number)=0D - ToolsDef.append("cc_resp_%s =3D @%s" % (resp_f= ile_number, SaveFilePath))=0D + ' \\\n\t'.join(Cpplist), CmdTargetDict[Cmd= Sign][0], resp_file_number)=0D + ToolsDef.append("cc_resp_%s =3D @%s" %=0D + (resp_file_number, SaveFilePat= h))=0D =0D - elif len(source_files)<=3D2 and len(" ".join(CmdTa= rgetDict[CmdSign][:2]))>GlobalData.gCommandMaxLength:=0D - SaveFileOnChange(SaveFilePath, " ".join(source= _files), False)=0D + elif len(source_files) <=3D 2 and len(" ".join(Cmd= TargetDict[CmdSign][:2])) > GlobalData.gCommandMaxLength:=0D + SaveFileOnChange(=0D + SaveFilePath, " ".join(source_files), Fals= e)=0D T.Commands[Index] =3D '%s\n\t%s $(cc_resp_%s)'= % (=0D ' \\\n\t'.join(Cpplist), CmdTargetDict[Cmd= Sign][0], resp_file_number)=0D - ToolsDef.append("cc_resp_%s =3D @%s" % (resp_f= ile_number, SaveFilePath))=0D + ToolsDef.append("cc_resp_%s =3D @%s" %=0D + (resp_file_number, SaveFilePat= h))=0D =0D else:=0D - T.Commands[Index] =3D '%s\n\t%s' % (' \\\n\t'.= join(Cpplist), " ".join(CmdTargetDict[CmdSign]))=0D + T.Commands[Index] =3D '%s\n\t%s' % (' \\\n\t'.= join(=0D + Cpplist), " ".join(CmdTargetDict[CmdSign])= )=0D else:=0D T.Commands.pop(Index)=0D return T, CmdSumDict, CmdTargetDict, CmdCppDict=0D @@ -1139,13 +1196,15 @@ cleanlib: if '$(CC)' in cmd:=0D return True=0D return False=0D - ## For creating makefile targets for dependent libraries=0D + # For creating makefile targets for dependent libraries=0D +=0D def ProcessDependentLibrary(self):=0D for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:=0D if not LibraryAutoGen.IsBinaryModule:=0D - self.LibraryBuildDirectoryList.append(self.PlaceMacro(Libr= aryAutoGen.BuildDir, self.Macros))=0D + self.LibraryBuildDirectoryList.append(=0D + self.PlaceMacro(LibraryAutoGen.BuildDir, self.Macros))= =0D =0D - ## Return a list containing source file's dependencies=0D + # Return a list containing source file's dependencies=0D #=0D # @param FileList The list of source files=0D # @param ForceInculeList The list of files which will be includ= ed forcely=0D @@ -1156,17 +1215,18 @@ cleanlib: def GetFileDependency(self, FileList, ForceInculeList, SearchPathList)= :=0D Dependency =3D {}=0D for F in FileList:=0D - Dependency[F] =3D GetDependencyList(self._AutoGenObject, self.= FileCache, F, ForceInculeList, SearchPathList)=0D + Dependency[F] =3D GetDependencyList(=0D + self._AutoGenObject, self.FileCache, F, ForceInculeList, S= earchPathList)=0D return Dependency=0D =0D =0D -## CustomMakefile class=0D +# CustomMakefile class=0D #=0D # This class encapsules makefie and its generation for module. It uses te= mplate to generate=0D # the content of makefile. The content of makefile will be got from Modul= eAutoGen object.=0D #=0D class CustomMakefile(BuildFile):=0D - ## template used to generate the makefile for module with custom makef= ile=0D + # template used to generate the makefile for module with custom makefi= le=0D _TEMPLATE_ =3D TemplateString('''\=0D ${makefile_header}=0D =0D @@ -1258,7 +1318,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ =0D ''')=0D =0D - ## Constructor of CustomMakefile=0D + # Constructor of CustomMakefile=0D #=0D # @param ModuleAutoGen Object of ModuleAutoGen class=0D #=0D @@ -1277,9 +1337,9 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom make= file for %s" % self._FileType,=0D ExtraData=3D"[%s]" % str(MyAgo))=0D MakefilePath =3D mws.join(=0D - MyAgo.WorkspaceDir,=0D - MyAgo.CustomMakefile[self._FileType]=0D - )=0D + MyAgo.WorkspaceDir,=0D + MyAgo.CustomMakefile[self._FileType]=0D + )=0D try:=0D CustomMakefile =3D open(MakefilePath, 'r').read()=0D except:=0D @@ -1296,61 +1356,65 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ if Attr =3D=3D "FAMILY":=0D continue=0D elif Attr =3D=3D "PATH":=0D - ToolsDef.append("%s =3D %s" % (Tool, MyAgo.BuildOption= [Tool][Attr]))=0D + ToolsDef.append("%s =3D %s" %=0D + (Tool, MyAgo.BuildOption[Tool][Attr]))= =0D else:=0D - ToolsDef.append("%s_%s =3D %s" % (Tool, Attr, MyAgo.Bu= ildOption[Tool][Attr]))=0D + ToolsDef.append("%s_%s =3D %s" %=0D + (Tool, Attr, MyAgo.BuildOption[Tool][A= ttr]))=0D ToolsDef.append("")=0D =0D MakefileName =3D self.getMakefileName()=0D MakefileTemplateDict =3D {=0D - "makefile_header" : self._FILE_HEADER_[self._FileTyp= e],=0D - "makefile_path" : os.path.join("$(MODULE_BUILD_DIR= )", MakefileName),=0D - "platform_name" : self.PlatformInfo.Name,=0D - "platform_guid" : self.PlatformInfo.Guid,=0D - "platform_version" : self.PlatformInfo.Version,=0D + "makefile_header": self._FILE_HEADER_[self._FileType],=0D + "makefile_path": os.path.join("$(MODULE_BUILD_DIR)", MakefileN= ame),=0D + "platform_name": self.PlatformInfo.Name,=0D + "platform_guid": self.PlatformInfo.Guid,=0D + "platform_version": self.PlatformInfo.Version,=0D "platform_relative_directory": self.PlatformInfo.SourceDir,=0D - "platform_output_directory" : self.PlatformInfo.OutputDir,=0D - "platform_dir" : MyAgo.Macros["PLATFORM_DIR"],=0D + "platform_output_directory": self.PlatformInfo.OutputDir,=0D + "platform_dir": MyAgo.Macros["PLATFORM_DIR"],=0D =0D - "module_name" : MyAgo.Name,=0D - "module_guid" : MyAgo.Guid,=0D - "module_name_guid" : MyAgo.UniqueBaseName,=0D - "module_version" : MyAgo.Version,=0D - "module_type" : MyAgo.ModuleType,=0D - "module_file" : MyAgo.MetaFile,=0D - "module_file_base_name" : MyAgo.MetaFile.BaseName,=0D - "module_relative_directory" : MyAgo.SourceDir,=0D - "module_dir" : mws.join (MyAgo.WorkspaceDir, My= Ago.SourceDir),=0D + "module_name": MyAgo.Name,=0D + "module_guid": MyAgo.Guid,=0D + "module_name_guid": MyAgo.UniqueBaseName,=0D + "module_version": MyAgo.Version,=0D + "module_type": MyAgo.ModuleType,=0D + "module_file": MyAgo.MetaFile,=0D + "module_file_base_name": MyAgo.MetaFile.BaseName,=0D + "module_relative_directory": MyAgo.SourceDir,=0D + "module_dir": mws.join(MyAgo.WorkspaceDir, MyAgo.SourceDir),=0D =0D - "architecture" : MyAgo.Arch,=0D - "toolchain_tag" : MyAgo.ToolChain,=0D - "build_target" : MyAgo.BuildTarget,=0D + "architecture": MyAgo.Arch,=0D + "toolchain_tag": MyAgo.ToolChain,=0D + "build_target": MyAgo.BuildTarget,=0D =0D - "platform_build_directory" : self.PlatformInfo.BuildDir,=0D - "module_build_directory" : MyAgo.BuildDir,=0D - "module_output_directory" : MyAgo.OutputDir,=0D - "module_debug_directory" : MyAgo.DebugDir,=0D + "platform_build_directory": self.PlatformInfo.BuildDir,=0D + "module_build_directory": MyAgo.BuildDir,=0D + "module_output_directory": MyAgo.OutputDir,=0D + "module_debug_directory": MyAgo.DebugDir,=0D =0D - "separator" : Separator,=0D - "module_tool_definitions" : ToolsDef,=0D + "separator": Separator,=0D + "module_tool_definitions": ToolsDef,=0D =0D - "shell_command_code" : list(self._SHELL_CMD_[self._Plat= form].keys()),=0D - "shell_command" : list(self._SHELL_CMD_[self._Plat= form].values()),=0D + "shell_command_code": list(self._SHELL_CMD_[self._Platform].ke= ys()),=0D + "shell_command": list(self._SHELL_CMD_[self._Platform].values(= )),=0D =0D - "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "custom_makefile_content" : CustomMakefile=0D + "create_directory_command": self.GetCreateDirectoryCommand(sel= f.IntermediateDirectoryList),=0D + "custom_makefile_content": CustomMakefile=0D }=0D =0D return MakefileTemplateDict=0D =0D -## PlatformMakefile class=0D +# PlatformMakefile class=0D #=0D # This class encapsules makefie and its generation for platform. It uses= =0D # template to generate the content of makefile. The content of makefile wi= ll be=0D # got from PlatformAutoGen object.=0D #=0D +=0D +=0D class PlatformMakefile(BuildFile):=0D - ## template used to generate the makefile for platform=0D + # template used to generate the makefile for platform=0D _TEMPLATE_ =3D TemplateString('''\=0D ${makefile_header}=0D =0D @@ -1445,7 +1509,7 @@ cleanlib: \t${END}@cd $(BUILD_DIR)\n=0D ''')=0D =0D - ## Constructor of PlatformMakefile=0D + # Constructor of PlatformMakefile=0D #=0D # @param ModuleAutoGen Object of PlatformAutoGen class=0D #=0D @@ -1477,9 +1541,9 @@ cleanlib: LibraryMakefileList =3D []=0D LibraryMakeCommandList =3D []=0D for D in self.LibraryBuildDirectoryList:=0D - D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})=0D + D =3D self.PlaceMacro(D, {"BUILD_DIR": MyAgo.BuildDir})=0D Makefile =3D os.path.join(D, MakefileName)=0D - Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file":Mak= efile}=0D + Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file": Ma= kefile}=0D LibraryMakefileList.append(Makefile)=0D LibraryMakeCommandList.append(Command)=0D self.LibraryMakeCommandList =3D LibraryMakeCommandList=0D @@ -1487,44 +1551,44 @@ cleanlib: ModuleMakefileList =3D []=0D ModuleMakeCommandList =3D []=0D for D in self.ModuleBuildDirectoryList:=0D - D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir})=0D + D =3D self.PlaceMacro(D, {"BUILD_DIR": MyAgo.BuildDir})=0D Makefile =3D os.path.join(D, MakefileName)=0D - Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file":Mak= efile}=0D + Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file": Ma= kefile}=0D ModuleMakefileList.append(Makefile)=0D ModuleMakeCommandList.append(Command)=0D =0D MakefileTemplateDict =3D {=0D - "makefile_header" : self._FILE_HEADER_[self._FileTyp= e],=0D - "makefile_path" : os.path.join("$(BUILD_DIR)", Mak= efileName),=0D - "make_path" : MyAgo.ToolDefinition["MAKE"]["PA= TH"],=0D - "makefile_name" : MakefileName,=0D - "platform_name" : MyAgo.Name,=0D - "platform_guid" : MyAgo.Guid,=0D - "platform_version" : MyAgo.Version,=0D - "platform_file" : MyAgo.MetaFile,=0D + "makefile_header": self._FILE_HEADER_[self._FileType],=0D + "makefile_path": os.path.join("$(BUILD_DIR)", MakefileName),=0D + "make_path": MyAgo.ToolDefinition["MAKE"]["PATH"],=0D + "makefile_name": MakefileName,=0D + "platform_name": MyAgo.Name,=0D + "platform_guid": MyAgo.Guid,=0D + "platform_version": MyAgo.Version,=0D + "platform_file": MyAgo.MetaFile,=0D "platform_relative_directory": MyAgo.SourceDir,=0D - "platform_output_directory" : MyAgo.OutputDir,=0D - "platform_build_directory" : MyAgo.BuildDir,=0D - "platform_dir" : MyAgo.Macros["PLATFORM_DIR"],=0D + "platform_output_directory": MyAgo.OutputDir,=0D + "platform_build_directory": MyAgo.BuildDir,=0D + "platform_dir": MyAgo.Macros["PLATFORM_DIR"],=0D =0D - "toolchain_tag" : MyAgo.ToolChain,=0D - "build_target" : MyAgo.BuildTarget,=0D - "shell_command_code" : list(self._SHELL_CMD_[self._Plat= form].keys()),=0D - "shell_command" : list(self._SHELL_CMD_[self._Plat= form].values()),=0D - "build_architecture_list" : MyAgo.Arch,=0D - "architecture" : MyAgo.Arch,=0D - "separator" : Separator,=0D - "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "cleanall_command" : self.GetRemoveDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "library_makefile_list" : LibraryMakefileList,=0D - "module_makefile_list" : ModuleMakefileList,=0D - "library_build_command" : LibraryMakeCommandList,=0D - "module_build_command" : ModuleMakeCommandList,=0D + "toolchain_tag": MyAgo.ToolChain,=0D + "build_target": MyAgo.BuildTarget,=0D + "shell_command_code": list(self._SHELL_CMD_[self._Platform].ke= ys()),=0D + "shell_command": list(self._SHELL_CMD_[self._Platform].values(= )),=0D + "build_architecture_list": MyAgo.Arch,=0D + "architecture": MyAgo.Arch,=0D + "separator": Separator,=0D + "create_directory_command": self.GetCreateDirectoryCommand(sel= f.IntermediateDirectoryList),=0D + "cleanall_command": self.GetRemoveDirectoryCommand(self.Interm= ediateDirectoryList),=0D + "library_makefile_list": LibraryMakefileList,=0D + "module_makefile_list": ModuleMakefileList,=0D + "library_build_command": LibraryMakeCommandList,=0D + "module_build_command": ModuleMakeCommandList,=0D }=0D =0D return MakefileTemplateDict=0D =0D - ## Get the root directory list for intermediate files of all modules b= uild=0D + # Get the root directory list for intermediate files of all modules bu= ild=0D #=0D # @retval list The list of directory=0D #=0D @@ -1532,10 +1596,11 @@ cleanlib: DirList =3D []=0D for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:=0D if not ModuleAutoGen.IsBinaryModule:=0D - DirList.append(os.path.join(self._AutoGenObject.BuildDir, = ModuleAutoGen.BuildDir))=0D + DirList.append(os.path.join(=0D + self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))= =0D return DirList=0D =0D - ## Get the root directory list for intermediate files of all libraries= build=0D + # Get the root directory list for intermediate files of all libraries = build=0D #=0D # @retval list The list of directory=0D #=0D @@ -1543,20 +1608,23 @@ cleanlib: DirList =3D []=0D for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:=0D if not LibraryAutoGen.IsBinaryModule:=0D - DirList.append(os.path.join(self._AutoGenObject.BuildDir, = LibraryAutoGen.BuildDir))=0D + DirList.append(os.path.join(=0D + self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir)= )=0D return DirList=0D =0D -## TopLevelMakefile class=0D +# TopLevelMakefile class=0D #=0D # This class encapsules makefie and its generation for entrance makefile.= It=0D # uses template to generate the content of makefile. The content of makefi= le=0D # will be got from WorkspaceAutoGen object.=0D #=0D +=0D +=0D class TopLevelMakefile(BuildFile):=0D - ## template used to generate toplevel makefile=0D + # template used to generate toplevel makefile=0D _TEMPLATE_ =3D TemplateString('''${BEGIN}\tGenFds -f ${fdf_file} --con= f=3D${conf_directory} -o ${platform_build_directory} -t ${toolchain_tag} -b= ${build_target} -p ${active_platform} -a ${build_architecture_list} ${extr= a_options}${END}${BEGIN} -r ${fd} ${END}${BEGIN} -i ${fv} ${END}${BEGIN} -C= ${cap} ${END}${BEGIN} -D ${macro} ${END}''')=0D =0D - ## Constructor of TopLevelMakefile=0D + # Constructor of TopLevelMakefile=0D #=0D # @param Workspace Object of WorkspaceAutoGen class=0D #=0D @@ -1578,7 +1646,8 @@ class TopLevelMakefile(BuildFile): ExtraData=3D"[%s]" % str(MyAgo))=0D =0D for Arch in MyAgo.ArchList:=0D - self.IntermediateDirectoryList.append(Separator.join(["$(BUILD= _DIR)", Arch]))=0D + self.IntermediateDirectoryList.append(=0D + Separator.join(["$(BUILD_DIR)", Arch]))=0D self.IntermediateDirectoryList.append("$(FV_DIR)")=0D =0D # TRICK: for not generating GenFds call in makefile if no FDF file= =0D @@ -1591,7 +1660,8 @@ class TopLevelMakefile(BuildFile): MacroDict.update(GlobalData.gCommandLineDefines)=0D for MacroName in MacroDict:=0D if MacroDict[MacroName] !=3D "":=0D - MacroList.append('"%s=3D%s"' % (MacroName, MacroDict[M= acroName].replace('\\', '\\\\')))=0D + MacroList.append('"%s=3D%s"' % (=0D + MacroName, MacroDict[MacroName].replace('\\', '\\\= \')))=0D else:=0D MacroList.append('"%s"' % MacroName)=0D else:=0D @@ -1620,48 +1690,50 @@ class TopLevelMakefile(BuildFile): else:=0D pcdname =3D '.'.join(pcd[0:2])=0D if pcd[3].startswith('{'):=0D - ExtraOption +=3D " --pcd " + pcdname + '=3D' + 'H' + '"' += pcd[3] + '"'=0D + ExtraOption +=3D " --pcd " + pcdname + \=0D + '=3D' + 'H' + '"' + pcd[3] + '"'=0D else:=0D ExtraOption +=3D " --pcd " + pcdname + '=3D' + pcd[3]=0D =0D MakefileName =3D self.getMakefileName()=0D SubBuildCommandList =3D []=0D for A in MyAgo.ArchList:=0D - Command =3D self._MAKE_TEMPLATE_[self._Platform] % {"file":os.= path.join("$(BUILD_DIR)", A, MakefileName)}=0D + Command =3D self._MAKE_TEMPLATE_[self._Platform] % {=0D + "file": os.path.join("$(BUILD_DIR)", A, MakefileName)}=0D SubBuildCommandList.append(Command)=0D =0D MakefileTemplateDict =3D {=0D - "makefile_header" : self._FILE_HEADER_[self._FileTyp= e],=0D - "makefile_path" : os.path.join("$(BUILD_DIR)", Mak= efileName),=0D - "make_path" : MyAgo.ToolDefinition["MAKE"]["PA= TH"],=0D - "platform_name" : MyAgo.Name,=0D - "platform_guid" : MyAgo.Guid,=0D - "platform_version" : MyAgo.Version,=0D - "platform_build_directory" : MyAgo.BuildDir,=0D - "conf_directory" : GlobalData.gConfDirectory,=0D + "makefile_header": self._FILE_HEADER_[self._FileType],=0D + "makefile_path": os.path.join("$(BUILD_DIR)", MakefileName),=0D + "make_path": MyAgo.ToolDefinition["MAKE"]["PATH"],=0D + "platform_name": MyAgo.Name,=0D + "platform_guid": MyAgo.Guid,=0D + "platform_version": MyAgo.Version,=0D + "platform_build_directory": MyAgo.BuildDir,=0D + "conf_directory": GlobalData.gConfDirectory,=0D =0D - "toolchain_tag" : MyAgo.ToolChain,=0D - "build_target" : MyAgo.BuildTarget,=0D - "shell_command_code" : list(self._SHELL_CMD_[self._Plat= form].keys()),=0D - "shell_command" : list(self._SHELL_CMD_[self._Plat= form].values()),=0D - 'arch' : list(MyAgo.ArchList),=0D - "build_architecture_list" : ','.join(MyAgo.ArchList),=0D - "separator" : Separator,=0D - "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "cleanall_command" : self.GetRemoveDirectoryCommand(s= elf.IntermediateDirectoryList),=0D - "sub_build_command" : SubBuildCommandList,=0D - "fdf_file" : FdfFileList,=0D - "active_platform" : str(MyAgo),=0D - "fd" : MyAgo.FdTargetList,=0D - "fv" : MyAgo.FvTargetList,=0D - "cap" : MyAgo.CapTargetList,=0D - "extra_options" : ExtraOption,=0D - "macro" : MacroList,=0D + "toolchain_tag": MyAgo.ToolChain,=0D + "build_target": MyAgo.BuildTarget,=0D + "shell_command_code": list(self._SHELL_CMD_[self._Platform].ke= ys()),=0D + "shell_command": list(self._SHELL_CMD_[self._Platform].values(= )),=0D + 'arch': list(MyAgo.ArchList),=0D + "build_architecture_list": ','.join(MyAgo.ArchList),=0D + "separator": Separator,=0D + "create_directory_command": self.GetCreateDirectoryCommand(sel= f.IntermediateDirectoryList),=0D + "cleanall_command": self.GetRemoveDirectoryCommand(self.Interm= ediateDirectoryList),=0D + "sub_build_command": SubBuildCommandList,=0D + "fdf_file": FdfFileList,=0D + "active_platform": str(MyAgo),=0D + "fd": MyAgo.FdTargetList,=0D + "fv": MyAgo.FvTargetList,=0D + "cap": MyAgo.CapTargetList,=0D + "extra_options": ExtraOption,=0D + "macro": MacroList,=0D }=0D =0D return MakefileTemplateDict=0D =0D - ## Get the root directory list for intermediate files of all modules b= uild=0D + # Get the root directory list for intermediate files of all modules bu= ild=0D #=0D # @retval list The list of directory=0D #=0D @@ -1669,10 +1741,11 @@ class TopLevelMakefile(BuildFile): DirList =3D []=0D for ModuleAutoGen in self._AutoGenObject.ModuleAutoGenList:=0D if not ModuleAutoGen.IsBinaryModule:=0D - DirList.append(os.path.join(self._AutoGenObject.BuildDir, = ModuleAutoGen.BuildDir))=0D + DirList.append(os.path.join(=0D + self._AutoGenObject.BuildDir, ModuleAutoGen.BuildDir))= =0D return DirList=0D =0D - ## Get the root directory list for intermediate files of all libraries= build=0D + # Get the root directory list for intermediate files of all libraries = build=0D #=0D # @retval list The list of directory=0D #=0D @@ -1680,10 +1753,11 @@ class TopLevelMakefile(BuildFile): DirList =3D []=0D for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:=0D if not LibraryAutoGen.IsBinaryModule:=0D - DirList.append(os.path.join(self._AutoGenObject.BuildDir, = LibraryAutoGen.BuildDir))=0D + DirList.append(os.path.join(=0D + self._AutoGenObject.BuildDir, LibraryAutoGen.BuildDir)= )=0D return DirList=0D =0D -## Find dependencies for one source file=0D +# Find dependencies for one source file=0D #=0D # By searching recursively "#include" directive in file, find out all the= =0D # files needed by given source file. The dependencies will be only search= ed=0D @@ -1695,8 +1769,11 @@ class TopLevelMakefile(BuildFile): #=0D # @retval list The list of files the given source file de= pends on=0D #=0D +=0D +=0D def GetDependencyList(AutoGenObject, FileCache, File, ForceList, SearchPat= hList):=0D - EdkLogger.debug(EdkLogger.DEBUG_1, "Try to get dependency files for %s= " % File)=0D + EdkLogger.debug(EdkLogger.DEBUG_1,=0D + "Try to get dependency files for %s" % File)=0D FileStack =3D [File] + ForceList=0D DependencySet =3D set()=0D =0D @@ -1725,7 +1802,8 @@ def GetDependencyList(AutoGenObject, FileCache, File,= ForceList, SearchPathList) FileContent =3D Fd.read()=0D Fd.close()=0D except BaseException as X:=0D - EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DF.= Path + "\n\t" + str(X))=0D + EdkLogger.error("build", FILE_OPEN_FAILURE,=0D + ExtraData=3DF.Path + "\n\t" + str(X))=0D if len(FileContent) =3D=3D 0:=0D continue=0D try:=0D @@ -1746,7 +1824,8 @@ def GetDependencyList(AutoGenObject, FileCache, File,= ForceList, SearchPathList) HeaderType =3D HeaderList[0][0]=0D HeaderKey =3D HeaderList[0][1]=0D if HeaderType in gIncludeMacroConversion:=0D - Inc =3D gIncludeMacroConversion[HeaderType] % {"He= aderKey" : HeaderKey}=0D + Inc =3D gIncludeMacroConversion[HeaderType] % {=0D + "HeaderKey": HeaderKey}=0D else:=0D # not known macro used in #include, always build t= he file by=0D # returning a empty dependency=0D @@ -1776,7 +1855,7 @@ def GetDependencyList(AutoGenObject, FileCache, File,= ForceList, SearchPathList) FileStack.append(FilePath)=0D break=0D else:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "%s included by %s was = not found "\=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "%s included by %s was = not found "=0D "in any given path:\n\t%s" % (Inc, F, "\n\= t".join(SearchPathList)))=0D =0D FileCache[F] =3D FullPathDependList=0D @@ -1789,6 +1868,7 @@ def GetDependencyList(AutoGenObject, FileCache, File,= ForceList, SearchPathList) =0D return DependencyList=0D =0D +=0D # This acts like the main() function for the script, unless it is 'import'= ed into another script.=0D if __name__ =3D=3D '__main__':=0D pass=0D diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source= /Python/AutoGen/GenPcdDb.py index ad5dae0e5a2f..8bf76e6a7058 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Routines for generating Pcd Database=0D #=0D # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -94,10 +94,10 @@ ${END} #endif=0D """)=0D =0D -## Mapping between PCD driver type and EFI phase=0D +# Mapping between PCD driver type and EFI phase=0D gPcdPhaseMap =3D {=0D - "PEI_PCD_DRIVER" : "PEI",=0D - "DXE_PCD_DRIVER" : "DXE"=0D + "PEI_PCD_DRIVER": "PEI",=0D + "DXE_PCD_DRIVER": "DXE"=0D }=0D =0D gPcdDatabaseAutoGenH =3D TemplateString("""=0D @@ -233,7 +233,7 @@ ${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit =3D { #endif=0D """)=0D =0D -## DbItemList=0D +# DbItemList=0D #=0D # The class holds the Pcd database items. ItemSize if not zero should mat= ch the item datum type in the C structure.=0D # When the structure is changed, remember to check the ItemSize and the r= elated PackStr in PackData()=0D @@ -241,6 +241,8 @@ ${PHASE}_PCD_DATABASE_INIT g${PHASE}PcdDbInit =3D { # the DataList corresponds to the data that need to be written to databas= e. If DataList is not present, then RawDataList=0D # will be written to the database.=0D #=0D +=0D +=0D class DbItemList:=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D self.ItemSize =3D ItemSize=0D @@ -269,13 +271,14 @@ class DbItemList: self.ListSize =3D 0=0D return self.ListSize=0D if self.ItemSize =3D=3D 0:=0D - self.ListSize =3D self.GetInterOffset(len(self.RawDataList) - = 1) + len(self.RawDataList[len(self.RawDataList)-1])=0D + self.ListSize =3D self.GetInterOffset(=0D + len(self.RawDataList) - 1) + len(self.RawDataList[len(self= .RawDataList)-1])=0D else:=0D self.ListSize =3D self.ItemSize * len(self.RawDataList)=0D return self.ListSize=0D =0D def PackData(self):=0D - ## PackGuid=0D + # PackGuid=0D #=0D # Pack the GUID value in C structure format into data array=0D #=0D @@ -305,10 +308,12 @@ class DbItemList: =0D return Buffer=0D =0D -## DbExMapTblItemList=0D +# DbExMapTblItemList=0D #=0D # The class holds the ExMap table=0D #=0D +=0D +=0D class DbExMapTblItemList (DbItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbItemList.__init__(self, ItemSize, DataList, RawDataList)=0D @@ -323,11 +328,13 @@ class DbExMapTblItemList (DbItemList): GetIntegerValue(Datas[2]))=0D return Buffer=0D =0D -## DbComItemList=0D +# DbComItemList=0D #=0D # The DbComItemList is a special kind of DbItemList in case that the size = of the List can not be computed by the=0D # ItemSize multiply the ItemCount.=0D #=0D +=0D +=0D class DbComItemList (DbItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbItemList.__init__(self, ItemSize, DataList, RawDataList)=0D @@ -356,7 +363,8 @@ class DbComItemList (DbItemList): if len(self.RawDataList) =3D=3D 0:=0D self.ListSize =3D 0=0D else:=0D - self.ListSize =3D self.GetInterOffset(len(self.RawDataList= ) - 1) + len(self.RawDataList[len(self.RawDataList)-1]) * self.ItemSize=0D + self.ListSize =3D self.GetInterOffset(len(=0D + self.RawDataList) - 1) + len(self.RawDataList[len(self= .RawDataList)-1]) * self.ItemSize=0D =0D return self.ListSize=0D =0D @@ -374,10 +382,12 @@ class DbComItemList (DbItemList): =0D return Buffer=0D =0D -## DbVariableTableItemList=0D +# DbVariableTableItemList=0D #=0D # The class holds the Variable header value table=0D #=0D +=0D +=0D class DbVariableTableItemList (DbComItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbComItemList.__init__(self, ItemSize, DataList, RawDataList)=0D @@ -397,8 +407,9 @@ class DbVariableTableItemList (DbComItemList): GetIntegerValue(0))=0D return Buffer=0D =0D +=0D class DbStringHeadTableItemList(DbItemList):=0D - def __init__(self,ItemSize,DataList=3DNone,RawDataList=3DNone):=0D + def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbItemList.__init__(self, ItemSize, DataList, RawDataList)=0D =0D def GetInterOffset(self, Index):=0D @@ -426,7 +437,8 @@ class DbStringHeadTableItemList(DbItemList): self.ListSize =3D 0=0D return self.ListSize=0D if self.ItemSize =3D=3D 0:=0D - self.ListSize =3D self.GetInterOffset(len(self.RawDataList) - = 1) + len(self.RawDataList[len(self.RawDataList)-1])=0D + self.ListSize =3D self.GetInterOffset(=0D + len(self.RawDataList) - 1) + len(self.RawDataList[len(self= .RawDataList)-1])=0D else:=0D for Datas in self.RawDataList:=0D if type(Datas) in (list, tuple):=0D @@ -435,10 +447,12 @@ class DbStringHeadTableItemList(DbItemList): self.ListSize +=3D self.ItemSize=0D return self.ListSize=0D =0D -## DbSkuHeadTableItemList=0D +# DbSkuHeadTableItemList=0D #=0D # The class holds the Sku header value table=0D #=0D +=0D +=0D class DbSkuHeadTableItemList (DbItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbItemList.__init__(self, ItemSize, DataList, RawDataList)=0D @@ -452,10 +466,12 @@ class DbSkuHeadTableItemList (DbItemList): GetIntegerValue(Data[1]))=0D return Buffer=0D =0D -## DbSizeTableItemList=0D +# DbSizeTableItemList=0D #=0D # The class holds the size table=0D #=0D +=0D +=0D class DbSizeTableItemList (DbItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone):=0D DbItemList.__init__(self, ItemSize, DataList, RawDataList)=0D @@ -465,6 +481,7 @@ class DbSizeTableItemList (DbItemList): for Data in self.RawDataList:=0D length +=3D (1 + len(Data[1]))=0D return length * self.ItemSize=0D +=0D def PackData(self):=0D PackStr =3D "=3DH"=0D Buffer =3D bytearray()=0D @@ -473,13 +490,15 @@ class DbSizeTableItemList (DbItemList): GetIntegerValue(Data[0]))=0D for subData in Data[1]:=0D Buffer +=3D pack(PackStr,=0D - GetIntegerValue(subData))=0D + GetIntegerValue(subData))=0D return Buffer=0D =0D -## DbStringItemList=0D +# DbStringItemList=0D #=0D # The class holds the string table=0D #=0D +=0D +=0D class DbStringItemList (DbComItemList):=0D def __init__(self, ItemSize, DataList=3DNone, RawDataList=3DNone, LenL= ist=3DNone):=0D if DataList is None:=0D @@ -504,6 +523,7 @@ class DbStringItemList (DbComItemList): DataList.append(ActualDatas)=0D self.LenList =3D LenList=0D DbComItemList.__init__(self, ItemSize, DataList, RawDataList)=0D +=0D def GetInterOffset(self, Index):=0D Offset =3D 0=0D =0D @@ -520,7 +540,8 @@ class DbStringItemList (DbComItemList): if len(self.LenList) =3D=3D 0:=0D self.ListSize =3D 0=0D else:=0D - self.ListSize =3D self.GetInterOffset(len(self.LenList) - 1) += self.LenList[len(self.LenList)-1]=0D + self.ListSize =3D self.GetInterOffset(=0D + len(self.LenList) - 1) + self.LenList[len(self.LenList)-1]= =0D =0D return self.ListSize=0D =0D @@ -529,8 +550,7 @@ class DbStringItemList (DbComItemList): return DbComItemList.PackData(self)=0D =0D =0D -=0D -## Find the index in two list where the item matches the key separately=0D +# Find the index in two list where the item matches the key separately=0D #=0D # @param Key1 The key used to search the List1=0D # @param List1 The list that Key1 will be searched=0D @@ -551,7 +571,7 @@ def GetMatchedIndex(Key1, List1, Key2, List2): return -1=0D =0D =0D -## convert StringArray like {0x36, 0x00, 0x34, 0x00, 0x21, 0x00, 0x36, 0x0= 0, 0x34, 0x00, 0x00, 0x00}=0D +# convert StringArray like {0x36, 0x00, 0x34, 0x00, 0x21, 0x00, 0x36, 0x00= , 0x34, 0x00, 0x00, 0x00}=0D # to List like [0x36, 0x00, 0x34, 0x00, 0x21, 0x00, 0x36, 0x00, 0x34, 0x00= , 0x00, 0x00]=0D #=0D # @param StringArray A string array like {0x36, 0x00, 0x34, 0x00, 0= x21, 0x00, 0x36, 0x00, 0x34, 0x00, 0x00, 0x00}=0D @@ -564,7 +584,7 @@ def StringArrayToList(StringArray): return eval(StringArray)=0D =0D =0D -## Convert TokenType String like "PCD_DATUM_TYPE_UINT32 | PCD_TYPE_HII" t= o TokenType value=0D +# Convert TokenType String like "PCD_DATUM_TYPE_UINT32 | PCD_TYPE_HII" to= TokenType value=0D #=0D # @param TokenType A TokenType string like "PCD_DATUM_TYPE_UINT32 = | PCD_TYPE_HII"=0D #=0D @@ -576,7 +596,7 @@ def GetTokenTypeValue(TokenType): "PCD_TYPE_DATA": (0x0 << 28),=0D "PCD_TYPE_HII": (0x8 << 28),=0D "PCD_TYPE_VPD": (0x4 << 28),=0D -# "PCD_TYPE_SKU_ENABLED":(0x2 << 28),=0D + # "PCD_TYPE_SKU_ENABLED":(0x2 << 28),=0D "PCD_TYPE_STRING": (0x1 << 28),=0D =0D "PCD_DATUM_TYPE_SHIFT": 24,=0D @@ -588,106 +608,112 @@ def GetTokenTypeValue(TokenType): =0D "PCD_DATUM_TYPE_SHIFT2": 20,=0D "PCD_DATUM_TYPE_UINT8_BOOLEAN": (0x1 << 20 | 0x1 << 24),=0D - }=0D + }=0D return eval(TokenType, TokenTypeDict)=0D =0D -## construct the external Pcd database using data from Dict=0D +# construct the external Pcd database using data from Dict=0D #=0D # @param Dict A dictionary contains Pcd related tables=0D #=0D # @retval Buffer A byte stream of the Pcd database=0D #=0D +=0D +=0D def BuildExDataBase(Dict):=0D # init Db items=0D InitValueUint64 =3D Dict['INIT_DB_VALUE_UINT64']=0D - DbInitValueUint64 =3D DbComItemList(8, RawDataList =3D InitValueUint64= )=0D + DbInitValueUint64 =3D DbComItemList(8, RawDataList=3DInitValueUint64)= =0D VardefValueUint64 =3D Dict['VARDEF_DB_VALUE_UINT64']=0D - DbVardefValueUint64 =3D DbItemList(8, RawDataList =3D VardefValueUint6= 4)=0D + DbVardefValueUint64 =3D DbItemList(8, RawDataList=3DVardefValueUint64)= =0D InitValueUint32 =3D Dict['INIT_DB_VALUE_UINT32']=0D - DbInitValueUint32 =3D DbComItemList(4, RawDataList =3D InitValueUint32= )=0D + DbInitValueUint32 =3D DbComItemList(4, RawDataList=3DInitValueUint32)= =0D VardefValueUint32 =3D Dict['VARDEF_DB_VALUE_UINT32']=0D - DbVardefValueUint32 =3D DbItemList(4, RawDataList =3D VardefValueUint3= 2)=0D + DbVardefValueUint32 =3D DbItemList(4, RawDataList=3DVardefValueUint32)= =0D VpdHeadValue =3D Dict['VPD_DB_VALUE']=0D - DbVpdHeadValue =3D DbComItemList(4, RawDataList =3D VpdHeadValue)=0D - ExMapTable =3D list(zip(Dict['EXMAPPING_TABLE_EXTOKEN'], Dict['EXMAPPI= NG_TABLE_LOCAL_TOKEN'], Dict['EXMAPPING_TABLE_GUID_INDEX']))=0D - DbExMapTable =3D DbExMapTblItemList(8, RawDataList =3D ExMapTable)=0D + DbVpdHeadValue =3D DbComItemList(4, RawDataList=3DVpdHeadValue)=0D + ExMapTable =3D list(zip(Dict['EXMAPPING_TABLE_EXTOKEN'],=0D + Dict['EXMAPPING_TABLE_LOCAL_TOKEN'], Dict['EXMAPPING= _TABLE_GUID_INDEX']))=0D + DbExMapTable =3D DbExMapTblItemList(8, RawDataList=3DExMapTable)=0D LocalTokenNumberTable =3D Dict['LOCAL_TOKEN_NUMBER_DB_VALUE']=0D - DbLocalTokenNumberTable =3D DbItemList(4, RawDataList =3D LocalTokenNu= mberTable)=0D + DbLocalTokenNumberTable =3D DbItemList(4, RawDataList=3DLocalTokenNumb= erTable)=0D GuidTable =3D Dict['GUID_STRUCTURE']=0D - DbGuidTable =3D DbItemList(16, RawDataList =3D GuidTable)=0D + DbGuidTable =3D DbItemList(16, RawDataList=3DGuidTable)=0D StringHeadValue =3D Dict['STRING_DB_VALUE']=0D # DbItemList to DbStringHeadTableItemList=0D - DbStringHeadValue =3D DbStringHeadTableItemList(4, RawDataList =3D Str= ingHeadValue)=0D + DbStringHeadValue =3D DbStringHeadTableItemList(=0D + 4, RawDataList=3DStringHeadValue)=0D VariableTable =3D Dict['VARIABLE_DB_VALUE']=0D - DbVariableTable =3D DbVariableTableItemList(20, RawDataList =3D Variab= leTable)=0D + DbVariableTable =3D DbVariableTableItemList(20, RawDataList=3DVariable= Table)=0D NumberOfSkuEnabledPcd =3D GetIntegerValue(Dict['SKU_HEAD_SIZE'])=0D =0D - Dict['STRING_TABLE_DB_VALUE'] =3D [StringArrayToList(x) for x in Dict[= 'STRING_TABLE_VALUE']]=0D + Dict['STRING_TABLE_DB_VALUE'] =3D [=0D + StringArrayToList(x) for x in Dict['STRING_TABLE_VALUE']]=0D =0D StringTableValue =3D Dict['STRING_TABLE_DB_VALUE']=0D # when calcute the offset, should use StringTableLen instead of String= TableValue, as string maximum len may be different with actual len=0D StringTableLen =3D Dict['STRING_TABLE_LENGTH']=0D - DbStringTableLen =3D DbStringItemList(0, RawDataList =3D StringTableVa= lue, LenList =3D StringTableLen)=0D -=0D + DbStringTableLen =3D DbStringItemList(=0D + 0, RawDataList=3DStringTableValue, LenList=3DStringTableLen)=0D =0D PcdTokenTable =3D Dict['PCD_TOKENSPACE']=0D PcdTokenLen =3D Dict['PCD_TOKENSPACE_LENGTH']=0D PcdTokenTableValue =3D [StringArrayToList(x) for x in Dict['PCD_TOKENS= PACE']]=0D - DbPcdTokenTable =3D DbStringItemList(0, RawDataList =3D PcdTokenTableV= alue, LenList =3D PcdTokenLen)=0D + DbPcdTokenTable =3D DbStringItemList(=0D + 0, RawDataList=3DPcdTokenTableValue, LenList=3DPcdTokenLen)=0D =0D PcdCNameTable =3D Dict['PCD_CNAME']=0D PcdCNameLen =3D Dict['PCD_CNAME_LENGTH']=0D PcdCNameTableValue =3D [StringArrayToList(x) for x in Dict['PCD_CNAME'= ]]=0D - DbPcdCNameTable =3D DbStringItemList(0, RawDataList =3D PcdCNameTableV= alue, LenList =3D PcdCNameLen)=0D + DbPcdCNameTable =3D DbStringItemList(=0D + 0, RawDataList=3DPcdCNameTableValue, LenList=3DPcdCNameLen)=0D =0D PcdNameOffsetTable =3D Dict['PCD_NAME_OFFSET']=0D - DbPcdNameOffsetTable =3D DbItemList(4, RawDataList =3D PcdNameOffsetTa= ble)=0D + DbPcdNameOffsetTable =3D DbItemList(4, RawDataList=3DPcdNameOffsetTabl= e)=0D =0D - SizeTableValue =3D list(zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['S= IZE_TABLE_CURRENT_LENGTH']))=0D - DbSizeTableValue =3D DbSizeTableItemList(2, RawDataList =3D SizeTableV= alue)=0D + SizeTableValue =3D list(=0D + zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_TABLE_CURRENT_LE= NGTH']))=0D + DbSizeTableValue =3D DbSizeTableItemList(2, RawDataList=3DSizeTableVal= ue)=0D InitValueUint16 =3D Dict['INIT_DB_VALUE_UINT16']=0D - DbInitValueUint16 =3D DbComItemList(2, RawDataList =3D InitValueUint16= )=0D + DbInitValueUint16 =3D DbComItemList(2, RawDataList=3DInitValueUint16)= =0D VardefValueUint16 =3D Dict['VARDEF_DB_VALUE_UINT16']=0D - DbVardefValueUint16 =3D DbItemList(2, RawDataList =3D VardefValueUint1= 6)=0D + DbVardefValueUint16 =3D DbItemList(2, RawDataList=3DVardefValueUint16)= =0D InitValueUint8 =3D Dict['INIT_DB_VALUE_UINT8']=0D - DbInitValueUint8 =3D DbComItemList(1, RawDataList =3D InitValueUint8)= =0D + DbInitValueUint8 =3D DbComItemList(1, RawDataList=3DInitValueUint8)=0D VardefValueUint8 =3D Dict['VARDEF_DB_VALUE_UINT8']=0D - DbVardefValueUint8 =3D DbItemList(1, RawDataList =3D VardefValueUint8)= =0D + DbVardefValueUint8 =3D DbItemList(1, RawDataList=3DVardefValueUint8)=0D InitValueBoolean =3D Dict['INIT_DB_VALUE_BOOLEAN']=0D - DbInitValueBoolean =3D DbComItemList(1, RawDataList =3D InitValueBoole= an)=0D + DbInitValueBoolean =3D DbComItemList(1, RawDataList=3DInitValueBoolean= )=0D VardefValueBoolean =3D Dict['VARDEF_DB_VALUE_BOOLEAN']=0D - DbVardefValueBoolean =3D DbItemList(1, RawDataList =3D VardefValueBool= ean)=0D + DbVardefValueBoolean =3D DbItemList(1, RawDataList=3DVardefValueBoolea= n)=0D SkuidValue =3D Dict['SKUID_VALUE']=0D - DbSkuidValue =3D DbItemList(8, RawDataList =3D SkuidValue)=0D -=0D -=0D + DbSkuidValue =3D DbItemList(8, RawDataList=3DSkuidValue)=0D =0D # Unit Db Items=0D UnInitValueUint64 =3D Dict['UNINIT_GUID_DECL_UINT64']=0D - DbUnInitValueUint64 =3D DbItemList(8, RawDataList =3D UnInitValueUint6= 4)=0D + DbUnInitValueUint64 =3D DbItemList(8, RawDataList=3DUnInitValueUint64)= =0D UnInitValueUint32 =3D Dict['UNINIT_GUID_DECL_UINT32']=0D - DbUnInitValueUint32 =3D DbItemList(4, RawDataList =3D UnInitValueUint3= 2)=0D + DbUnInitValueUint32 =3D DbItemList(4, RawDataList=3DUnInitValueUint32)= =0D UnInitValueUint16 =3D Dict['UNINIT_GUID_DECL_UINT16']=0D - DbUnInitValueUint16 =3D DbItemList(2, RawDataList =3D UnInitValueUint1= 6)=0D + DbUnInitValueUint16 =3D DbItemList(2, RawDataList=3DUnInitValueUint16)= =0D UnInitValueUint8 =3D Dict['UNINIT_GUID_DECL_UINT8']=0D - DbUnInitValueUint8 =3D DbItemList(1, RawDataList =3D UnInitValueUint8)= =0D + DbUnInitValueUint8 =3D DbItemList(1, RawDataList=3DUnInitValueUint8)=0D UnInitValueBoolean =3D Dict['UNINIT_GUID_DECL_BOOLEAN']=0D - DbUnInitValueBoolean =3D DbItemList(1, RawDataList =3D UnInitValueBool= ean)=0D + DbUnInitValueBoolean =3D DbItemList(1, RawDataList=3DUnInitValueBoolea= n)=0D PcdTokenNumberMap =3D Dict['PCD_ORDER_TOKEN_NUMBER_MAP']=0D =0D DbNameTotle =3D ["SkuidValue", "InitValueUint64", "VardefValueUint64"= , "InitValueUint32", "VardefValueUint32", "VpdHeadValue", "ExMapTable",=0D - "LocalTokenNumberTable", "GuidTable", "StringHeadValue", "= PcdNameOffsetTable", "VariableTable", "StringTableLen", "PcdTokenTable", "P= cdCNameTable",=0D - "SizeTableValue", "InitValueUint16", "VardefValueUint16", "= InitValueUint8", "VardefValueUint8", "InitValueBoolean",=0D - "VardefValueBoolean", "UnInitValueUint64", "UnInitValueUint= 32", "UnInitValueUint16", "UnInitValueUint8", "UnInitValueBoolean"]=0D + "LocalTokenNumberTable", "GuidTable", "StringHeadValue"= , "PcdNameOffsetTable", "VariableTable", "StringTableLen", "PcdTokenTable"= , "PcdCNameTable",=0D + "SizeTableValue", "InitValueUint16", "VardefValueUint16= ", "InitValueUint8", "VardefValueUint8", "InitValueBoolean",=0D + "VardefValueBoolean", "UnInitValueUint64", "UnInitValue= Uint32", "UnInitValueUint16", "UnInitValueUint8", "UnInitValueBoolean"]=0D =0D DbTotal =3D [SkuidValue, InitValueUint64, VardefValueUint64, InitValu= eUint32, VardefValueUint32, VpdHeadValue, ExMapTable,=0D LocalTokenNumberTable, GuidTable, StringHeadValue, PcdName= OffsetTable, VariableTable, StringTableLen, PcdTokenTable, PcdCNameTable,=0D SizeTableValue, InitValueUint16, VardefValueUint16, InitVal= ueUint8, VardefValueUint8, InitValueBoolean,=0D VardefValueBoolean, UnInitValueUint64, UnInitValueUint32, U= nInitValueUint16, UnInitValueUint8, UnInitValueBoolean]=0D DbItemTotal =3D [DbSkuidValue, DbInitValueUint64, DbVardefValueUint64= , DbInitValueUint32, DbVardefValueUint32, DbVpdHeadValue, DbExMapTable,=0D - DbLocalTokenNumberTable, DbGuidTable, DbStringHeadValue, D= bPcdNameOffsetTable, DbVariableTable, DbStringTableLen, DbPcdTokenTable, Db= PcdCNameTable,=0D - DbSizeTableValue, DbInitValueUint16, DbVardefValueUint16, D= bInitValueUint8, DbVardefValueUint8, DbInitValueBoolean,=0D - DbVardefValueBoolean, DbUnInitValueUint64, DbUnInitValueUin= t32, DbUnInitValueUint16, DbUnInitValueUint8, DbUnInitValueBoolean]=0D + DbLocalTokenNumberTable, DbGuidTable, DbStringHeadValue= , DbPcdNameOffsetTable, DbVariableTable, DbStringTableLen, DbPcdTokenTable= , DbPcdCNameTable,=0D + DbSizeTableValue, DbInitValueUint16, DbVardefValueUint1= 6, DbInitValueUint8, DbVardefValueUint8, DbInitValueBoolean,=0D + DbVardefValueBoolean, DbUnInitValueUint64, DbUnInitValu= eUint32, DbUnInitValueUint16, DbUnInitValueUint8, DbUnInitValueBoolean]=0D =0D # VardefValueBoolean is the last table in the init table items=0D InitTableNum =3D DbNameTotle.index("VardefValueBoolean") + 1=0D @@ -701,7 +727,6 @@ def BuildExDataBase(Dict): break=0D SkuIdTableOffset +=3D DbItemTotal[DbIndex].GetListSize()=0D =0D -=0D # Get offset of SkuValue table in the database=0D =0D # Fix up the LocalTokenNumberTable, SkuHeader table=0D @@ -721,22 +746,22 @@ def BuildExDataBase(Dict): =0D TokenTypeValue =3D Dict['TOKEN_TYPE'][LocalTokenNumberTableIndex]= =0D TokenTypeValue =3D GetTokenTypeValue(TokenTypeValue)=0D - LocalTokenNumberTable[LocalTokenNumberTableIndex] =3D DbOffset|int= (TokenTypeValue)=0D + LocalTokenNumberTable[LocalTokenNumberTableIndex] =3D DbOffset | i= nt(=0D + TokenTypeValue)=0D # if PCD_TYPE_SKU_ENABLED, then we need to fix up the SkuTable=0D =0D -=0D -=0D -=0D # resolve variable table offset=0D for VariableEntries in VariableTable:=0D skuindex =3D 0=0D for VariableEntryPerSku in VariableEntries:=0D - (VariableHeadGuidIndex, VariableHeadStringIndex, SKUVariableOf= fset, VariableOffset, VariableRefTable, VariableAttribute) =3D VariableEntr= yPerSku[:]=0D + (VariableHeadGuidIndex, VariableHeadStringIndex, SKUVariableOf= fset,=0D + VariableOffset, VariableRefTable, VariableAttribute) =3D Vari= ableEntryPerSku[:]=0D DbIndex =3D 0=0D DbOffset =3D FixedHeaderLen=0D for DbIndex in range(len(DbTotal)):=0D if DbTotal[DbIndex] is VariableRefTable:=0D - DbOffset +=3D DbItemTotal[DbIndex].GetInterOffset(Vari= ableOffset)=0D + DbOffset +=3D DbItemTotal[DbIndex].GetInterOffset(=0D + VariableOffset)=0D break=0D DbOffset +=3D DbItemTotal[DbIndex].GetListSize()=0D if DbIndex + 1 =3D=3D InitTableNum:=0D @@ -749,8 +774,10 @@ def BuildExDataBase(Dict): skuindex +=3D 1=0D if DbIndex >=3D InitTableNum:=0D assert(False)=0D - VarAttr, VarProp =3D VariableAttributes.GetVarAttributes(Varia= bleAttribute)=0D - VariableEntryPerSku[:] =3D (VariableHeadStringIndex, DbOffset,= VariableHeadGuidIndex, SKUVariableOffset, VarAttr, VarProp)=0D + VarAttr, VarProp =3D VariableAttributes.GetVarAttributes(=0D + VariableAttribute)=0D + VariableEntryPerSku[:] =3D (VariableHeadStringIndex, DbOffset,= =0D + VariableHeadGuidIndex, SKUVariableOf= fset, VarAttr, VarProp)=0D =0D # calculate various table offset now=0D DbTotalLength =3D FixedHeaderLen=0D @@ -770,17 +797,16 @@ def BuildExDataBase(Dict): elif DbItemTotal[DbIndex] is DbPcdNameOffsetTable:=0D DbPcdNameOffset =3D DbTotalLength=0D =0D -=0D DbTotalLength +=3D DbItemTotal[DbIndex].GetListSize()=0D if not Dict['PCD_INFO_FLAG']:=0D - DbPcdNameOffset =3D 0=0D + DbPcdNameOffset =3D 0=0D LocalTokenCount =3D GetIntegerValue(Dict['LOCAL_TOKEN_NUMBER'])=0D ExTokenCount =3D GetIntegerValue(Dict['EX_TOKEN_NUMBER'])=0D GuidTableCount =3D GetIntegerValue(Dict['GUID_TABLE_SIZE'])=0D SystemSkuId =3D GetIntegerValue(Dict['SYSTEM_SKU_ID_VALUE'])=0D Pad =3D 0xDA=0D =0D - UninitDataBaseSize =3D 0=0D + UninitDataBaseSize =3D 0=0D for Item in (DbUnInitValueUint64, DbUnInitValueUint32, DbUnInitValueUi= nt16, DbUnInitValueUint8, DbUnInitValueBoolean):=0D UninitDataBaseSize +=3D Item.GetListSize()=0D =0D @@ -846,7 +872,7 @@ def BuildExDataBase(Dict): =0D Index =3D 0=0D for Item in DbItemTotal:=0D - Index +=3D1=0D + Index +=3D 1=0D packdata =3D Item.PackData()=0D for i in range(len(packdata)):=0D Buffer +=3D packdata[i:i + 1]=0D @@ -858,20 +884,23 @@ def BuildExDataBase(Dict): break=0D return Buffer=0D =0D -## Create code for PCD database=0D +# Create code for PCD database=0D #=0D # @param Info The ModuleAutoGen object=0D # @param AutoGenC The TemplateString object for C code=0D # @param AutoGenH The TemplateString object for header file=0D #=0D -def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):=0D +=0D +=0D +def CreatePcdDatabaseCode(Info, AutoGenC, AutoGenH):=0D if Info.PcdIsDriver =3D=3D "":=0D return=0D if Info.PcdIsDriver not in gPcdPhaseMap:=0D EdkLogger.error("build", AUTOGEN_ERROR, "Not supported PcdIsDriver= type:%s" % Info.PcdIsDriver,=0D ExtraData=3D"[%s]" % str(Info))=0D =0D - AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer =3D NewCreatePcdDa= tabasePhaseSpecificAutoGen (Info.PlatformInfo, 'PEI')=0D + AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer =3D NewCreatePcdDa= tabasePhaseSpecificAutoGen(=0D + Info.PlatformInfo, 'PEI')=0D AutoGenH.Append(AdditionalAutoGenH.String)=0D =0D Phase =3D gPcdPhaseMap[Info.PcdIsDriver]=0D @@ -879,26 +908,32 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH): AutoGenC.Append(AdditionalAutoGenC.String)=0D =0D if Phase =3D=3D 'DXE':=0D - AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer =3D NewCreateP= cdDatabasePhaseSpecificAutoGen (Info.PlatformInfo, Phase)=0D + AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer =3D NewCreateP= cdDatabasePhaseSpecificAutoGen(=0D + Info.PlatformInfo, Phase)=0D AutoGenH.Append(AdditionalAutoGenH.String)=0D AutoGenC.Append(AdditionalAutoGenC.String)=0D =0D if Info.IsBinaryModule:=0D - DbFileName =3D os.path.join(Info.PlatformInfo.BuildDir, TAB_FV_DIR= ECTORY, Phase + "PcdDataBase.raw")=0D + DbFileName =3D os.path.join(=0D + Info.PlatformInfo.BuildDir, TAB_FV_DIRECTORY, Phase + "PcdData= Base.raw")=0D else:=0D DbFileName =3D os.path.join(Info.OutputDir, Phase + "PcdDataBase.r= aw")=0D DbFile =3D BytesIO()=0D DbFile.write(PcdDbBuffer)=0D Changed =3D SaveFileOnChange(DbFileName, DbFile.getvalue(), True)=0D +=0D +=0D def CreatePcdDataBase(PcdDBData):=0D delta =3D {}=0D for skuname, skuid in PcdDBData:=0D if len(PcdDBData[(skuname, skuid)][1]) !=3D len(PcdDBData[(TAB_DEF= AULT, "0")][1]):=0D - EdkLogger.error("build", AUTOGEN_ERROR, "The size of each sku = in one pcd are not same")=0D + EdkLogger.error("build", AUTOGEN_ERROR,=0D + "The size of each sku in one pcd are not same"= )=0D for skuname, skuid in PcdDBData:=0D if skuname =3D=3D TAB_DEFAULT:=0D continue=0D - delta[(skuname, skuid)] =3D [(index, data, hex(data)) for index, d= ata in enumerate(PcdDBData[(skuname, skuid)][1]) if PcdDBData[(skuname, sku= id)][1][index] !=3D PcdDBData[(TAB_DEFAULT, "0")][1][index]]=0D + delta[(skuname, skuid)] =3D [(index, data, hex(data)) for index, d= ata in enumerate(PcdDBData[(=0D + skuname, skuid)][1]) if PcdDBData[(skuname, skuid)][1][index] = !=3D PcdDBData[(TAB_DEFAULT, "0")][1][index]]=0D databasebuff =3D PcdDBData[(TAB_DEFAULT, "0")][0]=0D =0D for skuname, skuid in delta:=0D @@ -922,25 +957,30 @@ def CreatePcdDataBase(PcdDBData): =0D return newbuffer=0D =0D +=0D def CreateVarCheckBin(VarCheckTab):=0D return VarCheckTab[(TAB_DEFAULT, "0")]=0D =0D +=0D def CreateAutoGen(PcdDriverAutoGenData):=0D autogenC =3D TemplateString()=0D for skuname, skuid in PcdDriverAutoGenData:=0D autogenC.Append("//SKUID: %s" % skuname)=0D autogenC.Append(PcdDriverAutoGenData[(skuname, skuid)][1].String)= =0D return (PcdDriverAutoGenData[(skuname, skuid)][0], autogenC)=0D +=0D +=0D def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform, Phase):=0D def prune_sku(pcd, skuname):=0D new_pcd =3D copy.deepcopy(pcd)=0D - new_pcd.SkuInfoList =3D {skuname:pcd.SkuInfoList[skuname]}=0D + new_pcd.SkuInfoList =3D {skuname: pcd.SkuInfoList[skuname]}=0D new_pcd.isinit =3D 'INIT'=0D if new_pcd.DatumType in TAB_PCD_NUMERIC_TYPES:=0D for skuobj in pcd.SkuInfoList.values():=0D if skuobj.DefaultValue:=0D - defaultvalue =3D int(skuobj.DefaultValue, 16) if skuob= j.DefaultValue.upper().startswith("0X") else int(skuobj.DefaultValue, 10)=0D - if defaultvalue !=3D 0:=0D + defaultvalue =3D int(skuobj.DefaultValue, 16) if skuob= j.DefaultValue.upper(=0D + ).startswith("0X") else int(skuobj.DefaultValue, 10)=0D + if defaultvalue !=3D 0:=0D new_pcd.isinit =3D "INIT"=0D break=0D elif skuobj.VariableName:=0D @@ -950,64 +990,72 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform= , Phase): new_pcd.isinit =3D "UNINIT"=0D return new_pcd=0D DynamicPcds =3D Platform.DynamicPcdList=0D - DynamicPcdSet_Sku =3D {(SkuName, skuobj.SkuId):[] for pcd in DynamicPc= ds for (SkuName, skuobj) in pcd.SkuInfoList.items() }=0D + DynamicPcdSet_Sku =3D {(SkuName, skuobj.SkuId): [] for pcd in DynamicP= cds for (=0D + SkuName, skuobj) in pcd.SkuInfoList.items()}=0D for skuname, skuid in DynamicPcdSet_Sku:=0D - DynamicPcdSet_Sku[(skuname, skuid)] =3D [prune_sku(pcd, skuname) f= or pcd in DynamicPcds]=0D + DynamicPcdSet_Sku[(skuname, skuid)] =3D [=0D + prune_sku(pcd, skuname) for pcd in DynamicPcds]=0D PcdDBData =3D {}=0D PcdDriverAutoGenData =3D {}=0D VarCheckTableData =3D {}=0D if DynamicPcdSet_Sku:=0D for skuname, skuid in DynamicPcdSet_Sku:=0D - AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer, VarCheckT= ab =3D CreatePcdDatabasePhaseSpecificAutoGen (Platform, DynamicPcdSet_Sku[(= skuname, skuid)], Phase)=0D + AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer, VarCheckT= ab =3D CreatePcdDatabasePhaseSpecificAutoGen(=0D + Platform, DynamicPcdSet_Sku[(skuname, skuid)], Phase)=0D final_data =3D ()=0D for item in range(len(PcdDbBuffer)):=0D final_data +=3D unpack("B", PcdDbBuffer[item:item+1])=0D PcdDBData[(skuname, skuid)] =3D (PcdDbBuffer, final_data)=0D - PcdDriverAutoGenData[(skuname, skuid)] =3D (AdditionalAutoGenH= , AdditionalAutoGenC)=0D + PcdDriverAutoGenData[(skuname, skuid)] =3D (=0D + AdditionalAutoGenH, AdditionalAutoGenC)=0D VarCheckTableData[(skuname, skuid)] =3D VarCheckTab=0D if Platform.Platform.VarCheckFlag:=0D dest =3D os.path.join(Platform.BuildDir, TAB_FV_DIRECTORY)=0D VarCheckTable =3D CreateVarCheckBin(VarCheckTableData)=0D VarCheckTable.dump(dest, Phase)=0D - AdditionalAutoGenH, AdditionalAutoGenC =3D CreateAutoGen(PcdDrive= rAutoGenData)=0D + AdditionalAutoGenH, AdditionalAutoGenC =3D CreateAutoGen(=0D + PcdDriverAutoGenData)=0D else:=0D - AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer, VarCheckTab = =3D CreatePcdDatabasePhaseSpecificAutoGen (Platform, {}, Phase)=0D + AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer, VarCheckTab = =3D CreatePcdDatabasePhaseSpecificAutoGen(=0D + Platform, {}, Phase)=0D final_data =3D ()=0D for item in range(len(PcdDbBuffer)):=0D final_data +=3D unpack("B", PcdDbBuffer[item:item + 1])=0D PcdDBData[(TAB_DEFAULT, "0")] =3D (PcdDbBuffer, final_data)=0D =0D return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDB= Data)=0D -## Create PCD database in DXE or PEI phase=0D +# Create PCD database in DXE or PEI phase=0D #=0D # @param Platform The platform object=0D # @retval tuple Two TemplateString objects for C code and head= er file,=0D # respectively=0D #=0D -def CreatePcdDatabasePhaseSpecificAutoGen (Platform, DynamicPcdList, Phase= ):=0D +=0D +=0D +def CreatePcdDatabasePhaseSpecificAutoGen(Platform, DynamicPcdList, Phase)= :=0D AutoGenC =3D TemplateString()=0D AutoGenH =3D TemplateString()=0D =0D Dict =3D {=0D - 'PHASE' : Phase,=0D - 'SERVICE_DRIVER_VERSION' : DATABASE_VERSION,=0D - 'GUID_TABLE_SIZE' : '1U',=0D - 'STRING_TABLE_SIZE' : '1U',=0D - 'SKUID_TABLE_SIZE' : '1U',=0D - 'LOCAL_TOKEN_NUMBER_TABLE_SIZE' : '0U',=0D - 'LOCAL_TOKEN_NUMBER' : '0U',=0D - 'EXMAPPING_TABLE_SIZE' : '1U',=0D - 'EX_TOKEN_NUMBER' : '0U',=0D - 'SIZE_TABLE_SIZE' : '2U',=0D - 'SKU_HEAD_SIZE' : '1U',=0D - 'GUID_TABLE_EMPTY' : 'TRUE',=0D - 'STRING_TABLE_EMPTY' : 'TRUE',=0D - 'SKUID_TABLE_EMPTY' : 'TRUE',=0D - 'DATABASE_EMPTY' : 'TRUE',=0D - 'EXMAP_TABLE_EMPTY' : 'TRUE',=0D - 'PCD_DATABASE_UNINIT_EMPTY' : ' UINT8 dummy; /* PCD_DATABASE= _UNINIT is empty */',=0D - 'SYSTEM_SKU_ID' : ' SKU_ID SystemSkuI= d;',=0D - 'SYSTEM_SKU_ID_VALUE' : '0U'=0D + 'PHASE': Phase,=0D + 'SERVICE_DRIVER_VERSION': DATABASE_VERSION,=0D + 'GUID_TABLE_SIZE': '1U',=0D + 'STRING_TABLE_SIZE': '1U',=0D + 'SKUID_TABLE_SIZE': '1U',=0D + 'LOCAL_TOKEN_NUMBER_TABLE_SIZE': '0U',=0D + 'LOCAL_TOKEN_NUMBER': '0U',=0D + 'EXMAPPING_TABLE_SIZE': '1U',=0D + 'EX_TOKEN_NUMBER': '0U',=0D + 'SIZE_TABLE_SIZE': '2U',=0D + 'SKU_HEAD_SIZE': '1U',=0D + 'GUID_TABLE_EMPTY': 'TRUE',=0D + 'STRING_TABLE_EMPTY': 'TRUE',=0D + 'SKUID_TABLE_EMPTY': 'TRUE',=0D + 'DATABASE_EMPTY': 'TRUE',=0D + 'EXMAP_TABLE_EMPTY': 'TRUE',=0D + 'PCD_DATABASE_UNINIT_EMPTY': ' UINT8 dummy; /* PCD_DATABASE_UNIN= IT is empty */',=0D + 'SYSTEM_SKU_ID': ' SKU_ID SystemSkuId;',=0D + 'SYSTEM_SKU_ID_VALUE': '0U'=0D }=0D =0D SkuObj =3D Platform.Platform.SkuIdMgr=0D @@ -1017,20 +1065,20 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): =0D for DatumType in TAB_PCD_NUMERIC_TYPES_VOID:=0D Dict['VARDEF_CNAME_' + DatumType] =3D []=0D - Dict['VARDEF_GUID_' + DatumType] =3D []=0D + Dict['VARDEF_GUID_' + DatumType] =3D []=0D Dict['VARDEF_SKUID_' + DatumType] =3D []=0D Dict['VARDEF_VALUE_' + DatumType] =3D []=0D Dict['VARDEF_DB_VALUE_' + DatumType] =3D []=0D for Init in ['INIT', 'UNINIT']:=0D - Dict[Init+'_CNAME_DECL_' + DatumType] =3D []=0D - Dict[Init+'_GUID_DECL_' + DatumType] =3D []=0D + Dict[Init+'_CNAME_DECL_' + DatumType] =3D []=0D + Dict[Init+'_GUID_DECL_' + DatumType] =3D []=0D Dict[Init+'_NUMSKUS_DECL_' + DatumType] =3D []=0D - Dict[Init+'_VALUE_' + DatumType] =3D []=0D + Dict[Init+'_VALUE_' + DatumType] =3D []=0D Dict[Init+'_DB_VALUE_'+DatumType] =3D []=0D =0D for Type in ['STRING_HEAD', 'VPD_HEAD', 'VARIABLE_HEAD']:=0D - Dict[Type + '_CNAME_DECL'] =3D []=0D - Dict[Type + '_GUID_DECL'] =3D []=0D + Dict[Type + '_CNAME_DECL'] =3D []=0D + Dict[Type + '_GUID_DECL'] =3D []=0D Dict[Type + '_NUMSKUS_DECL'] =3D []=0D Dict[Type + '_VALUE'] =3D []=0D =0D @@ -1039,23 +1087,23 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Dict['VARIABLE_DB_VALUE'] =3D []=0D =0D Dict['STRING_TABLE_INDEX'] =3D []=0D - Dict['STRING_TABLE_LENGTH'] =3D []=0D + Dict['STRING_TABLE_LENGTH'] =3D []=0D Dict['STRING_TABLE_CNAME'] =3D []=0D - Dict['STRING_TABLE_GUID'] =3D []=0D + Dict['STRING_TABLE_GUID'] =3D []=0D Dict['STRING_TABLE_VALUE'] =3D []=0D Dict['STRING_TABLE_DB_VALUE'] =3D []=0D =0D Dict['SIZE_TABLE_CNAME'] =3D []=0D - Dict['SIZE_TABLE_GUID'] =3D []=0D - Dict['SIZE_TABLE_CURRENT_LENGTH'] =3D []=0D - Dict['SIZE_TABLE_MAXIMUM_LENGTH'] =3D []=0D + Dict['SIZE_TABLE_GUID'] =3D []=0D + Dict['SIZE_TABLE_CURRENT_LENGTH'] =3D []=0D + Dict['SIZE_TABLE_MAXIMUM_LENGTH'] =3D []=0D =0D Dict['EXMAPPING_TABLE_EXTOKEN'] =3D []=0D Dict['EXMAPPING_TABLE_LOCAL_TOKEN'] =3D []=0D Dict['EXMAPPING_TABLE_GUID_INDEX'] =3D []=0D =0D Dict['GUID_STRUCTURE'] =3D []=0D - Dict['SKUID_VALUE'] =3D [0] # init Dict length=0D + Dict['SKUID_VALUE'] =3D [0] # init Dict length=0D Dict['VARDEF_HEADER'] =3D []=0D =0D Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'] =3D []=0D @@ -1084,7 +1132,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): GuidList =3D []=0D VarCheckTab =3D VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER()=0D i =3D 0=0D - ReorderedDynPcdList =3D GetOrderedDynamicPcdList(DynamicPcdList, Platf= orm.PcdTokenNumber)=0D + ReorderedDynPcdList =3D GetOrderedDynamicPcdList(=0D + DynamicPcdList, Platform.PcdTokenNumber)=0D for item in ReorderedDynPcdList:=0D if item.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_U= INT64, TAB_VOID, "BOOLEAN"]:=0D item.DatumType =3D TAB_VOID=0D @@ -1098,7 +1147,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData.Mix= edPcd[PcdItem]:=0D CName =3D PcdItem[0]=0D =0D - EdkLogger.debug(EdkLogger.DEBUG_3, "PCD: %s %s (%s : %s)" % (CName= , TokenSpaceGuidCName, Pcd.Phase, Phase))=0D + EdkLogger.debug(EdkLogger.DEBUG_3, "PCD: %s %s (%s : %s)" %=0D + (CName, TokenSpaceGuidCName, Pcd.Phase, Phase))=0D =0D if Pcd.Phase =3D=3D 'PEI':=0D NumberOfPeiLocalTokens +=3D 1=0D @@ -1111,7 +1161,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): # TODO: need GetGuidValue() definition=0D #=0D TokenSpaceGuidStructure =3D Pcd.TokenSpaceGuidValue=0D - TokenSpaceGuid =3D GuidStructureStringToGuidValueName(TokenSpaceGu= idStructure)=0D + TokenSpaceGuid =3D GuidStructureStringToGuidValueName(=0D + TokenSpaceGuidStructure)=0D if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D if TokenSpaceGuid not in GuidList:=0D GuidList.append(TokenSpaceGuid)=0D @@ -1149,17 +1200,20 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if SkuId is None or SkuId =3D=3D '':=0D continue=0D =0D -=0D SkuIdIndex +=3D 1=0D =0D if len(Sku.VariableName) > 0:=0D VariableGuidStructure =3D Sku.VariableGuidValue=0D - VariableGuid =3D GuidStructureStringToGuidValueName(Variab= leGuidStructure)=0D + VariableGuid =3D GuidStructureStringToGuidValueName(=0D + VariableGuidStructure)=0D if Platform.Platform.VarCheckFlag:=0D - var_check_obj =3D VAR_CHECK_PCD_VARIABLE_TAB(VariableG= uidStructure, StringToArray(Sku.VariableName))=0D + var_check_obj =3D VAR_CHECK_PCD_VARIABLE_TAB(=0D + VariableGuidStructure, StringToArray(Sku.VariableN= ame))=0D try:=0D - var_check_obj.push_back(GetValidationObject(Pcd, S= ku.VariableOffset))=0D - VarAttr, _ =3D VariableAttributes.GetVarAttributes= (Sku.VariableAttribute)=0D + var_check_obj.push_back(=0D + GetValidationObject(Pcd, Sku.VariableOffset))= =0D + VarAttr, _ =3D VariableAttributes.GetVarAttributes= (=0D + Sku.VariableAttribute)=0D var_check_obj.SetAttributes(VarAttr)=0D var_check_obj.UpdateSize()=0D VarCheckTab.push_back(var_check_obj)=0D @@ -1171,11 +1225,12 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): ValidInfo =3D Pcd.validlists[0]=0D if ValidInfo:=0D EdkLogger.error("build", PCD_VALIDATION_INFO_E= RROR,=0D - "The PCD '%s.%s' Validatio= n information defined in DEC file has incorrect format." % (Pcd.TokenSpaceG= uidCName, Pcd.TokenCName),=0D - ExtraData =3D "[%s]" % str= (ValidInfo))=0D + "The PCD '%s.%s' Validation in= formation defined in DEC file has incorrect format." % (=0D + Pcd.TokenSpaceGuidCName, P= cd.TokenCName),=0D + ExtraData=3D"[%s]" % str(Valid= Info))=0D else:=0D EdkLogger.error("build", PCD_VALIDATION_INFO_E= RROR,=0D - "The PCD '%s.%s' Validatio= n information defined in DEC file has incorrect format." % (Pcd.TokenSpaceG= uidCName, Pcd.TokenCName))=0D + "The PCD '%s.%s' Validation in= formation defined in DEC file has incorrect format." % (Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName))=0D Pcd.TokenTypeList.append('PCD_TYPE_HII')=0D Pcd.InitString =3D 'INIT'=0D # Store all variable names of one HII PCD under different = SKU to stringTable=0D @@ -1184,9 +1239,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform,= DynamicPcdList, Phase): VariableNameStructure =3D StringToArray(Sku.VariableName)= =0D =0D # Make pointer of VaraibleName(HII PCD) 2 bytes aligned=0D - VariableNameStructureBytes =3D VariableNameStructure.lstri= p("{").rstrip("}").split(",")=0D + VariableNameStructureBytes =3D VariableNameStructure.lstri= p(=0D + "{").rstrip("}").split(",")=0D if len(VariableNameStructureBytes) % 2:=0D - VariableNameStructure =3D "{%s,0x00}" % ",".join(Varia= bleNameStructureBytes)=0D + VariableNameStructure =3D "{%s,0x00}" % ",".join(=0D + VariableNameStructureBytes)=0D =0D if VariableNameStructure not in Dict['STRING_TABLE_VALUE']= :=0D Dict['STRING_TABLE_CNAME'].append(CName)=0D @@ -1194,16 +1251,19 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if StringTableIndex =3D=3D 0:=0D Dict['STRING_TABLE_INDEX'].append('')=0D else:=0D - Dict['STRING_TABLE_INDEX'].append('_%d' % StringTa= bleIndex)=0D - VarNameSize =3D len(VariableNameStructure.replace(',',= ' ').split())=0D - Dict['STRING_TABLE_LENGTH'].append(VarNameSize )=0D + Dict['STRING_TABLE_INDEX'].append(=0D + '_%d' % StringTableIndex)=0D + VarNameSize =3D len(=0D + VariableNameStructure.replace(',', ' ').split())=0D + Dict['STRING_TABLE_LENGTH'].append(VarNameSize)=0D Dict['STRING_TABLE_VALUE'].append(VariableNameStructur= e)=0D StringHeadOffsetList.append(str(StringTableSize) + 'U'= )=0D VarStringDbOffsetList =3D []=0D VarStringDbOffsetList.append(StringTableSize)=0D Dict['STRING_DB_VALUE'].append(VarStringDbOffsetList)= =0D StringTableIndex +=3D 1=0D - StringTableSize +=3D len(VariableNameStructure.replace= (',', ' ').split())=0D + StringTableSize +=3D len(=0D + VariableNameStructure.replace(',', ' ').split())=0D VariableHeadStringIndex =3D 0=0D for Index in range(Dict['STRING_TABLE_VALUE'].index(Variab= leNameStructure)):=0D VariableHeadStringIndex +=3D Dict['STRING_TABLE_LENGTH= '][Index]=0D @@ -1220,32 +1280,38 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if "PCD_TYPE_STRING" in Pcd.TokenTypeList:=0D VariableHeadValueList.append('%dU, offsetof(%s_PCD_DAT= ABASE, Init.%s_%s), %dU, %sU' %=0D (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid,=0D - VariableHeadGuidIndex, Sk= u.VariableOffset))=0D + VariableHeadGuidIndex, S= ku.VariableOffset))=0D else:=0D VariableHeadValueList.append('%dU, offsetof(%s_PCD_DAT= ABASE, Init.%s_%s_VariableDefault_%s), %dU, %sU' %=0D (VariableHeadStringIndex,= Phase, CName, TokenSpaceGuid, SkuIdIndex,=0D - VariableHeadGuidIndex, Sk= u.VariableOffset))=0D + VariableHeadGuidIndex, S= ku.VariableOffset))=0D Dict['VARDEF_CNAME_'+Pcd.DatumType].append(CName)=0D Dict['VARDEF_GUID_'+Pcd.DatumType].append(TokenSpaceGuid)= =0D Dict['VARDEF_SKUID_'+Pcd.DatumType].append(SkuIdIndex)=0D - if "PCD_TYPE_STRING" in Pcd.TokenTypeList:=0D - Dict['VARDEF_VALUE_' + Pcd.DatumType].append("%s_%s[%d= ]" % (Pcd.TokenCName, TokenSpaceGuid, SkuIdIndex))=0D + if "PCD_TYPE_STRING" in Pcd.TokenTypeList:=0D + Dict['VARDEF_VALUE_' + Pcd.DatumType].append(=0D + "%s_%s[%d]" % (Pcd.TokenCName, TokenSpaceGuid, Sku= IdIndex))=0D else:=0D #=0D # ULL (for UINT64) or U(other integer type) should be = append to avoid=0D # warning under linux building environment.=0D #=0D - Dict['VARDEF_DB_VALUE_'+Pcd.DatumType].append(Sku.HiiD= efaultValue)=0D + Dict['VARDEF_DB_VALUE_' +=0D + Pcd.DatumType].append(Sku.HiiDefaultValue)=0D =0D if Pcd.DatumType =3D=3D TAB_UINT64:=0D - Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.Hii= DefaultValue + "ULL")=0D + Dict['VARDEF_VALUE_' +=0D + Pcd.DatumType].append(Sku.HiiDefaultValue + "= ULL")=0D elif Pcd.DatumType in (TAB_UINT32, TAB_UINT16, TAB_UIN= T8):=0D - Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.Hii= DefaultValue + "U")=0D + Dict['VARDEF_VALUE_' +=0D + Pcd.DatumType].append(Sku.HiiDefaultValue + "= U")=0D elif Pcd.DatumType =3D=3D "BOOLEAN":=0D if eval(Sku.HiiDefaultValue) in [1, 0]:=0D - Dict['VARDEF_VALUE_'+Pcd.DatumType].append(str= (eval(Sku.HiiDefaultValue)) + "U")=0D + Dict['VARDEF_VALUE_'+Pcd.DatumType].append(=0D + str(eval(Sku.HiiDefaultValue)) + "U")=0D else:=0D - Dict['VARDEF_VALUE_'+Pcd.DatumType].append(Sku.Hii= DefaultValue)=0D + Dict['VARDEF_VALUE_' +=0D + Pcd.DatumType].append(Sku.HiiDefaultValue)=0D =0D # construct the VariableHeader value=0D if "PCD_TYPE_STRING" in Pcd.TokenTypeList:=0D @@ -1260,9 +1326,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform,= DynamicPcdList, Phase): (VariableHeadGuidIndex, V= ariableHeadStringIndex, Sku.VariableOffset,=0D Phase, CName, TokenSpace= Guid, SkuIdIndex))=0D # the Pcd default value was filled before=0D - VariableOffset =3D len(Dict['VARDEF_DB_VALUE_' + Pcd.D= atumType]) - 1=0D + VariableOffset =3D len(=0D + Dict['VARDEF_DB_VALUE_' + Pcd.DatumType]) - 1=0D VariableRefTable =3D Dict['VARDEF_DB_VALUE_' + Pcd.Dat= umType]=0D - VariableDbValueList.append([VariableHeadGuidIndex, Variabl= eHeadStringIndex, Sku.VariableOffset, VariableOffset, VariableRefTable, Sku= .VariableAttribute])=0D + VariableDbValueList.append([VariableHeadGuidIndex, Variabl= eHeadStringIndex,=0D + Sku.VariableOffset, VariableOff= set, VariableRefTable, Sku.VariableAttribute])=0D =0D elif Sku.VpdOffset !=3D '':=0D Pcd.TokenTypeList.append('PCD_TYPE_VPD')=0D @@ -1289,19 +1357,27 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if StringTableIndex =3D=3D 0:=0D Dict['STRING_TABLE_INDEX'].append('')=0D else:=0D - Dict['STRING_TABLE_INDEX'].append('_%d' % StringTa= bleIndex)=0D + Dict['STRING_TABLE_INDEX'].append(=0D + '_%d' % StringTableIndex)=0D if Sku.DefaultValue[0] =3D=3D 'L':=0D - DefaultValueBinStructure =3D StringToArray(Sku.Def= aultValue)=0D - Size =3D len(DefaultValueBinStructure.replace(',',= ' ').split())=0D - Dict['STRING_TABLE_VALUE'].append(DefaultValueBinS= tructure)=0D + DefaultValueBinStructure =3D StringToArray(=0D + Sku.DefaultValue)=0D + Size =3D len(DefaultValueBinStructure.replace(=0D + ',', ' ').split())=0D + Dict['STRING_TABLE_VALUE'].append(=0D + DefaultValueBinStructure)=0D elif Sku.DefaultValue[0] =3D=3D '"':=0D - DefaultValueBinStructure =3D StringToArray(Sku.Def= aultValue)=0D + DefaultValueBinStructure =3D StringToArray(=0D + Sku.DefaultValue)=0D Size =3D len(Sku.DefaultValue) - 2 + 1=0D - Dict['STRING_TABLE_VALUE'].append(DefaultValueBinS= tructure)=0D + Dict['STRING_TABLE_VALUE'].append(=0D + DefaultValueBinStructure)=0D elif Sku.DefaultValue[0] =3D=3D '{':=0D - DefaultValueBinStructure =3D StringToArray(Sku.Def= aultValue)=0D + DefaultValueBinStructure =3D StringToArray(=0D + Sku.DefaultValue)=0D Size =3D len(Sku.DefaultValue.split(","))=0D - Dict['STRING_TABLE_VALUE'].append(DefaultValueBinS= tructure)=0D + Dict['STRING_TABLE_VALUE'].append(=0D + DefaultValueBinStructure)=0D =0D StringHeadOffsetList.append(str(StringTableSize) + 'U'= )=0D StringDbOffsetList.append(StringTableSize)=0D @@ -1310,8 +1386,9 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): if MaxDatumSize < Size:=0D if Pcd.MaxSizeUserSet:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "The maximum size of VOID* typ= e PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuid= CName, Pcd.TokenCName),=0D - ExtraData=3D"[%s]" % str(Platf= orm))=0D + "The maximum size of VOID*= type PCD '%s.%s' is less than its actual size occupied." % (=0D + Pcd.TokenSpaceGuidCNam= e, Pcd.TokenCName),=0D + ExtraData=3D"[%s]" % str(P= latform))=0D else:=0D MaxDatumSize =3D Size=0D else:=0D @@ -1351,16 +1428,16 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): if Pcd.DatumType =3D=3D TAB_VOID:=0D Dict['SIZE_TABLE_CNAME'].append(CName)=0D Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)=0D - Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize)= + 'U')=0D + Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(=0D + str(Pcd.MaxDatumSize) + 'U')=0D Dict['SIZE_TABLE_CURRENT_LENGTH'].append(VoidStarTypeCurrSize)= =0D =0D -=0D -=0D if 'PCD_TYPE_HII' in Pcd.TokenTypeList:=0D Dict['VARIABLE_HEAD_CNAME_DECL'].append(CName)=0D Dict['VARIABLE_HEAD_GUID_DECL'].append(TokenSpaceGuid)=0D Dict['VARIABLE_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList)= )=0D - Dict['VARIABLE_HEAD_VALUE'].append('{ %s }\n' % ' },\n { '.= join(VariableHeadValueList))=0D + Dict['VARIABLE_HEAD_VALUE'].append(=0D + '{ %s }\n' % ' },\n { '.join(VariableHeadValueList))=0D Dict['VARDEF_HEADER'].append('_Variable_Header')=0D Dict['VARIABLE_DB_VALUE'].append(VariableDbValueList)=0D else:=0D @@ -1369,7 +1446,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['VPD_HEAD_CNAME_DECL'].append(CName)=0D Dict['VPD_HEAD_GUID_DECL'].append(TokenSpaceGuid)=0D Dict['VPD_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))=0D - Dict['VPD_HEAD_VALUE'].append('{ %s }' % ' }, { '.join(VpdHead= OffsetList))=0D + Dict['VPD_HEAD_VALUE'].append(=0D + '{ %s }' % ' }, { '.join(VpdHeadOffsetList))=0D Dict['VPD_DB_VALUE'].append(VpdDbOffsetList)=0D if 'PCD_TYPE_STRING' in Pcd.TokenTypeList:=0D Dict['STRING_HEAD_CNAME_DECL'].append(CName)=0D @@ -1377,28 +1455,34 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Dict['STRING_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))= =0D Dict['STRING_HEAD_VALUE'].append(', '.join(StringHeadOffsetLis= t))=0D Dict['STRING_DB_VALUE'].append(StringDbOffsetList)=0D - PCD_STRING_INDEX_MAP[len(Dict['STRING_HEAD_CNAME_DECL']) -1 ] = =3D len(Dict['STRING_DB_VALUE']) -1=0D + PCD_STRING_INDEX_MAP[len(=0D + Dict['STRING_HEAD_CNAME_DECL']) - 1] =3D len(Dict['STRING_= DB_VALUE']) - 1=0D if 'PCD_TYPE_DATA' in Pcd.TokenTypeList:=0D Dict[Pcd.InitString+'_CNAME_DECL_'+Pcd.DatumType].append(CName= )=0D - Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType].append(TokenS= paceGuid)=0D - Dict[Pcd.InitString+'_NUMSKUS_DECL_'+Pcd.DatumType].append(len= (Pcd.SkuInfoList))=0D + Dict[Pcd.InitString+'_GUID_DECL_' +=0D + Pcd.DatumType].append(TokenSpaceGuid)=0D + Dict[Pcd.InitString+'_NUMSKUS_DECL_' +=0D + Pcd.DatumType].append(len(Pcd.SkuInfoList))=0D if Pcd.InitString =3D=3D 'UNINIT':=0D Dict['PCD_DATABASE_UNINIT_EMPTY'] =3D ''=0D else:=0D - Dict[Pcd.InitString+'_VALUE_'+Pcd.DatumType].append(', '.j= oin(ValueList))=0D - Dict[Pcd.InitString+'_DB_VALUE_'+Pcd.DatumType].append(DbV= alueList)=0D + Dict[Pcd.InitString+'_VALUE_' +=0D + Pcd.DatumType].append(', '.join(ValueList))=0D + Dict[Pcd.InitString+'_DB_VALUE_' +=0D + Pcd.DatumType].append(DbValueList)=0D =0D if Phase =3D=3D 'PEI':=0D NumberOfLocalTokens =3D NumberOfPeiLocalTokens=0D if Phase =3D=3D 'DXE':=0D NumberOfLocalTokens =3D NumberOfDxeLocalTokens=0D =0D - Dict['TOKEN_INIT'] =3D ['' for x in range(NumberOfLocalTokens)]= =0D - Dict['TOKEN_CNAME'] =3D ['' for x in range(NumberOfLocalTokens)]= =0D - Dict['TOKEN_GUID'] =3D ['' for x in range(NumberOfLocalTokens)]= =0D - Dict['TOKEN_TYPE'] =3D ['' for x in range(NumberOfLocalTokens)]= =0D - Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'] =3D ['' for x in range(NumberOfLoc= alTokens)]=0D - Dict['PCD_CNAME'] =3D ['' for x in range(NumberOfLocalTokens)]= =0D + Dict['TOKEN_INIT'] =3D ['' for x in range(NumberOfLocalTokens)]=0D + Dict['TOKEN_CNAME'] =3D ['' for x in range(NumberOfLocalTokens)]=0D + Dict['TOKEN_GUID'] =3D ['' for x in range(NumberOfLocalTokens)]=0D + Dict['TOKEN_TYPE'] =3D ['' for x in range(NumberOfLocalTokens)]=0D + Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'] =3D [=0D + '' for x in range(NumberOfLocalTokens)]=0D + Dict['PCD_CNAME'] =3D ['' for x in range(NumberOfLocalTokens)]=0D Dict['PCD_TOKENSPACE_MAP'] =3D ['' for x in range(NumberOfLocalTokens)= ]=0D Dict['PCD_CNAME_LENGTH'] =3D [0 for x in range(NumberOfLocalTokens)]=0D SkuEnablePcdIndex =3D 0=0D @@ -1408,8 +1492,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform,= DynamicPcdList, Phase): if Pcd.Phase !=3D Phase:=0D continue=0D =0D - TokenSpaceGuid =3D GuidStructureStringToGuidValueName(Pcd.TokenSpa= ceGuidValue) #(Platform.PackageList, TokenSpaceGuidCName))=0D - GeneratedTokenNumber =3D Platform.PcdTokenNumber[CName, TokenSpace= GuidCName] - 1=0D + # (Platform.PackageList, TokenSpaceGuidCName))=0D + TokenSpaceGuid =3D GuidStructureStringToGuidValueName(=0D + Pcd.TokenSpaceGuidValue)=0D + GeneratedTokenNumber =3D Platform.PcdTokenNumber[CName,=0D + TokenSpaceGuidCName= ] - 1=0D if Phase =3D=3D 'DXE':=0D GeneratedTokenNumber -=3D NumberOfPeiLocalTokens=0D =0D @@ -1421,9 +1508,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform,= DynamicPcdList, Phase): if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData.Mix= edPcd[PcdItem]:=0D CName =3D PcdItem[0]=0D =0D - EdkLogger.debug(EdkLogger.DEBUG_1, "PCD =3D %s.%s" % (CName, Token= SpaceGuidCName))=0D + EdkLogger.debug(EdkLogger.DEBUG_1, "PCD =3D %s.%s" %=0D + (CName, TokenSpaceGuidCName))=0D EdkLogger.debug(EdkLogger.DEBUG_1, "phase =3D %s" % Phase)=0D - EdkLogger.debug(EdkLogger.DEBUG_1, "GeneratedTokenNumber =3D %s" %= str(GeneratedTokenNumber))=0D + EdkLogger.debug(EdkLogger.DEBUG_1, "GeneratedTokenNumber =3D %s" %= =0D + str(GeneratedTokenNumber))=0D =0D #=0D # following four Dict items hold the information for LocalTokenNum= berTable=0D @@ -1434,47 +1523,56 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): =0D Dict['TOKEN_CNAME'][GeneratedTokenNumber] =3D CName=0D Dict['TOKEN_GUID'][GeneratedTokenNumber] =3D TokenSpaceGuid=0D - Dict['TOKEN_TYPE'][GeneratedTokenNumber] =3D ' | '.join(Pcd.TokenT= ypeList)=0D + Dict['TOKEN_TYPE'][GeneratedTokenNumber] =3D ' | '.join(=0D + Pcd.TokenTypeList)=0D =0D if Platform.Platform.PcdInfoFlag:=0D - TokenSpaceGuidCNameArray =3D StringToArray('"' + TokenSpaceGui= dCName + '"' )=0D + TokenSpaceGuidCNameArray =3D StringToArray(=0D + '"' + TokenSpaceGuidCName + '"')=0D if TokenSpaceGuidCNameArray not in Dict['PCD_TOKENSPACE']:=0D Dict['PCD_TOKENSPACE'].append(TokenSpaceGuidCNameArray)=0D - Dict['PCD_TOKENSPACE_LENGTH'].append( len(TokenSpaceGuidCN= ameArray.split(",")) )=0D - Dict['PCD_TOKENSPACE_MAP'][GeneratedTokenNumber] =3D Dict['PCD= _TOKENSPACE'].index(TokenSpaceGuidCNameArray)=0D - CNameBinArray =3D StringToArray('"' + CName + '"' )=0D + Dict['PCD_TOKENSPACE_LENGTH'].append(=0D + len(TokenSpaceGuidCNameArray.split(",")))=0D + Dict['PCD_TOKENSPACE_MAP'][GeneratedTokenNumber] =3D Dict['PCD= _TOKENSPACE'].index(=0D + TokenSpaceGuidCNameArray)=0D + CNameBinArray =3D StringToArray('"' + CName + '"')=0D Dict['PCD_CNAME'][GeneratedTokenNumber] =3D CNameBinArray=0D =0D - Dict['PCD_CNAME_LENGTH'][GeneratedTokenNumber] =3D len(CNameBi= nArray.split(","))=0D -=0D + Dict['PCD_CNAME_LENGTH'][GeneratedTokenNumber] =3D len(=0D + CNameBinArray.split(","))=0D =0D Pcd.TokenTypeList =3D list(set(Pcd.TokenTypeList))=0D =0D # search the Offset and Table, used by LocalTokenNumberTableOffset= =0D if 'PCD_TYPE_HII' in Pcd.TokenTypeList:=0D # Find index by CName, TokenSpaceGuid=0D - Offset =3D GetMatchedIndex(CName, Dict['VARIABLE_HEAD_CNAME_DE= CL'], TokenSpaceGuid, Dict['VARIABLE_HEAD_GUID_DECL'])=0D + Offset =3D GetMatchedIndex(=0D + CName, Dict['VARIABLE_HEAD_CNAME_DECL'], TokenSpaceGuid, D= ict['VARIABLE_HEAD_GUID_DECL'])=0D assert(Offset !=3D -1)=0D Table =3D Dict['VARIABLE_DB_VALUE']=0D if 'PCD_TYPE_VPD' in Pcd.TokenTypeList:=0D - Offset =3D GetMatchedIndex(CName, Dict['VPD_HEAD_CNAME_DECL'],= TokenSpaceGuid, Dict['VPD_HEAD_GUID_DECL'])=0D + Offset =3D GetMatchedIndex(=0D + CName, Dict['VPD_HEAD_CNAME_DECL'], TokenSpaceGuid, Dict['= VPD_HEAD_GUID_DECL'])=0D assert(Offset !=3D -1)=0D Table =3D Dict['VPD_DB_VALUE']=0D if 'PCD_TYPE_STRING' in Pcd.TokenTypeList and 'PCD_TYPE_HII' not i= n Pcd.TokenTypeList:=0D # Find index by CName, TokenSpaceGuid=0D - Offset =3D GetMatchedIndex(CName, Dict['STRING_HEAD_CNAME_DECL= '], TokenSpaceGuid, Dict['STRING_HEAD_GUID_DECL'])=0D + Offset =3D GetMatchedIndex(=0D + CName, Dict['STRING_HEAD_CNAME_DECL'], TokenSpaceGuid, Dic= t['STRING_HEAD_GUID_DECL'])=0D Offset =3D PCD_STRING_INDEX_MAP[Offset]=0D assert(Offset !=3D -1)=0D Table =3D Dict['STRING_DB_VALUE']=0D if 'PCD_TYPE_DATA' in Pcd.TokenTypeList:=0D # need to store whether it is in init table or not=0D - Offset =3D GetMatchedIndex(CName, Dict[Pcd.InitString+'_CNAME_= DECL_'+Pcd.DatumType], TokenSpaceGuid, Dict[Pcd.InitString+'_GUID_DECL_'+Pc= d.DatumType])=0D + Offset =3D GetMatchedIndex(CName, Dict[Pcd.InitString+'_CNAME_= DECL_'+Pcd.DatumType],=0D + TokenSpaceGuid, Dict[Pcd.InitString+'= _GUID_DECL_'+Pcd.DatumType])=0D assert(Offset !=3D -1)=0D if Pcd.InitString =3D=3D 'UNINIT':=0D - Table =3D Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType= ]=0D + Table =3D Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType]= =0D else:=0D Table =3D Dict[Pcd.InitString+'_DB_VALUE_'+Pcd.DatumType]= =0D - Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'][GeneratedTokenNumber] =3D (Off= set, Table)=0D + Dict['LOCAL_TOKEN_NUMBER_DB_VALUE'][GeneratedTokenNumber] =3D (=0D + Offset, Table)=0D =0D #=0D # Update VARDEF_HEADER=0D @@ -1484,7 +1582,6 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): else:=0D Dict['VARDEF_HEADER'][GeneratedTokenNumber] =3D ''=0D =0D -=0D if Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D =0D if Phase =3D=3D 'DXE':=0D @@ -1499,10 +1596,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): # to the EXMAPPING_TABLE.=0D #=0D =0D -=0D Dict['EXMAPPING_TABLE_EXTOKEN'].append(str(Pcd.TokenValue) + '= U')=0D - Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(str(GeneratedTokenN= umber + 1) + 'U')=0D - Dict['EXMAPPING_TABLE_GUID_INDEX'].append(str(GuidList.index(T= okenSpaceGuid)) + 'U')=0D + Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append(=0D + str(GeneratedTokenNumber + 1) + 'U')=0D + Dict['EXMAPPING_TABLE_GUID_INDEX'].append(=0D + str(GuidList.index(TokenSpaceGuid)) + 'U')=0D =0D if Platform.Platform.PcdInfoFlag:=0D for index in range(len(Dict['PCD_TOKENSPACE_MAP'])):=0D @@ -1515,7 +1613,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): StringTableIndex +=3D 1=0D for index in range(len(Dict['PCD_CNAME'])):=0D Dict['PCD_CNAME_OFFSET'].append(StringTableSize)=0D - Dict['PCD_NAME_OFFSET'].append(Dict['PCD_TOKENSPACE_OFFSET'][i= ndex])=0D + Dict['PCD_NAME_OFFSET'].append(=0D + Dict['PCD_TOKENSPACE_OFFSET'][index])=0D Dict['PCD_NAME_OFFSET'].append(StringTableSize)=0D StringTableSize +=3D Dict['PCD_CNAME_LENGTH'][index]=0D StringTableIndex +=3D 1=0D @@ -1523,7 +1622,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, = DynamicPcdList, Phase): Dict['GUID_TABLE_EMPTY'] =3D 'FALSE'=0D Dict['GUID_TABLE_SIZE'] =3D str(len(GuidList)) + 'U'=0D else:=0D - Dict['GUID_STRUCTURE'] =3D [GuidStringToGuidStructureString('00000= 000-0000-0000-0000-000000000000')]=0D + Dict['GUID_STRUCTURE'] =3D [GuidStringToGuidStructureString(=0D + '00000000-0000-0000-0000-000000000000')]=0D =0D if StringTableIndex =3D=3D 0:=0D Dict['STRING_TABLE_INDEX'].append('')=0D @@ -1542,14 +1642,14 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append('0U')=0D =0D if NumberOfLocalTokens !=3D 0:=0D - Dict['DATABASE_EMPTY'] =3D 'FALSE'=0D + Dict['DATABASE_EMPTY'] =3D 'FALSE'=0D Dict['LOCAL_TOKEN_NUMBER_TABLE_SIZE'] =3D NumberOfLocalTokens=0D - Dict['LOCAL_TOKEN_NUMBER'] =3D NumberOfLocalTokens=0D + Dict['LOCAL_TOKEN_NUMBER'] =3D NumberOfLocalTokens=0D =0D if NumberOfExTokens !=3D 0:=0D - Dict['EXMAP_TABLE_EMPTY'] =3D 'FALSE'=0D + Dict['EXMAP_TABLE_EMPTY'] =3D 'FALSE'=0D Dict['EXMAPPING_TABLE_SIZE'] =3D str(NumberOfExTokens) + 'U'=0D - Dict['EX_TOKEN_NUMBER'] =3D str(NumberOfExTokens) + 'U'=0D + Dict['EX_TOKEN_NUMBER'] =3D str(NumberOfExTokens) + 'U'=0D else:=0D Dict['EXMAPPING_TABLE_EXTOKEN'].append('0U')=0D Dict['EXMAPPING_TABLE_LOCAL_TOKEN'].append('0U')=0D @@ -1587,11 +1687,15 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): for Count in range(len(Dict['TOKEN_CNAME'])):=0D for Count1 in range(len(Dict['SIZE_TABLE_CNAME'])):=0D if Dict['TOKEN_CNAME'][Count] =3D=3D Dict['SIZE_TABLE_= CNAME'][Count1] and \=0D - Dict['TOKEN_GUID'][Count] =3D=3D Dict['SIZE_TABLE_= GUID'][Count1]:=0D - SizeCNameTempList.append(Dict['SIZE_TABLE_CNAME'][= Count1])=0D - SizeGuidTempList.append(Dict['SIZE_TABLE_GUID'][Co= unt1])=0D - SizeCurLenTempList.append(Dict['SIZE_TABLE_CURRENT= _LENGTH'][Count1])=0D - SizeMaxLenTempList.append(Dict['SIZE_TABLE_MAXIMUM= _LENGTH'][Count1])=0D + Dict['TOKEN_GUID'][Count] =3D=3D Dict['SIZE_TA= BLE_GUID'][Count1]:=0D + SizeCNameTempList.append(=0D + Dict['SIZE_TABLE_CNAME'][Count1])=0D + SizeGuidTempList.append(=0D + Dict['SIZE_TABLE_GUID'][Count1])=0D + SizeCurLenTempList.append(=0D + Dict['SIZE_TABLE_CURRENT_LENGTH'][Count1])=0D + SizeMaxLenTempList.append(=0D + Dict['SIZE_TABLE_MAXIMUM_LENGTH'][Count1])=0D =0D for Count in range(len(Dict['SIZE_TABLE_CNAME'])):=0D Dict['SIZE_TABLE_CNAME'][Count] =3D SizeCNameTempList[Coun= t]=0D @@ -1606,10 +1710,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform= , DynamicPcdList, Phase): Buffer =3D BuildExDataBase(Dict)=0D return AutoGenH, AutoGenC, Buffer, VarCheckTab=0D =0D +=0D def GetOrderedDynamicPcdList(DynamicPcdList, PcdTokenNumberList):=0D ReorderedDyPcdList =3D [None for i in range(len(DynamicPcdList))]=0D for Pcd in DynamicPcdList:=0D if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in PcdTokenNumberList= :=0D - ReorderedDyPcdList[PcdTokenNumberList[Pcd.TokenCName, Pcd.Toke= nSpaceGuidCName]-1] =3D Pcd=0D + ReorderedDyPcdList[PcdTokenNumberList[Pcd.TokenCName,=0D + Pcd.TokenSpaceGuidCName]= -1] =3D Pcd=0D return ReorderedDyPcdList=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/GenVar.py b/BaseTools/Source/P= ython/AutoGen/GenVar.py index f2ad54ba630e..8b7ff2f66196 100644 --- a/BaseTools/Source/Python/AutoGen/GenVar.py +++ b/BaseTools/Source/Python/AutoGen/GenVar.py @@ -17,11 +17,13 @@ import collections import Common.DataType as DataType=0D import Common.GlobalData as GlobalData=0D =0D -var_info =3D collections.namedtuple("uefi_var", "pcdindex,pcdname,defaults= toragename,skuname,var_name, var_guid, var_offset,var_attribute,pcd_default= _value, default_value, data_type,PcdDscLine,StructurePcd")=0D +var_info =3D collections.namedtuple(=0D + "uefi_var", "pcdindex,pcdname,defaultstoragename,skuname,var_name, var= _guid, var_offset,var_attribute,pcd_default_value, default_value, data_type= ,PcdDscLine,StructurePcd")=0D NvStorageHeaderSize =3D 28=0D VariableHeaderSize =3D 32=0D AuthenticatedVariableHeaderSize =3D 60=0D =0D +=0D class VariableMgr(object):=0D def __init__(self, DefaultStoreMap, SkuIdMap):=0D self.VarInfo =3D []=0D @@ -46,9 +48,11 @@ class VariableMgr(object): if not self.NVHeaderBuff:=0D return ""=0D self.NVHeaderBuff =3D self.NVHeaderBuff[:8] + pack("=3DQ", maxsize= )=0D - default_var_bin =3D VariableMgr.format_data(self.NVHeaderBuff + se= lf.VarDefaultBuff + self.VarDeltaBuff)=0D + default_var_bin =3D VariableMgr.format_data(=0D + self.NVHeaderBuff + self.VarDefaultBuff + self.VarDeltaBuff)=0D value_str =3D "{"=0D - default_var_bin_strip =3D [ data.strip("""'""") for data in defaul= t_var_bin]=0D + default_var_bin_strip =3D [data.strip(=0D + """'""") for data in default_var_bin]=0D value_str +=3D ",".join(default_var_bin_strip)=0D value_str +=3D "}"=0D return value_str=0D @@ -57,13 +61,17 @@ class VariableMgr(object): indexedvarinfo =3D collections.OrderedDict()=0D for item in self.VarInfo:=0D if (item.skuname, item.defaultstoragename, item.var_name, item= .var_guid) not in indexedvarinfo:=0D - indexedvarinfo[(item.skuname, item.defaultstoragename, ite= m.var_name, item.var_guid) ] =3D []=0D - indexedvarinfo[(item.skuname, item.defaultstoragename, item.va= r_name, item.var_guid)].append(item)=0D + indexedvarinfo[(item.skuname, item.defaultstoragename,=0D + item.var_name, item.var_guid)] =3D []=0D + indexedvarinfo[(item.skuname, item.defaultstoragename,=0D + item.var_name, item.var_guid)].append(item)=0D for key in indexedvarinfo:=0D sku_var_info_offset_list =3D indexedvarinfo[key]=0D - sku_var_info_offset_list.sort(key=3Dlambda x:x.PcdDscLine)=0D - FirstOffset =3D int(sku_var_info_offset_list[0].var_offset, 16= ) if sku_var_info_offset_list[0].var_offset.upper().startswith("0X") else i= nt(sku_var_info_offset_list[0].var_offset)=0D - fisrtvalue_list =3D sku_var_info_offset_list[0].default_value.= strip("{").strip("}").split(",")=0D + sku_var_info_offset_list.sort(key=3Dlambda x: x.PcdDscLine)=0D + FirstOffset =3D int(sku_var_info_offset_list[0].var_offset, 16= ) if sku_var_info_offset_list[0].var_offset.upper(=0D + ).startswith("0X") else int(sku_var_info_offset_list[0].var_of= fset)=0D + fisrtvalue_list =3D sku_var_info_offset_list[0].default_value.= strip(=0D + "{").strip("}").split(",")=0D firstdata_type =3D sku_var_info_offset_list[0].data_type=0D if firstdata_type in DataType.TAB_PCD_NUMERIC_TYPES:=0D fisrtdata_flag =3D DataType.PACK_CODE_BY_SIZE[MAX_SIZE_TYP= E[firstdata_type]]=0D @@ -71,12 +79,15 @@ class VariableMgr(object): fisrtvalue_list =3D []=0D pack_data =3D pack(fisrtdata_flag, int(fisrtdata, 0))=0D for data_byte in range(len(pack_data)):=0D - fisrtvalue_list.append(hex(unpack("B", pack_data[data_= byte:data_byte + 1])[0]))=0D + fisrtvalue_list.append(=0D + hex(unpack("B", pack_data[data_byte:data_byte + 1]= )[0]))=0D newvalue_list =3D ["0x00"] * FirstOffset + fisrtvalue_list=0D =0D for var_item in sku_var_info_offset_list[1:]:=0D - CurOffset =3D int(var_item.var_offset, 16) if var_item.var= _offset.upper().startswith("0X") else int(var_item.var_offset)=0D - CurvalueList =3D var_item.default_value.strip("{").strip("= }").split(",")=0D + CurOffset =3D int(var_item.var_offset, 16) if var_item.var= _offset.upper(=0D + ).startswith("0X") else int(var_item.var_offset)=0D + CurvalueList =3D var_item.default_value.strip(=0D + "{").strip("}").split(",")=0D Curdata_type =3D var_item.data_type=0D if Curdata_type in DataType.TAB_PCD_NUMERIC_TYPES:=0D data_flag =3D DataType.PACK_CODE_BY_SIZE[MAX_SIZE_TYPE= [Curdata_type]]=0D @@ -84,15 +95,20 @@ class VariableMgr(object): CurvalueList =3D []=0D pack_data =3D pack(data_flag, int(data, 0))=0D for data_byte in range(len(pack_data)):=0D - CurvalueList.append(hex(unpack("B", pack_data[data= _byte:data_byte + 1])[0]))=0D + CurvalueList.append(=0D + hex(unpack("B", pack_data[data_byte:data_byte = + 1])[0]))=0D if CurOffset > len(newvalue_list):=0D - newvalue_list =3D newvalue_list + ["0x00"] * (CurOffse= t - len(newvalue_list)) + CurvalueList=0D + newvalue_list =3D newvalue_list + \=0D + ["0x00"] * (CurOffset - len(newvalue_list)=0D + ) + CurvalueList=0D else:=0D - newvalue_list[CurOffset : CurOffset + len(CurvalueList= )] =3D CurvalueList=0D + newvalue_list[CurOffset: CurOffset +=0D + len(CurvalueList)] =3D CurvalueList=0D =0D - newvaluestr =3D "{" + ",".join(newvalue_list) +"}"=0D + newvaluestr =3D "{" + ",".join(newvalue_list) + "}"=0D n =3D sku_var_info_offset_list[0]=0D - indexedvarinfo[key] =3D [var_info(n.pcdindex, n.pcdname, n.de= faultstoragename, n.skuname, n.var_name, n.var_guid, "0x00", n.var_attribut= e, newvaluestr, newvaluestr, DataType.TAB_VOID,n.PcdDscLine,n.StructurePcd)= ]=0D + indexedvarinfo[key] =3D [var_info(n.pcdindex, n.pcdname, n.def= aultstoragename, n.skuname, n.var_name, n.var_guid,=0D + "0x00", n.var_attribute, newva= luestr, newvaluestr, DataType.TAB_VOID, n.PcdDscLine, n.StructurePcd)]=0D self.VarInfo =3D [item[0] for item in list(indexedvarinfo.values()= )]=0D =0D def process_variable_data(self):=0D @@ -103,7 +119,8 @@ class VariableMgr(object): for item in self.VarInfo:=0D if item.pcdindex not in indexedvarinfo:=0D indexedvarinfo[item.pcdindex] =3D dict()=0D - indexedvarinfo[item.pcdindex][(item.skuname, item.defaultstora= gename)] =3D item=0D + indexedvarinfo[item.pcdindex][(=0D + item.skuname, item.defaultstoragename)] =3D item=0D =0D for index in indexedvarinfo:=0D sku_var_info =3D indexedvarinfo[index]=0D @@ -111,40 +128,52 @@ class VariableMgr(object): default_data_buffer =3D ""=0D others_data_buffer =3D ""=0D tail =3D None=0D - default_sku_default =3D indexedvarinfo[index].get((DataType.TA= B_DEFAULT, DataType.TAB_DEFAULT_STORES_DEFAULT))=0D + default_sku_default =3D indexedvarinfo[index].get(=0D + (DataType.TAB_DEFAULT, DataType.TAB_DEFAULT_STORES_DEFAULT= ))=0D =0D if default_sku_default.data_type not in DataType.TAB_PCD_NUMER= IC_TYPES:=0D - var_max_len =3D max(len(var_item.default_value.split(","))= for var_item in sku_var_info.values())=0D + var_max_len =3D max(len(var_item.default_value.split(","))= =0D + for var_item in sku_var_info.values())=0D if len(default_sku_default.default_value.split(",")) < var= _max_len:=0D - tail =3D ",".join("0x00" for i in range(var_max_len-le= n(default_sku_default.default_value.split(","))))=0D + tail =3D ",".join("0x00" for i in range(=0D + var_max_len-len(default_sku_default.default_value.= split(","))))=0D =0D - default_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(defaul= t_sku_default.default_value, default_sku_default.data_type, tail)=0D + default_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(=0D + default_sku_default.default_value, default_sku_default.dat= a_type, tail)=0D =0D default_data_array =3D ()=0D for item in range(len(default_data_buffer)):=0D - default_data_array +=3D unpack("B", default_data_buffer[it= em:item + 1])=0D + default_data_array +=3D unpack("B",=0D + default_data_buffer[item:item= + 1])=0D =0D - var_data[(DataType.TAB_DEFAULT, DataType.TAB_DEFAULT_STORES_DE= FAULT)][index] =3D (default_data_buffer, sku_var_info[(DataType.TAB_DEFAULT= , DataType.TAB_DEFAULT_STORES_DEFAULT)])=0D + var_data[(DataType.TAB_DEFAULT, DataType.TAB_DEFAULT_STORES_DE= FAULT)][index] =3D (=0D + default_data_buffer, sku_var_info[(DataType.TAB_DEFAULT, D= ataType.TAB_DEFAULT_STORES_DEFAULT)])=0D =0D for (skuid, defaultstoragename) in indexedvarinfo[index]:=0D tail =3D None=0D if (skuid, defaultstoragename) =3D=3D (DataType.TAB_DEFAUL= T, DataType.TAB_DEFAULT_STORES_DEFAULT):=0D continue=0D - other_sku_other =3D indexedvarinfo[index][(skuid, defaults= toragename)]=0D + other_sku_other =3D indexedvarinfo[index][(=0D + skuid, defaultstoragename)]=0D =0D if default_sku_default.data_type not in DataType.TAB_PCD_N= UMERIC_TYPES:=0D if len(other_sku_other.default_value.split(",")) < var= _max_len:=0D - tail =3D ",".join("0x00" for i in range(var_max_le= n-len(other_sku_other.default_value.split(","))))=0D + tail =3D ",".join("0x00" for i in range(=0D + var_max_len-len(other_sku_other.default_value.= split(","))))=0D =0D - others_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(oth= er_sku_other.default_value, other_sku_other.data_type, tail)=0D + others_data_buffer =3D VariableMgr.PACK_VARIABLES_DATA(=0D + other_sku_other.default_value, other_sku_other.data_ty= pe, tail)=0D =0D others_data_array =3D ()=0D for item in range(len(others_data_buffer)):=0D - others_data_array +=3D unpack("B", others_data_buffer[= item:item + 1])=0D + others_data_array +=3D unpack("B",=0D + others_data_buffer[item:it= em + 1])=0D =0D - data_delta =3D VariableMgr.calculate_delta(default_data_ar= ray, others_data_array)=0D + data_delta =3D VariableMgr.calculate_delta(=0D + default_data_array, others_data_array)=0D =0D - var_data[(skuid, defaultstoragename)][index] =3D (data_del= ta, sku_var_info[(skuid, defaultstoragename)])=0D + var_data[(skuid, defaultstoragename)][index] =3D (=0D + data_delta, sku_var_info[(skuid, defaultstoragename)])= =0D return var_data=0D =0D def new_process_varinfo(self):=0D @@ -155,41 +184,51 @@ class VariableMgr(object): if not var_data:=0D return []=0D =0D - pcds_default_data =3D var_data.get((DataType.TAB_DEFAULT, DataType= .TAB_DEFAULT_STORES_DEFAULT), {})=0D + pcds_default_data =3D var_data.get(=0D + (DataType.TAB_DEFAULT, DataType.TAB_DEFAULT_STORES_DEFAULT), {= })=0D NvStoreDataBuffer =3D bytearray()=0D var_data_offset =3D collections.OrderedDict()=0D offset =3D NvStorageHeaderSize=0D for default_data, default_info in pcds_default_data.values():=0D - var_name_buffer =3D VariableMgr.PACK_VARIABLE_NAME(default_inf= o.var_name)=0D + var_name_buffer =3D VariableMgr.PACK_VARIABLE_NAME(=0D + default_info.var_name)=0D =0D vendorguid =3D default_info.var_guid.split('-')=0D =0D if default_info.var_attribute:=0D - var_attr_value, _ =3D VariableAttributes.GetVarAttributes(= default_info.var_attribute)=0D + var_attr_value, _ =3D VariableAttributes.GetVarAttributes(= =0D + default_info.var_attribute)=0D else:=0D var_attr_value =3D 0x07=0D =0D DataBuffer =3D VariableMgr.AlignData(var_name_buffer + default= _data)=0D =0D data_size =3D len(DataBuffer)=0D - if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTH= ENTICATED_VARIABLE_STORE,"FALSE").upper() =3D=3D "TRUE":=0D - offset +=3D AuthenticatedVariableHeaderSize + len(default_= info.var_name.split(","))=0D + if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTH= ENTICATED_VARIABLE_STORE, "FALSE").upper() =3D=3D "TRUE":=0D + offset +=3D AuthenticatedVariableHeaderSize + \=0D + len(default_info.var_name.split(","))=0D else:=0D - offset +=3D VariableHeaderSize + len(default_info.var_name= .split(","))=0D + offset +=3D VariableHeaderSize + \=0D + len(default_info.var_name.split(","))=0D var_data_offset[default_info.pcdindex] =3D offset=0D offset +=3D data_size - len(default_info.var_name.split(","))= =0D - if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTH= ENTICATED_VARIABLE_STORE,"FALSE").upper() =3D=3D "TRUE":=0D - var_header_buffer =3D VariableMgr.PACK_AUTHENTICATED_VARIA= BLE_HEADER(var_attr_value, len(default_info.var_name.split(",")), len (defa= ult_data), vendorguid)=0D + if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTH= ENTICATED_VARIABLE_STORE, "FALSE").upper() =3D=3D "TRUE":=0D + var_header_buffer =3D VariableMgr.PACK_AUTHENTICATED_VARIA= BLE_HEADER(=0D + var_attr_value, len(default_info.var_name.split(",")),= len(default_data), vendorguid)=0D else:=0D - var_header_buffer =3D VariableMgr.PACK_VARIABLE_HEADER(var= _attr_value, len(default_info.var_name.split(",")), len (default_data), ven= dorguid)=0D + var_header_buffer =3D VariableMgr.PACK_VARIABLE_HEADER(var= _attr_value, len(=0D + default_info.var_name.split(",")), len(default_data), = vendorguid)=0D NvStoreDataBuffer +=3D (var_header_buffer + DataBuffer)=0D =0D - if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTI= CATED_VARIABLE_STORE,"FALSE").upper() =3D=3D "TRUE":=0D - variable_storage_header_buffer =3D VariableMgr.PACK_AUTHENTICA= TED_VARIABLE_STORE_HEADER(len(NvStoreDataBuffer) + 28)=0D + if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_VPD_AUTHENTI= CATED_VARIABLE_STORE, "FALSE").upper() =3D=3D "TRUE":=0D + variable_storage_header_buffer =3D VariableMgr.PACK_AUTHENTICA= TED_VARIABLE_STORE_HEADER(=0D + len(NvStoreDataBuffer) + 28)=0D else:=0D - variable_storage_header_buffer =3D VariableMgr.PACK_VARIABLE_S= TORE_HEADER(len(NvStoreDataBuffer) + 28)=0D + variable_storage_header_buffer =3D VariableMgr.PACK_VARIABLE_S= TORE_HEADER(=0D + len(NvStoreDataBuffer) + 28)=0D =0D - nv_default_part =3D VariableMgr.AlignData(VariableMgr.PACK_DEFAULT= _DATA(0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+NvStoreD= ataBuffer)), 8)=0D + nv_default_part =3D VariableMgr.AlignData(VariableMgr.PACK_DEFAULT= _DATA(=0D + 0, 0, VariableMgr.unpack_data(variable_storage_header_buffer+N= vStoreDataBuffer)), 8)=0D =0D data_delta_structure_buffer =3D bytearray()=0D for skuname, defaultstore in var_data:=0D @@ -200,24 +239,26 @@ class VariableMgr(object): for pcdindex in pcds_sku_data:=0D offset =3D var_data_offset[pcdindex]=0D delta_data, _ =3D pcds_sku_data[pcdindex]=0D - delta_data =3D [(item[0] + offset, item[1]) for item in de= lta_data]=0D + delta_data =3D [(item[0] + offset, item[1])=0D + for item in delta_data]=0D delta_data_set.extend(delta_data)=0D =0D - data_delta_structure_buffer +=3D VariableMgr.AlignData(self.PA= CK_DELTA_DATA(skuname, defaultstore, delta_data_set), 8)=0D + data_delta_structure_buffer +=3D VariableMgr.AlignData(=0D + self.PACK_DELTA_DATA(skuname, defaultstore, delta_data_set= ), 8)=0D =0D size =3D len(nv_default_part + data_delta_structure_buffer) + 16=0D maxsize =3D self.VpdRegionSize if self.VpdRegionSize else size=0D - NV_Store_Default_Header =3D VariableMgr.PACK_NV_STORE_DEFAULT_HEAD= ER(size, maxsize)=0D + NV_Store_Default_Header =3D VariableMgr.PACK_NV_STORE_DEFAULT_HEAD= ER(=0D + size, maxsize)=0D =0D - self.NVHeaderBuff =3D NV_Store_Default_Header=0D - self.VarDefaultBuff =3Dnv_default_part=0D - self.VarDeltaBuff =3D data_delta_structure_buffer=0D + self.NVHeaderBuff =3D NV_Store_Default_Header=0D + self.VarDefaultBuff =3D nv_default_part=0D + self.VarDeltaBuff =3D data_delta_structure_buffer=0D return VariableMgr.format_data(NV_Store_Default_Header + nv_defaul= t_part + data_delta_structure_buffer)=0D =0D -=0D @staticmethod=0D def format_data(data):=0D - return [hex(item) for item in VariableMgr.unpack_data(data)]=0D + return [hex(item) for item in VariableMgr.unpack_data(data)]=0D =0D @staticmethod=0D def unpack_data(data):=0D @@ -229,7 +270,8 @@ class VariableMgr(object): @staticmethod=0D def calculate_delta(default, theother):=0D if len(default) - len(theother) !=3D 0:=0D - EdkLogger.error("build", FORMAT_INVALID, 'The variable data le= ngth is not the same for the same PCD.')=0D + EdkLogger.error("build", FORMAT_INVALID,=0D + 'The variable data length is not the same for = the same PCD.')=0D data_delta =3D []=0D for i in range(len(default)):=0D if default[i] !=3D theother[i]:=0D @@ -241,7 +283,8 @@ class VariableMgr(object): default_var_bin =3D self.new_process_varinfo()=0D if default_var_bin:=0D value_str =3D "{"=0D - default_var_bin_strip =3D [ data.strip("""'""") for data in de= fault_var_bin]=0D + default_var_bin_strip =3D [data.strip(=0D + """'""") for data in default_var_bin]=0D value_str +=3D ",".join(default_var_bin_strip)=0D value_str +=3D "}"=0D return value_str=0D @@ -291,7 +334,7 @@ class VariableMgr(object): @staticmethod=0D def PACK_VARIABLE_HEADER(attribute, namesize, datasize, vendorguid):=0D =0D - Buffer =3D pack('=3DH', 0x55AA) # pack StartID=0D + Buffer =3D pack('=3DH', 0x55AA) # pack StartID=0D Buffer +=3D pack('=3DB', 0x3F) # pack State=0D Buffer +=3D pack('=3DB', 0) # pack reserved=0D =0D @@ -313,18 +356,18 @@ class VariableMgr(object): Buffer +=3D pack('=3DL', attribute)=0D =0D Buffer +=3D pack('=3DQ', 0) # pack MonotonicCount=0D - Buffer +=3D pack('=3DHBBBBBBLhBB', # pack TimeStamp=0D - 0, # UINT16 Year=0D - 0, # UINT8 Month=0D - 0, # UINT8 Day=0D - 0, # UINT8 Hour=0D - 0, # UINT8 Minute=0D - 0, # UINT8 Second=0D - 0, # UINT8 Pad1=0D - 0, # UINT32 Nanosecond=0D - 0, # INT16 TimeZone=0D - 0, # UINT8 Daylight=0D - 0) # UINT8 Pad2=0D + Buffer +=3D pack('=3DHBBBBBBLhBB', # pack TimeStamp=0D + 0, # UINT16 Year=0D + 0, # UINT8 Month=0D + 0, # UINT8 Day=0D + 0, # UINT8 Hour=0D + 0, # UINT8 Minute=0D + 0, # UINT8 Second=0D + 0, # UINT8 Pad1=0D + 0, # UINT32 Nanosecond=0D + 0, # INT16 TimeZone=0D + 0, # UINT8 Daylight=0D + 0) # UINT8 Pad2=0D Buffer +=3D pack('=3DL', 0) # pack PubKeyIndex=0D =0D Buffer +=3D pack('=3DL', namesize)=0D @@ -335,7 +378,7 @@ class VariableMgr(object): return Buffer=0D =0D @staticmethod=0D - def PACK_VARIABLES_DATA(var_value,data_type, tail =3D None):=0D + def PACK_VARIABLES_DATA(var_value, data_type, tail=3DNone):=0D Buffer =3D bytearray()=0D data_len =3D 0=0D if data_type =3D=3D DataType.TAB_VOID:=0D @@ -347,9 +390,10 @@ class VariableMgr(object): Buffer +=3D pack("=3DB", int(value_char, 16))=0D data_len +=3D len(tail.split(","))=0D elif data_type =3D=3D "BOOLEAN":=0D - Buffer +=3D pack("=3DB", True) if var_value.upper() in ["TRUE"= ,"1"] else pack("=3DB", False)=0D + Buffer +=3D pack("=3DB", True) if var_value.upper() in [=0D + "TRUE", "1"] else pack("=3DB", False)=0D data_len +=3D 1=0D - elif data_type =3D=3D DataType.TAB_UINT8:=0D + elif data_type =3D=3D DataType.TAB_UINT8:=0D Buffer +=3D pack("=3DB", GetIntegerValue(var_value))=0D data_len +=3D 1=0D elif data_type =3D=3D DataType.TAB_UINT16:=0D @@ -404,7 +448,7 @@ class VariableMgr(object): return Buffer=0D =0D @staticmethod=0D - def AlignData(data, align =3D 4):=0D + def AlignData(data, align=3D4):=0D mybuffer =3D data=0D if (len(data) % align) > 0:=0D for i in range(align - (len(data) % align)):=0D diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/= Source/Python/AutoGen/IdfClassObject.py index a6b8123c2539..1526a9f01de4 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to collect all defined strings in Image Definition fil= es=0D #=0D # Copyright (c) 2016, Intel Corporation. All rights reserved.
        =0D @@ -18,53 +18,56 @@ import os from Common.GlobalData import gIdentifierPattern=0D from .UniClassObject import StripComments=0D =0D -IMAGE_TOKEN =3D re.compile('IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE= | re.UNICODE)=0D +IMAGE_TOKEN =3D re.compile(=0D + 'IMAGE_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)=0D =0D #=0D # Value of different image information block types=0D #=0D -EFI_HII_IIBT_END =3D 0x00=0D -EFI_HII_IIBT_IMAGE_1BIT =3D 0x10=0D -EFI_HII_IIBT_IMAGE_1BIT_TRANS =3D 0x11=0D -EFI_HII_IIBT_IMAGE_4BIT =3D 0x12=0D -EFI_HII_IIBT_IMAGE_4BIT_TRANS =3D 0x13=0D -EFI_HII_IIBT_IMAGE_8BIT =3D 0x14=0D -EFI_HII_IIBT_IMAGE_8BIT_TRANS =3D 0x15=0D -EFI_HII_IIBT_IMAGE_24BIT =3D 0x16=0D +EFI_HII_IIBT_END =3D 0x00=0D +EFI_HII_IIBT_IMAGE_1BIT =3D 0x10=0D +EFI_HII_IIBT_IMAGE_1BIT_TRANS =3D 0x11=0D +EFI_HII_IIBT_IMAGE_4BIT =3D 0x12=0D +EFI_HII_IIBT_IMAGE_4BIT_TRANS =3D 0x13=0D +EFI_HII_IIBT_IMAGE_8BIT =3D 0x14=0D +EFI_HII_IIBT_IMAGE_8BIT_TRANS =3D 0x15=0D +EFI_HII_IIBT_IMAGE_24BIT =3D 0x16=0D EFI_HII_IIBT_IMAGE_24BIT_TRANS =3D 0x17=0D -EFI_HII_IIBT_IMAGE_JPEG =3D 0x18=0D -EFI_HII_IIBT_IMAGE_PNG =3D 0x19=0D -EFI_HII_IIBT_DUPLICATE =3D 0x20=0D -EFI_HII_IIBT_SKIP2 =3D 0x21=0D -EFI_HII_IIBT_SKIP1 =3D 0x22=0D -EFI_HII_IIBT_EXT1 =3D 0x30=0D -EFI_HII_IIBT_EXT2 =3D 0x31=0D -EFI_HII_IIBT_EXT4 =3D 0x32=0D +EFI_HII_IIBT_IMAGE_JPEG =3D 0x18=0D +EFI_HII_IIBT_IMAGE_PNG =3D 0x19=0D +EFI_HII_IIBT_DUPLICATE =3D 0x20=0D +EFI_HII_IIBT_SKIP2 =3D 0x21=0D +EFI_HII_IIBT_SKIP1 =3D 0x22=0D +EFI_HII_IIBT_EXT1 =3D 0x30=0D +EFI_HII_IIBT_EXT2 =3D 0x31=0D +EFI_HII_IIBT_EXT4 =3D 0x32=0D =0D #=0D # Value of HII package type=0D #=0D -EFI_HII_PACKAGE_TYPE_ALL =3D 0x00=0D -EFI_HII_PACKAGE_TYPE_GUID =3D 0x01=0D -EFI_HII_PACKAGE_FORMS =3D 0x02=0D -EFI_HII_PACKAGE_STRINGS =3D 0x04=0D -EFI_HII_PACKAGE_FONTS =3D 0x05=0D -EFI_HII_PACKAGE_IMAGES =3D 0x06=0D -EFI_HII_PACKAGE_SIMPLE_FONTS =3D 0x07=0D -EFI_HII_PACKAGE_DEVICE_PATH =3D 0x08=0D -EFI_HII_PACKAGE_KEYBOARD_LAYOUT =3D 0x09=0D -EFI_HII_PACKAGE_ANIMATIONS =3D 0x0A=0D -EFI_HII_PACKAGE_END =3D 0xDF=0D -EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN =3D 0xE0=0D -EFI_HII_PACKAGE_TYPE_SYSTEM_END =3D 0xFF=0D +EFI_HII_PACKAGE_TYPE_ALL =3D 0x00=0D +EFI_HII_PACKAGE_TYPE_GUID =3D 0x01=0D +EFI_HII_PACKAGE_FORMS =3D 0x02=0D +EFI_HII_PACKAGE_STRINGS =3D 0x04=0D +EFI_HII_PACKAGE_FONTS =3D 0x05=0D +EFI_HII_PACKAGE_IMAGES =3D 0x06=0D +EFI_HII_PACKAGE_SIMPLE_FONTS =3D 0x07=0D +EFI_HII_PACKAGE_DEVICE_PATH =3D 0x08=0D +EFI_HII_PACKAGE_KEYBOARD_LAYOUT =3D 0x09=0D +EFI_HII_PACKAGE_ANIMATIONS =3D 0x0A=0D +EFI_HII_PACKAGE_END =3D 0xDF=0D +EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN =3D 0xE0=0D +EFI_HII_PACKAGE_TYPE_SYSTEM_END =3D 0xFF=0D +=0D =0D class IdfFileClassObject(object):=0D - def __init__(self, FileList =3D []):=0D + def __init__(self, FileList=3D[]):=0D self.ImageFilesDict =3D {}=0D self.ImageIDList =3D []=0D for File in FileList:=0D if File is None:=0D - EdkLogger.error("Image Definition File Parser", PARSER_ERR= OR, 'No Image definition file is given.')=0D + EdkLogger.error("Image Definition File Parser",=0D + PARSER_ERROR, 'No Image definition file is= given.')=0D =0D try:=0D IdfFile =3D open(LongFilePath(File.Path), mode=3D'r')=0D @@ -82,30 +85,38 @@ class IdfFileClassObject(object): =0D LineNo =3D GetLineNo(FileIn, Line, False)=0D if not Line.startswith('#image '):=0D - EdkLogger.error("Image Definition File Parser", PARSER= _ERROR, 'The %s in Line %s of File %s is invalid.' % (Line, LineNo, File.Pa= th))=0D + EdkLogger.error("Image Definition File Parser", PARSER= _ERROR,=0D + 'The %s in Line %s of File %s is inval= id.' % (Line, LineNo, File.Path))=0D =0D if Line.find('#image ') >=3D 0:=0D LineDetails =3D Line.split()=0D Len =3D len(LineDetails)=0D if Len !=3D 3 and Len !=3D 4:=0D - 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))=0D + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR,=0D + 'The format is not match #image IM= AGE_ID [TRANSPARENT] ImageFileName in Line %s of File %s.' % (LineNo, File.= Path))=0D if Len =3D=3D 4 and LineDetails[2] !=3D 'TRANSPARENT':= =0D - 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))=0D + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR,=0D + 'Please use the keyword "TRANSPARE= NT" to describe the transparency setting in Line %s of File %s.' % (LineNo,= File.Path))=0D MatchString =3D gIdentifierPattern.match(LineDetails[1= ])=0D if MatchString is None:=0D - 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))=0D + EdkLogger.error('Image Definition File Parser', F= ORMAT_INVALID,=0D + 'The Image token name %s defined i= n Idf file %s contains the invalid character.' % (LineDetails[1], File.Path= ))=0D if LineDetails[1] not in self.ImageIDList:=0D self.ImageIDList.append(LineDetails[1])=0D else:=0D - 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))=0D + EdkLogger.error("Image Definition File Parser", PA= RSER_ERROR, 'The %s in Line %s of File %s is already defined.' % (=0D + LineDetails[1], LineNo, File.Path))=0D if Len =3D=3D 4:=0D - ImageFile =3D ImageFileObject(LineDetails[Len-1], = LineDetails[1], True)=0D + ImageFile =3D ImageFileObject(=0D + LineDetails[Len-1], LineDetails[1], True)=0D else:=0D - ImageFile =3D ImageFileObject(LineDetails[Len-1], = LineDetails[1], False)=0D + ImageFile =3D ImageFileObject(=0D + LineDetails[Len-1], LineDetails[1], False)=0D ImageFileList.append(ImageFile)=0D if ImageFileList:=0D self.ImageFilesDict[File] =3D ImageFileList=0D =0D +=0D def SearchImageID(ImageFileObject, FileList):=0D if FileList =3D=3D []:=0D return ImageFileObject=0D @@ -116,11 +127,13 @@ def SearchImageID(ImageFileObject, FileList): for Line in Lines:=0D ImageIdList =3D IMAGE_TOKEN.findall(Line)=0D for ID in ImageIdList:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "Found ImageID iden= tifier: " + ID)=0D + EdkLogger.debug(EdkLogger.DEBUG_5,=0D + "Found ImageID identifier: " + ID)=0D ImageFileObject.SetImageIDReferenced(ID)=0D =0D +=0D class ImageFileObject(object):=0D - def __init__(self, FileName, ImageID, TransParent =3D False):=0D + def __init__(self, FileName, ImageID, TransParent=3DFalse):=0D self.FileName =3D FileName=0D self.File =3D ''=0D self.ImageID =3D ImageID=0D diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools= /Source/Python/AutoGen/IncludesAutoGen.py index 5ec26eb98b42..7d3dbae33512 100644 --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Build cache intermediate result and state=0D #=0D # Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
        =0D @@ -16,6 +16,7 @@ gIsFileMap =3D {} =0D DEP_FILE_TAIL =3D "# Updated \n"=0D =0D +=0D class IncludesAutoGen():=0D """ This class is to manage the dependent files witch are used in Make= file to support incremental build.=0D 1. C files:=0D @@ -34,6 +35,7 @@ class IncludesAutoGen(): 2. ASM PP use c preprocessor to find out all included files wi= th #include format and generate a deps file=0D 3. build tool updates the .deps file=0D """=0D +=0D def __init__(self, makefile_folder, ModuleAuto):=0D self.d_folder =3D makefile_folder=0D self.makefile_folder =3D makefile_folder=0D @@ -42,14 +44,16 @@ class IncludesAutoGen(): self.workspace =3D ModuleAuto.WorkspaceDir=0D =0D def CreateModuleDeps(self):=0D - SaveFileOnChange(os.path.join(self.makefile_folder,"deps.txt"),"\n= ".join(self.DepsCollection),False)=0D + SaveFileOnChange(os.path.join(self.makefile_folder,=0D + "deps.txt"), "\n".join(self.DepsCollection), Fals= e)=0D =0D def CreateDepsInclude(self):=0D - deps_file =3D {'deps_file':self.deps_files}=0D + deps_file =3D {'deps_file': self.deps_files}=0D =0D MakePath =3D self.module_autogen.BuildOption.get('MAKE', {}).get('= PATH')=0D if not MakePath:=0D - EdkLogger.error("build", PARAMETER_MISSING, Message=3D"No Make= path available.")=0D + EdkLogger.error("build", PARAMETER_MISSING,=0D + Message=3D"No Make path available.")=0D elif "nmake" in MakePath:=0D _INCLUDE_DEPS_TEMPLATE =3D TemplateString('''=0D ${BEGIN}=0D @@ -69,10 +73,12 @@ ${END} deps_include_str =3D _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)= =0D except Exception as e:=0D print(e)=0D - SaveFileOnChange(os.path.join(self.makefile_folder,"dependency"),d= eps_include_str,False)=0D + SaveFileOnChange(os.path.join(self.makefile_folder,=0D + "dependency"), deps_include_str, False)=0D =0D def CreateDepsTarget(self):=0D - SaveFileOnChange(os.path.join(self.makefile_folder,"deps_target"),= "\n".join([item +":" for item in self.DepsCollection]),False)=0D + SaveFileOnChange(os.path.join(self.makefile_folder, "deps_target")= , "\n".join(=0D + [item + ":" for item in self.DepsCollection]), False)=0D =0D @cached_property=0D def deps_files(self):=0D @@ -93,14 +99,14 @@ ${END} targetname =3D [item[0].Name for item in self.TargetFileList.value= s()]=0D for abspath in self.deps_files:=0D try:=0D - with open(abspath,"r") as fd:=0D + with open(abspath, "r") as fd:=0D lines =3D fd.readlines()=0D =0D firstlineitems =3D lines[0].split(": ")=0D dependency_file =3D firstlineitems[1].strip(" \\\n")=0D dependency_file =3D dependency_file.strip('''"''')=0D if dependency_file:=0D - if os.path.normpath(dependency_file +".deps") =3D=3D a= bspath:=0D + if os.path.normpath(dependency_file + ".deps") =3D=3D = abspath:=0D continue=0D filename =3D os.path.basename(dependency_file).strip()= =0D if filename not in targetname:=0D @@ -113,14 +119,15 @@ ${END} dependency_file =3D dependency_file.strip('''"''')=0D if dependency_file =3D=3D '':=0D continue=0D - if os.path.normpath(dependency_file +".deps") =3D=3D a= bspath:=0D + if os.path.normpath(dependency_file + ".deps") =3D=3D = abspath:=0D continue=0D filename =3D os.path.basename(dependency_file).strip()= =0D if filename in targetname:=0D continue=0D includes.add(dependency_file.strip())=0D except Exception as e:=0D - EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist"= % abspath, ExtraData=3Dstr(e), RaiseError=3DFalse)=0D + EdkLogger.error("build", FILE_NOT_FOUND, "%s doesn't exist= " %=0D + abspath, ExtraData=3Dstr(e), RaiseError=3D= False)=0D continue=0D rt =3D sorted(list(set([item.strip(' " \\\n') for item in includes= ])))=0D return rt=0D @@ -128,49 +135,60 @@ ${END} @cached_property=0D def SourceFileList(self):=0D """ Get a map of module's source files name to module's source fil= es path """=0D - source =3D {os.path.basename(item.File):item.Path for item in self= .module_autogen.SourceFileList}=0D + source =3D {os.path.basename(=0D + item.File): item.Path for item in self.module_autogen.SourceFi= leList}=0D middle_file =3D {}=0D for afile in source:=0D if afile.upper().endswith(".VFR"):=0D - middle_file.update({afile.split(".")[0]+".c":os.path.join(= self.module_autogen.DebugDir,afile.split(".")[0]+".c")})=0D - if afile.upper().endswith((".S","ASM")):=0D - middle_file.update({afile.split(".")[0]+".i":os.path.join(= self.module_autogen.OutputDir,afile.split(".")[0]+".i")})=0D + middle_file.update({afile.split(".")[=0D + 0]+".c": os.path.join(self.module_autog= en.DebugDir, afile.split(".")[0]+".c")})=0D + if afile.upper().endswith((".S", "ASM")):=0D + middle_file.update({afile.split(".")[=0D + 0]+".i": os.path.join(self.module_autog= en.OutputDir, afile.split(".")[0]+".i")})=0D if afile.upper().endswith(".ASL"):=0D - middle_file.update({afile.split(".")[0]+".i":os.path.join(= self.module_autogen.OutputDir,afile.split(".")[0]+".i")})=0D - source.update({"AutoGen.c":os.path.join(self.module_autogen.Output= Dir,"AutoGen.c")})=0D + middle_file.update({afile.split(".")[=0D + 0]+".i": os.path.join(self.module_autog= en.OutputDir, afile.split(".")[0]+".i")})=0D + source.update({"AutoGen.c": os.path.join(=0D + self.module_autogen.OutputDir, "AutoGen.c")})=0D source.update(middle_file)=0D return source=0D =0D @cached_property=0D def HasNamesakeSourceFile(self):=0D - source_base_name =3D set([os.path.basename(item.File) for item in = self.module_autogen.SourceFileList])=0D + source_base_name =3D set([os.path.basename(item.File)=0D + for item in self.module_autogen.SourceFileL= ist])=0D rt =3D len(source_base_name) !=3D len(self.module_autogen.SourceFi= leList)=0D return rt=0D +=0D @cached_property=0D def CcPPCommandPathSet(self):=0D rt =3D set()=0D - rt.add(self.module_autogen.BuildOption.get('CC',{}).get('PATH'))=0D - rt.add(self.module_autogen.BuildOption.get('ASLCC',{}).get('PATH')= )=0D - rt.add(self.module_autogen.BuildOption.get('ASLPP',{}).get('PATH')= )=0D - rt.add(self.module_autogen.BuildOption.get('VFRPP',{}).get('PATH')= )=0D - rt.add(self.module_autogen.BuildOption.get('PP',{}).get('PATH'))=0D - rt.add(self.module_autogen.BuildOption.get('APP',{}).get('PATH'))= =0D + rt.add(self.module_autogen.BuildOption.get('CC', {}).get('PATH'))= =0D + rt.add(self.module_autogen.BuildOption.get('ASLCC', {}).get('PATH'= ))=0D + rt.add(self.module_autogen.BuildOption.get('ASLPP', {}).get('PATH'= ))=0D + rt.add(self.module_autogen.BuildOption.get('VFRPP', {}).get('PATH'= ))=0D + rt.add(self.module_autogen.BuildOption.get('PP', {}).get('PATH'))= =0D + rt.add(self.module_autogen.BuildOption.get('APP', {}).get('PATH'))= =0D rt.discard(None)=0D return rt=0D +=0D @cached_property=0D def TargetFileList(self):=0D """ Get a map of module's target name to a tuple of module's targe= ts path and whose input file path """=0D targets =3D {}=0D - targets["AutoGen.obj"] =3D (PathClass(os.path.join(self.module_aut= ogen.OutputDir,"AutoGen.obj")),PathClass(os.path.join(self.module_autogen.D= ebugDir,"AutoGen.c")))=0D + targets["AutoGen.obj"] =3D (PathClass(os.path.join(self.module_aut= ogen.OutputDir, "AutoGen.obj")), PathClass(=0D + os.path.join(self.module_autogen.DebugDir, "AutoGen.c")))=0D for item in self.module_autogen.Targets.values():=0D for block in item:=0D - targets[block.Target.Path] =3D (block.Target,block.Inputs[= 0])=0D + targets[block.Target.Path] =3D (block.Target, block.Inputs= [0])=0D return targets=0D =0D - def GetRealTarget(self,source_file_abs):=0D + def GetRealTarget(self, source_file_abs):=0D """ Get the final target file based on source file abspath """=0D - source_target_map =3D {item[1].Path:item[0].Path for item in self.= TargetFileList.values()}=0D - source_name_map =3D {item[1].File:item[0].Path for item in self.Ta= rgetFileList.values()}=0D + source_target_map =3D {=0D + item[1].Path: item[0].Path for item in self.TargetFileList.val= ues()}=0D + source_name_map =3D {=0D + item[1].File: item[0].Path for item in self.TargetFileList.val= ues()}=0D target_abs =3D source_target_map.get(source_file_abs)=0D if target_abs is None:=0D if source_file_abs.strip().endswith(".i"):=0D @@ -205,28 +223,33 @@ ${END} if not item.startswith("/"):=0D if item.endswith(".txt") and item.startswi= th("@"):=0D with open(item[1:], "r") as file:=0D - source_files =3D file.readlines()[= 0].split()=0D + source_files =3D file.readlines()[= =0D + 0].split()=0D SourceFileAbsPathMap =3D {os.path.= basename(file): file for file in source_files if=0D os.path.ex= ists(file)}=0D else:=0D if os.path.exists(item):=0D - SourceFileAbsPathMap.update({os.pa= th.basename(item): item.strip()})=0D + SourceFileAbsPathMap.update(=0D + {os.path.basename(item): item.= strip()})=0D # SourceFileAbsPathMap =3D {os.path.basename(item)= :item for item in cc_options if not item.startswith("/") and os.path.exists= (item)}=0D if line in SourceFileAbsPathMap:=0D current_source =3D line=0D if current_source not in ModuleDepDict:=0D ModuleDepDict[SourceFileAbsPathMap[current_source]] = =3D []=0D - elif "Note: including file:" =3D=3D line.lstrip()[:21]:=0D + elif "Note: including file:" =3D=3D line.lstrip()[:21]:=0D if not current_source:=0D - EdkLogger.error("build",BUILD_ERROR, "Parse /showInclu= des output failed. line: %s. \n" % line, RaiseError=3DFalse)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Parse /showIncludes output = failed. line: %s. \n" % line, RaiseError=3DFalse)=0D else:=0D - ModuleDepDict[SourceFileAbsPathMap[current_source]].ap= pend(line.lstrip()[22:].strip())=0D + ModuleDepDict[SourceFileAbsPathMap[current_source]].ap= pend(line.lstrip()[=0D + = 22:].strip())=0D =0D for source_abs in ModuleDepDict:=0D if ModuleDepDict[source_abs]:=0D target_abs =3D self.GetRealTarget(source_abs)=0D dep_file_name =3D os.path.basename(source_abs) + ".deps"=0D - SaveFileOnChange(os.path.join(os.path.dirname(target_abs),= dep_file_name)," \\\n".join([target_abs+":"] + ['''"''' + item +'''"''' for= item in ModuleDepDict[source_abs]]),False)=0D + SaveFileOnChange(os.path.join(os.path.dirname(target_abs),= dep_file_name), " \\\n".join(=0D + [target_abs+":"] + ['''"''' + item + '''"''' for item = in ModuleDepDict[source_abs]]), False)=0D =0D def UpdateDepsFileforNonMsvc(self):=0D """ Update .deps files.=0D @@ -239,7 +262,7 @@ ${END} continue=0D try:=0D newcontent =3D []=0D - with open(abspath,"r") as fd:=0D + with open(abspath, "r") as fd:=0D lines =3D fd.readlines()=0D if lines[-1] =3D=3D DEP_FILE_TAIL:=0D continue=0D @@ -250,7 +273,7 @@ ${END} else:=0D sourceitem =3D lines[1].strip().split(" ")[0]=0D =0D - source_abs =3D self.SourceFileList.get(sourceitem,sourceit= em)=0D + source_abs =3D self.SourceFileList.get(sourceitem, sourcei= tem)=0D firstlineitems[0] =3D self.GetRealTarget(source_abs)=0D p_target =3D firstlineitems=0D if not p_target[0].strip().endswith(":"):=0D @@ -268,10 +291,11 @@ ${END} =0D newcontent.append("\n")=0D newcontent.append(DEP_FILE_TAIL)=0D - with open(abspath,"w") as fw:=0D + with open(abspath, "w") as fw:=0D fw.write("".join(newcontent))=0D except Exception as e:=0D - EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist"= % abspath, ExtraData=3Dstr(e), RaiseError=3DFalse)=0D + EdkLogger.error("build", FILE_NOT_FOUND, "%s doesn't exist= " %=0D + abspath, ExtraData=3Dstr(e), RaiseError=3D= False)=0D continue=0D =0D def UpdateDepsFileforTrim(self):=0D @@ -282,7 +306,7 @@ ${END} continue=0D try:=0D newcontent =3D []=0D - with open(abspath,"r") as fd:=0D + with open(abspath, "r") as fd:=0D lines =3D fd.readlines()=0D if lines[-1] =3D=3D DEP_FILE_TAIL:=0D continue=0D @@ -291,14 +315,15 @@ ${END} targetitem =3D self.GetRealTarget(source_abs.strip(" :"))= =0D =0D targetitem +=3D ": "=0D - if len(lines)>=3D2:=0D + if len(lines) >=3D 2:=0D targetitem +=3D lines[1]=0D newcontent.append(targetitem)=0D newcontent.extend(lines[2:])=0D newcontent.append("\n")=0D newcontent.append(DEP_FILE_TAIL)=0D - with open(abspath,"w") as fw:=0D + with open(abspath, "w") as fw:=0D fw.write("".join(newcontent))=0D except Exception as e:=0D - EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist"= % abspath, ExtraData=3Dstr(e), RaiseError=3DFalse)=0D + EdkLogger.error("build", FILE_NOT_FOUND, "%s doesn't exist= " %=0D + abspath, ExtraData=3Dstr(e), RaiseError=3D= False)=0D continue=0D diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTool= s/Source/Python/AutoGen/InfSectionParser.py index a55ddac341b6..0b27fa4e4ea4 100644 --- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py +++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py @@ -1,11 +1,11 @@ -## @file=0D +# @file=0D # Parser a Inf file and Get specify section data.=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D =0D import Common.EdkLogger as EdkLogger=0D @@ -31,7 +31,8 @@ class InfSectionParser(): with open(self._FilePath, "r") as File:=0D FileLinesList =3D File.readlines()=0D except BaseException:=0D - EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened fai= led.' % self._FilePath)=0D + EdkLogger.error("build", AUTOGEN_ERROR,=0D + 'File %s is opened failed.' % self._FilePath)= =0D =0D for Index in range(0, len(FileLinesList)):=0D line =3D str(FileLinesList[Index]).strip()=0D @@ -48,8 +49,8 @@ class InfSectionParser(): UserExtFind =3D True=0D FindEnd =3D False=0D =0D - if (NextLine !=3D '' and NextLine[0] =3D=3D TAB_SECTION_START = and \=0D - NextLine[-1] =3D=3D TAB_SECTION_END) or FileLastLine:=0D + if (NextLine !=3D '' and NextLine[0] =3D=3D TAB_SECTION_START = and=0D + NextLine[-1] =3D=3D TAB_SECTION_END) or FileLastLine:= =0D UserExtFind =3D False=0D FindEnd =3D True=0D self._FileSectionDataList.append({SectionLine: SectionData= [:]})=0D @@ -66,13 +67,16 @@ class InfSectionParser(): for SectionDataDict in self._FileSectionDataList:=0D for key in SectionDataDict:=0D if key.lower().startswith("[userextensions") and key.lower= ().find('.tianocore.') > -1:=0D - SectionLine =3D key.lstrip(TAB_SECTION_START).rstrip(T= AB_SECTION_END)=0D + SectionLine =3D key.lstrip(=0D + TAB_SECTION_START).rstrip(TAB_SECTION_END)=0D SubSectionList =3D [SectionLine]=0D if str(SectionLine).find(TAB_COMMA_SPLIT) > -1:=0D - SubSectionList =3D str(SectionLine).split(TAB_COMM= A_SPLIT)=0D + SubSectionList =3D str(=0D + SectionLine).split(TAB_COMMA_SPLIT)=0D for SubSection in SubSectionList:=0D if SubSection.lower().find('.tianocore.') > -1:=0D - UserExtensionTianoCore.append({SubSection: Sec= tionDataDict[key]})=0D + UserExtensionTianoCore.append(=0D + {SubSection: SectionDataDict[key]})=0D return UserExtensionTianoCore=0D =0D # Get depex expression=0D @@ -85,10 +89,12 @@ class InfSectionParser(): for SectionDataDict in self._FileSectionDataList:=0D for key in SectionDataDict:=0D if key.lower() =3D=3D "[depex]" or key.lower().startswith(= "[depex."):=0D - SectionLine =3D key.lstrip(TAB_SECTION_START).rstrip(T= AB_SECTION_END)=0D + SectionLine =3D key.lstrip(=0D + TAB_SECTION_START).rstrip(TAB_SECTION_END)=0D SubSectionList =3D [SectionLine]=0D if str(SectionLine).find(TAB_COMMA_SPLIT) > -1:=0D - SubSectionList =3D str(SectionLine).split(TAB_COMM= A_SPLIT)=0D + SubSectionList =3D str(=0D + SectionLine).split(TAB_COMMA_SPLIT)=0D for SubSection in SubSectionList:=0D SectionList =3D SubSection.split(TAB_SPLIT)=0D SubKey =3D ()=0D @@ -99,21 +105,8 @@ class InfSectionParser(): elif len(SectionList) =3D=3D 3:=0D SubKey =3D (SectionList[1], SectionList[2])=0D else:=0D - EdkLogger.error("build", AUTOGEN_ERROR, 'Secti= on %s is invalid.' % key)=0D - DepexExpressionList.append({SubKey: SectionDataDic= t[key]})=0D + EdkLogger.error(=0D + "build", AUTOGEN_ERROR, 'Section %s is inv= alid.' % key)=0D + DepexExpressionList.append(=0D + {SubKey: SectionDataDict[key]})=0D return DepexExpressionList=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/S= ource/Python/AutoGen/ModuleAutoGen.py index d05410b32966..4983a2e124fb 100755 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,7 @@ from Common.LongFilePathSupport import LongFilePath, Copy= LongFilePath from Common.BuildToolError import *=0D from Common.DataType import *=0D from Common.Misc import *=0D -from Common.StringUtils import NormPath,GetSplitList=0D +from Common.StringUtils import NormPath, GetSplitList=0D from collections import defaultdict=0D from Workspace.WorkspaceCommon import OrderedListDict=0D import os.path as path=0D @@ -25,20 +25,22 @@ from GenPatchPcdTable.GenPatchPcdTable import parsePcdI= nfoFromMapFile from Workspace.MetaFileCommentParser import UsageList=0D from .GenPcdDb import CreatePcdDatabaseCode=0D from Common.caching import cached_class_function=0D -from AutoGen.ModuleAutoGenHelper import PlatformInfo,WorkSpaceInfo=0D +from AutoGen.ModuleAutoGenHelper import PlatformInfo, WorkSpaceInfo=0D import json=0D import tempfile=0D =0D -## Mapping Makefile type=0D -gMakeTypeMap =3D {TAB_COMPILER_MSFT:"nmake", "GCC":"gmake"}=0D +# Mapping Makefile type=0D +gMakeTypeMap =3D {TAB_COMPILER_MSFT: "nmake", "GCC": "gmake"}=0D #=0D # Regular expression for finding Include Directories, the difference betwe= en MSFT and INTEL/GCC=0D # is the former use /I , the Latter used -I to specify include directories= =0D #=0D -gBuildOptIncludePatternMsft =3D re.compile(r"(?:.*?)/I[ \t]*([^ ]*)", re.M= ULTILINE | re.DOTALL)=0D -gBuildOptIncludePatternOther =3D re.compile(r"(?:.*?)-I[ \t]*([^ ]*)", re.= MULTILINE | re.DOTALL)=0D +gBuildOptIncludePatternMsft =3D re.compile(=0D + r"(?:.*?)/I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL)=0D +gBuildOptIncludePatternOther =3D re.compile(=0D + r"(?:.*?)-I[ \t]*([^ ]*)", re.MULTILINE | re.DOTALL)=0D =0D -## default file name for AutoGen=0D +# default file name for AutoGen=0D gAutoGenCodeFileName =3D "AutoGen.c"=0D gAutoGenHeaderFileName =3D "AutoGen.h"=0D gAutoGenStringFileName =3D "%(module_name)sStrDefs.h"=0D @@ -133,11 +135,15 @@ ${tail_comments} # extend lists contained in a dictionary with lists stored in another dict= ionary=0D # if CopyToDict is not derived from DefaultDict(list) then this may raise = exception=0D #=0D +=0D +=0D def ExtendCopyDictionaryLists(CopyToDict, CopyFromDict):=0D for Key in CopyFromDict:=0D CopyToDict[Key].extend(CopyFromDict[Key])=0D =0D # Create a directory specified by a set of path elements and return the fu= ll path=0D +=0D +=0D def _MakeDir(PathList):=0D RetVal =3D path.join(*PathList)=0D CreateDirectory(RetVal)=0D @@ -146,6 +152,8 @@ def _MakeDir(PathList): #=0D # Convert string to C format array=0D #=0D +=0D +=0D def _ConvertStringToByteArray(Value):=0D Value =3D Value.strip()=0D if not Value:=0D @@ -182,32 +190,35 @@ def _ConvertStringToByteArray(Value): Value =3D NewValue + '0}'=0D return Value=0D =0D -## ModuleAutoGen class=0D +# ModuleAutoGen class=0D #=0D # This class encapsules the AutoGen behaviors for the build tools. In addi= tion to=0D # the generation of AutoGen.h and AutoGen.c, it will generate *.depex file= according=0D # to the [depex] section in module's inf file.=0D #=0D +=0D +=0D class ModuleAutoGen(AutoGen):=0D # call super().__init__ then call the worker function with different p= arameter count=0D def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args= , **kwargs):=0D if not hasattr(self, "_Init"):=0D - self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch,= *args)=0D + self._InitWorker(Workspace, MetaFile, Target,=0D + Toolchain, Arch, *args)=0D self._Init =3D True=0D =0D - ## Cache the timestamps of metafiles of every module in a class attrib= ute=0D + # Cache the timestamps of metafiles of every module in a class attribu= te=0D #=0D TimeDict =3D {}=0D =0D def __new__(cls, Workspace, MetaFile, Target, Toolchain, Arch, *args, = **kwargs):=0D -# check if this module is employed by active platform=0D - if not PlatformInfo(Workspace, args[0], Target, Toolchain, Arch,ar= gs[-1]).ValidModule(MetaFile):=0D - EdkLogger.verbose("Module [%s] for [%s] is not employed by act= ive platform\n" \=0D + # check if this module is employed by active platform=0D + if not PlatformInfo(Workspace, args[0], Target, Toolchain, Arch, a= rgs[-1]).ValidModule(MetaFile):=0D + EdkLogger.verbose("Module [%s] for [%s] is not employed by act= ive platform\n"=0D % (MetaFile, Arch))=0D return None=0D return super(ModuleAutoGen, cls).__new__(cls, Workspace, MetaFile,= Target, Toolchain, Arch, *args, **kwargs)=0D =0D - ## Initialize ModuleAutoGen=0D + # Initialize ModuleAutoGen=0D #=0D # @param Workspace EdkIIWorkspaceBuild object=0D # @param ModuleFile The path of module file=0D @@ -216,9 +227,11 @@ class ModuleAutoGen(AutoGen): # @param Arch The arch the module supports=0D # @param PlatformFile Platform meta-file=0D #=0D - def _InitWorker(self, Workspace, ModuleFile, Target, Toolchain, Arch, = PlatformFile,DataPipe):=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen module [%s] [%s]" % (M= oduleFile, Arch))=0D - GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (ModuleFile, Ar= ch, Toolchain, Target)=0D + def _InitWorker(self, Workspace, ModuleFile, Target, Toolchain, Arch, = PlatformFile, DataPipe):=0D + EdkLogger.debug(EdkLogger.DEBUG_9,=0D + "AutoGen module [%s] [%s]" % (ModuleFile, Arch))=0D + GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (=0D + ModuleFile, Arch, Toolchain, Target)=0D =0D self.Workspace =3D Workspace=0D self.WorkspaceDir =3D ""=0D @@ -241,35 +254,38 @@ class ModuleAutoGen(AutoGen): =0D self.BuildDatabase =3D self.Workspace.BuildDatabase=0D self.BuildRuleOrder =3D None=0D - self.BuildTime =3D 0=0D + self.BuildTime =3D 0=0D =0D self._GuidComments =3D OrderedListDict()=0D self._ProtocolComments =3D OrderedListDict()=0D self._PpiComments =3D OrderedListDict()=0D - self._BuildTargets =3D None=0D - self._IntroBuildTargetList =3D None=0D - self._FinalBuildTargetList =3D None=0D - self._FileTypes =3D None=0D + self._BuildTargets =3D None=0D + self._IntroBuildTargetList =3D None=0D + self._FinalBuildTargetList =3D None=0D + self._FileTypes =3D None=0D =0D self.AutoGenDepSet =3D set()=0D self.ReferenceModules =3D []=0D - self.ConstPcd =3D {}=0D - self.FileDependCache =3D {}=0D + self.ConstPcd =3D {}=0D + self.FileDependCache =3D {}=0D =0D def __init_platform_info__(self):=0D pinfo =3D self.DataPipe.Get("P_Info")=0D self.WorkspaceDir =3D pinfo.get("WorkspaceDir")=0D - self.PlatformInfo =3D PlatformInfo(self.Workspace,pinfo.get("Activ= ePlatform"),pinfo.get("Target"),pinfo.get("ToolChain"),pinfo.get("Arch"),se= lf.DataPipe)=0D - ## hash() operator of ModuleAutoGen=0D + self.PlatformInfo =3D PlatformInfo(self.Workspace, pinfo.get("Acti= vePlatform"), pinfo.get(=0D + "Target"), pinfo.get("ToolChain"), pinfo.get("Arch"), self.Dat= aPipe)=0D + # hash() operator of ModuleAutoGen=0D #=0D # The module file path and arch string will be used to represent=0D # hash value of this object=0D #=0D # @retval int Hash value of the module file path and arch=0D #=0D +=0D @cached_class_function=0D def __hash__(self):=0D - return hash((self.MetaFile, self.Arch, self.ToolChain,self.BuildTa= rget))=0D + return hash((self.MetaFile, self.Arch, self.ToolChain, self.BuildT= arget))=0D +=0D def __repr__(self):=0D return "%s [%s]" % (self.MetaFile, self.Arch)=0D =0D @@ -290,7 +306,8 @@ class ModuleAutoGen(AutoGen): for Pcd in self.FixedAtBuildPcds:=0D if Pcd.DatumType =3D=3D TAB_VOID:=0D if '.'.join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) not= in RetVal:=0D - RetVal['.'.join((Pcd.TokenSpaceGuidCName, Pcd.TokenCNa= me))] =3D Pcd.DefaultValue=0D + RetVal['.'.join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName))] =3D Pc= d.DefaultValue=0D return RetVal=0D =0D @property=0D @@ -298,61 +315,61 @@ class ModuleAutoGen(AutoGen): ModuleNames =3D self.DataPipe.Get("M_Name")=0D if not ModuleNames:=0D return self.Name=0D - return ModuleNames.get((self.Name,self.MetaFile),self.Name)=0D + return ModuleNames.get((self.Name, self.MetaFile), self.Name)=0D =0D # Macros could be used in build_rule.txt (also Makefile)=0D @cached_property=0D def Macros(self):=0D return OrderedDict((=0D - ("WORKSPACE" ,self.WorkspaceDir),=0D - ("MODULE_NAME" ,self.Name),=0D - ("MODULE_NAME_GUID" ,self.UniqueBaseName),=0D - ("MODULE_GUID" ,self.Guid),=0D - ("MODULE_VERSION" ,self.Version),=0D - ("MODULE_TYPE" ,self.ModuleType),=0D - ("MODULE_FILE" ,str(self.MetaFile)),=0D - ("MODULE_FILE_BASE_NAME" ,self.MetaFile.BaseName),=0D - ("MODULE_RELATIVE_DIR" ,self.SourceDir),=0D - ("MODULE_DIR" ,self.SourceDir),=0D - ("BASE_NAME" ,self.Name),=0D - ("ARCH" ,self.Arch),=0D - ("TOOLCHAIN" ,self.ToolChain),=0D - ("TOOLCHAIN_TAG" ,self.ToolChain),=0D - ("TOOL_CHAIN_TAG" ,self.ToolChain),=0D - ("TARGET" ,self.BuildTarget),=0D - ("BUILD_DIR" ,self.PlatformInfo.BuildDir),=0D - ("BIN_DIR" ,os.path.join(self.PlatformInfo.BuildDir, self.Arch= )),=0D - ("LIB_DIR" ,os.path.join(self.PlatformInfo.BuildDir, self.Arch= )),=0D - ("MODULE_BUILD_DIR" ,self.BuildDir),=0D - ("OUTPUT_DIR" ,self.OutputDir),=0D - ("DEBUG_DIR" ,self.DebugDir),=0D - ("DEST_DIR_OUTPUT" ,self.OutputDir),=0D - ("DEST_DIR_DEBUG" ,self.DebugDir),=0D - ("PLATFORM_NAME" ,self.PlatformInfo.Name),=0D - ("PLATFORM_GUID" ,self.PlatformInfo.Guid),=0D - ("PLATFORM_VERSION" ,self.PlatformInfo.Version),=0D - ("PLATFORM_RELATIVE_DIR" ,self.PlatformInfo.SourceDir),=0D - ("PLATFORM_DIR" ,mws.join(self.WorkspaceDir, self.PlatformInfo= .SourceDir)),=0D - ("PLATFORM_OUTPUT_DIR" ,self.PlatformInfo.OutputDir),=0D - ("FFS_OUTPUT_DIR" ,self.FfsOutputDir)=0D - ))=0D + ("WORKSPACE", self.WorkspaceDir),=0D + ("MODULE_NAME", self.Name),=0D + ("MODULE_NAME_GUID", self.UniqueBaseName),=0D + ("MODULE_GUID", self.Guid),=0D + ("MODULE_VERSION", self.Version),=0D + ("MODULE_TYPE", self.ModuleType),=0D + ("MODULE_FILE", str(self.MetaFile)),=0D + ("MODULE_FILE_BASE_NAME", self.MetaFile.BaseName),=0D + ("MODULE_RELATIVE_DIR", self.SourceDir),=0D + ("MODULE_DIR", self.SourceDir),=0D + ("BASE_NAME", self.Name),=0D + ("ARCH", self.Arch),=0D + ("TOOLCHAIN", self.ToolChain),=0D + ("TOOLCHAIN_TAG", self.ToolChain),=0D + ("TOOL_CHAIN_TAG", self.ToolChain),=0D + ("TARGET", self.BuildTarget),=0D + ("BUILD_DIR", self.PlatformInfo.BuildDir),=0D + ("BIN_DIR", os.path.join(self.PlatformInfo.BuildDir, self.Arch= )),=0D + ("LIB_DIR", os.path.join(self.PlatformInfo.BuildDir, self.Arch= )),=0D + ("MODULE_BUILD_DIR", self.BuildDir),=0D + ("OUTPUT_DIR", self.OutputDir),=0D + ("DEBUG_DIR", self.DebugDir),=0D + ("DEST_DIR_OUTPUT", self.OutputDir),=0D + ("DEST_DIR_DEBUG", self.DebugDir),=0D + ("PLATFORM_NAME", self.PlatformInfo.Name),=0D + ("PLATFORM_GUID", self.PlatformInfo.Guid),=0D + ("PLATFORM_VERSION", self.PlatformInfo.Version),=0D + ("PLATFORM_RELATIVE_DIR", self.PlatformInfo.SourceDir),=0D + ("PLATFORM_DIR", mws.join(self.WorkspaceDir, self.PlatformInfo= .SourceDir)),=0D + ("PLATFORM_OUTPUT_DIR", self.PlatformInfo.OutputDir),=0D + ("FFS_OUTPUT_DIR", self.FfsOutputDir)=0D + ))=0D =0D - ## Return the module build data object=0D + # Return the module build data object=0D @cached_property=0D def Module(self):=0D return self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarg= et, self.ToolChain]=0D =0D - ## Return the module name=0D + # Return the module name=0D @cached_property=0D def Name(self):=0D return self.Module.BaseName=0D =0D - ## Return the module DxsFile if exist=0D + # Return the module DxsFile if exist=0D @cached_property=0D def DxsFile(self):=0D return self.Module.DxsFile=0D =0D - ## Return the module meta-file GUID=0D + # Return the module meta-file GUID=0D @cached_property=0D def Guid(self):=0D #=0D @@ -367,84 +384,85 @@ class ModuleAutoGen(AutoGen): return os.path.basename(self.MetaFile.Path)[:36]=0D return self.Module.Guid=0D =0D - ## Return the module version=0D + # Return the module version=0D @cached_property=0D def Version(self):=0D return self.Module.Version=0D =0D - ## Return the module type=0D + # Return the module type=0D @cached_property=0D def ModuleType(self):=0D return self.Module.ModuleType=0D =0D - ## Return the component type (for Edk.x style of module)=0D + # Return the component type (for Edk.x style of module)=0D @cached_property=0D def ComponentType(self):=0D return self.Module.ComponentType=0D =0D - ## Return the build type=0D + # Return the build type=0D @cached_property=0D def BuildType(self):=0D return self.Module.BuildType=0D =0D - ## Return the PCD_IS_DRIVER setting=0D + # Return the PCD_IS_DRIVER setting=0D @cached_property=0D def PcdIsDriver(self):=0D return self.Module.PcdIsDriver=0D =0D - ## Return the autogen version, i.e. module meta-file version=0D + # Return the autogen version, i.e. module meta-file version=0D @cached_property=0D def AutoGenVersion(self):=0D return self.Module.AutoGenVersion=0D =0D - ## Check if the module is library or not=0D + # Check if the module is library or not=0D @cached_property=0D def IsLibrary(self):=0D return bool(self.Module.LibraryClass)=0D =0D - ## Check if the module is binary module or not=0D + # Check if the module is binary module or not=0D @cached_property=0D def IsBinaryModule(self):=0D return self.Module.IsBinaryModule=0D =0D - ## Return the directory to store intermediate files of the module=0D + # Return the directory to store intermediate files of the module=0D @cached_property=0D def BuildDir(self):=0D return _MakeDir((=0D - self.PlatformInfo.BuildDir,=0D - self.Arch,=0D - self.SourceDir,=0D - self.MetaFile.BaseName=0D - ))=0D + self.PlatformInfo.BuildDir,=0D + self.Arch,=0D + self.SourceDir,=0D + self.MetaFile.BaseName=0D + ))=0D =0D - ## Return the directory to store the intermediate object files of the = module=0D + # Return the directory to store the intermediate object files of the m= odule=0D @cached_property=0D def OutputDir(self):=0D return _MakeDir((self.BuildDir, "OUTPUT"))=0D =0D - ## Return the directory path to store ffs file=0D + # Return the directory path to store ffs file=0D @cached_property=0D def FfsOutputDir(self):=0D if GlobalData.gFdfParser:=0D return path.join(self.PlatformInfo.BuildDir, TAB_FV_DIRECTORY,= "Ffs", self.Guid + self.Name)=0D return ''=0D =0D - ## Return the directory to store auto-gened source files of the module= =0D + # Return the directory to store auto-gened source files of the module= =0D @cached_property=0D def DebugDir(self):=0D return _MakeDir((self.BuildDir, "DEBUG"))=0D =0D - ## Return the path of custom file=0D + # Return the path of custom file=0D @cached_property=0D def CustomMakefile(self):=0D RetVal =3D {}=0D for Type in self.Module.CustomMakefile:=0D MakeType =3D gMakeTypeMap[Type] if Type in gMakeTypeMap else '= nmake'=0D - File =3D os.path.join(self.SourceDir, self.Module.CustomMakefi= le[Type])=0D + File =3D os.path.join(=0D + self.SourceDir, self.Module.CustomMakefile[Type])=0D RetVal[MakeType] =3D File=0D return RetVal=0D =0D - ## Return the directory of the makefile=0D + # Return the directory of the makefile=0D #=0D # @retval string The directory string of module's makefile=0D #=0D @@ -452,7 +470,7 @@ class ModuleAutoGen(AutoGen): def MakeFileDir(self):=0D return self.BuildDir=0D =0D - ## Return build command string=0D + # Return build command string=0D #=0D # @retval string Build command string=0D #=0D @@ -460,7 +478,7 @@ class ModuleAutoGen(AutoGen): def BuildCommand(self):=0D return self.PlatformInfo.BuildCommand=0D =0D - ## Get Module package and Platform package=0D + # Get Module package and Platform package=0D #=0D # @retval list The list of package object=0D #=0D @@ -469,14 +487,15 @@ class ModuleAutoGen(AutoGen): PkagList =3D []=0D if self.Module.Packages:=0D PkagList.extend(self.Module.Packages)=0D - Platform =3D self.BuildDatabase[self.PlatformInfo.MetaFile, self.A= rch, self.BuildTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.PlatformInfo.MetaFile,=0D + self.Arch, self.BuildTarget, self.To= olChain]=0D for Package in Platform.Packages:=0D if Package in PkagList:=0D continue=0D PkagList.append(Package)=0D return PkagList=0D =0D - ## Get object list of all packages the module and its dependent librar= ies belong to and the Platform depends on=0D + # Get object list of all packages the module and its dependent librari= es belong to and the Platform depends on=0D #=0D # @retval list The list of package object=0D #=0D @@ -491,13 +510,13 @@ class ModuleAutoGen(AutoGen): PackageList.append(Package)=0D return PackageList=0D =0D - ## Get the depex string=0D + # Get the depex string=0D #=0D # @return : a string contain all depex expression.=0D def _GetDepexExpresionString(self):=0D DepexStr =3D ''=0D DepexList =3D []=0D - ## DPX_SOURCE IN Define section.=0D + # DPX_SOURCE IN Define section.=0D if self.Module.DxsFile:=0D return DepexStr=0D for M in [self.Module] + self.DependentLibraryList:=0D @@ -507,7 +526,8 @@ class ModuleAutoGen(AutoGen): for DepexExpression in DepexExpressionList:=0D for key in DepexExpression:=0D Arch, ModuleType =3D key=0D - DepexExpr =3D [x for x in DepexExpression[key] if not = str(x).startswith('#')]=0D + DepexExpr =3D [x for x in DepexExpression[key]=0D + if not str(x).startswith('#')]=0D # the type of build module is USER_DEFINED.=0D # All different DEPEX section tags would be copied int= o the As Built INF file=0D # and there would be separate DEPEX section tags=0D @@ -516,22 +536,22 @@ class ModuleAutoGen(AutoGen): DepexList.append({(Arch, ModuleType): DepexExp= r})=0D else:=0D if Arch.upper() =3D=3D TAB_ARCH_COMMON or \=0D - (Arch.upper() =3D=3D self.Arch.upper() and \=0D - ModuleType.upper() in [TAB_ARCH_COMMON, self.Mod= uleType.upper()]):=0D + (Arch.upper() =3D=3D self.Arch.upper() and=0D + ModuleType.upper() in [TAB_ARCH_COMMON, self.Mo= duleType.upper()]):=0D DepexList.append({(Arch, ModuleType): DepexExp= r})=0D =0D - #the type of build module is USER_DEFINED.=0D + # the type of build module is USER_DEFINED.=0D if self.ModuleType.upper() =3D=3D SUP_MODULE_USER_DEFINED or self.= ModuleType.upper() =3D=3D SUP_MODULE_HOST_APPLICATION:=0D for Depex in DepexList:=0D for key in Depex:=0D DepexStr +=3D '[Depex.%s.%s]\n' % key=0D - DepexStr +=3D '\n'.join('# '+ val for val in Depex[key= ])=0D + DepexStr +=3D '\n'.join('# ' + val for val in Depex[ke= y])=0D DepexStr +=3D '\n\n'=0D if not DepexStr:=0D return '[Depex.%s]\n' % self.Arch=0D return DepexStr=0D =0D - #the type of build module not is USER_DEFINED.=0D + # the type of build module not is USER_DEFINED.=0D Count =3D 0=0D for Depex in DepexList:=0D Count +=3D 1=0D @@ -551,7 +571,7 @@ class ModuleAutoGen(AutoGen): return '[Depex.%s]\n' % self.Arch=0D return '[Depex.%s]\n# ' % self.Arch + DepexStr=0D =0D - ## Merge dependency expression=0D + # Merge dependency expression=0D #=0D # @retval list The token list of the dependency expression af= ter parsed=0D #=0D @@ -573,7 +593,7 @@ class ModuleAutoGen(AutoGen): if DepexList !=3D []:=0D DepexList.append('AND')=0D DepexList.append('(')=0D - #replace D with value if D is FixedAtBuild PCD=0D + # replace D with value if D is FixedAtBuild PCD=0D NewList =3D []=0D for item in D:=0D if '.' not in item:=0D @@ -586,7 +606,8 @@ class ModuleAutoGen(AutoGen): "{} used in [Depex] sectio= n should be used as FixedAtBuild type and VOID* datum type and 16 bytes in = the module.".format(item))=0D NewList.append(Value)=0D except:=0D - EdkLogger.error("build", FORMAT_INVALID, "{} u= sed in [Depex] section should be used as FixedAtBuild type and VOID* datum = type in the module.".format(item))=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, "{} used in [Depe= x] section should be used as FixedAtBuild type and VOID* datum type in the = module.".format(item))=0D =0D DepexList.extend(NewList)=0D if DepexList[-1] =3D=3D 'END': # no need of a END at this= time=0D @@ -594,14 +615,15 @@ class ModuleAutoGen(AutoGen): DepexList.append(')')=0D Inherited =3D True=0D if Inherited:=0D - EdkLogger.verbose("DEPEX[%s] (+%s) =3D %s" % (self.Name, M= .Module.BaseName, DepexList))=0D + EdkLogger.verbose("DEPEX[%s] (+%s) =3D %s" %=0D + (self.Name, M.Module.BaseName, DepexList= ))=0D if 'BEFORE' in DepexList or 'AFTER' in DepexList:=0D break=0D if len(DepexList) > 0:=0D EdkLogger.verbose('')=0D - return {self.ModuleType:DepexList}=0D + return {self.ModuleType: DepexList}=0D =0D - ## Merge dependency expression=0D + # Merge dependency expression=0D #=0D # @retval list The token list of the dependency expression af= ter parsed=0D #=0D @@ -621,17 +643,19 @@ class ModuleAutoGen(AutoGen): DepexExpressionString +=3D ' AND '=0D DepexExpressionString +=3D '('=0D DepexExpressionString +=3D D=0D - DepexExpressionString =3D DepexExpressionString.rstrip('EN= D').strip()=0D + DepexExpressionString =3D DepexExpressionString.rstrip(=0D + 'END').strip()=0D DepexExpressionString +=3D ')'=0D Inherited =3D True=0D if Inherited:=0D - EdkLogger.verbose("DEPEX[%s] (+%s) =3D %s" % (self.Name, M= .BaseName, DepexExpressionString))=0D + EdkLogger.verbose(=0D + "DEPEX[%s] (+%s) =3D %s" % (self.Name, M.BaseName, Dep= exExpressionString))=0D if 'BEFORE' in DepexExpressionString or 'AFTER' in DepexExpres= sionString:=0D break=0D if len(DepexExpressionString) > 0:=0D EdkLogger.verbose('')=0D =0D - return {self.ModuleType:DepexExpressionString}=0D + return {self.ModuleType: DepexExpressionString}=0D =0D # Get the tiano core user extension, it is contain dependent library.= =0D # @retval: a list contain tiano core userextension.=0D @@ -650,14 +674,15 @@ class ModuleAutoGen(AutoGen): Arch =3D ItemList[3]=0D if Arch.upper() =3D=3D TAB_ARCH_COMMON or Arch.upper()= =3D=3D self.Arch.upper():=0D TianoCoreList =3D []=0D - TianoCoreList.extend([TAB_SECTION_START + Section = + TAB_SECTION_END])=0D + TianoCoreList.extend(=0D + [TAB_SECTION_START + Section + TAB_SECTION_END= ])=0D TianoCoreList.extend(TianoCoreUserExtent[Section][= :])=0D TianoCoreList.append('\n')=0D TianoCoreUserExtentionList.append(TianoCoreList)=0D =0D return TianoCoreUserExtentionList=0D =0D - ## Return the list of specification version required for the module=0D + # Return the list of specification version required for the module=0D #=0D # @retval list The list of specification defined in module fi= le=0D #=0D @@ -665,19 +690,21 @@ class ModuleAutoGen(AutoGen): def Specification(self):=0D return self.Module.Specification=0D =0D - ## Tool option for the module build=0D + # Tool option for the module build=0D #=0D # @param PlatformInfo The object of PlatformBuildInfo=0D # @retval dict The dict containing valid options=0D #=0D @cached_property=0D def BuildOption(self):=0D - RetVal, self.BuildRuleOrder =3D self.PlatformInfo.ApplyBuildOption= (self.Module)=0D + RetVal, self.BuildRuleOrder =3D self.PlatformInfo.ApplyBuildOption= (=0D + self.Module)=0D if self.BuildRuleOrder:=0D - self.BuildRuleOrder =3D ['.%s' % Ext for Ext in self.BuildRule= Order.split()]=0D + self.BuildRuleOrder =3D ['.%s' %=0D + Ext for Ext in self.BuildRuleOrder.spli= t()]=0D return RetVal=0D =0D - ## Get include path list from tool option for the module build=0D + # Get include path list from tool option for the module build=0D #=0D # @retval list The include path list=0D #=0D @@ -704,7 +731,8 @@ class ModuleAutoGen(AutoGen): except KeyError:=0D FlagOption =3D ''=0D =0D - IncPathList =3D [NormPath(Path, self.Macros) for Path in Build= OptIncludeRegEx.findall(FlagOption)]=0D + IncPathList =3D [NormPath(Path, self.Macros)=0D + for Path in BuildOptIncludeRegEx.findall(FlagOp= tion)]=0D =0D #=0D # EDK II modules must not reference header files outside of th= e packages they depend on or=0D @@ -713,7 +741,8 @@ class ModuleAutoGen(AutoGen): if GlobalData.gDisableIncludePathCheck =3D=3D False:=0D for Path in IncPathList:=0D if (Path not in self.IncludePathList) and (CommonPath(= [Path, self.MetaFile.Dir]) !=3D self.MetaFile.Dir):=0D - ErrMsg =3D "The include directory for the EDK II m= odule in this line is invalid %s specified in %s FLAGS '%s'" % (Path, Tool,= FlagOption)=0D + ErrMsg =3D "The include directory for the EDK II m= odule in this line is invalid %s specified in %s FLAGS '%s'" % (=0D + Path, Tool, FlagOption)=0D EdkLogger.error("build",=0D PARAMETER_INVALID,=0D ExtraData=3DErrMsg,=0D @@ -721,7 +750,7 @@ class ModuleAutoGen(AutoGen): RetVal +=3D IncPathList=0D return RetVal=0D =0D - ## Return a list of files which can be built from source=0D + # Return a list of files which can be built from source=0D #=0D # What kind of files can be built is determined by build rules in=0D # $(CONF_DIRECTORY)/build_rule.txt and toolchain family.=0D @@ -730,7 +759,8 @@ class ModuleAutoGen(AutoGen): def SourceFileList(self):=0D RetVal =3D []=0D ToolChainTagSet =3D {"", TAB_STAR, self.ToolChain}=0D - ToolChainFamilySet =3D {"", TAB_STAR, self.ToolChainFamily, self.B= uildRuleFamily}=0D + ToolChainFamilySet =3D {"", TAB_STAR,=0D + self.ToolChainFamily, self.BuildRuleFamily}= =0D for F in self.Module.Sources:=0D # match tool chain=0D if F.TagName not in ToolChainTagSet:=0D @@ -740,10 +770,10 @@ class ModuleAutoGen(AutoGen): # match tool chain family or build rule family=0D if F.ToolChainFamily not in ToolChainFamilySet:=0D EdkLogger.debug(=0D - EdkLogger.DEBUG_0,=0D - "The file [%s] must be built by tools of [%s],= " \=0D - "but current toolchain family is [%s], buildru= le family is [%s]" \=0D - % (str(F), F.ToolChainFamily, self.ToolCha= inFamily, self.BuildRuleFamily))=0D + EdkLogger.DEBUG_0,=0D + "The file [%s] must be built by tools of [%s], "=0D + "but current toolchain family is [%s], buildrule famil= y is [%s]"=0D + % (str(F), F.ToolChainFamily, self.ToolChainFamily, se= lf.BuildRuleFamily))=0D continue=0D =0D # add the file path into search path list for file including=0D @@ -762,7 +792,7 @@ class ModuleAutoGen(AutoGen): self.BuildOption=0D for SingleFile in FileList:=0D if self.BuildRuleOrder and SingleFile.Ext in self.BuildRuleOrd= er and SingleFile.Ext in self.BuildRules:=0D - key =3D SingleFile.Path.rsplit(SingleFile.Ext,1)[0]=0D + key =3D SingleFile.Path.rsplit(SingleFile.Ext, 1)[0]=0D if key in Order_Dict:=0D Order_Dict[key].append(SingleFile.Ext)=0D else:=0D @@ -780,22 +810,22 @@ class ModuleAutoGen(AutoGen): =0D return FileList=0D =0D - ## Return the list of unicode files=0D + # Return the list of unicode files=0D @cached_property=0D def UnicodeFileList(self):=0D - return self.FileTypes.get(TAB_UNICODE_FILE,[])=0D + return self.FileTypes.get(TAB_UNICODE_FILE, [])=0D =0D - ## Return the list of vfr files=0D + # Return the list of vfr files=0D @cached_property=0D def VfrFileList(self):=0D return self.FileTypes.get(TAB_VFR_FILE, [])=0D =0D - ## Return the list of Image Definition files=0D + # Return the list of Image Definition files=0D @cached_property=0D def IdfFileList(self):=0D - return self.FileTypes.get(TAB_IMAGE_FILE,[])=0D + return self.FileTypes.get(TAB_IMAGE_FILE, [])=0D =0D - ## Return a list of files which can be built from binary=0D + # Return a list of files which can be built from binary=0D #=0D # "Build" binary files are just to copy them to build directory.=0D #=0D @@ -816,19 +846,23 @@ class ModuleAutoGen(AutoGen): RetVal =3D {}=0D BuildRuleDatabase =3D self.PlatformInfo.BuildRule=0D for Type in BuildRuleDatabase.FileTypeList:=0D - #first try getting build rule by BuildRuleFamily=0D - RuleObject =3D BuildRuleDatabase[Type, self.BuildType, self.Ar= ch, self.BuildRuleFamily]=0D + # first try getting build rule by BuildRuleFamily=0D + RuleObject =3D BuildRuleDatabase[Type,=0D + self.BuildType, self.Arch, self= .BuildRuleFamily]=0D if not RuleObject:=0D # build type is always module type, but ...=0D if self.ModuleType !=3D self.BuildType:=0D - RuleObject =3D BuildRuleDatabase[Type, self.ModuleType= , self.Arch, self.BuildRuleFamily]=0D - #second try getting build rule by ToolChainFamily=0D + RuleObject =3D BuildRuleDatabase[Type,=0D + self.ModuleType, self.A= rch, self.BuildRuleFamily]=0D + # second try getting build rule by ToolChainFamily=0D if not RuleObject:=0D - RuleObject =3D BuildRuleDatabase[Type, self.BuildType, sel= f.Arch, self.ToolChainFamily]=0D + RuleObject =3D BuildRuleDatabase[Type,=0D + self.BuildType, self.Arch, = self.ToolChainFamily]=0D if not RuleObject:=0D # build type is always module type, but ...=0D if self.ModuleType !=3D self.BuildType:=0D - RuleObject =3D BuildRuleDatabase[Type, self.Module= Type, self.Arch, self.ToolChainFamily]=0D + RuleObject =3D BuildRuleDatabase[Type,=0D + self.ModuleType, se= lf.Arch, self.ToolChainFamily]=0D if not RuleObject:=0D continue=0D RuleObject =3D RuleObject.Instantiate(self.Macros)=0D @@ -906,7 +940,8 @@ class ModuleAutoGen(AutoGen): =0D # to avoid cyclic rule=0D if FileType in RuleChain:=0D - EdkLogger.error("build", ERROR_STATEMENT, "Cyclic dependen= cy detected while generating rule for %s" % str(Source))=0D + EdkLogger.error(=0D + "build", ERROR_STATEMENT, "Cyclic dependency detected = while generating rule for %s" % str(Source))=0D =0D RuleChain.add(FileType)=0D SourceList.extend(Target.Outputs)=0D @@ -925,10 +960,10 @@ class ModuleAutoGen(AutoGen): self._BuildTargets =3D defaultdict(set)=0D self._FileTypes =3D defaultdict(set)=0D =0D - #TRICK: call SourceFileList property to apply build rule for sourc= e files=0D + # TRICK: call SourceFileList property to apply build rule for sour= ce files=0D self.SourceFileList=0D =0D - #TRICK: call _GetBinaryFileList to apply build rule for binary fil= es=0D + # TRICK: call _GetBinaryFileList to apply build rule for binary fi= les=0D self.BinaryFileList=0D =0D return self._BuildTargets=0D @@ -948,7 +983,7 @@ class ModuleAutoGen(AutoGen): self.Targets=0D return self._FileTypes=0D =0D - ## Get the list of package object the module depends on and the Platfo= rm depends on=0D + # Get the list of package object the module depends on and the Platfor= m depends on=0D #=0D # @retval list The package object list=0D #=0D @@ -956,7 +991,7 @@ class ModuleAutoGen(AutoGen): def DependentPackageList(self):=0D return self.PackageList=0D =0D - ## Return the list of auto-generated code file=0D + # Return the list of auto-generated code file=0D #=0D # @retval list The list of auto-generated file=0D #=0D @@ -970,7 +1005,8 @@ class ModuleAutoGen(AutoGen): AutoGenH =3D TemplateString()=0D StringH =3D TemplateString()=0D StringIdf =3D TemplateString()=0D - GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf, = UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfGenBinBuffer)=0D + GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, AutoGenUniIdf,= =0D + UniStringBinBuffer, StringIdf, AutoGenUniIdf, IdfG= enBinBuffer)=0D #=0D # AutoGen.c is generated if there are library classes in inf, or t= here are object files=0D #=0D @@ -984,22 +1020,26 @@ class ModuleAutoGen(AutoGen): RetVal[AutoFile] =3D str(AutoGenH)=0D self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)=0D if str(StringH) !=3D "":=0D - AutoFile =3D PathClass(gAutoGenStringFileName % {"module_name"= :self.Name}, self.DebugDir)=0D + AutoFile =3D PathClass(gAutoGenStringFileName %=0D + {"module_name": self.Name}, self.DebugDir= )=0D RetVal[AutoFile] =3D str(StringH)=0D self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)=0D if UniStringBinBuffer is not None and UniStringBinBuffer.getvalue(= ) !=3D b"":=0D - AutoFile =3D PathClass(gAutoGenStringFormFileName % {"module_n= ame":self.Name}, self.OutputDir)=0D + AutoFile =3D PathClass(gAutoGenStringFormFileName %=0D + {"module_name": self.Name}, self.OutputDi= r)=0D RetVal[AutoFile] =3D UniStringBinBuffer.getvalue()=0D AutoFile.IsBinary =3D True=0D self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)=0D if UniStringBinBuffer is not None:=0D UniStringBinBuffer.close()=0D if str(StringIdf) !=3D "":=0D - AutoFile =3D PathClass(gAutoGenImageDefFileName % {"module_nam= e":self.Name}, self.DebugDir)=0D + AutoFile =3D PathClass(gAutoGenImageDefFileName %=0D + {"module_name": self.Name}, self.DebugDir= )=0D RetVal[AutoFile] =3D str(StringIdf)=0D self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)=0D if IdfGenBinBuffer is not None and IdfGenBinBuffer.getvalue() !=3D= b"":=0D - AutoFile =3D PathClass(gAutoGenIdfFileName % {"module_name":se= lf.Name}, self.OutputDir)=0D + AutoFile =3D PathClass(gAutoGenIdfFileName %=0D + {"module_name": self.Name}, self.OutputDi= r)=0D RetVal[AutoFile] =3D IdfGenBinBuffer.getvalue()=0D AutoFile.IsBinary =3D True=0D self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE)=0D @@ -1007,7 +1047,7 @@ class ModuleAutoGen(AutoGen): IdfGenBinBuffer.close()=0D return RetVal=0D =0D - ## Return the list of library modules explicitly or implicitly used by= this module=0D + # Return the list of library modules explicitly or implicitly used by = this module=0D @cached_property=0D def DependentLibraryList(self):=0D # only merge library classes and PCD for non-library module=0D @@ -1015,7 +1055,7 @@ class ModuleAutoGen(AutoGen): return []=0D return self.PlatformInfo.ApplyLibraryInstance(self.Module)=0D =0D - ## Get the list of PCDs from current module=0D + # Get the list of PCDs from current module=0D #=0D # @retval list The list of PCD=0D #=0D @@ -1025,6 +1065,7 @@ class ModuleAutoGen(AutoGen): RetVal =3D self.PlatformInfo.ApplyPcdSetting(self, self.Module.Pcd= s)=0D =0D return RetVal=0D +=0D @cached_property=0D def _PcdComments(self):=0D ReVal =3D OrderedListDict()=0D @@ -1034,7 +1075,7 @@ class ModuleAutoGen(AutoGen): ExtendCopyDictionaryLists(ReVal, Library.PcdComments)=0D return ReVal=0D =0D - ## Get the list of PCDs from dependent libraries=0D + # Get the list of PCDs from dependent libraries=0D #=0D # @retval list The list of PCD=0D #=0D @@ -1053,10 +1094,11 @@ class ModuleAutoGen(AutoGen): continue=0D Pcds.add(Key)=0D PcdsInLibrary[Key] =3D copy.copy(Library.Pcds[Key])=0D - RetVal.extend(self.PlatformInfo.ApplyPcdSetting(self, PcdsInLi= brary, Library=3DLibrary))=0D + RetVal.extend(self.PlatformInfo.ApplyPcdSetting(=0D + self, PcdsInLibrary, Library=3DLibrary))=0D return RetVal=0D =0D - ## Get the GUID value mapping=0D + # Get the GUID value mapping=0D #=0D # @retval dict The mapping between GUID cname and its value=0D #=0D @@ -1075,20 +1117,23 @@ class ModuleAutoGen(AutoGen): for Library in self.DependentLibraryList:=0D RetVal.update(Library.GetGuidsUsedByPcd())=0D return RetVal=0D - ## Get the protocol value mapping=0D + # Get the protocol value mapping=0D #=0D # @retval dict The mapping between protocol cname and its val= ue=0D #=0D +=0D @cached_property=0D def ProtocolList(self):=0D RetVal =3D OrderedDict(self.Module.Protocols)=0D for Library in self.DependentLibraryList:=0D RetVal.update(Library.Protocols)=0D - ExtendCopyDictionaryLists(self._ProtocolComments, Library.Prot= ocolComments)=0D - ExtendCopyDictionaryLists(self._ProtocolComments, self.Module.Prot= ocolComments)=0D + ExtendCopyDictionaryLists(=0D + self._ProtocolComments, Library.ProtocolComments)=0D + ExtendCopyDictionaryLists(=0D + self._ProtocolComments, self.Module.ProtocolComments)=0D return RetVal=0D =0D - ## Get the PPI value mapping=0D + # Get the PPI value mapping=0D #=0D # @retval dict The mapping between PPI cname and its value=0D #=0D @@ -1101,7 +1146,7 @@ class ModuleAutoGen(AutoGen): ExtendCopyDictionaryLists(self._PpiComments, self.Module.PpiCommen= ts)=0D return RetVal=0D =0D - ## Get the list of include search path=0D + # Get the list of include search path=0D #=0D # @retval list The list path=0D #=0D @@ -1118,7 +1163,8 @@ class ModuleAutoGen(AutoGen): IncludesList =3D Package.Includes=0D if Package._PrivateIncludes:=0D if not self.MetaFile.OriginalPath.Path.startswith(PackageD= ir):=0D - IncludesList =3D list(set(Package.Includes).difference= (set(Package._PrivateIncludes)))=0D + IncludesList =3D list(set(Package.Includes).difference= (=0D + set(Package._PrivateIncludes)))=0D for Inc in IncludesList:=0D if Inc not in RetVal:=0D RetVal.append(str(Inc))=0D @@ -1134,8 +1180,8 @@ class ModuleAutoGen(AutoGen): whitespace =3D False=0D for flag in flags.split(" "):=0D flag =3D flag.strip()=0D - if flag.startswith(("/I","-I")):=0D - if len(flag)>2:=0D + if flag.startswith(("/I", "-I")):=0D + if len(flag) > 2:=0D if os.path.exists(flag[2:]):=0D IncPathList.append(flag[2:])=0D else:=0D @@ -1151,7 +1197,7 @@ class ModuleAutoGen(AutoGen): def IncludePathLength(self):=0D return sum(len(inc)+1 for inc in self.IncludePathList)=0D =0D - ## Get the list of include paths from the packages=0D + # Get the list of include paths from the packages=0D #=0D # @IncludesList list The list path=0D #=0D @@ -1163,10 +1209,11 @@ class ModuleAutoGen(AutoGen): IncludesList =3D Package.Includes=0D if Package._PrivateIncludes:=0D if not self.MetaFile.Path.startswith(PackageDir):=0D - IncludesList =3D list(set(Package.Includes).difference= (set(Package._PrivateIncludes)))=0D + IncludesList =3D list(set(Package.Includes).difference= (=0D + set(Package._PrivateIncludes)))=0D return IncludesList=0D =0D - ## Get HII EX PCDs which maybe used by VFR=0D + # Get HII EX PCDs which maybe used by VFR=0D #=0D # efivarstore used by VFR may relate with HII EX PCDs=0D # Get the variable name and GUID from efivarstore and HII EX PCD=0D @@ -1209,8 +1256,10 @@ class ModuleAutoGen(AutoGen): Guid =3D gEfiVarStoreGuidPattern.search(Content, Pos)=0D if not Guid:=0D break=0D - NameArray =3D _ConvertStringToByteArray('L"' + Name.group(= 1) + '"')=0D - NameGuids.add((NameArray, GuidStructureStringToGuidString(= Guid.group(1))))=0D + NameArray =3D _ConvertStringToByteArray(=0D + 'L"' + Name.group(1) + '"')=0D + NameGuids.add(=0D + (NameArray, GuidStructureStringToGuidString(Guid.group= (1))))=0D Pos =3D Content.find('efivarstore', Name.end())=0D if not NameGuids:=0D return []=0D @@ -1219,7 +1268,8 @@ class ModuleAutoGen(AutoGen): if Pcd.Type !=3D TAB_PCDS_DYNAMIC_EX_HII:=0D continue=0D for SkuInfo in Pcd.SkuInfoList.values():=0D - Value =3D GuidValue(SkuInfo.VariableGuid, self.PlatformInf= o.PackageList, self.MetaFile.Path)=0D + Value =3D GuidValue(=0D + SkuInfo.VariableGuid, self.PlatformInfo.PackageList, s= elf.MetaFile.Path)=0D if not Value:=0D continue=0D Name =3D _ConvertStringToByteArray(SkuInfo.VariableName)=0D @@ -1233,12 +1283,13 @@ class ModuleAutoGen(AutoGen): def _GenOffsetBin(self):=0D VfrUniBaseName =3D {}=0D for SourceFile in self.Module.Sources:=0D - if SourceFile.Type.upper() =3D=3D ".VFR" :=0D + if SourceFile.Type.upper() =3D=3D ".VFR":=0D #=0D # search the .map file to find the offset of vfr binary in= the PE32+/TE file.=0D #=0D - VfrUniBaseName[SourceFile.BaseName] =3D (SourceFile.BaseNa= me + "Bin")=0D - elif SourceFile.Type.upper() =3D=3D ".UNI" :=0D + VfrUniBaseName[SourceFile.BaseName] =3D (=0D + SourceFile.BaseName + "Bin")=0D + elif SourceFile.Type.upper() =3D=3D ".UNI":=0D #=0D # search the .map file to find the offset of Uni strings b= inary in the PE32+/TE file.=0D #=0D @@ -1248,17 +1299,19 @@ class ModuleAutoGen(AutoGen): return None=0D MapFileName =3D os.path.join(self.OutputDir, self.Name + ".map")=0D EfiFileName =3D os.path.join(self.OutputDir, self.Name + ".efi")=0D - VfrUniOffsetList =3D GetVariableOffset(MapFileName, EfiFileName, l= ist(VfrUniBaseName.values()))=0D + VfrUniOffsetList =3D GetVariableOffset(=0D + MapFileName, EfiFileName, list(VfrUniBaseName.values()))=0D if not VfrUniOffsetList:=0D return None=0D =0D OutputName =3D '%sOffset.bin' % self.Name=0D - UniVfrOffsetFileName =3D os.path.join( self.OutputDir, OutputN= ame)=0D + UniVfrOffsetFileName =3D os.path.join(self.OutputDir, OutputName)= =0D =0D try:=0D fInputfile =3D open(UniVfrOffsetFileName, "wb+", 0)=0D except:=0D - EdkLogger.error("build", FILE_OPEN_FAILURE, "File open failed = for %s" % UniVfrOffsetFileName, None)=0D + EdkLogger.error("build", FILE_OPEN_FAILURE,=0D + "File open failed for %s" % UniVfrOffsetFileNa= me, None)=0D =0D # Use a instance of BytesIO to cache data=0D fStringIO =3D BytesIO()=0D @@ -1272,8 +1325,8 @@ class ModuleAutoGen(AutoGen): #=0D UniGuid =3D b'\xe0\xc5\x13\x89\xf63\x86M\x9b\xf1C\xef\x89\= xfc\x06f'=0D fStringIO.write(UniGuid)=0D - UniValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (UniValue)=0D + UniValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(UniValue)=0D else:=0D #=0D # VFR binary offset in image.=0D @@ -1282,19 +1335,19 @@ class ModuleAutoGen(AutoGen): #=0D VfrGuid =3D b'\xb4|\xbc\xd0Gj_I\xaa\x11q\x07F\xda\x06\xa2'= =0D fStringIO.write(VfrGuid)=0D - VfrValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (VfrValue)=0D + VfrValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(VfrValue)=0D #=0D # write data into file.=0D #=0D - try :=0D - fInputfile.write (fStringIO.getvalue())=0D + try:=0D + fInputfile.write(fStringIO.getvalue())=0D except:=0D EdkLogger.error("build", FILE_WRITE_FAILURE, "Write data to fi= le %s failed, please check whether the "=0D - "file been locked or using by other applicatio= ns." %UniVfrOffsetFileName, None)=0D + "file been locked or using by other applicatio= ns." % UniVfrOffsetFileName, None)=0D =0D - fStringIO.close ()=0D - fInputfile.close ()=0D + fStringIO.close()=0D + fInputfile.close()=0D return OutputName=0D =0D @cached_property=0D @@ -1315,7 +1368,7 @@ class ModuleAutoGen(AutoGen): =0D return retVal=0D =0D - ## Create AsBuilt INF file the module=0D + # Create AsBuilt INF file the module=0D #=0D def CreateAsBuiltInf(self):=0D =0D @@ -1334,7 +1387,7 @@ class ModuleAutoGen(AutoGen): if self.BinaryFileList:=0D return=0D =0D - ### TODO: How to handles mixed source and binary modules=0D + # TODO: How to handles mixed source and binary modules=0D =0D # Find all DynamicEx and PatchableInModule PCDs used by this modul= e and dependent libraries=0D # Also find all packages that the DynamicEx PCDs depend on=0D @@ -1346,12 +1399,15 @@ class ModuleAutoGen(AutoGen): for Pcd in self.ModulePcdList + self.LibraryPcdList:=0D if Pcd.Type =3D=3D TAB_PCDS_PATCHABLE_IN_MODULE:=0D PatchablePcds.append(Pcd)=0D - PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGuidCNa= me, TAB_PCDS_PATCHABLE_IN_MODULE))=0D + PcdCheckList.append(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS_PAT= CHABLE_IN_MODULE))=0D elif Pcd.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D if Pcd not in Pcds:=0D Pcds.append(Pcd)=0D - PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGui= dCName, TAB_PCDS_DYNAMIC_EX))=0D - PcdCheckList.append((Pcd.TokenCName, Pcd.TokenSpaceGui= dCName, TAB_PCDS_DYNAMIC))=0D + PcdCheckList.append(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS= _DYNAMIC_EX))=0D + PcdCheckList.append(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, TAB_PCDS= _DYNAMIC))=0D PcdTokenSpaceList.append(Pcd.TokenSpaceGuidCName)=0D GuidList =3D OrderedDict(self.GuidList)=0D for TokenSpace in self.GetGuidsUsedByPcd:=0D @@ -1363,7 +1419,8 @@ class ModuleAutoGen(AutoGen): for Package in self.DerivedPackageList:=0D if Package in Packages:=0D continue=0D - BeChecked =3D (Package.Guids, Package.Ppis, Package.Protocols,= Package.Pcds)=0D + BeChecked =3D (Package.Guids, Package.Ppis,=0D + Package.Protocols, Package.Pcds)=0D Found =3D False=0D for Index in range(len(BeChecked)):=0D for Item in CheckList[Index]:=0D @@ -1380,7 +1437,7 @@ class ModuleAutoGen(AutoGen): continue=0D for VfrPcd in VfrPcds:=0D if ((VfrPcd.TokenCName, VfrPcd.TokenSpaceGuidCName, TAB_PC= DS_DYNAMIC_EX) in Pkg.Pcds or=0D - (VfrPcd.TokenCName, VfrPcd.TokenSpaceGuidCName, TAB_PC= DS_DYNAMIC) in Pkg.Pcds):=0D + (VfrPcd.TokenCName, VfrPcd.TokenSpaceGuidCName, TA= B_PCDS_DYNAMIC) in Pkg.Pcds):=0D Packages.append(Pkg)=0D break=0D =0D @@ -1390,36 +1447,36 @@ class ModuleAutoGen(AutoGen): MDefs =3D self.Module.Defines=0D =0D AsBuiltInfDict =3D {=0D - 'module_name' : self.Name,=0D - 'module_guid' : Guid,=0D - 'module_module_type' : ModuleType,=0D - 'module_version_string' : [MDefs['VERSION_STRING']] = if 'VERSION_STRING' in MDefs else [],=0D - 'pcd_is_driver_string' : [],=0D - 'module_uefi_specification_version' : [],=0D - 'module_pi_specification_version' : [],=0D - 'module_entry_point' : self.Module.ModuleEntryPoi= ntList,=0D - 'module_unload_image' : self.Module.ModuleUnloadIm= ageList,=0D - 'module_constructor' : self.Module.ConstructorLis= t,=0D - 'module_destructor' : self.Module.DestructorList= ,=0D - 'module_shadow' : [MDefs['SHADOW']] if 'SHAD= OW' in MDefs else [],=0D - 'module_pci_vendor_id' : [MDefs['PCI_VENDOR_ID']] i= f 'PCI_VENDOR_ID' in MDefs else [],=0D - 'module_pci_device_id' : [MDefs['PCI_DEVICE_ID']] i= f 'PCI_DEVICE_ID' in MDefs else [],=0D - 'module_pci_class_code' : [MDefs['PCI_CLASS_CODE']] = if 'PCI_CLASS_CODE' in MDefs else [],=0D - 'module_pci_revision' : [MDefs['PCI_REVISION']] if= 'PCI_REVISION' in MDefs else [],=0D - 'module_build_number' : [MDefs['BUILD_NUMBER']] if= 'BUILD_NUMBER' in MDefs else [],=0D - 'module_spec' : [MDefs['SPEC']] if 'SPEC' = in MDefs else [],=0D - 'module_uefi_hii_resource_section' : [MDefs['UEFI_HII_RESOURCE_= SECTION']] if 'UEFI_HII_RESOURCE_SECTION' in MDefs else [],=0D - 'module_uni_file' : [MDefs['MODULE_UNI_FILE']]= if 'MODULE_UNI_FILE' in MDefs else [],=0D - 'module_arch' : self.Arch,=0D - 'package_item' : [Package.MetaFile.File.rep= lace('\\', '/') for Package in Packages],=0D - 'binary_item' : [],=0D - 'patchablepcd_item' : [],=0D - 'pcd_item' : [],=0D - 'protocol_item' : [],=0D - 'ppi_item' : [],=0D - 'guid_item' : [],=0D - 'flags_item' : [],=0D - 'libraryclasses_item' : []=0D + 'module_name': self.Name,=0D + 'module_guid': Guid,=0D + 'module_module_type': ModuleType,=0D + 'module_version_string': [MDefs['VERSION_STRING']] if 'VERSION= _STRING' in MDefs else [],=0D + 'pcd_is_driver_string': [],=0D + 'module_uefi_specification_version': [],=0D + 'module_pi_specification_version': [],=0D + 'module_entry_point': self.Module.ModuleEntryPointList,=0D + 'module_unload_image': self.Module.ModuleUnloadImageList,=0D + 'module_constructor': self.Module.ConstructorList,=0D + 'module_destructor': self.Module.DestructorList,=0D + 'module_shadow': [MDefs['SHADOW']] if 'SHADOW' in MDefs else [= ],=0D + 'module_pci_vendor_id': [MDefs['PCI_VENDOR_ID']] if 'PCI_VENDO= R_ID' in MDefs else [],=0D + 'module_pci_device_id': [MDefs['PCI_DEVICE_ID']] if 'PCI_DEVIC= E_ID' in MDefs else [],=0D + 'module_pci_class_code': [MDefs['PCI_CLASS_CODE']] if 'PCI_CLA= SS_CODE' in MDefs else [],=0D + 'module_pci_revision': [MDefs['PCI_REVISION']] if 'PCI_REVISIO= N' in MDefs else [],=0D + 'module_build_number': [MDefs['BUILD_NUMBER']] if 'BUILD_NUMBE= R' in MDefs else [],=0D + 'module_spec': [MDefs['SPEC']] if 'SPEC' in MDefs else [],=0D + 'module_uefi_hii_resource_section': [MDefs['UEFI_HII_RESOURCE_= SECTION']] if 'UEFI_HII_RESOURCE_SECTION' in MDefs else [],=0D + 'module_uni_file': [MDefs['MODULE_UNI_FILE']] if 'MODULE_UNI_F= ILE' in MDefs else [],=0D + 'module_arch': self.Arch,=0D + 'package_item': [Package.MetaFile.File.replace('\\', '/') for = Package in Packages],=0D + 'binary_item': [],=0D + 'patchablepcd_item': [],=0D + 'pcd_item': [],=0D + 'protocol_item': [],=0D + 'ppi_item': [],=0D + 'guid_item': [],=0D + 'flags_item': [],=0D + 'libraryclasses_item': []=0D }=0D =0D if 'MODULE_UNI_FILE' in MDefs:=0D @@ -1436,22 +1493,27 @@ class ModuleAutoGen(AutoGen): AsBuiltInfDict['pcd_is_driver_string'].append(DriverType)=0D =0D if 'UEFI_SPECIFICATION_VERSION' in self.Specification:=0D - AsBuiltInfDict['module_uefi_specification_version'].append(sel= f.Specification['UEFI_SPECIFICATION_VERSION'])=0D + AsBuiltInfDict['module_uefi_specification_version'].append(=0D + self.Specification['UEFI_SPECIFICATION_VERSION'])=0D if 'PI_SPECIFICATION_VERSION' in self.Specification:=0D - AsBuiltInfDict['module_pi_specification_version'].append(self.= Specification['PI_SPECIFICATION_VERSION'])=0D + AsBuiltInfDict['module_pi_specification_version'].append(=0D + self.Specification['PI_SPECIFICATION_VERSION'])=0D =0D OutputDir =3D self.OutputDir.replace('\\', '/').strip('/')=0D DebugDir =3D self.DebugDir.replace('\\', '/').strip('/')=0D for Item in self.CodaTargetList:=0D - File =3D Item.Target.Path.replace('\\', '/').strip('/').replac= e(DebugDir, '').replace(OutputDir, '').strip('/')=0D + File =3D Item.Target.Path.replace(=0D + '\\', '/').strip('/').replace(DebugDir, '').replace(Output= Dir, '').strip('/')=0D if os.path.isabs(File):=0D - File =3D File.replace('\\', '/').strip('/').replace(Output= Dir, '').strip('/')=0D + File =3D File.replace(=0D + '\\', '/').strip('/').replace(OutputDir, '').strip('/'= )=0D if Item.Target.Ext.lower() =3D=3D '.aml':=0D AsBuiltInfDict['binary_item'].append('ASL|' + File)=0D elif Item.Target.Ext.lower() =3D=3D '.acpi':=0D AsBuiltInfDict['binary_item'].append('ACPI|' + File)=0D elif Item.Target.Ext.lower() =3D=3D '.efi':=0D - AsBuiltInfDict['binary_item'].append('PE32|' + self.Name += '.efi')=0D + AsBuiltInfDict['binary_item'].append(=0D + 'PE32|' + self.Name + '.efi')=0D else:=0D AsBuiltInfDict['binary_item'].append('BIN|' + File)=0D if not self.DepexGenerated:=0D @@ -1460,11 +1522,14 @@ class ModuleAutoGen(AutoGen): self.DepexGenerated =3D True=0D if self.DepexGenerated:=0D if self.ModuleType in [SUP_MODULE_PEIM]:=0D - AsBuiltInfDict['binary_item'].append('PEI_DEPEX|' + self.N= ame + '.depex')=0D + AsBuiltInfDict['binary_item'].append(=0D + 'PEI_DEPEX|' + self.Name + '.depex')=0D elif self.ModuleType in [SUP_MODULE_DXE_DRIVER, SUP_MODULE_DXE= _RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER, SUP_MODULE_UEFI_DRIVER]:=0D - AsBuiltInfDict['binary_item'].append('DXE_DEPEX|' + self.N= ame + '.depex')=0D + AsBuiltInfDict['binary_item'].append(=0D + 'DXE_DEPEX|' + self.Name + '.depex')=0D elif self.ModuleType in [SUP_MODULE_DXE_SMM_DRIVER]:=0D - AsBuiltInfDict['binary_item'].append('SMM_DEPEX|' + self.N= ame + '.depex')=0D + AsBuiltInfDict['binary_item'].append(=0D + 'SMM_DEPEX|' + self.Name + '.depex')=0D =0D Bin =3D self._GenOffsetBin()=0D if Bin:=0D @@ -1478,10 +1543,12 @@ class ModuleAutoGen(AutoGen): StartPos =3D 0=0D for Index in range(len(HeaderComments)):=0D if HeaderComments[Index].find('@BinaryHeader') !=3D -1:=0D - HeaderComments[Index] =3D HeaderComments[Index].replace('@= BinaryHeader', '@file')=0D + HeaderComments[Index] =3D HeaderComments[Index].replace(=0D + '@BinaryHeader', '@file')=0D StartPos =3D Index=0D break=0D - AsBuiltInfDict['header_comments'] =3D '\n'.join(HeaderComments[Sta= rtPos:]).replace(':#', '://')=0D + AsBuiltInfDict['header_comments'] =3D '\n'.join(=0D + HeaderComments[StartPos:]).replace(':#', '://')=0D AsBuiltInfDict['tail_comments'] =3D '\n'.join(self.Module.TailComm= ents)=0D =0D GenList =3D [=0D @@ -1491,13 +1558,14 @@ class ModuleAutoGen(AutoGen): ]=0D for Item in GenList:=0D for CName in Item[0]:=0D - Comments =3D '\n '.join(Item[1][CName]) if CName in Item[= 1] else ''=0D + Comments =3D '\n '.join(=0D + Item[1][CName]) if CName in Item[1] else ''=0D Entry =3D Comments + '\n ' + CName if Comments else CName= =0D AsBuiltInfDict[Item[2]].append(Entry)=0D PatchList =3D parsePcdInfoFromMapFile(=0D - os.path.join(self.OutputDir, self.Name + '.map= '),=0D - os.path.join(self.OutputDir, self.Name + '.efi= ')=0D - )=0D + os.path.join(self.OutputDir, self.Name + '.map'),=0D + os.path.join(self.OutputDir, self.Name + '.efi')=0D + )=0D if PatchList:=0D for Pcd in PatchablePcds:=0D TokenCName =3D Pcd.TokenCName=0D @@ -1530,7 +1598,8 @@ class ModuleAutoGen(AutoGen): else:=0D if Pcd.MaxDatumSize is None or Pcd.MaxDatumSize =3D=3D= '':=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "Unknown [MaxDatumSize] of PCD [%s= .%s]" % (Pcd.TokenSpaceGuidCName, TokenCName)=0D + "Unknown [MaxDatumSize] of PCD [%s= .%s]" % (=0D + Pcd.TokenSpaceGuidCName, Token= CName)=0D )=0D ArraySize =3D int(Pcd.MaxDatumSize, 0)=0D PcdValue =3D Pcd.DefaultValue=0D @@ -1545,9 +1614,11 @@ class ModuleAutoGen(AutoGen): if Unicode:=0D CharVal =3D ord(PcdValue[Index])=0D NewValue =3D NewValue + '0x%02x' % (CharVa= l & 0x00FF) + ', ' \=0D - + '0x%02x' % (CharVal >> 8) + ', '= =0D + + '0x%02x' % (CharVal >> 8) + ', '=0D else:=0D - NewValue =3D NewValue + '0x%02x' % (ord(Pc= dValue[Index]) % 0x100) + ', '=0D + NewValue =3D NewValue + \=0D + '0x%02x' % (=0D + ord(PcdValue[Index]) % 0x100) + ',= '=0D Padding =3D '0x00, '=0D if Unicode:=0D Padding =3D Padding * 2=0D @@ -1555,28 +1626,34 @@ class ModuleAutoGen(AutoGen): if ArraySize < (len(PcdValue) + 1):=0D if Pcd.MaxSizeUserSet:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "The maximum size of VOID* typ= e PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuid= CName, TokenCName)=0D - )=0D + "The maximum size of VOID*= type PCD '%s.%s' is less than its actual size occupied." % (=0D + Pcd.TokenSpaceGuidCNam= e, TokenCName)=0D + )=0D else:=0D ArraySize =3D len(PcdValue) + 1=0D if ArraySize > len(PcdValue) + 1:=0D - NewValue =3D NewValue + Padding * (ArraySize -= len(PcdValue) - 1)=0D + NewValue =3D NewValue + Padding * \=0D + (ArraySize - len(PcdValue) - 1)=0D PcdValue =3D NewValue + Padding.strip().rstrip(','= ) + '}'=0D elif len(PcdValue.split(',')) <=3D ArraySize:=0D - PcdValue =3D PcdValue.rstrip('}') + ', 0x00' * (Ar= raySize - len(PcdValue.split(',')))=0D + PcdValue =3D PcdValue.rstrip(=0D + '}') + ', 0x00' * (ArraySize - len(PcdValue.sp= lit(',')))=0D PcdValue +=3D '}'=0D else:=0D if Pcd.MaxSizeUserSet:=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - "The maximum size of VOID* type PC= D '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCNam= e, TokenCName)=0D - )=0D + "The maximum size of VOID* typ= e PCD '%s.%s' is less than its actual size occupied." % (=0D + Pcd.TokenSpaceGuidCName, T= okenCName)=0D + )=0D else:=0D ArraySize =3D len(PcdValue) + 1=0D PcdItem =3D '%s.%s|%s|0x%X' % \=0D - (Pcd.TokenSpaceGuidCName, TokenCName, PcdValue, PatchP= cd[1])=0D + (Pcd.TokenSpaceGuidCName,=0D + TokenCName, PcdValue, PatchPcd[1])=0D PcdComments =3D ''=0D if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in self._PcdC= omments:=0D - PcdComments =3D '\n '.join(self._PcdComments[Pcd.Toke= nSpaceGuidCName, Pcd.TokenCName])=0D + PcdComments =3D '\n '.join(=0D + self._PcdComments[Pcd.TokenSpaceGuidCName, Pcd.Tok= enCName])=0D if PcdComments:=0D PcdItem =3D PcdComments + '\n ' + PcdItem=0D AsBuiltInfDict['patchablepcd_item'].append(PcdItem)=0D @@ -1592,10 +1669,12 @@ class ModuleAutoGen(AutoGen): if Pcd.Type =3D=3D TAB_PCDS_DYNAMIC_EX_HII:=0D for SkuName in Pcd.SkuInfoList:=0D SkuInfo =3D Pcd.SkuInfoList[SkuName]=0D - HiiInfo =3D '## %s|%s|%s' % (SkuInfo.VariableName, Sku= Info.VariableGuid, SkuInfo.VariableOffset)=0D + HiiInfo =3D '## %s|%s|%s' % (=0D + SkuInfo.VariableName, SkuInfo.VariableGuid, SkuInf= o.VariableOffset)=0D break=0D if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) in self._PcdComme= nts:=0D - PcdCommentList =3D self._PcdComments[Pcd.TokenSpaceGuidCNa= me, Pcd.TokenCName][:]=0D + PcdCommentList =3D self._PcdComments[Pcd.TokenSpaceGuidCNa= me,=0D + Pcd.TokenCName][:]=0D if HiiInfo:=0D UsageIndex =3D -1=0D UsageStr =3D ''=0D @@ -1606,7 +1685,8 @@ class ModuleAutoGen(AutoGen): UsageIndex =3D Index=0D break=0D if UsageIndex !=3D -1:=0D - PcdCommentList[UsageIndex] =3D '## %s %s %s' % (UsageS= tr, HiiInfo, PcdCommentList[UsageIndex].replace(UsageStr, ''))=0D + PcdCommentList[UsageIndex] =3D '## %s %s %s' % (=0D + UsageStr, HiiInfo, PcdCommentList[UsageIndex].repl= ace(UsageStr, ''))=0D else:=0D PcdCommentList.append('## UNDEFINED ' + HiiInfo)=0D PcdComments =3D '\n '.join(PcdCommentList)=0D @@ -1616,11 +1696,13 @@ class ModuleAutoGen(AutoGen): AsBuiltInfDict['pcd_item'].append(PcdEntry)=0D for Item in self.BuildOption:=0D if 'FLAGS' in self.BuildOption[Item]:=0D - AsBuiltInfDict['flags_item'].append('%s:%s_%s_%s_%s_FLAGS = =3D %s' % (self.ToolChainFamily, self.BuildTarget, self.ToolChain, self.Arc= h, Item, self.BuildOption[Item]['FLAGS'].strip()))=0D + AsBuiltInfDict['flags_item'].append('%s:%s_%s_%s_%s_FLAGS = =3D %s' % (=0D + self.ToolChainFamily, self.BuildTarget, self.ToolChain= , self.Arch, Item, self.BuildOption[Item]['FLAGS'].strip()))=0D =0D # Generated LibraryClasses section in comments.=0D for Library in self.LibraryAutoGenList:=0D - AsBuiltInfDict['libraryclasses_item'].append(Library.MetaFile.= File.replace('\\', '/'))=0D + AsBuiltInfDict['libraryclasses_item'].append(=0D + Library.MetaFile.File.replace('\\', '/'))=0D =0D # Generated UserExtensions TianoCore section.=0D # All tianocore user extensions are copied.=0D @@ -1639,7 +1721,8 @@ class ModuleAutoGen(AutoGen): AsBuiltInf =3D TemplateString()=0D AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict))= =0D =0D - SaveFileOnChange(os.path.join(self.OutputDir, self.Name + '.inf'),= str(AsBuiltInf), False)=0D + SaveFileOnChange(os.path.join(=0D + self.OutputDir, self.Name + '.inf'), str(AsBuiltInf), False)=0D =0D self.IsAsBuiltInfCreated =3D True=0D =0D @@ -1654,7 +1737,8 @@ class ModuleAutoGen(AutoGen): try:=0D CopyFileOnChange(File, destination_dir)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to copy file:%s to fold= er:%s" % (File, destination_dir))=0D + EdkLogger.quiet("[cache warning]: fail to copy file:%s to fold= er:%s" % (=0D + File, destination_dir))=0D return=0D =0D def CopyModuleToCache(self):=0D @@ -1664,42 +1748,52 @@ class ModuleAutoGen(AutoGen): PreMakeHashStr =3D None=0D MakeTimeStamp =3D 0=0D PreMakeTimeStamp =3D 0=0D - Files =3D [f for f in os.listdir(LongFilePath(self.BuildDir)) if p= ath.isfile(LongFilePath(path.join(self.BuildDir, f)))]=0D + Files =3D [f for f in os.listdir(LongFilePath(self.BuildDir)) if p= ath.isfile(=0D + LongFilePath(path.join(self.BuildDir, f)))]=0D for File in Files:=0D if ".MakeHashFileList." in File:=0D - #find lastest file through time stamp=0D - FileTimeStamp =3D os.stat(LongFilePath(path.join(self.Buil= dDir, File)))[8]=0D + # find lastest file through time stamp=0D + FileTimeStamp =3D os.stat(LongFilePath(=0D + path.join(self.BuildDir, File)))[8]=0D if FileTimeStamp > MakeTimeStamp:=0D MakeTimeStamp =3D FileTimeStamp=0D MakeHashStr =3D File.split('.')[-1]=0D if len(MakeHashStr) !=3D 32:=0D - EdkLogger.quiet("[cache error]: wrong MakeHashFile= List file:%s" % (File))=0D + EdkLogger.quiet(=0D + "[cache error]: wrong MakeHashFileList file:%s= " % (File))=0D if ".PreMakeHashFileList." in File:=0D - FileTimeStamp =3D os.stat(LongFilePath(path.join(self.Buil= dDir, File)))[8]=0D + FileTimeStamp =3D os.stat(LongFilePath(=0D + path.join(self.BuildDir, File)))[8]=0D if FileTimeStamp > PreMakeTimeStamp:=0D PreMakeTimeStamp =3D FileTimeStamp=0D PreMakeHashStr =3D File.split('.')[-1]=0D if len(PreMakeHashStr) !=3D 32:=0D - EdkLogger.quiet("[cache error]: wrong PreMakeHashF= ileList file:%s" % (File))=0D + EdkLogger.quiet(=0D + "[cache error]: wrong PreMakeHashFileList file= :%s" % (File))=0D =0D if not MakeHashStr:=0D - EdkLogger.quiet("[cache error]: No MakeHashFileList file for m= odule:%s[%s]" % (self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache error]: No MakeHashFileList file for m= odule:%s[%s]" % (=0D + self.MetaFile.Path, self.Arch))=0D return=0D if not PreMakeHashStr:=0D - EdkLogger.quiet("[cache error]: No PreMakeHashFileList file fo= r module:%s[%s]" % (self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache error]: No PreMakeHashFileList file fo= r module:%s[%s]" % (=0D + self.MetaFile.Path, self.Arch))=0D return=0D =0D # Create Cache destination dirs=0D - FileDir =3D path.join(GlobalData.gBinCacheDest, self.PlatformInfo.= OutputDir, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceD= ir, self.MetaFile.BaseName)=0D - FfsDir =3D path.join(GlobalData.gBinCacheDest, self.PlatformInfo.O= utputDir, self.BuildTarget + "_" + self.ToolChain, TAB_FV_DIRECTORY, "Ffs",= self.Guid + self.Name)=0D + FileDir =3D path.join(GlobalData.gBinCacheDest, self.PlatformInfo.= OutputDir, self.BuildTarget +=0D + "_" + self.ToolChain, self.Arch, self.SourceDi= r, self.MetaFile.BaseName)=0D + FfsDir =3D path.join(GlobalData.gBinCacheDest, self.PlatformInfo.O= utputDir, self.BuildTarget +=0D + "_" + self.ToolChain, TAB_FV_DIRECTORY, "Ffs", = self.Guid + self.Name)=0D CacheFileDir =3D path.join(FileDir, MakeHashStr)=0D CacheFfsDir =3D path.join(FfsDir, MakeHashStr)=0D - CreateDirectory (CacheFileDir)=0D - CreateDirectory (CacheFfsDir)=0D + CreateDirectory(CacheFileDir)=0D + CreateDirectory(CacheFfsDir)=0D =0D # Create ModuleHashPair file to support multiple version cache tog= ether=0D ModuleHashPair =3D path.join(FileDir, self.Name + ".ModuleHashPair= ")=0D - ModuleHashPairList =3D [] # tuple list: [tuple(PreMakefileHash, Ma= keHash)]=0D + # tuple list: [tuple(PreMakefileHash, MakeHash)]=0D + ModuleHashPairList =3D []=0D if os.path.exists(ModuleHashPair):=0D with open(ModuleHashPair, 'r') as f:=0D ModuleHashPairList =3D json.load(f)=0D @@ -1710,44 +1804,46 @@ class ModuleAutoGen(AutoGen): =0D # Copy files to Cache destination dirs=0D if not self.OutputFile:=0D - Ma =3D self.BuildDatabase[self.MetaFile, self.Arch, self.Build= Target, self.ToolChain]=0D + Ma =3D self.BuildDatabase[self.MetaFile,=0D + self.Arch, self.BuildTarget, self.Tool= Chain]=0D self.OutputFile =3D Ma.Binaries=0D for File in self.OutputFile:=0D if File.startswith(os.path.abspath(self.FfsOutputDir)+os.sep):= =0D self.CacheCopyFile(CacheFfsDir, self.FfsOutputDir, File)=0D else:=0D - if self.Name + ".autogen.hash." in File or \=0D - self.Name + ".autogen.hashchain." in File or \=0D - self.Name + ".hash." in File or \=0D - self.Name + ".hashchain." in File or \=0D - self.Name + ".PreMakeHashFileList." in File or \=0D - self.Name + ".MakeHashFileList." in File:=0D + if self.Name + ".autogen.hash." in File or \=0D + self.Name + ".autogen.hashchain." in File or \=0D + self.Name + ".hash." in File or \=0D + self.Name + ".hashchain." in File or \=0D + self.Name + ".PreMakeHashFileList." in File or \=0D + self.Name + ".MakeHashFileList." in File:=0D self.CacheCopyFile(FileDir, self.BuildDir, File)=0D else:=0D self.CacheCopyFile(CacheFileDir, self.BuildDir, File)= =0D - ## Create makefile for the module and its dependent libraries=0D + # Create makefile for the module and its dependent libraries=0D #=0D # @param CreateLibraryMakeFile Flag indicating if or not the = makefiles of=0D # dependent libraries will be cr= eated=0D #=0D +=0D @cached_class_function=0D - def CreateMakeFile(self, CreateLibraryMakeFile=3DTrue, GenFfsList =3D = []):=0D + def CreateMakeFile(self, CreateLibraryMakeFile=3DTrue, GenFfsList=3D[]= ):=0D =0D # nest this function inside it's only caller.=0D def CreateTimeStamp():=0D FileSet =3D {self.MetaFile.Path}=0D =0D for SourceFile in self.Module.Sources:=0D - FileSet.add (SourceFile.Path)=0D + FileSet.add(SourceFile.Path)=0D =0D for Lib in self.DependentLibraryList:=0D - FileSet.add (Lib.MetaFile.Path)=0D + FileSet.add(Lib.MetaFile.Path)=0D =0D for f in self.AutoGenDepSet:=0D - FileSet.add (f.Path)=0D + FileSet.add(f.Path)=0D =0D - if os.path.exists (self.TimeStampPath):=0D - os.remove (self.TimeStampPath)=0D + if os.path.exists(self.TimeStampPath):=0D + os.remove(self.TimeStampPath)=0D =0D SaveFileOnChange(self.TimeStampPath, "\n".join(FileSet), False= )=0D =0D @@ -1789,11 +1885,12 @@ class ModuleAutoGen(AutoGen): SrcPath =3D File.Path=0D DstPath =3D os.path.join(self.OutputDir, os.path.basename(SrcP= ath))=0D CopyLongFilePath(SrcPath, DstPath)=0D - ## Create autogen code for the module and its dependent libraries=0D + # Create autogen code for the module and its dependent libraries=0D #=0D # @param CreateLibraryCodeFile Flag indicating if or not the = code of=0D # dependent libraries will be cr= eated=0D #=0D +=0D def CreateCodeFile(self, CreateLibraryCodeFile=3DTrue):=0D =0D if self.IsCodeFileCreated:=0D @@ -1822,14 +1919,14 @@ class ModuleAutoGen(AutoGen): else:=0D IgoredAutoGenList.append(str(File))=0D =0D -=0D for ModuleType in self.DepexList:=0D # Ignore empty [depex] section or [depex] section for SUP_MODU= LE_USER_DEFINED module=0D if len(self.DepexList[ModuleType]) =3D=3D 0 or ModuleType =3D= =3D SUP_MODULE_USER_DEFINED or ModuleType =3D=3D SUP_MODULE_HOST_APPLICATIO= N:=0D continue=0D =0D - Dpx =3D GenDepex.DependencyExpression(self.DepexList[ModuleTyp= e], ModuleType, True)=0D - DpxFile =3D gAutoGenDepexFileName % {"module_name" : self.Name= }=0D + Dpx =3D GenDepex.DependencyExpression(=0D + self.DepexList[ModuleType], ModuleType, True)=0D + DpxFile =3D gAutoGenDepexFileName % {"module_name": self.Name}= =0D =0D if len(Dpx.PostfixNotation) !=3D 0:=0D self.DepexGenerated =3D True=0D @@ -1853,20 +1950,20 @@ class ModuleAutoGen(AutoGen): =0D return AutoGenList=0D =0D - ## Summarize the ModuleAutoGen objects of all libraries used by this m= odule=0D + # Summarize the ModuleAutoGen objects of all libraries used by this mo= dule=0D @cached_property=0D def LibraryAutoGenList(self):=0D RetVal =3D []=0D for Library in self.DependentLibraryList:=0D La =3D ModuleAutoGen(=0D - self.Workspace,=0D - Library.MetaFile,=0D - self.BuildTarget,=0D - self.ToolChain,=0D - self.Arch,=0D - self.PlatformInfo.MetaFile,=0D - self.DataPipe=0D - )=0D + self.Workspace,=0D + Library.MetaFile,=0D + self.BuildTarget,=0D + self.ToolChain,=0D + self.Arch,=0D + self.PlatformInfo.MetaFile,=0D + self.DataPipe=0D + )=0D La.IsLibrary =3D True=0D if La not in RetVal:=0D RetVal.append(La)=0D @@ -1888,10 +1985,11 @@ class ModuleAutoGen(AutoGen): # Add Makefile=0D abspath =3D path.join(self.BuildDir, self.Name + ".makefile")=0D try:=0D - with open(LongFilePath(abspath),"r") as fd:=0D + with open(LongFilePath(abspath), "r") as fd:=0D lines =3D fd.readlines()=0D except Exception as e:=0D - EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist" % a= bspath, ExtraData=3Dstr(e), RaiseError=3DFalse)=0D + EdkLogger.error("build", FILE_NOT_FOUND, "%s doesn't exist" %= =0D + abspath, ExtraData=3Dstr(e), RaiseError=3DFals= e)=0D if lines:=0D DependencyFileSet.update(lines)=0D =0D @@ -1901,20 +1999,24 @@ class ModuleAutoGen(AutoGen): m =3D hashlib.md5()=0D for File in sorted(DependencyFileSet, key=3Dlambda x: str(x)):=0D if not path.exists(LongFilePath(str(File))):=0D - EdkLogger.quiet("[cache warning]: header file %s is missin= g for module: %s[%s]" % (File, self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache warning]: header file %s is missin= g for module: %s[%s]" % (=0D + File, self.MetaFile.Path, self.Arch))=0D continue=0D with open(LongFilePath(str(File)), 'rb') as f:=0D Content =3D f.read()=0D m.update(Content)=0D FileList.append((str(File), hashlib.md5(Content).hexdigest()))= =0D =0D - HashChainFile =3D path.join(self.BuildDir, self.Name + ".autogen.h= ashchain." + m.hexdigest())=0D - GlobalData.gCMakeHashFile[(self.MetaFile.Path, self.Arch)] =3D Has= hChainFile=0D + HashChainFile =3D path.join(=0D + self.BuildDir, self.Name + ".autogen.hashchain." + m.hexdigest= ())=0D + GlobalData.gCMakeHashFile[(=0D + self.MetaFile.Path, self.Arch)] =3D HashChainFile=0D try:=0D with open(LongFilePath(HashChainFile), 'w') as f:=0D json.dump(FileList, f, indent=3D2)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save hashchain file:= %s" % HashChainFile)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save hashchain file:%s" % HashCh= ainFile)=0D return False=0D =0D def GenModuleHash(self):=0D @@ -1939,17 +2041,18 @@ class ModuleAutoGen(AutoGen): abspath =3D path.join(self.BuildDir, "deps.txt")=0D rt =3D None=0D try:=0D - with open(LongFilePath(abspath),"r") as fd:=0D + with open(LongFilePath(abspath), "r") as fd:=0D lines =3D fd.readlines()=0D if lines:=0D - rt =3D set([item.lstrip().strip("\n") for item in line= s if item.strip("\n").endswith(".h")])=0D + rt =3D set([item.lstrip().strip("\n")=0D + for item in lines if item.strip("\n").endswit= h(".h")])=0D except Exception as e:=0D - EdkLogger.error("build",FILE_NOT_FOUND, "%s doesn't exist" % a= bspath, ExtraData=3Dstr(e), RaiseError=3DFalse)=0D + EdkLogger.error("build", FILE_NOT_FOUND, "%s doesn't exist" %= =0D + abspath, ExtraData=3Dstr(e), RaiseError=3DFals= e)=0D =0D if rt:=0D DependencyFileSet.update(rt)=0D =0D -=0D # Caculate all above dependency files hash=0D # Initialze hash object=0D FileList =3D []=0D @@ -1961,20 +2064,24 @@ class ModuleAutoGen(AutoGen): if BuildDirStr in path.abspath(File).lower():=0D continue=0D if not path.exists(LongFilePath(File)):=0D - EdkLogger.quiet("[cache warning]: header file %s is missin= g for module: %s[%s]" % (File, self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache warning]: header file %s is missin= g for module: %s[%s]" % (=0D + File, self.MetaFile.Path, self.Arch))=0D continue=0D with open(LongFilePath(File), 'rb') as f:=0D Content =3D f.read()=0D m.update(Content)=0D FileList.append((File, hashlib.md5(Content).hexdigest()))=0D =0D - HashChainFile =3D path.join(self.BuildDir, self.Name + ".hashchain= ." + m.hexdigest())=0D - GlobalData.gModuleHashFile[(self.MetaFile.Path, self.Arch)] =3D Ha= shChainFile=0D + HashChainFile =3D path.join(=0D + self.BuildDir, self.Name + ".hashchain." + m.hexdigest())=0D + GlobalData.gModuleHashFile[(=0D + self.MetaFile.Path, self.Arch)] =3D HashChainFile=0D try:=0D with open(LongFilePath(HashChainFile), 'w') as f:=0D json.dump(FileList, f, indent=3D2)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save hashchain file:= %s" % HashChainFile)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save hashchain file:%s" % HashCh= ainFile)=0D return False=0D =0D def GenPreMakefileHashList(self):=0D @@ -1998,56 +2105,68 @@ class ModuleAutoGen(AutoGen): FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]: No Platform HashFile: %s" % = HashFile)=0D + EdkLogger.quiet(=0D + "[cache warning]: No Platform HashFile: %s" % HashFile)=0D =0D # Add Package level hash=0D if self.DependentPackageList:=0D for Pkg in sorted(self.DependentPackageList, key=3Dlambda x: x= .PackageName):=0D if not (Pkg.PackageName, Pkg.Arch) in GlobalData.gPackageH= ashFile:=0D - EdkLogger.quiet("[cache warning]:No Package %s for mod= ule %s[%s]" % (Pkg.PackageName, self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache warning]:No Package %s for mod= ule %s[%s]" % (=0D + Pkg.PackageName, self.MetaFile.Path, self.Arch))=0D continue=0D - HashFile =3D GlobalData.gPackageHashFile[(Pkg.PackageName,= Pkg.Arch)]=0D + HashFile =3D GlobalData.gPackageHashFile[(=0D + Pkg.PackageName, Pkg.Arch)]=0D if path.exists(LongFilePath(HashFile)):=0D FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No Package HashFile: = %s" % HashFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No Package HashFile: %s" % HashFi= le)=0D =0D # Add Module self=0D # GenPreMakefileHashList needed in both --binary-destination=0D # and --hash. And --hash might save ModuleHashFile in remote dict= =0D # during multiprocessing.=0D if (self.MetaFile.Path, self.Arch) in GlobalData.gModuleHashFile:= =0D - HashFile =3D GlobalData.gModuleHashFile[(self.MetaFile.Path, s= elf.Arch)]=0D + HashFile =3D GlobalData.gModuleHashFile[(=0D + self.MetaFile.Path, self.Arch)]=0D else:=0D - EdkLogger.quiet("[cache error]:No ModuleHashFile for module: %= s[%s]" % (self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache error]:No ModuleHashFile for module: %= s[%s]" % (=0D + self.MetaFile.Path, self.Arch))=0D if path.exists(LongFilePath(HashFile)):=0D FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No Module HashFile: %s" % Has= hFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No Module HashFile: %s" % HashFile)=0D =0D # Add Library hash=0D if self.LibraryAutoGenList:=0D for Lib in sorted(self.LibraryAutoGenList, key=3Dlambda x: x.M= etaFile.Path):=0D =0D if (Lib.MetaFile.Path, Lib.Arch) in GlobalData.gModuleHash= File:=0D - HashFile =3D GlobalData.gModuleHashFile[(Lib.MetaFile.= Path, Lib.Arch)]=0D + HashFile =3D GlobalData.gModuleHashFile[(=0D + Lib.MetaFile.Path, Lib.Arch)]=0D else:=0D - EdkLogger.quiet("[cache error]:No ModuleHashFile for l= ib: %s[%s]" % (Lib.MetaFile.Path, Lib.Arch))=0D + EdkLogger.quiet("[cache error]:No ModuleHashFile for l= ib: %s[%s]" % (=0D + Lib.MetaFile.Path, Lib.Arch))=0D if path.exists(LongFilePath(HashFile)):=0D FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No Lib HashFile: %s" = % HashFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No Lib HashFile: %s" % HashFile)= =0D =0D # Save PreMakeHashFileList=0D - FilePath =3D path.join(self.BuildDir, self.Name + ".PreMakeHashFil= eList." + m.hexdigest())=0D + FilePath =3D path.join(self.BuildDir, self.Name +=0D + ".PreMakeHashFileList." + m.hexdigest())=0D try:=0D with open(LongFilePath(FilePath), 'w') as f:=0D json.dump(FileList, f, indent=3D0)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save PreMake HashFil= eList: %s" % FilePath)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save PreMake HashFileList: %s" %= FilePath)=0D =0D def GenMakefileHashList(self):=0D # GenMakefileHashList only need in --binary-destination which will= =0D @@ -2065,39 +2184,48 @@ class ModuleAutoGen(AutoGen): FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No AutoGen HashFile: %s" % Ha= shFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No AutoGen HashFile: %s" % HashFile)=0D =0D # Add Module self=0D if (self.MetaFile.Path, self.Arch) in GlobalData.gModuleHashFile:= =0D - HashFile =3D GlobalData.gModuleHashFile[(self.MetaFile.Path, s= elf.Arch)]=0D + HashFile =3D GlobalData.gModuleHashFile[(=0D + self.MetaFile.Path, self.Arch)]=0D else:=0D - EdkLogger.quiet("[cache error]:No ModuleHashFile for module: %= s[%s]" % (self.MetaFile.Path, self.Arch))=0D + EdkLogger.quiet("[cache error]:No ModuleHashFile for module: %= s[%s]" % (=0D + self.MetaFile.Path, self.Arch))=0D if path.exists(LongFilePath(HashFile)):=0D FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No Module HashFile: %s" % Has= hFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No Module HashFile: %s" % HashFile)=0D =0D # Add Library hash=0D if self.LibraryAutoGenList:=0D for Lib in sorted(self.LibraryAutoGenList, key=3Dlambda x: x.M= etaFile.Path):=0D if (Lib.MetaFile.Path, Lib.Arch) in GlobalData.gModuleHash= File:=0D - HashFile =3D GlobalData.gModuleHashFile[(Lib.MetaFile.= Path, Lib.Arch)]=0D + HashFile =3D GlobalData.gModuleHashFile[(=0D + Lib.MetaFile.Path, Lib.Arch)]=0D else:=0D - EdkLogger.quiet("[cache error]:No ModuleHashFile for l= ib: %s[%s]" % (Lib.MetaFile.Path, Lib.Arch))=0D + EdkLogger.quiet("[cache error]:No ModuleHashFile for l= ib: %s[%s]" % (=0D + Lib.MetaFile.Path, Lib.Arch))=0D if path.exists(LongFilePath(HashFile)):=0D FileList.append(HashFile)=0D m.update(HashFile.encode('utf-8'))=0D else:=0D - EdkLogger.quiet("[cache warning]:No Lib HashFile: %s" = % HashFile)=0D + EdkLogger.quiet(=0D + "[cache warning]:No Lib HashFile: %s" % HashFile)= =0D =0D # Save MakeHashFileList=0D - FilePath =3D path.join(self.BuildDir, self.Name + ".MakeHashFileLi= st." + m.hexdigest())=0D + FilePath =3D path.join(self.BuildDir, self.Name +=0D + ".MakeHashFileList." + m.hexdigest())=0D try:=0D with open(LongFilePath(FilePath), 'w') as f:=0D json.dump(FileList, f, indent=3D0)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save Make HashFileLi= st: %s" % FilePath)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save Make HashFileList: %s" % Fi= lePath)=0D =0D def CheckHashChainFile(self, HashChainFile):=0D # Assume the HashChainFile basename format is the 'x.hashchain.16B= ytesHexStr'=0D @@ -2105,19 +2233,21 @@ class ModuleAutoGen(AutoGen): # all hashchain files content=0D HashStr =3D HashChainFile.split('.')[-1]=0D if len(HashStr) !=3D 32:=0D - EdkLogger.quiet("[cache error]: wrong format HashChainFile:%s"= % (File))=0D + EdkLogger.quiet(=0D + "[cache error]: wrong format HashChainFile:%s" % (File))=0D return False=0D =0D try:=0D with open(LongFilePath(HashChainFile), 'r') as f:=0D HashChainList =3D json.load(f)=0D except:=0D - EdkLogger.quiet("[cache error]: fail to load HashChainFile: %s= " % HashChainFile)=0D + EdkLogger.quiet(=0D + "[cache error]: fail to load HashChainFile: %s" % HashChai= nFile)=0D return False=0D =0D # Print the different file info=0D # print(HashChainFile)=0D - for idx, (SrcFile, SrcHash) in enumerate (HashChainList):=0D + for idx, (SrcFile, SrcHash) in enumerate(HashChainList):=0D if SrcFile in GlobalData.gFileHashDict:=0D DestHash =3D GlobalData.gFileHashDict[SrcFile]=0D else:=0D @@ -2129,15 +2259,17 @@ class ModuleAutoGen(AutoGen): except IOError as X:=0D # cache miss if SrcFile is removed in new version code= =0D GlobalData.gFileHashDict[SrcFile] =3D 0=0D - EdkLogger.quiet("[cache insight]: first cache miss fil= e in %s is %s" % (HashChainFile, SrcFile))=0D + EdkLogger.quiet("[cache insight]: first cache miss fil= e in %s is %s" % (=0D + HashChainFile, SrcFile))=0D return False=0D if SrcHash !=3D DestHash:=0D - EdkLogger.quiet("[cache insight]: first cache miss file in= %s is %s" % (HashChainFile, SrcFile))=0D + EdkLogger.quiet("[cache insight]: first cache miss file in= %s is %s" % (=0D + HashChainFile, SrcFile))=0D return False=0D =0D return True=0D =0D - ## Decide whether we can skip the left autogen and make process=0D + # Decide whether we can skip the left autogen and make process=0D def CanSkipbyMakeCache(self):=0D # For --binary-source only=0D # CanSkipbyMakeCache consume below dicts:=0D @@ -2155,44 +2287,57 @@ class ModuleAutoGen(AutoGen): =0D # If Module is binary, which has special build rule, do not skip b= y cache.=0D if self.IsBinaryModule:=0D - print("[cache miss]: MakeCache: Skip BinaryModule:", self.Meta= File.Path, self.Arch)=0D - GlobalData.gModuleMakeCacheStatus[(self.MetaFile.Path, self.Ar= ch)] =3D False=0D + print("[cache miss]: MakeCache: Skip BinaryModule:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModuleMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D # see .inc as binary file, do not skip by hash=0D for f_ext in self.SourceFileList:=0D if '.inc' in str(f_ext):=0D - print("[cache miss]: MakeCache: Skip '.inc' File:", self.M= etaFile.Path, self.Arch)=0D - GlobalData.gModuleMakeCacheStatus[(self.MetaFile.Path, sel= f.Arch)] =3D False=0D + print("[cache miss]: MakeCache: Skip '.inc' File:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModuleMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D - ModuleCacheDir =3D path.join(GlobalData.gBinCacheSource, self.Plat= formInfo.OutputDir, self.BuildTarget + "_" + self.ToolChain, self.Arch, sel= f.SourceDir, self.MetaFile.BaseName)=0D - FfsDir =3D path.join(GlobalData.gBinCacheSource, self.PlatformInfo= .OutputDir, self.BuildTarget + "_" + self.ToolChain, TAB_FV_DIRECTORY, "Ffs= ", self.Guid + self.Name)=0D + ModuleCacheDir =3D path.join(GlobalData.gBinCacheSource, self.Plat= formInfo.OutputDir,=0D + self.BuildTarget + "_" + self.ToolChain= , self.Arch, self.SourceDir, self.MetaFile.BaseName)=0D + FfsDir =3D path.join(GlobalData.gBinCacheSource, self.PlatformInfo= .OutputDir,=0D + self.BuildTarget + "_" + self.ToolChain, TAB_FV= _DIRECTORY, "Ffs", self.Guid + self.Name)=0D =0D - ModuleHashPairList =3D [] # tuple list: [tuple(PreMakefileHash, Ma= keHash)]=0D - ModuleHashPair =3D path.join(ModuleCacheDir, self.Name + ".ModuleH= ashPair")=0D + # tuple list: [tuple(PreMakefileHash, MakeHash)]=0D + ModuleHashPairList =3D []=0D + ModuleHashPair =3D path.join(=0D + ModuleCacheDir, self.Name + ".ModuleHashPair")=0D try:=0D with open(LongFilePath(ModuleHashPair), 'r') as f:=0D ModuleHashPairList =3D json.load(f)=0D except:=0D # ModuleHashPair might not exist for new added module=0D - GlobalData.gModuleMakeCacheStatus[(self.MetaFile.Path, self.Ar= ch)] =3D False=0D - EdkLogger.quiet("[cache warning]: fail to load ModuleHashPair = file: %s" % ModuleHashPair)=0D + GlobalData.gModuleMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to load ModuleHashPair file: %s" % = ModuleHashPair)=0D print("[cache miss]: MakeCache:", self.MetaFile.Path, self.Arc= h)=0D return False=0D =0D # Check the PreMakeHash in ModuleHashPairList one by one=0D - for idx, (PreMakefileHash, MakeHash) in enumerate (ModuleHashPairL= ist):=0D + for idx, (PreMakefileHash, MakeHash) in enumerate(ModuleHashPairLi= st):=0D SourceHashDir =3D path.join(ModuleCacheDir, MakeHash)=0D SourceFfsHashDir =3D path.join(FfsDir, MakeHash)=0D - PreMakeHashFileList_FilePah =3D path.join(ModuleCacheDir, self= .Name + ".PreMakeHashFileList." + PreMakefileHash)=0D - MakeHashFileList_FilePah =3D path.join(ModuleCacheDir, self.Na= me + ".MakeHashFileList." + MakeHash)=0D + PreMakeHashFileList_FilePah =3D path.join(=0D + ModuleCacheDir, self.Name + ".PreMakeHashFileList." + PreM= akefileHash)=0D + MakeHashFileList_FilePah =3D path.join(=0D + ModuleCacheDir, self.Name + ".MakeHashFileList." + MakeHas= h)=0D =0D try:=0D with open(LongFilePath(MakeHashFileList_FilePah), 'r') as = f:=0D MakeHashFileList =3D json.load(f)=0D except:=0D - EdkLogger.quiet("[cache error]: fail to load MakeHashFileL= ist file: %s" % MakeHashFileList_FilePah)=0D + EdkLogger.quiet(=0D + "[cache error]: fail to load MakeHashFileList file: %s= " % MakeHashFileList_FilePah)=0D continue=0D =0D HashMiss =3D False=0D @@ -2206,13 +2351,16 @@ class ModuleAutoGen(AutoGen): elif HashChainStatus =3D=3D True:=0D continue=0D # Convert to path start with cache source dir=0D - RelativePath =3D os.path.relpath(HashChainFile, self.Works= paceDir)=0D - NewFilePath =3D os.path.join(GlobalData.gBinCacheSource, R= elativePath)=0D + RelativePath =3D os.path.relpath(=0D + HashChainFile, self.WorkspaceDir)=0D + NewFilePath =3D os.path.join(=0D + GlobalData.gBinCacheSource, RelativePath)=0D if self.CheckHashChainFile(NewFilePath):=0D GlobalData.gHashChainStatus[HashChainFile] =3D True=0D # Save the module self HashFile for GenPreMakefileHash= List later usage=0D if self.Name + ".hashchain." in HashChainFile:=0D - GlobalData.gModuleHashFile[(self.MetaFile.Path, se= lf.Arch)] =3D HashChainFile=0D + GlobalData.gModuleHashFile[(=0D + self.MetaFile.Path, self.Arch)] =3D HashChainF= ile=0D else:=0D GlobalData.gHashChainStatus[HashChainFile] =3D False=0D HashMiss =3D True=0D @@ -2230,20 +2378,23 @@ class ModuleAutoGen(AutoGen): for root, dir, files in os.walk(SourceFfsHashDir):=0D for f in files:=0D File =3D path.join(root, f)=0D - self.CacheCopyFile(self.FfsOutputDir, SourceFfsHas= hDir, File)=0D + self.CacheCopyFile(=0D + self.FfsOutputDir, SourceFfsHashDir, File)=0D =0D if self.Name =3D=3D "PcdPeim" or self.Name =3D=3D "PcdDxe":=0D CreatePcdDatabaseCode(self, TemplateString(), TemplateStri= ng())=0D =0D print("[cache hit]: MakeCache:", self.MetaFile.Path, self.Arch= )=0D - GlobalData.gModuleMakeCacheStatus[(self.MetaFile.Path, self.Ar= ch)] =3D True=0D + GlobalData.gModuleMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D True=0D return True=0D =0D print("[cache miss]: MakeCache:", self.MetaFile.Path, self.Arch)=0D - GlobalData.gModuleMakeCacheStatus[(self.MetaFile.Path, self.Arch)]= =3D False=0D + GlobalData.gModuleMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D - ## Decide whether we can skip the left autogen and make process=0D + # Decide whether we can skip the left autogen and make process=0D def CanSkipbyPreMakeCache(self):=0D # CanSkipbyPreMakeCache consume below dicts:=0D # gModulePreMakeCacheStatus=0D @@ -2261,20 +2412,25 @@ class ModuleAutoGen(AutoGen): =0D # If Module is binary, which has special build rule, do not skip b= y cache.=0D if self.IsBinaryModule:=0D - print("[cache miss]: PreMakeCache: Skip BinaryModule:", self.M= etaFile.Path, self.Arch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, self= .Arch)] =3D False=0D + print("[cache miss]: PreMakeCache: Skip BinaryModule:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D # see .inc as binary file, do not skip by hash=0D for f_ext in self.SourceFileList:=0D if '.inc' in str(f_ext):=0D - print("[cache miss]: PreMakeCache: Skip '.inc' File:", sel= f.MetaFile.Path, self.Arch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, = self.Arch)] =3D False=0D + print("[cache miss]: PreMakeCache: Skip '.inc' File:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D # For --hash only in the incremental build=0D if not GlobalData.gBinCacheSource:=0D - Files =3D [path.join(self.BuildDir, f) for f in os.listdir(sel= f.BuildDir) if path.isfile(path.join(self.BuildDir, f))]=0D + Files =3D [path.join(self.BuildDir, f) for f in os.listdir(=0D + self.BuildDir) if path.isfile(path.join(self.BuildDir, f))= ]=0D PreMakeHashFileList_FilePah =3D None=0D MakeTimeStamp =3D 0=0D # Find latest PreMakeHashFileList file in self.BuildDir folder= =0D @@ -2285,16 +2441,20 @@ class ModuleAutoGen(AutoGen): MakeTimeStamp =3D FileTimeStamp=0D PreMakeHashFileList_FilePah =3D File=0D if not PreMakeHashFileList_FilePah:=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, = self.Arch)] =3D False=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D try:=0D with open(LongFilePath(PreMakeHashFileList_FilePah), 'r') = as f:=0D PreMakeHashFileList =3D json.load(f)=0D except:=0D - EdkLogger.quiet("[cache error]: fail to load PreMakeHashFi= leList file: %s" % PreMakeHashFileList_FilePah)=0D - print("[cache miss]: PreMakeCache:", self.MetaFile.Path, s= elf.Arch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, = self.Arch)] =3D False=0D + EdkLogger.quiet(=0D + "[cache error]: fail to load PreMakeHashFileList file:= %s" % PreMakeHashFileList_FilePah)=0D + print("[cache miss]: PreMakeCache:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D HashMiss =3D False=0D @@ -2311,48 +2471,62 @@ class ModuleAutoGen(AutoGen): GlobalData.gHashChainStatus[HashChainFile] =3D True=0D # Save the module self HashFile for GenPreMakefileHash= List later usage=0D if self.Name + ".hashchain." in HashChainFile:=0D - GlobalData.gModuleHashFile[(self.MetaFile.Path, se= lf.Arch)] =3D HashChainFile=0D + GlobalData.gModuleHashFile[(=0D + self.MetaFile.Path, self.Arch)] =3D HashChainF= ile=0D else:=0D GlobalData.gHashChainStatus[HashChainFile] =3D False=0D HashMiss =3D True=0D break=0D =0D if HashMiss:=0D - print("[cache miss]: PreMakeCache:", self.MetaFile.Path, s= elf.Arch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, = self.Arch)] =3D False=0D + print("[cache miss]: PreMakeCache:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D else:=0D - print("[cache hit]: PreMakeCache:", self.MetaFile.Path, se= lf.Arch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, = self.Arch)] =3D True=0D + print("[cache hit]: PreMakeCache:",=0D + self.MetaFile.Path, self.Arch)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D True=0D return True=0D =0D - ModuleCacheDir =3D path.join(GlobalData.gBinCacheSource, self.Plat= formInfo.OutputDir, self.BuildTarget + "_" + self.ToolChain, self.Arch, sel= f.SourceDir, self.MetaFile.BaseName)=0D - FfsDir =3D path.join(GlobalData.gBinCacheSource, self.PlatformInfo= .OutputDir, self.BuildTarget + "_" + self.ToolChain, TAB_FV_DIRECTORY, "Ffs= ", self.Guid + self.Name)=0D + ModuleCacheDir =3D path.join(GlobalData.gBinCacheSource, self.Plat= formInfo.OutputDir,=0D + self.BuildTarget + "_" + self.ToolChain= , self.Arch, self.SourceDir, self.MetaFile.BaseName)=0D + FfsDir =3D path.join(GlobalData.gBinCacheSource, self.PlatformInfo= .OutputDir,=0D + self.BuildTarget + "_" + self.ToolChain, TAB_FV= _DIRECTORY, "Ffs", self.Guid + self.Name)=0D =0D - ModuleHashPairList =3D [] # tuple list: [tuple(PreMakefileHash, Ma= keHash)]=0D - ModuleHashPair =3D path.join(ModuleCacheDir, self.Name + ".ModuleH= ashPair")=0D + # tuple list: [tuple(PreMakefileHash, MakeHash)]=0D + ModuleHashPairList =3D []=0D + ModuleHashPair =3D path.join(=0D + ModuleCacheDir, self.Name + ".ModuleHashPair")=0D try:=0D with open(LongFilePath(ModuleHashPair), 'r') as f:=0D ModuleHashPairList =3D json.load(f)=0D except:=0D # ModuleHashPair might not exist for new added module=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, self= .Arch)] =3D False=0D - EdkLogger.quiet("[cache warning]: fail to load ModuleHashPair = file: %s" % ModuleHashPair)=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to load ModuleHashPair file: %s" % = ModuleHashPair)=0D print("[cache miss]: PreMakeCache:", self.MetaFile.Path, self.= Arch)=0D return False=0D =0D # Check the PreMakeHash in ModuleHashPairList one by one=0D - for idx, (PreMakefileHash, MakeHash) in enumerate (ModuleHashPairL= ist):=0D + for idx, (PreMakefileHash, MakeHash) in enumerate(ModuleHashPairLi= st):=0D SourceHashDir =3D path.join(ModuleCacheDir, MakeHash)=0D SourceFfsHashDir =3D path.join(FfsDir, MakeHash)=0D - PreMakeHashFileList_FilePah =3D path.join(ModuleCacheDir, self= .Name + ".PreMakeHashFileList." + PreMakefileHash)=0D - MakeHashFileList_FilePah =3D path.join(ModuleCacheDir, self.Na= me + ".MakeHashFileList." + MakeHash)=0D + PreMakeHashFileList_FilePah =3D path.join(=0D + ModuleCacheDir, self.Name + ".PreMakeHashFileList." + PreM= akefileHash)=0D + MakeHashFileList_FilePah =3D path.join(=0D + ModuleCacheDir, self.Name + ".MakeHashFileList." + MakeHas= h)=0D =0D try:=0D with open(LongFilePath(PreMakeHashFileList_FilePah), 'r') = as f:=0D PreMakeHashFileList =3D json.load(f)=0D except:=0D - EdkLogger.quiet("[cache error]: fail to load PreMakeHashFi= leList file: %s" % PreMakeHashFileList_FilePah)=0D + EdkLogger.quiet(=0D + "[cache error]: fail to load PreMakeHashFileList file:= %s" % PreMakeHashFileList_FilePah)=0D continue=0D =0D HashMiss =3D False=0D @@ -2366,8 +2540,10 @@ class ModuleAutoGen(AutoGen): elif HashChainStatus =3D=3D True:=0D continue=0D # Convert to path start with cache source dir=0D - RelativePath =3D os.path.relpath(HashChainFile, self.Works= paceDir)=0D - NewFilePath =3D os.path.join(GlobalData.gBinCacheSource, R= elativePath)=0D + RelativePath =3D os.path.relpath(=0D + HashChainFile, self.WorkspaceDir)=0D + NewFilePath =3D os.path.join(=0D + GlobalData.gBinCacheSource, RelativePath)=0D if self.CheckHashChainFile(NewFilePath):=0D GlobalData.gHashChainStatus[HashChainFile] =3D True=0D else:=0D @@ -2387,20 +2563,23 @@ class ModuleAutoGen(AutoGen): for root, dir, files in os.walk(SourceFfsHashDir):=0D for f in files:=0D File =3D path.join(root, f)=0D - self.CacheCopyFile(self.FfsOutputDir, SourceFfsHas= hDir, File)=0D + self.CacheCopyFile(=0D + self.FfsOutputDir, SourceFfsHashDir, File)=0D =0D if self.Name =3D=3D "PcdPeim" or self.Name =3D=3D "PcdDxe":=0D CreatePcdDatabaseCode(self, TemplateString(), TemplateStri= ng())=0D =0D print("[cache hit]: PreMakeCache:", self.MetaFile.Path, self.A= rch)=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, self= .Arch)] =3D True=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D True=0D return True=0D =0D print("[cache miss]: PreMakeCache:", self.MetaFile.Path, self.Arch= )=0D - GlobalData.gModulePreMakeCacheStatus[(self.MetaFile.Path, self.Arc= h)] =3D False=0D + GlobalData.gModulePreMakeCacheStatus[(=0D + self.MetaFile.Path, self.Arch)] =3D False=0D return False=0D =0D - ## Decide whether we can skip the Module build=0D + # Decide whether we can skip the Module build=0D def CanSkipbyCache(self, gHitSet):=0D # Hashing feature is off=0D if not GlobalData.gBinCacheSource:=0D @@ -2411,7 +2590,7 @@ class ModuleAutoGen(AutoGen): =0D return False=0D =0D - ## Decide whether we can skip the ModuleAutoGen process=0D + # Decide whether we can skip the ModuleAutoGen process=0D # If any source file is newer than the module than we cannot skip=0D #=0D def CanSkip(self):=0D @@ -2422,19 +2601,19 @@ class ModuleAutoGen(AutoGen): return True=0D if not os.path.exists(self.TimeStampPath):=0D return False=0D - #last creation time of the module=0D + # last creation time of the module=0D DstTimeStamp =3D os.stat(self.TimeStampPath)[8]=0D =0D SrcTimeStamp =3D self.Workspace._SrcTimeStamp=0D if SrcTimeStamp > DstTimeStamp:=0D return False=0D =0D - with open(self.TimeStampPath,'r') as f:=0D + with open(self.TimeStampPath, 'r') as f:=0D for source in f:=0D source =3D source.rstrip('\n')=0D if not os.path.exists(source):=0D return False=0D - if source not in ModuleAutoGen.TimeDict :=0D + if source not in ModuleAutoGen.TimeDict:=0D ModuleAutoGen.TimeDict[source] =3D os.stat(source)[8]= =0D if ModuleAutoGen.TimeDict[source] > DstTimeStamp:=0D return False=0D diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py b/BaseT= ools/Source/Python/AutoGen/ModuleAutoGenHelper.py index 036fdac3d7df..1fa3805d2480 100644 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGenHelper.py @@ -1,21 +1,21 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D from __future__ import absolute_import=0D -from Workspace.WorkspaceDatabase import WorkspaceDatabase,BuildDB=0D +from Workspace.WorkspaceDatabase import WorkspaceDatabase, BuildDB=0D from Common.caching import cached_property=0D -from AutoGen.BuildEngine import BuildRule,AutoGenReqBuildRuleVerNum=0D +from AutoGen.BuildEngine import BuildRule, AutoGenReqBuildRuleVerNum=0D from AutoGen.AutoGen import CalculatePriorityValue=0D -from Common.Misc import CheckPcdDatum,GuidValue=0D +from Common.Misc import CheckPcdDatum, GuidValue=0D from Common.Expression import ValueExpressionEx=0D from Common.DataType import *=0D from CommonDataClass.Exceptions import *=0D from CommonDataClass.CommonClass import SkuInfoClass=0D import Common.EdkLogger as EdkLogger=0D -from Common.BuildToolError import OPTION_CONFLICT,FORMAT_INVALID,RESOURCE_= NOT_AVAILABLE=0D +from Common.BuildToolError import OPTION_CONFLICT, FORMAT_INVALID, RESOURC= E_NOT_AVAILABLE=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D from collections import defaultdict=0D from Common.Misc import PathClass=0D @@ -25,31 +25,34 @@ import os #=0D # The priority list while override build option=0D #=0D -PrioList =3D {"0x11111" : 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_AT= TRIBUTE (Highest)=0D - "0x01111" : 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x10111" : 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_ATTR= IBUTE=0D - "0x11011" : 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x01011" : 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x10011" : 10, # TARGET_*********_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x00011" : 9, # ******_*********_****_COMMANDTYPE_ATTR= IBUTE=0D - "0x11101" : 8, # TARGET_TOOLCHAIN_ARCH_***********_ATTR= IBUTE=0D - "0x01101" : 7, # ******_TOOLCHAIN_ARCH_***********_ATTR= IBUTE=0D - "0x10101" : 6, # TARGET_*********_ARCH_***********_ATTR= IBUTE=0D - "0x00101" : 5, # ******_*********_ARCH_***********_ATTR= IBUTE=0D - "0x11001" : 4, # TARGET_TOOLCHAIN_****_***********_ATTR= IBUTE=0D - "0x01001" : 3, # ******_TOOLCHAIN_****_***********_ATTR= IBUTE=0D - "0x10001" : 2, # TARGET_*********_****_***********_ATTR= IBUTE=0D - "0x00001" : 1} # ******_*********_****_***********_ATTR= IBUTE (Lowest)=0D -## Base class for AutoGen=0D +PrioList =3D {"0x11111": 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUT= E (Highest)=0D + "0x01111": 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x10111": 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x00111": 13, # ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE= =0D + "0x11011": 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x01011": 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x10011": 10, # TARGET_*********_****_COMMANDTYPE_ATTRIBUTE= =0D + "0x00011": 9, # ******_*********_****_COMMANDTYPE_ATTRIBUTE=0D + "0x11101": 8, # TARGET_TOOLCHAIN_ARCH_***********_ATTRIBUTE=0D + "0x01101": 7, # ******_TOOLCHAIN_ARCH_***********_ATTRIBUTE=0D + "0x10101": 6, # TARGET_*********_ARCH_***********_ATTRIBUTE=0D + "0x00101": 5, # ******_*********_ARCH_***********_ATTRIBUTE=0D + "0x11001": 4, # TARGET_TOOLCHAIN_****_***********_ATTRIBUTE=0D + "0x01001": 3, # ******_TOOLCHAIN_****_***********_ATTRIBUTE=0D + "0x10001": 2, # TARGET_*********_****_***********_ATTRIBUTE=0D + "0x00001": 1} # ******_*********_****_***********_ATTRIBUTE (= Lowest)=0D +# Base class for AutoGen=0D #=0D # This class just implements the cache mechanism of AutoGen objects.=0D #=0D +=0D +=0D class AutoGenInfo(object):=0D # database to maintain the objects in each child class=0D - __ObjectCache =3D {} # (BuildTarget, ToolChain, ARCH, platform file= ): AutoGen object=0D + # (BuildTarget, ToolChain, ARCH, platform file): AutoGen object=0D + __ObjectCache =3D {}=0D =0D - ## Factory method=0D + # Factory method=0D #=0D # @param Class class object of real AutoGen class=0D # (WorkspaceAutoGen, ModuleAutoGen or Platfo= rmAutoGen)=0D @@ -64,6 +67,7 @@ class AutoGenInfo(object): @classmethod=0D def GetCache(cls):=0D return cls.__ObjectCache=0D +=0D def __new__(cls, Workspace, MetaFile, Target, Toolchain, Arch, *args, = **kwargs):=0D # check if the object has been created=0D Key =3D (Target, Toolchain, Arch, MetaFile)=0D @@ -74,17 +78,17 @@ class AutoGenInfo(object): RetVal =3D cls.__ObjectCache[Key] =3D super(AutoGenInfo, cls).__ne= w__(cls)=0D return RetVal=0D =0D -=0D - ## hash() operator=0D + # hash() operator=0D #=0D # The file path of platform file will be used to represent hash value= of this object=0D #=0D # @retval int Hash value of the file path of platform file=0D #=0D +=0D def __hash__(self):=0D return hash(self.MetaFile)=0D =0D - ## str() operator=0D + # str() operator=0D #=0D # The file path of platform file will be used to represent this objec= t=0D #=0D @@ -93,11 +97,11 @@ class AutoGenInfo(object): def __str__(self):=0D return str(self.MetaFile)=0D =0D - ## "=3D=3D" operator=0D + # "=3D=3D" operator=0D def __eq__(self, Other):=0D return Other and self.MetaFile =3D=3D Other=0D =0D - ## Expand * in build option key=0D + # Expand * in build option key=0D #=0D # @param Options Options to be expanded=0D # @param ToolDef Use specified ToolDef instead of full version.= =0D @@ -111,7 +115,7 @@ class AutoGenInfo(object): if not ToolDef:=0D ToolDef =3D self.ToolDefinition=0D BuildOptions =3D {}=0D - FamilyMatch =3D False=0D + FamilyMatch =3D False=0D FamilyIsNull =3D True=0D =0D OverrideList =3D {}=0D @@ -124,12 +128,12 @@ class AutoGenInfo(object): # Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE=0D #=0D if (Key[0] =3D=3D self.BuildRuleFamily and=0D - (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 and = Key[2] =3D=3D ModuleStyle))):=0D + (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 = and Key[2] =3D=3D ModuleStyle))):=0D Target, ToolChain, Arch, CommandType, Attr =3D Key[1].spli= t('_')=0D if (Target =3D=3D self.BuildTarget or Target =3D=3D TAB_ST= AR) and\=0D (ToolChain =3D=3D self.ToolChain or ToolChain =3D=3D T= AB_STAR) and\=0D (Arch =3D=3D self.Arch or Arch =3D=3D TAB_STAR) and\=0D - Options[Key].startswith("=3D"):=0D + Options[Key].startswith("=3D"):=0D =0D if OverrideList.get(Key[1]) is not None:=0D OverrideList.pop(Key[1])=0D @@ -142,18 +146,20 @@ class AutoGenInfo(object): KeyList =3D list(OverrideList.keys())=0D for Index in range(len(KeyList)):=0D NowKey =3D KeyList[Index]=0D - Target1, ToolChain1, Arch1, CommandType1, Attr1 =3D NowKey= .split("_")=0D + Target1, ToolChain1, Arch1, CommandType1, Attr1 =3D NowKey= .split(=0D + "_")=0D for Index1 in range(len(KeyList) - Index - 1):=0D NextKey =3D KeyList[Index1 + Index + 1]=0D #=0D # Compare two Key, if one is included by another, choo= se the higher priority one=0D #=0D - Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D Ne= xtKey.split("_")=0D + Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D Ne= xtKey.split(=0D + "_")=0D if (Target1 =3D=3D Target2 or Target1 =3D=3D TAB_STAR = or Target2 =3D=3D TAB_STAR) and\=0D (ToolChain1 =3D=3D ToolChain2 or ToolChain1 =3D=3D= TAB_STAR or ToolChain2 =3D=3D TAB_STAR) and\=0D (Arch1 =3D=3D Arch2 or Arch1 =3D=3D TAB_STAR or Ar= ch2 =3D=3D TAB_STAR) and\=0D (CommandType1 =3D=3D CommandType2 or CommandType1 = =3D=3D TAB_STAR or CommandType2 =3D=3D TAB_STAR) and\=0D - (Attr1 =3D=3D Attr2 or Attr1 =3D=3D TAB_STAR or At= tr2 =3D=3D TAB_STAR):=0D + (Attr1 =3D=3D Attr2 or Attr1 =3D=3D TAB_STAR o= r Attr2 =3D=3D TAB_STAR):=0D =0D if CalculatePriorityValue(NowKey) > CalculatePrior= ityValue(NextKey):=0D if Options.get((self.BuildRuleFamily, NextKey)= ) is not None:=0D @@ -163,7 +169,7 @@ class AutoGenInfo(object): Options.pop((self.BuildRuleFamily, NowKey)= )=0D =0D for Key in Options:=0D - if ModuleStyle is not None and len (Key) > 2:=0D + if ModuleStyle is not None and len(Key) > 2:=0D # Check Module style is EDK or EDKII.=0D # Only append build option for the matched style module.=0D if ModuleStyle =3D=3D EDK_NAME and Key[2] !=3D EDK_NAME:=0D @@ -208,7 +214,7 @@ class AutoGenInfo(object): return BuildOptions=0D =0D for Key in Options:=0D - if ModuleStyle is not None and len (Key) > 2:=0D + if ModuleStyle is not None and len(Key) > 2:=0D # Check Module style is EDK or EDKII.=0D # Only append build option for the matched style module.=0D if ModuleStyle =3D=3D EDK_NAME and Key[2] !=3D EDK_NAME:=0D @@ -249,14 +255,17 @@ class AutoGenInfo(object): BuildOptions[Tool][Attr] =3D Options[Key]= =0D return BuildOptions=0D #=0D -#This class is the pruned WorkSpaceAutoGen for ModuleAutoGen in multiple t= hread=0D +# This class is the pruned WorkSpaceAutoGen for ModuleAutoGen in multiple = thread=0D #=0D +=0D +=0D class WorkSpaceInfo(AutoGenInfo):=0D - def __init__(self,Workspace, MetaFile, Target, ToolChain, Arch):=0D + def __init__(self, Workspace, MetaFile, Target, ToolChain, Arch):=0D if not hasattr(self, "_Init"):=0D self.do_init(Workspace, MetaFile, Target, ToolChain, Arch)=0D self._Init =3D True=0D - def do_init(self,Workspace, MetaFile, Target, ToolChain, Arch):=0D +=0D + def do_init(self, Workspace, MetaFile, Target, ToolChain, Arch):=0D self._SrcTimeStamp =3D 0=0D self.Db =3D BuildDB=0D self.BuildDatabase =3D self.Db.BuildObject=0D @@ -266,6 +275,7 @@ class WorkSpaceInfo(AutoGenInfo): self.ActivePlatform =3D MetaFile=0D self.ArchList =3D Arch=0D self.AutoGenObjectList =3D []=0D +=0D @property=0D def BuildDir(self):=0D return self.AutoGenObjectList[0].BuildDir=0D @@ -277,9 +287,11 @@ class WorkSpaceInfo(AutoGenInfo): @property=0D def FlashDefinition(self):=0D return self.AutoGenObjectList[0].Platform.FlashDefinition=0D +=0D @property=0D def GenFdsCommandDict(self):=0D - FdsCommandDict =3D self.AutoGenObjectList[0].DataPipe.Get("FdsComm= andDict")=0D + FdsCommandDict =3D self.AutoGenObjectList[0].DataPipe.Get(=0D + "FdsCommandDict")=0D if FdsCommandDict:=0D return FdsCommandDict=0D return {}=0D @@ -288,12 +300,15 @@ class WorkSpaceInfo(AutoGenInfo): def FvDir(self):=0D return os.path.join(self.BuildDir, TAB_FV_DIRECTORY)=0D =0D +=0D class PlatformInfo(AutoGenInfo):=0D - def __init__(self, Workspace, MetaFile, Target, ToolChain, Arch,DataPi= pe):=0D + def __init__(self, Workspace, MetaFile, Target, ToolChain, Arch, DataP= ipe):=0D if not hasattr(self, "_Init"):=0D - self.do_init(Workspace, MetaFile, Target, ToolChain, Arch,Data= Pipe)=0D + self.do_init(Workspace, MetaFile, Target,=0D + ToolChain, Arch, DataPipe)=0D self._Init =3D True=0D - def do_init(self,Workspace, MetaFile, Target, ToolChain, Arch,DataPipe= ):=0D +=0D + def do_init(self, Workspace, MetaFile, Target, ToolChain, Arch, DataPi= pe):=0D self.Wa =3D Workspace=0D self.WorkspaceDir =3D self.Wa.WorkspaceDir=0D self.MetaFile =3D MetaFile=0D @@ -301,10 +316,12 @@ class PlatformInfo(AutoGenInfo): self.Target =3D Target=0D self.BuildTarget =3D Target=0D self.ToolChain =3D ToolChain=0D - self.Platform =3D self.Wa.BuildDatabase[self.MetaFile, self.Arch, = self.Target, self.ToolChain]=0D + self.Platform =3D self.Wa.BuildDatabase[self.MetaFile,=0D + self.Arch, self.Target, self= .ToolChain]=0D =0D self.SourceDir =3D MetaFile.SubDir=0D self.DataPipe =3D DataPipe=0D +=0D @cached_property=0D def _AsBuildModuleList(self):=0D retVal =3D self.DataPipe.Get("AsBuildModuleList")=0D @@ -312,7 +329,7 @@ class PlatformInfo(AutoGenInfo): retVal =3D {}=0D return retVal=0D =0D - ## Test if a module is supported by the platform=0D + # Test if a module is supported by the platform=0D #=0D # An error will be raised directly if the module or its arch is not s= upported=0D # by the platform or current configuration=0D @@ -342,47 +359,48 @@ class PlatformInfo(AutoGenInfo): @cached_property=0D def PackageList(self):=0D RetVal =3D set()=0D - for dec_file,Arch in self.DataPipe.Get("PackageList"):=0D - RetVal.add(self.Wa.BuildDatabase[dec_file,Arch,self.BuildTarge= t, self.ToolChain])=0D + for dec_file, Arch in self.DataPipe.Get("PackageList"):=0D + RetVal.add(=0D + self.Wa.BuildDatabase[dec_file, Arch, self.BuildTarget, se= lf.ToolChain])=0D return list(RetVal)=0D =0D - ## Return the directory to store all intermediate and final files buil= t=0D + # Return the directory to store all intermediate and final files built= =0D @cached_property=0D def BuildDir(self):=0D if os.path.isabs(self.OutputDir):=0D RetVal =3D os.path.join(=0D - os.path.abspath(self.OutputDir),=0D - self.Target + "_" + self.ToolChain,=0D - )=0D + os.path.abspath(self.OutputDir),=0D + self.Target + "_" + self.ToolChain,=0D + )=0D else:=0D RetVal =3D os.path.join(=0D - self.WorkspaceDir,=0D - self.OutputDir,=0D - self.Target + "_" + self.ToolChain,=0D - )=0D + self.WorkspaceDir,=0D + self.OutputDir,=0D + self.Target + "_" + self.ToolChain,=0D + )=0D return RetVal=0D =0D - ## Return the build output directory platform specifies=0D + # Return the build output directory platform specifies=0D @cached_property=0D def OutputDir(self):=0D return self.Platform.OutputDirectory=0D =0D - ## Return platform name=0D + # Return platform name=0D @cached_property=0D def Name(self):=0D return self.Platform.PlatformName=0D =0D - ## Return meta-file GUID=0D + # Return meta-file GUID=0D @cached_property=0D def Guid(self):=0D return self.Platform.Guid=0D =0D - ## Return platform version=0D + # Return platform version=0D @cached_property=0D def Version(self):=0D return self.Platform.Version=0D =0D - ## Return paths of tools=0D + # Return paths of tools=0D @cached_property=0D def ToolDefinition(self):=0D retVal =3D self.DataPipe.Get("TOOLDEF")=0D @@ -390,7 +408,7 @@ class PlatformInfo(AutoGenInfo): retVal =3D {}=0D return retVal=0D =0D - ## Return build command string=0D + # Return build command string=0D #=0D # @retval string Build command string=0D #=0D @@ -408,7 +426,7 @@ class PlatformInfo(AutoGenInfo): retVal =3D {}=0D return retVal=0D =0D - ## Override PCD setting (type, value, ...)=0D + # Override PCD setting (type, value, ...)=0D #=0D # @param ToPcd The PCD to be overridden=0D # @param FromPcd The PCD overriding from=0D @@ -428,15 +446,16 @@ class PlatformInfo(AutoGenInfo): if ToPcd.Pending and FromPcd.Type:=0D ToPcd.Type =3D FromPcd.Type=0D elif ToPcd.Type and FromPcd.Type\=0D - and ToPcd.Type !=3D FromPcd.Type and ToPcd.Type in FromPcd= .Type:=0D + and ToPcd.Type !=3D FromPcd.Type and ToPcd.Type in Fro= mPcd.Type:=0D if ToPcd.Type.strip() =3D=3D TAB_PCDS_DYNAMIC_EX:=0D ToPcd.Type =3D FromPcd.Type=0D elif ToPcd.Type and FromPcd.Type \=0D - and ToPcd.Type !=3D FromPcd.Type:=0D + and ToPcd.Type !=3D FromPcd.Type:=0D if Library:=0D - Module =3D str(Module) + " 's library file (" + str(Li= brary) + ")"=0D + Module =3D str(Module) + \=0D + " 's library file (" + str(Library) + ")"=0D EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD = type",=0D - ExtraData=3D"%s.%s is used as [%s] in modu= le %s, but as [%s] in %s."\=0D + ExtraData=3D"%s.%s is used as [%s] in modu= le %s, but as [%s] in %s."=0D % (ToPcd.TokenSpaceGuidCName, To= kenCName,=0D ToPcd.Type, Module, FromPcd.T= ype, Msg),=0D File=3Dself.MetaFile)=0D @@ -457,10 +476,11 @@ class PlatformInfo(AutoGenInfo): # Add Flexible PCD format parse=0D if ToPcd.DefaultValue:=0D try:=0D - ToPcd.DefaultValue =3D ValueExpressionEx(ToPcd.Default= Value, ToPcd.DatumType, self._GuidDict)(True)=0D + ToPcd.DefaultValue =3D ValueExpressionEx(=0D + ToPcd.DefaultValue, ToPcd.DatumType, self._GuidDic= t)(True)=0D except BadExpression as Value:=0D - EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s]= Value "%s", %s' %(ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.Defau= ltValue, Value),=0D - File=3Dself.MetaFile)=0D + EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s]= Value "%s", %s' % (ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.Defa= ultValue, Value),=0D + File=3Dself.MetaFile)=0D =0D # check the validation of datum=0D IsValid, Cause =3D CheckPcdDatum(ToPcd.DatumType, ToPcd.Defaul= tValue)=0D @@ -473,7 +493,7 @@ class PlatformInfo(AutoGenInfo): ToPcd.CustomAttribute =3D FromPcd.CustomAttribute=0D =0D if FromPcd is not None and ToPcd.DatumType =3D=3D TAB_VOID and not= ToPcd.MaxDatumSize:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified = for PCD %s.%s" \=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified = for PCD %s.%s"=0D % (ToPcd.TokenSpaceGuidCName, TokenCName))=0D Value =3D ToPcd.DefaultValue=0D if not Value:=0D @@ -487,18 +507,19 @@ class PlatformInfo(AutoGenInfo): =0D # apply default SKU for dynamic PCDS if specified one is not avail= able=0D if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMI= C_EX_TYPE_SET) \=0D - and not ToPcd.SkuInfoList:=0D + and not ToPcd.SkuInfoList:=0D if self.Platform.SkuName in self.Platform.SkuIds:=0D SkuName =3D self.Platform.SkuName=0D else:=0D SkuName =3D TAB_DEFAULT=0D ToPcd.SkuInfoList =3D {=0D - SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuNa= me][0], '', '', '', '', '', ToPcd.DefaultValue)=0D + SkuName: SkuInfoClass(=0D + SkuName, self.Platform.SkuIds[SkuName][0], '', '', '',= '', '', ToPcd.DefaultValue)=0D }=0D =0D def ApplyPcdSetting(self, Ma, Pcds, Library=3D""):=0D # for each PCD in module=0D - Module=3DMa.Module=0D + Module =3D Ma.Module=0D for Name, Guid in Pcds:=0D PcdInModule =3D Pcds[Name, Guid]=0D # find out the PCD setting in platform=0D @@ -507,34 +528,40 @@ class PlatformInfo(AutoGenInfo): else:=0D PcdInPlatform =3D None=0D # then override the settings if any=0D - self._OverridePcd(PcdInModule, PcdInPlatform, Module, Msg=3D"D= SC PCD sections", Library=3DLibrary)=0D + self._OverridePcd(PcdInModule, PcdInPlatform,=0D + Module, Msg=3D"DSC PCD sections", Library=3D= Library)=0D # resolve the VariableGuid value=0D for SkuId in PcdInModule.SkuInfoList:=0D Sku =3D PcdInModule.SkuInfoList[SkuId]=0D - if Sku.VariableGuid =3D=3D '': continue=0D - Sku.VariableGuidValue =3D GuidValue(Sku.VariableGuid, self= .PackageList, self.MetaFile.Path)=0D + if Sku.VariableGuid =3D=3D '':=0D + continue=0D + Sku.VariableGuidValue =3D GuidValue(=0D + Sku.VariableGuid, self.PackageList, self.MetaFile.Path= )=0D if Sku.VariableGuidValue is None:=0D PackageList =3D "\n\t".join(str(P) for P in self.Packa= geList)=0D EdkLogger.error(=0D - 'build',=0D - RESOURCE_NOT_AVAILABLE,=0D - "Value of GUID [%s] is not found in" % Sku= .VariableGuid,=0D - ExtraData=3DPackageList + "\n\t(used with = %s.%s from module %s)" \=0D - % (Guid, Name, str= (Module)),=0D - File=3Dself.MetaFile=0D - )=0D + 'build',=0D + RESOURCE_NOT_AVAILABLE,=0D + "Value of GUID [%s] is not found in" % Sku.Variabl= eGuid,=0D + ExtraData=3DPackageList +=0D + "\n\t(used with %s.%s from module %s)"=0D + % (Guid, Name, str(Module)),=0D + File=3Dself.MetaFile=0D + )=0D =0D # override PCD settings with module specific setting=0D ModuleScopePcds =3D self.DataPipe.Get("MOL_PCDS")=0D if Module in self.Platform.Modules:=0D PlatformModule =3D self.Platform.Modules[str(Module)]=0D - PCD_DATA =3D ModuleScopePcds.get(Ma.Guid,{})=0D - mPcds =3D {(pcd.TokenCName,pcd.TokenSpaceGuidCName): pcd for p= cd in PCD_DATA}=0D - for Key in mPcds:=0D + PCD_DATA =3D ModuleScopePcds.get(Ma.Guid, {})=0D + mPcds =3D {(pcd.TokenCName, pcd.TokenSpaceGuidCName)=0D + : pcd for pcd in PCD_DATA}=0D + for Key in mPcds:=0D if self.BuildOptionPcd:=0D for pcd in self.BuildOptionPcd:=0D - (TokenSpaceGuidCName, TokenCName, FieldName, pcdva= lue, _) =3D pcd=0D - if (TokenCName, TokenSpaceGuidCName) =3D=3D Key an= d FieldName =3D=3D"":=0D + (TokenSpaceGuidCName, TokenCName,=0D + FieldName, pcdvalue, _) =3D pcd=0D + if (TokenCName, TokenSpaceGuidCName) =3D=3D Key an= d FieldName =3D=3D "":=0D PlatformModule.Pcds[Key].DefaultValue =3D pcdv= alue=0D PlatformModule.Pcds[Key].PcdValueFromComm =3D = pcdvalue=0D break=0D @@ -549,7 +576,8 @@ class PlatformInfo(AutoGenInfo): Flag =3D True=0D break=0D if Flag:=0D - self._OverridePcd(ToPcd, mPcds[Key], Module, Msg=3D"DS= C Components Module scoped PCD section", Library=3DLibrary)=0D + self._OverridePcd(=0D + ToPcd, mPcds[Key], Module, Msg=3D"DSC Components M= odule scoped PCD section", Library=3DLibrary)=0D # use PCD value to calculate the MaxDatumSize when it is not speci= fied=0D for Name, Guid in Pcds:=0D Pcd =3D Pcds[Name, Guid]=0D @@ -572,9 +600,9 @@ class PlatformInfo(AutoGenInfo): # for pcd in PlatformPcdData:=0D # for skuid in pcd.SkuInfoList:=0D # pcd.SkuInfoList[skuid] =3D self.CreateSkuInfoFromDict(pc= d.SkuInfoList[skuid])=0D - return {(pcddata.TokenCName,pcddata.TokenSpaceGuidCName):pcddata f= or pcddata in PlatformPcdData}=0D + return {(pcddata.TokenCName, pcddata.TokenSpaceGuidCName): pcddata= for pcddata in PlatformPcdData}=0D =0D - def CreateSkuInfoFromDict(self,SkuInfoDict):=0D + def CreateSkuInfoFromDict(self, SkuInfoDict):=0D return SkuInfoClass(=0D SkuInfoDict.get("SkuIdName"),=0D SkuInfoDict.get("SkuId"),=0D @@ -585,27 +613,33 @@ class PlatformInfo(AutoGenInfo): SkuInfoDict.get("VpdOffset"),=0D SkuInfoDict.get("DefaultValue"),=0D SkuInfoDict.get("VariableGuidValue"),=0D - SkuInfoDict.get("VariableAttribute",""),=0D - SkuInfoDict.get("DefaultStore",None)=0D - )=0D + SkuInfoDict.get("VariableAttribute", ""),=0D + SkuInfoDict.get("DefaultStore", None)=0D + )=0D +=0D @cached_property=0D def MixedPcd(self):=0D return self.DataPipe.Get("MixedPcd")=0D +=0D @cached_property=0D def _GuidDict(self):=0D RetVal =3D self.DataPipe.Get("GuidDict")=0D if RetVal is None:=0D RetVal =3D {}=0D return RetVal=0D +=0D @cached_property=0D def BuildOptionPcd(self):=0D return self.DataPipe.Get("BuildOptPcd")=0D - def ApplyBuildOption(self,module):=0D +=0D + def ApplyBuildOption(self, module):=0D PlatformOptions =3D self.DataPipe.Get("PLA_BO")=0D ModuleBuildOptions =3D self.DataPipe.Get("MOL_BO")=0D - ModuleOptionFromDsc =3D ModuleBuildOptions.get((module.MetaFile.Fi= le,module.MetaFile.Root))=0D + ModuleOptionFromDsc =3D ModuleBuildOptions.get(=0D + (module.MetaFile.File, module.MetaFile.Root))=0D if ModuleOptionFromDsc:=0D - ModuleTypeOptions, PlatformModuleOptions =3D ModuleOptionFromD= sc["ModuleTypeOptions"],ModuleOptionFromDsc["PlatformModuleOptions"]=0D + ModuleTypeOptions, PlatformModuleOptions =3D ModuleOptionFromD= sc[=0D + "ModuleTypeOptions"], ModuleOptionFromDsc["PlatformModuleO= ptions"]=0D else:=0D ModuleTypeOptions, PlatformModuleOptions =3D {}, {}=0D ToolDefinition =3D self.DataPipe.Get("TOOLDEF")=0D @@ -639,29 +673,34 @@ class PlatformInfo(AutoGenInfo): for ExpandedTool in ToolList:=0D # check if override is indicated=0D if Value.startswith('=3D'):=0D - BuildOptions[ExpandedTool][Attr] =3D mws.handl= eWsMacro(Value[1:])=0D + BuildOptions[ExpandedTool][Attr] =3D mws.handl= eWsMacro(=0D + Value[1:])=0D else:=0D if Attr !=3D 'PATH':=0D - BuildOptions[ExpandedTool][Attr] +=3D " " = + mws.handleWsMacro(Value)=0D + BuildOptions[ExpandedTool][Attr] +=3D " " = + \=0D + mws.handleWsMacro(Value)=0D else:=0D - BuildOptions[ExpandedTool][Attr] =3D mws.h= andleWsMacro(Value)=0D + BuildOptions[ExpandedTool][Attr] =3D mws.h= andleWsMacro(=0D + Value)=0D =0D return BuildOptions, BuildRuleOrder=0D =0D - def ApplyLibraryInstance(self,module):=0D + def ApplyLibraryInstance(self, module):=0D alldeps =3D self.DataPipe.Get("DEPS")=0D if alldeps is None:=0D alldeps =3D {}=0D - mod_libs =3D alldeps.get((module.MetaFile.File,module.MetaFile.Roo= t,module.Arch,module.MetaFile.Path),[])=0D + mod_libs =3D alldeps.get(=0D + (module.MetaFile.File, module.MetaFile.Root, module.Arch, modu= le.MetaFile.Path), [])=0D retVal =3D []=0D - for (file_path,root,arch,abs_path) in mod_libs:=0D - libMetaFile =3D PathClass(file_path,root)=0D - libMetaFile.OriginalPath =3D PathClass(file_path,root)=0D + for (file_path, root, arch, abs_path) in mod_libs:=0D + libMetaFile =3D PathClass(file_path, root)=0D + libMetaFile.OriginalPath =3D PathClass(file_path, root)=0D libMetaFile.Path =3D abs_path=0D - retVal.append(self.Wa.BuildDatabase[libMetaFile, arch, self.Ta= rget,self.ToolChain])=0D + retVal.append(=0D + self.Wa.BuildDatabase[libMetaFile, arch, self.Target, self= .ToolChain])=0D return retVal=0D =0D - ## Parse build_rule.txt in Conf Directory.=0D + # Parse build_rule.txt in Conf Directory.=0D #=0D # @retval BuildRule object=0D #=0D diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools= /Source/Python/AutoGen/PlatformAutoGen.py index 592d4824a4b3..292466053c9c 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
        =0D @@ -6,7 +6,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import print_function=0D from __future__ import absolute_import=0D @@ -14,7 +14,7 @@ import os.path as path import copy=0D from collections import defaultdict=0D =0D -from .BuildEngine import BuildRule,gDefaultBuildRuleFile,AutoGenReqBuildRu= leVerNum=0D +from .BuildEngine import BuildRule, gDefaultBuildRuleFile, AutoGenReqBuild= RuleVerNum=0D from .GenVar import VariableMgr, var_info=0D from . import GenMake=0D from AutoGen.DataPipe import MemoryDataPipe=0D @@ -25,17 +25,19 @@ from Workspace.WorkspaceCommon import GetModuleLibInsta= nces from CommonDataClass.CommonClass import SkuInfoClass=0D from Common.caching import cached_class_function=0D from Common.Expression import ValueExpressionEx=0D -from Common.StringUtils import StringToArray,NormPath=0D +from Common.StringUtils import StringToArray, NormPath=0D from Common.BuildToolError import *=0D from Common.DataType import *=0D from Common.Misc import *=0D import Common.VpdInfoFile as VpdInfoFile=0D =0D -## Split command line option string to list=0D +# Split command line option string to list=0D #=0D # subprocess.Popen needs the args to be a sequence. Otherwise there's prob= lem=0D # in non-windows platform to launch command=0D #=0D +=0D +=0D def _SplitOption(OptionString):=0D OptionList =3D []=0D LastChar =3D " "=0D @@ -60,11 +62,13 @@ def _SplitOption(OptionString): OptionList.append(OptionString[OptionStart:])=0D return OptionList=0D =0D -## AutoGen class for platform=0D +# AutoGen class for platform=0D #=0D # PlatformAutoGen class will process the original information in platform= =0D # file in order to generate makefile for platform.=0D #=0D +=0D +=0D class PlatformAutoGen(AutoGen):=0D # call super().__init__ then call the worker function with different p= arameter count=0D def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args= , **kwargs):=0D @@ -79,9 +83,7 @@ class PlatformAutoGen(AutoGen): _NonDynaPcdList_ =3D []=0D _PlatformPcds =3D {}=0D =0D -=0D -=0D - ## Initialize PlatformAutoGen=0D + # Initialize PlatformAutoGen=0D #=0D #=0D # @param Workspace WorkspaceAutoGen object=0D @@ -90,9 +92,12 @@ class PlatformAutoGen(AutoGen): # @param Toolchain Name of tool chain=0D # @param Arch arch of the platform supports=0D #=0D +=0D def _InitWorker(self, Workspace, PlatformFile, Target, Toolchain, Arch= ):=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "AutoGen platform [%s] [%s]" % = (PlatformFile, Arch))=0D - GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (PlatformFile, = Arch, Toolchain, Target)=0D + EdkLogger.debug(EdkLogger.DEBUG_9,=0D + "AutoGen platform [%s] [%s]" % (PlatformFile, Arch= ))=0D + GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (=0D + PlatformFile, Arch, Toolchain, Target)=0D =0D self.MetaFile =3D PlatformFile=0D self.Workspace =3D Workspace=0D @@ -111,8 +116,10 @@ class PlatformAutoGen(AutoGen): # indicating whether the file has been created.=0D self.MakeFileName =3D ""=0D =0D - self._DynamicPcdList =3D None # [(TokenCName1, TokenSpaceGuidCN= ame1), (TokenCName2, TokenSpaceGuidCName2), ...]=0D - self._NonDynamicPcdList =3D None # [(TokenCName1, TokenSpaceGuidCN= ame1), (TokenCName2, TokenSpaceGuidCName2), ...]=0D + # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGu= idCName2), ...]=0D + self._DynamicPcdList =3D None=0D + # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGu= idCName2), ...]=0D + self._NonDynamicPcdList =3D None=0D =0D self._AsBuildInfList =3D []=0D self._AsBuildModuleList =3D []=0D @@ -122,8 +129,10 @@ class PlatformAutoGen(AutoGen): if GlobalData.gFdfParser is not None:=0D self._AsBuildInfList =3D GlobalData.gFdfParser.Profile.InfList= =0D for Inf in self._AsBuildInfList:=0D - InfClass =3D PathClass(NormPath(Inf), GlobalData.gWorkspac= e, self.Arch)=0D - M =3D self.BuildDatabase[InfClass, self.Arch, self.BuildTa= rget, self.ToolChain]=0D + InfClass =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, self.Arch)=0D + M =3D self.BuildDatabase[InfClass, self.Arch,=0D + self.BuildTarget, self.ToolChain]=0D if not M.IsBinaryModule:=0D continue=0D self._AsBuildModuleList.append(InfClass)=0D @@ -135,27 +144,31 @@ class PlatformAutoGen(AutoGen): self.DataPipe.FillData(self)=0D =0D return True=0D +=0D def FillData_LibConstPcd(self):=0D libConstPcd =3D {}=0D for LibAuto in self.LibraryAutoGenList:=0D if LibAuto.ConstPcd:=0D - libConstPcd[(LibAuto.MetaFile.File,LibAuto.MetaFile.Root,L= ibAuto.Arch,LibAuto.MetaFile.Path)] =3D LibAuto.ConstPcd=0D - self.DataPipe.DataContainer =3D {"LibConstPcd":libConstPcd}=0D - ## hash() operator of PlatformAutoGen=0D + libConstPcd[(LibAuto.MetaFile.File, LibAuto.MetaFile.Root,= =0D + LibAuto.Arch, LibAuto.MetaFile.Path)] =3D Lib= Auto.ConstPcd=0D + self.DataPipe.DataContainer =3D {"LibConstPcd": libConstPcd}=0D + # hash() operator of PlatformAutoGen=0D #=0D # The platform file path and arch string will be used to represent=0D # hash value of this object=0D #=0D # @retval int Hash value of the platform file path and arch=0D #=0D +=0D @cached_class_function=0D def __hash__(self):=0D - return hash((self.MetaFile, self.Arch,self.ToolChain,self.BuildTar= get))=0D + return hash((self.MetaFile, self.Arch, self.ToolChain, self.BuildT= arget))=0D +=0D @cached_class_function=0D def __repr__(self):=0D return "%s [%s]" % (self.MetaFile, self.Arch)=0D =0D - ## Create autogen code for platform and modules=0D + # Create autogen code for platform and modules=0D #=0D # Since there's no autogen code for platform, this method will do not= hing=0D # if CreateModuleCodeFile is set to False.=0D @@ -172,17 +185,17 @@ class PlatformAutoGen(AutoGen): for Ma in self.ModuleAutoGenList:=0D Ma.CreateCodeFile(CreateModuleCodeFile)=0D =0D - ## Generate Fds Command=0D + # Generate Fds Command=0D @cached_property=0D def GenFdsCommand(self):=0D return self.Workspace.GenFdsCommand=0D =0D - ## Create makefile for the platform and modules in it=0D + # Create makefile for the platform and modules in it=0D #=0D # @param CreateModuleMakeFile Flag indicating if the makefil= e for=0D # modules will be created as wel= l=0D #=0D - def CreateMakeFile(self, CreateModuleMakeFile=3DFalse, FfsCommand =3D = {}):=0D + def CreateMakeFile(self, CreateModuleMakeFile=3DFalse, FfsCommand=3D{}= ):=0D if CreateModuleMakeFile:=0D for Ma in self._MaList:=0D key =3D (Ma.MetaFile.File, self.Arch)=0D @@ -206,8 +219,9 @@ class PlatformAutoGen(AutoGen): @property=0D def AllPcdList(self):=0D return self.DynamicPcdList + self.NonDynamicPcdList=0D - ## Deal with Shared FixedAtBuild Pcds=0D + # Deal with Shared FixedAtBuild Pcds=0D #=0D +=0D def CollectFixedAtBuildPcds(self):=0D for LibAuto in self.LibraryAutoGenList:=0D FixedAtBuildPcds =3D {}=0D @@ -231,7 +245,8 @@ class PlatformAutoGen(AutoGen): if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in self.N= onDynamicPcdDict:=0D continue=0D else:=0D - DscPcd =3D self.NonDynamicPcdDict[(Pcd.TokenCName, Pcd= .TokenSpaceGuidCName)]=0D + DscPcd =3D self.NonDynamicPcdDict[(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuidCName)]=0D if DscPcd.Type !=3D TAB_PCDS_FIXED_AT_BUILD:=0D continue=0D if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtB= uildPcdsSameValue[key]:=0D @@ -249,7 +264,8 @@ class PlatformAutoGen(AutoGen): VpdRegionBase =3D FdRegion.Offset=0D break=0D =0D - VariableInfo =3D VariableMgr(self.DscBuildDataObj._GetDefaultStore= s(), self.DscBuildDataObj.SkuIds)=0D + VariableInfo =3D VariableMgr(=0D + self.DscBuildDataObj._GetDefaultStores(), self.DscBuildDataObj= .SkuIds)=0D VariableInfo.SetVpdRegionMaxSize(VpdRegionSize)=0D VariableInfo.SetVpdRegionOffset(VpdRegionBase)=0D Index =3D 0=0D @@ -264,40 +280,52 @@ class PlatformAutoGen(AutoGen): if Sku.VariableAttribute and 'NV' not in Sku.VariableA= ttribute:=0D continue=0D VariableGuidStructure =3D Sku.VariableGuidValue=0D - VariableGuid =3D GuidStructureStringToGuidString(Varia= bleGuidStructure)=0D + VariableGuid =3D GuidStructureStringToGuidString(=0D + VariableGuidStructure)=0D for StorageName in Sku.DefaultStoreDict:=0D - VariableInfo.append_variable(var_info(Index, pcdna= me, StorageName, SkuName, StringToArray(Sku.VariableName), VariableGuid, Sk= u.VariableOffset, Sku.VariableAttribute, Sku.HiiDefaultValue, Sku.DefaultSt= oreDict[StorageName] if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES else StringT= oArray(Sku.DefaultStoreDict[StorageName]), Pcd.DatumType, Pcd.CustomAttribu= te['DscPosition'], Pcd.CustomAttribute.get('IsStru',False)))=0D + VariableInfo.append_variable(var_info(Index, pcdna= me, StorageName, SkuName, StringToArray(Sku.VariableName), VariableGuid, Sk= u.VariableOffset, Sku.VariableAttribute, Sku.HiiDefaultValue, Sku.DefaultSt= oreDict[=0D + StorageName] if Pcd.D= atumType in TAB_PCD_NUMERIC_TYPES else StringToArray(Sku.DefaultStoreDict[S= torageName]), Pcd.DatumType, Pcd.CustomAttribute['DscPosition'], Pcd.Custom= Attribute.get('IsStru', False)))=0D Index +=3D 1=0D return VariableInfo=0D =0D def UpdateNVStoreMaxSize(self, OrgVpdFile):=0D if self.VariableInfo:=0D - VpdMapFilePath =3D os.path.join(self.BuildDir, TAB_FV_DIRECTOR= Y, "%s.map" % self.Platform.VpdToolGuid)=0D - PcdNvStoreDfBuffer =3D [item for item in self._DynamicPcdList = if item.TokenCName =3D=3D "PcdNvStoreDefaultValueBuffer" and item.TokenSpac= eGuidCName =3D=3D "gEfiMdeModulePkgTokenSpaceGuid"]=0D + VpdMapFilePath =3D os.path.join(=0D + self.BuildDir, TAB_FV_DIRECTORY, "%s.map" % self.Platform.= VpdToolGuid)=0D + PcdNvStoreDfBuffer =3D [item for item in self._DynamicPcdList = if item.TokenCName =3D=3D=0D + "PcdNvStoreDefaultValueBuffer" and item.= TokenSpaceGuidCName =3D=3D "gEfiMdeModulePkgTokenSpaceGuid"]=0D =0D if PcdNvStoreDfBuffer:=0D try:=0D OrgVpdFile.Read(VpdMapFilePath)=0D PcdItems =3D OrgVpdFile.GetOffset(PcdNvStoreDfBuffer[0= ])=0D - NvStoreOffset =3D list(PcdItems.values())[0].strip() i= f PcdItems else '0'=0D + NvStoreOffset =3D list(PcdItems.values())[=0D + 0].strip() if PcdItems else '0'=0D except:=0D - EdkLogger.error("build", FILE_READ_FAILURE, "Can not f= ind VPD map file %s to fix up VPD offset." % VpdMapFilePath)=0D + EdkLogger.error(=0D + "build", FILE_READ_FAILURE, "Can not find VPD map = file %s to fix up VPD offset." % VpdMapFilePath)=0D =0D - NvStoreOffset =3D int(NvStoreOffset, 16) if NvStoreOffset.= upper().startswith("0X") else int(NvStoreOffset)=0D - default_skuobj =3D PcdNvStoreDfBuffer[0].SkuInfoList.get(T= AB_DEFAULT)=0D - maxsize =3D self.VariableInfo.VpdRegionSize - NvStoreOffs= et if self.VariableInfo.VpdRegionSize else len(default_skuobj.DefaultValue.= split(","))=0D - var_data =3D self.VariableInfo.PatchNVStoreDefaultMaxSize(= maxsize)=0D + NvStoreOffset =3D int(NvStoreOffset, 16) if NvStoreOffset.= upper(=0D + ).startswith("0X") else int(NvStoreOffset)=0D + default_skuobj =3D PcdNvStoreDfBuffer[0].SkuInfoList.get(= =0D + TAB_DEFAULT)=0D + maxsize =3D self.VariableInfo.VpdRegionSize - \=0D + NvStoreOffset if self.VariableInfo.VpdRegionSize else = len(=0D + default_skuobj.DefaultValue.split(","))=0D + var_data =3D self.VariableInfo.PatchNVStoreDefaultMaxSize(= =0D + maxsize)=0D =0D if var_data and default_skuobj:=0D default_skuobj.DefaultValue =3D var_data=0D PcdNvStoreDfBuffer[0].DefaultValue =3D var_data=0D PcdNvStoreDfBuffer[0].SkuInfoList.clear()=0D PcdNvStoreDfBuffer[0].SkuInfoList[TAB_DEFAULT] =3D def= ault_skuobj=0D - PcdNvStoreDfBuffer[0].MaxDatumSize =3D str(len(default= _skuobj.DefaultValue.split(",")))=0D + PcdNvStoreDfBuffer[0].MaxDatumSize =3D str(=0D + len(default_skuobj.DefaultValue.split(",")))=0D =0D return OrgVpdFile=0D =0D - ## Collect dynamic PCDs=0D + # Collect dynamic PCDs=0D #=0D # Gather dynamic PCDs list from each module and their settings from p= latform=0D # This interface should be invoked explicitly when platform action is= created.=0D @@ -315,23 +343,26 @@ class PlatformAutoGen(AutoGen): InfName =3D mws.join(self.WorkspaceDir, InfName)=0D FdfModuleList.append(os.path.normpath(InfName))=0D for M in self._MbList:=0D -# F is the Module for which M is the module autogen=0D + # F is the Module for which M is the module autogen= =0D ModPcdList =3D self.ApplyPcdSetting(M, M.ModulePcdList)=0D LibPcdList =3D []=0D for lib in M.LibraryPcdList:=0D - LibPcdList.extend(self.ApplyPcdSetting(M, M.LibraryPcdList= [lib], lib))=0D + LibPcdList.extend(self.ApplyPcdSetting(=0D + M, M.LibraryPcdList[lib], lib))=0D for PcdFromModule in ModPcdList + LibPcdList:=0D =0D # make sure that the "VOID*" kind of datum has MaxDatumSiz= e set=0D if PcdFromModule.DatumType =3D=3D TAB_VOID and not PcdFrom= Module.MaxDatumSize:=0D - NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModule.T= okenSpaceGuidCName, PcdFromModule.TokenCName, M.MetaFile))=0D + NoDatumTypePcdList.add("%s.%s [%s]" % (=0D + PcdFromModule.TokenSpaceGuidCName, PcdFromModule.T= okenCName, M.MetaFile))=0D =0D # Check the PCD from Binary INF or Source INF=0D if M.IsBinaryModule =3D=3D True:=0D PcdFromModule.IsFromBinaryInf =3D True=0D =0D # Check the PCD from DSC or not=0D - PcdFromModule.IsFromDsc =3D (PcdFromModule.TokenCName, Pcd= FromModule.TokenSpaceGuidCName) in self.Platform.Pcds=0D + PcdFromModule.IsFromDsc =3D (=0D + PcdFromModule.TokenCName, PcdFromModule.TokenSpaceGuid= CName) in self.Platform.Pcds=0D =0D if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET or PcdFromMo= dule.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D if M.MetaFile.Path not in FdfModuleList:=0D @@ -344,7 +375,7 @@ class PlatformAutoGen(AutoGen): # PCD will not be added into the Database unless i= t is used by other=0D # modules that are included in the FDF file.=0D if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET and = \=0D - PcdFromModule.IsFromBinaryInf =3D=3D False:=0D + PcdFromModule.IsFromBinaryInf =3D=3D False= :=0D # Print warning message to let the developer m= ake a determine.=0D continue=0D # If one of the Source built modules listed in the= DSC is not listed in=0D @@ -373,16 +404,19 @@ class PlatformAutoGen(AutoGen): elif PcdFromModule in self._NonDynaPcdList_ and PcdFromMod= ule.IsFromBinaryInf =3D=3D True:=0D Index =3D self._NonDynaPcdList_.index(PcdFromModule)=0D if self._NonDynaPcdList_[Index].IsFromBinaryInf =3D=3D= False:=0D - #The PCD from Binary INF will override the same on= e from source INF=0D - self._NonDynaPcdList_.remove (self._NonDynaPcdList= _[Index])=0D + # The PCD from Binary INF will override the same o= ne from source INF=0D + self._NonDynaPcdList_.remove(=0D + self._NonDynaPcdList_[Index])=0D PcdFromModule.Pending =3D False=0D - self._NonDynaPcdList_.append (PcdFromModule)=0D - DscModuleSet =3D {os.path.normpath(ModuleInf.Path) for ModuleInf i= n self.Platform.Modules}=0D + self._NonDynaPcdList_.append(PcdFromModule)=0D + DscModuleSet =3D {os.path.normpath(ModuleInf.Path)=0D + for ModuleInf in self.Platform.Modules}=0D # add the PCD from modules that listed in FDF but not in DSC to Da= tabase=0D for InfName in FdfModuleList:=0D if InfName not in DscModuleSet:=0D InfClass =3D PathClass(InfName)=0D - M =3D self.BuildDatabase[InfClass, self.Arch, self.BuildTa= rget, self.ToolChain]=0D + M =3D self.BuildDatabase[InfClass, self.Arch,=0D + self.BuildTarget, self.ToolChain]=0D # If a module INF in FDF but not in current arch's DSC mod= ule list, it must be module (either binary or source)=0D # for different Arch. PCDs in source module for different = Arch is already added before, so skip the source module here.=0D # For binary module, if in current arch, we need to list t= he PCDs into database.=0D @@ -401,7 +435,8 @@ class PlatformAutoGen(AutoGen): % (PcdFromModule.Type, PcdFromModu= le.TokenCName, InfName))=0D # make sure that the "VOID*" kind of datum has MaxDatu= mSize set=0D if PcdFromModule.DatumType =3D=3D TAB_VOID and not Pcd= FromModule.MaxDatumSize:=0D - NoDatumTypePcdList.add("%s.%s [%s]" % (PcdFromModu= le.TokenSpaceGuidCName, PcdFromModule.TokenCName, InfName))=0D + NoDatumTypePcdList.add("%s.%s [%s]" % (=0D + PcdFromModule.TokenSpaceGuidCName, PcdFromModu= le.TokenCName, InfName))=0D if M.ModuleType in SUP_MODULE_SET_PEI:=0D PcdFromModule.Phase =3D "PEI"=0D if PcdFromModule not in self._DynaPcdList_ and PcdFrom= Module.Type in PCD_DYNAMIC_EX_TYPE_SET:=0D @@ -429,11 +464,11 @@ class PlatformAutoGen(AutoGen): continue=0D Index =3D self._DynaPcdList_.index(PcdFromModule)=0D if PcdFromModule.IsFromDsc =3D=3D False and \=0D - PcdFromModule.Type in TAB_PCDS_PATCHABLE_IN_MODULE and \=0D - PcdFromModule.IsFromBinaryInf =3D=3D True and \=0D - self._DynaPcdList_[Index].IsFromBinaryInf =3D=3D False:=0D + PcdFromModule.Type in TAB_PCDS_PATCHABLE_IN_MODULE and= \=0D + PcdFromModule.IsFromBinaryInf =3D=3D True and \=0D + self._DynaPcdList_[Index].IsFromBinaryInf =3D=3D False= :=0D Index =3D self._DynaPcdList_.index(PcdFromModule)=0D - self._DynaPcdList_.remove (self._DynaPcdList_[Index])=0D + self._DynaPcdList_.remove(self._DynaPcdList_[Index])=0D =0D # print out error information and break the build, if error found= =0D if len(NoDatumTypePcdList) > 0:=0D @@ -455,10 +490,10 @@ class PlatformAutoGen(AutoGen): # The reason of sorting is make sure the unicode string is in doub= le-byte alignment in string table.=0D #=0D UnicodePcdArray =3D set()=0D - HiiPcdArray =3D set()=0D - OtherPcdArray =3D set()=0D - VpdPcdDict =3D {}=0D - VpdFile =3D VpdInfoFile.VpdInfoFile()=0D + HiiPcdArray =3D set()=0D + OtherPcdArray =3D set()=0D + VpdPcdDict =3D {}=0D + VpdFile =3D VpdInfoFile.VpdInfoFile()=0D NeedProcessVpdMapFile =3D False=0D =0D for pcd in self.Platform.Pcds:=0D @@ -483,27 +518,31 @@ class PlatformAutoGen(AutoGen): if Pcd.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_= VPD]:=0D VpdPcdDict[(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)] = =3D Pcd=0D =0D - #Collect DynamicHii PCD values and assign it to DynamicExVpd P= CD gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer=0D - PcdNvStoreDfBuffer =3D VpdPcdDict.get(("PcdNvStoreDefaultValue= Buffer", "gEfiMdeModulePkgTokenSpaceGuid"))=0D + # Collect DynamicHii PCD values and assign it to DynamicExVpd = PCD gEfiMdeModulePkgTokenSpaceGuid.PcdNvStoreDefaultValueBuffer=0D + PcdNvStoreDfBuffer =3D VpdPcdDict.get(=0D + ("PcdNvStoreDefaultValueBuffer", "gEfiMdeModulePkgTokenSpa= ceGuid"))=0D if PcdNvStoreDfBuffer:=0D self.VariableInfo =3D self.CollectVariables(self._DynamicP= cdList)=0D vardump =3D self.VariableInfo.dump()=0D if vardump:=0D #=0D - #According to PCD_DATABASE_INIT in edk2\MdeModulePkg\I= nclude\Guid\PcdDataBaseSignatureGuid.h,=0D - #the max size for string PCD should not exceed USHRT_M= AX 65535(0xffff).=0D - #typedef UINT16 SIZE_INFO;=0D - #//SIZE_INFO SizeTable[];=0D + # According to PCD_DATABASE_INIT in edk2\MdeModulePkg\= Include\Guid\PcdDataBaseSignatureGuid.h,=0D + # the max size for string PCD should not exceed USHRT_= MAX 65535(0xffff).=0D + # typedef UINT16 SIZE_INFO;=0D + # //SIZE_INFO SizeTable[];=0D if len(vardump.split(",")) > 0xffff:=0D - EdkLogger.error("build", RESOURCE_OVERFLOW, 'The c= urrent length of PCD %s value is %d, it exceeds to the max size of String P= CD.' %(".".join([PcdNvStoreDfBuffer.TokenSpaceGuidCName,PcdNvStoreDfBuffer.= TokenCName]) ,len(vardump.split(","))))=0D + EdkLogger.error("build", RESOURCE_OVERFLOW, 'The c= urrent length of PCD %s value is %d, it exceeds to the max size of String P= CD.' % (=0D + ".".join([PcdNvStoreDfBuffer.TokenSpaceGuidCNa= me, PcdNvStoreDfBuffer.TokenCName]), len(vardump.split(","))))=0D PcdNvStoreDfBuffer.DefaultValue =3D vardump=0D for skuname in PcdNvStoreDfBuffer.SkuInfoList:=0D PcdNvStoreDfBuffer.SkuInfoList[skuname].DefaultVal= ue =3D vardump=0D - PcdNvStoreDfBuffer.MaxDatumSize =3D str(len(vardum= p.split(",")))=0D + PcdNvStoreDfBuffer.MaxDatumSize =3D str(=0D + len(vardump.split(",")))=0D else:=0D - #If the end user define [DefaultStores] and [XXX.Menufactu= ring] in DSC, but forget to configure PcdNvStoreDefaultValueBuffer to PcdsD= ynamicVpd=0D + # If the end user define [DefaultStores] and [XXX.Menufact= uring] in DSC, but forget to configure PcdNvStoreDefaultValueBuffer to Pcds= DynamicVpd=0D if [Pcd for Pcd in self._DynamicPcdList if Pcd.UserDefined= DefaultStoresFlag]:=0D - EdkLogger.warn("build", "PcdNvStoreDefaultValueBuffer = should be defined as PcdsDynamicExVpd in dsc file since the DefaultStores i= s enabled for this platform.\n%s" %self.Platform.MetaFile.Path)=0D + EdkLogger.warn(=0D + "build", "PcdNvStoreDefaultValueBuffer should be d= efined as PcdsDynamicExVpd in dsc file since the DefaultStores is enabled f= or this platform.\n%s" % self.Platform.MetaFile.Path)=0D PlatformPcds =3D sorted(self._PlatformPcds.keys())=0D #=0D # Add VPD type PCD into VpdFile and determine whether the VPD = PCD need to be fixed up.=0D @@ -527,7 +566,7 @@ class PlatformAutoGen(AutoGen): Sku.VpdOffset =3D Sku.VpdOffset.strip()=0D PcdValue =3D Sku.DefaultValue=0D if PcdValue =3D=3D "":=0D - PcdValue =3D Pcd.DefaultValue=0D + PcdValue =3D Pcd.DefaultValue=0D if Sku.VpdOffset !=3D TAB_STAR:=0D if PcdValue.startswith("{"):=0D Alignment =3D 8=0D @@ -541,12 +580,15 @@ class PlatformAutoGen(AutoGen): try:=0D VpdOffset =3D int(Sku.VpdOffset, 16)=0D except:=0D - EdkLogger.error("build", FORMAT_INVALI= D, "Invalid offset value %s for PCD %s.%s." % (Sku.VpdOffset, Pcd.TokenSpac= eGuidCName, Pcd.TokenCName))=0D + EdkLogger.error("build", FORMAT_INVALI= D, "Invalid offset value %s for PCD %s.%s." % (=0D + Sku.VpdOffset, Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName))=0D if VpdOffset % Alignment !=3D 0:=0D if PcdValue.startswith("{"):=0D - EdkLogger.warn("build", "The offset va= lue of PCD %s.%s is not 8-byte aligned!" %(Pcd.TokenSpaceGuidCName, Pcd.Tok= enCName), File=3Dself.MetaFile)=0D + EdkLogger.warn("build", "The offset va= lue of PCD %s.%s is not 8-byte aligned!" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.Token= CName), File=3Dself.MetaFile)=0D else:=0D - EdkLogger.error("build", FORMAT_INVALI= D, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (Pcd.TokenS= paceGuidCName, Pcd.TokenCName, Alignment))=0D + EdkLogger.error("build", FORMAT_INVALI= D, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.Token= CName, Alignment))=0D if PcdValue not in SkuValueMap:=0D SkuValueMap[PcdValue] =3D []=0D VpdFile.Add(Pcd, SkuName, Sku.VpdOffset)=0D @@ -555,7 +597,7 @@ class PlatformAutoGen(AutoGen): if not NeedProcessVpdMapFile and Sku.VpdOffset =3D= =3D TAB_STAR:=0D NeedProcessVpdMapFile =3D True=0D if self.Platform.VpdToolGuid is None or self.P= latform.VpdToolGuid =3D=3D '':=0D - EdkLogger.error("Build", FILE_NOT_FOUND, \= =0D + EdkLogger.error("Build", FILE_NOT_FOUND,=0D "Fail to find third-party = BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_d= ef.txt and VPD_TOOL_GUID need to be provided in DSC file.")=0D =0D VpdSkuMap[PcdKey] =3D SkuValueMap=0D @@ -572,16 +614,18 @@ class PlatformAutoGen(AutoGen): # This PCD has been referenced by module=0D if (VpdPcd.TokenSpaceGuidCName =3D=3D DscPcdEn= try.TokenSpaceGuidCName) and \=0D (VpdPcd.TokenCName =3D=3D DscPcdEntry.Token= CName):=0D - FoundFlag =3D True=0D + FoundFlag =3D True=0D =0D # Not found, it should be signature=0D - if not FoundFlag :=0D + if not FoundFlag:=0D # just pick the a value to determine whether i= s unicode string type=0D SkuValueMap =3D {}=0D SkuObjList =3D list(DscPcdEntry.SkuInfoList.it= ems())=0D - DefaultSku =3D DscPcdEntry.SkuInfoList.get(TAB= _DEFAULT)=0D + DefaultSku =3D DscPcdEntry.SkuInfoList.get(=0D + TAB_DEFAULT)=0D if DefaultSku:=0D - defaultindex =3D SkuObjList.index((TAB_DEF= AULT, DefaultSku))=0D + defaultindex =3D SkuObjList.index(=0D + (TAB_DEFAULT, DefaultSku))=0D SkuObjList[0], SkuObjList[defaultindex] = =3D SkuObjList[defaultindex], SkuObjList[0]=0D for (SkuName, Sku) in SkuObjList:=0D Sku.VpdOffset =3D Sku.VpdOffset.strip()=0D @@ -594,24 +638,26 @@ class PlatformAutoGen(AutoGen): (DecPcdEntry.TokenCName =3D=3D = DscPcdEntry.TokenCName):=0D # Print warning message to let= the developer make a determine.=0D EdkLogger.warn("build", "Unref= erenced vpd pcd used!",=0D - File=3Dself.Me= taFile, \=0D - ExtraData =3D = "PCD: %s.%s used in the DSC file %s is unreferenced." \=0D - %(DscPcdEntry.= TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))= =0D + File=3Dself.Met= aFile,=0D + ExtraData=3D"PC= D: %s.%s used in the DSC file %s is unreferenced."=0D + % (DscPcdEntry.= TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))= =0D =0D - DscPcdEntry.DatumType =3D D= ecPcdEntry.DatumType=0D + DscPcdEntry.DatumType =3D DecP= cdEntry.DatumType=0D DscPcdEntry.DefaultValue =3D D= ecPcdEntry.DefaultValue=0D DscPcdEntry.TokenValue =3D Dec= PcdEntry.TokenValue=0D - DscPcdEntry.TokenSpaceGuidValu= e =3D eachDec.Guids[DecPcdEntry.TokenSpaceGuidCName]=0D + DscPcdEntry.TokenSpaceGuidValu= e =3D eachDec.Guids[=0D + DecPcdEntry.TokenSpaceGuid= CName]=0D # Only fix the value while no = value provided in DSC file.=0D if not Sku.DefaultValue:=0D - DscPcdEntry.SkuInfoList[li= st(DscPcdEntry.SkuInfoList.keys())[0]].DefaultValue =3D DecPcdEntry.Default= Value=0D + DscPcdEntry.SkuInfoList[li= st(DscPcdEntry.SkuInfoList.keys())[=0D + 0]].DefaultValue =3D D= ecPcdEntry.DefaultValue=0D =0D if DscPcdEntry not in self._DynamicPcdList= :=0D self._DynamicPcdList.append(DscPcdEntr= y)=0D Sku.VpdOffset =3D Sku.VpdOffset.strip()=0D PcdValue =3D Sku.DefaultValue=0D if PcdValue =3D=3D "":=0D - PcdValue =3D DscPcdEntry.DefaultValue= =0D + PcdValue =3D DscPcdEntry.DefaultValue= =0D if Sku.VpdOffset !=3D TAB_STAR:=0D if PcdValue.startswith("{"):=0D Alignment =3D 8=0D @@ -625,15 +671,19 @@ class PlatformAutoGen(AutoGen): try:=0D VpdOffset =3D int(Sku.VpdOffse= t, 16)=0D except:=0D - EdkLogger.error("build", FORMA= T_INVALID, "Invalid offset value %s for PCD %s.%s." % (Sku.VpdOffset, DscPc= dEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName))=0D + EdkLogger.error("build", FORMA= T_INVALID, "Invalid offset value %s for PCD %s.%s." % (=0D + Sku.VpdOffset, DscPcdEntry= .TokenSpaceGuidCName, DscPcdEntry.TokenCName))=0D if VpdOffset % Alignment !=3D 0:=0D if PcdValue.startswith("{"):=0D - EdkLogger.warn("build", "The o= ffset value of PCD %s.%s is not 8-byte aligned!" %(DscPcdEntry.TokenSpaceGu= idCName, DscPcdEntry.TokenCName), File=3Dself.MetaFile)=0D + EdkLogger.warn("build", "The o= ffset value of PCD %s.%s is not 8-byte aligned!" % (=0D + DscPcdEntry.TokenSpaceGuid= CName, DscPcdEntry.TokenCName), File=3Dself.MetaFile)=0D else:=0D - EdkLogger.error("build", FORMA= T_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (Ds= cPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, Alignment))=0D + EdkLogger.error("build", FORMA= T_INVALID, 'The offset value of PCD %s.%s should be %s-byte aligned.' % (=0D + DscPcdEntry.TokenSpaceGuid= CName, DscPcdEntry.TokenCName, Alignment))=0D if PcdValue not in SkuValueMap:=0D SkuValueMap[PcdValue] =3D []=0D - VpdFile.Add(DscPcdEntry, SkuName, Sku.= VpdOffset)=0D + VpdFile.Add(=0D + DscPcdEntry, SkuName, Sku.VpdOffse= t)=0D SkuValueMap[PcdValue].append(Sku)=0D if not NeedProcessVpdMapFile and Sku.VpdOf= fset =3D=3D TAB_STAR:=0D NeedProcessVpdMapFile =3D True=0D @@ -656,16 +706,20 @@ class PlatformAutoGen(AutoGen): self.FixVpdOffset(VpdFile)=0D =0D self.FixVpdOffset(self.UpdateNVStoreMaxSize(VpdFile))=0D - PcdNvStoreDfBuffer =3D [item for item in self._DynamicPcdL= ist if item.TokenCName =3D=3D "PcdNvStoreDefaultValueBuffer" and item.Token= SpaceGuidCName =3D=3D "gEfiMdeModulePkgTokenSpaceGuid"]=0D + PcdNvStoreDfBuffer =3D [item for item in self._DynamicPcdL= ist if item.TokenCName =3D=3D=0D + "PcdNvStoreDefaultValueBuffer" and i= tem.TokenSpaceGuidCName =3D=3D "gEfiMdeModulePkgTokenSpaceGuid"]=0D if PcdNvStoreDfBuffer:=0D - PcdName,PcdGuid =3D PcdNvStoreDfBuffer[0].TokenCName, = PcdNvStoreDfBuffer[0].TokenSpaceGuidCName=0D - if (PcdName,PcdGuid) in VpdSkuMap:=0D - DefaultSku =3D PcdNvStoreDfBuffer[0].SkuInfoList.g= et(TAB_DEFAULT)=0D - VpdSkuMap[(PcdName,PcdGuid)] =3D {DefaultSku.Defau= ltValue:[SkuObj for SkuObj in PcdNvStoreDfBuffer[0].SkuInfoList.values() ]}= =0D + PcdName, PcdGuid =3D PcdNvStoreDfBuffer[0].TokenCName,= PcdNvStoreDfBuffer[0].TokenSpaceGuidCName=0D + if (PcdName, PcdGuid) in VpdSkuMap:=0D + DefaultSku =3D PcdNvStoreDfBuffer[0].SkuInfoList.g= et(=0D + TAB_DEFAULT)=0D + VpdSkuMap[(PcdName, PcdGuid)] =3D {DefaultSku.Defa= ultValue: [=0D + SkuObj for SkuObj in PcdNvStoreDfBuffer[0].Sku= InfoList.values()]}=0D =0D # Process VPD map file generated by third party BPDG tool= =0D if NeedProcessVpdMapFile:=0D - VpdMapFilePath =3D os.path.join(self.BuildDir, TAB_FV_= DIRECTORY, "%s.map" % self.Platform.VpdToolGuid)=0D + VpdMapFilePath =3D os.path.join(=0D + self.BuildDir, TAB_FV_DIRECTORY, "%s.map" % self.P= latform.VpdToolGuid)=0D try:=0D VpdFile.Read(VpdMapFilePath)=0D =0D @@ -673,7 +727,7 @@ class PlatformAutoGen(AutoGen): for pcd in VpdSkuMap:=0D vpdinfo =3D VpdFile.GetVpdInfo(pcd)=0D if vpdinfo is None:=0D - # just pick the a value to determine whether i= s unicode string type=0D + # just pick the a value to determine wheth= er is unicode string type=0D continue=0D for pcdvalue in VpdSkuMap[pcd]:=0D for sku in VpdSkuMap[pcd][pcdvalue]:=0D @@ -681,7 +735,8 @@ class PlatformAutoGen(AutoGen): if item[2] =3D=3D pcdvalue:=0D sku.VpdOffset =3D item[1]=0D except:=0D - EdkLogger.error("build", FILE_READ_FAILURE, "Can n= ot find VPD map file %s to fix up VPD offset." % VpdMapFilePath)=0D + EdkLogger.error(=0D + "build", FILE_READ_FAILURE, "Can not find VPD = map file %s to fix up VPD offset." % VpdMapFilePath)=0D =0D # Delete the DynamicPcdList At the last time enter into this f= unction=0D for Pcd in self._DynamicPcdList:=0D @@ -706,25 +761,29 @@ class PlatformAutoGen(AutoGen): self._DynamicPcdList.extend(list(HiiPcdArray))=0D self._DynamicPcdList.extend(list(OtherPcdArray))=0D self._DynamicPcdList.sort()=0D - allskuset =3D [(SkuName, Sku.SkuId) for pcd in self._DynamicPcdLis= t for (SkuName, Sku) in pcd.SkuInfoList.items()]=0D + allskuset =3D [(SkuName, Sku.SkuId) for pcd in self._DynamicPcdLis= t for (=0D + SkuName, Sku) in pcd.SkuInfoList.items()]=0D for pcd in self._DynamicPcdList:=0D if len(pcd.SkuInfoList) =3D=3D 1:=0D for (SkuName, SkuId) in allskuset:=0D if isinstance(SkuId, str) and eval(SkuId) =3D=3D 0 or = SkuId =3D=3D 0:=0D continue=0D - pcd.SkuInfoList[SkuName] =3D copy.deepcopy(pcd.SkuInfo= List[TAB_DEFAULT])=0D + pcd.SkuInfoList[SkuName] =3D copy.deepcopy(=0D + pcd.SkuInfoList[TAB_DEFAULT])=0D pcd.SkuInfoList[SkuName].SkuId =3D SkuId=0D pcd.SkuInfoList[SkuName].SkuIdName =3D SkuName=0D =0D - def FixVpdOffset(self, VpdFile ):=0D + def FixVpdOffset(self, VpdFile):=0D FvPath =3D os.path.join(self.BuildDir, TAB_FV_DIRECTORY)=0D if not os.path.exists(FvPath):=0D try:=0D os.makedirs(FvPath)=0D except:=0D - EdkLogger.error("build", FILE_WRITE_FAILURE, "Fail to crea= te FV folder under %s" % self.BuildDir)=0D + EdkLogger.error("build", FILE_WRITE_FAILURE,=0D + "Fail to create FV folder under %s" % self= .BuildDir)=0D =0D - VpdFilePath =3D os.path.join(FvPath, "%s.txt" % self.Platform.VpdT= oolGuid)=0D + VpdFilePath =3D os.path.join(FvPath, "%s.txt" %=0D + self.Platform.VpdToolGuid)=0D =0D if VpdFile.Write(VpdFilePath):=0D # retrieve BPDG tool's path from tool_def.txt according to VPD= _TOOL_GUID defined in DSC file.=0D @@ -732,66 +791,68 @@ class PlatformAutoGen(AutoGen): for ToolDef in self.ToolDefinition.values():=0D if TAB_GUID in ToolDef and ToolDef[TAB_GUID] =3D=3D self.P= latform.VpdToolGuid:=0D if "PATH" not in ToolDef:=0D - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, = "PATH attribute was not provided for BPDG guid tool %s in tools_def.txt" % = self.Platform.VpdToolGuid)=0D + EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,= =0D + "PATH attribute was not provided f= or BPDG guid tool %s in tools_def.txt" % self.Platform.VpdToolGuid)=0D BPDGToolName =3D ToolDef["PATH"]=0D break=0D # Call third party GUID BPDG tool.=0D if BPDGToolName is not None:=0D VpdInfoFile.CallExtenalBPDGTool(BPDGToolName, VpdFilePath)= =0D else:=0D - EdkLogger.error("Build", FILE_NOT_FOUND, "Fail to find thi= rd-party BPDG tool to process VPD PCDs. BPDG Guid tool need to be defined i= n tools_def.txt and VPD_TOOL_GUID need to be provided in DSC file.")=0D + EdkLogger.error(=0D + "Build", FILE_NOT_FOUND, "Fail to find third-party BPD= G tool to process VPD PCDs. BPDG Guid tool need to be defined in tools_def.= txt and VPD_TOOL_GUID need to be provided in DSC file.")=0D =0D - ## Return the platform build data object=0D + # Return the platform build data object=0D @cached_property=0D def Platform(self):=0D return self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarg= et, self.ToolChain]=0D =0D - ## Return platform name=0D + # Return platform name=0D @cached_property=0D def Name(self):=0D return self.Platform.PlatformName=0D =0D - ## Return the meta file GUID=0D + # Return the meta file GUID=0D @cached_property=0D def Guid(self):=0D return self.Platform.Guid=0D =0D - ## Return the platform version=0D + # Return the platform version=0D @cached_property=0D def Version(self):=0D return self.Platform.Version=0D =0D - ## Return the FDF file name=0D + # Return the FDF file name=0D @cached_property=0D def FdfFile(self):=0D if self.Workspace.FdfFile:=0D - RetVal=3D mws.join(self.WorkspaceDir, self.Workspace.FdfFile)= =0D + RetVal =3D mws.join(self.WorkspaceDir, self.Workspace.FdfFile)= =0D else:=0D RetVal =3D ''=0D return RetVal=0D =0D - ## Return the build output directory platform specifies=0D + # Return the build output directory platform specifies=0D @cached_property=0D def OutputDir(self):=0D return self.Platform.OutputDirectory=0D =0D - ## Return the directory to store all intermediate and final files buil= t=0D + # Return the directory to store all intermediate and final files built= =0D @cached_property=0D def BuildDir(self):=0D if os.path.isabs(self.OutputDir):=0D GlobalData.gBuildDirectory =3D RetVal =3D path.join(=0D - path.abspath(self.OutputDir),=0D - self.BuildTarget + "_" + self.Tool= Chain,=0D - )=0D + path.abspath(self.OutputDir),=0D + self.BuildTarget + "_" + self.ToolChain,=0D + )=0D else:=0D GlobalData.gBuildDirectory =3D RetVal =3D path.join(=0D - self.WorkspaceDir,=0D - self.OutputDir,=0D - self.BuildTarget + "_" + self.Tool= Chain,=0D - )=0D + self.WorkspaceDir,=0D + self.OutputDir,=0D + self.BuildTarget + "_" + self.ToolChain,=0D + )=0D return RetVal=0D =0D - ## Return directory of platform makefile=0D + # Return directory of platform makefile=0D #=0D # @retval string Makefile directory=0D #=0D @@ -799,7 +860,7 @@ class PlatformAutoGen(AutoGen): def MakeFileDir(self):=0D return path.join(self.BuildDir, self.Arch)=0D =0D - ## Return build command string=0D + # Return build command string=0D #=0D # @retval string Build command string=0D #=0D @@ -827,7 +888,7 @@ class PlatformAutoGen(AutoGen): RetVal =3D RetVal + _SplitOption(Flags.strip())=0D return RetVal=0D =0D - ## Compute a tool defintion key priority value in range 0..15=0D + # Compute a tool defintion key priority value in range 0..15=0D #=0D # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE 15=0D # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE 14=0D @@ -846,15 +907,15 @@ class PlatformAutoGen(AutoGen): # TARGET_*********_****_***********_ATTRIBUTE 1=0D # ******_*********_****_***********_ATTRIBUTE 0=0D #=0D - def ToolDefinitionPriority (self,Key):=0D + def ToolDefinitionPriority(self, Key):=0D KeyList =3D Key.split('_')=0D Priority =3D 0=0D - for Index in range (0, min(4, len(KeyList))):=0D + for Index in range(0, min(4, len(KeyList))):=0D if KeyList[Index] !=3D '*':=0D Priority +=3D (1 << Index)=0D return Priority=0D =0D - ## Get tool chain definition=0D + # Get tool chain definition=0D #=0D # Get each tool definition for given tool chain from tools_def.txt an= d platform=0D #=0D @@ -867,7 +928,8 @@ class PlatformAutoGen(AutoGen): RetVal =3D OrderedDict()=0D DllPathList =3D set()=0D =0D - PrioritizedDefList =3D sorted(ToolDefinition.keys(), key=3Dself.To= olDefinitionPriority, reverse=3DTrue)=0D + PrioritizedDefList =3D sorted(ToolDefinition.keys(=0D + ), key=3Dself.ToolDefinitionPriority, reverse=3DTrue)=0D for Def in PrioritizedDefList:=0D Target, Tag, Arch, Tool, Attr =3D Def.split("_")=0D if Target =3D=3D TAB_STAR:=0D @@ -918,13 +980,17 @@ class PlatformAutoGen(AutoGen): if Tool in self._BuildOptionWithToolDef(RetVal) and Attr i= n self._BuildOptionWithToolDef(RetVal)[Tool]:=0D # check if override is indicated=0D if self._BuildOptionWithToolDef(RetVal)[Tool][Attr].st= artswith('=3D'):=0D - Value =3D self._BuildOptionWithToolDef(RetVal)[Too= l][Attr][1:].strip()=0D + Value =3D self._BuildOptionWithToolDef(=0D + RetVal)[Tool][Attr][1:].strip()=0D else:=0D # Do not append PATH or GUID=0D if Attr !=3D 'PATH' and Attr !=3D 'GUID':=0D - Value +=3D " " + self._BuildOptionWithToolDef(= RetVal)[Tool][Attr]=0D + Value +=3D " " + \=0D + self._BuildOptionWithToolDef(RetVal)[=0D + Tool][Attr]=0D else:=0D - Value =3D self._BuildOptionWithToolDef(RetVal)= [Tool][Attr]=0D + Value =3D self._BuildOptionWithToolDef(RetVal)= [=0D + Tool][Attr]=0D if Attr =3D=3D "PATH":=0D # Don't put MAKE definition in the file=0D if Tool !=3D "MAKE":=0D @@ -938,7 +1004,8 @@ class PlatformAutoGen(AutoGen): ToolsDef +=3D "%s_%s =3D %s\n" % (Tool, Attr, Valu= e)=0D ToolsDef +=3D "\n"=0D =0D - tool_def_file =3D os.path.join(self.MakeFileDir, "TOOLS_DEF." + se= lf.Arch)=0D + tool_def_file =3D os.path.join(=0D + self.MakeFileDir, "TOOLS_DEF." + self.Arch)=0D SaveFileOnChange(tool_def_file, ToolsDef, False)=0D for DllPath in DllPathList:=0D os.environ["PATH"] =3D DllPath + os.pathsep + os.environ["PATH= "]=0D @@ -946,23 +1013,24 @@ class PlatformAutoGen(AutoGen): =0D return RetVal=0D =0D - ## Return the paths of tools=0D + # Return the paths of tools=0D @cached_property=0D def ToolDefinitionFile(self):=0D - tool_def_file =3D os.path.join(self.MakeFileDir, "TOOLS_DEF." + se= lf.Arch)=0D + tool_def_file =3D os.path.join(=0D + self.MakeFileDir, "TOOLS_DEF." + self.Arch)=0D if not os.path.exists(tool_def_file):=0D self.ToolDefinition=0D return tool_def_file=0D =0D - ## Retrieve the toolchain family of given toolchain tag. Default to 'M= SFT'.=0D + # Retrieve the toolchain family of given toolchain tag. Default to 'MS= FT'.=0D @cached_property=0D def ToolChainFamily(self):=0D ToolDefinition =3D self.Workspace.ToolDef.ToolsDefTxtDatabase=0D if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \=0D or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY]= \=0D or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][self.ToolChain]:= =0D - EdkLogger.verbose("No tool chain family found in configuration= for %s. Default to MSFT." \=0D - % self.ToolChain)=0D + EdkLogger.verbose("No tool chain family found in configuration= for %s. Default to MSFT."=0D + % self.ToolChain)=0D RetVal =3D TAB_COMPILER_MSFT=0D else:=0D RetVal =3D ToolDefinition[TAB_TOD_DEFINES_FAMILY][self.ToolCha= in]=0D @@ -974,13 +1042,13 @@ class PlatformAutoGen(AutoGen): if TAB_TOD_DEFINES_BUILDRULEFAMILY not in ToolDefinition \=0D or self.ToolChain not in ToolDefinition[TAB_TOD_DEFINES_BUILDRU= LEFAMILY] \=0D or not ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY][self.Too= lChain]:=0D - EdkLogger.verbose("No tool chain family found in configuration= for %s. Default to MSFT." \=0D - % self.ToolChain)=0D + EdkLogger.verbose("No tool chain family found in configuration= for %s. Default to MSFT."=0D + % self.ToolChain)=0D return TAB_COMPILER_MSFT=0D =0D return ToolDefinition[TAB_TOD_DEFINES_BUILDRULEFAMILY][self.ToolCh= ain]=0D =0D - ## Return the build options specific for all modules in this platform= =0D + # Return the build options specific for all modules in this platform=0D @cached_property=0D def BuildOption(self):=0D return self._ExpandBuildOption(self.Platform.BuildOptions)=0D @@ -988,17 +1056,17 @@ class PlatformAutoGen(AutoGen): def _BuildOptionWithToolDef(self, ToolDef):=0D return self._ExpandBuildOption(self.Platform.BuildOptions, ToolDef= =3DToolDef)=0D =0D - ## Return the build options specific for EDK modules in this platform= =0D + # Return the build options specific for EDK modules in this platform=0D @cached_property=0D def EdkBuildOption(self):=0D return self._ExpandBuildOption(self.Platform.BuildOptions, EDK_NAM= E)=0D =0D - ## Return the build options specific for EDKII modules in this platfor= m=0D + # Return the build options specific for EDKII modules in this platform= =0D @cached_property=0D def EdkIIBuildOption(self):=0D return self._ExpandBuildOption(self.Platform.BuildOptions, EDKII_N= AME)=0D =0D - ## Parse build_rule.txt in Conf Directory.=0D + # Parse build_rule.txt in Conf Directory.=0D #=0D # @retval BuildRule object=0D #=0D @@ -1006,21 +1074,22 @@ class PlatformAutoGen(AutoGen): def BuildRule(self):=0D BuildRuleFile =3D None=0D if TAB_TAT_DEFINES_BUILD_RULE_CONF in self.Workspace.TargetTxt.Tar= getTxtDictionary:=0D - BuildRuleFile =3D self.Workspace.TargetTxt.TargetTxtDictionary= [TAB_TAT_DEFINES_BUILD_RULE_CONF]=0D + BuildRuleFile =3D self.Workspace.TargetTxt.TargetTxtDictionary= [=0D + TAB_TAT_DEFINES_BUILD_RULE_CONF]=0D if not BuildRuleFile:=0D BuildRuleFile =3D gDefaultBuildRuleFile=0D RetVal =3D BuildRule(BuildRuleFile)=0D if RetVal._FileVersion =3D=3D "":=0D RetVal._FileVersion =3D AutoGenReqBuildRuleVerNum=0D else:=0D - if RetVal._FileVersion < AutoGenReqBuildRuleVerNum :=0D + if RetVal._FileVersion < AutoGenReqBuildRuleVerNum:=0D # If Build Rule's version is less than the version number = required by the tools, halting the build.=0D EdkLogger.error("build", AUTOGEN_ERROR,=0D - ExtraData=3D"The version number [%s] of bu= ild_rule.txt is less than the version number required by the AutoGen.(the m= inimum required version number is [%s])"\=0D - % (RetVal._FileVersion, AutoGenReqBuildRu= leVerNum))=0D + ExtraData=3D"The version number [%s] of bu= ild_rule.txt is less than the version number required by the AutoGen.(the m= inimum required version number is [%s])"=0D + % (RetVal._FileVersion, AutoGenReqBuildRul= eVerNum))=0D return RetVal=0D =0D - ## Summarize the packages used by modules in this platform=0D + # Summarize the packages used by modules in this platform=0D @cached_property=0D def PackageList(self):=0D RetVal =3D set()=0D @@ -1028,34 +1097,35 @@ class PlatformAutoGen(AutoGen): RetVal.update(Mb.Packages)=0D for lb in Mb.LibInstances:=0D RetVal.update(lb.Packages)=0D - #Collect package set information from INF of FDF=0D + # Collect package set information from INF of FDF=0D for ModuleFile in self._AsBuildModuleList:=0D if ModuleFile in self.Platform.Modules:=0D continue=0D - ModuleData =3D self.BuildDatabase[ModuleFile, self.Arch, self.= BuildTarget, self.ToolChain]=0D + ModuleData =3D self.BuildDatabase[ModuleFile,=0D + self.Arch, self.BuildTarget, s= elf.ToolChain]=0D RetVal.update(ModuleData.Packages)=0D RetVal.update(self.Platform.Packages)=0D return list(RetVal)=0D =0D @cached_property=0D def NonDynamicPcdDict(self):=0D - return {(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):Pcd for Pcd in s= elf.NonDynamicPcdList}=0D + return {(Pcd.TokenCName, Pcd.TokenSpaceGuidCName): Pcd for Pcd in = self.NonDynamicPcdList}=0D =0D - ## Get list of non-dynamic PCDs=0D + # Get list of non-dynamic PCDs=0D @property=0D def NonDynamicPcdList(self):=0D if not self._NonDynamicPcdList:=0D self.CollectPlatformDynamicPcds()=0D return self._NonDynamicPcdList=0D =0D - ## Get list of dynamic PCDs=0D + # Get list of dynamic PCDs=0D @property=0D def DynamicPcdList(self):=0D if not self._DynamicPcdList:=0D self.CollectPlatformDynamicPcds()=0D return self._DynamicPcdList=0D =0D - ## Generate Token Number for all PCD=0D + # Generate Token Number for all PCD=0D @cached_property=0D def PcdTokenNumber(self):=0D RetVal =3D OrderedDict()=0D @@ -1071,25 +1141,29 @@ class PlatformAutoGen(AutoGen): #=0D for Pcd in self.DynamicPcdList:=0D if Pcd.Phase =3D=3D "PEI" and Pcd.Type in PCD_DYNAMIC_TYPE_SET= :=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (P= cd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))=0D + EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" %=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, = Pcd.Phase, TokenNumber))=0D RetVal[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] =3D TokenN= umber=0D TokenNumber +=3D 1=0D =0D for Pcd in self.DynamicPcdList:=0D if Pcd.Phase =3D=3D "PEI" and Pcd.Type in PCD_DYNAMIC_EX_TYPE_= SET:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (P= cd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))=0D + EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" %=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, = Pcd.Phase, TokenNumber))=0D RetVal[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] =3D TokenN= umber=0D TokenNumber +=3D 1=0D =0D for Pcd in self.DynamicPcdList:=0D if Pcd.Phase =3D=3D "DXE" and Pcd.Type in PCD_DYNAMIC_TYPE_SET= :=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (P= cd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))=0D + EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" %=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, = Pcd.Phase, TokenNumber))=0D RetVal[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] =3D TokenN= umber=0D TokenNumber +=3D 1=0D =0D for Pcd in self.DynamicPcdList:=0D if Pcd.Phase =3D=3D "DXE" and Pcd.Type in PCD_DYNAMIC_EX_TYPE_= SET:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" % (P= cd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Phase, TokenNumber))=0D + EdkLogger.debug(EdkLogger.DEBUG_5, "%s %s (%s) -> %d" %=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, = Pcd.Phase, TokenNumber))=0D RetVal[Pcd.TokenCName, Pcd.TokenSpaceGuidCName] =3D TokenN= umber=0D TokenNumber +=3D 1=0D =0D @@ -1102,7 +1176,8 @@ class PlatformAutoGen(AutoGen): ModuleList =3D []=0D for m in self.Platform.Modules:=0D component =3D self.Platform.Modules[m]=0D - module =3D self.BuildDatabase[m, self.Arch, self.BuildTarget, = self.ToolChain]=0D + module =3D self.BuildDatabase[m, self.Arch,=0D + self.BuildTarget, self.ToolChain]= =0D module.Guid =3D component.Guid=0D ModuleList.append(module)=0D return ModuleList=0D @@ -1111,18 +1186,18 @@ class PlatformAutoGen(AutoGen): def _MaList(self):=0D for ModuleFile in self.Platform.Modules:=0D Ma =3D ModuleAutoGen(=0D - self.Workspace,=0D - ModuleFile,=0D - self.BuildTarget,=0D - self.ToolChain,=0D - self.Arch,=0D - self.MetaFile,=0D - self.DataPipe=0D - )=0D + self.Workspace,=0D + ModuleFile,=0D + self.BuildTarget,=0D + self.ToolChain,=0D + self.Arch,=0D + self.MetaFile,=0D + self.DataPipe=0D + )=0D self.Platform.Modules[ModuleFile].M =3D Ma=0D return [x.M for x in self.Platform.Modules.values()]=0D =0D - ## Summarize ModuleAutoGen objects of all modules to be built for this= platform=0D + # Summarize ModuleAutoGen objects of all modules to be built for this = platform=0D @cached_property=0D def ModuleAutoGenList(self):=0D RetVal =3D []=0D @@ -1131,7 +1206,7 @@ class PlatformAutoGen(AutoGen): RetVal.append(Ma)=0D return RetVal=0D =0D - ## Summarize ModuleAutoGen objects of all libraries to be built for th= is platform=0D + # Summarize ModuleAutoGen objects of all libraries to be built for thi= s platform=0D @cached_property=0D def LibraryAutoGenList(self):=0D RetVal =3D []=0D @@ -1143,7 +1218,7 @@ class PlatformAutoGen(AutoGen): La.ReferenceModules.append(Ma)=0D return RetVal=0D =0D - ## Test if a module is supported by the platform=0D + # Test if a module is supported by the platform=0D #=0D # An error will be raised directly if the module or its arch is not s= upported=0D # by the platform or current configuration=0D @@ -1151,23 +1226,28 @@ class PlatformAutoGen(AutoGen): def ValidModule(self, Module):=0D return Module in self.Platform.Modules or Module in self.Platform.= LibraryInstances \=0D or Module in self._AsBuildModuleList=0D +=0D @cached_property=0D - def GetAllModuleInfo(self,WithoutPcd=3DTrue):=0D + def GetAllModuleInfo(self, WithoutPcd=3DTrue):=0D ModuleLibs =3D set()=0D for m in self.Platform.Modules:=0D - module_obj =3D self.BuildDatabase[m,self.Arch,self.BuildTarget= ,self.ToolChain]=0D + module_obj =3D self.BuildDatabase[m, self.Arch,=0D + self.BuildTarget, self.ToolCha= in]=0D if not bool(module_obj.LibraryClass):=0D - Libs =3D GetModuleLibInstances(module_obj, self.Platform, = self.BuildDatabase, self.Arch,self.BuildTarget,self.ToolChain,self.MetaFile= ,EdkLogger)=0D + Libs =3D GetModuleLibInstances(module_obj, self.Platform, = self.BuildDatabase,=0D + self.Arch, self.BuildTarget, = self.ToolChain, self.MetaFile, EdkLogger)=0D else:=0D Libs =3D []=0D - ModuleLibs.update( set([(l.MetaFile.File,l.MetaFile.Root,l.Met= aFile.Path,l.MetaFile.BaseName,l.MetaFile.OriginalPath,l.Arch,True) for l i= n Libs]))=0D + ModuleLibs.update(set([(l.MetaFile.File, l.MetaFile.Root, l.Me= taFile.Path,=0D + l.MetaFile.BaseName, l.MetaFile.OriginalPath= , l.Arch, True) for l in Libs]))=0D if WithoutPcd and module_obj.PcdIsDriver:=0D continue=0D - ModuleLibs.add((m.File,m.Root,m.Path,m.BaseName,m.OriginalPath= ,module_obj.Arch,bool(module_obj.LibraryClass)))=0D + ModuleLibs.add((m.File, m.Root, m.Path, m.BaseName, m.Original= Path,=0D + module_obj.Arch, bool(module_obj.LibraryClass))= )=0D =0D return ModuleLibs=0D =0D - ## Resolve the library classes in a module to library instances=0D + # Resolve the library classes in a module to library instances=0D #=0D # This method will not only resolve library classes but also sort the = library=0D # instances according to the dependency-ship.=0D @@ -1190,7 +1270,7 @@ class PlatformAutoGen(AutoGen): self.MetaFile,=0D EdkLogger)=0D =0D - ## Override PCD setting (type, value, ...)=0D + # Override PCD setting (type, value, ...)=0D #=0D # @param ToPcd The PCD to be overridden=0D # @param FromPcd The PCD overriding from=0D @@ -1210,15 +1290,16 @@ class PlatformAutoGen(AutoGen): if ToPcd.Pending and FromPcd.Type:=0D ToPcd.Type =3D FromPcd.Type=0D elif ToPcd.Type and FromPcd.Type\=0D - and ToPcd.Type !=3D FromPcd.Type and ToPcd.Type in FromPcd= .Type:=0D + and ToPcd.Type !=3D FromPcd.Type and ToPcd.Type in Fro= mPcd.Type:=0D if ToPcd.Type.strip() =3D=3D TAB_PCDS_DYNAMIC_EX:=0D ToPcd.Type =3D FromPcd.Type=0D elif ToPcd.Type and FromPcd.Type \=0D - and ToPcd.Type !=3D FromPcd.Type:=0D + and ToPcd.Type !=3D FromPcd.Type:=0D if Library:=0D - Module =3D str(Module) + " 's library file (" + str(Li= brary) + ")"=0D + Module =3D str(Module) + \=0D + " 's library file (" + str(Library) + ")"=0D EdkLogger.error("build", OPTION_CONFLICT, "Mismatched PCD = type",=0D - ExtraData=3D"%s.%s is used as [%s] in modu= le %s, but as [%s] in %s."\=0D + ExtraData=3D"%s.%s is used as [%s] in modu= le %s, but as [%s] in %s."=0D % (ToPcd.TokenSpaceGuidCName, To= kenCName,=0D ToPcd.Type, Module, FromPcd.T= ype, Msg),=0D File=3Dself.MetaFile)=0D @@ -1239,10 +1320,11 @@ class PlatformAutoGen(AutoGen): # Add Flexible PCD format parse=0D if ToPcd.DefaultValue:=0D try:=0D - ToPcd.DefaultValue =3D ValueExpressionEx(ToPcd.Default= Value, ToPcd.DatumType, self.Platform._GuidDict)(True)=0D + ToPcd.DefaultValue =3D ValueExpressionEx(=0D + ToPcd.DefaultValue, ToPcd.DatumType, self.Platform= ._GuidDict)(True)=0D except BadExpression as Value:=0D - EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s]= Value "%s", %s' %(ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.Defau= ltValue, Value),=0D - File=3Dself.MetaFile)=0D + EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s]= Value "%s", %s' % (ToPcd.TokenSpaceGuidCName, ToPcd.TokenCName, ToPcd.Defa= ultValue, Value),=0D + File=3Dself.MetaFile)=0D =0D # check the validation of datum=0D IsValid, Cause =3D CheckPcdDatum(ToPcd.DatumType, ToPcd.Defaul= tValue)=0D @@ -1255,7 +1337,7 @@ class PlatformAutoGen(AutoGen): ToPcd.CustomAttribute =3D FromPcd.CustomAttribute=0D =0D if FromPcd is not None and ToPcd.DatumType =3D=3D TAB_VOID and not= ToPcd.MaxDatumSize:=0D - EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified = for PCD %s.%s" \=0D + EdkLogger.debug(EdkLogger.DEBUG_9, "No MaxDatumSize specified = for PCD %s.%s"=0D % (ToPcd.TokenSpaceGuidCName, TokenCName))=0D Value =3D ToPcd.DefaultValue=0D if not Value:=0D @@ -1269,16 +1351,17 @@ class PlatformAutoGen(AutoGen): =0D # apply default SKU for dynamic PCDS if specified one is not avail= able=0D if (ToPcd.Type in PCD_DYNAMIC_TYPE_SET or ToPcd.Type in PCD_DYNAMI= C_EX_TYPE_SET) \=0D - and not ToPcd.SkuInfoList:=0D + and not ToPcd.SkuInfoList:=0D if self.Platform.SkuName in self.Platform.SkuIds:=0D SkuName =3D self.Platform.SkuName=0D else:=0D SkuName =3D TAB_DEFAULT=0D ToPcd.SkuInfoList =3D {=0D - SkuName : SkuInfoClass(SkuName, self.Platform.SkuIds[SkuNa= me][0], '', '', '', '', '', ToPcd.DefaultValue)=0D + SkuName: SkuInfoClass(=0D + SkuName, self.Platform.SkuIds[SkuName][0], '', '', '',= '', '', ToPcd.DefaultValue)=0D }=0D =0D - ## Apply PCD setting defined platform to a module=0D + # Apply PCD setting defined platform to a module=0D #=0D # @param Module The module from which the PCD setting will be over= ridden=0D #=0D @@ -1294,31 +1377,36 @@ class PlatformAutoGen(AutoGen): else:=0D PcdInPlatform =3D None=0D # then override the settings if any=0D - self._OverridePcd(PcdInModule, PcdInPlatform, Module, Msg=3D"D= SC PCD sections", Library=3DLibrary)=0D + self._OverridePcd(PcdInModule, PcdInPlatform,=0D + Module, Msg=3D"DSC PCD sections", Library=3D= Library)=0D # resolve the VariableGuid value=0D for SkuId in PcdInModule.SkuInfoList:=0D Sku =3D PcdInModule.SkuInfoList[SkuId]=0D - if Sku.VariableGuid =3D=3D '': continue=0D - Sku.VariableGuidValue =3D GuidValue(Sku.VariableGuid, self= .PackageList, self.MetaFile.Path)=0D + if Sku.VariableGuid =3D=3D '':=0D + continue=0D + Sku.VariableGuidValue =3D GuidValue(=0D + Sku.VariableGuid, self.PackageList, self.MetaFile.Path= )=0D if Sku.VariableGuidValue is None:=0D PackageList =3D "\n\t".join(str(P) for P in self.Packa= geList)=0D EdkLogger.error(=0D - 'build',=0D - RESOURCE_NOT_AVAILABLE,=0D - "Value of GUID [%s] is not found in" % Sku= .VariableGuid,=0D - ExtraData=3DPackageList + "\n\t(used with = %s.%s from module %s)" \=0D - % (Guid, Name, str= (Module)),=0D - File=3Dself.MetaFile=0D - )=0D + 'build',=0D + RESOURCE_NOT_AVAILABLE,=0D + "Value of GUID [%s] is not found in" % Sku.Variabl= eGuid,=0D + ExtraData=3DPackageList +=0D + "\n\t(used with %s.%s from module %s)"=0D + % (Guid, Name, str(Module)),=0D + File=3Dself.MetaFile=0D + )=0D =0D # override PCD settings with module specific setting=0D if Module in self.Platform.Modules:=0D PlatformModule =3D self.Platform.Modules[str(Module)]=0D - for Key in PlatformModule.Pcds:=0D + for Key in PlatformModule.Pcds:=0D if GlobalData.BuildOptionPcd:=0D for pcd in GlobalData.BuildOptionPcd:=0D - (TokenSpaceGuidCName, TokenCName, FieldName, pcdva= lue, _) =3D pcd=0D - if (TokenCName, TokenSpaceGuidCName) =3D=3D Key an= d FieldName =3D=3D"":=0D + (TokenSpaceGuidCName, TokenCName,=0D + FieldName, pcdvalue, _) =3D pcd=0D + if (TokenCName, TokenSpaceGuidCName) =3D=3D Key an= d FieldName =3D=3D "":=0D PlatformModule.Pcds[Key].DefaultValue =3D pcdv= alue=0D PlatformModule.Pcds[Key].PcdValueFromComm =3D = pcdvalue=0D break=0D @@ -1333,7 +1421,8 @@ class PlatformAutoGen(AutoGen): Flag =3D True=0D break=0D if Flag:=0D - self._OverridePcd(ToPcd, PlatformModule.Pcds[Key], Mod= ule, Msg=3D"DSC Components Module scoped PCD section", Library=3DLibrary)=0D + self._OverridePcd(=0D + ToPcd, PlatformModule.Pcds[Key], Module, Msg=3D"DS= C Components Module scoped PCD section", Library=3DLibrary)=0D # use PCD value to calculate the MaxDatumSize when it is not speci= fied=0D for Name, Guid in Pcds:=0D Pcd =3D Pcds[Name, Guid]=0D @@ -1350,7 +1439,7 @@ class PlatformAutoGen(AutoGen): Pcd.MaxDatumSize =3D str(len(Value) - 1)=0D return list(Pcds.values())=0D =0D - ## Append build options in platform to a module=0D + # Append build options in platform to a module=0D #=0D # @param Module The module to which the build options will be appe= nded=0D #=0D @@ -1359,12 +1448,14 @@ class PlatformAutoGen(AutoGen): def ApplyBuildOption(self, Module):=0D # Get the different options for the different style module=0D PlatformOptions =3D self.EdkIIBuildOption=0D - ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleType(ED= KII_NAME, Module.ModuleType)=0D + ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleType(=0D + EDKII_NAME, Module.ModuleType)=0D ModuleTypeOptions =3D self._ExpandBuildOption(ModuleTypeOptions)=0D ModuleOptions =3D self._ExpandBuildOption(Module.BuildOptions)=0D if Module in self.Platform.Modules:=0D PlatformModule =3D self.Platform.Modules[str(Module)]=0D - PlatformModuleOptions =3D self._ExpandBuildOption(PlatformModu= le.BuildOptions)=0D + PlatformModuleOptions =3D self._ExpandBuildOption(=0D + PlatformModule.BuildOptions)=0D else:=0D PlatformModuleOptions =3D {}=0D =0D @@ -1397,59 +1488,67 @@ class PlatformAutoGen(AutoGen): for ExpandedTool in ToolList:=0D # check if override is indicated=0D if Value.startswith('=3D'):=0D - BuildOptions[ExpandedTool][Attr] =3D mws.handl= eWsMacro(Value[1:])=0D + BuildOptions[ExpandedTool][Attr] =3D mws.handl= eWsMacro(=0D + Value[1:])=0D else:=0D if Attr !=3D 'PATH':=0D - BuildOptions[ExpandedTool][Attr] +=3D " " = + mws.handleWsMacro(Value)=0D + BuildOptions[ExpandedTool][Attr] +=3D " " = + \=0D + mws.handleWsMacro(Value)=0D else:=0D - BuildOptions[ExpandedTool][Attr] =3D mws.h= andleWsMacro(Value)=0D + BuildOptions[ExpandedTool][Attr] =3D mws.h= andleWsMacro(=0D + Value)=0D =0D return BuildOptions, BuildRuleOrder=0D =0D -=0D - def GetGlobalBuildOptions(self,Module):=0D - ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleType(ED= KII_NAME, Module.ModuleType)=0D + def GetGlobalBuildOptions(self, Module):=0D + ModuleTypeOptions =3D self.Platform.GetBuildOptionsByModuleType(=0D + EDKII_NAME, Module.ModuleType)=0D ModuleTypeOptions =3D self._ExpandBuildOption(ModuleTypeOptions)=0D =0D if Module in self.Platform.Modules:=0D PlatformModule =3D self.Platform.Modules[str(Module)]=0D - PlatformModuleOptions =3D self._ExpandBuildOption(PlatformModu= le.BuildOptions)=0D + PlatformModuleOptions =3D self._ExpandBuildOption(=0D + PlatformModule.BuildOptions)=0D else:=0D PlatformModuleOptions =3D {}=0D =0D - return ModuleTypeOptions,PlatformModuleOptions=0D - def ModuleGuid(self,Module):=0D + return ModuleTypeOptions, PlatformModuleOptions=0D +=0D + def ModuleGuid(self, Module):=0D if os.path.basename(Module.MetaFile.File) !=3D os.path.basename(Mo= dule.MetaFile.Path):=0D #=0D # Length of GUID is 36=0D #=0D return os.path.basename(Module.MetaFile.Path)[:36]=0D return Module.Guid=0D +=0D @cached_property=0D def UniqueBaseName(self):=0D - retVal =3D{}=0D + retVal =3D {}=0D ModuleNameDict =3D {}=0D UniqueName =3D {}=0D for Module in self._MbList:=0D - unique_base_name =3D '%s_%s' % (Module.BaseName,self.ModuleGui= d(Module))=0D + unique_base_name =3D '%s_%s' % (=0D + Module.BaseName, self.ModuleGuid(Module))=0D if unique_base_name not in ModuleNameDict:=0D ModuleNameDict[unique_base_name] =3D []=0D ModuleNameDict[unique_base_name].append(Module.MetaFile)=0D if Module.BaseName not in UniqueName:=0D UniqueName[Module.BaseName] =3D set()=0D - UniqueName[Module.BaseName].add((self.ModuleGuid(Module),Modul= e.MetaFile))=0D + UniqueName[Module.BaseName].add(=0D + (self.ModuleGuid(Module), Module.MetaFile))=0D for module_paths in ModuleNameDict.values():=0D - if len(set(module_paths))>1:=0D + if len(set(module_paths)) > 1:=0D samemodules =3D list(set(module_paths))=0D EdkLogger.error("build", FILE_DUPLICATED, 'Modules have sa= me BaseName and FILE_GUID:\n'=0D - ' %s\n %s' % (samemodules[0], samemo= dules[1]))=0D + ' %s\n %s' % (samemodules[0], samemodule= s[1]))=0D for name in UniqueName:=0D Guid_Path =3D UniqueName[name]=0D if len(Guid_Path) > 1:=0D - for guid,mpath in Guid_Path:=0D - retVal[(name,mpath)] =3D '%s_%s' % (name,guid)=0D + for guid, mpath in Guid_Path:=0D + retVal[(name, mpath)] =3D '%s_%s' % (name, guid)=0D return retVal=0D - ## Expand * in build option key=0D + # Expand * in build option key=0D #=0D # @param Options Options to be expanded=0D # @param ToolDef Use specified ToolDef instead of full version.= =0D @@ -1459,11 +1558,12 @@ class PlatformAutoGen(AutoGen): #=0D # @retval options Options expanded=0D #=0D +=0D def _ExpandBuildOption(self, Options, ModuleStyle=3DNone, ToolDef=3DNo= ne):=0D if not ToolDef:=0D ToolDef =3D self.ToolDefinition=0D BuildOptions =3D {}=0D - FamilyMatch =3D False=0D + FamilyMatch =3D False=0D FamilyIsNull =3D True=0D =0D OverrideList =3D {}=0D @@ -1476,12 +1576,12 @@ class PlatformAutoGen(AutoGen): # Key[1] -- TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE=0D #=0D if (Key[0] =3D=3D self.BuildRuleFamily and=0D - (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 and = Key[2] =3D=3D ModuleStyle))):=0D + (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 = and Key[2] =3D=3D ModuleStyle))):=0D Target, ToolChain, Arch, CommandType, Attr =3D Key[1].spli= t('_')=0D if (Target =3D=3D self.BuildTarget or Target =3D=3D TAB_ST= AR) and\=0D (ToolChain =3D=3D self.ToolChain or ToolChain =3D=3D T= AB_STAR) and\=0D (Arch =3D=3D self.Arch or Arch =3D=3D TAB_STAR) and\=0D - Options[Key].startswith("=3D"):=0D + Options[Key].startswith("=3D"):=0D =0D if OverrideList.get(Key[1]) is not None:=0D OverrideList.pop(Key[1])=0D @@ -1494,18 +1594,20 @@ class PlatformAutoGen(AutoGen): KeyList =3D list(OverrideList.keys())=0D for Index in range(len(KeyList)):=0D NowKey =3D KeyList[Index]=0D - Target1, ToolChain1, Arch1, CommandType1, Attr1 =3D NowKey= .split("_")=0D + Target1, ToolChain1, Arch1, CommandType1, Attr1 =3D NowKey= .split(=0D + "_")=0D for Index1 in range(len(KeyList) - Index - 1):=0D NextKey =3D KeyList[Index1 + Index + 1]=0D #=0D # Compare two Key, if one is included by another, choo= se the higher priority one=0D #=0D - Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D Ne= xtKey.split("_")=0D + Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D Ne= xtKey.split(=0D + "_")=0D if (Target1 =3D=3D Target2 or Target1 =3D=3D TAB_STAR = or Target2 =3D=3D TAB_STAR) and\=0D (ToolChain1 =3D=3D ToolChain2 or ToolChain1 =3D=3D= TAB_STAR or ToolChain2 =3D=3D TAB_STAR) and\=0D (Arch1 =3D=3D Arch2 or Arch1 =3D=3D TAB_STAR or Ar= ch2 =3D=3D TAB_STAR) and\=0D (CommandType1 =3D=3D CommandType2 or CommandType1 = =3D=3D TAB_STAR or CommandType2 =3D=3D TAB_STAR) and\=0D - (Attr1 =3D=3D Attr2 or Attr1 =3D=3D TAB_STAR or At= tr2 =3D=3D TAB_STAR):=0D + (Attr1 =3D=3D Attr2 or Attr1 =3D=3D TAB_STAR o= r Attr2 =3D=3D TAB_STAR):=0D =0D if CalculatePriorityValue(NowKey) > CalculatePrior= ityValue(NextKey):=0D if Options.get((self.BuildRuleFamily, NextKey)= ) is not None:=0D @@ -1515,7 +1617,7 @@ class PlatformAutoGen(AutoGen): Options.pop((self.BuildRuleFamily, NowKey)= )=0D =0D for Key in Options:=0D - if ModuleStyle is not None and len (Key) > 2:=0D + if ModuleStyle is not None and len(Key) > 2:=0D # Check Module style is EDK or EDKII.=0D # Only append build option for the matched style module.=0D if ModuleStyle =3D=3D EDK_NAME and Key[2] !=3D EDK_NAME:=0D @@ -1561,7 +1663,7 @@ class PlatformAutoGen(AutoGen): return BuildOptions=0D =0D for Key in Options:=0D - if ModuleStyle is not None and len (Key) > 2:=0D + if ModuleStyle is not None and len(Key) > 2:=0D # Check Module style is EDK or EDKII.=0D # Only append build option for the matched style module.=0D if ModuleStyle =3D=3D EDK_NAME and Key[2] !=3D EDK_NAME:=0D diff --git a/BaseTools/Source/Python/AutoGen/StrGather.py b/BaseTools/Sourc= e/Python/AutoGen/StrGather.py index eed30388bea1..441f6ebcbf0e 100644 --- a/BaseTools/Source/Python/AutoGen/StrGather.py +++ b/BaseTools/Source/Python/AutoGen/StrGather.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a strings file and create or add to a string = database=0D # file.=0D #=0D @@ -54,7 +54,8 @@ NOT_REFERENCED =3D 'not referenced' COMMENT_NOT_REFERENCED =3D ' ' + COMMENT + NOT_REFERENCED=0D CHAR_ARRAY_DEFIN =3D 'unsigned char'=0D COMMON_FILE_NAME =3D 'Strings'=0D -STRING_TOKEN =3D re.compile('STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILI= NE | re.UNICODE)=0D +STRING_TOKEN =3D re.compile(=0D + 'STRING_TOKEN *\(([A-Z0-9_]+) *\)', re.MULTILINE | re.UNICODE)=0D =0D EFI_HII_ARRAY_SIZE_LENGTH =3D 4=0D EFI_HII_PACKAGE_HEADER_LENGTH =3D 4=0D @@ -65,17 +66,19 @@ EFI_STRING_ID_LENGTH =3D 2 EFI_HII_LANGUAGE_WINDOW =3D 0=0D EFI_HII_LANGUAGE_WINDOW_LENGTH =3D 2=0D EFI_HII_LANGUAGE_WINDOW_NUMBER =3D 16=0D -EFI_HII_STRING_PACKAGE_HDR_LENGTH =3D EFI_HII_PACKAGE_HEADER_LENGTH + EFI_= HII_HDR_SIZE_LENGTH + EFI_HII_STRING_OFFSET_LENGTH + EFI_HII_LANGUAGE_WINDO= W_LENGTH * EFI_HII_LANGUAGE_WINDOW_NUMBER + EFI_STRING_ID_LENGTH=0D +EFI_HII_STRING_PACKAGE_HDR_LENGTH =3D EFI_HII_PACKAGE_HEADER_LENGTH + EFI_= HII_HDR_SIZE_LENGTH + \=0D + EFI_HII_STRING_OFFSET_LENGTH + EFI_HII_LANGUAGE_WINDOW_LENGTH * \=0D + EFI_HII_LANGUAGE_WINDOW_NUMBER + EFI_STRING_ID_LENGTH=0D =0D -H_C_FILE_HEADER =3D ['//', \=0D - '// DO NOT EDIT -- auto-generated file', \=0D - '//', \=0D - '// This file is generated by the StrGather utility', = \=0D +H_C_FILE_HEADER =3D ['//',=0D + '// DO NOT EDIT -- auto-generated file',=0D + '//',=0D + '// This file is generated by the StrGather utility',= =0D '//']=0D LANGUAGE_NAME_STRING_NAME =3D '$LANGUAGE_NAME'=0D PRINTABLE_LANGUAGE_NAME_STRING_NAME =3D '$PRINTABLE_LANGUAGE_NAME'=0D =0D -## Convert a dec number to a hex string=0D +# Convert a dec number to a hex string=0D #=0D # Convert a dec number to a formatted hex string in length digit=0D # The digit is set to default 8=0D @@ -88,10 +91,12 @@ PRINTABLE_LANGUAGE_NAME_STRING_NAME =3D '$PRINTABLE_LAN= GUAGE_NAME' #=0D # @retval: The formatted hex string=0D #=0D -def DecToHexStr(Dec, Digit =3D 8):=0D +=0D +=0D +def DecToHexStr(Dec, Digit=3D8):=0D return '0x{0:0{1}X}'.format(Dec, Digit)=0D =0D -## Convert a dec number to a hex list=0D +# Convert a dec number to a hex list=0D #=0D # Convert a dec number to a formatted hex list in size digit=0D # The digit is set to default 8=0D @@ -103,11 +108,13 @@ def DecToHexStr(Dec, Digit =3D 8): #=0D # @retval: A list for formatted hex string=0D #=0D -def DecToHexList(Dec, Digit =3D 8):=0D +=0D +=0D +def DecToHexList(Dec, Digit=3D8):=0D Hex =3D '{0:0{1}X}'.format(Dec, Digit)=0D return ["0x" + Hex[Bit:Bit + 2] for Bit in range(Digit - 2, -1, -2)]=0D =0D -## Convert a acsii string to a hex list=0D +# Convert a acsii string to a hex list=0D #=0D # Convert a acsii string to a formatted hex list=0D # AscToHexList('en-US') is ['0x65', '0x6E', '0x2D', '0x55', '0x53']=0D @@ -116,13 +123,15 @@ def DecToHexList(Dec, Digit =3D 8): #=0D # @retval: A list for formatted hex string=0D #=0D +=0D +=0D def AscToHexList(Ascii):=0D try:=0D return ['0x{0:02X}'.format(Item) for Item in Ascii]=0D except:=0D return ['0x{0:02X}'.format(ord(Item)) for Item in Ascii]=0D =0D -## Create content of .h file=0D +# Create content of .h file=0D #=0D # Create content of .h file=0D #=0D @@ -133,16 +142,22 @@ def AscToHexList(Ascii): #=0D # @retval Str: A string of .h file content=0D #=0D +=0D +=0D def CreateHFileContent(BaseName, UniObjectClass, IsCompatibleMode, UniGenC= Flag):=0D Str =3D []=0D ValueStartPtr =3D 60=0D - Line =3D COMMENT_DEFINE_STR + ' ' + LANGUAGE_NAME_STRING_NAME + ' ' * = (ValueStartPtr - len(DEFINE_STR + LANGUAGE_NAME_STRING_NAME)) + DecToHexStr= (0, 4) + COMMENT_NOT_REFERENCED=0D + Line =3D COMMENT_DEFINE_STR + ' ' + LANGUAGE_NAME_STRING_NAME + ' ' * = \=0D + (ValueStartPtr - len(DEFINE_STR + LANGUAGE_NAME_STRING_NAME)) + \= =0D + DecToHexStr(0, 4) + COMMENT_NOT_REFERENCED=0D Str =3D WriteLine(Str, Line)=0D - Line =3D COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAM= E + ' ' * (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_= NAME)) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED=0D + Line =3D COMMENT_DEFINE_STR + ' ' + PRINTABLE_LANGUAGE_NAME_STRING_NAM= E + ' ' * \=0D + (ValueStartPtr - len(DEFINE_STR + PRINTABLE_LANGUAGE_NAME_STRING_N= AME)=0D + ) + DecToHexStr(1, 4) + COMMENT_NOT_REFERENCED=0D Str =3D WriteLine(Str, Line)=0D UnusedStr =3D ''=0D =0D - #Group the referred/Unused STRING token together.=0D + # Group the referred/Unused STRING token together.=0D for Index in range(2, len(UniObjectClass.OrderedStringList[UniObjectCl= ass.LanguageDef[0][0]])):=0D StringItem =3D UniObjectClass.OrderedStringList[UniObjectClass.Lan= guageDef[0][0]][Index]=0D Name =3D StringItem.StringName=0D @@ -152,25 +167,31 @@ def CreateHFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniGenCFlag): Line =3D ''=0D if Referenced =3D=3D True:=0D if (ValueStartPtr - len(DEFINE_STR + Name)) <=3D 0:=0D - Line =3D DEFINE_STR + ' ' + Name + ' ' + DecToHexStr(T= oken, 4)=0D + Line =3D DEFINE_STR + ' ' + Name + \=0D + ' ' + DecToHexStr(Token, 4)=0D else:=0D - Line =3D DEFINE_STR + ' ' + Name + ' ' * (ValueStartPt= r - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4)=0D + Line =3D DEFINE_STR + ' ' + Name + ' ' * \=0D + (ValueStartPtr - len(DEFINE_STR + Name)) + \=0D + DecToHexStr(Token, 4)=0D Str =3D WriteLine(Str, Line)=0D else:=0D if (ValueStartPtr - len(DEFINE_STR + Name)) <=3D 0:=0D - Line =3D COMMENT_DEFINE_STR + ' ' + Name + ' ' + DecTo= HexStr(Token, 4) + COMMENT_NOT_REFERENCED=0D + Line =3D COMMENT_DEFINE_STR + ' ' + Name + ' ' + \=0D + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED=0D else:=0D - Line =3D COMMENT_DEFINE_STR + ' ' + Name + ' ' * (Valu= eStartPtr - len(DEFINE_STR + Name)) + DecToHexStr(Token, 4) + COMMENT_NOT_R= EFERENCED=0D + Line =3D COMMENT_DEFINE_STR + ' ' + Name + ' ' * \=0D + (ValueStartPtr - len(DEFINE_STR + Name)) + \=0D + DecToHexStr(Token, 4) + COMMENT_NOT_REFERENCED=0D UnusedStr =3D WriteLine(UnusedStr, Line)=0D =0D - Str.extend( UnusedStr)=0D + Str.extend(UnusedStr)=0D =0D Str =3D WriteLine(Str, '')=0D if IsCompatibleMode or UniGenCFlag:=0D Str =3D WriteLine(Str, 'extern unsigned char ' + BaseName + 'Strin= gs[];')=0D return "".join(Str)=0D =0D -## Create a complete .h file=0D +# Create a complete .h file=0D #=0D # Create a complet .h file with file header and file content=0D #=0D @@ -181,21 +202,26 @@ def CreateHFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniGenCFlag): #=0D # @retval Str: A string of complete .h file=0D #=0D +=0D +=0D def CreateHFile(BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag):= =0D - HFile =3D WriteLine('', CreateHFileContent(BaseName, UniObjectClass, I= sCompatibleMode, UniGenCFlag))=0D + HFile =3D WriteLine('', CreateHFileContent(=0D + BaseName, UniObjectClass, IsCompatibleMode, UniGenCFlag))=0D =0D return "".join(HFile)=0D =0D -## Create a buffer to store all items in an array=0D +# Create a buffer to store all items in an array=0D #=0D # @param BinBuffer Buffer to contain Binary data.=0D # @param Array: The array need to be formatted=0D #=0D +=0D +=0D def CreateBinBuffer(BinBuffer, Array):=0D for Item in Array:=0D BinBuffer.write(pack("B", int(Item, 16)))=0D =0D -## Create a formatted string all items in an array=0D +# Create a formatted string all items in an array=0D #=0D # Use ',' to join each item in an array, and break an new line when reachi= ng the width (default is 16)=0D #=0D @@ -204,7 +230,9 @@ def CreateBinBuffer(BinBuffer, Array): #=0D # @retval ArrayItem: A string for all formatted array items=0D #=0D -def CreateArrayItem(Array, Width =3D 16):=0D +=0D +=0D +def CreateArrayItem(Array, Width=3D16):=0D MaxLength =3D Width=0D Index =3D 0=0D Line =3D ' '=0D @@ -222,7 +250,7 @@ def CreateArrayItem(Array, Width =3D 16): =0D return "".join(ArrayItem)=0D =0D -## CreateCFileStringValue=0D +# CreateCFileStringValue=0D #=0D # Create a line with string value=0D #=0D @@ -231,13 +259,14 @@ def CreateArrayItem(Array, Width =3D 16): # @retval Str: A formatted string with string value=0D #=0D =0D +=0D def CreateCFileStringValue(Value):=0D Value =3D [StringBlockType] + Value=0D Str =3D WriteLine('', CreateArrayItem(Value))=0D =0D return "".join(Str)=0D =0D -## GetFilteredLanguage=0D +# GetFilteredLanguage=0D #=0D # apply get best language rules to the UNI language code list=0D #=0D @@ -246,6 +275,8 @@ def CreateCFileStringValue(Value): #=0D # @retval UniLanguageListFiltered: the filtered language code=0D #=0D +=0D +=0D def GetFilteredLanguage(UniLanguageList, LanguageFilterList):=0D UniLanguageListFiltered =3D []=0D # if filter list is empty, then consider there is no filter=0D @@ -269,12 +300,14 @@ def GetFilteredLanguage(UniLanguageList, LanguageFilt= erList): =0D for UniLanguage in UniLanguageList:=0D if UniLanguage.find('-') !=3D -1:=0D - UniLanguagePrimaryTag =3D UniLanguage[0:UniLanguage.fi= nd('-')].lower()=0D + UniLanguagePrimaryTag =3D UniLanguage[0:UniLanguage.fi= nd(=0D + '-')].lower()=0D else:=0D UniLanguagePrimaryTag =3D UniLanguage=0D =0D if len(UniLanguagePrimaryTag) =3D=3D 3:=0D - UniLanguagePrimaryTag =3D LangConvTable.get(UniLanguag= ePrimaryTag)=0D + UniLanguagePrimaryTag =3D LangConvTable.get(=0D + UniLanguagePrimaryTag)=0D =0D if PrimaryTag =3D=3D UniLanguagePrimaryTag:=0D if UniLanguage not in UniLanguageListFiltered:=0D @@ -294,10 +327,10 @@ def GetFilteredLanguage(UniLanguageList, LanguageFilt= erList): break=0D else:=0D UniLanguageListFiltered.append(DefaultTag)=0D - return UniLanguageListFiltered=0D + return UniLanguageListFiltered=0D =0D =0D -## Create content of .c file=0D +# Create content of .c file=0D #=0D # Create content of .c file=0D #=0D @@ -322,14 +355,15 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, LanguageFilterList =3D FilterInfo[1]=0D else:=0D # EDK module is using ISO639-2 format filter, convert to the RFC46= 46 format=0D - LanguageFilterList =3D [LangConvTable.get(F.lower()) for F in Filt= erInfo[1]]=0D + LanguageFilterList =3D [LangConvTable.get(=0D + F.lower()) for F in FilterInfo[1]]=0D =0D UniLanguageList =3D []=0D for IndexI in range(len(UniObjectClass.LanguageDef)):=0D UniLanguageList +=3D [UniObjectClass.LanguageDef[IndexI][0]]=0D =0D - UniLanguageListFiltered =3D GetFilteredLanguage(UniLanguageList, Langu= ageFilterList)=0D -=0D + UniLanguageListFiltered =3D GetFilteredLanguage(=0D + UniLanguageList, LanguageFilterList)=0D =0D #=0D # Create lines for each language's strings=0D @@ -358,16 +392,21 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, Index =3D Index + 1=0D else:=0D if NumberOfUseOtherLangDef > 0:=0D - StrStringValue =3D WriteLine(StrStringValue, CreateArr= ayItem([StringSkipType] + DecToHexList(NumberOfUseOtherLangDef, 4)))=0D - CreateBinBuffer (StringBuffer, ([StringSkipType] + Dec= ToHexList(NumberOfUseOtherLangDef, 4)))=0D + StrStringValue =3D WriteLine(StrStringValue, CreateArr= ayItem(=0D + [StringSkipType] + DecToHexList(NumberOfUseOtherLa= ngDef, 4)))=0D + CreateBinBuffer(=0D + StringBuffer, ([StringSkipType] + DecToHexList(Num= berOfUseOtherLangDef, 4)))=0D NumberOfUseOtherLangDef =3D 0=0D ArrayLength =3D ArrayLength + 3=0D if Referenced and Item.Token > 0:=0D Index =3D Index + 1=0D - StrStringValue =3D WriteLine(StrStringValue, "// %s: %= s:%s" % (DecToHexStr(Index, 4), Name, DecToHexStr(Token, 4)))=0D - StrStringValue =3D Write(StrStringValue, CreateCFileSt= ringValue(Value))=0D - CreateBinBuffer (StringBuffer, [StringBlockType] + Val= ue)=0D - ArrayLength =3D ArrayLength + Item.Length + 1 # 1 is f= or the length of string type=0D + StrStringValue =3D WriteLine(=0D + StrStringValue, "// %s: %s:%s" % (DecToHexStr(Inde= x, 4), Name, DecToHexStr(Token, 4)))=0D + StrStringValue =3D Write(=0D + StrStringValue, CreateCFileStringValue(Value))=0D + CreateBinBuffer(StringBuffer, [StringBlockType] + Valu= e)=0D + ArrayLength =3D ArrayLength + Item.Length + \=0D + 1 # 1 is for the length of string type=0D =0D #=0D # EFI_HII_PACKAGE_HEADER=0D @@ -382,13 +421,13 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, TotalLength =3D TotalLength + ArrayLength=0D =0D List =3D DecToHexList(ArrayLength, 6) + \=0D - [StringPackageType] + \=0D - DecToHexList(Offset) + \=0D - DecToHexList(Offset) + \=0D - DecToHexList(EFI_HII_LANGUAGE_WINDOW, EFI_HII_LANGUAGE_WIND= OW_LENGTH * 2) * EFI_HII_LANGUAGE_WINDOW_NUMBER + \=0D - DecToHexList(EFI_STRING_ID, 4) + \=0D - AscToHexList(Language) + \=0D - DecToHexList(0, 2)=0D + [StringPackageType] + \=0D + DecToHexList(Offset) + \=0D + DecToHexList(Offset) + \=0D + DecToHexList(EFI_HII_LANGUAGE_WINDOW, EFI_HII_LANGUAGE_WINDOW_= LENGTH * 2) * EFI_HII_LANGUAGE_WINDOW_NUMBER + \=0D + DecToHexList(EFI_STRING_ID, 4) + \=0D + AscToHexList(Language) + \=0D + DecToHexList(0, 2)=0D Str =3D WriteLine(Str, CreateArrayItem(List, 16) + '\n')=0D =0D #=0D @@ -406,23 +445,25 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, # Create binary UNI string=0D #=0D if UniBinBuffer:=0D - CreateBinBuffer (UniBinBuffer, List)=0D - UniBinBuffer.write (StringBuffer.getvalue())=0D - UniBinBuffer.write (pack("B", int(EFI_HII_SIBT_END, 16)))=0D + CreateBinBuffer(UniBinBuffer, List)=0D + UniBinBuffer.write(StringBuffer.getvalue())=0D + UniBinBuffer.write(pack("B", int(EFI_HII_SIBT_END, 16)))=0D StringBuffer.close()=0D =0D #=0D # Create line for string variable name=0D # "unsigned char $(BaseName)Strings[] =3D {"=0D #=0D - AllStr =3D WriteLine('', CHAR_ARRAY_DEFIN + ' ' + BaseName + COMMON_FI= LE_NAME + '[] =3D {\n')=0D + AllStr =3D WriteLine('', CHAR_ARRAY_DEFIN + ' ' +=0D + BaseName + COMMON_FILE_NAME + '[] =3D {\n')=0D =0D if IsCompatibleMode:=0D #=0D # Create FRAMEWORK_EFI_HII_PACK_HEADER in compatible mode=0D #=0D AllStr =3D WriteLine(AllStr, '// FRAMEWORK PACKAGE HEADER Length')= =0D - AllStr =3D WriteLine(AllStr, CreateArrayItem(DecToHexList(TotalLen= gth + 2)) + '\n')=0D + AllStr =3D WriteLine(AllStr, CreateArrayItem(=0D + DecToHexList(TotalLength + 2)) + '\n')=0D AllStr =3D WriteLine(AllStr, '// FRAMEWORK PACKAGE HEADER Type')=0D AllStr =3D WriteLine(AllStr, CreateArrayItem(DecToHexList(2, 4)) += '\n')=0D else:=0D @@ -430,7 +471,8 @@ def CreateCFileContent(BaseName, UniObjectClass, IsComp= atibleMode, UniBinBuffer, # Create whole array length in UEFI mode=0D #=0D AllStr =3D WriteLine(AllStr, '// STRGATHER_OUTPUT_HEADER')=0D - AllStr =3D WriteLine(AllStr, CreateArrayItem(DecToHexList(TotalLen= gth)) + '\n')=0D + AllStr =3D WriteLine(AllStr, CreateArrayItem(=0D + DecToHexList(TotalLength)) + '\n')=0D =0D #=0D # Join package data=0D @@ -439,17 +481,19 @@ def CreateCFileContent(BaseName, UniObjectClass, IsCo= mpatibleMode, UniBinBuffer, =0D return "".join(AllStr)=0D =0D -## Create end of .c file=0D +# Create end of .c file=0D #=0D # Create end of .c file=0D #=0D # @retval Str: A string of .h file end=0D #=0D +=0D +=0D def CreateCFileEnd():=0D Str =3D Write('', '};')=0D return Str=0D =0D -## Create a .c file=0D +# Create a .c file=0D #=0D # Create a complete .c file=0D #=0D @@ -460,13 +504,16 @@ def CreateCFileEnd(): #=0D # @retval CFile: A string of complete .c file=0D #=0D +=0D +=0D def CreateCFile(BaseName, UniObjectClass, IsCompatibleMode, FilterInfo):=0D CFile =3D ''=0D - CFile =3D WriteLine(CFile, CreateCFileContent(BaseName, UniObjectClass= , IsCompatibleMode, None, FilterInfo))=0D + CFile =3D WriteLine(CFile, CreateCFileContent(=0D + BaseName, UniObjectClass, IsCompatibleMode, None, FilterInfo))=0D CFile =3D WriteLine(CFile, CreateCFileEnd())=0D return "".join(CFile)=0D =0D -## GetFileList=0D +# GetFileList=0D #=0D # Get a list for all files=0D #=0D @@ -475,9 +522,12 @@ def CreateCFile(BaseName, UniObjectClass, IsCompatible= Mode, FilterInfo): #=0D # @retval FileList: A list of all files found=0D #=0D +=0D +=0D def GetFileList(SourceFileList, IncludeList, SkipList):=0D if IncludeList is None:=0D - EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "Include pat= h for unicode file is not defined")=0D + EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR,=0D + "Include path for unicode file is not defined")=0D =0D FileList =3D []=0D if SkipList is None:=0D @@ -499,7 +549,8 @@ def GetFileList(SourceFileList, IncludeList, SkipList): IsSkip =3D False=0D for Skip in SkipList:=0D if os.path.splitext(File)[1].upper() =3D=3D Skip.upper():= =0D - EdkLogger.verbose("Skipped %s for string token uses se= arch" % File)=0D + EdkLogger.verbose(=0D + "Skipped %s for string token uses search" % File)= =0D IsSkip =3D True=0D break=0D =0D @@ -510,7 +561,7 @@ def GetFileList(SourceFileList, IncludeList, SkipList): =0D return FileList=0D =0D -## SearchString=0D +# SearchString=0D #=0D # Search whether all string defined in UniObjectClass are referenced=0D # All string used should be set to Referenced=0D @@ -521,6 +572,8 @@ def GetFileList(SourceFileList, IncludeList, SkipList): #=0D # @retval UniObjectClass: UniObjectClass after searched=0D #=0D +=0D +=0D def SearchString(UniObjectClass, FileList, IsCompatibleMode):=0D if FileList =3D=3D []:=0D return UniObjectClass=0D @@ -531,55 +584,65 @@ def SearchString(UniObjectClass, FileList, IsCompatib= leMode): Lines =3D open(File, 'r')=0D for Line in Lines:=0D for StrName in STRING_TOKEN.findall(Line):=0D - EdkLogger.debug(EdkLogger.DEBUG_5, "Found string i= dentifier: " + StrName)=0D + EdkLogger.debug(EdkLogger.DEBUG_5,=0D + "Found string identifier: " + StrN= ame)=0D UniObjectClass.SetStringReferenced(StrName)=0D except:=0D - EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, "SearchS= tring: Error while processing file", File=3DFile, RaiseError=3DFalse)=0D + EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR,=0D + "SearchString: Error while processing file", F= ile=3DFile, RaiseError=3DFalse)=0D raise=0D =0D UniObjectClass.ReToken()=0D =0D return UniObjectClass=0D =0D -## GetStringFiles=0D +# GetStringFiles=0D #=0D # This function is used for UEFI2.1 spec=0D #=0D #=0D -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, []]):=0D +=0D +=0D +def GetStringFiles(UniFilList, SourceFileList, IncludeList, IncludePathLis= t, SkipList, BaseName, IsCompatibleMode=3DFalse, ShellMode=3DFalse, UniGenC= Flag=3DTrue, UniGenBinBuffer=3DNone, FilterInfo=3D[True, []]):=0D if len(UniFilList) > 0:=0D if ShellMode:=0D #=0D # support ISO 639-2 codes in .UNI files of EDK Shell=0D #=0D - Uni =3D UniFileClassObject(sorted(UniFilList, key=3Dlambda x: = x.File), True, IncludePathList)=0D + Uni =3D UniFileClassObject(=0D + sorted(UniFilList, key=3Dlambda x: x.File), True, IncludeP= athList)=0D else:=0D - Uni =3D UniFileClassObject(sorted(UniFilList, key=3Dlambda x: = x.File), IsCompatibleMode, IncludePathList)=0D + Uni =3D UniFileClassObject(=0D + sorted(UniFilList, key=3Dlambda x: x.File), IsCompatibleMo= de, IncludePathList)=0D else:=0D - EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR, 'No unicode = files given')=0D + EdkLogger.error("UnicodeStringGather", AUTOGEN_ERROR,=0D + 'No unicode files given')=0D =0D FileList =3D GetFileList(SourceFileList, IncludeList, SkipList)=0D =0D - Uni =3D SearchString(Uni, sorted (FileList), IsCompatibleMode)=0D + Uni =3D SearchString(Uni, sorted(FileList), IsCompatibleMode)=0D =0D HFile =3D CreateHFile(BaseName, Uni, IsCompatibleMode, UniGenCFlag)=0D CFile =3D None=0D if IsCompatibleMode or UniGenCFlag:=0D CFile =3D CreateCFile(BaseName, Uni, IsCompatibleMode, FilterInfo)= =0D if UniGenBinBuffer:=0D - CreateCFileContent(BaseName, Uni, IsCompatibleMode, UniGenBinBuffe= r, FilterInfo)=0D + CreateCFileContent(BaseName, Uni, IsCompatibleMode,=0D + UniGenBinBuffer, FilterInfo)=0D =0D return HFile, CFile=0D =0D #=0D # Write an item=0D #=0D +=0D +=0D def Write(Target, Item):=0D - if isinstance(Target,str):=0D + if isinstance(Target, str):=0D Target =3D [Target]=0D if not Target:=0D Target =3D []=0D - if isinstance(Item,list):=0D + if isinstance(Item, list):=0D Target.extend(Item)=0D else:=0D Target.append(Item)=0D @@ -588,8 +651,10 @@ def Write(Target, Item): #=0D # Write an item with a break line=0D #=0D +=0D +=0D def WriteLine(Target, Item):=0D - if isinstance(Target,str):=0D + if isinstance(Target, str):=0D Target =3D [Target]=0D if not Target:=0D Target =3D []=0D @@ -600,14 +665,15 @@ def WriteLine(Target, Item): Target.append('\n')=0D return Target=0D =0D +=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D # script.=0D if __name__ =3D=3D '__main__':=0D EdkLogger.info('start')=0D =0D UniFileList =3D [=0D - r'C:\\Edk\\Strings2.uni',=0D - r'C:\\Edk\\Strings.uni'=0D + r'C:\\Edk\\Strings2.uni',=0D + r'C:\\Edk\\Strings.uni'=0D ]=0D =0D SrcFileList =3D []=0D @@ -616,12 +682,13 @@ if __name__ =3D=3D '__main__': SrcFileList.append(File)=0D =0D IncludeList =3D [=0D - r'C:\\Edk'=0D + r'C:\\Edk'=0D ]=0D =0D SkipList =3D ['.inf', '.uni']=0D BaseName =3D 'DriverSample'=0D - (h, c) =3D GetStringFiles(UniFileList, SrcFileList, IncludeList, SkipL= ist, BaseName, True)=0D + (h, c) =3D GetStringFiles(UniFileList, SrcFileList,=0D + IncludeList, SkipList, BaseName, True)=0D hfile =3D open('unistring.h', 'w')=0D cfile =3D open('unistring.c', 'w')=0D hfile.write(h)=0D diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/= Source/Python/AutoGen/UniClassObject.py index b16330e36825..753364560e04 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to collect all defined strings in multiple uni files=0D #=0D #=0D @@ -11,7 +11,9 @@ # Import Modules=0D #=0D from __future__ import print_function=0D -import Common.LongFilePathOs as os, codecs, re=0D +import Common.LongFilePathOs as os=0D +import codecs=0D +import re=0D import shlex=0D import Common.EdkLogger as EdkLogger=0D from io import BytesIO=0D @@ -38,9 +40,10 @@ NULL =3D u'\u0000' TAB =3D u'\t'=0D BACK_SLASH_PLACEHOLDER =3D u'\u0006'=0D =0D -gIncludePattern =3D re.compile("^#include +[\"<]+([^\"< >]+)[>\"]+$", re.M= ULTILINE | re.UNICODE)=0D +gIncludePattern =3D re.compile(=0D + "^#include +[\"<]+([^\"< >]+)[>\"]+$", re.MULTILINE | re.UNICODE)=0D =0D -## Convert a unicode string to a Hex list=0D +# Convert a unicode string to a Hex list=0D #=0D # Convert a unicode string to a Hex list=0D # UniToHexList('ABC') is ['0x41', '0x00', '0x42', '0x00', '0x43', '0x00']= =0D @@ -49,6 +52,8 @@ gIncludePattern =3D re.compile("^#include +[\"<]+([^\"< >= ]+)[>\"]+$", re.MULTILINE #=0D # @retval List: The formatted hex list=0D #=0D +=0D +=0D def UniToHexList(Uni):=0D List =3D []=0D for Item in Uni:=0D @@ -57,40 +62,41 @@ def UniToHexList(Uni): List.append('0x' + Temp[0:2])=0D return List=0D =0D -LangConvTable =3D {'eng':'en', 'fra':'fr', \=0D - 'aar':'aa', 'abk':'ab', 'ave':'ae', 'afr':'af', 'aka':'ak= ', 'amh':'am', \=0D - 'arg':'an', 'ara':'ar', 'asm':'as', 'ava':'av', 'aym':'ay= ', 'aze':'az', \=0D - 'bak':'ba', 'bel':'be', 'bul':'bg', 'bih':'bh', 'bis':'bi= ', 'bam':'bm', \=0D - 'ben':'bn', 'bod':'bo', 'bre':'br', 'bos':'bs', 'cat':'ca= ', 'che':'ce', \=0D - 'cha':'ch', 'cos':'co', 'cre':'cr', 'ces':'cs', 'chu':'cu= ', 'chv':'cv', \=0D - 'cym':'cy', 'dan':'da', 'deu':'de', 'div':'dv', 'dzo':'dz= ', 'ewe':'ee', \=0D - 'ell':'el', 'epo':'eo', 'spa':'es', 'est':'et', 'eus':'eu= ', 'fas':'fa', \=0D - 'ful':'ff', 'fin':'fi', 'fij':'fj', 'fao':'fo', 'fry':'fy= ', 'gle':'ga', \=0D - 'gla':'gd', 'glg':'gl', 'grn':'gn', 'guj':'gu', 'glv':'gv= ', 'hau':'ha', \=0D - 'heb':'he', 'hin':'hi', 'hmo':'ho', 'hrv':'hr', 'hat':'ht= ', 'hun':'hu', \=0D - 'hye':'hy', 'her':'hz', 'ina':'ia', 'ind':'id', 'ile':'ie= ', 'ibo':'ig', \=0D - 'iii':'ii', 'ipk':'ik', 'ido':'io', 'isl':'is', 'ita':'it= ', 'iku':'iu', \=0D - 'jpn':'ja', 'jav':'jv', 'kat':'ka', 'kon':'kg', 'kik':'ki= ', 'kua':'kj', \=0D - 'kaz':'kk', 'kal':'kl', 'khm':'km', 'kan':'kn', 'kor':'ko= ', 'kau':'kr', \=0D - 'kas':'ks', 'kur':'ku', 'kom':'kv', 'cor':'kw', 'kir':'ky= ', 'lat':'la', \=0D - 'ltz':'lb', 'lug':'lg', 'lim':'li', 'lin':'ln', 'lao':'lo= ', 'lit':'lt', \=0D - 'lub':'lu', 'lav':'lv', 'mlg':'mg', 'mah':'mh', 'mri':'mi= ', 'mkd':'mk', \=0D - 'mal':'ml', 'mon':'mn', 'mar':'mr', 'msa':'ms', 'mlt':'mt= ', 'mya':'my', \=0D - 'nau':'na', 'nob':'nb', 'nde':'nd', 'nep':'ne', 'ndo':'ng= ', 'nld':'nl', \=0D - 'nno':'nn', 'nor':'no', 'nbl':'nr', 'nav':'nv', 'nya':'ny= ', 'oci':'oc', \=0D - 'oji':'oj', 'orm':'om', 'ori':'or', 'oss':'os', 'pan':'pa= ', 'pli':'pi', \=0D - 'pol':'pl', 'pus':'ps', 'por':'pt', 'que':'qu', 'roh':'rm= ', 'run':'rn', \=0D - 'ron':'ro', 'rus':'ru', 'kin':'rw', 'san':'sa', 'srd':'sc= ', 'snd':'sd', \=0D - 'sme':'se', 'sag':'sg', 'sin':'si', 'slk':'sk', 'slv':'sl= ', 'smo':'sm', \=0D - 'sna':'sn', 'som':'so', 'sqi':'sq', 'srp':'sr', 'ssw':'ss= ', 'sot':'st', \=0D - 'sun':'su', 'swe':'sv', 'swa':'sw', 'tam':'ta', 'tel':'te= ', 'tgk':'tg', \=0D - 'tha':'th', 'tir':'ti', 'tuk':'tk', 'tgl':'tl', 'tsn':'tn= ', 'ton':'to', \=0D - 'tur':'tr', 'tso':'ts', 'tat':'tt', 'twi':'tw', 'tah':'ty= ', 'uig':'ug', \=0D - 'ukr':'uk', 'urd':'ur', 'uzb':'uz', 'ven':'ve', 'vie':'vi= ', 'vol':'vo', \=0D - 'wln':'wa', 'wol':'wo', 'xho':'xh', 'yid':'yi', 'yor':'yo= ', 'zha':'za', \=0D - 'zho':'zh', 'zul':'zu'}=0D =0D -## GetLanguageCode=0D +LangConvTable =3D {'eng': 'en', 'fra': 'fr',=0D + 'aar': 'aa', 'abk': 'ab', 'ave': 'ae', 'afr': 'af', 'aka'= : 'ak', 'amh': 'am',=0D + 'arg': 'an', 'ara': 'ar', 'asm': 'as', 'ava': 'av', 'aym'= : 'ay', 'aze': 'az',=0D + 'bak': 'ba', 'bel': 'be', 'bul': 'bg', 'bih': 'bh', 'bis'= : 'bi', 'bam': 'bm',=0D + 'ben': 'bn', 'bod': 'bo', 'bre': 'br', 'bos': 'bs', 'cat'= : 'ca', 'che': 'ce',=0D + 'cha': 'ch', 'cos': 'co', 'cre': 'cr', 'ces': 'cs', 'chu'= : 'cu', 'chv': 'cv',=0D + 'cym': 'cy', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'dzo'= : 'dz', 'ewe': 'ee',=0D + 'ell': 'el', 'epo': 'eo', 'spa': 'es', 'est': 'et', 'eus'= : 'eu', 'fas': 'fa',=0D + 'ful': 'ff', 'fin': 'fi', 'fij': 'fj', 'fao': 'fo', 'fry'= : 'fy', 'gle': 'ga',=0D + 'gla': 'gd', 'glg': 'gl', 'grn': 'gn', 'guj': 'gu', 'glv'= : 'gv', 'hau': 'ha',=0D + 'heb': 'he', 'hin': 'hi', 'hmo': 'ho', 'hrv': 'hr', 'hat'= : 'ht', 'hun': 'hu',=0D + 'hye': 'hy', 'her': 'hz', 'ina': 'ia', 'ind': 'id', 'ile'= : 'ie', 'ibo': 'ig',=0D + 'iii': 'ii', 'ipk': 'ik', 'ido': 'io', 'isl': 'is', 'ita'= : 'it', 'iku': 'iu',=0D + 'jpn': 'ja', 'jav': 'jv', 'kat': 'ka', 'kon': 'kg', 'kik'= : 'ki', 'kua': 'kj',=0D + 'kaz': 'kk', 'kal': 'kl', 'khm': 'km', 'kan': 'kn', 'kor'= : 'ko', 'kau': 'kr',=0D + 'kas': 'ks', 'kur': 'ku', 'kom': 'kv', 'cor': 'kw', 'kir'= : 'ky', 'lat': 'la',=0D + 'ltz': 'lb', 'lug': 'lg', 'lim': 'li', 'lin': 'ln', 'lao'= : 'lo', 'lit': 'lt',=0D + 'lub': 'lu', 'lav': 'lv', 'mlg': 'mg', 'mah': 'mh', 'mri'= : 'mi', 'mkd': 'mk',=0D + 'mal': 'ml', 'mon': 'mn', 'mar': 'mr', 'msa': 'ms', 'mlt'= : 'mt', 'mya': 'my',=0D + 'nau': 'na', 'nob': 'nb', 'nde': 'nd', 'nep': 'ne', 'ndo'= : 'ng', 'nld': 'nl',=0D + 'nno': 'nn', 'nor': 'no', 'nbl': 'nr', 'nav': 'nv', 'nya'= : 'ny', 'oci': 'oc',=0D + 'oji': 'oj', 'orm': 'om', 'ori': 'or', 'oss': 'os', 'pan'= : 'pa', 'pli': 'pi',=0D + 'pol': 'pl', 'pus': 'ps', 'por': 'pt', 'que': 'qu', 'roh'= : 'rm', 'run': 'rn',=0D + 'ron': 'ro', 'rus': 'ru', 'kin': 'rw', 'san': 'sa', 'srd'= : 'sc', 'snd': 'sd',=0D + 'sme': 'se', 'sag': 'sg', 'sin': 'si', 'slk': 'sk', 'slv'= : 'sl', 'smo': 'sm',=0D + 'sna': 'sn', 'som': 'so', 'sqi': 'sq', 'srp': 'sr', 'ssw'= : 'ss', 'sot': 'st',=0D + 'sun': 'su', 'swe': 'sv', 'swa': 'sw', 'tam': 'ta', 'tel'= : 'te', 'tgk': 'tg',=0D + 'tha': 'th', 'tir': 'ti', 'tuk': 'tk', 'tgl': 'tl', 'tsn'= : 'tn', 'ton': 'to',=0D + 'tur': 'tr', 'tso': 'ts', 'tat': 'tt', 'twi': 'tw', 'tah'= : 'ty', 'uig': 'ug',=0D + 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz', 'ven': 've', 'vie'= : 'vi', 'vol': 'vo',=0D + 'wln': 'wa', 'wol': 'wo', 'xho': 'xh', 'yid': 'yi', 'yor'= : 'yo', 'zha': 'za',=0D + 'zho': 'zh', 'zul': 'zu'}=0D +=0D +# GetLanguageCode=0D #=0D # Check the language code read from .UNI file and convert ISO 639-2 codes = to RFC 4646 codes if appropriate=0D # ISO 639-2 language codes supported in compatibility mode=0D @@ -100,6 +106,8 @@ LangConvTable =3D {'eng':'en', 'fra':'fr', \ #=0D # @retval LangName: Valid language code in RFC 4646 format or None=0D #=0D +=0D +=0D def GetLanguageCode(LangName, IsCompatibleMode, File):=0D length =3D len(LangName)=0D if IsCompatibleMode:=0D @@ -109,7 +117,8 @@ def GetLanguageCode(LangName, IsCompatibleMode, File): return TempLangName=0D return LangName=0D else:=0D - EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invali= d ISO 639-2 language code : %s" % LangName, File)=0D + EdkLogger.error("Unicode File Parser", FORMAT_INVALID,=0D + "Invalid ISO 639-2 language code : %s" % LangN= ame, File)=0D =0D if (LangName[0] =3D=3D 'X' or LangName[0] =3D=3D 'x') and LangName[1] = =3D=3D '-':=0D return LangName=0D @@ -128,14 +137,17 @@ def GetLanguageCode(LangName, IsCompatibleMode, File): if LangName[0:3].isalpha() and LangConvTable.get(LangName.lower())= is None and LangName[3] =3D=3D '-':=0D return LangName=0D =0D - EdkLogger.error("Unicode File Parser", FORMAT_INVALID, "Invalid RFC 46= 46 language code : %s" % LangName, File)=0D + EdkLogger.error("Unicode File Parser", FORMAT_INVALID,=0D + "Invalid RFC 4646 language code : %s" % LangName, File= )=0D =0D -## Ucs2Codec=0D +# Ucs2Codec=0D #=0D # This is only a partial codec implementation. It only supports=0D # encoding, and is primarily used to check that all the characters are=0D # valid for UCS-2.=0D #=0D +=0D +=0D class Ucs2Codec(codecs.Codec):=0D def __init__(self):=0D self.__utf16 =3D codecs.lookup('utf-16')=0D @@ -150,7 +162,10 @@ class Ucs2Codec(codecs.Codec): raise ValueError("Code Point too large to encode in UCS-2"= )=0D return self.__utf16.encode(input)=0D =0D +=0D TheUcs2Codec =3D Ucs2Codec()=0D +=0D +=0D def Ucs2Search(name):=0D if name in ['ucs-2', 'ucs_2']:=0D return codecs.CodecInfo(=0D @@ -159,14 +174,18 @@ def Ucs2Search(name): decode=3DTheUcs2Codec.decode)=0D else:=0D return None=0D +=0D +=0D codecs.register(Ucs2Search)=0D =0D -## StringDefClassObject=0D +# StringDefClassObject=0D #=0D # A structure for language definition=0D #=0D +=0D +=0D class StringDefClassObject(object):=0D - def __init__(self, Name =3D None, Value =3D None, Referenced =3D False= , Token =3D None, UseOtherLangDef =3D ''):=0D + def __init__(self, Name=3DNone, Value=3DNone, Referenced=3DFalse, Toke= n=3DNone, UseOtherLangDef=3D''):=0D self.StringName =3D ''=0D self.StringNameByteList =3D []=0D self.StringValue =3D ''=0D @@ -188,42 +207,48 @@ class StringDefClassObject(object): =0D def __str__(self):=0D return repr(self.StringName) + ' ' + \=0D - repr(self.Token) + ' ' + \=0D - repr(self.Referenced) + ' ' + \=0D - repr(self.StringValue) + ' ' + \=0D - repr(self.UseOtherLangDef)=0D + repr(self.Token) + ' ' + \=0D + repr(self.Referenced) + ' ' + \=0D + repr(self.StringValue) + ' ' + \=0D + repr(self.UseOtherLangDef)=0D =0D - def UpdateValue(self, Value =3D None):=0D + def UpdateValue(self, Value=3DNone):=0D if Value is not None:=0D self.StringValue =3D Value + u'\x00' # Add a NULL at st= ring tail=0D self.StringValueByteList =3D UniToHexList(self.StringValue)=0D self.Length =3D len(self.StringValueByteList)=0D =0D +=0D def StripComments(Line):=0D Comment =3D u'//'=0D CommentPos =3D Line.find(Comment)=0D while CommentPos >=3D 0:=0D - # if there are non matched quotes before the comment header=0D - # then we are in the middle of a string=0D - # but we need to ignore the escaped quotes and backslashes.=0D + # if there are non matched quotes before the comment header=0D + # then we are in the middle of a string=0D + # but we need to ignore the escaped quotes and backslashes.=0D if ((Line.count(u'"', 0, CommentPos) - Line.count(u'\\"', 0, Comme= ntPos)) & 1) =3D=3D 1:=0D - CommentPos =3D Line.find (Comment, CommentPos + 1)=0D + CommentPos =3D Line.find(Comment, CommentPos + 1)=0D else:=0D return Line[:CommentPos].strip()=0D return Line.strip()=0D =0D -## UniFileClassObject=0D +# UniFileClassObject=0D #=0D # A structure for .uni file definition=0D #=0D +=0D +=0D class UniFileClassObject(object):=0D - def __init__(self, FileList =3D [], IsCompatibleMode =3D False, Includ= ePathList =3D []):=0D + def __init__(self, FileList=3D[], IsCompatibleMode=3DFalse, IncludePat= hList=3D[]):=0D self.FileList =3D FileList=0D self.Token =3D 2=0D - self.LanguageDef =3D [] #[ [u'LanguageIdentifier= ', u'PrintableName'], ... ]=0D - self.OrderedStringList =3D {} #{ u'LanguageIdentifier'= : [StringDefClassObject] }=0D - self.OrderedStringDict =3D {} #{ u'LanguageIdentifier'= : {StringName:(IndexInList)} }=0D - self.OrderedStringListByToken =3D {} #{ u'LanguageIdentifier'= : {Token: StringDefClassObject} }=0D + self.LanguageDef =3D [] # [ [u'LanguageIdentifier', u'PrintableNa= me'], ... ]=0D + # { u'LanguageIdentifier' : [StringDefClassObject] }=0D + self.OrderedStringList =3D {}=0D + # { u'LanguageIdentifier' : {StringName:(IndexInList)} }=0D + self.OrderedStringDict =3D {}=0D + # { u'LanguageIdentifier' : {Token: StringDefClassObject} }=0D + self.OrderedStringListByToken =3D {}=0D self.IsCompatibleMode =3D IsCompatibleMode=0D self.IncludePathList =3D IncludePathList=0D if len(self.FileList) > 0:=0D @@ -236,23 +261,26 @@ class UniFileClassObject(object): Lang =3D shlex.split(Line.split(u"//")[0])=0D if len(Lang) !=3D 3:=0D try:=0D - FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(Fil= e.Path))=0D + FileIn =3D UniFileClassObject.OpenUniFile(=0D + LongFilePath(File.Path))=0D except UnicodeError as X:=0D - EdkLogger.error("build", FILE_READ_FAILURE, "File read fai= lure: %s" % str(X), ExtraData=3DFile);=0D + EdkLogger.error("build", FILE_READ_FAILURE,=0D + "File read failure: %s" % str(X), ExtraDat= a=3DFile)=0D except:=0D - EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFi= le);=0D + EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFi= le)=0D LineNo =3D GetLineNo(FileIn, Line, False)=0D EdkLogger.error("Unicode File Parser", PARSER_ERROR, "Wrong la= nguage definition",=0D ExtraData=3D"""%s\n\t*Correct format is like '= #langdef en-US "English"'""" % Line, File=3DFile, Line=3DLineNo)=0D else:=0D - LangName =3D GetLanguageCode(Lang[1], self.IsCompatibleMode, s= elf.File)=0D + LangName =3D GetLanguageCode(=0D + Lang[1], self.IsCompatibleMode, self.File)=0D LangPrintName =3D Lang[2]=0D =0D IsLangInDef =3D False=0D for Item in self.LanguageDef:=0D if Item[0] =3D=3D LangName:=0D IsLangInDef =3D True=0D - break;=0D + break=0D =0D if not IsLangInDef:=0D self.LanguageDef.append([LangName, LangPrintName])=0D @@ -260,8 +288,10 @@ class UniFileClassObject(object): #=0D # Add language string=0D #=0D - self.AddStringToList(u'$LANGUAGE_NAME', LangName, LangName, 0, Tru= e, Index=3D0)=0D - self.AddStringToList(u'$PRINTABLE_LANGUAGE_NAME', LangName, LangPr= intName, 1, True, Index=3D1)=0D + self.AddStringToList(u'$LANGUAGE_NAME', LangName,=0D + LangName, 0, True, Index=3D0)=0D + self.AddStringToList(u'$PRINTABLE_LANGUAGE_NAME',=0D + LangName, LangPrintName, 1, True, Index=3D1)= =0D =0D if not IsLangInDef:=0D #=0D @@ -270,14 +300,16 @@ class UniFileClassObject(object): #=0D FirstLangName =3D self.LanguageDef[0][0]=0D if LangName !=3D FirstLangName:=0D - for Index in range (2, len (self.OrderedStringList[FirstLa= ngName])):=0D + for Index in range(2, len(self.OrderedStringList[FirstLang= Name])):=0D Item =3D self.OrderedStringList[FirstLangName][Index]= =0D if Item.UseOtherLangDef !=3D '':=0D OtherLang =3D Item.UseOtherLangDef=0D else:=0D OtherLang =3D FirstLangName=0D - self.OrderedStringList[LangName].append (StringDefClas= sObject(Item.StringName, '', Item.Referenced, Item.Token, OtherLang))=0D - self.OrderedStringDict[LangName][Item.StringName] =3D = len(self.OrderedStringList[LangName]) - 1=0D + self.OrderedStringList[LangName].append(StringDefClass= Object(=0D + Item.StringName, '', Item.Referenced, Item.Token, = OtherLang))=0D + self.OrderedStringDict[LangName][Item.StringName] =3D = len(=0D + self.OrderedStringList[LangName]) - 1=0D return True=0D =0D @staticmethod=0D @@ -297,7 +329,7 @@ class UniFileClassObject(object): #=0D Encoding =3D 'utf-8'=0D if (FileIn.startswith(codecs.BOM_UTF16_BE) or=0D - FileIn.startswith(codecs.BOM_UTF16_LE)):=0D + FileIn.startswith(codecs.BOM_UTF16_LE)):=0D Encoding =3D 'utf-16'=0D =0D UniFileClassObject.VerifyUcs2Data(FileIn, FileName, Encoding)=0D @@ -322,9 +354,10 @@ class UniFileClassObject(object): (Reader, Writer) =3D (Info.streamreader, Info.streamwriter)=0D File =3D codecs.StreamReaderWriter(UniFile, Reader, Writer)=0D LineNumber =3D 0=0D - ErrMsg =3D lambda Encoding, LineNumber: \=0D - '%s contains invalid %s characters on line %d.' % \=0D - (FileName, Encoding, LineNumber)=0D +=0D + def ErrMsg(Encoding, LineNumber): return \=0D + '%s contains invalid %s characters on line %d.' % \=0D + (FileName, Encoding, LineNumber)=0D while True:=0D LineNumber =3D LineNumber + 1=0D try:=0D @@ -349,22 +382,26 @@ class UniFileClassObject(object): if Name !=3D '':=0D MatchString =3D gIdentifierPattern.match(Name)=0D if MatchString is None:=0D - EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'Th= e string token name %s defined in UNI file %s contains the invalid characte= r.' % (Name, self.File))=0D + EdkLogger.error('Unicode File Parser', FORMAT_INVALID,=0D + 'The string token name %s defined in UNI f= ile %s contains the invalid character.' % (Name, self.File))=0D LanguageList =3D Item.split(u'#language ')=0D for IndexI in range(len(LanguageList)):=0D if IndexI =3D=3D 0:=0D continue=0D else:=0D Language =3D LanguageList[IndexI].split()[0]=0D - Value =3D LanguageList[IndexI][LanguageList[IndexI].find(u= '\"') + len(u'\"') : LanguageList[IndexI].rfind(u'\"')] #.replace(u'\r\n', = u'')=0D - Language =3D GetLanguageCode(Language, self.IsCompatibleMo= de, self.File)=0D + Value =3D LanguageList[IndexI][LanguageList[IndexI].find(= =0D + u'\"') + len(u'\"'): LanguageList[IndexI].rfind(u'\"')= ] # .replace(u'\r\n', u'')=0D + Language =3D GetLanguageCode(=0D + Language, self.IsCompatibleMode, self.File)=0D self.AddStringToList(Name, Language, Value)=0D =0D #=0D # Get include file list and load them=0D #=0D def GetIncludeFile(self, Item, Dir):=0D - FileName =3D Item[Item.find(u'#include ') + len(u'#include ') :Ite= m.find(u' ', len(u'#include '))][1:-1]=0D + FileName =3D Item[Item.find(=0D + u'#include ') + len(u'#include '):Item.find(u' ', len(u'#inclu= de '))][1:-1]=0D self.LoadUniFile(FileName)=0D =0D #=0D @@ -374,11 +411,13 @@ class UniFileClassObject(object): try:=0D FileIn =3D UniFileClassObject.OpenUniFile(LongFilePath(File.Pa= th))=0D except UnicodeError as X:=0D - EdkLogger.error("build", FILE_READ_FAILURE, "File read failure= : %s" % str(X), ExtraData=3DFile.Path);=0D + EdkLogger.error("build", FILE_READ_FAILURE,=0D + "File read failure: %s" % str(X), ExtraData=3D= File.Path)=0D except OSError:=0D - EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraDa= ta=3DFile.Path)=0D + EdkLogger.error("Unicode File Parser",=0D + FILE_NOT_FOUND, ExtraData=3DFile.Path)=0D except:=0D - EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFile.P= ath);=0D + EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DFile.P= ath)=0D =0D Lines =3D []=0D #=0D @@ -395,7 +434,6 @@ class UniFileClassObject(object): if len(Line) =3D=3D 0:=0D continue=0D =0D -=0D Line =3D Line.replace(u'/langdef', u'#langdef')=0D Line =3D Line.replace(u'/string', u'#string')=0D Line =3D Line.replace(u'/language', u'#language')=0D @@ -417,15 +455,15 @@ class UniFileClassObject(object): StartPos =3D Line.find(u'\\x')=0D while (StartPos !=3D -1):=0D EndPos =3D Line.find(u'\\', StartPos + 1, StartPos + 7)=0D - if EndPos !=3D -1 and EndPos - StartPos =3D=3D 6 :=0D - if g4HexChar.match(Line[StartPos + 2 : EndPos], re.UNI= CODE):=0D - EndStr =3D Line[EndPos: ]=0D + if EndPos !=3D -1 and EndPos - StartPos =3D=3D 6:=0D + if g4HexChar.match(Line[StartPos + 2: EndPos], re.UNIC= ODE):=0D + EndStr =3D Line[EndPos:]=0D UniStr =3D Line[StartPos + 2: EndPos]=0D if EndStr.startswith(u'\\x') and len(EndStr) >=3D = 7:=0D - if EndStr[6] =3D=3D u'\\' and g4HexChar.match(= EndStr[2 : 6], re.UNICODE):=0D - Line =3D Line[0 : StartPos] + UniStr + End= Str=0D + if EndStr[6] =3D=3D u'\\' and g4HexChar.match(= EndStr[2: 6], re.UNICODE):=0D + Line =3D Line[0: StartPos] + UniStr + EndS= tr=0D else:=0D - Line =3D Line[0 : StartPos] + UniStr + EndStr[= 1:]=0D + Line =3D Line[0: StartPos] + UniStr + EndStr[1= :]=0D StartPos =3D Line.find(u'\\x', StartPos + 1)=0D =0D IncList =3D gIncludePattern.findall(Line)=0D @@ -436,7 +474,8 @@ class UniFileClassObject(object): Lines.extend(self.PreProcess(IncFile))=0D break=0D else:=0D - EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND,= Message=3D"Cannot find include file", ExtraData=3Dstr(IncList[0]))=0D + EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND,= =0D + Message=3D"Cannot find include file", = ExtraData=3Dstr(IncList[0]))=0D continue=0D =0D Lines.append(Line)=0D @@ -446,9 +485,10 @@ class UniFileClassObject(object): #=0D # Load a .uni file=0D #=0D - def LoadUniFile(self, File =3D None):=0D + def LoadUniFile(self, File=3DNone):=0D if File is None:=0D - EdkLogger.error("Unicode File Parser", PARSER_ERROR, 'No unico= de file is given')=0D + EdkLogger.error("Unicode File Parser", PARSER_ERROR,=0D + 'No unicode file is given')=0D self.File =3D File=0D #=0D # Process special char in file=0D @@ -488,10 +528,12 @@ class UniFileClassObject(object): # Mi segunda secuencia 2=0D #=0D if Line.find(u'#string ') >=3D 0 and Line.find(u'#language ') = < 0 and \=0D - SecondLine.find(u'#string ') < 0 and SecondLine.find(u'#la= nguage ') >=3D 0 and \=0D - ThirdLine.find(u'#string ') < 0 and ThirdLine.find(u'#lang= uage ') < 0:=0D - Name =3D Line[Line.find(u'#string ') + len(u'#string ') : = ].strip(' ')=0D - Language =3D SecondLine[SecondLine.find(u'#language ') + l= en(u'#language ') : ].strip(' ')=0D + SecondLine.find(u'#string ') < 0 and SecondLine.find(u= '#language ') >=3D 0 and \=0D + ThirdLine.find(u'#string ') < 0 and ThirdLine.find(u'#= language ') < 0:=0D + Name =3D Line[Line.find(u'#string ') +=0D + len(u'#string '):].strip(' ')=0D + Language =3D SecondLine[SecondLine.find(=0D + u'#language ') + len(u'#language '):].strip(' ')=0D for IndexJ in range(IndexI + 2, len(Lines)):=0D if Lines[IndexJ].find(u'#string ') < 0 and Lines[Index= J].find(u'#language ') < 0:=0D Value =3D Value + Lines[IndexJ]=0D @@ -499,12 +541,14 @@ class UniFileClassObject(object): IndexI =3D IndexJ=0D break=0D # Value =3D Value.replace(u'\r\n', u'')=0D - Language =3D GetLanguageCode(Language, self.IsCompatibleMo= de, self.File)=0D + Language =3D GetLanguageCode(=0D + Language, self.IsCompatibleMode, self.File)=0D # Check the string name=0D if not self.IsCompatibleMode and Name !=3D '':=0D MatchString =3D gIdentifierPattern.match(Name)=0D if MatchString is None:=0D - EdkLogger.error('Unicode File Parser', FORMAT_INVA= LID, 'The string token name %s defined in UNI file %s contains the invalid = character.' % (Name, self.File))=0D + EdkLogger.error('Unicode File Parser', FORMAT_INVA= LID,=0D + 'The string token name %s defined = in UNI file %s contains the invalid character.' % (Name, self.File))=0D self.AddStringToList(Name, Language, Value)=0D continue=0D =0D @@ -529,7 +573,8 @@ class UniFileClassObject(object): elif Lines[IndexJ].find(u'#string ') < 0 and Lines[Ind= exJ].find(u'#language ') >=3D 0:=0D StringItem =3D StringItem + Lines[IndexJ]=0D elif Lines[IndexJ].count(u'\"') >=3D 2:=0D - StringItem =3D StringItem[ : StringItem.rfind(u'\"= ')] + Lines[IndexJ][Lines[IndexJ].find(u'\"') + len(u'\"') : ]=0D + StringItem =3D StringItem[: StringItem.rfind(=0D + u'\"')] + Lines[IndexJ][Lines[IndexJ].find(u'\= "') + len(u'\"'):]=0D self.GetStringObject(StringItem)=0D continue=0D =0D @@ -544,12 +589,12 @@ class UniFileClassObject(object): #=0D # Add a string to list=0D #=0D - def AddStringToList(self, Name, Language, Value, Token =3D None, Refer= enced =3D False, UseOtherLangDef =3D '', Index =3D -1):=0D + def AddStringToList(self, Name, Language, Value, Token=3DNone, Referen= ced=3DFalse, UseOtherLangDef=3D'', Index=3D-1):=0D for LangNameItem in self.LanguageDef:=0D if Language =3D=3D LangNameItem[0]:=0D break=0D else:=0D - EdkLogger.error('Unicode File Parser', FORMAT_NOT_SUPPORTED, "= The language '%s' for %s is not defined in Unicode file %s." \=0D + EdkLogger.error('Unicode File Parser', FORMAT_NOT_SUPPORTED, "= The language '%s' for %s is not defined in Unicode file %s."=0D % (Language, Name, self.File))=0D =0D if Language not in self.OrderedStringList:=0D @@ -568,7 +613,8 @@ class UniFileClassObject(object): if IsAdded:=0D Token =3D len(self.OrderedStringList[Language])=0D if Index =3D=3D -1:=0D - self.OrderedStringList[Language].append(StringDefClassObje= ct(Name, Value, Referenced, Token, UseOtherLangDef))=0D + self.OrderedStringList[Language].append(StringDefClassObje= ct(=0D + Name, Value, Referenced, Token, UseOtherLangDef))=0D self.OrderedStringDict[Language][Name] =3D Token=0D for LangName in self.LanguageDef:=0D #=0D @@ -580,10 +626,13 @@ class UniFileClassObject(object): OtherLangDef =3D UseOtherLangDef=0D else:=0D OtherLangDef =3D Language=0D - self.OrderedStringList[LangName[0]].append(StringD= efClassObject(Name, '', Referenced, Token, OtherLangDef))=0D - self.OrderedStringDict[LangName[0]][Name] =3D len(= self.OrderedStringList[LangName[0]]) - 1=0D + self.OrderedStringList[LangName[0]].append(=0D + StringDefClassObject(Name, '', Referenced, Tok= en, OtherLangDef))=0D + self.OrderedStringDict[LangName[0]][Name] =3D len(= =0D + self.OrderedStringList[LangName[0]]) - 1=0D else:=0D - self.OrderedStringList[Language].insert(Index, StringDefCl= assObject(Name, Value, Referenced, Token, UseOtherLangDef))=0D + self.OrderedStringList[Language].insert(Index, StringDefCl= assObject(=0D + Name, Value, Referenced, Token, UseOtherLangDef))=0D self.OrderedStringDict[Language][Name] =3D Index=0D =0D #=0D @@ -637,7 +686,7 @@ class UniFileClassObject(object): # Use small token for all referred string stoken.=0D #=0D RefToken =3D 0=0D - for Index in range (0, len (self.OrderedStringList[FirstLangName])= ):=0D + for Index in range(0, len(self.OrderedStringList[FirstLangName])):= =0D FirstLangItem =3D self.OrderedStringList[FirstLangName][Index]= =0D if FirstLangItem.Referenced =3D=3D True:=0D for LangNameItem in self.LanguageDef:=0D @@ -652,7 +701,7 @@ class UniFileClassObject(object): # Use big token for all unreferred string stoken.=0D #=0D UnRefToken =3D 0=0D - for Index in range (0, len (self.OrderedStringList[FirstLangName])= ):=0D + for Index in range(0, len(self.OrderedStringList[FirstLangName])):= =0D FirstLangItem =3D self.OrderedStringList[FirstLangName][Index]= =0D if FirstLangItem.Referenced =3D=3D False:=0D for LangNameItem in self.LanguageDef:=0D @@ -667,17 +716,19 @@ class UniFileClassObject(object): #=0D def ShowMe(self):=0D print(self.LanguageDef)=0D - #print self.OrderedStringList=0D + # print self.OrderedStringList=0D for Item in self.OrderedStringList:=0D print(Item)=0D for Member in self.OrderedStringList[Item]:=0D print(str(Member))=0D =0D +=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D # script.=0D if __name__ =3D=3D '__main__':=0D EdkLogger.Initialize()=0D EdkLogger.SetLevel(EdkLogger.DEBUG_0)=0D - a =3D UniFileClassObject([PathClass("C:\\Edk\\Strings.uni"), PathClass= ("C:\\Edk\\Strings2.uni")])=0D + a =3D UniFileClassObject(=0D + [PathClass("C:\\Edk\\Strings.uni"), PathClass("C:\\Edk\\Strings2.u= ni")])=0D a.ReToken()=0D a.ShowMe()=0D diff --git a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py b/B= aseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py index ad8c9b598025..36907e983b60 100644 --- a/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py +++ b/BaseTools/Source/Python/AutoGen/ValidCheckingInfoObject.py @@ -15,6 +15,7 @@ from io import BytesIO from struct import pack=0D from Common.DataType import *=0D =0D +=0D class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object):=0D def __init__(self):=0D self.var_check_info =3D []=0D @@ -56,7 +57,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): else:=0D realLength +=3D item.StorageWidth=0D realLength +=3D item.StorageWidth=0D - if (index =3D=3D len(self.var_check_info)) :=0D + if (index =3D=3D len(self.var_check_info)):=0D if (itemIndex < len(var_check_tab.validtab)) and realL= ength % 4:=0D realLength +=3D (4 - (realLength % 4))=0D else:=0D @@ -136,14 +137,16 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): Buffer +=3D b=0D realLength +=3D item.StorageWidth=0D else:=0D - b =3D pack(PACK_CODE_BY_SIZE[item.StorageWidth], v= _data[0])=0D + b =3D pack(=0D + PACK_CODE_BY_SIZE[item.StorageWidth], v_data[0= ])=0D Buffer +=3D b=0D realLength +=3D item.StorageWidth=0D - b =3D pack(PACK_CODE_BY_SIZE[item.StorageWidth], v= _data[1])=0D + b =3D pack(=0D + PACK_CODE_BY_SIZE[item.StorageWidth], v_data[1= ])=0D Buffer +=3D b=0D realLength +=3D item.StorageWidth=0D =0D - if (index =3D=3D len(self.var_check_info)) :=0D + if (index =3D=3D len(self.var_check_info)):=0D if (itemIndex < len(var_check_tab.validtab)) and realL= ength % 4:=0D for i in range(4 - (realLength % 4)):=0D b =3D pack("=3DB", var_check_tab.pad)=0D @@ -173,6 +176,7 @@ class VAR_CHECK_PCD_VARIABLE_TAB_CONTAINER(object): =0D class VAR_CHECK_PCD_VARIABLE_TAB(object):=0D pad =3D 0xDA=0D +=0D def __init__(self, TokenSpaceGuid, PcdCName):=0D self.Revision =3D 0x0001=0D self.HeaderLength =3D 0=0D @@ -180,7 +184,8 @@ class VAR_CHECK_PCD_VARIABLE_TAB(object): self.Type =3D 0=0D self.Reserved =3D 0=0D self.Attributes =3D 0x00000000=0D - self.Guid =3D eval("[" + TokenSpaceGuid.replace("{", "").replace("= }", "") + "]")=0D + self.Guid =3D eval(=0D + "[" + TokenSpaceGuid.replace("{", "").replace("}", "") + "]")= =0D self.Name =3D PcdCName=0D self.validtab =3D []=0D =0D @@ -233,9 +238,11 @@ class VAR_CHECK_PCD_VALID_OBJ(object): def __eq__(self, validObj):=0D return validObj and self.VarOffset =3D=3D validObj.VarOffset=0D =0D +=0D class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OBJ):=0D def __init__(self, VarOffset, validlist, PcdDataType):=0D - super(VAR_CHECK_PCD_VALID_LIST, self).__init__(VarOffset, validlis= t, PcdDataType)=0D + super(VAR_CHECK_PCD_VALID_LIST, self).__init__(=0D + VarOffset, validlist, PcdDataType)=0D self.Type =3D 1=0D valid_num_list =3D []=0D for item in self.rawdata:=0D @@ -249,13 +256,13 @@ class VAR_CHECK_PCD_VALID_LIST(VAR_CHECK_PCD_VALID_OB= J): else:=0D self.data.add(int(valid_num))=0D =0D -=0D self.Length =3D 5 + len(self.data) * self.StorageWidth=0D =0D =0D class VAR_CHECK_PCD_VALID_RANGE(VAR_CHECK_PCD_VALID_OBJ):=0D def __init__(self, VarOffset, validrange, PcdDataType):=0D - super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(VarOffset, validra= nge, PcdDataType)=0D + super(VAR_CHECK_PCD_VALID_RANGE, self).__init__(=0D + VarOffset, validrange, PcdDataType)=0D self.Type =3D 2=0D RangeExpr =3D ""=0D i =3D 0=0D diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTool= s/Source/Python/AutoGen/WorkspaceAutoGen.py index f86c749c08c3..1f10e03c268f 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -1,11 +1,11 @@ -## @file=0D +# @file=0D # Create makefile for MS nmake and GNU make=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import print_function=0D from __future__ import absolute_import=0D @@ -25,25 +25,28 @@ from Common.DataType import * from Common.Misc import *=0D import json=0D =0D -## Regular expression for splitting Dependency Expression string into toke= ns=0D +# Regular expression for splitting Dependency Expression string into token= s=0D gDepexTokenPattern =3D re.compile("(\(|\)|\w+| \S+\.inf)")=0D =0D -## Regular expression for match: PCD(xxxx.yyy)=0D +# Regular expression for match: PCD(xxxx.yyy)=0D gPCDAsGuidPattern =3D re.compile(r"^PCD\(.+\..+\)$")=0D =0D -## Workspace AutoGen class=0D +# Workspace AutoGen class=0D #=0D # This class is used mainly to control the whole platform build for diff= erent=0D # architecture. This class will generate top level makefile.=0D #=0D +=0D +=0D class WorkspaceAutoGen(AutoGen):=0D # call super().__init__ then call the worker function with different p= arameter count=0D def __init__(self, Workspace, MetaFile, Target, Toolchain, Arch, *args= , **kwargs):=0D if not hasattr(self, "_Init"):=0D - self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch,= *args, **kwargs)=0D + self._InitWorker(Workspace, MetaFile, Target,=0D + Toolchain, Arch, *args, **kwargs)=0D self._Init =3D True=0D =0D - ## Initialize WorkspaceAutoGen=0D + # Initialize WorkspaceAutoGen=0D #=0D # @param WorkspaceDir Root directory of workspace=0D # @param ActivePlatform Meta-file of active platform=0D @@ -60,25 +63,26 @@ class WorkspaceAutoGen(AutoGen): # @param SkuId SKU id from command line=0D #=0D def _InitWorker(self, WorkspaceDir, ActivePlatform, Target, Toolchain,= ArchList, MetaFileDb,=0D - BuildConfig, ToolDefinition, FlashDefinitionFile=3D'', Fds= =3DNone, Fvs=3DNone, Caps=3DNone, SkuId=3D'', UniFlag=3DNone,=0D - Progress=3DNone, BuildModule=3DNone):=0D - self.BuildDatabase =3D MetaFileDb=0D - self.MetaFile =3D ActivePlatform=0D - self.WorkspaceDir =3D WorkspaceDir=0D - self.Platform =3D self.BuildDatabase[self.MetaFile, TAB_ARCH= _COMMON, Target, Toolchain]=0D + BuildConfig, ToolDefinition, FlashDefinitionFile=3D'',= Fds=3DNone, Fvs=3DNone, Caps=3DNone, SkuId=3D'', UniFlag=3DNone,=0D + Progress=3DNone, BuildModule=3DNone):=0D + self.BuildDatabase =3D MetaFileDb=0D + self.MetaFile =3D ActivePlatform=0D + self.WorkspaceDir =3D WorkspaceDir=0D + self.Platform =3D self.BuildDatabase[self.MetaFile,=0D + TAB_ARCH_COMMON, Target, Toolch= ain]=0D GlobalData.gActivePlatform =3D self.Platform=0D - self.BuildTarget =3D Target=0D - self.ToolChain =3D Toolchain=0D - self.ArchList =3D ArchList=0D - self.SkuId =3D SkuId=0D - self.UniFlag =3D UniFlag=0D + self.BuildTarget =3D Target=0D + self.ToolChain =3D Toolchain=0D + self.ArchList =3D ArchList=0D + self.SkuId =3D SkuId=0D + self.UniFlag =3D UniFlag=0D =0D - self.TargetTxt =3D BuildConfig=0D - self.ToolDef =3D ToolDefinition=0D - self.FdfFile =3D FlashDefinitionFile=0D - self.FdTargetList =3D Fds if Fds else []=0D - self.FvTargetList =3D Fvs if Fvs else []=0D - self.CapTargetList =3D Caps if Caps else []=0D + self.TargetTxt =3D BuildConfig=0D + self.ToolDef =3D ToolDefinition=0D + self.FdfFile =3D FlashDefinitionFile=0D + self.FdTargetList =3D Fds if Fds else []=0D + self.FvTargetList =3D Fvs if Fvs else []=0D + self.CapTargetList =3D Caps if Caps else []=0D self.AutoGenObjectList =3D []=0D self._GuidDict =3D {}=0D =0D @@ -90,7 +94,8 @@ class WorkspaceAutoGen(AutoGen): =0D EdkLogger.info("")=0D if self.ArchList:=0D - EdkLogger.info('%-16s =3D %s' % ("Architecture(s)", ' '.join(s= elf.ArchList)))=0D + EdkLogger.info('%-16s =3D %s' %=0D + ("Architecture(s)", ' '.join(self.ArchList)))=0D EdkLogger.info('%-16s =3D %s' % ("Build target", self.BuildTarget)= )=0D EdkLogger.info('%-16s =3D %s' % ("Toolchain", self.ToolChain))=0D =0D @@ -99,7 +104,8 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.info('%-24s =3D %s' % ("Active Module", BuildModule)= )=0D =0D if self.FdfFile:=0D - EdkLogger.info('%-24s =3D %s' % ("Flash Image Definition", sel= f.FdfFile))=0D + EdkLogger.info('%-24s =3D %s' %=0D + ("Flash Image Definition", self.FdfFile))=0D =0D EdkLogger.verbose("\nFLASH_DEFINITION =3D %s" % self.FdfFile)=0D =0D @@ -144,9 +150,10 @@ class WorkspaceAutoGen(AutoGen): ArchList =3D set(self.ArchList) & set(self.Platform.SupArchLis= t)=0D if not ArchList:=0D EdkLogger.error("build", PARAMETER_INVALID,=0D - ExtraData =3D "Invalid ARCH specified. [Valid = ARCH: %s]" % (" ".join(self.Platform.SupArchList)))=0D + ExtraData=3D"Invalid ARCH specified. [Valid AR= CH: %s]" % (" ".join(self.Platform.SupArchList)))=0D elif self.ArchList and len(ArchList) !=3D len(self.ArchList):=0D - SkippedArchList =3D set(self.ArchList).symmetric_difference(se= t(self.Platform.SupArchList))=0D + SkippedArchList =3D set(self.ArchList).symmetric_difference(=0D + set(self.Platform.SupArchList))=0D EdkLogger.verbose("\nArch [%s] is ignored because the platform= supports [%s] only!"=0D % (" ".join(SkippedArchList), " ".join(self.= Platform.SupArchList)))=0D self.ArchList =3D tuple(ArchList)=0D @@ -163,10 +170,12 @@ class WorkspaceAutoGen(AutoGen): oriPkgSet =3D set()=0D PlatformPkg =3D set()=0D for Arch in self.ArchList:=0D - Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Buil= dTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.MetaFile,=0D + Arch, self.BuildTarget, self.Too= lChain]=0D oriInfList =3D Platform.Modules=0D for ModuleFile in oriInfList:=0D - ModuleData =3D self.BuildDatabase[ModuleFile, Platform._Ar= ch, Platform._Target, Platform._Toolchain]=0D + ModuleData =3D self.BuildDatabase[ModuleFile,=0D + Platform._Arch, Platform._= Target, Platform._Toolchain]=0D oriPkgSet.update(ModuleData.Packages)=0D for Pkg in oriPkgSet:=0D Guids =3D Pkg.Guids=0D @@ -192,17 +201,21 @@ class WorkspaceAutoGen(AutoGen): for FdRegion in FdDict.RegionList:=0D if str(FdRegion.RegionType) =3D=3D 'FILE' and self.Pla= tform.VpdToolGuid in str(FdRegion.RegionDataList):=0D if int(FdRegion.Offset) % 8 !=3D 0:=0D - EdkLogger.error("build", FORMAT_INVALID, 'The = VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, 'The VPD Base Add= ress %s must be 8-byte aligned.' % (FdRegion.Offset))=0D FdfProfile =3D Fdf.Profile=0D else:=0D if self.FdTargetList:=0D - EdkLogger.info("No flash definition file found. FD [%s] wi= ll be ignored." % " ".join(self.FdTargetList))=0D + EdkLogger.info("No flash definition file found. FD [%s] wi= ll be ignored." % " ".join(=0D + self.FdTargetList))=0D self.FdTargetList =3D []=0D if self.FvTargetList:=0D - EdkLogger.info("No flash definition file found. FV [%s] wi= ll be ignored." % " ".join(self.FvTargetList))=0D + EdkLogger.info("No flash definition file found. FV [%s] wi= ll be ignored." % " ".join(=0D + self.FvTargetList))=0D self.FvTargetList =3D []=0D if self.CapTargetList:=0D - EdkLogger.info("No flash definition file found. Capsule [%= s] will be ignored." % " ".join(self.CapTargetList))=0D + EdkLogger.info("No flash definition file found. Capsule [%= s] will be ignored." % " ".join(=0D + self.CapTargetList))=0D self.CapTargetList =3D []=0D =0D return FdfProfile=0D @@ -221,37 +234,46 @@ class WorkspaceAutoGen(AutoGen): if key =3D=3D 'ArchTBD':=0D MetaFile_cache =3D defaultdict(set)=0D for Arch in self.ArchList:=0D - Current_Platform_cache =3D self.BuildDatabase[self= .MetaFile, Arch, self.BuildTarget, self.ToolChain]=0D + Current_Platform_cache =3D self.BuildDatabase[self= .MetaFile,=0D + Arch, = self.BuildTarget, self.ToolChain]=0D for Pkey in Current_Platform_cache.Modules:=0D - MetaFile_cache[Arch].add(Current_Platform_cach= e.Modules[Pkey].MetaFile)=0D + MetaFile_cache[Arch].add(=0D + Current_Platform_cache.Modules[Pkey].MetaF= ile)=0D for Inf in self.FdfProfile.InfDict[key]:=0D - ModuleFile =3D PathClass(NormPath(Inf), GlobalData= .gWorkspace, Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, Arch)=0D for Arch in self.ArchList:=0D if ModuleFile in MetaFile_cache[Arch]:=0D break=0D else:=0D - ModuleData =3D self.BuildDatabase[ModuleFile, = Arch, self.BuildTarget, self.ToolChain]=0D + ModuleData =3D self.BuildDatabase[ModuleFile,= =0D + Arch, self.Bui= ldTarget, self.ToolChain]=0D if not ModuleData.IsBinaryModule:=0D - EdkLogger.error('build', PARSER_ERROR, "Mo= dule %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)= =0D + EdkLogger.error(=0D + 'build', PARSER_ERROR, "Module %s NOT = found in DSC file; Is it really a binary module?" % ModuleFile)=0D =0D else:=0D for Arch in self.ArchList:=0D if Arch =3D=3D key:=0D - Platform =3D self.BuildDatabase[self.MetaFile,= Arch, self.BuildTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.MetaFile,= =0D + Arch, self.Build= Target, self.ToolChain]=0D MetaFileList =3D set()=0D for Pkey in Platform.Modules:=0D - MetaFileList.add(Platform.Modules[Pkey].Me= taFile)=0D + MetaFileList.add(=0D + Platform.Modules[Pkey].MetaFile)=0D for Inf in self.FdfProfile.InfDict[key]:=0D - ModuleFile =3D PathClass(NormPath(Inf), Gl= obalData.gWorkspace, Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, = Arch)=0D if ModuleFile in MetaFileList:=0D continue=0D - ModuleData =3D self.BuildDatabase[ModuleFi= le, Arch, self.BuildTarget, self.ToolChain]=0D + ModuleData =3D self.BuildDatabase[ModuleFi= le,=0D + Arch, self= .BuildTarget, self.ToolChain]=0D if not ModuleData.IsBinaryModule:=0D - EdkLogger.error('build', PARSER_ERROR,= "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleF= ile)=0D -=0D -=0D + EdkLogger.error(=0D + 'build', PARSER_ERROR, "Module %s = NOT found in DSC file; Is it really a binary module?" % ModuleFile)=0D =0D # parse FDF file to get PCDs in it, if any=0D +=0D def VerifyPcdsFromFDF(self):=0D =0D if self.FdfProfile:=0D @@ -260,22 +282,23 @@ class WorkspaceAutoGen(AutoGen): =0D def ProcessPcdType(self):=0D for Arch in self.ArchList:=0D - Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Buil= dTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.MetaFile,=0D + Arch, self.BuildTarget, self.Too= lChain]=0D Platform.Pcds=0D # generate the SourcePcdDict and BinaryPcdDict=0D Libs =3D []=0D for BuildData in list(self.BuildDatabase._CACHE_.values()):=0D if BuildData.Arch !=3D Arch:=0D continue=0D - if BuildData.MetaFile.Ext =3D=3D '.inf' and str(BuildData)= in Platform.Modules :=0D + if BuildData.MetaFile.Ext =3D=3D '.inf' and str(BuildData)= in Platform.Modules:=0D Libs.extend(GetModuleLibInstances(BuildData, Platform,= =0D - self.BuildDatabase,=0D - Arch,=0D - self.BuildTarget,=0D - self.ToolChain,=0D - self.Platform.MetaFile,=0D - EdkLogger=0D - ))=0D + self.BuildDatabase,= =0D + Arch,=0D + self.BuildTarget,=0D + self.ToolChain,=0D + self.Platform.MetaFi= le,=0D + EdkLogger=0D + ))=0D for BuildData in list(self.BuildDatabase._CACHE_.values()):=0D if BuildData.Arch !=3D Arch:=0D continue=0D @@ -289,21 +312,23 @@ class WorkspaceAutoGen(AutoGen): BuildData.Pcds[key].Pending =3D False= =0D =0D if BuildData.MetaFile in Platform.Modules:=0D - PlatformModule =3D Platform.Modules[str(Bu= ildData.MetaFile)]=0D + PlatformModule =3D Platform.Modules[str(=0D + BuildData.MetaFile)]=0D if key in PlatformModule.Pcds:=0D PcdInPlatform =3D PlatformModule.Pcds[= key]=0D if PcdInPlatform.Type:=0D BuildData.Pcds[key].Type =3D PcdIn= Platform.Type=0D BuildData.Pcds[key].Pending =3D Fa= lse=0D else:=0D - #Pcd used in Library, Pcd Type from refere= nce module if Pcd Type is Pending=0D + # Pcd used in Library, Pcd Type from refer= ence module if Pcd Type is Pending=0D if BuildData.Pcds[key].Pending:=0D if bool(BuildData.LibraryClass):=0D if BuildData in set(Libs):=0D ReferenceModules =3D BuildData= .ReferenceModules=0D for ReferenceModule in Referen= ceModules:=0D if ReferenceModule.MetaFil= e in Platform.Modules:=0D - RefPlatformModule =3D = Platform.Modules[str(ReferenceModule.MetaFile)]=0D + RefPlatformModule =3D = Platform.Modules[str(=0D + ReferenceModule.Me= taFile)]=0D if key in RefPlatformM= odule.Pcds:=0D PcdInReferenceModu= le =3D RefPlatformModule.Pcds[key]=0D if PcdInReferenceM= odule.Type:=0D @@ -313,8 +338,10 @@ class WorkspaceAutoGen(AutoGen): =0D def ProcessMixedPcd(self):=0D for Arch in self.ArchList:=0D - SourcePcdDict =3D {TAB_PCDS_DYNAMIC_EX:set(), TAB_PCDS_PATCHAB= LE_IN_MODULE:set(),TAB_PCDS_DYNAMIC:set(),TAB_PCDS_FIXED_AT_BUILD:set()}=0D - BinaryPcdDict =3D {TAB_PCDS_DYNAMIC_EX:set(), TAB_PCDS_PATCHAB= LE_IN_MODULE:set()}=0D + SourcePcdDict =3D {TAB_PCDS_DYNAMIC_EX: set(), TAB_PCDS_PATCHA= BLE_IN_MODULE: set(=0D + ), TAB_PCDS_DYNAMIC: set(), TAB_PCDS_FIXED_AT_BUILD: set()}=0D + BinaryPcdDict =3D {TAB_PCDS_DYNAMIC_EX: set(=0D + ), TAB_PCDS_PATCHABLE_IN_MODULE: set()}=0D SourcePcdDict_Keys =3D SourcePcdDict.keys()=0D BinaryPcdDict_Keys =3D BinaryPcdDict.keys()=0D =0D @@ -327,21 +354,27 @@ class WorkspaceAutoGen(AutoGen): for key in BuildData.Pcds:=0D if TAB_PCDS_DYNAMIC_EX in BuildData.Pcds[key].Type= :=0D if BuildData.IsBinaryModule:=0D - BinaryPcdDict[TAB_PCDS_DYNAMIC_EX].add((Bu= ildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))=0D + BinaryPcdDict[TAB_PCDS_DYNAMIC_EX].add(=0D + (BuildData.Pcds[key].TokenCName, Build= Data.Pcds[key].TokenSpaceGuidCName))=0D else:=0D - SourcePcdDict[TAB_PCDS_DYNAMIC_EX].add((Bu= ildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))=0D + SourcePcdDict[TAB_PCDS_DYNAMIC_EX].add(=0D + (BuildData.Pcds[key].TokenCName, Build= Data.Pcds[key].TokenSpaceGuidCName))=0D =0D elif TAB_PCDS_PATCHABLE_IN_MODULE in BuildData.Pcd= s[key].Type:=0D if BuildData.MetaFile.Ext =3D=3D '.inf':=0D if BuildData.IsBinaryModule:=0D - BinaryPcdDict[TAB_PCDS_PATCHABLE_IN_MO= DULE].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGu= idCName))=0D + BinaryPcdDict[TAB_PCDS_PATCHABLE_IN_MO= DULE].add(=0D + (BuildData.Pcds[key].TokenCName, B= uildData.Pcds[key].TokenSpaceGuidCName))=0D else:=0D - SourcePcdDict[TAB_PCDS_PATCHABLE_IN_MO= DULE].add((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGu= idCName))=0D + SourcePcdDict[TAB_PCDS_PATCHABLE_IN_MO= DULE].add(=0D + (BuildData.Pcds[key].TokenCName, B= uildData.Pcds[key].TokenSpaceGuidCName))=0D =0D elif TAB_PCDS_DYNAMIC in BuildData.Pcds[key].Type:= =0D - SourcePcdDict[TAB_PCDS_DYNAMIC].add((BuildData= .Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))=0D + SourcePcdDict[TAB_PCDS_DYNAMIC].add(=0D + (BuildData.Pcds[key].TokenCName, BuildData= .Pcds[key].TokenSpaceGuidCName))=0D elif TAB_PCDS_FIXED_AT_BUILD in BuildData.Pcds[key= ].Type:=0D - SourcePcdDict[TAB_PCDS_FIXED_AT_BUILD].add((Bu= ildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))=0D + SourcePcdDict[TAB_PCDS_FIXED_AT_BUILD].add(=0D + (BuildData.Pcds[key].TokenCName, BuildData= .Pcds[key].TokenSpaceGuidCName))=0D =0D #=0D # A PCD can only use one type for all source modules=0D @@ -349,13 +382,16 @@ class WorkspaceAutoGen(AutoGen): for i in SourcePcdDict_Keys:=0D for j in SourcePcdDict_Keys:=0D if i !=3D j:=0D - Intersections =3D SourcePcdDict[i].intersection(So= urcePcdDict[j])=0D + Intersections =3D SourcePcdDict[i].intersection(=0D + SourcePcdDict[j])=0D if len(Intersections) > 0:=0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "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),=0D - ExtraData=3D'\n\t'.join(str(P[1]+'.'+P[0]) for= P in Intersections)=0D + 'build',=0D + FORMAT_INVALID,=0D + "Building modules from source INFs, follow= ing PCD use %s and %s access method. It must be corrected to use only one a= ccess method." % (=0D + i, j),=0D + ExtraData=3D'\n\t'.join(=0D + str(P[1]+'.'+P[0]) for P in Intersecti= ons)=0D )=0D =0D #=0D @@ -364,7 +400,8 @@ class WorkspaceAutoGen(AutoGen): for i in BinaryPcdDict_Keys:=0D for j in BinaryPcdDict_Keys:=0D if i !=3D j:=0D - Intersections =3D BinaryPcdDict[i].intersection(Bi= naryPcdDict[j])=0D + Intersections =3D BinaryPcdDict[i].intersection(=0D + BinaryPcdDict[j])=0D for item in Intersections:=0D NewPcd1 =3D (item[0] + '_' + i, item[1])=0D NewPcd2 =3D (item[0] + '_' + j, item[1])=0D @@ -382,7 +419,8 @@ class WorkspaceAutoGen(AutoGen): for i in SourcePcdDict_Keys:=0D for j in BinaryPcdDict_Keys:=0D if i !=3D j:=0D - Intersections =3D SourcePcdDict[i].intersection(Bi= naryPcdDict[j])=0D + Intersections =3D SourcePcdDict[i].intersection(=0D + BinaryPcdDict[j])=0D for item in Intersections:=0D NewPcd1 =3D (item[0] + '_' + i, item[1])=0D NewPcd2 =3D (item[0] + '_' + j, item[1])=0D @@ -394,7 +432,8 @@ class WorkspaceAutoGen(AutoGen): if NewPcd2 not in GlobalData.MixedPcd[item= ]:=0D GlobalData.MixedPcd[item].append(NewPc= d2)=0D =0D - BuildData =3D self.BuildDatabase[self.MetaFile, Arch, self.Bui= ldTarget, self.ToolChain]=0D + BuildData =3D self.BuildDatabase[self.MetaFile,=0D + Arch, self.BuildTarget, self.To= olChain]=0D for key in BuildData.Pcds:=0D for SinglePcd in GlobalData.MixedPcd:=0D if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key= ].TokenSpaceGuidCName) =3D=3D SinglePcd:=0D @@ -403,7 +442,8 @@ class WorkspaceAutoGen(AutoGen): if (Pcd_Type =3D=3D BuildData.Pcds[key].Type) = or (Pcd_Type =3D=3D TAB_PCDS_DYNAMIC_EX and BuildData.Pcds[key].Type in PCD= _DYNAMIC_EX_TYPE_SET) or \=0D (Pcd_Type =3D=3D TAB_PCDS_DYNAMIC and Build= Data.Pcds[key].Type in PCD_DYNAMIC_TYPE_SET):=0D Value =3D BuildData.Pcds[key]=0D - Value.TokenCName =3D BuildData.Pcds[key].T= okenCName + '_' + Pcd_Type=0D + Value.TokenCName =3D BuildData.Pcds[key].T= okenCName + \=0D + '_' + Pcd_Type=0D if len(key) =3D=3D 2:=0D newkey =3D (Value.TokenCName, key[1])= =0D elif len(key) =3D=3D 3:=0D @@ -423,7 +463,7 @@ class WorkspaceAutoGen(AutoGen): for item in GlobalData.MixedPcd[key]:=0D PcdSet[item] =3D Value=0D =0D - #Collect package set information from INF of FDF=0D + # Collect package set information from INF of FDF=0D @cached_property=0D def PkgSet(self):=0D if not self.FdfFile:=0D @@ -435,23 +475,27 @@ class WorkspaceAutoGen(AutoGen): ModuleList =3D []=0D Pkgs =3D {}=0D for Arch in self.ArchList:=0D - Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Buil= dTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.MetaFile,=0D + Arch, self.BuildTarget, self.Too= lChain]=0D PkgSet =3D set()=0D for mb in [self.BuildDatabase[m, Arch, self.BuildTarget, self.= ToolChain] for m in Platform.Modules]:=0D PkgSet.update(mb.Packages)=0D for Inf in ModuleList:=0D - ModuleFile =3D PathClass(NormPath(Inf), GlobalData.gWorksp= ace, Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, Arch)=0D if ModuleFile in Platform.Modules:=0D continue=0D - ModuleData =3D self.BuildDatabase[ModuleFile, Arch, self.B= uildTarget, self.ToolChain]=0D + ModuleData =3D self.BuildDatabase[ModuleFile,=0D + Arch, self.BuildTarget, se= lf.ToolChain]=0D PkgSet.update(ModuleData.Packages)=0D PkgSet.update(Platform.Packages)=0D Pkgs[Arch] =3D list(PkgSet)=0D return Pkgs=0D =0D - def VerifyPcdDeclearation(self,PcdSet):=0D + def VerifyPcdDeclearation(self, PcdSet):=0D for Arch in self.ArchList:=0D - Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Buil= dTarget, self.ToolChain]=0D + Platform =3D self.BuildDatabase[self.MetaFile,=0D + Arch, self.BuildTarget, self.Too= lChain]=0D Pkgs =3D self.PkgSet[Arch]=0D DecPcds =3D set()=0D DecPcdsKey =3D set()=0D @@ -461,33 +505,41 @@ class WorkspaceAutoGen(AutoGen): DecPcdsKey.add((Pcd[0], Pcd[1], Pcd[2]))=0D =0D Platform.SkuName =3D self.SkuId=0D - for Name, Guid,Fileds in PcdSet:=0D + for Name, Guid, Fileds in PcdSet:=0D if (Name, Guid) not in DecPcds:=0D EdkLogger.error(=0D 'build',=0D PARSER_ERROR,=0D - "PCD (%s.%s) used in FDF is not declared in DEC fi= les." % (Guid, Name),=0D - File =3D self.FdfProfile.PcdFileLineDict[Name, Gui= d, Fileds][0],=0D - Line =3D self.FdfProfile.PcdFileLineDict[Name, Gui= d, Fileds][1]=0D + "PCD (%s.%s) used in FDF is not declared in DEC fi= les." % (=0D + Guid, Name),=0D + File=3Dself.FdfProfile.PcdFileLineDict[Name,=0D + Guid, Fileds]= [0],=0D + Line=3Dself.FdfProfile.PcdFileLineDict[Name,=0D + Guid, Fileds]= [1]=0D )=0D else:=0D # Check whether Dynamic or DynamicEx PCD used in FDF f= ile. If used, build break and give a error message.=0D if (Name, Guid, TAB_PCDS_FIXED_AT_BUILD) in DecPcdsKey= \=0D - or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) in D= ecPcdsKey \=0D - or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecPcdsK= ey:=0D + or (Name, Guid, TAB_PCDS_PATCHABLE_IN_MODULE) = in DecPcdsKey \=0D + or (Name, Guid, TAB_PCDS_FEATURE_FLAG) in DecP= cdsKey:=0D continue=0D elif (Name, Guid, TAB_PCDS_DYNAMIC) in DecPcdsKey or (= Name, Guid, TAB_PCDS_DYNAMIC_EX) in DecPcdsKey:=0D EdkLogger.error(=0D - 'build',=0D - PARSER_ERROR,=0D - "Using Dynamic or DynamicEx type of PCD [%= s.%s] in FDF file is not allowed." % (Guid, Name),=0D - File =3D self.FdfProfile.PcdFileLineDict[N= ame, Guid, Fileds][0],=0D - Line =3D self.FdfProfile.PcdFileLineDict[N= ame, Guid, Fileds][1]=0D + 'build',=0D + PARSER_ERROR,=0D + "Using Dynamic or DynamicEx type of PCD [%s.%s= ] in FDF file is not allowed." % (=0D + Guid, Name),=0D + File=3Dself.FdfProfile.PcdFileLineDict[Name,=0D + Guid, Fil= eds][0],=0D + Line=3Dself.FdfProfile.PcdFileLineDict[Name,=0D + Guid, Fil= eds][1]=0D )=0D +=0D def CollectAllPcds(self):=0D =0D for Arch in self.ArchList:=0D - Pa =3D PlatformAutoGen(self, self.MetaFile, self.BuildTarget, = self.ToolChain, Arch)=0D + Pa =3D PlatformAutoGen(self, self.MetaFile,=0D + self.BuildTarget, self.ToolChain, Arch)=0D #=0D # Explicitly collect platform's dynamic PCDs=0D #=0D @@ -496,21 +548,24 @@ class WorkspaceAutoGen(AutoGen): self.AutoGenObjectList.append(Pa)=0D # We need to calculate the PcdTokenNumber after all Arch Pcds are = collected.=0D for Arch in self.ArchList:=0D - #Pcd TokenNumber=0D - Pa =3D PlatformAutoGen(self, self.MetaFile, self.BuildTarget, = self.ToolChain, Arch)=0D - self.UpdateModuleDataPipe(Arch, {"PCD_TNUM":Pa.PcdTokenNumber= })=0D + # Pcd TokenNumber=0D + Pa =3D PlatformAutoGen(self, self.MetaFile,=0D + self.BuildTarget, self.ToolChain, Arch)=0D + self.UpdateModuleDataPipe(Arch, {"PCD_TNUM": Pa.PcdTokenNumbe= r})=0D =0D - def UpdateModuleDataPipe(self,arch, attr_dict):=0D + def UpdateModuleDataPipe(self, arch, attr_dict):=0D for (Target, Toolchain, Arch, MetaFile) in AutoGen.Cache():=0D if Arch !=3D arch:=0D continue=0D try:=0D - AutoGen.Cache()[(Target, Toolchain, Arch, MetaFile)].DataP= ipe.DataContainer =3D attr_dict=0D + AutoGen.Cache()[(Target, Toolchain, Arch, MetaFile)=0D + ].DataPipe.DataContainer =3D attr_dict=0D except Exception:=0D pass=0D #=0D # Generate Package level hash value=0D #=0D +=0D def GeneratePkgLevelHash(self):=0D for Arch in self.ArchList:=0D GlobalData.gPackageHash =3D {}=0D @@ -518,7 +573,6 @@ class WorkspaceAutoGen(AutoGen): for Pkg in self.PkgSet[Arch]:=0D self._GenPkgLevelHash(Pkg)=0D =0D -=0D def CreateBuildOptionsFile(self):=0D #=0D # Create BuildOptions Macro & PCD metafile, also add the Active Pl= atform and FDF file.=0D @@ -536,7 +590,8 @@ class WorkspaceAutoGen(AutoGen): content +=3D 'Flash Image Definition: '=0D content +=3D str(self.FdfFile)=0D content +=3D TAB_LINE_BREAK=0D - SaveFileOnChange(os.path.join(self.BuildDir, 'BuildOptions'), cont= ent, False)=0D + SaveFileOnChange(os.path.join(=0D + self.BuildDir, 'BuildOptions'), content, False)=0D =0D def CreatePcdTokenNumberFile(self):=0D #=0D @@ -548,17 +603,22 @@ class WorkspaceAutoGen(AutoGen): if Pa.DynamicPcdList:=0D for Pcd in Pa.DynamicPcdList:=0D PcdTokenNumber +=3D TAB_LINE_BREAK=0D - PcdTokenNumber +=3D str((Pcd.TokenCName, Pcd.TokenSpac= eGuidCName))=0D + PcdTokenNumber +=3D str((Pcd.TokenCName,=0D + Pcd.TokenSpaceGuidCName))=0D PcdTokenNumber +=3D ' : '=0D - PcdTokenNumber +=3D str(Pa.PcdTokenNumber[Pcd.TokenCNa= me, Pcd.TokenSpaceGuidCName])=0D - SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), Pc= dTokenNumber, False)=0D + PcdTokenNumber +=3D str(=0D + Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGu= idCName])=0D + SaveFileOnChange(os.path.join(=0D + self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)=0D =0D def GeneratePlatformLevelHash(self):=0D #=0D # Get set of workspace metafiles=0D #=0D - AllWorkSpaceMetaFiles =3D self._GetMetaFiles(self.BuildTarget, sel= f.ToolChain)=0D - AllWorkSpaceMetaFileList =3D sorted(AllWorkSpaceMetaFiles, key=3Dl= ambda x: str(x))=0D + AllWorkSpaceMetaFiles =3D self._GetMetaFiles(=0D + self.BuildTarget, self.ToolChain)=0D + AllWorkSpaceMetaFileList =3D sorted(=0D + AllWorkSpaceMetaFiles, key=3Dlambda x: str(x))=0D #=0D # Retrieve latest modified time of all metafiles=0D #=0D @@ -583,17 +643,20 @@ class WorkspaceAutoGen(AutoGen): HashDir =3D path.join(self.BuildDir, "Hash_Platform")=0D HashFile =3D path.join(HashDir, 'Platform.hash.' + m.hexdigest= ())=0D SaveFileOnChange(HashFile, m.hexdigest(), False)=0D - HashChainFile =3D path.join(HashDir, 'Platform.hashchain.' + m= .hexdigest())=0D + HashChainFile =3D path.join(=0D + HashDir, 'Platform.hashchain.' + m.hexdigest())=0D GlobalData.gPlatformHashFile =3D HashChainFile=0D try:=0D with open(HashChainFile, 'w') as f:=0D json.dump(FileList, f, indent=3D2)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save hashchain f= ile:%s" % HashChainFile)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save hashchain file:%s" % Ha= shChainFile)=0D =0D if GlobalData.gBinCacheDest:=0D # Copy platform hash files to cache destination=0D - FileDir =3D path.join(GlobalData.gBinCacheDest, self.Outpu= tDir, self.BuildTarget + "_" + self.ToolChain, "Hash_Platform")=0D + FileDir =3D path.join(GlobalData.gBinCacheDest, self.Outpu= tDir,=0D + self.BuildTarget + "_" + self.ToolChai= n, "Hash_Platform")=0D CacheFileDir =3D FileDir=0D CreateDirectory(CacheFileDir)=0D CopyFileOnChange(HashFile, CacheFileDir)=0D @@ -603,7 +666,7 @@ class WorkspaceAutoGen(AutoGen): # Write metafile list to build directory=0D #=0D AutoGenFilePath =3D os.path.join(self.BuildDir, 'AutoGen')=0D - if os.path.exists (AutoGenFilePath):=0D + if os.path.exists(AutoGenFilePath):=0D os.remove(AutoGenFilePath)=0D if not os.path.exists(self.BuildDir):=0D os.makedirs(self.BuildDir)=0D @@ -616,7 +679,8 @@ class WorkspaceAutoGen(AutoGen): if Pkg.PackageName in GlobalData.gPackageHash:=0D return=0D =0D - PkgDir =3D os.path.join(self.BuildDir, Pkg.Arch, "Hash_Pkg", Pkg.P= ackageName)=0D + PkgDir =3D os.path.join(self.BuildDir, Pkg.Arch,=0D + "Hash_Pkg", Pkg.PackageName)=0D CreateDirectory(PkgDir)=0D FileList =3D []=0D m =3D hashlib.md5()=0D @@ -625,7 +689,8 @@ class WorkspaceAutoGen(AutoGen): Content =3D f.read()=0D f.close()=0D m.update(Content)=0D - FileList.append((str(Pkg.MetaFile.Path), hashlib.md5(Content).hexd= igest()))=0D + FileList.append(=0D + (str(Pkg.MetaFile.Path), hashlib.md5(Content).hexdigest()))=0D # Get include files hash value=0D if Pkg.Includes:=0D for inc in sorted(Pkg.Includes, key=3Dlambda x: str(x)):=0D @@ -636,23 +701,29 @@ class WorkspaceAutoGen(AutoGen): Content =3D f.read()=0D f.close()=0D m.update(Content)=0D - FileList.append((str(File_Path), hashlib.md5(Conte= nt).hexdigest()))=0D + FileList.append(=0D + (str(File_Path), hashlib.md5(Content).hexdiges= t()))=0D GlobalData.gPackageHash[Pkg.PackageName] =3D m.hexdigest()=0D =0D HashDir =3D PkgDir=0D - HashFile =3D path.join(HashDir, Pkg.PackageName + '.hash.' + m.hex= digest())=0D + HashFile =3D path.join(HashDir, Pkg.PackageName +=0D + '.hash.' + m.hexdigest())=0D SaveFileOnChange(HashFile, m.hexdigest(), False)=0D - HashChainFile =3D path.join(HashDir, Pkg.PackageName + '.hashchain= .' + m.hexdigest())=0D - GlobalData.gPackageHashFile[(Pkg.PackageName, Pkg.Arch)] =3D HashC= hainFile=0D + HashChainFile =3D path.join(=0D + HashDir, Pkg.PackageName + '.hashchain.' + m.hexdigest())=0D + GlobalData.gPackageHashFile[(=0D + Pkg.PackageName, Pkg.Arch)] =3D HashChainFile=0D try:=0D with open(HashChainFile, 'w') as f:=0D json.dump(FileList, f, indent=3D2)=0D except:=0D - EdkLogger.quiet("[cache warning]: fail to save hashchain file:= %s" % HashChainFile)=0D + EdkLogger.quiet(=0D + "[cache warning]: fail to save hashchain file:%s" % HashCh= ainFile)=0D =0D if GlobalData.gBinCacheDest:=0D # Copy Pkg hash files to cache destination dir=0D - FileDir =3D path.join(GlobalData.gBinCacheDest, self.OutputDir= , self.BuildTarget + "_" + self.ToolChain, Pkg.Arch, "Hash_Pkg", Pkg.Packag= eName)=0D + FileDir =3D path.join(GlobalData.gBinCacheDest, self.OutputDir= , self.BuildTarget +=0D + "_" + self.ToolChain, Pkg.Arch, "Hash_Pkg"= , Pkg.PackageName)=0D CacheFileDir =3D FileDir=0D CreateDirectory(CacheFileDir)=0D CopyFileOnChange(HashFile, CacheFileDir)=0D @@ -664,9 +735,9 @@ class WorkspaceAutoGen(AutoGen): # add fdf=0D #=0D if self.FdfFile:=0D - AllWorkSpaceMetaFiles.add (self.FdfFile.Path)=0D + AllWorkSpaceMetaFiles.add(self.FdfFile.Path)=0D for f in GlobalData.gFdfParser.GetAllIncludedFile():=0D - AllWorkSpaceMetaFiles.add (f.FileName)=0D + AllWorkSpaceMetaFiles.add(f.FileName)=0D #=0D # add dsc=0D #=0D @@ -675,8 +746,10 @@ class WorkspaceAutoGen(AutoGen): #=0D # add build_rule.txt & tools_def.txt=0D #=0D - AllWorkSpaceMetaFiles.add(os.path.join(GlobalData.gConfDirectory, = gDefaultBuildRuleFile))=0D - AllWorkSpaceMetaFiles.add(os.path.join(GlobalData.gConfDirectory, = gDefaultToolsDefFile))=0D + AllWorkSpaceMetaFiles.add(os.path.join(=0D + GlobalData.gConfDirectory, gDefaultBuildRuleFile))=0D + AllWorkSpaceMetaFiles.add(os.path.join(=0D + GlobalData.gConfDirectory, gDefaultToolsDefFile))=0D =0D # add BuildOption metafile=0D #=0D @@ -684,7 +757,8 @@ class WorkspaceAutoGen(AutoGen): =0D # add PcdToken Number file for Dynamic/DynamicEx Pcd=0D #=0D - AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'PcdTokenNum= ber'))=0D + AllWorkSpaceMetaFiles.add(os.path.join(=0D + self.BuildDir, 'PcdTokenNumber'))=0D =0D for Pa in self.AutoGenObjectList:=0D AllWorkSpaceMetaFiles.add(Pa.ToolDefinitionFile)=0D @@ -706,10 +780,10 @@ class WorkspaceAutoGen(AutoGen): =0D def _CheckPcdDefineAndType(self):=0D PcdTypeSet =3D {TAB_PCDS_FIXED_AT_BUILD,=0D - TAB_PCDS_PATCHABLE_IN_MODULE,=0D - TAB_PCDS_FEATURE_FLAG,=0D - TAB_PCDS_DYNAMIC,=0D - TAB_PCDS_DYNAMIC_EX}=0D + TAB_PCDS_PATCHABLE_IN_MODULE,=0D + TAB_PCDS_FEATURE_FLAG,=0D + TAB_PCDS_DYNAMIC,=0D + TAB_PCDS_DYNAMIC_EX}=0D =0D # This dict store PCDs which are not used by any modules with spec= ified arches=0D UnusedPcd =3D OrderedDict()=0D @@ -737,7 +811,7 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error(=0D 'build',=0D FORMAT_INVALID,=0D - "Type [%s] of PCD [%s.%s] in DSC file does= n't match the type [%s] defined in DEC file." \=0D + "Type [%s] of PCD [%s.%s] in DSC file does= n't match the type [%s] defined in DEC file."=0D % (Pa.Platform.Pcds[Pcd].Type, Pcd[1], Pcd= [0], Type),=0D ExtraData=3DNone=0D )=0D @@ -757,42 +831,42 @@ class WorkspaceAutoGen(AutoGen): def __repr__(self):=0D return "%s [%s]" % (self.MetaFile, ", ".join(self.ArchList))=0D =0D - ## Return the directory to store FV files=0D + # Return the directory to store FV files=0D @cached_property=0D def FvDir(self):=0D return path.join(self.BuildDir, TAB_FV_DIRECTORY)=0D =0D - ## Return the directory to store all intermediate and final files buil= t=0D + # Return the directory to store all intermediate and final files built= =0D @cached_property=0D def BuildDir(self):=0D return self.AutoGenObjectList[0].BuildDir=0D =0D - ## Return the build output directory platform specifies=0D + # Return the build output directory platform specifies=0D @cached_property=0D def OutputDir(self):=0D return self.Platform.OutputDirectory=0D =0D - ## Return platform name=0D + # Return platform name=0D @cached_property=0D def Name(self):=0D return self.Platform.PlatformName=0D =0D - ## Return meta-file GUID=0D + # Return meta-file GUID=0D @cached_property=0D def Guid(self):=0D return self.Platform.Guid=0D =0D - ## Return platform version=0D + # Return platform version=0D @cached_property=0D def Version(self):=0D return self.Platform.Version=0D =0D - ## Return paths of tools=0D + # Return paths of tools=0D @cached_property=0D def ToolDefinition(self):=0D return self.AutoGenObjectList[0].ToolDefinition=0D =0D - ## Return directory of platform makefile=0D + # Return directory of platform makefile=0D #=0D # @retval string Makefile directory=0D #=0D @@ -800,7 +874,7 @@ class WorkspaceAutoGen(AutoGen): def MakeFileDir(self):=0D return self.BuildDir=0D =0D - ## Return build command string=0D + # Return build command string=0D #=0D # @retval string Build command string=0D #=0D @@ -809,7 +883,7 @@ class WorkspaceAutoGen(AutoGen): # BuildCommand should be all the same. So just get one from platfo= rm AutoGen=0D return self.AutoGenObjectList[0].BuildCommand=0D =0D - ## Check the PCDs token value conflict in each DEC file.=0D + # Check the PCDs token value conflict in each DEC file.=0D #=0D # Will cause build break and raise error message while two PCDs confli= ct.=0D #=0D @@ -821,7 +895,7 @@ class WorkspaceAutoGen(AutoGen): PcdList =3D list(Package.Pcds.values())=0D PcdList.sort(key=3Dlambda x: int(x.TokenValue, 0))=0D Count =3D 0=0D - while (Count < len(PcdList) - 1) :=0D + while (Count < len(PcdList) - 1):=0D Item =3D PcdList[Count]=0D ItemNext =3D PcdList[Count + 1]=0D #=0D @@ -834,13 +908,15 @@ class WorkspaceAutoGen(AutoGen): RemainPcdListLength =3D len(PcdList) - Count - 2=0D for ValueSameCount in range(RemainPcdListLength):= =0D if int(PcdList[len(PcdList) - RemainPcdListLen= gth + ValueSameCount].TokenValue, 0) =3D=3D int(Item.TokenValue, 0):=0D - SameTokenValuePcdList.append(PcdList[len(P= cdList) - RemainPcdListLength + ValueSameCount])=0D + SameTokenValuePcdList.append(=0D + PcdList[len(PcdList) - RemainPcdListLe= ngth + ValueSameCount])=0D else:=0D - break;=0D + break=0D #=0D # Sort same token value PCD list with TokenGuid an= d TokenCName=0D #=0D - SameTokenValuePcdList.sort(key=3Dlambda x: "%s.%s"= % (x.TokenSpaceGuidCName, x.TokenCName))=0D + SameTokenValuePcdList.sort(key=3Dlambda x: "%s.%s"= % (=0D + x.TokenSpaceGuidCName, x.TokenCName))=0D SameTokenValuePcdListCount =3D 0=0D while (SameTokenValuePcdListCount < len(SameTokenV= aluePcdList) - 1):=0D Flag =3D False=0D @@ -850,24 +926,25 @@ class WorkspaceAutoGen(AutoGen): if (TemListItem.TokenSpaceGuidCName =3D=3D Tem= ListItemNext.TokenSpaceGuidCName) and (TemListItem.TokenCName !=3D TemListI= temNext.TokenCName):=0D for PcdItem in GlobalData.MixedPcd:=0D if (TemListItem.TokenCName, TemListIte= m.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem] or \=0D - (TemListItemNext.TokenCName, TemLi= stItemNext.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:=0D + (TemListItemNext.TokenCName, T= emListItemNext.TokenSpaceGuidCName) in GlobalData.MixedPcd[PcdItem]:=0D Flag =3D True=0D if not Flag:=0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "The TokenValue [%s] of PC= D [%s.%s] is conflict with: [%s.%s] in %s"\=0D - % (TemListItem.TokenValue,= TemListItem.TokenSpaceGuidCName, TemListItem.TokenCName, TemListItemNext.T= okenSpaceGuidCName, TemListItemNext.TokenCName, Package),=0D - ExtraData=3DNone=0D - )=0D + 'build',=0D + FORMAT_INVALID,=0D + "The TokenValue [%s] of PCD [%s.%s= ] is conflict with: [%s.%s] in %s"=0D + % (TemListItem.TokenValue, TemList= Item.TokenSpaceGuidCName, TemListItem.TokenCName, TemListItemNext.TokenSpac= eGuidCName, TemListItemNext.TokenCName, Package),=0D + ExtraData=3DNone=0D + )=0D SameTokenValuePcdListCount +=3D 1=0D Count +=3D SameTokenValuePcdListCount=0D Count +=3D 1=0D =0D PcdList =3D list(Package.Pcds.values())=0D - PcdList.sort(key=3Dlambda x: "%s.%s" % (x.TokenSpaceGuidCN= ame, x.TokenCName))=0D + PcdList.sort(key=3Dlambda x: "%s.%s" %=0D + (x.TokenSpaceGuidCName, x.TokenCName))=0D Count =3D 0=0D - while (Count < len(PcdList) - 1) :=0D + while (Count < len(PcdList) - 1):=0D Item =3D PcdList[Count]=0D ItemNext =3D PcdList[Count + 1]=0D #=0D @@ -875,14 +952,15 @@ class WorkspaceAutoGen(AutoGen): #=0D if (Item.TokenSpaceGuidCName =3D=3D ItemNext.TokenSpac= eGuidCName) and (Item.TokenCName =3D=3D ItemNext.TokenCName) and (int(Item.= TokenValue, 0) !=3D int(ItemNext.TokenValue, 0)):=0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "The TokenValue [%s] of PCD [%s.%s] in= %s defined in two places should be same as well."\=0D - % (Item.TokenValue, Item.TokenSpaceGui= dCName, Item.TokenCName, Package),=0D - ExtraData=3DNone=0D - )=0D + 'build',=0D + FORMAT_INVALID,=0D + "The TokenValue [%s] of PCD [%s.%s] in %s defi= ned in two places should be same as well."=0D + % (Item.TokenValue, Item.TokenSpaceGuidCName, = Item.TokenCName, Package),=0D + ExtraData=3DNone=0D + )=0D Count +=3D 1=0D - ## Generate fds command=0D + # Generate fds command=0D +=0D @property=0D def GenFdsCommand(self):=0D return (GenMake.TopLevelMakefile(self)._TEMPLATE_.Replace(GenMake.= TopLevelMakefile(self)._TemplateDict)).strip()=0D @@ -909,7 +987,8 @@ class WorkspaceAutoGen(AutoGen): else:=0D pcdname =3D '.'.join(pcd[0:2])=0D if pcd[3].startswith('{'):=0D - FdsCommandDict["OptionPcd"].append(pcdname + '=3D' + 'H' += '"' + pcd[3] + '"')=0D + FdsCommandDict["OptionPcd"].append(=0D + pcdname + '=3D' + 'H' + '"' + pcd[3] + '"')=0D else:=0D FdsCommandDict["OptionPcd"].append(pcdname + '=3D' + pcd[3= ])=0D =0D @@ -920,7 +999,8 @@ class WorkspaceAutoGen(AutoGen): MacroDict.update(GlobalData.gCommandLineDefines)=0D for MacroName in MacroDict:=0D if MacroDict[MacroName] !=3D "":=0D - MacroList.append('"%s=3D%s"' % (MacroName, MacroDict[Macro= Name].replace('\\', '\\\\')))=0D + MacroList.append('"%s=3D%s"' % (=0D + MacroName, MacroDict[MacroName].replace('\\', '\\\\'))= )=0D else:=0D MacroList.append('"%s"' % MacroName)=0D FdsCommandDict["macro"] =3D MacroList=0D @@ -939,7 +1019,7 @@ class WorkspaceAutoGen(AutoGen): FdsCommandDict["cap"] =3D self.CapTargetList=0D return FdsCommandDict=0D =0D - ## Create makefile for the platform and modules in it=0D + # Create makefile for the platform and modules in it=0D #=0D # @param CreateDepsMakeFile Flag indicating if the makefil= e for=0D # modules will be created as wel= l=0D @@ -950,7 +1030,7 @@ class WorkspaceAutoGen(AutoGen): for Pa in self.AutoGenObjectList:=0D Pa.CreateMakeFile(CreateDepsMakeFile)=0D =0D - ## Create autogen code for platform and modules=0D + # Create autogen code for platform and modules=0D #=0D # Since there's no autogen code for platform, this method will do not= hing=0D # if CreateModuleCodeFile is set to False.=0D @@ -964,8 +1044,7 @@ class WorkspaceAutoGen(AutoGen): for Pa in self.AutoGenObjectList:=0D Pa.CreateCodeFile(CreateDepsCodeFile)=0D =0D - ## Create AsBuilt INF file the platform=0D + # Create AsBuilt INF file the platform=0D #=0D def CreateAsBuiltInf(self):=0D return=0D -=0D diff --git a/BaseTools/Source/Python/AutoGen/__init__.py b/BaseTools/Source= /Python/AutoGen/__init__.py index 47451c4c40fa..7e12731d6c86 100644 --- a/BaseTools/Source/Python/AutoGen/__init__.py +++ b/BaseTools/Source/Python/AutoGen/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'AutoGen' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/BPDG/BPDG.py b/BaseTools/Source/Python= /BPDG/BPDG.py index 283e08a37a0f..0820cfd5e7e0 100644 --- a/BaseTools/Source/Python/BPDG/BPDG.py +++ b/BaseTools/Source/Python/BPDG/BPDG.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Intel Binary Product Data Generation Tool (Intel BPDG).=0D # This tool provide a simple process for the creation of a binary file co= ntaining read-only=0D # configuration data for EDK II platforms that contain Dynamic and Dynami= cEx PCDs described=0D @@ -28,10 +28,10 @@ from Common.BuildVersion import gBUILD_VERSION from . import StringTable as st=0D from . import GenVpd=0D =0D -PROJECT_NAME =3D st.LBL_BPDG_LONG_UNI=0D -VERSION =3D (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)= =0D +PROJECT_NAME =3D st.LBL_BPDG_LONG_UNI=0D +VERSION =3D (st.LBL_BPDG_VERSION + " Build " + gBUILD_VERSION)=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -40,6 +40,8 @@ VERSION =3D (st.LBL_BPDG_VERSION + " Build " += gBUILD_VERSION) # @retval 0 Tool was successful=0D # @retval 1 Tool failed=0D #=0D +=0D +=0D def main():=0D global Options, Args=0D =0D @@ -59,24 +61,26 @@ def main(): EdkLogger.SetLevel(EdkLogger.INFO)=0D =0D if Options.bin_filename is None:=0D - EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= o option to specify the file name for the VPD binary file")=0D + EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE,=0D + "Please use the -o option to specify the file name= for the VPD binary file")=0D if Options.filename is None:=0D - EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -= m option to specify the file name for the mapping file")=0D + EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE,=0D + "Please use the -m option to specify the file name= for the mapping file")=0D =0D Force =3D False=0D if Options.opt_force is not None:=0D Force =3D True=0D =0D - if (Args[0] is not None) :=0D + if (Args[0] is not None):=0D StartBpdg(Args[0], Options.filename, Options.bin_filename, Force)= =0D - else :=0D + else:=0D EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify t= he file which contain the VPD pcd info.",=0D None)=0D =0D return ReturnCode=0D =0D =0D -## Parse command line options=0D +# Parse command line options=0D #=0D # Using standard Python module optparse to parse command line option of th= is tool.=0D #=0D @@ -107,13 +111,14 @@ def MyOptionParser(): =0D (options, args) =3D parser.parse_args()=0D if len(args) =3D=3D 0:=0D - EdkLogger.info("Please specify the filename.txt file which contain= the VPD pcd info!")=0D + EdkLogger.info(=0D + "Please specify the filename.txt file which contain the VPD pc= d info!")=0D EdkLogger.info(parser.usage)=0D sys.exit(1)=0D return options, args=0D =0D =0D -## Start BPDG and call the main functions=0D +# Start BPDG and call the main functions=0D #=0D # This method mainly focus on call GenVPD class member functions to comple= te=0D # BPDG's target. It will process VpdFile override, and provide the interfa= ce file=0D @@ -133,7 +138,7 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName, = Force): if choice.strip().lower() not in ['y', 'yes', '']:=0D return=0D =0D - GenVPD =3D GenVpd.GenVPD (InputFileName, MapFileName, VpdFileName)=0D + GenVPD =3D GenVpd.GenVPD(InputFileName, MapFileName, VpdFileName)=0D =0D EdkLogger.info('%-24s =3D %s' % ("VPD input data file: ", InputFileNam= e))=0D EdkLogger.info('%-24s =3D %s' % ("VPD output map file: ", MapFileName)= )=0D @@ -146,13 +151,13 @@ def StartBpdg(InputFileName, MapFileName, VpdFileName= , Force): =0D EdkLogger.info("- Vpd pcd fixed done! -")=0D =0D +=0D if __name__ =3D=3D '__main__':=0D try:=0D r =3D main()=0D except FatalError as e:=0D r =3D e=0D - ## 0-127 is a safe return range, and 1 is a standard default error=0D - if r < 0 or r > 127: r =3D 1=0D + # 0-127 is a safe return range, and 1 is a standard default error=0D + if r < 0 or r > 127:=0D + r =3D 1=0D sys.exit(r)=0D -=0D -=0D diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py b/BaseTools/Source/Pyth= on/BPDG/GenVpd.py index 049c082f40e2..371d5a8ebf06 100644 --- a/BaseTools/Source/Python/BPDG/GenVpd.py +++ b/BaseTools/Source/Python/BPDG/GenVpd.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file include GenVpd class for fix the Vpd type PCD offset, and Pcd= Entry for describe=0D # and process each entry of vpd type PCD.=0D #=0D @@ -25,40 +25,42 @@ _FORMAT_CHAR =3D {1: 'B', 8: 'Q'=0D }=0D =0D -## The VPD PCD data structure for store and process each VPD PCD entry.=0D +# The VPD PCD data structure for store and process each VPD PCD entry.=0D #=0D # This class contain method to format and pack pcd's value.=0D #=0D +=0D +=0D class PcdEntry:=0D - def __init__(self, PcdCName, SkuId,PcdOffset, PcdSize, PcdValue, Linen= o=3DNone, FileName=3DNone, PcdUnpackValue=3DNone,=0D + def __init__(self, PcdCName, SkuId, PcdOffset, PcdSize, PcdValue, Line= no=3DNone, FileName=3DNone, PcdUnpackValue=3DNone,=0D PcdBinOffset=3DNone, PcdBinSize=3DNone, Alignment=3DNone)= :=0D - self.PcdCName =3D PcdCName.strip()=0D - self.SkuId =3D SkuId.strip()=0D - self.PcdOffset =3D PcdOffset.strip()=0D - self.PcdSize =3D PcdSize.strip()=0D - self.PcdValue =3D PcdValue.strip()=0D - self.Lineno =3D Lineno.strip()=0D - self.FileName =3D FileName.strip()=0D + self.PcdCName =3D PcdCName.strip()=0D + self.SkuId =3D SkuId.strip()=0D + self.PcdOffset =3D PcdOffset.strip()=0D + self.PcdSize =3D PcdSize.strip()=0D + self.PcdValue =3D PcdValue.strip()=0D + self.Lineno =3D Lineno.strip()=0D + self.FileName =3D FileName.strip()=0D self.PcdUnpackValue =3D PcdUnpackValue=0D - self.PcdBinOffset =3D PcdBinOffset=0D - self.PcdBinSize =3D PcdBinSize=0D - self.Alignment =3D Alignment=0D + self.PcdBinOffset =3D PcdBinOffset=0D + self.PcdBinSize =3D PcdBinSize=0D + self.Alignment =3D Alignment=0D =0D - if self.PcdValue =3D=3D '' :=0D + if self.PcdValue =3D=3D '':=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid PCD format(Name: %s File: %s line: %s= ) , no Value specified!" % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - if self.PcdOffset =3D=3D '' :=0D + if self.PcdOffset =3D=3D '':=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid PCD format(Name: %s File: %s Line: %s= ) , no Offset specified!" % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - if self.PcdSize =3D=3D '' :=0D + if self.PcdSize =3D=3D '':=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid PCD format(Name: %s File: %s Line: %s= ), no PcdSize specified!" % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - self._GenOffsetValue ()=0D + self._GenOffsetValue()=0D =0D - ## Analyze the string value to judge the PCD's datum type equal to Boo= lean or not.=0D + # Analyze the string value to judge the PCD's datum type equal to Bool= ean or not.=0D #=0D # @param ValueString PCD's value=0D # @param Size PCD's size=0D @@ -75,7 +77,7 @@ class PcdEntry: =0D return False=0D =0D - ## Convert the PCD's value from string to integer.=0D + # Convert the PCD's value from string to integer.=0D #=0D # This function will try to convert the Offset value form string to i= nteger=0D # for both hexadecimal and decimal.=0D @@ -83,7 +85,7 @@ class PcdEntry: def _GenOffsetValue(self):=0D if self.PcdOffset !=3D TAB_STAR:=0D try:=0D - self.PcdBinOffset =3D int (self.PcdOffset)=0D + self.PcdBinOffset =3D int(self.PcdOffset)=0D except:=0D try:=0D self.PcdBinOffset =3D int(self.PcdOffset, 16)=0D @@ -91,7 +93,7 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,= =0D "Invalid offset value %s for PCD %s (F= ile: %s Line: %s)" % (self.PcdOffset, self.PcdCName, self.FileName, self.Li= neno))=0D =0D - ## Pack Boolean type VPD PCD's value form string to binary type.=0D + # Pack Boolean type VPD PCD's value form string to binary type.=0D #=0D # @param ValueString The boolean type string for pack.=0D #=0D @@ -110,7 +112,7 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid size or value for PCD %s to pack(= File: %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - ## Pack Integer type VPD PCD's value form string to binary type.=0D + # Pack Integer type VPD PCD's value form string to binary type.=0D #=0D # @param ValueString The Integer type string for pack.=0D #=0D @@ -127,11 +129,11 @@ class PcdEntry: if IntValue < 0:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,= =0D "PCD can't be set to negative value %d= for PCD %s in %s datum type(File: %s Line: %s)." % (=0D - IntValue, self.PcdCName, Type, self.Fi= leName, self.Lineno))=0D + IntValue, self.PcdCName, Type, sel= f.FileName, self.Lineno))=0D elif IntValue > MAX_VAL_TYPE[Type]:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,= =0D "Too large PCD value %d for datum type= %s for PCD %s(File: %s Line: %s)." % (=0D - IntValue, Type, self.PcdCName, self.Fi= leName, self.Lineno))=0D + IntValue, Type, self.PcdCName, sel= f.FileName, self.Lineno))=0D =0D try:=0D self.PcdValue =3D pack(_FORMAT_CHAR[Size], IntValue)=0D @@ -139,7 +141,7 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid size or value for PCD %s to pack(File= : %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - ## Pack VOID* type VPD PCD's value form string to binary type.=0D + # Pack VOID* type VPD PCD's value form string to binary type.=0D #=0D # The VOID* type of string divided into 3 sub-type:=0D # 1: L"String"/L'String', Unicode type string.=0D @@ -159,7 +161,7 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid VOID* type PCD %s value %s (File: %s = Line: %s)" % (self.PcdCName, ValueString, self.FileName, self.Lineno))=0D =0D - ## Pack an Ascii PCD value.=0D + # Pack an Ascii PCD value.=0D #=0D # An Ascii string for a PCD should be in format as ""/''.=0D #=0D @@ -168,7 +170,8 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid parameter Size %s of PCD %s!(File: %s= Line: %s)" % (self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno))= =0D if (ValueString =3D=3D ""):=0D - EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (self.PcdUnpack= Value, self.PcdCName, self.FileName, self.Lineno))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (=0D + self.PcdUnpackValue, self.PcdCName, self.FileName, self.Li= neno))=0D =0D QuotedFlag =3D True=0D if ValueString.startswith("'"):=0D @@ -185,15 +188,17 @@ class PcdEntry: EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D "Invalid size or value for PCD %s to pack(File= : %s Line: %s)." % (self.PcdCName, self.FileName, self.Lineno))=0D =0D - ## Pack a byte-array PCD value.=0D + # Pack a byte-array PCD value.=0D #=0D # A byte-array for a PCD should be in format as {0x01, 0x02, ...}.=0D #=0D def _PackByteArray(self, ValueString, Size):=0D if (Size < 0):=0D - 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))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter Size %s of PCD %s!(File: %s Line: %s)" % (=0D + self.PcdBinSize, self.PcdCName, self.FileName, self.Lineno= ))=0D if (ValueString =3D=3D ""):=0D - EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (self.PcdUnpack= Value, self.PcdCName, self.FileName, self.Lineno))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter ValueString %s of PCD %s!(File: %s Line: %s)" % (=0D + self.PcdUnpackValue, self.PcdCName, self.FileName, self.Li= neno))=0D =0D ValueString =3D ValueString.strip()=0D ValueString =3D ValueString.lstrip('{').strip('}')=0D @@ -214,7 +219,7 @@ class PcdEntry: Value =3D int(ValueList[Index], 16)=0D except:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,= =0D - "The value item %s in byte array %s is= an invalid HEX value.(File: %s Line: %s)" % \=0D + "The value item %s in byte array %s is= an invalid HEX value.(File: %s Line: %s)" %=0D (ValueList[Index], ValueString, self.F= ileName, self.Lineno))=0D else:=0D # translate decimal value=0D @@ -222,12 +227,12 @@ class PcdEntry: Value =3D int(ValueList[Index], 10)=0D except:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,= =0D - "The value item %s in byte array %s is= an invalid DECIMAL value.(File: %s Line: %s)" % \=0D + "The value item %s in byte array %s is= an invalid DECIMAL value.(File: %s Line: %s)" %=0D (ValueList[Index], ValueString, self.F= ileName, self.Lineno))=0D =0D if Value > 255:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D - "The value item %s in byte array %s do not= in range 0 ~ 0xFF(File: %s Line: %s)" % \=0D + "The value item %s in byte array %s do not= in range 0 ~ 0xFF(File: %s Line: %s)" %=0D (ValueList[Index], ValueString, self.FileN= ame, self.Lineno))=0D =0D ReturnArray.append(Value)=0D @@ -237,14 +242,14 @@ class PcdEntry: =0D self.PcdValue =3D ReturnArray.tolist()=0D =0D - ## Pack a unicode PCD value into byte array.=0D + # Pack a unicode PCD value into byte array.=0D #=0D # A unicode string for a PCD should be in format as L""/L''.=0D #=0D def _PackUnicode(self, UnicodeString, Size):=0D if (Size < 0):=0D - EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter Size %s of PCD %s!(File: %s Line: %s)" % \=0D - (self.PcdBinSize, self.PcdCName, self.FileNam= e, self.Lineno))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID, "Invali= d parameter Size %s of PCD %s!(File: %s Line: %s)" %=0D + (self.PcdBinSize, self.PcdCName, self.FileName= , self.Lineno))=0D =0D QuotedFlag =3D True=0D if UnicodeString.startswith("L'"):=0D @@ -254,7 +259,7 @@ class PcdEntry: # No null-terminator in L'string'=0D if (QuotedFlag and (len(UnicodeString) + 1) * 2 > Size) or (not Qu= otedFlag and len(UnicodeString) * 2 > Size):=0D EdkLogger.error("BPDG", BuildToolError.RESOURCE_OVERFLOW,=0D - "The size of unicode string %s is too larger f= or size %s(File: %s Line: %s)" % \=0D + "The size of unicode string %s is too larger f= or size %s(File: %s Line: %s)" %=0D (UnicodeString, Size, self.FileName, self.Line= no))=0D =0D ReturnArray =3D array.array('B')=0D @@ -264,7 +269,7 @@ class PcdEntry: ReturnArray.append(0)=0D except:=0D EdkLogger.error("BPDG", BuildToolError.FORMAT_INVALID,=0D - "Invalid unicode character %s in unicode s= tring %s(File: %s Line: %s)" % \=0D + "Invalid unicode character %s in unicode s= tring %s(File: %s Line: %s)" %=0D (Value, UnicodeString, self.FileName, self= .Lineno))=0D =0D for Index in range(len(UnicodeString) * 2, Size):=0D @@ -273,8 +278,7 @@ class PcdEntry: self.PcdValue =3D ReturnArray.tolist()=0D =0D =0D -=0D -## The class implementing the BPDG VPD PCD offset fix process=0D +# The class implementing the BPDG VPD PCD offset fix process=0D #=0D # The VPD PCD offset fix process includes:=0D # 1. Parse the input guided.txt file and store it in the data struct= ure;=0D @@ -282,8 +286,8 @@ class PcdEntry: # 3. Fixed offset if needed;=0D # 4. Generate output file, including guided.map and guided.bin file;= =0D #=0D -class GenVPD :=0D - ## Constructor of DscBuildData=0D +class GenVPD:=0D + # Constructor of DscBuildData=0D #=0D # Initialize object of GenVPD=0D # @Param InputFileName The filename include the vpd type pcd = information=0D @@ -293,28 +297,30 @@ class GenVPD : # @param VpdFileName The filename of Vpd file that hold vpd= pcd information.=0D #=0D def __init__(self, InputFileName, MapFileName, VpdFileName):=0D - self.InputFileName =3D InputFileName=0D - self.MapFileName =3D MapFileName=0D - self.VpdFileName =3D VpdFileName=0D - self.FileLinesList =3D []=0D - self.PcdFixedOffsetSizeList =3D []=0D - self.PcdUnknownOffsetList =3D []=0D + self.InputFileName =3D InputFileName=0D + self.MapFileName =3D MapFileName=0D + self.VpdFileName =3D VpdFileName=0D + self.FileLinesList =3D []=0D + self.PcdFixedOffsetSizeList =3D []=0D + self.PcdUnknownOffsetList =3D []=0D try:=0D fInputfile =3D open(InputFileName, "r")=0D try:=0D self.FileLinesList =3D fInputfile.readlines()=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FILE_READ_FAILURE, = "File read failed for %s" % InputFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_READ_FAILURE,= =0D + "File read failed for %s" % InputFileName,= None)=0D finally:=0D fInputfile.close()=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "Fil= e open failed for %s" % InputFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE,=0D + "File open failed for %s" % InputFileName, Non= e)=0D =0D ##=0D # Parser the input file which is generated by the build tool. Convert = the value of each pcd's=0D # from string to its real format. Also remove the useless line in the = input file.=0D #=0D - def ParserInputFile (self):=0D + def ParserInputFile(self):=0D count =3D 0=0D for line in self.FileLinesList:=0D # Strip "\r\n" generated by readlines ().=0D @@ -322,7 +328,7 @@ class GenVPD : line =3D line.rstrip(os.linesep)=0D =0D # Skip the comment line=0D - if (not line.startswith("#")) and len(line) > 1 :=0D + if (not line.startswith("#")) and len(line) > 1:=0D #=0D # Enhanced for support "|" character in the string.=0D #=0D @@ -345,10 +351,10 @@ class GenVPD : self.FileLinesList[count] =3D ValueList=0D # Store the line number=0D self.FileLinesList[count].append(str(count + 1))=0D - elif len(line) <=3D 1 :=0D + elif len(line) <=3D 1:=0D # Set the blank line to "None"=0D self.FileLinesList[count] =3D None=0D - else :=0D + else:=0D # Set the comment line to "None"=0D self.FileLinesList[count] =3D None=0D count +=3D 1=0D @@ -356,40 +362,41 @@ class GenVPD : # The line count contain usage information=0D count =3D 0=0D # Delete useless lines=0D - while (True) :=0D - try :=0D - if (self.FileLinesList[count] is None) :=0D + while (True):=0D + try:=0D + if (self.FileLinesList[count] is None):=0D del(self.FileLinesList[count])=0D - else :=0D + else:=0D count +=3D 1=0D - except :=0D + except:=0D break=0D #=0D # After remove the useless line, if there are no data remain in th= e file line list,=0D # Report warning messages to user's.=0D #=0D - if len(self.FileLinesList) =3D=3D 0 :=0D + if len(self.FileLinesList) =3D=3D 0:=0D EdkLogger.warn('BPDG', BuildToolError.RESOURCE_NOT_AVAILABLE,= =0D "There are no VPD type pcds defined in DSC file= , Please check it.")=0D =0D # Process the pcds one by one base on the pcd's value and size=0D count =3D 0=0D for line in self.FileLinesList:=0D - if line is not None :=0D - PCD =3D PcdEntry(line[0], line[1], line[2], line[3], line[= 4], line[5], self.InputFileName)=0D + if line is not None:=0D + PCD =3D PcdEntry(line[0], line[1], line[2], line[3],=0D + line[4], line[5], self.InputFileName)=0D # Strip the space char=0D - PCD.PcdCName =3D PCD.PcdCName.strip(' ')=0D - PCD.SkuId =3D PCD.SkuId.strip(' ')=0D - PCD.PcdOffset =3D PCD.PcdOffset.strip(' ')=0D - PCD.PcdSize =3D PCD.PcdSize.strip(' ')=0D - PCD.PcdValue =3D PCD.PcdValue.strip(' ')=0D - PCD.Lineno =3D PCD.Lineno.strip(' ')=0D + PCD.PcdCName =3D PCD.PcdCName.strip(' ')=0D + PCD.SkuId =3D PCD.SkuId.strip(' ')=0D + PCD.PcdOffset =3D PCD.PcdOffset.strip(' ')=0D + PCD.PcdSize =3D PCD.PcdSize.strip(' ')=0D + PCD.PcdValue =3D PCD.PcdValue.strip(' ')=0D + PCD.Lineno =3D PCD.Lineno.strip(' ')=0D =0D #=0D # Store the original pcd value.=0D # This information will be useful while generate the outpu= t map file.=0D #=0D - PCD.PcdUnpackValue =3D str(PCD.PcdValue)=0D + PCD.PcdUnpackValue =3D str(PCD.PcdValue)=0D =0D #=0D # Translate PCD size string to an integer value.=0D @@ -402,7 +409,8 @@ class GenVPD : PackSize =3D int(PCD.PcdSize, 16)=0D PCD.PcdBinSize =3D PackSize=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FORMAT_INVA= LID, "Invalid PCD size value %s at file: %s line: %s" % (PCD.PcdSize, self.= InputFileName, PCD.Lineno))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_INVA= LID, "Invalid PCD size value %s at file: %s line: %s" % (=0D + PCD.PcdSize, self.InputFileName, PCD.Lineno))= =0D =0D #=0D # If value is Unicode string (e.g. L""), then use 2-byte a= lignment=0D @@ -420,12 +428,15 @@ class GenVPD : if PCD.PcdOffset !=3D TAB_STAR:=0D if PCD.PcdOccupySize % Alignment !=3D 0:=0D if PCD.PcdUnpackValue.startswith("{"):=0D - EdkLogger.warn("BPDG", "The offset value of PC= D %s is not 8-byte aligned!" %(PCD.PcdCName), File=3Dself.InputFileName)=0D + EdkLogger.warn("BPDG", "The offset value of PC= D %s is not 8-byte aligned!" % (=0D + PCD.PcdCName), File=3Dself.InputFileName)= =0D else:=0D - EdkLogger.error("BPDG", BuildToolError.FORMAT_= INVALID, 'The offset value of PCD %s should be %s-byte aligned.' % (PCD.Pcd= CName, Alignment))=0D + EdkLogger.error("BPDG", BuildToolError.FORMAT_= INVALID,=0D + 'The offset value of PCD %s sh= ould be %s-byte aligned.' % (PCD.PcdCName, Alignment))=0D else:=0D if PCD.PcdOccupySize % Alignment !=3D 0:=0D - PCD.PcdOccupySize =3D (PCD.PcdOccupySize // Alignm= ent + 1) * Alignment=0D + PCD.PcdOccupySize =3D (=0D + PCD.PcdOccupySize // Alignment + 1) * Alignmen= t=0D =0D PackSize =3D PCD.PcdOccupySize=0D if PCD._IsBoolean(PCD.PcdValue, PCD.PcdSize):=0D @@ -453,29 +464,29 @@ class GenVPD : =0D self.FileLinesList[count] =3D PCD=0D count +=3D 1=0D - else :=0D + else:=0D continue=0D =0D ##=0D # This function used to create a clean list only contain useful inform= ation and reorganized to make it=0D # easy to be sorted=0D #=0D - def FormatFileLine (self) :=0D + def FormatFileLine(self):=0D =0D - for eachPcd in self.FileLinesList :=0D - if eachPcd.PcdOffset !=3D TAB_STAR :=0D + for eachPcd in self.FileLinesList:=0D + if eachPcd.PcdOffset !=3D TAB_STAR:=0D # Use pcd's Offset value as key, and pcd's Value as value= =0D self.PcdFixedOffsetSizeList.append(eachPcd)=0D - else :=0D + else:=0D # Use pcd's CName as key, and pcd's Size as value=0D self.PcdUnknownOffsetList.append(eachPcd)=0D =0D -=0D ##=0D # This function is use to fix the offset value which the not specified= in the map file.=0D # Usually it use the star (meaning any offset) character in the offset= field=0D #=0D - def FixVpdOffset (self):=0D +=0D + def FixVpdOffset(self):=0D # At first, the offset should start at 0=0D # Sort fixed offset list in order to find out where has free space= s for the pcd's offset=0D # value is TAB_STAR to insert into.=0D @@ -487,187 +498,204 @@ class GenVPD : #=0D self.PcdUnknownOffsetList.sort(key=3Dlambda x: x.PcdBinSize)=0D =0D - index =3D0=0D + index =3D 0=0D for pcd in self.PcdUnknownOffsetList:=0D index +=3D 1=0D if pcd.PcdCName =3D=3D ".".join(("gEfiMdeModulePkgTokenSpaceGu= id", "PcdNvStoreDefaultValueBuffer")):=0D if index !=3D len(self.PcdUnknownOffsetList):=0D for i in range(len(self.PcdUnknownOffsetList) - index)= :=0D - self.PcdUnknownOffsetList[index+i -1 ], self.PcdUn= knownOffsetList[index+i] =3D self.PcdUnknownOffsetList[index+i], self.PcdUn= knownOffsetList[index+i -1]=0D + self.PcdUnknownOffsetList[index+i - 1], self.PcdUn= knownOffsetList[index +=0D + = i] =3D self.PcdUnknownOffsetList[index+i], self.PcdUnknownO= ffsetList[index+i - 1]=0D =0D #=0D # Process all Offset value are TAB_STAR=0D #=0D - if (len(self.PcdFixedOffsetSizeList) =3D=3D 0) and (len(self.PcdUn= knownOffsetList) !=3D 0) :=0D + if (len(self.PcdFixedOffsetSizeList) =3D=3D 0) and (len(self.PcdUn= knownOffsetList) !=3D 0):=0D # The offset start from 0=0D NowOffset =3D 0=0D - for Pcd in self.PcdUnknownOffsetList :=0D + for Pcd in self.PcdUnknownOffsetList:=0D if NowOffset % Pcd.Alignment !=3D 0:=0D - NowOffset =3D (NowOffset// Pcd.Alignment + 1) * Pcd.Al= ignment=0D + NowOffset =3D (NowOffset // Pcd.Alignment + 1) * \=0D + Pcd.Alignment=0D Pcd.PcdBinOffset =3D NowOffset=0D - Pcd.PcdOffset =3D str(hex(Pcd.PcdBinOffset))=0D - NowOffset +=3D Pcd.PcdOccupySize=0D + Pcd.PcdOffset =3D str(hex(Pcd.PcdBinOffset))=0D + NowOffset +=3D Pcd.PcdOccupySize=0D =0D self.PcdFixedOffsetSizeList =3D self.PcdUnknownOffsetList=0D return=0D =0D # Check the offset of VPD type pcd's offset start from 0.=0D - if self.PcdFixedOffsetSizeList[0].PcdBinOffset !=3D 0 :=0D + if self.PcdFixedOffsetSizeList[0].PcdBinOffset !=3D 0:=0D EdkLogger.warn("BPDG", "The offset of VPD type pcd should star= t with 0, please check it.",=0D - None)=0D + None)=0D =0D # Judge whether the offset in fixed pcd offset list is overlapped = or not.=0D lenOfList =3D len(self.PcdFixedOffsetSizeList)=0D - count =3D 0=0D - while (count < lenOfList - 1) :=0D - PcdNow =3D self.PcdFixedOffsetSizeList[count]=0D + count =3D 0=0D + while (count < lenOfList - 1):=0D + PcdNow =3D self.PcdFixedOffsetSizeList[count]=0D PcdNext =3D self.PcdFixedOffsetSizeList[count+1]=0D # Two pcd's offset is same=0D - if PcdNow.PcdBinOffset =3D=3D PcdNext.PcdBinOffset :=0D + if PcdNow.PcdBinOffset =3D=3D PcdNext.PcdBinOffset:=0D EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILU= RE,=0D - "The offset of %s at line: %s is same with= %s at line: %s in file %s" % \=0D - (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName, PcdNext.Lineno, PcdNext.FileName),=0D + "The offset of %s at line: %s is same with= %s at line: %s in file %s" %=0D + (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName,=0D + PcdNext.Lineno, PcdNext.FileName),=0D None)=0D =0D # Overlapped=0D - if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize > PcdNext.PcdBin= Offset :=0D + if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize > PcdNext.PcdBin= Offset:=0D EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_GET_FAILU= RE,=0D - "The offset of %s at line: %s is overlappe= d with %s at line: %s in file %s" % \=0D - (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName, PcdNext.Lineno, PcdNext.FileName),=0D + "The offset of %s at line: %s is overlappe= d with %s at line: %s in file %s" %=0D + (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.P= cdCName,=0D + PcdNext.Lineno, PcdNext.FileName),=0D None)=0D =0D # Has free space, raise a warning message=0D - if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize < PcdNext.PcdBin= Offset :=0D + if PcdNow.PcdBinOffset + PcdNow.PcdOccupySize < PcdNext.PcdBin= Offset:=0D EdkLogger.warn("BPDG", BuildToolError.ATTRIBUTE_GET_FAILUR= E,=0D - "The offsets have free space of between %s = at line: %s and %s at line: %s in file %s" % \=0D - (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.Pc= dCName, PcdNext.Lineno, PcdNext.FileName),=0D - None)=0D + "The offsets have free space of between %s = at line: %s and %s at line: %s in file %s" %=0D + (PcdNow.PcdCName, PcdNow.Lineno, PcdNext.Pc= dCName,=0D + PcdNext.Lineno, PcdNext.FileName),=0D + None)=0D count +=3D 1=0D =0D - LastOffset =3D self.PcdFixedOffsetSizeList[0].PcdBinO= ffset=0D - FixOffsetSizeListCount =3D 0=0D - lenOfList =3D len(self.PcdFixedOffsetSizeList)=0D - lenOfUnfixedList =3D len(self.PcdUnknownOffsetList)=0D + LastOffset =3D self.PcdFixedOffsetSizeList[0].PcdBinOffset=0D + FixOffsetSizeListCount =3D 0=0D + lenOfList =3D len(self.PcdFixedOffsetSizeList)=0D + lenOfUnfixedList =3D len(self.PcdUnknownOffsetList)=0D =0D ##=0D # Insert the un-fixed offset pcd's list into fixed offset pcd's li= st if has free space between those pcds.=0D #=0D - while (FixOffsetSizeListCount < lenOfList) :=0D + while (FixOffsetSizeListCount < lenOfList):=0D =0D - eachFixedPcd =3D self.PcdFixedOffsetSizeList[FixOffsetSize= ListCount]=0D - NowOffset =3D eachFixedPcd.PcdBinOffset=0D + eachFixedPcd =3D self.PcdFixedOffsetSizeList[FixOffsetSizeList= Count]=0D + NowOffset =3D eachFixedPcd.PcdBinOffset=0D =0D # Has free space=0D - if LastOffset < NowOffset :=0D - if lenOfUnfixedList !=3D 0 :=0D + if LastOffset < NowOffset:=0D + if lenOfUnfixedList !=3D 0:=0D countOfUnfixedList =3D 0=0D - while(countOfUnfixedList < lenOfUnfixedList) :=0D - eachUnfixedPcd =3D self.PcdUnknownOffsetList[= countOfUnfixedList]=0D - needFixPcdSize =3D eachUnfixedPcd.PcdOccupySi= ze=0D + while(countOfUnfixedList < lenOfUnfixedList):=0D + eachUnfixedPcd =3D self.PcdUnknownOffsetList[count= OfUnfixedList]=0D + needFixPcdSize =3D eachUnfixedPcd.PcdOccupySize=0D # Not been fixed=0D - if eachUnfixedPcd.PcdOffset =3D=3D TAB_STAR :=0D + if eachUnfixedPcd.PcdOffset =3D=3D TAB_STAR:=0D if LastOffset % eachUnfixedPcd.Alignment !=3D = 0:=0D - LastOffset =3D (LastOffset // eachUnfixedP= cd.Alignment + 1) * eachUnfixedPcd.Alignment=0D + LastOffset =3D (=0D + LastOffset // eachUnfixedPcd.Alignment= + 1) * eachUnfixedPcd.Alignment=0D # The offset un-fixed pcd can write into this = free space=0D - if needFixPcdSize <=3D (NowOffset - LastOffset= ) :=0D + if needFixPcdSize <=3D (NowOffset - LastOffset= ):=0D # Change the offset value of un-fixed pcd= =0D - eachUnfixedPcd.PcdOffset =3D str(hex(La= stOffset))=0D + eachUnfixedPcd.PcdOffset =3D str(hex(LastO= ffset))=0D eachUnfixedPcd.PcdBinOffset =3D LastOffset= =0D # Insert this pcd into fixed offset pcd li= st.=0D - self.PcdFixedOffsetSizeList.insert(FixOffs= etSizeListCount, eachUnfixedPcd)=0D + self.PcdFixedOffsetSizeList.insert(=0D + FixOffsetSizeListCount, eachUnfixedPcd= )=0D =0D # Delete the item's offset that has been f= ixed and added into fixed offset list=0D - self.PcdUnknownOffsetList.pop(countOfUnfix= edList)=0D + self.PcdUnknownOffsetList.pop(=0D + countOfUnfixedList)=0D =0D # After item added, should enlarge the len= gth of fixed pcd offset list=0D - lenOfList +=3D 1=0D - FixOffsetSizeListCount +=3D 1=0D + lenOfList +=3D 1=0D + FixOffsetSizeListCount +=3D 1=0D =0D # Decrease the un-fixed pcd offset list's = length=0D - lenOfUnfixedList -=3D 1=0D + lenOfUnfixedList -=3D 1=0D =0D # Modify the last offset value=0D - LastOffset +=3D needFixPcdSiz= e=0D - else :=0D + LastOffset +=3D needFixPcdSize=0D + else:=0D # It can not insert into those two pcds, n= eed to check still has other space can store it.=0D - LastOffset =3D NowOffset + sel= f.PcdFixedOffsetSizeList[FixOffsetSizeListCount].PcdOccupySize=0D + LastOffset =3D NowOffset + \=0D + self.PcdFixedOffsetSizeList[FixOffsetS= izeListCount].PcdOccupySize=0D FixOffsetSizeListCount +=3D 1=0D break=0D =0D # Set the FixOffsetSizeListCount =3D lenOfList for quit th= e loop=0D - else :=0D + else:=0D FixOffsetSizeListCount =3D lenOfList=0D =0D # No free space, smoothly connect with previous pcd.=0D - elif LastOffset =3D=3D NowOffset :=0D + elif LastOffset =3D=3D NowOffset:=0D LastOffset =3D NowOffset + eachFixedPcd.PcdOccupySize=0D FixOffsetSizeListCount +=3D 1=0D # Usually it will not enter into this thunk, if so, means it o= verlapped.=0D - else :=0D + else:=0D EdkLogger.error("BPDG", BuildToolError.ATTRIBUTE_NOT_AVAIL= ABLE,=0D - "The offset value definition has overlappe= d at pcd: %s, its offset is: %s, in file: %s line: %s" % \=0D - (eachFixedPcd.PcdCName, eachFixedPcd.PcdOf= fset, eachFixedPcd.InputFileName, eachFixedPcd.Lineno),=0D + "The offset value definition has overlappe= d at pcd: %s, its offset is: %s, in file: %s line: %s" %=0D + (eachFixedPcd.PcdCName, eachFixedPcd.PcdOf= fset,=0D + eachFixedPcd.InputFileName, eachFixedPcd.= Lineno),=0D None)=0D FixOffsetSizeListCount +=3D 1=0D =0D # Continue to process the un-fixed offset pcd's list, add this tim= e, just append them behind the fixed pcd's offset list.=0D - lenOfUnfixedList =3D len(self.PcdUnknownOffsetList)=0D - lenOfList =3D len(self.PcdFixedOffsetSizeList)=0D - while (lenOfUnfixedList > 0) :=0D + lenOfUnfixedList =3D len(self.PcdUnknownOffsetList)=0D + lenOfList =3D len(self.PcdFixedOffsetSizeList)=0D + while (lenOfUnfixedList > 0):=0D # Still has items need to process=0D # The last pcd instance=0D - LastPcd =3D self.PcdFixedOffsetSizeList[lenOfList-1]=0D + LastPcd =3D self.PcdFixedOffsetSizeList[lenOfList-1]=0D NeedFixPcd =3D self.PcdUnknownOffsetList[0]=0D =0D NeedFixPcd.PcdBinOffset =3D LastPcd.PcdBinOffset + LastPcd.Pcd= OccupySize=0D if NeedFixPcd.PcdBinOffset % NeedFixPcd.Alignment !=3D 0:=0D - NeedFixPcd.PcdBinOffset =3D (NeedFixPcd.PcdBinOffset // Ne= edFixPcd.Alignment + 1) * NeedFixPcd.Alignment=0D + NeedFixPcd.PcdBinOffset =3D (=0D + NeedFixPcd.PcdBinOffset // NeedFixPcd.Alignment + 1) *= NeedFixPcd.Alignment=0D =0D - NeedFixPcd.PcdOffset =3D str(hex(NeedFixPcd.PcdBinOffset))= =0D + NeedFixPcd.PcdOffset =3D str(hex(NeedFixPcd.PcdBinOffset))=0D =0D # Insert this pcd into fixed offset pcd list's tail.=0D self.PcdFixedOffsetSizeList.insert(lenOfList, NeedFixPcd)=0D # Delete the item's offset that has been fixed and added into = fixed offset list=0D self.PcdUnknownOffsetList.pop(0)=0D =0D - lenOfList +=3D 1=0D - lenOfUnfixedList -=3D 1=0D + lenOfList +=3D 1=0D + lenOfUnfixedList -=3D 1=0D ##=0D # Write the final data into output files.=0D #=0D - def GenerateVpdFile (self, MapFileName, BinFileName):=0D - #Open an VPD file to process=0D +=0D + def GenerateVpdFile(self, MapFileName, BinFileName):=0D + # Open an VPD file to process=0D =0D try:=0D fVpdFile =3D open(BinFileName, "wb")=0D except:=0D # Open failed=0D - EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "Fil= e open failed for %s" % self.VpdFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE,=0D + "File open failed for %s" % self.VpdFileName, = None)=0D =0D - try :=0D + try:=0D fMapFile =3D open(MapFileName, "w")=0D except:=0D # Open failed=0D - EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE, "Fil= e open failed for %s" % self.MapFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_OPEN_FAILURE,=0D + "File open failed for %s" % self.MapFileName, = None)=0D =0D # Use a instance of BytesIO to cache data=0D fStringIO =3D BytesIO()=0D =0D # Write the header of map file.=0D - try :=0D - fMapFile.write (st.MAP_FILE_COMMENT_TEMPLATE + "\n")=0D + try:=0D + fMapFile.write(st.MAP_FILE_COMMENT_TEMPLATE + "\n")=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Wr= ite data to file %s failed, please check whether the file been locked or us= ing by other applications." % self.MapFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE,=0D + "Write data to file %s failed, please check wh= ether the file been locked or using by other applications." % self.MapFileN= ame, None)=0D =0D - for eachPcd in self.PcdFixedOffsetSizeList :=0D + for eachPcd in self.PcdFixedOffsetSizeList:=0D # write map file=0D - try :=0D - fMapFile.write("%s | %s | %s | %s | %s \n" % (eachPcd.Pcd= CName, eachPcd.SkuId, eachPcd.PcdOffset, eachPcd.PcdSize, eachPcd.PcdUnpack= Value))=0D + try:=0D + fMapFile.write("%s | %s | %s | %s | %s \n" % (=0D + eachPcd.PcdCName, eachPcd.SkuId, eachPcd.PcdOffset, ea= chPcd.PcdSize, eachPcd.PcdUnpackValue))=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE,= "Write data to file %s failed, please check whether the file been locked o= r using by other applications." % self.MapFileName, None)=0D + EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE,= =0D + "Write data to file %s failed, please chec= k whether the file been locked or using by other applications." % self.MapF= ileName, None)=0D =0D # Write Vpd binary file=0D - fStringIO.seek (eachPcd.PcdBinOffset)=0D + fStringIO.seek(eachPcd.PcdBinOffset)=0D if isinstance(eachPcd.PcdValue, list):=0D for i in range(len(eachPcd.PcdValue)):=0D Value =3D eachPcd.PcdValue[i:i + 1]=0D @@ -676,14 +704,14 @@ class GenVPD : else:=0D fStringIO.write(bytes(Value))=0D else:=0D - fStringIO.write (eachPcd.PcdValue)=0D + fStringIO.write(eachPcd.PcdValue)=0D =0D - try :=0D - fVpdFile.write (fStringIO.getvalue())=0D + try:=0D + fVpdFile.write(fStringIO.getvalue())=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE, "Wr= ite data to file %s failed, please check whether the file been locked or us= ing by other applications." % self.VpdFileName, None)=0D -=0D - fStringIO.close ()=0D - fVpdFile.close ()=0D - fMapFile.close ()=0D + EdkLogger.error("BPDG", BuildToolError.FILE_WRITE_FAILURE,=0D + "Write data to file %s failed, please check wh= ether the file been locked or using by other applications." % self.VpdFileN= ame, None)=0D =0D + fStringIO.close()=0D + fVpdFile.close()=0D + fMapFile.close()=0D diff --git a/BaseTools/Source/Python/BPDG/StringTable.py b/BaseTools/Source= /Python/BPDG/StringTable.py index cd8b2d732645..b142ebc60129 100644 --- a/BaseTools/Source/Python/BPDG/StringTable.py +++ b/BaseTools/Source/Python/BPDG/StringTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define strings used in the BPDG tool=0D #=0D # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -6,9 +6,9 @@ ##=0D =0D =0D -#string table starts here...=0D +# string table starts here...=0D =0D -#strings are classified as following types=0D +# strings are classified as following types=0D # MSG_...: it is a message string=0D # ERR_...: it is a error string=0D # WRN_...: it is a warning string=0D @@ -19,7 +19,7 @@ # XRC_...: it is a user visible string from xrc file=0D =0D MAP_FILE_COMMENT_TEMPLATE =3D \=0D -"""=0D + """=0D ## @file=0D #=0D # THIS IS AUTO-GENERATED FILE BY BPDG TOOLS AND PLEASE DO NOT MAKE MODIFI= CATION.=0D @@ -38,12 +38,12 @@ MAP_FILE_COMMENT_TEMPLATE =3D \ """=0D =0D =0D -=0D -LBL_BPDG_LONG_UNI =3D (u"Intel(r) Binary Product Data Generation= Tool (Intel(r) BPDG)")=0D -LBL_BPDG_VERSION =3D (u"1.0")=0D -LBL_BPDG_USAGE =3D \=0D -(=0D -"""BPDG options -o Filename.bin -m Filename.map Filename.txt=0D +LBL_BPDG_LONG_UNI =3D (=0D + u"Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)")=0D +LBL_BPDG_VERSION =3D (u"1.0")=0D +LBL_BPDG_USAGE =3D \=0D + (=0D + """BPDG options -o Filename.bin -m Filename.map Filename.txt=0D Copyright (c) 2010 - 2018, Intel Corporation All Rights Reserved.=0D =0D Intel(r) Binary Product Data Generation Tool (Intel(r) BPDG)=0D @@ -56,17 +56,20 @@ Required Flags: the mapping of Pcd name, offset, datum size and value derived= =0D from the input file and any automatic calculations.=0D """=0D -)=0D + )=0D =0D -MSG_OPTION_HELP =3D ("Show this help message and exit.")=0D -MSG_OPTION_DEBUG_LEVEL =3D ("Print DEBUG statements, where DEBUG_LEVE= L is 0-9.")=0D -MSG_OPTION_VERBOSE =3D ("Print informational statements.")=0D -MSG_OPTION_QUIET =3D ("Returns the exit code and will display o= nly error messages.")=0D -MSG_OPTION_VPD_FILENAME =3D ("Specify the file name for the VPD binary= file.")=0D -MSG_OPTION_MAP_FILENAME =3D ("Generate file name for consumption durin= g the build that contains the mapping of Pcd name, offset, datum size and v= alue derived from the input file and any automatic calculations.")=0D -MSG_OPTION_FORCE =3D ("Will force overwriting existing output f= iles rather than returning an error message.")=0D +MSG_OPTION_HELP =3D ("Show this help message and exit.")=0D +MSG_OPTION_DEBUG_LEVEL =3D ("Print DEBUG statements, where DEBUG_LEVEL is = 0-9.")=0D +MSG_OPTION_VERBOSE =3D ("Print informational statements.")=0D +MSG_OPTION_QUIET =3D (=0D + "Returns the exit code and will display only error messages.")=0D +MSG_OPTION_VPD_FILENAME =3D ("Specify the file name for the VPD binary fil= e.")=0D +MSG_OPTION_MAP_FILENAME =3D (=0D + "Generate file name for consumption during the build that contains the= mapping of Pcd name, offset, datum size and value derived from the input f= ile and any automatic calculations.")=0D +MSG_OPTION_FORCE =3D (=0D + "Will force overwriting existing output files rather than returning an= error message.")=0D =0D -ERR_INVALID_DEBUG_LEVEL =3D ("Invalid level for debug message. Only "= =0D - "'DEBUG', 'INFO', 'WARNING', 'ERROR', "=0D - "'CRITICAL' are supported for debugging "= =0D - "messages.")=0D +ERR_INVALID_DEBUG_LEVEL =3D ("Invalid level for debug message. Only "=0D + "'DEBUG', 'INFO', 'WARNING', 'ERROR', "=0D + "'CRITICAL' are supported for debugging "=0D + "messages.")=0D diff --git a/BaseTools/Source/Python/BPDG/__init__.py b/BaseTools/Source/Py= thon/BPDG/__init__.py index ea120ab9c743..20f8a593e315 100644 --- a/BaseTools/Source/Python/BPDG/__init__.py +++ b/BaseTools/Source/Python/BPDG/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'BPDG' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools= /Source/Python/Capsule/GenerateCapsule.py index 35435946c664..f44bc42022cb 100644 --- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py +++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Generate a capsule.=0D #=0D # This tool generates a UEFI Capsule around an FMP Capsule. The capsule pa= yload=0D @@ -29,20 +29,21 @@ import shutil import platform=0D import json=0D from Common.Uefi.Capsule.UefiCapsuleHeader import UefiCapsuleHeaderClass=0D -from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass=0D -from Common.Uefi.Capsule.FmpAuthHeader import FmpAuthHeaderClass=0D +from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass=0D +from Common.Uefi.Capsule.FmpAuthHeader import FmpAuthHeaderClass=0D from Common.Uefi.Capsule.CapsuleDependency import CapsuleDependencyClass=0D -from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass=0D +from Common.Edk2.Capsule.FmpPayloadHeader import FmpPayloadHeaderClass=0D =0D #=0D # Globals for help information=0D #=0D -__prog__ =3D 'GenerateCapsule'=0D -__version__ =3D '0.10'=0D -__copyright__ =3D 'Copyright (c) 2022, Intel Corporation. All rights res= erved.'=0D +__prog__ =3D 'GenerateCapsule'=0D +__version__ =3D '0.10'=0D +__copyright__ =3D 'Copyright (c) 2022, Intel Corporation. All rights reser= ved.'=0D __description__ =3D 'Generate a capsule.\n'=0D =0D -def SignPayloadSignTool (Payload, ToolPath, PfxFile, SubjectName, Verbose = =3D False):=0D +=0D +def SignPayloadSignTool(Payload, ToolPath, PfxFile, SubjectName, Verbose= =3DFalse):=0D #=0D # Create a temporary directory=0D #=0D @@ -51,17 +52,18 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Su= bjectName, Verbose =3D Fals #=0D # Generate temp file name for the payload contents=0D #=0D - TempFileName =3D os.path.join (TempDirectoryName, 'Payload.bin')=0D + TempFileName =3D os.path.join(TempDirectoryName, 'Payload.bin')=0D =0D #=0D # Create temporary payload file for signing=0D #=0D try:=0D - with open (TempFileName, 'wb') as File:=0D - File.write (Payload)=0D + with open(TempFileName, 'wb') as File:=0D + File.write(Payload)=0D except:=0D - shutil.rmtree (TempDirectoryName)=0D - raise ValueError ('GenerateCapsule: error: can not write temporary= payload file.')=0D + shutil.rmtree(TempDirectoryName)=0D + raise ValueError(=0D + 'GenerateCapsule: error: can not write temporary payload file.= ')=0D =0D #=0D # Build signtool command=0D @@ -69,79 +71,89 @@ def SignPayloadSignTool (Payload, ToolPath, PfxFile, Su= bjectName, Verbose =3D Fals if ToolPath is None:=0D ToolPath =3D ''=0D Command =3D ''=0D - Command =3D Command + '"{Path}" '.format (Path =3D os.path.join (ToolP= ath, 'signtool.exe'))=0D + Command =3D Command + \=0D + '"{Path}" '.format(Path=3Dos.path.join(ToolPath, 'signtool.exe'))= =0D Command =3D Command + 'sign /fd sha256 /p7ce DetachedSignedData /p7co = 1.2.840.113549.1.7.2 '=0D - Command =3D Command + '/p7 {TempDir} '.format (TempDir =3D TempDirecto= ryName)=0D + Command =3D Command + '/p7 {TempDir} '.format(TempDir=3DTempDirectoryN= ame)=0D if PfxFile is not None:=0D - Command =3D Command + '/f {PfxFile} '.format (PfxFile =3D PfxFile)= =0D + Command =3D Command + '/f {PfxFile} '.format(PfxFile=3DPfxFile)=0D if SubjectName is not None:=0D - Command =3D Command + '/n {SubjectName} '.format (SubjectName =3D = SubjectName)=0D + Command =3D Command + '/n {SubjectName} '.format(SubjectName=3DSub= jectName)=0D Command =3D Command + TempFileName=0D if Verbose:=0D - print (Command)=0D + print(Command)=0D =0D #=0D # Sign the input file using the specified private key=0D #=0D try:=0D - Process =3D subprocess.Popen (Command, stdin =3D subprocess.PIPE, = stdout =3D subprocess.PIPE, stderr =3D subprocess.PIPE, shell =3D True)=0D + Process =3D subprocess.Popen(Command, stdin=3Dsubprocess.PIPE,=0D + stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D Result =3D Process.communicate('')=0D except:=0D - shutil.rmtree (TempDirectoryName)=0D - raise ValueError ('GenerateCapsule: error: can not run signtool.')= =0D + shutil.rmtree(TempDirectoryName)=0D + raise ValueError('GenerateCapsule: error: can not run signtool.')= =0D =0D if Process.returncode !=3D 0:=0D - shutil.rmtree (TempDirectoryName)=0D - print (Result[1].decode())=0D - raise ValueError ('GenerateCapsule: error: signtool failed.')=0D + shutil.rmtree(TempDirectoryName)=0D + print(Result[1].decode())=0D + raise ValueError('GenerateCapsule: error: signtool failed.')=0D =0D #=0D # Read the signature from the generated output file=0D #=0D try:=0D - with open (TempFileName + '.p7', 'rb') as File:=0D - Signature =3D File.read ()=0D + with open(TempFileName + '.p7', 'rb') as File:=0D + Signature =3D File.read()=0D except:=0D - shutil.rmtree (TempDirectoryName)=0D - raise ValueError ('GenerateCapsule: error: can not read signature = file.')=0D + shutil.rmtree(TempDirectoryName)=0D + raise ValueError(=0D + 'GenerateCapsule: error: can not read signature file.')=0D =0D - shutil.rmtree (TempDirectoryName)=0D + shutil.rmtree(TempDirectoryName)=0D return Signature=0D =0D -def VerifyPayloadSignTool (Payload, CertData, ToolPath, PfxFile, SubjectNa= me, Verbose =3D False):=0D - print ('signtool verify is not supported.')=0D - raise ValueError ('GenerateCapsule: error: signtool verify is not supp= orted.')=0D =0D -def SignPayloadOpenSsl (Payload, ToolPath, SignerPrivateCertFile, OtherPub= licCertFile, TrustedPublicCertFile, Verbose =3D False):=0D +def VerifyPayloadSignTool(Payload, CertData, ToolPath, PfxFile, SubjectNam= e, Verbose=3DFalse):=0D + print('signtool verify is not supported.')=0D + raise ValueError(=0D + 'GenerateCapsule: error: signtool verify is not supported.')=0D +=0D +=0D +def SignPayloadOpenSsl(Payload, ToolPath, SignerPrivateCertFile, OtherPubl= icCertFile, TrustedPublicCertFile, Verbose=3DFalse):=0D #=0D # Build openssl command=0D #=0D if ToolPath is None:=0D ToolPath =3D ''=0D Command =3D ''=0D - Command =3D Command + '"{Path}" '.format (Path =3D os.path.join (ToolP= ath, 'openssl'))=0D + Command =3D Command + \=0D + '"{Path}" '.format(Path=3Dos.path.join(ToolPath, 'openssl'))=0D Command =3D Command + 'smime -sign -binary -outform DER -md sha256 '=0D - Command =3D Command + '-signer "{Private}" -certfile "{Public}"'.forma= t (Private =3D SignerPrivateCertFile, Public =3D OtherPublicCertFile)=0D + Command =3D Command + '-signer "{Private}" -certfile "{Public}"'.forma= t(=0D + Private=3DSignerPrivateCertFile, Public=3DOtherPublicCertFile)=0D if Verbose:=0D - print (Command)=0D + print(Command)=0D =0D #=0D # Sign the input file using the specified private key and capture sign= ature from STDOUT=0D #=0D try:=0D - Process =3D subprocess.Popen (Command, stdin =3D subprocess.PIPE, = stdout =3D subprocess.PIPE, stderr =3D subprocess.PIPE, shell =3D True)=0D - Result =3D Process.communicate(input =3D Payload)=0D + Process =3D subprocess.Popen(Command, stdin=3Dsubprocess.PIPE,=0D + stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D + Result =3D Process.communicate(input=3DPayload)=0D Signature =3D Result[0]=0D except:=0D - raise ValueError ('GenerateCapsule: error: can not run openssl.')= =0D + raise ValueError('GenerateCapsule: error: can not run openssl.')=0D =0D if Process.returncode !=3D 0:=0D - print (Result[1].decode())=0D - raise ValueError ('GenerateCapsule: error: openssl failed.')=0D + print(Result[1].decode())=0D + raise ValueError('GenerateCapsule: error: openssl failed.')=0D =0D return Signature=0D =0D -def VerifyPayloadOpenSsl (Payload, CertData, ToolPath, SignerPrivateCertFi= le, OtherPublicCertFile, TrustedPublicCertFile, Verbose =3D False):=0D +=0D +def VerifyPayloadOpenSsl(Payload, CertData, ToolPath, SignerPrivateCertFil= e, OtherPublicCertFile, TrustedPublicCertFile, Verbose=3DFalse):=0D #=0D # Create a temporary directory=0D #=0D @@ -150,17 +162,18 @@ def VerifyPayloadOpenSsl (Payload, CertData, ToolPath= , SignerPrivateCertFile, Ot #=0D # Generate temp file name for the payload contents=0D #=0D - TempFileName =3D os.path.join (TempDirectoryName, 'Payload.bin')=0D + TempFileName =3D os.path.join(TempDirectoryName, 'Payload.bin')=0D =0D #=0D # Create temporary payload file for verification=0D #=0D try:=0D - with open (TempFileName, 'wb') as File:=0D - File.write (Payload)=0D + with open(TempFileName, 'wb') as File:=0D + File.write(Payload)=0D except:=0D - shutil.rmtree (TempDirectoryName)=0D - raise ValueError ('GenerateCapsule: error: can not write temporary= payload file.')=0D + shutil.rmtree(TempDirectoryName)=0D + raise ValueError(=0D + 'GenerateCapsule: error: can not write temporary payload file.= ')=0D =0D #=0D # Build openssl command=0D @@ -168,30 +181,34 @@ def VerifyPayloadOpenSsl (Payload, CertData, ToolPath= , SignerPrivateCertFile, Ot if ToolPath is None:=0D ToolPath =3D ''=0D Command =3D ''=0D - Command =3D Command + '"{Path}" '.format (Path =3D os.path.join (ToolP= ath, 'openssl'))=0D + Command =3D Command + \=0D + '"{Path}" '.format(Path=3Dos.path.join(ToolPath, 'openssl'))=0D Command =3D Command + 'smime -verify -inform DER '=0D - Command =3D Command + '-content {Content} -CAfile "{Public}"'.format (= Content =3D TempFileName, Public =3D TrustedPublicCertFile)=0D + Command =3D Command + '-content {Content} -CAfile "{Public}"'.format(= =0D + Content=3DTempFileName, Public=3DTrustedPublicCertFile)=0D if Verbose:=0D - print (Command)=0D + print(Command)=0D =0D #=0D # Verify signature=0D #=0D try:=0D - Process =3D subprocess.Popen (Command, stdin =3D subprocess.PIPE, = stdout =3D subprocess.PIPE, stderr =3D subprocess.PIPE, shell =3D True)=0D - Result =3D Process.communicate(input =3D CertData)=0D + Process =3D subprocess.Popen(Command, stdin=3Dsubprocess.PIPE,=0D + stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D + Result =3D Process.communicate(input=3DCertData)=0D except:=0D - shutil.rmtree (TempDirectoryName)=0D - raise ValueError ('GenerateCapsule: error: can not run openssl.')= =0D + shutil.rmtree(TempDirectoryName)=0D + raise ValueError('GenerateCapsule: error: can not run openssl.')=0D =0D if Process.returncode !=3D 0:=0D - shutil.rmtree (TempDirectoryName)=0D - print (Result[1].decode())=0D - raise ValueError ('GenerateCapsule: error: openssl failed.')=0D + shutil.rmtree(TempDirectoryName)=0D + print(Result[1].decode())=0D + raise ValueError('GenerateCapsule: error: openssl failed.')=0D =0D - shutil.rmtree (TempDirectoryName)=0D + shutil.rmtree(TempDirectoryName)=0D return Payload=0D =0D +=0D if __name__ =3D=3D '__main__':=0D def convert_arg_line_to_args(arg_line):=0D for arg in arg_line.split():=0D @@ -199,234 +216,286 @@ if __name__ =3D=3D '__main__': continue=0D yield arg=0D =0D - def ValidateUnsignedInteger (Argument):=0D + def ValidateUnsignedInteger(Argument):=0D try:=0D - Value =3D int (Argument, 0)=0D + Value =3D int(Argument, 0)=0D except:=0D - Message =3D '{Argument} is not a valid integer value.'.format = (Argument =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + Message =3D '{Argument} is not a valid integer value.'.format(= =0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D if Value < 0:=0D - Message =3D '{Argument} is a negative value.'.format (Argument= =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + Message =3D '{Argument} is a negative value.'.format(=0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D return Value=0D =0D - def ValidateRegistryFormatGuid (Argument):=0D + def ValidateRegistryFormatGuid(Argument):=0D try:=0D - Value =3D uuid.UUID (Argument)=0D + Value =3D uuid.UUID(Argument)=0D except:=0D - Message =3D '{Argument} is not a valid registry format GUID va= lue.'.format (Argument =3D Argument)=0D - raise argparse.ArgumentTypeError (Message)=0D + Message =3D '{Argument} is not a valid registry format GUID va= lue.'.format(=0D + Argument=3DArgument)=0D + raise argparse.ArgumentTypeError(Message)=0D return Value=0D =0D - def ConvertJsonValue (Config, FieldName, Convert, Required =3D True, D= efault =3D None, Open =3D False):=0D + def ConvertJsonValue(Config, FieldName, Convert, Required=3DTrue, Defa= ult=3DNone, Open=3DFalse):=0D if FieldName not in Config:=0D if Required:=0D - print ('GenerateCapsule: error: Payload descriptor invalid= syntax. Could not find {Key} in payload descriptor.'.format(Key =3D FieldN= ame))=0D - sys.exit (1)=0D + print('GenerateCapsule: error: Payload descriptor invalid = syntax. Could not find {Key} in payload descriptor.'.format(=0D + Key=3DFieldName))=0D + sys.exit(1)=0D return Default=0D try:=0D - Value =3D Convert (Config[FieldName])=0D + Value =3D Convert(Config[FieldName])=0D except:=0D - print ('GenerateCapsule: error: {Key} in payload descriptor ha= s invalid syntax.'.format (Key =3D FieldName))=0D - sys.exit (1)=0D + print('GenerateCapsule: error: {Key} in payload descriptor has= invalid syntax.'.format(=0D + Key=3DFieldName))=0D + sys.exit(1)=0D if Open:=0D try:=0D - Value =3D open (Value, "rb")=0D + Value =3D open(Value, "rb")=0D except:=0D - print ('GenerateCapsule: error: can not open file {File}'.= format (File =3D FieldName))=0D - sys.exit (1)=0D + print('GenerateCapsule: error: can not open file {File}'.f= ormat(=0D + File=3DFieldName))=0D + sys.exit(1)=0D return Value=0D =0D - def DecodeJsonFileParse (Json):=0D + def DecodeJsonFileParse(Json):=0D if 'Payloads' not in Json:=0D - print ('GenerateCapsule: error "Payloads" section not found in= JSON file {File}'.format (File =3D args.JsonFile.name))=0D - sys.exit (1)=0D + print('GenerateCapsule: error "Payloads" section not found in = JSON file {File}'.format(=0D + File=3Dargs.JsonFile.name))=0D + sys.exit(1)=0D for Config in Json['Payloads']:=0D #=0D # Parse fields from JSON=0D #=0D - PayloadFile =3D ConvertJsonValue (Config, 'Pa= yload', os.path.expandvars, Required =3D False)=0D - Guid =3D ConvertJsonValue (Config, 'Gu= id', ValidateRegistryFormatGuid, Required =3D False)=0D - FwVersion =3D ConvertJsonValue (Config, 'Fw= Version', ValidateUnsignedInteger, Required =3D False)=0D - LowestSupportedVersion =3D ConvertJsonValue (Config, 'Lo= westSupportedVersion', ValidateUnsignedInteger, Required =3D False)=0D - HardwareInstance =3D ConvertJsonValue (Config, 'Ha= rdwareInstance', ValidateUnsignedInteger, Required =3D False, Default =3D 0= )=0D - MonotonicCount =3D ConvertJsonValue (Config, 'Mo= notonicCount', ValidateUnsignedInteger, Required =3D False, Default =3D 0)= =0D - SignToolPfxFile =3D ConvertJsonValue (Config, 'Si= gnToolPfxFile', os.path.expandvars, Required =3D False, Default =3D None, O= pen =3D True)=0D - SignToolSubjectName =3D ConvertJsonValue (Config, 'Si= gnToolSubjectName', os.path.expandvars, Required =3D False, Default =3D Non= e, Open =3D True)=0D - OpenSslSignerPrivateCertFile =3D ConvertJsonValue (Config, 'Op= enSslSignerPrivateCertFile', os.path.expandvars, Required =3D False, Defaul= t =3D None, Open =3D True)=0D - OpenSslOtherPublicCertFile =3D ConvertJsonValue (Config, 'Op= enSslOtherPublicCertFile', os.path.expandvars, Required =3D False, Default = =3D None, Open =3D True)=0D - OpenSslTrustedPublicCertFile =3D ConvertJsonValue (Config, 'Op= enSslTrustedPublicCertFile', os.path.expandvars, Required =3D False, Defaul= t =3D None, Open =3D True)=0D - SigningToolPath =3D ConvertJsonValue (Config, 'Si= gningToolPath', os.path.expandvars, Required =3D False, Default =3D None)=0D - UpdateImageIndex =3D ConvertJsonValue (Config, 'Up= dateImageIndex', ValidateUnsignedInteger, Required =3D False, Default =3D 1= )=0D + PayloadFile =3D ConvertJsonValue(=0D + Config, 'Payload', os.path.expandvars, Required=3DFalse)=0D + Guid =3D ConvertJsonValue(=0D + Config, 'Guid', ValidateRegistryFormatGuid, Required=3DFal= se)=0D + FwVersion =3D ConvertJsonValue(=0D + Config, 'FwVersion', ValidateUnsignedInteger, Required=3DF= alse)=0D + LowestSupportedVersion =3D ConvertJsonValue(=0D + Config, 'LowestSupportedVersion', ValidateUnsignedInteger,= Required=3DFalse)=0D + HardwareInstance =3D ConvertJsonValue(=0D + Config, 'HardwareInstance', ValidateUnsignedInteger, Requi= red=3DFalse, Default=3D0)=0D + MonotonicCount =3D ConvertJsonValue(=0D + Config, 'MonotonicCount', ValidateUnsignedInteger, Require= d=3DFalse, Default=3D0)=0D + SignToolPfxFile =3D ConvertJsonValue(=0D + Config, 'SignToolPfxFile', os.path.expandvars, Required=3D= False, Default=3DNone, Open=3DTrue)=0D + SignToolSubjectName =3D ConvertJsonValue(=0D + Config, 'SignToolSubjectName', os.path.expandvars, Require= d=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslSignerPrivateCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars= , Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslOtherPublicCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, = Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslTrustedPublicCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars= , Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + SigningToolPath =3D ConvertJsonValue(=0D + Config, 'SigningToolPath', os.path.expandvars, Required=3D= False, Default=3DNone)=0D + UpdateImageIndex =3D ConvertJsonValue(=0D + Config, 'UpdateImageIndex', ValidateUnsignedInteger, Requi= red=3DFalse, Default=3D1)=0D =0D - PayloadDescriptorList.append (PayloadDescriptor (=0D - PayloadFile,=0D - Guid,=0D - FwVersion,=0D - LowestSupportedVersion,=0D - MonotonicCount,=0D - HardwareInstance,=0D - UpdateImageIndex,=0D - SignToolPfxFile,=0D - SignToolSubjectName,=0D - OpenSslSignerPrivateCertFile,= =0D - OpenSslOtherPublicCertFile,=0D - OpenSslTrustedPublicCertFile,= =0D - SigningToolPath=0D - ))=0D + PayloadDescriptorList.append(PayloadDescriptor(=0D + PayloadFile,=0D + Guid,=0D + FwVersion,=0D + LowestSupportedVersion,=0D + MonotonicCount,=0D + HardwareInstance,=0D + UpdateImageIndex,=0D + SignToolPfxFile,=0D + SignToolSubjectName,=0D + OpenSslSignerPrivateCertFile,=0D + OpenSslOtherPublicCertFile,=0D + OpenSslTrustedPublicCertFile,=0D + SigningToolPath=0D + ))=0D =0D - def EncodeJsonFileParse (Json):=0D + def EncodeJsonFileParse(Json):=0D if 'EmbeddedDrivers' not in Json:=0D - print ('GenerateCapsule: warning "EmbeddedDrivers" section not= found in JSON file {File}'.format (File =3D args.JsonFile.name))=0D + print('GenerateCapsule: warning "EmbeddedDrivers" section not = found in JSON file {File}'.format(=0D + File=3Dargs.JsonFile.name))=0D else:=0D for Config in Json['EmbeddedDrivers']:=0D - EmbeddedDriverFile =3D ConvertJsonValue(Config, 'Driv= er', os.path.expandvars, Open =3D True)=0D + EmbeddedDriverFile =3D ConvertJsonValue(=0D + Config, 'Driver', os.path.expandvars, Open=3DTrue)=0D #=0D - #Read EmbeddedDriver file=0D + # Read EmbeddedDriver file=0D #=0D try:=0D if args.Verbose:=0D - print ('Read EmbeddedDriver file {File}'.format (F= ile =3D EmbeddedDriverFile.name))=0D + print('Read EmbeddedDriver file {File}'.format(=0D + File=3DEmbeddedDriverFile.name))=0D Driver =3D EmbeddedDriverFile.read()=0D except:=0D - print ('GenerateCapsule: error: can not read EmbeddedD= river file {File}'.format (File =3D EmbeddedDriverFile.name))=0D - sys.exit (1)=0D - EmbeddedDriverDescriptorList.append (Driver)=0D + print('GenerateCapsule: error: can not read EmbeddedDr= iver file {File}'.format(=0D + File=3DEmbeddedDriverFile.name))=0D + sys.exit(1)=0D + EmbeddedDriverDescriptorList.append(Driver)=0D =0D if 'Payloads' not in Json:=0D - print ('GenerateCapsule: error: "Payloads" section not found i= n JSON file {File}'.format (File =3D args.JsonFile.name))=0D - sys.exit (1)=0D + print('GenerateCapsule: error: "Payloads" section not found in= JSON file {File}'.format(=0D + File=3Dargs.JsonFile.name))=0D + sys.exit(1)=0D for Config in Json['Payloads']:=0D #=0D # Parse fields from JSON=0D #=0D - PayloadFile =3D ConvertJsonValue (Config, 'Pa= yload', os.path.expandvars, Open =3D True)=0D - Guid =3D ConvertJsonValue (Config, 'Gu= id', ValidateRegistryFormatGuid)=0D - FwVersion =3D ConvertJsonValue (Config, 'Fw= Version', ValidateUnsignedInteger)=0D - LowestSupportedVersion =3D ConvertJsonValue (Config, 'Lo= westSupportedVersion', ValidateUnsignedInteger)=0D - HardwareInstance =3D ConvertJsonValue (Config, 'Ha= rdwareInstance', ValidateUnsignedInteger, Required =3D False, Default =3D 0= )=0D - UpdateImageIndex =3D ConvertJsonValue (Config, 'Up= dateImageIndex', ValidateUnsignedInteger, Required =3D False, Default =3D 1= )=0D - MonotonicCount =3D ConvertJsonValue (Config, 'Mo= notonicCount', ValidateUnsignedInteger, Required =3D False, Default =3D 0)= =0D - SignToolPfxFile =3D ConvertJsonValue (Config, 'Si= gnToolPfxFile', os.path.expandvars, Required =3D False, Default =3D None, O= pen =3D True)=0D - SignToolSubjectName =3D ConvertJsonValue (Config, 'Si= gnToolSubjectName', os.path.expandvars, Required =3D False, Default =3D Non= e, Open =3D True)=0D - OpenSslSignerPrivateCertFile =3D ConvertJsonValue (Config, 'Op= enSslSignerPrivateCertFile', os.path.expandvars, Required =3D False, Defaul= t =3D None, Open =3D True)=0D - OpenSslOtherPublicCertFile =3D ConvertJsonValue (Config, 'Op= enSslOtherPublicCertFile', os.path.expandvars, Required =3D False, Default = =3D None, Open =3D True)=0D - OpenSslTrustedPublicCertFile =3D ConvertJsonValue (Config, 'Op= enSslTrustedPublicCertFile', os.path.expandvars, Required =3D False, Defaul= t =3D None, Open =3D True)=0D - SigningToolPath =3D ConvertJsonValue (Config, 'Si= gningToolPath', os.path.expandvars, Required =3D False, Default =3D None)=0D - DepexExp =3D ConvertJsonValue (Config, 'De= pendencies', str, Required =3D False, Default =3D None)=0D + PayloadFile =3D ConvertJsonValue(=0D + Config, 'Payload', os.path.expandvars, Open=3DTrue)=0D + Guid =3D ConvertJsonValue(Config, 'Guid', ValidateRegistryForm= atGuid)=0D + FwVersion =3D ConvertJsonValue(=0D + Config, 'FwVersion', ValidateUnsignedInteger)=0D + LowestSupportedVersion =3D ConvertJsonValue(=0D + Config, 'LowestSupportedVersion', ValidateUnsignedInteger)= =0D + HardwareInstance =3D ConvertJsonValue(=0D + Config, 'HardwareInstance', ValidateUnsignedInteger, Requi= red=3DFalse, Default=3D0)=0D + UpdateImageIndex =3D ConvertJsonValue(=0D + Config, 'UpdateImageIndex', ValidateUnsignedInteger, Requi= red=3DFalse, Default=3D1)=0D + MonotonicCount =3D ConvertJsonValue(=0D + Config, 'MonotonicCount', ValidateUnsignedInteger, Require= d=3DFalse, Default=3D0)=0D + SignToolPfxFile =3D ConvertJsonValue(=0D + Config, 'SignToolPfxFile', os.path.expandvars, Required=3D= False, Default=3DNone, Open=3DTrue)=0D + SignToolSubjectName =3D ConvertJsonValue(=0D + Config, 'SignToolSubjectName', os.path.expandvars, Require= d=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslSignerPrivateCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslSignerPrivateCertFile', os.path.expandvars= , Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslOtherPublicCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslOtherPublicCertFile', os.path.expandvars, = Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + OpenSslTrustedPublicCertFile =3D ConvertJsonValue(=0D + Config, 'OpenSslTrustedPublicCertFile', os.path.expandvars= , Required=3DFalse, Default=3DNone, Open=3DTrue)=0D + SigningToolPath =3D ConvertJsonValue(=0D + Config, 'SigningToolPath', os.path.expandvars, Required=3D= False, Default=3DNone)=0D + DepexExp =3D ConvertJsonValue(=0D + Config, 'Dependencies', str, Required=3DFalse, Default=3DN= one)=0D =0D #=0D # Read binary input file=0D #=0D try:=0D if args.Verbose:=0D - print ('Read binary input file {File}'.format (File = =3D PayloadFile.name))=0D + print('Read binary input file {File}'.format(=0D + File=3DPayloadFile.name))=0D Payload =3D PayloadFile.read()=0D - PayloadFile.close ()=0D + PayloadFile.close()=0D except:=0D - print ('GenerateCapsule: error: can not read binary input = file {File}'.format (File =3D PayloadFile.name))=0D - sys.exit (1)=0D - PayloadDescriptorList.append (PayloadDescriptor (=0D - Payload,=0D - Guid,=0D - FwVersion,=0D - LowestSupportedVersion,=0D - MonotonicCount,=0D - HardwareInstance,=0D - UpdateImageIndex,=0D - SignToolPfxFile,=0D - SignToolSubjectName,=0D - OpenSslSignerPrivateCertFile,= =0D - OpenSslOtherPublicCertFile,=0D - OpenSslTrustedPublicCertFile,= =0D - SigningToolPath,=0D - DepexExp=0D - ))=0D + print('GenerateCapsule: error: can not read binary input f= ile {File}'.format(=0D + File=3DPayloadFile.name))=0D + sys.exit(1)=0D + PayloadDescriptorList.append(PayloadDescriptor(=0D + Payload,=0D + Guid,=0D + FwVersion,=0D + LowestSupportedVersion,=0D + MonotonicCount,=0D + HardwareInstance,=0D + UpdateImageIndex,=0D + SignToolPfxFile,=0D + SignToolSubjectName,=0D + OpenSslSignerPrivateCertFile,=0D + OpenSslOtherPublicCertFile,=0D + OpenSslTrustedPublicCertFile,=0D + SigningToolPath,=0D + DepexExp=0D + ))=0D =0D - def GenerateOutputJson (PayloadJsonDescriptorList):=0D + def GenerateOutputJson(PayloadJsonDescriptorList):=0D PayloadJson =3D {=0D - "Payloads" : [=0D - {=0D - "Guid": str(PayloadDescriptor.Guid).uppe= r(),=0D - "FwVersion": str(PayloadDescriptor.FwVer= sion),=0D - "LowestSupportedVersion": str(PayloadDes= criptor.LowestSupportedVersion),=0D - "MonotonicCount": str(PayloadDescriptor.= MonotonicCount),=0D - "Payload": PayloadDescriptor.Payload,=0D - "HardwareInstance": str(PayloadDescripto= r.HardwareInstance),=0D - "UpdateImageIndex": str(PayloadDescripto= r.UpdateImageIndex),=0D - "SignToolPfxFile": str(PayloadDescriptor= .SignToolPfxFile),=0D - "SignToolSubjectName": str(PayloadDescri= ptor.SignToolSubjectName),=0D - "OpenSslSignerPrivateCertFile": str(Payl= oadDescriptor.OpenSslSignerPrivateCertFile),=0D - "OpenSslOtherPublicCertFile": str(Payloa= dDescriptor.OpenSslOtherPublicCertFile),=0D - "OpenSslTrustedPublicCertFile": str(Payl= oadDescriptor.OpenSslTrustedPublicCertFile),=0D - "SigningToolPath": str(PayloadDescriptor= .SigningToolPath),=0D - "Dependencies" : str(PayloadDescriptor.D= epexExp)=0D - }for PayloadDescriptor in PayloadJsonDescrip= torList=0D - ]=0D - }=0D + "Payloads": [=0D + {=0D + "Guid": str(PayloadDescriptor.Guid).upper(),=0D + "FwVersion": str(PayloadDescriptor.FwVersion),=0D + "LowestSupportedVersion": str(PayloadDescriptor.Lowest= SupportedVersion),=0D + "MonotonicCount": str(PayloadDescriptor.MonotonicCount= ),=0D + "Payload": PayloadDescriptor.Payload,=0D + "HardwareInstance": str(PayloadDescriptor.HardwareInst= ance),=0D + "UpdateImageIndex": str(PayloadDescriptor.UpdateImageI= ndex),=0D + "SignToolPfxFile": str(PayloadDescriptor.SignToolPfxFi= le),=0D + "SignToolSubjectName": str(PayloadDescriptor.SignToolS= ubjectName),=0D + "OpenSslSignerPrivateCertFile": str(PayloadDescriptor.= OpenSslSignerPrivateCertFile),=0D + "OpenSslOtherPublicCertFile": str(PayloadDescriptor.Op= enSslOtherPublicCertFile),=0D + "OpenSslTrustedPublicCertFile": str(PayloadDescriptor.= OpenSslTrustedPublicCertFile),=0D + "SigningToolPath": str(PayloadDescriptor.SigningToolPa= th),=0D + "Dependencies": str(PayloadDescriptor.DepexExp)=0D + }for PayloadDescriptor in PayloadJsonDescriptorList=0D + ]=0D + }=0D OutputJsonFile =3D args.OutputFile.name + '.json'=0D if 'Payloads' in PayloadJson:=0D - PayloadSection =3D PayloadJson ['Payloads']=0D + PayloadSection =3D PayloadJson['Payloads']=0D Index =3D 0=0D for PayloadField in PayloadSection:=0D if PayloadJsonDescriptorList[Index].SignToolPfxFile is None:=0D - del PayloadField ['SignToolPfxFile']=0D + del PayloadField['SignToolPfxFile']=0D if PayloadJsonDescriptorList[Index].SignToolSubjectName is Non= e:=0D - del PayloadField ['SignToolSubjectName']=0D + del PayloadField['SignToolSubjectName']=0D if PayloadJsonDescriptorList[Index].OpenSslSignerPrivateCertFi= le is None:=0D - del PayloadField ['OpenSslSignerPrivateCertFile']=0D + del PayloadField['OpenSslSignerPrivateCertFile']=0D if PayloadJsonDescriptorList[Index].OpenSslOtherPublicCertFile= is None:=0D - del PayloadField ['OpenSslOtherPublicCertFile']=0D + del PayloadField['OpenSslOtherPublicCertFile']=0D if PayloadJsonDescriptorList[Index].OpenSslTrustedPublicCertFi= le is None:=0D - del PayloadField ['OpenSslTrustedPublicCertFile']=0D + del PayloadField['OpenSslTrustedPublicCertFile']=0D if PayloadJsonDescriptorList[Index].SigningToolPath is None:=0D - del PayloadField ['SigningToolPath']=0D + del PayloadField['SigningToolPath']=0D Index =3D Index + 1=0D - Result =3D json.dumps (PayloadJson, indent=3D4, sort_keys=3DTrue, = separators=3D(',', ': '))=0D - with open (OutputJsonFile, 'w') as OutputFile:=0D - OutputFile.write (Result)=0D + Result =3D json.dumps(PayloadJson, indent=3D4,=0D + sort_keys=3DTrue, separators=3D(',', ': '))=0D + with open(OutputJsonFile, 'w') as OutputFile:=0D + OutputFile.write(Result)=0D =0D - def CheckArgumentConflict (args):=0D + def CheckArgumentConflict(args):=0D if args.Encode:=0D if args.InputFile:=0D - print ('GenerateCapsule: error: Argument InputFile conflic= ts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument InputFile conflicts = with Argument -j')=0D + sys.exit(1)=0D if args.EmbeddedDriver:=0D - print ('GenerateCapsule: error: Argument --embedded-driver= conflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --embedded-driver co= nflicts with Argument -j')=0D + sys.exit(1)=0D if args.Guid:=0D - print ('GenerateCapsule: error: Argument --guid conflicts with= Argument -j')=0D - sys.exit (1)=0D + print('GenerateCapsule: error: Argument --guid conflicts with = Argument -j')=0D + sys.exit(1)=0D if args.FwVersion:=0D - print ('GenerateCapsule: error: Argument --fw-version conflict= s with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --fw-version conflicts w= ith Argument -j')=0D + sys.exit(1)=0D if args.LowestSupportedVersion:=0D - print ('GenerateCapsule: error: Argument --lsv conflicts with = Argument -j')=0D - sys.exit (1)=0D + print('GenerateCapsule: error: Argument --lsv conflicts with A= rgument -j')=0D + sys.exit(1)=0D if args.MonotonicCount:=0D - print ('GenerateCapsule: error: Argument --monotonic-count con= flicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --monotonic-count confli= cts with Argument -j')=0D + sys.exit(1)=0D if args.HardwareInstance:=0D - print ('GenerateCapsule: error: Argument --hardware-instance c= onflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --hardware-instance conf= licts with Argument -j')=0D + sys.exit(1)=0D if args.SignToolPfxFile:=0D - print ('GenerateCapsule: error: Argument --pfx-file conflicts = with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --pfx-file conflicts wit= h Argument -j')=0D + sys.exit(1)=0D if args.SignToolSubjectName:=0D - print ('GenerateCapsule: error: Argument --SubjectName conflic= ts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --SubjectName conflicts = with Argument -j')=0D + sys.exit(1)=0D if args.OpenSslSignerPrivateCertFile:=0D - print ('GenerateCapsule: error: Argument --signer-private-cert= conflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --signer-private-cert co= nflicts with Argument -j')=0D + sys.exit(1)=0D if args.OpenSslOtherPublicCertFile:=0D - print ('GenerateCapsule: error: Argument --other-public-cert c= onflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --other-public-cert conf= licts with Argument -j')=0D + sys.exit(1)=0D if args.OpenSslTrustedPublicCertFile:=0D - print ('GenerateCapsule: error: Argument --trusted-public-cert= conflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --trusted-public-cert co= nflicts with Argument -j')=0D + sys.exit(1)=0D if args.SigningToolPath:=0D - print ('GenerateCapsule: error: Argument --signing-tool-path c= onflicts with Argument -j')=0D - sys.exit (1)=0D + print(=0D + 'GenerateCapsule: error: Argument --signing-tool-path conf= licts with Argument -j')=0D + sys.exit(1)=0D =0D class PayloadDescriptor (object):=0D def __init__(self,=0D @@ -434,90 +503,108 @@ if __name__ =3D=3D '__main__': Guid,=0D FwVersion,=0D LowestSupportedVersion,=0D - MonotonicCount =3D 0,=0D - HardwareInstance =3D 0,=0D - UpdateImageIndex =3D 1,=0D - SignToolPfxFile =3D None,=0D - SignToolSubjectName =3D None,=0D - OpenSslSignerPrivateCertFile =3D None,=0D - OpenSslOtherPublicCertFile =3D None,=0D - OpenSslTrustedPublicCertFile =3D None,=0D - SigningToolPath =3D None,=0D - DepexExp =3D None=0D + MonotonicCount=3D0,=0D + HardwareInstance=3D0,=0D + UpdateImageIndex=3D1,=0D + SignToolPfxFile=3DNone,=0D + SignToolSubjectName=3DNone,=0D + OpenSslSignerPrivateCertFile=3DNone,=0D + OpenSslOtherPublicCertFile=3DNone,=0D + OpenSslTrustedPublicCertFile=3DNone,=0D + SigningToolPath=3DNone,=0D + DepexExp=3DNone=0D ):=0D - self.Payload =3D Payload=0D - self.Guid =3D Guid=0D - self.FwVersion =3D FwVersion=0D - self.LowestSupportedVersion =3D LowestSupportedVersion=0D - self.MonotonicCount =3D MonotonicCount=0D - self.HardwareInstance =3D HardwareInstance=0D - self.UpdateImageIndex =3D UpdateImageIndex=0D - self.SignToolPfxFile =3D SignToolPfxFile=0D - self.SignToolSubjectName =3D SignToolSubjectName=0D + self.Payload =3D Payload=0D + self.Guid =3D Guid=0D + self.FwVersion =3D FwVersion=0D + self.LowestSupportedVersion =3D LowestSupportedVersion=0D + self.MonotonicCount =3D MonotonicCount=0D + self.HardwareInstance =3D HardwareInstance=0D + self.UpdateImageIndex =3D UpdateImageIndex=0D + self.SignToolPfxFile =3D SignToolPfxFile=0D + self.SignToolSubjectName =3D SignToolSubjectName=0D self.OpenSslSignerPrivateCertFile =3D OpenSslSignerPrivateCert= File=0D - self.OpenSslOtherPublicCertFile =3D OpenSslOtherPublicCertFi= le=0D + self.OpenSslOtherPublicCertFile =3D OpenSslOtherPublicCertFile= =0D self.OpenSslTrustedPublicCertFile =3D OpenSslTrustedPublicCert= File=0D - self.SigningToolPath =3D SigningToolPath=0D - self.DepexExp =3D DepexExp=0D + self.SigningToolPath =3D SigningToolPath=0D + self.DepexExp =3D DepexExp=0D =0D self.UseSignTool =3D (self.SignToolPfxFile is not None or=0D self.SignToolSubjectName is not None)=0D - self.UseOpenSsl =3D (self.OpenSslSignerPrivateCertFile is not= None and=0D - self.OpenSslOtherPublicCertFile is not Non= e and=0D - self.OpenSslTrustedPublicCertFile is not N= one)=0D - self.AnyOpenSsl =3D (self.OpenSslSignerPrivateCertFile is not= None or=0D - self.OpenSslOtherPublicCertFile is not Non= e or=0D - self.OpenSslTrustedPublicCertFile is not N= one)=0D + self.UseOpenSsl =3D (self.OpenSslSignerPrivateCertFile is not = None and=0D + self.OpenSslOtherPublicCertFile is not None= and=0D + self.OpenSslTrustedPublicCertFile is not No= ne)=0D + self.AnyOpenSsl =3D (self.OpenSslSignerPrivateCertFile is not = None or=0D + self.OpenSslOtherPublicCertFile is not None= or=0D + self.OpenSslTrustedPublicCertFile is not No= ne)=0D self.UseDependency =3D self.DepexExp is not None=0D =0D def Validate(self, args):=0D if self.UseSignTool and self.AnyOpenSsl:=0D - raise argparse.ArgumentTypeError ('Providing both signtool= and OpenSSL options is not supported')=0D + raise argparse.ArgumentTypeError(=0D + 'Providing both signtool and OpenSSL options is not su= pported')=0D if not self.UseSignTool and not self.UseOpenSsl and self.AnyOp= enSsl:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('the following JSON = fields are required for OpenSSL: OpenSslSignerPrivateCertFile, OpenSslOther= PublicCertFile, OpenSslTrustedPublicCertFile')=0D + raise argparse.ArgumentTypeError(=0D + 'the following JSON fields are required for OpenSS= L: OpenSslSignerPrivateCertFile, OpenSslOtherPublicCertFile, OpenSslTrusted= PublicCertFile')=0D else:=0D - raise argparse.ArgumentTypeError ('the following optio= ns are required for OpenSSL: --signer-private-cert, --other-public-cert, --= trusted-public-cert')=0D + raise argparse.ArgumentTypeError(=0D + 'the following options are required for OpenSSL: -= -signer-private-cert, --other-public-cert, --trusted-public-cert')=0D if self.UseSignTool and platform.system() !=3D 'Windows':=0D - raise argparse.ArgumentTypeError ('Use of signtool is not = supported on this operating system.')=0D + raise argparse.ArgumentTypeError(=0D + 'Use of signtool is not supported on this operating sy= stem.')=0D if args.Encode:=0D if self.FwVersion is None or self.LowestSupportedVersion i= s None:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('the following J= SON fields are required: FwVersion, LowestSupportedVersion')=0D + raise argparse.ArgumentTypeError(=0D + 'the following JSON fields are required: FwVer= sion, LowestSupportedVersion')=0D else:=0D - raise argparse.ArgumentTypeError ('the following o= ptions are required: --fw-version, --lsv')=0D + raise argparse.ArgumentTypeError(=0D + 'the following options are required: --fw-vers= ion, --lsv')=0D if self.FwVersion > 0xFFFFFFFF:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('JSON field FwVe= rsion must be an integer in range 0x0..0xffffffff')=0D + raise argparse.ArgumentTypeError(=0D + 'JSON field FwVersion must be an integer in ra= nge 0x0..0xffffffff')=0D else:=0D - raise argparse.ArgumentTypeError ('--fw-version mu= st be an integer in range 0x0..0xffffffff')=0D + raise argparse.ArgumentTypeError(=0D + '--fw-version must be an integer in range 0x0.= .0xffffffff')=0D if self.LowestSupportedVersion > 0xFFFFFFFF:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('JSON field Lowe= stSupportedVersion must be an integer in range 0x0..0xffffffff')=0D + raise argparse.ArgumentTypeError(=0D + 'JSON field LowestSupportedVersion must be an = integer in range 0x0..0xffffffff')=0D else:=0D - raise argparse.ArgumentTypeError ('--lsv must be a= n integer in range 0x0..0xffffffff')=0D + raise argparse.ArgumentTypeError(=0D + '--lsv must be an integer in range 0x0..0xffff= ffff')=0D =0D if args.Encode:=0D if self.Guid is None:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('the following J= SON field is required: Guid')=0D + raise argparse.ArgumentTypeError(=0D + 'the following JSON field is required: Guid')= =0D else:=0D - raise argparse.ArgumentTypeError ('the following o= ption is required: --guid')=0D + raise argparse.ArgumentTypeError(=0D + 'the following option is required: --guid')=0D if self.HardwareInstance > 0xFFFFFFFFFFFFFFFF:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('JSON field Hard= wareInstance must be an integer in range 0x0..0xffffffffffffffff')=0D + raise argparse.ArgumentTypeError(=0D + 'JSON field HardwareInstance must be an intege= r in range 0x0..0xffffffffffffffff')=0D else:=0D - raise argparse.ArgumentTypeError ('--hardware-inst= ance must be an integer in range 0x0..0xffffffffffffffff')=0D + raise argparse.ArgumentTypeError(=0D + '--hardware-instance must be an integer in ran= ge 0x0..0xffffffffffffffff')=0D if self.MonotonicCount > 0xFFFFFFFFFFFFFFFF:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('JSON field Mono= tonicCount must be an integer in range 0x0..0xffffffffffffffff')=0D + raise argparse.ArgumentTypeError(=0D + 'JSON field MonotonicCount must be an integer = in range 0x0..0xffffffffffffffff')=0D else:=0D - raise argparse.ArgumentTypeError ('--monotonic-cou= nt must be an integer in range 0x0..0xffffffffffffffff')=0D - if self.UpdateImageIndex >0xFF:=0D + raise argparse.ArgumentTypeError(=0D + '--monotonic-count must be an integer in range= 0x0..0xffffffffffffffff')=0D + if self.UpdateImageIndex > 0xFF:=0D if args.JsonFile:=0D - raise argparse.ArgumentTypeError ('JSON field Upda= teImageIndex must be an integer in range 0x0..0xff')=0D + raise argparse.ArgumentTypeError(=0D + 'JSON field UpdateImageIndex must be an intege= r in range 0x0..0xff')=0D else:=0D - raise argparse.ArgumentTypeError ('--update-image-= index must be an integer in range 0x0..0xff')=0D + raise argparse.ArgumentTypeError(=0D + '--update-image-index must be an integer in ra= nge 0x0..0xff')=0D =0D if self.UseSignTool:=0D if self.SignToolPfxFile is not None:=0D @@ -528,7 +615,7 @@ if __name__ =3D=3D '__main__': self.OpenSslOtherPublicCertFile.close()=0D self.OpenSslTrustedPublicCertFile.close()=0D self.OpenSslSignerPrivateCertFile =3D self.OpenSslSignerPr= ivateCertFile.name=0D - self.OpenSslOtherPublicCertFile =3D self.OpenSslOtherPub= licCertFile.name=0D + self.OpenSslOtherPublicCertFile =3D self.OpenSslOtherPubli= cCertFile.name=0D self.OpenSslTrustedPublicCertFile =3D self.OpenSslTrustedP= ublicCertFile.name=0D =0D #=0D @@ -537,487 +624,534 @@ if __name__ =3D=3D '__main__': if args.Encode:=0D if 'PersistAcrossReset' not in args.CapsuleFlag:=0D if 'InitiateReset' in args.CapsuleFlag:=0D - raise argparse.ArgumentTypeError ('--capflag Initi= ateReset also requires --capflag PersistAcrossReset')=0D + raise argparse.ArgumentTypeError(=0D + '--capflag InitiateReset also requires --capfl= ag PersistAcrossReset')=0D if args.CapsuleOemFlag > 0xFFFF:=0D - raise argparse.ArgumentTypeError ('--capoemflag must b= e an integer between 0x0000 and 0xffff')=0D + raise argparse.ArgumentTypeError(=0D + '--capoemflag must be an integer between 0x0000 an= d 0xffff')=0D =0D return True=0D =0D -=0D - def Encode (PayloadDescriptorList, EmbeddedDriverDescriptorList, Buffe= r):=0D + def Encode(PayloadDescriptorList, EmbeddedDriverDescriptorList, Buffer= ):=0D if args.JsonFile:=0D CheckArgumentConflict(args)=0D try:=0D - Json =3D json.loads (args.JsonFile.read ())=0D + Json =3D json.loads(args.JsonFile.read())=0D except:=0D - print ('GenerateCapsule: error: {JSONFile} loads failure. = '.format (JSONFile =3D args.JsonFile))=0D - sys.exit (1)=0D + print('GenerateCapsule: error: {JSONFile} loads failure. '= .format(=0D + JSONFile=3Dargs.JsonFile))=0D + sys.exit(1)=0D EncodeJsonFileParse(Json)=0D else:=0D for Driver in args.EmbeddedDriver:=0D - EmbeddedDriverDescriptorList.append (Driver.read())=0D - PayloadDescriptorList.append (PayloadDescriptor (=0D - Buffer,=0D - args.Guid,=0D - args.FwVersion,=0D - args.LowestSupportedVersion,=0D - args.MonotonicCount,=0D - args.HardwareInstance,=0D - args.UpdateImageIndex,=0D - args.SignToolPfxFile,=0D - args.SignToolSubjectName,=0D - args.OpenSslSignerPrivateCertF= ile,=0D - args.OpenSslOtherPublicCertFil= e,=0D - args.OpenSslTrustedPublicCertF= ile,=0D - args.SigningToolPath,=0D - None=0D - ))=0D + EmbeddedDriverDescriptorList.append(Driver.read())=0D + PayloadDescriptorList.append(PayloadDescriptor(=0D + Buffer,=0D + args.Guid,=0D + args.FwVersion,=0D + args.LowestSupportedVersion,=0D + args.MonotonicCount,=0D + args.HardwareInstance,=0D + args.UpdateImageIndex,=0D + args.SignToolPfxFile,=0D + args.SignToolSubjectName,=0D + args.OpenSslSignerPrivateCertFile,=0D + args.OpenSslOtherPublicCertFile,=0D + args.OpenSslTrustedPublicCertFile,=0D + args.SigningToolPath,=0D + None=0D + ))=0D for SinglePayloadDescriptor in PayloadDescriptorList:=0D try:=0D - SinglePayloadDescriptor.Validate (args)=0D + SinglePayloadDescriptor.Validate(args)=0D except Exception as Msg:=0D - print ('GenerateCapsule: error:' + str(Msg))=0D - sys.exit (1)=0D + print('GenerateCapsule: error:' + str(Msg))=0D + sys.exit(1)=0D for SinglePayloadDescriptor in PayloadDescriptorList:=0D ImageCapsuleSupport =3D 0x0000000000000000=0D Result =3D SinglePayloadDescriptor.Payload=0D try:=0D - FmpPayloadHeader.FwVersion =3D SinglePayloadD= escriptor.FwVersion=0D + FmpPayloadHeader.FwVersion =3D SinglePayloadDescriptor.FwV= ersion=0D FmpPayloadHeader.LowestSupportedVersion =3D SinglePayloadD= escriptor.LowestSupportedVersion=0D - FmpPayloadHeader.Payload =3D SinglePayloadD= escriptor.Payload=0D - Result =3D FmpPayloadHeader.Encode ()=0D + FmpPayloadHeader.Payload =3D SinglePayloadDescriptor.Paylo= ad=0D + Result =3D FmpPayloadHeader.Encode()=0D if args.Verbose:=0D - FmpPayloadHeader.DumpInfo ()=0D + FmpPayloadHeader.DumpInfo()=0D except:=0D - print ('GenerateCapsule: error: can not encode FMP Payload= Header')=0D - sys.exit (1)=0D + print('GenerateCapsule: error: can not encode FMP Payload = Header')=0D + sys.exit(1)=0D if SinglePayloadDescriptor.UseDependency:=0D CapsuleDependency.Payload =3D Result=0D CapsuleDependency.DepexExp =3D SinglePayloadDescriptor.Dep= exExp=0D - ImageCapsuleSupport |=3D FmpCapsuleHeader.CAPSULE_S= UPPORT_DEPENDENCY=0D - Result =3D CapsuleDependency.Encode ()=0D + ImageCapsuleSupport |=3D FmpCapsuleHeader.CAPSULE_SUPPORT_= DEPENDENCY=0D + Result =3D CapsuleDependency.Encode()=0D if args.Verbose:=0D - CapsuleDependency.DumpInfo ()=0D + CapsuleDependency.DumpInfo()=0D if SinglePayloadDescriptor.UseOpenSsl or SinglePayloadDescript= or.UseSignTool:=0D #=0D # Sign image with 64-bit MonotonicCount appended to end of= image=0D #=0D try:=0D if SinglePayloadDescriptor.UseSignTool:=0D - CertData =3D SignPayloadSignTool (=0D - Result + struct.pack (' 0:=0D - Result =3D FmpCapsuleHeader.Decode (Result)=0D + Result =3D UefiCapsuleHeader.Decode(Buffer)=0D + if len(Result) > 0:=0D + Result =3D FmpCapsuleHeader.Decode(Result)=0D if args.JsonFile:=0D - if FmpCapsuleHeader.PayloadItemCount !=3D len (Payload= DescriptorList):=0D + if FmpCapsuleHeader.PayloadItemCount !=3D len(PayloadD= escriptorList):=0D CapsulePayloadNum =3D FmpCapsuleHeader.PayloadItem= Count=0D - JsonPayloadNum =3D len (PayloadDescriptorList)=0D - print ('GenerateCapsule: Decode error: {JsonPayloa= dNumber} payloads in JSON file {File} and {CapsulePayloadNumber} payloads i= n Capsule {CapsuleName}'.format (JsonPayloadNumber =3D JsonPayloadNum, File= =3D args.JsonFile.name, CapsulePayloadNumber =3D CapsulePayloadNum, Capsul= eName =3D args.InputFile.name))=0D - sys.exit (1)=0D - for Index in range (0, FmpCapsuleHeader.PayloadItemCou= nt):=0D - if Index < len (PayloadDescriptorList):=0D - GUID =3D FmpCapsuleHeader.GetFmpCapsuleImageHe= ader (Index).UpdateImageTypeId=0D - HardwareInstance =3D FmpCapsuleHeader.GetFmpCa= psuleImageHeader (Index).UpdateHardwareInstance=0D - UpdateImageIndex =3D FmpCapsuleHeader.GetFmpCa= psuleImageHeader (Index).UpdateImageIndex=0D + JsonPayloadNum =3D len(PayloadDescriptorList)=0D + print('GenerateCapsule: Decode error: {JsonPayload= Number} payloads in JSON file {File} and {CapsulePayloadNumber} payloads in= Capsule {CapsuleName}'.format(=0D + JsonPayloadNumber=3DJsonPayloadNum, File=3Darg= s.JsonFile.name, CapsulePayloadNumber=3DCapsulePayloadNum, CapsuleName=3Dar= gs.InputFile.name))=0D + sys.exit(1)=0D + for Index in range(0, FmpCapsuleHeader.PayloadItemCoun= t):=0D + if Index < len(PayloadDescriptorList):=0D + GUID =3D FmpCapsuleHeader.GetFmpCapsuleImageHe= ader(=0D + Index).UpdateImageTypeId=0D + HardwareInstance =3D FmpCapsuleHeader.GetFmpCa= psuleImageHeader(=0D + Index).UpdateHardwareInstance=0D + UpdateImageIndex =3D FmpCapsuleHeader.GetFmpCa= psuleImageHeader(=0D + Index).UpdateImageIndex=0D if PayloadDescriptorList[Index].Guid !=3D GUID= or PayloadDescriptorList[Index].HardwareInstance !=3D HardwareInstance:=0D - print ('GenerateCapsule: Decode error: Gui= d or HardwareInstance pair in input JSON file {File} does not match the pay= load {PayloadIndex} in Capsule {InputCapsule}'.format (File =3D args.JsonFi= le.name, PayloadIndex =3D Index + 1, InputCapsule =3D args.InputFile.name))= =0D - sys.exit (1)=0D - PayloadDescriptorList[Index].Payload =3D FmpCa= psuleHeader.GetFmpCapsuleImageHeader (Index).Payload=0D - DecodeJsonOutput =3D args.OutputFile.name + '.= Payload.{Index:d}.bin'.format (Index =3D Index + 1)=0D - PayloadJsonDescriptorList.append (PayloadDescr= iptor (=0D - DecodeJson= Output,=0D - GUID,=0D - None,=0D - None,=0D - None,=0D - HardwareIn= stance,=0D - UpdateImag= eIndex,=0D - PayloadDes= criptorList[Index].SignToolPfxFile,=0D - PayloadDes= criptorList[Index].SignToolSubjectName,=0D - PayloadDes= criptorList[Index].OpenSslSignerPrivateCertFile,=0D - PayloadDes= criptorList[Index].OpenSslOtherPublicCertFile,=0D - PayloadDes= criptorList[Index].OpenSslTrustedPublicCertFile,=0D - PayloadDes= criptorList[Index].SigningToolPath,=0D - None=0D - ))=0D + print('GenerateCapsule: Decode error: Guid= or HardwareInstance pair in input JSON file {File} does not match the payl= oad {PayloadIndex} in Capsule {InputCapsule}'.format(=0D + File=3Dargs.JsonFile.name, PayloadInde= x=3DIndex + 1, InputCapsule=3Dargs.InputFile.name))=0D + sys.exit(1)=0D + PayloadDescriptorList[Index].Payload =3D FmpCa= psuleHeader.GetFmpCapsuleImageHeader(=0D + Index).Payload=0D + DecodeJsonOutput =3D args.OutputFile.name + \= =0D + '.Payload.{Index:d}.bin'.format(=0D + Index=3DIndex + 1)=0D + PayloadJsonDescriptorList.append(PayloadDescri= ptor(=0D + DecodeJsonOutput,=0D + GUID,=0D + None,=0D + None,=0D + None,=0D + HardwareInstance,=0D + UpdateImageIndex,=0D + PayloadDescriptorList[Index].SignToolPfxFi= le,=0D + PayloadDescriptorList[Index].SignToolSubje= ctName,=0D + PayloadDescriptorList[Index].OpenSslSigner= PrivateCertFile,=0D + PayloadDescriptorList[Index].OpenSslOtherP= ublicCertFile,=0D + PayloadDescriptorList[Index].OpenSslTruste= dPublicCertFile,=0D + PayloadDescriptorList[Index].SigningToolPa= th,=0D + None=0D + ))=0D else:=0D - PayloadDescriptorList[0].Payload =3D FmpCapsuleHeader.= GetFmpCapsuleImageHeader (0).Payload=0D - for Index in range (0, FmpCapsuleHeader.PayloadItemCou= nt):=0D + PayloadDescriptorList[0].Payload =3D FmpCapsuleHeader.= GetFmpCapsuleImageHeader(=0D + 0).Payload=0D + for Index in range(0, FmpCapsuleHeader.PayloadItemCoun= t):=0D if Index > 0:=0D - PayloadDecodeFile =3D FmpCapsuleHeader.GetFmpC= apsuleImageHeader (Index).Payload=0D - PayloadDescriptorList.append (PayloadDescripto= r (PayloadDecodeFile,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None,=0D - None=0D - ))=0D - GUID =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader= (Index).UpdateImageTypeId=0D - HardwareInstance =3D FmpCapsuleHeader.GetFmpCapsul= eImageHeader (Index).UpdateHardwareInstance=0D - UpdateImageIndex =3D FmpCapsuleHeader.GetFmpCapsul= eImageHeader (Index).UpdateImageIndex=0D - DecodeJsonOutput =3D args.OutputFile.name + '.Payl= oad.{Index:d}.bin'.format (Index =3D Index + 1)=0D - PayloadJsonDescriptorList.append (PayloadDescripto= r (=0D - DecodeJsonOutp= ut,=0D - GUID,=0D - None,=0D - None,=0D - None,=0D - HardwareInstan= ce,=0D - UpdateImageInd= ex,=0D - PayloadDescrip= torList[Index].SignToolPfxFile,=0D - PayloadDescrip= torList[Index].SignToolSubjectName,=0D - PayloadDescrip= torList[Index].OpenSslSignerPrivateCertFile,=0D - PayloadDescrip= torList[Index].OpenSslOtherPublicCertFile,=0D - PayloadDescrip= torList[Index].OpenSslTrustedPublicCertFile,=0D - PayloadDescrip= torList[Index].SigningToolPath,=0D - None=0D - ))=0D + PayloadDecodeFile =3D FmpCapsuleHeader.GetFmpC= apsuleImageHeader(=0D + Index).Payload=0D + PayloadDescriptorList.append(PayloadDescriptor= (PayloadDecodeFile,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None,=0D + = None=0D + = ))=0D + GUID =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader= (=0D + Index).UpdateImageTypeId=0D + HardwareInstance =3D FmpCapsuleHeader.GetFmpCapsul= eImageHeader(=0D + Index).UpdateHardwareInstance=0D + UpdateImageIndex =3D FmpCapsuleHeader.GetFmpCapsul= eImageHeader(=0D + Index).UpdateImageIndex=0D + DecodeJsonOutput =3D args.OutputFile.name + \=0D + '.Payload.{Index:d}.bin'.format(Index=3DIndex = + 1)=0D + PayloadJsonDescriptorList.append(PayloadDescriptor= (=0D + DecodeJsonOutput,=0D + GUID,=0D + None,=0D + None,=0D + None,=0D + HardwareInstance,=0D + UpdateImageIndex,=0D + PayloadDescriptorList[Index].SignToolPfxFile,= =0D + PayloadDescriptorList[Index].SignToolSubjectNa= me,=0D + PayloadDescriptorList[Index].OpenSslSignerPriv= ateCertFile,=0D + PayloadDescriptorList[Index].OpenSslOtherPubli= cCertFile,=0D + PayloadDescriptorList[Index].OpenSslTrustedPub= licCertFile,=0D + PayloadDescriptorList[Index].SigningToolPath,= =0D + None=0D + ))=0D JsonIndex =3D 0=0D for SinglePayloadDescriptor in PayloadDescriptorList:=0D if args.Verbose:=0D - print ('=3D=3D=3D=3D=3D=3D=3D=3D')=0D - UefiCapsuleHeader.DumpInfo ()=0D - print ('--------')=0D - FmpCapsuleHeader.DumpInfo ()=0D + print('=3D=3D=3D=3D=3D=3D=3D=3D')=0D + UefiCapsuleHeader.DumpInfo()=0D + print('--------')=0D + FmpCapsuleHeader.DumpInfo()=0D if FmpAuthHeader.IsSigned(SinglePayloadDescriptor.Payl= oad):=0D if not SinglePayloadDescriptor.UseOpenSsl and not = SinglePayloadDescriptor.UseSignTool:=0D - print ('GenerateCapsule: decode warning: can n= ot verify singed payload without cert or pfx file. Index =3D {Index}'.forma= t (Index =3D JsonIndex + 1))=0D - SinglePayloadDescriptor.Payload =3D FmpAuthHeader.= Decode (SinglePayloadDescriptor.Payload)=0D + print('GenerateCapsule: decode warning: can no= t verify singed payload without cert or pfx file. Index =3D {Index}'.format= (=0D + Index=3DJsonIndex + 1))=0D + SinglePayloadDescriptor.Payload =3D FmpAuthHeader.= Decode(=0D + SinglePayloadDescriptor.Payload)=0D PayloadJsonDescriptorList[JsonIndex].MonotonicCoun= t =3D FmpAuthHeader.MonotonicCount=0D if args.Verbose:=0D - print ('--------')=0D - FmpAuthHeader.DumpInfo ()=0D + print('--------')=0D + FmpAuthHeader.DumpInfo()=0D =0D #=0D # Verify Image with 64-bit MonotonicCount appended= to end of image=0D #=0D try:=0D - if SinglePayloadDescriptor.UseSignTool:=0D - CertData =3D VerifyPayloadSignTool (=0D - FmpAuthHeader.Payload + struct.= pack (' 0:=0D - FmpCapsuleHeader.Decode (Result)=0D - print ('--------')=0D - FmpCapsuleHeader.DumpInfo ()=0D - for Index in range (0, FmpCapsuleHeader.PayloadItemCount):= =0D - Result =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader (= Index).Payload=0D + Result =3D UefiCapsuleHeader.Decode(Buffer)=0D + print('=3D=3D=3D=3D=3D=3D=3D=3D')=0D + UefiCapsuleHeader.DumpInfo()=0D + if len(Result) > 0:=0D + FmpCapsuleHeader.Decode(Result)=0D + print('--------')=0D + FmpCapsuleHeader.DumpInfo()=0D + for Index in range(0, FmpCapsuleHeader.PayloadItemCount):= =0D + Result =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader(= =0D + Index).Payload=0D try:=0D - Result =3D FmpAuthHeader.Decode (Result)=0D - print ('--------')=0D - FmpAuthHeader.DumpInfo ()=0D + Result =3D FmpAuthHeader.Decode(Result)=0D + print('--------')=0D + FmpAuthHeader.DumpInfo()=0D except:=0D - print ('--------')=0D - print ('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')=0D + print('--------')=0D + print('No EFI_FIRMWARE_IMAGE_AUTHENTICATION')=0D =0D - PayloadSignature =3D struct.unpack ('=0D @@ -21,30 +21,33 @@ import platform import re=0D import logging=0D from WindowsCapsuleSupportHelper import WindowsCapsuleSupportHelper=0D -from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass=0D +from Common.Uefi.Capsule.FmpCapsuleHeader import FmpCapsuleHeaderClass=0D from Common.Uefi.Capsule.UefiCapsuleHeader import UefiCapsuleHeaderClass=0D =0D #=0D # Globals for help information=0D #=0D -__prog__ =3D 'GenerateWindowsDriver'=0D -__version__ =3D '0.0'=0D -__copyright__ =3D 'Copyright (c) 2019, Intel Corporation. All rights res= erved.'=0D +__prog__ =3D 'GenerateWindowsDriver'=0D +__version__ =3D '0.0'=0D +__copyright__ =3D 'Copyright (c) 2019, Intel Corporation. All rights reser= ved.'=0D __description__ =3D 'Generate Capsule Windows Driver.\n'=0D =0D -def GetCapGuid (InputFile):=0D +=0D +def GetCapGuid(InputFile):=0D with open(InputFile, 'rb') as File:=0D Buffer =3D File.read()=0D try:=0D - Result =3D UefiCapsuleHeader.Decode (Buffer)=0D - if len (Result) > 0:=0D - FmpCapsuleHeader.Decode (Result)=0D - for index in range (0, FmpCapsuleHeader.PayloadItemCount):=0D - Guid =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader (index)= .UpdateImageTypeId=0D + Result =3D UefiCapsuleHeader.Decode(Buffer)=0D + if len(Result) > 0:=0D + FmpCapsuleHeader.Decode(Result)=0D + for index in range(0, FmpCapsuleHeader.PayloadItemCount):=0D + Guid =3D FmpCapsuleHeader.GetFmpCapsuleImageHeader(=0D + index).UpdateImageTypeId=0D return Guid=0D except:=0D - print ('GenerateCapsule: error: can not decode capsule')=0D - sys.exit (1)=0D + print('GenerateCapsule: error: can not decode capsule')=0D + sys.exit(1)=0D +=0D =0D def ArgCheck(args):=0D Version =3D args.CapsuleVersion_DotString.split('.')=0D @@ -53,20 +56,23 @@ def ArgCheck(args): logging.critical("Name invalid: '%s'", args.CapsuleVersion_DotStri= ng)=0D raise ValueError("Name invalid.")=0D for sub in Version:=0D - if int(sub, 16) > 65536:=0D - logging.critical("Name invalid: '%s'", args.CapsuleVersion_Dot= String)=0D + if int(sub, 16) > 65536:=0D + logging.critical("Name invalid: '%s'",=0D + args.CapsuleVersion_DotString)=0D raise ValueError("Name exceed limit 65536.")=0D =0D if not (re.compile(r'[\a-fA-F0-9]*$')).match(args.CapsuleVersion_DotSt= ring):=0D logging.critical("Name invalid: '%s'", args.CapsuleVersion_DotStri= ng)=0D raise ValueError("Name has invalid chars.")=0D =0D +=0D def CapsuleGuidCheck(InputFile, Guid):=0D CapGuid =3D GetCapGuid(InputFile)=0D if (str(Guid).lower() !=3D str(CapGuid)):=0D print('GenerateWindowsDriver error: Different Guid from Capsule')= =0D sys.exit(1)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D def convert_arg_line_to_args(arg_line):=0D for arg in arg_line.split():=0D @@ -74,47 +80,58 @@ if __name__ =3D=3D '__main__': continue=0D yield arg=0D =0D - parser =3D argparse.ArgumentParser (=0D - prog =3D __prog__,=0D - description =3D __description__ + __copyright__,=0D - conflict_handler =3D 'resolve',=0D - fromfile_prefix_chars =3D '@'=0D - )=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__,=0D + description=3D__description__ + __copyright__,=0D + conflict_handler=3D'resolve',=0D + fromfile_prefix_chars=3D'@'=0D + )=0D parser.convert_arg_line_to_args =3D convert_arg_line_to_args=0D - parser.add_argument("--output-folder", dest =3D 'OutputFolder', help = =3D "firmware resource update driver package output folder.")=0D - parser.add_argument("--product-fmp-guid", dest =3D 'ProductFmpGuid', h= elp =3D "firmware GUID of resource update driver package")=0D - parser.add_argument("--capsuleversion-dotstring", dest =3D 'CapsuleVer= sion_DotString', help =3D "firmware version with date on which update drive= r package is authored")=0D - parser.add_argument("--capsuleversion-hexstring", dest =3D 'CapsuleVer= sion_HexString', help =3D "firmware version in Hex of update driver package= ")=0D - parser.add_argument("--product-fw-provider", dest =3D 'ProductFwProvid= er', help =3D "vendor/provider of entire firmware resource update driver pa= ckage")=0D - parser.add_argument("--product-fw-mfg-name", dest =3D 'ProductFwMfgNam= e', help =3D "manufacturer/vendor of firmware resource update driver packag= e")=0D - parser.add_argument("--product-fw-desc", dest =3D "ProductFwDesc", hel= p =3D "description about resource update driver")=0D - parser.add_argument("--capsule-file-name", dest =3D 'CapsuleFileName',= help =3D"firmware resource image file")=0D - parser.add_argument("--pfx-file", dest =3D 'PfxFile', help =3D "pfx fi= le path used to sign resource update driver")=0D - parser.add_argument("--arch", dest =3D 'Arch', help =3D "supported arc= hitecture:arm/x64/amd64/arm64/aarch64", default =3D 'amd64')=0D - parser.add_argument("--operating-system-string", dest =3D 'OperatingSy= stemString', help =3D "supported operating system:win10/10/10_au/10_rs2/10_= rs3/10_rs4/server10/server2016/serverrs2/serverrs3/serverrs4", default =3D = "win10")=0D + parser.add_argument("--output-folder", dest=3D'OutputFolder',=0D + help=3D"firmware resource update driver package ou= tput folder.")=0D + parser.add_argument("--product-fmp-guid", dest=3D'ProductFmpGuid',=0D + help=3D"firmware GUID of resource update driver pa= ckage")=0D + parser.add_argument("--capsuleversion-dotstring", dest=3D'CapsuleVersi= on_DotString',=0D + help=3D"firmware version with date on which update= driver package is authored")=0D + parser.add_argument("--capsuleversion-hexstring", dest=3D'CapsuleVersi= on_HexString',=0D + help=3D"firmware version in Hex of update driver p= ackage")=0D + parser.add_argument("--product-fw-provider", dest=3D'ProductFwProvider= ',=0D + help=3D"vendor/provider of entire firmware resourc= e update driver package")=0D + parser.add_argument("--product-fw-mfg-name", dest=3D'ProductFwMfgName'= ,=0D + help=3D"manufacturer/vendor of firmware resource u= pdate driver package")=0D + parser.add_argument("--product-fw-desc", dest=3D"ProductFwDesc",=0D + help=3D"description about resource update driver")= =0D + parser.add_argument("--capsule-file-name", dest=3D'CapsuleFileName',=0D + help=3D"firmware resource image file")=0D + parser.add_argument("--pfx-file", dest=3D'PfxFile',=0D + help=3D"pfx file path used to sign resource update= driver")=0D + parser.add_argument("--arch", dest=3D'Arch',=0D + help=3D"supported architecture:arm/x64/amd64/arm64= /aarch64", default=3D'amd64')=0D + parser.add_argument("--operating-system-string", dest=3D'OperatingSyst= emString',=0D + help=3D"supported operating system:win10/10/10_au/= 10_rs2/10_rs3/10_rs4/server10/server2016/serverrs2/serverrs3/serverrs4", de= fault=3D"win10")=0D =0D args =3D parser.parse_args()=0D InputFile =3D os.path.join(args.OutputFolder, '') + args.CapsuleFileNa= me=0D - UefiCapsuleHeader =3D UefiCapsuleHeaderClass ()=0D - FmpCapsuleHeader =3D FmpCapsuleHeaderClass ()=0D + UefiCapsuleHeader =3D UefiCapsuleHeaderClass()=0D + FmpCapsuleHeader =3D FmpCapsuleHeaderClass()=0D CapsuleGuidCheck(InputFile, args.ProductFmpGuid)=0D ArgCheck(args)=0D ProductName =3D os.path.splitext(args.CapsuleFileName)[0]=0D - WindowsDriver =3D WindowsCapsuleSupportHelper ()=0D + WindowsDriver =3D WindowsCapsuleSupportHelper()=0D =0D - WindowsDriver.PackageWindowsCapsuleFiles (=0D - args.OutputFolder,=0D - ProductName,=0D - args.ProductFmpGuid,=0D - args.CapsuleVersion_Dot= String,=0D - args.CapsuleVersion_Hex= String,=0D - args.ProductFwProvider,= =0D - args.ProductFwMfgName,= =0D - args.ProductFwDesc,=0D - args.CapsuleFileName,=0D - args.PfxFile,=0D - None,=0D - None,=0D - args.Arch,=0D - args.OperatingSystemStr= ing=0D - )=0D + WindowsDriver.PackageWindowsCapsuleFiles(=0D + args.OutputFolder,=0D + ProductName,=0D + args.ProductFmpGuid,=0D + args.CapsuleVersion_DotString,=0D + args.CapsuleVersion_HexString,=0D + args.ProductFwProvider,=0D + args.ProductFwMfgName,=0D + args.ProductFwDesc,=0D + args.CapsuleFileName,=0D + args.PfxFile,=0D + None,=0D + None,=0D + args.Arch,=0D + args.OperatingSystemString=0D + )=0D diff --git a/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py= b/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py index a29ac21ae890..d6b0aa04832c 100644 --- a/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py +++ b/BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py @@ -21,44 +21,49 @@ from edk2toollib.windows.capsule.inf_generator import I= nfGenerator from edk2toollib.utility_functions import CatalogSignWithSignTool=0D from edk2toollib.windows.locate_tools import FindToolInWinSdk=0D =0D +=0D class WindowsCapsuleSupportHelper(object):=0D =0D - def RegisterHelpers(self, obj):=0D - fp =3D os.path.abspath(__file__)=0D - obj.Register("PackageWindowsCapsuleFiles", WindowsCapsuleSupportHelp= er.PackageWindowsCapsuleFiles, fp)=0D -=0D -=0D - @staticmethod=0D - def PackageWindowsCapsuleFiles(OutputFolder, ProductName, ProductFmpGuid= , CapsuleVersion_DotString,=0D - CapsuleVersion_HexString, ProductFwProvider, ProductFwMfgName, Product= FwDesc, CapsuleFileName, PfxFile=3DNone, PfxPass=3DNone,=0D - Rollback=3DFalse, Arch=3D'amd64', OperatingSystem_String=3D'Win10'):=0D -=0D - logging.debug("CapsulePackage: Create Windows Capsule Files")=0D -=0D - #Make INF=0D - InfFilePath =3D os.path.join(OutputFolder, ProductName + ".inf")=0D - InfTool =3D InfGenerator(ProductName, ProductFwProvider, ProductFmpG= uid, Arch, ProductFwDesc, CapsuleVersion_DotString, CapsuleVersion_HexStrin= g)=0D - InfTool.Manufacturer =3D ProductFwMfgName #optional=0D - ret =3D InfTool.MakeInf(InfFilePath, CapsuleFileName, Rollback)=0D - if(ret !=3D 0):=0D - raise Exception("CreateWindowsInf Failed with errorcode %d" % re= t)=0D -=0D - #Make CAT=0D - CatFilePath =3D os.path.realpath(os.path.join(OutputFolder, ProductN= ame + ".cat"))=0D - CatTool =3D CatGenerator(Arch, OperatingSystem_String)=0D - ret =3D CatTool.MakeCat(CatFilePath)=0D -=0D - if(ret !=3D 0):=0D - raise Exception("Creating Cat file Failed with errorcode %d" % r= et)=0D -=0D - if(PfxFile is not None):=0D - #Find Signtool=0D - SignToolPath =3D FindToolInWinSdk("signtool.exe")=0D - if not os.path.exists(SignToolPath):=0D - raise Exception("Can't find signtool on this machine.")=0D - #dev sign the cat file=0D - ret =3D CatalogSignWithSignTool(SignToolPath, CatFilePath, PfxFi= le, PfxPass)=0D - if(ret !=3D 0):=0D - raise Exception("Signing Cat file Failed with errorcode %d" = % ret)=0D -=0D - return ret=0D + def RegisterHelpers(self, obj):=0D + fp =3D os.path.abspath(__file__)=0D + obj.Register("PackageWindowsCapsuleFiles",=0D + WindowsCapsuleSupportHelper.PackageWindowsCapsuleFile= s, fp)=0D +=0D + @staticmethod=0D + def PackageWindowsCapsuleFiles(OutputFolder, ProductName, ProductFmpGu= id, CapsuleVersion_DotString,=0D + CapsuleVersion_HexString, ProductFwProv= ider, ProductFwMfgName, ProductFwDesc, CapsuleFileName, PfxFile=3DNone, Pfx= Pass=3DNone,=0D + Rollback=3DFalse, Arch=3D'amd64', Opera= tingSystem_String=3D'Win10'):=0D +=0D + logging.debug("CapsulePackage: Create Windows Capsule Files")=0D +=0D + # Make INF=0D + InfFilePath =3D os.path.join(OutputFolder, ProductName + ".inf")=0D + InfTool =3D InfGenerator(ProductName, ProductFwProvider, ProductFm= pGuid,=0D + Arch, ProductFwDesc, CapsuleVersion_DotStri= ng, CapsuleVersion_HexString)=0D + InfTool.Manufacturer =3D ProductFwMfgName # optional=0D + ret =3D InfTool.MakeInf(InfFilePath, CapsuleFileName, Rollback)=0D + if(ret !=3D 0):=0D + raise Exception("CreateWindowsInf Failed with errorcode %d" % = ret)=0D +=0D + # Make CAT=0D + CatFilePath =3D os.path.realpath(=0D + os.path.join(OutputFolder, ProductName + ".cat"))=0D + CatTool =3D CatGenerator(Arch, OperatingSystem_String)=0D + ret =3D CatTool.MakeCat(CatFilePath)=0D +=0D + if(ret !=3D 0):=0D + raise Exception("Creating Cat file Failed with errorcode %d" %= ret)=0D +=0D + if(PfxFile is not None):=0D + # Find Signtool=0D + SignToolPath =3D FindToolInWinSdk("signtool.exe")=0D + if not os.path.exists(SignToolPath):=0D + raise Exception("Can't find signtool on this machine.")=0D + # dev sign the cat file=0D + ret =3D CatalogSignWithSignTool(=0D + SignToolPath, CatFilePath, PfxFile, PfxPass)=0D + if(ret !=3D 0):=0D + raise Exception(=0D + "Signing Cat file Failed with errorcode %d" % ret)=0D +=0D + return ret=0D diff --git a/BaseTools/Source/Python/Common/BuildToolError.py b/BaseTools/S= ource/Python/Common/BuildToolError.py index 21549683cd19..2efd364fc4b3 100644 --- a/BaseTools/Source/Python/Common/BuildToolError.py +++ b/BaseTools/Source/Python/Common/BuildToolError.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Standardized Error Handling infrastructures.=0D #=0D # Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
        =0D @@ -34,7 +34,7 @@ OPTION_UNKNOWN_ERROR =3D 0x1FFF =0D PARAMETER_INVALID =3D 0x2000=0D PARAMETER_MISSING =3D 0x2001=0D -PARAMETER_UNKNOWN_ERROR =3D0x2FFF=0D +PARAMETER_UNKNOWN_ERROR =3D 0x2FFF=0D =0D FORMAT_INVALID =3D 0x3000=0D FORMAT_NOT_SUPPORTED =3D 0x3001=0D @@ -89,72 +89,75 @@ ERROR_STATEMENT =3D 0xFFFD ABORT_ERROR =3D 0xFFFE=0D UNKNOWN_ERROR =3D 0xFFFF=0D =0D -## Error message of each error code=0D +# Error message of each error code=0D gErrorMessage =3D {=0D - FILE_NOT_FOUND : "File/directory not found in workspace",=0D - FILE_OPEN_FAILURE : "File open failure",=0D - FILE_WRITE_FAILURE : "File write failure",=0D - FILE_PARSE_FAILURE : "File parse failure",=0D - FILE_READ_FAILURE : "File read failure",=0D - FILE_CREATE_FAILURE : "File create failure",=0D - FILE_CHECKSUM_FAILURE : "Invalid checksum of file",=0D - FILE_COMPRESS_FAILURE : "File compress failure",=0D - FILE_DECOMPRESS_FAILURE : "File decompress failure",=0D - FILE_MOVE_FAILURE : "File move failure",=0D - FILE_DELETE_FAILURE : "File delete failure",=0D - FILE_COPY_FAILURE : "File copy failure",=0D + FILE_NOT_FOUND: "File/directory not found in workspace",=0D + FILE_OPEN_FAILURE: "File open failure",=0D + FILE_WRITE_FAILURE: "File write failure",=0D + FILE_PARSE_FAILURE: "File parse failure",=0D + FILE_READ_FAILURE: "File read failure",=0D + FILE_CREATE_FAILURE: "File create failure",=0D + FILE_CHECKSUM_FAILURE: "Invalid checksum of file",=0D + FILE_COMPRESS_FAILURE: "File compress failure",=0D + FILE_DECOMPRESS_FAILURE: "File decompress failure",=0D + FILE_MOVE_FAILURE: "File move failure",=0D + FILE_DELETE_FAILURE: "File delete failure",=0D + FILE_COPY_FAILURE: "File copy failure",=0D FILE_POSITIONING_FAILURE: "Failed to seeking position",=0D - FILE_ALREADY_EXIST : "File or directory already exists",=0D - FILE_TYPE_MISMATCH : "Incorrect file type",=0D - FILE_CASE_MISMATCH : "File name case mismatch",=0D - FILE_DUPLICATED : "Duplicated file found",=0D - FILE_UNKNOWN_ERROR : "Unknown error encountered on file",=0D + FILE_ALREADY_EXIST: "File or directory already exists",=0D + FILE_TYPE_MISMATCH: "Incorrect file type",=0D + FILE_CASE_MISMATCH: "File name case mismatch",=0D + FILE_DUPLICATED: "Duplicated file found",=0D + FILE_UNKNOWN_ERROR: "Unknown error encountered on file",=0D =0D - OPTION_UNKNOWN : "Unknown option",=0D - OPTION_MISSING : "Missing option",=0D - OPTION_CONFLICT : "Conflict options",=0D - OPTION_VALUE_INVALID : "Invalid value of option",=0D - OPTION_DEPRECATED : "Deprecated option",=0D - OPTION_NOT_SUPPORTED : "Unsupported option",=0D - OPTION_UNKNOWN_ERROR : "Unknown error when processing options",=0D + OPTION_UNKNOWN: "Unknown option",=0D + OPTION_MISSING: "Missing option",=0D + OPTION_CONFLICT: "Conflict options",=0D + OPTION_VALUE_INVALID: "Invalid value of option",=0D + OPTION_DEPRECATED: "Deprecated option",=0D + OPTION_NOT_SUPPORTED: "Unsupported option",=0D + OPTION_UNKNOWN_ERROR: "Unknown error when processing options",=0D =0D - PARAMETER_INVALID : "Invalid parameter",=0D - PARAMETER_MISSING : "Missing parameter",=0D - PARAMETER_UNKNOWN_ERROR : "Unknown error in parameters",=0D + PARAMETER_INVALID: "Invalid parameter",=0D + PARAMETER_MISSING: "Missing parameter",=0D + PARAMETER_UNKNOWN_ERROR: "Unknown error in parameters",=0D =0D - FORMAT_INVALID : "Invalid syntax/format",=0D - FORMAT_NOT_SUPPORTED : "Not supported syntax/format",=0D - FORMAT_UNKNOWN : "Unknown format",=0D - FORMAT_UNKNOWN_ERROR : "Unknown error in syntax/format ",=0D + FORMAT_INVALID: "Invalid syntax/format",=0D + FORMAT_NOT_SUPPORTED: "Not supported syntax/format",=0D + FORMAT_UNKNOWN: "Unknown format",=0D + FORMAT_UNKNOWN_ERROR: "Unknown error in syntax/format ",=0D =0D - RESOURCE_NOT_AVAILABLE : "Not available",=0D - RESOURCE_ALLOCATE_FAILURE : "Allocate failure",=0D - RESOURCE_FULL : "Full",=0D - RESOURCE_OVERFLOW : "Overflow",=0D - RESOURCE_UNDERRUN : "Underrun",=0D - RESOURCE_UNKNOWN_ERROR : "Unknown error",=0D + RESOURCE_NOT_AVAILABLE: "Not available",=0D + RESOURCE_ALLOCATE_FAILURE: "Allocate failure",=0D + RESOURCE_FULL: "Full",=0D + RESOURCE_OVERFLOW: "Overflow",=0D + RESOURCE_UNDERRUN: "Underrun",=0D + RESOURCE_UNKNOWN_ERROR: "Unknown error",=0D =0D - ATTRIBUTE_NOT_AVAILABLE : "Not available",=0D - ATTRIBUTE_GET_FAILURE : "Failed to retrieve",=0D - ATTRIBUTE_SET_FAILURE : "Failed to set",=0D + ATTRIBUTE_NOT_AVAILABLE: "Not available",=0D + ATTRIBUTE_GET_FAILURE: "Failed to retrieve",=0D + ATTRIBUTE_SET_FAILURE: "Failed to set",=0D ATTRIBUTE_UPDATE_FAILURE: "Failed to update",=0D - ATTRIBUTE_ACCESS_DENIED : "Access denied",=0D - ATTRIBUTE_UNKNOWN_ERROR : "Unknown error when accessing",=0D + ATTRIBUTE_ACCESS_DENIED: "Access denied",=0D + ATTRIBUTE_UNKNOWN_ERROR: "Unknown error when accessing",=0D =0D - COMMAND_FAILURE : "Failed to execute command",=0D + COMMAND_FAILURE: "Failed to execute command",=0D =0D - IO_NOT_READY : "Not ready",=0D - IO_BUSY : "Busy",=0D - IO_TIMEOUT : "Timeout",=0D - IO_UNKNOWN_ERROR : "Unknown error in IO operation",=0D + IO_NOT_READY: "Not ready",=0D + IO_BUSY: "Busy",=0D + IO_TIMEOUT: "Timeout",=0D + IO_UNKNOWN_ERROR: "Unknown error in IO operation",=0D =0D - ERROR_STATEMENT : "!error statement",=0D - UNKNOWN_ERROR : "Unknown error",=0D + ERROR_STATEMENT: "!error statement",=0D + UNKNOWN_ERROR: "Unknown error",=0D }=0D =0D -## Exception indicating a fatal error=0D +# Exception indicating a fatal error=0D +=0D +=0D class FatalError(Exception):=0D pass=0D =0D +=0D if __name__ =3D=3D "__main__":=0D pass=0D diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Sou= rce/Python/Common/BuildVersion.py index 088609f54170..8e276013bcce 100644 --- a/BaseTools/Source/Python/Common/BuildVersion.py +++ b/BaseTools/Source/Python/Common/BuildVersion.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This file is for build version number auto generation=0D #=0D diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/= Python/Common/DataType.py index dc4962333351..67433b95c759 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common static strings used by INF/DEC/DSC fi= les=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -39,8 +39,10 @@ TAB_VOID =3D 'VOID*' TAB_GUID =3D 'GUID'=0D =0D TAB_PCD_CLEAN_NUMERIC_TYPES =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UI= NT64}=0D -TAB_PCD_NUMERIC_TYPES =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, = 'BOOLEAN'}=0D -TAB_PCD_NUMERIC_TYPES_VOID =3D {TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UIN= T64, 'BOOLEAN', TAB_VOID}=0D +TAB_PCD_NUMERIC_TYPES =3D {TAB_UINT8, TAB_UINT16,=0D + TAB_UINT32, TAB_UINT64, 'BOOLEAN'}=0D +TAB_PCD_NUMERIC_TYPES_VOID =3D {TAB_UINT8, TAB_UINT16,=0D + TAB_UINT32, TAB_UINT64, 'BOOLEAN', TAB_VOID}= =0D =0D TAB_WORKSPACE =3D '$(WORKSPACE)'=0D TAB_FV_DIRECTORY =3D 'FV'=0D @@ -55,7 +57,8 @@ TAB_ARCH_AARCH64 =3D 'AARCH64' =0D TAB_ARCH_RISCV64 =3D 'RISCV64'=0D =0D -ARCH_SET_FULL =3D {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM, TAB_ARCH_EBC= , TAB_ARCH_AARCH64, TAB_ARCH_RISCV64, TAB_ARCH_COMMON}=0D +ARCH_SET_FULL =3D {TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_ARM,=0D + TAB_ARCH_EBC, TAB_ARCH_AARCH64, TAB_ARCH_RISCV64, TAB_ARC= H_COMMON}=0D =0D SUP_MODULE_BASE =3D 'BASE'=0D SUP_MODULE_SEC =3D 'SEC'=0D @@ -74,8 +77,8 @@ SUP_MODULE_SMM_CORE =3D 'SMM_CORE' SUP_MODULE_MM_STANDALONE =3D 'MM_STANDALONE'=0D SUP_MODULE_MM_CORE_STANDALONE =3D 'MM_CORE_STANDALONE'=0D =0D -SUP_MODULE_LIST =3D [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,= SUP_MODULE_PEIM, SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \=0D - SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVE= R, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \=0D +SUP_MODULE_LIST =3D [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE,= SUP_MODULE_PEIM, SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER,=0D + SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVE= R, SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER,=0D SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, S= UP_MODULE_HOST_APPLICATION, SUP_MODULE_SMM_CORE, SUP_MODULE_MM_STANDALONE, = SUP_MODULE_MM_CORE_STANDALONE]=0D SUP_MODULE_LIST_STRING =3D TAB_VALUE_SPLIT.join(SUP_MODULE_LIST)=0D SUP_MODULE_SET_PEI =3D {SUP_MODULE_PEIM, SUP_MODULE_PEI_CORE}=0D @@ -95,18 +98,18 @@ EDKII_NAME =3D 'EDKII' MSG_EDKII_MAIL_ADDR =3D 'devel@edk2.groups.io'=0D =0D COMPONENT_TO_MODULE_MAP_DICT =3D {=0D - EDK_COMPONENT_TYPE_LIBRARY : SUP_MODULE_BASE,=0D - EDK_COMPONENT_TYPE_SECURITY_CORE : SUP_MODULE_SEC,=0D - EDK_COMPONENT_TYPE_PEI_CORE : SUP_MODULE_PEI_CORE,=0D - EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER : SUP_MODULE_PEIM,=0D - EDK_COMPONENT_TYPE_PIC_PEIM : SUP_MODULE_PEIM,=0D - EDK_COMPONENT_TYPE_RELOCATABLE_PEIM : SUP_MODULE_PEIM,=0D - "PE32_PEIM" : SUP_MODULE_PEIM,=0D - EDK_COMPONENT_TYPE_BS_DRIVER : SUP_MODULE_DXE_DRIVER,=0D - EDK_COMPONENT_TYPE_RT_DRIVER : SUP_MODULE_DXE_RUNTIME_DR= IVER,=0D - EDK_COMPONENT_TYPE_SAL_RT_DRIVER : SUP_MODULE_DXE_SAL_DRIVER= ,=0D - EDK_COMPONENT_TYPE_APPLICATION : SUP_MODULE_UEFI_APPLICATI= ON,=0D - "LOGO" : SUP_MODULE_BASE,=0D + EDK_COMPONENT_TYPE_LIBRARY: SUP_MODULE_BASE,=0D + EDK_COMPONENT_TYPE_SECURITY_CORE: SUP_MODULE_SEC,=0D + EDK_COMPONENT_TYPE_PEI_CORE: SUP_MODULE_PEI_CORE,=0D + EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER: SUP_MODULE_PEIM,=0D + EDK_COMPONENT_TYPE_PIC_PEIM: SUP_MODULE_PEIM,=0D + EDK_COMPONENT_TYPE_RELOCATABLE_PEIM: SUP_MODULE_PEIM,=0D + "PE32_PEIM": SUP_MODULE_PEIM,=0D + EDK_COMPONENT_TYPE_BS_DRIVER: SUP_MODULE_DXE_DRIVER,=0D + EDK_COMPONENT_TYPE_RT_DRIVER: SUP_MODULE_DXE_RUNTIME_DRIVER,=0D + EDK_COMPONENT_TYPE_SAL_RT_DRIVER: SUP_MODULE_DXE_SAL_DRIVER,=0D + EDK_COMPONENT_TYPE_APPLICATION: SUP_MODULE_UEFI_APPLICATION,=0D + "LOGO": SUP_MODULE_BASE,=0D }=0D =0D BINARY_FILE_TYPE_FW =3D 'FW'=0D @@ -208,57 +211,86 @@ TAB_PCDS_DYNAMIC_DEFAULT =3D 'DynamicDefault' TAB_PCDS_DYNAMIC_VPD =3D 'DynamicVpd'=0D TAB_PCDS_DYNAMIC_HII =3D 'DynamicHii'=0D =0D -PCD_DYNAMIC_TYPE_SET =3D {TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, TAB_= PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII}=0D -PCD_DYNAMIC_EX_TYPE_SET =3D {TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFA= ULT, TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII}=0D +PCD_DYNAMIC_TYPE_SET =3D {TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT,=0D + TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII}=0D +PCD_DYNAMIC_EX_TYPE_SET =3D {TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFA= ULT,=0D + TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HI= I}=0D =0D # leave as a list for order=0D -PCD_TYPE_LIST =3D [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE, = TAB_PCDS_FEATURE_FLAG, TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_EX]=0D +PCD_TYPE_LIST =3D [TAB_PCDS_FIXED_AT_BUILD, TAB_PCDS_PATCHABLE_IN_MODULE,= =0D + TAB_PCDS_FEATURE_FLAG, TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC= _EX]=0D =0D TAB_PCDS_FIXED_AT_BUILD_NULL =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD=0D -TAB_PCDS_FIXED_AT_BUILD_COMMON =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TA= B_SPLIT + TAB_ARCH_COMMON=0D -TAB_PCDS_FIXED_AT_BUILD_IA32 =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_= SPLIT + TAB_ARCH_IA32=0D -TAB_PCDS_FIXED_AT_BUILD_X64 =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_S= PLIT + TAB_ARCH_X64=0D -TAB_PCDS_FIXED_AT_BUILD_ARM =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_S= PLIT + TAB_ARCH_ARM=0D -TAB_PCDS_FIXED_AT_BUILD_EBC =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_S= PLIT + TAB_ARCH_EBC=0D -TAB_PCDS_FIXED_AT_BUILD_AARCH64 =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + T= AB_SPLIT + TAB_ARCH_AARCH64=0D +TAB_PCDS_FIXED_AT_BUILD_COMMON =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_COMMON=0D +TAB_PCDS_FIXED_AT_BUILD_IA32 =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_IA32=0D +TAB_PCDS_FIXED_AT_BUILD_X64 =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_X64=0D +TAB_PCDS_FIXED_AT_BUILD_ARM =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_ARM=0D +TAB_PCDS_FIXED_AT_BUILD_EBC =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_EBC=0D +TAB_PCDS_FIXED_AT_BUILD_AARCH64 =3D TAB_PCDS + \=0D + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_AARCH64=0D =0D TAB_PCDS_PATCHABLE_IN_MODULE_NULL =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MOD= ULE=0D -TAB_PCDS_PATCHABLE_IN_MODULE_COMMON =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_M= ODULE + TAB_SPLIT + TAB_ARCH_COMMON=0D -TAB_PCDS_PATCHABLE_IN_MODULE_IA32 =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MOD= ULE + TAB_SPLIT + TAB_ARCH_IA32=0D -TAB_PCDS_PATCHABLE_IN_MODULE_X64 =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + TAB_SPLIT + TAB_ARCH_X64=0D -TAB_PCDS_PATCHABLE_IN_MODULE_ARM =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + TAB_SPLIT + TAB_ARCH_ARM=0D -TAB_PCDS_PATCHABLE_IN_MODULE_EBC =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + TAB_SPLIT + TAB_ARCH_EBC=0D -TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_= MODULE + TAB_SPLIT + TAB_ARCH_AARCH64=0D +TAB_PCDS_PATCHABLE_IN_MODULE_COMMON =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_COMMON=0D +TAB_PCDS_PATCHABLE_IN_MODULE_IA32 =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_IA32=0D +TAB_PCDS_PATCHABLE_IN_MODULE_X64 =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_X64=0D +TAB_PCDS_PATCHABLE_IN_MODULE_ARM =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_ARM=0D +TAB_PCDS_PATCHABLE_IN_MODULE_EBC =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_EBC=0D +TAB_PCDS_PATCHABLE_IN_MODULE_AARCH64 =3D TAB_PCDS + \=0D + TAB_PCDS_PATCHABLE_IN_MODULE + TAB_SPLIT + TAB_ARCH_AARCH64=0D =0D TAB_PCDS_FEATURE_FLAG_NULL =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG=0D -TAB_PCDS_FEATURE_FLAG_COMMON =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SP= LIT + TAB_ARCH_COMMON=0D -TAB_PCDS_FEATURE_FLAG_IA32 =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLI= T + TAB_ARCH_IA32=0D -TAB_PCDS_FEATURE_FLAG_X64 =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + TAB_ARCH_X64=0D -TAB_PCDS_FEATURE_FLAG_ARM =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + TAB_ARCH_ARM=0D -TAB_PCDS_FEATURE_FLAG_EBC =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + TAB_ARCH_EBC=0D -TAB_PCDS_FEATURE_FLAG_AARCH64 =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_S= PLIT + TAB_ARCH_AARCH64=0D +TAB_PCDS_FEATURE_FLAG_COMMON =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_COMMON=0D +TAB_PCDS_FEATURE_FLAG_IA32 =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_IA32=0D +TAB_PCDS_FEATURE_FLAG_X64 =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_X64=0D +TAB_PCDS_FEATURE_FLAG_ARM =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_ARM=0D +TAB_PCDS_FEATURE_FLAG_EBC =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_EBC=0D +TAB_PCDS_FEATURE_FLAG_AARCH64 =3D TAB_PCDS + \=0D + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_AARCH64=0D =0D TAB_PCDS_DYNAMIC_EX_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX=0D TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAUL= T=0D TAB_PCDS_DYNAMIC_EX_HII_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII=0D TAB_PCDS_DYNAMIC_EX_VPD_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD=0D -TAB_PCDS_DYNAMIC_EX_COMMON =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT = + TAB_ARCH_COMMON=0D -TAB_PCDS_DYNAMIC_EX_IA32 =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + = TAB_ARCH_IA32=0D -TAB_PCDS_DYNAMIC_EX_X64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + T= AB_ARCH_X64=0D -TAB_PCDS_DYNAMIC_EX_ARM =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + T= AB_ARCH_ARM=0D -TAB_PCDS_DYNAMIC_EX_EBC =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + T= AB_ARCH_EBC=0D -TAB_PCDS_DYNAMIC_EX_AARCH64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT= + TAB_ARCH_AARCH64=0D +TAB_PCDS_DYNAMIC_EX_COMMON =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_COMMON=0D +TAB_PCDS_DYNAMIC_EX_IA32 =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IA32=0D +TAB_PCDS_DYNAMIC_EX_X64 =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_X64=0D +TAB_PCDS_DYNAMIC_EX_ARM =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_ARM=0D +TAB_PCDS_DYNAMIC_EX_EBC =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_EBC=0D +TAB_PCDS_DYNAMIC_EX_AARCH64 =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_AARCH64=0D =0D TAB_PCDS_DYNAMIC_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC=0D TAB_PCDS_DYNAMIC_DEFAULT_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT=0D TAB_PCDS_DYNAMIC_HII_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_HII=0D TAB_PCDS_DYNAMIC_VPD_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_VPD=0D -TAB_PCDS_DYNAMIC_COMMON =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_= ARCH_COMMON=0D +TAB_PCDS_DYNAMIC_COMMON =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_COMMON=0D TAB_PCDS_DYNAMIC_IA32 =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_AR= CH_IA32=0D TAB_PCDS_DYNAMIC_X64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_X64=0D TAB_PCDS_DYNAMIC_ARM =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_ARM=0D TAB_PCDS_DYNAMIC_EBC =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_EBC=0D -TAB_PCDS_DYNAMIC_AARCH64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB= _ARCH_AARCH64=0D +TAB_PCDS_DYNAMIC_AARCH64 =3D TAB_PCDS + \=0D + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_AARCH64=0D =0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE =3D 'PcdLoadFixAddressPe= iCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE =3D 'UINT32'=0D @@ -268,15 +300,17 @@ TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE= =3D 'PcdLoadFixAddressRuntim TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE =3D 'UINT3= 2'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE =3D 'PcdLoadFixAddressSm= mCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE =3D 'UINT32'=0D -TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SET =3D {TAB_PCDS_PATCHABLE_LOAD_FIX_= ADDRESS_PEI_PAGE_SIZE, \=0D - TAB_PCDS_PATCHABLE_LOAD_FIX_AD= DRESS_DXE_PAGE_SIZE, \=0D - TAB_PCDS_PATCHABLE_LOAD_FIX_AD= DRESS_RUNTIME_PAGE_SIZE, \=0D - TAB_PCDS_PATCHABLE_LOAD_FIX_AD= DRESS_SMM_PAGE_SIZE}=0D +TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SET =3D {TAB_PCDS_PATCHABLE_LOAD_FIX_A= DDRESS_PEI_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADD= RESS_DXE_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADD= RESS_RUNTIME_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADD= RESS_SMM_PAGE_SIZE}=0D =0D -## The mapping dictionary from datum type to its maximum number.=0D -MAX_VAL_TYPE =3D {"BOOLEAN":0x01, TAB_UINT8:0xFF, TAB_UINT16:0xFFFF, TAB_U= INT32:0xFFFFFFFF, TAB_UINT64:0xFFFFFFFFFFFFFFFF}=0D -## The mapping dictionary from datum type to size string.=0D -MAX_SIZE_TYPE =3D {"BOOLEAN":1, TAB_UINT8:1, TAB_UINT16:2, TAB_UINT32:4, T= AB_UINT64:8}=0D +# The mapping dictionary from datum type to its maximum number.=0D +MAX_VAL_TYPE =3D {"BOOLEAN": 0x01, TAB_UINT8: 0xFF, TAB_UINT16: 0xFFFF,=0D + TAB_UINT32: 0xFFFFFFFF, TAB_UINT64: 0xFFFFFFFFFFFFFFFF}=0D +# The mapping dictionary from datum type to size string.=0D +MAX_SIZE_TYPE =3D {"BOOLEAN": 1, TAB_UINT8: 1,=0D + TAB_UINT16: 2, TAB_UINT32: 4, TAB_UINT64: 8}=0D =0D TAB_DEPEX =3D 'Depex'=0D TAB_DEPEX_COMMON =3D TAB_DEPEX + TAB_SPLIT + TAB_ARCH_COMMON=0D @@ -343,7 +377,8 @@ TAB_INF_DEFINES_FFS_EXT =3D 'FFS_EXT' TAB_INF_DEFINES_FV_EXT =3D 'FV_EXT'=0D TAB_INF_DEFINES_SOURCE_FV =3D 'SOURCE_FV'=0D TAB_INF_DEFINES_VERSION_NUMBER =3D 'VERSION_NUMBER'=0D -TAB_INF_DEFINES_VERSION =3D 'VERSION' # for Edk inf, the same as = VERSION_NUMBER=0D +# for Edk inf, the same as VERSION_NUMBER=0D +TAB_INF_DEFINES_VERSION =3D 'VERSION'=0D TAB_INF_DEFINES_VERSION_STRING =3D 'VERSION_STRING'=0D TAB_INF_DEFINES_PCD_IS_DRIVER =3D 'PCD_IS_DRIVER'=0D TAB_INF_DEFINES_TIANO_EDK_FLASHMAP_H =3D 'TIANO_EDK_FLASHMAP_H'=0D @@ -463,10 +498,11 @@ TAB_UNKNOWN =3D 'UNKNOWN' #=0D # Build database path=0D #=0D -DATABASE_PATH =3D ":memory:" #"BuildDatabase.db"=0D +DATABASE_PATH =3D ":memory:" # "BuildDatabase.db"=0D =0D # used by ECC=0D -MODIFIER_SET =3D {'IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVIC= E', 'EFI_BOOTSERVICE', 'EFIAPI'}=0D +MODIFIER_SET =3D {'IN', 'OUT', 'OPTIONAL', 'UNALIGNED',=0D + 'EFI_RUNTIMESERVICE', 'EFI_BOOTSERVICE', 'EFIAPI'}=0D =0D # Dependency Opcodes=0D DEPEX_OPCODE_BEFORE =3D "BEFORE"=0D @@ -481,7 +517,8 @@ DEPEX_OPCODE_TRUE =3D "TRUE" DEPEX_OPCODE_FALSE =3D "FALSE"=0D =0D # Dependency Expression=0D -DEPEX_SUPPORTED_OPCODE_SET =3D {"BEFORE", "AFTER", "PUSH", "AND", "OR", "N= OT", "END", "SOR", "TRUE", "FALSE", '(', ')'}=0D +DEPEX_SUPPORTED_OPCODE_SET =3D {"BEFORE", "AFTER", "PUSH",=0D + "AND", "OR", "NOT", "END", "SOR", "TRUE", "F= ALSE", '(', ')'}=0D =0D TAB_STATIC_LIBRARY =3D "STATIC-LIBRARY-FILE"=0D TAB_DYNAMIC_LIBRARY =3D "DYNAMIC-LIBRARY-FILE"=0D @@ -513,29 +550,29 @@ PCDS_DYNAMICEX_DEFAULT =3D "PcdsDynamicExDefault" PCDS_DYNAMICEX_VPD =3D "PcdsDynamicExVpd"=0D PCDS_DYNAMICEX_HII =3D "PcdsDynamicExHii"=0D =0D -SECTIONS_HAVE_ITEM_PCD_SET =3D {PCDS_DYNAMIC_DEFAULT.upper(), PCDS_DYNAMIC= _VPD.upper(), PCDS_DYNAMIC_HII.upper(), \=0D +SECTIONS_HAVE_ITEM_PCD_SET =3D {PCDS_DYNAMIC_DEFAULT.upper(), PCDS_DYNAMIC= _VPD.upper(), PCDS_DYNAMIC_HII.upper(),=0D PCDS_DYNAMICEX_DEFAULT.upper(), PCDS_DYNAMIC= EX_VPD.upper(), PCDS_DYNAMICEX_HII.upper()}=0D # Section allowed to have items after arch=0D SECTIONS_HAVE_ITEM_AFTER_ARCH_SET =3D {TAB_LIBRARY_CLASSES.upper(), TAB_DE= PEX.upper(), TAB_USER_EXTENSIONS.upper(),=0D - PCDS_DYNAMIC_DEFAULT.upper(),=0D - PCDS_DYNAMIC_VPD.upper(),=0D - PCDS_DYNAMIC_HII.upper(),=0D - PCDS_DYNAMICEX_DEFAULT.upper(),=0D - PCDS_DYNAMICEX_VPD.upper(),=0D - PCDS_DYNAMICEX_HII.upper(),=0D - TAB_BUILD_OPTIONS.upper(),=0D - TAB_PACKAGES.upper(),=0D - TAB_INCLUDES.upper()}=0D + PCDS_DYNAMIC_DEFAULT.upper(),=0D + PCDS_DYNAMIC_VPD.upper(),=0D + PCDS_DYNAMIC_HII.upper(),=0D + PCDS_DYNAMICEX_DEFAULT.upper(),=0D + PCDS_DYNAMICEX_VPD.upper(),=0D + PCDS_DYNAMICEX_HII.upper(),=0D + TAB_BUILD_OPTIONS.upper(),=0D + TAB_PACKAGES.upper(),=0D + TAB_INCLUDES.upper()}=0D =0D #=0D # pack codes as used in PcdDb and elsewhere=0D #=0D PACK_PATTERN_GUID =3D '=3DLHHBBBBBBBB'=0D -PACK_CODE_BY_SIZE =3D {8:'=3DQ',=0D - 4:'=3DL',=0D - 2:'=3DH',=0D - 1:'=3DB',=0D - 0:'=3DB',=0D - 16:""}=0D +PACK_CODE_BY_SIZE =3D {8: '=3DQ',=0D + 4: '=3DL',=0D + 2: '=3DH',=0D + 1: '=3DB',=0D + 0: '=3DB',=0D + 16: ""}=0D =0D TAB_COMPILER_MSFT =3D 'MSFT'=0D diff --git a/BaseTools/Source/Python/Common/Edk2/Capsule/FmpPayloadHeader.p= y b/BaseTools/Source/Python/Common/Edk2/Capsule/FmpPayloadHeader.py index ddc142c39ef2..c3dd899c85ae 100644 --- a/BaseTools/Source/Python/Common/Edk2/Capsule/FmpPayloadHeader.py +++ b/BaseTools/Source/Python/Common/Edk2/Capsule/FmpPayloadHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Module that encodes and decodes a FMP_PAYLOAD_HEADER with a payload.=0D # The FMP_PAYLOAD_HEADER is processed by the FmpPayloadHeaderLib in the=0D # FmpDevicePkg.=0D @@ -13,11 +13,14 @@ FmpPayloadHeader =0D import struct=0D =0D -def _SIGNATURE_32 (A, B, C, D):=0D - return struct.unpack ('=3DI',bytearray (A + B + C + D, 'ascii'))[0]=0D =0D -def _SIGNATURE_32_TO_STRING (Signature):=0D - return struct.pack ("=0D @@ -22,11 +22,13 @@ # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0D # This copyright is for QueueHandler.=0D =0D -## Import modules=0D +# Import modules=0D from __future__ import absolute_import=0D -import Common.LongFilePathOs as os, sys, logging=0D +import Common.LongFilePathOs as os=0D +import sys=0D +import logging=0D import traceback=0D -from .BuildToolError import *=0D +from .BuildToolError import *=0D try:=0D from logging.handlers import QueueHandler=0D except:=0D @@ -95,10 +97,14 @@ except: self.enqueue(self.prepare(record))=0D except Exception:=0D self.handleError(record)=0D +=0D +=0D class BlockQueueHandler(QueueHandler):=0D def enqueue(self, record):=0D - self.queue.put(record,True)=0D -## Log level constants=0D + self.queue.put(record, True)=0D +=0D +=0D +# Log level constants=0D DEBUG_0 =3D 1=0D DEBUG_1 =3D 2=0D DEBUG_2 =3D 3=0D @@ -110,11 +116,11 @@ DEBUG_7 =3D 8 DEBUG_8 =3D 9=0D DEBUG_9 =3D 10=0D VERBOSE =3D 15=0D -INFO =3D 20=0D -WARN =3D 30=0D -QUIET =3D 40=0D -ERROR =3D 50=0D -SILENT =3D 99=0D +INFO =3D 20=0D +WARN =3D 30=0D +QUIET =3D 40=0D +ERROR =3D 50=0D +SILENT =3D 99=0D =0D IsRaiseError =3D True=0D =0D @@ -128,7 +134,8 @@ _LogLevels =3D [DEBUG_0, DEBUG_1, DEBUG_2, DEBUG_3, DEB= UG_4, DEBUG_5, =0D # For DEBUG level (All DEBUG_0~9 are applicable)=0D _DebugLogger =3D logging.getLogger("tool_debug")=0D -_DebugFormatter =3D logging.Formatter("[%(asctime)s.%(msecs)d]: %(message)= s", datefmt=3D"%H:%M:%S")=0D +_DebugFormatter =3D logging.Formatter(=0D + "[%(asctime)s.%(msecs)d]: %(message)s", datefmt=3D"%H:%M:%S")=0D =0D # For VERBOSE, INFO, WARN level=0D _InfoLogger =3D logging.getLogger("tool_info")=0D @@ -151,12 +158,14 @@ _DebugMessageTemplate =3D '%(file)s(%(line)s): debug:= \n %(msg)s' #=0D _WarningAsError =3D False=0D =0D -## Log debug message=0D +# Log debug message=0D #=0D # @param Level DEBUG level (DEBUG0~9)=0D # @param Message Debug information=0D # @param ExtraData More information associated with "Message"=0D #=0D +=0D +=0D def debug(Level, Message, ExtraData=3DNone):=0D if _DebugLogger.level > Level:=0D return=0D @@ -166,9 +175,9 @@ def debug(Level, Message, ExtraData=3DNone): # Find out the caller method information=0D CallerStack =3D traceback.extract_stack()[-2]=0D TemplateDict =3D {=0D - "file" : CallerStack[0],=0D - "line" : CallerStack[1],=0D - "msg" : Message,=0D + "file": CallerStack[0],=0D + "line": CallerStack[1],=0D + "msg": Message,=0D }=0D =0D if ExtraData is not None:=0D @@ -178,14 +187,16 @@ def debug(Level, Message, ExtraData=3DNone): =0D _DebugLogger.log(Level, LogText)=0D =0D -## Log verbose message=0D +# Log verbose message=0D #=0D # @param Message Verbose information=0D #=0D +=0D +=0D def verbose(Message):=0D return _InfoLogger.log(VERBOSE, Message)=0D =0D -## Log warning message=0D +# Log warning message=0D #=0D # Warning messages are those which might be wrong but won't fail the too= l.=0D #=0D @@ -196,6 +207,8 @@ def verbose(Message): # @param Line The line number in the "File" which caused the war= ning.=0D # @param ExtraData More information associated with "Message"=0D #=0D +=0D +=0D def warn(ToolName, Message, File=3DNone, Line=3DNone, ExtraData=3DNone):=0D if _InfoLogger.level > WARN:=0D return=0D @@ -210,10 +223,10 @@ def warn(ToolName, Message, File=3DNone, Line=3DNone,= ExtraData=3DNone): Line =3D "%d" % Line=0D =0D TemplateDict =3D {=0D - "tool" : ToolName,=0D - "file" : File,=0D - "line" : Line,=0D - "msg" : Message,=0D + "tool": ToolName,=0D + "file": File,=0D + "line": Line,=0D + "msg": Message,=0D }=0D =0D if File is not None:=0D @@ -230,10 +243,11 @@ def warn(ToolName, Message, File=3DNone, Line=3DNone,= ExtraData=3DNone): if _WarningAsError =3D=3D True:=0D raise FatalError(WARNING_AS_ERROR)=0D =0D -## Log INFO message=0D -info =3D _InfoLogger.info=0D =0D -## Log ERROR message=0D +# Log INFO message=0D +info =3D _InfoLogger.info=0D +=0D +# Log ERROR message=0D #=0D # Once an error messages is logged, the tool's execution will be broken = by raising=0D # an exception. If you don't want to break the execution later, you can gi= ve=0D @@ -249,6 +263,8 @@ info =3D _InfoLogger.info # @param RaiseError Raise an exception to break the tool's execution i= f=0D # it's True. This is the default behavior.=0D #=0D +=0D +=0D def error(ToolName, ErrorCode, Message=3DNone, File=3DNone, Line=3DNone, E= xtraData=3DNone, RaiseError=3DIsRaiseError):=0D if Line is None:=0D Line =3D "..."=0D @@ -265,16 +281,16 @@ def error(ToolName, ErrorCode, Message=3DNone, File= =3DNone, Line=3DNone, ExtraData=3DNon ExtraData =3D ""=0D =0D TemplateDict =3D {=0D - "tool" : _ToolName,=0D - "file" : File,=0D - "line" : Line,=0D - "errorcode" : ErrorCode,=0D - "msg" : Message,=0D - "extra" : ExtraData=0D + "tool": _ToolName,=0D + "file": File,=0D + "line": Line,=0D + "errorcode": ErrorCode,=0D + "msg": Message,=0D + "extra": ExtraData=0D }=0D =0D if File is not None:=0D - LogText =3D _ErrorMessageTemplate % TemplateDict=0D + LogText =3D _ErrorMessageTemplate % TemplateDict=0D else:=0D LogText =3D _ErrorMessageTemplateWithoutFile % TemplateDict=0D =0D @@ -283,10 +299,13 @@ def error(ToolName, ErrorCode, Message=3DNone, File= =3DNone, Line=3DNone, ExtraData=3DNon if RaiseError and IsRaiseError:=0D raise FatalError(ErrorCode)=0D =0D +=0D # Log information which should be always put out=0D -quiet =3D _ErrorLogger.error=0D +quiet =3D _ErrorLogger.error=0D +=0D +# Initialize log system=0D +=0D =0D -## Initialize log system=0D def LogClientInitialize(log_q):=0D #=0D # Since we use different format to log different levels of message int= o different=0D @@ -310,9 +329,11 @@ def LogClientInitialize(log_q): _ErrorCh.setFormatter(_ErrorFormatter)=0D _ErrorLogger.addHandler(_ErrorCh)=0D =0D -## Set log level=0D +# Set log level=0D #=0D # @param Level One of log level in _LogLevel=0D +=0D +=0D def SetLevel(Level):=0D if Level not in _LogLevels:=0D info("Not supported log level (%d). Use default level instead." % = Level)=0D @@ -321,7 +342,9 @@ def SetLevel(Level): _InfoLogger.setLevel(Level)=0D _ErrorLogger.setLevel(Level)=0D =0D -## Initialize log system=0D +# Initialize log system=0D +=0D +=0D def Initialize():=0D #=0D # Since we use different format to log different levels of message int= o different=0D @@ -345,23 +368,30 @@ def Initialize(): _ErrorCh.setFormatter(_ErrorFormatter)=0D _ErrorLogger.addHandler(_ErrorCh)=0D =0D +=0D def InitializeForUnitTest():=0D Initialize()=0D SetLevel(SILENT)=0D =0D -## Get current log level=0D +# Get current log level=0D +=0D +=0D def GetLevel():=0D return _InfoLogger.getEffectiveLevel()=0D =0D -## Raise up warning as error=0D +# Raise up warning as error=0D +=0D +=0D def SetWarningAsError():=0D global _WarningAsError=0D _WarningAsError =3D True=0D =0D -## Specify a file to store the log message as well as put on console=0D +# Specify a file to store the log message as well as put on console=0D #=0D # @param LogFile The file path used to store the log message=0D #=0D +=0D +=0D def SetLogFile(LogFile):=0D if os.path.exists(LogFile):=0D os.remove(LogFile)=0D @@ -370,7 +400,7 @@ def SetLogFile(LogFile): _Ch.setFormatter(_DebugFormatter)=0D _DebugLogger.addHandler(_Ch)=0D =0D - _Ch=3D logging.FileHandler(LogFile)=0D + _Ch =3D logging.FileHandler(LogFile)=0D _Ch.setFormatter(_InfoFormatter)=0D _InfoLogger.addHandler(_Ch)=0D =0D @@ -378,6 +408,6 @@ def SetLogFile(LogFile): _Ch.setFormatter(_ErrorFormatter)=0D _ErrorLogger.addHandler(_Ch)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Sourc= e/Python/Common/Expression.py index 31bf0e4b6cf7..ac9c767f213e 100644 --- a/BaseTools/Source/Python/Common/Expression.py +++ b/BaseTools/Source/Python/Common/Expression.py @@ -1,17 +1,17 @@ -## @file=0D +# @file=0D # This file is used to parse and evaluate expression in directive or PCD v= alue.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D from __future__ import print_function=0D from __future__ import absolute_import=0D from Common.GlobalData import *=0D from CommonDataClass.Exceptions import BadExpression=0D from CommonDataClass.Exceptions import WrnExpression=0D -from .Misc import GuidStringToGuidStructureString, ParseFieldValue,CopyDic= t=0D +from .Misc import GuidStringToGuidStructureString, ParseFieldValue, CopyDi= ct=0D import Common.EdkLogger as EdkLogger=0D import copy=0D from Common.DataType import *=0D @@ -19,36 +19,38 @@ import sys from random import sample=0D import string=0D =0D -ERR_STRING_EXPR =3D 'This operator cannot be used in string expres= sion: [%s].'=0D -ERR_SNYTAX =3D 'Syntax error, the rest of expression cannot b= e evaluated: [%s].'=0D -ERR_MATCH =3D 'No matching right parenthesis.'=0D -ERR_STRING_TOKEN =3D 'Bad string token: [%s].'=0D -ERR_MACRO_TOKEN =3D 'Bad macro token: [%s].'=0D -ERR_EMPTY_TOKEN =3D 'Empty token is not allowed.'=0D -ERR_PCD_RESOLVE =3D 'The PCD should be FeatureFlag type or FixedAt= Build type: [%s].'=0D -ERR_VALID_TOKEN =3D 'No more valid token found from rest of string= : [%s].'=0D -ERR_EXPR_TYPE =3D 'Different types found in expression.'=0D -ERR_OPERATOR_UNSUPPORT =3D 'Unsupported operator: [%s]'=0D -ERR_REL_NOT_IN =3D 'Expect "IN" after "not" operator.'=0D -WRN_BOOL_EXPR =3D 'Operand of boolean type cannot be used in ari= thmetic expression.'=0D -WRN_EQCMP_STR_OTHERS =3D '=3D=3D Comparison between Operand of string t= ype and Boolean/Number Type always return False.'=0D -WRN_NECMP_STR_OTHERS =3D '!=3D Comparison between Operand of string typ= e and Boolean/Number Type always return True.'=0D -ERR_RELCMP_STR_OTHERS =3D 'Operator taking Operand of string type and Bo= olean/Number Type is not allowed: [%s].'=0D -ERR_STRING_CMP =3D 'Unicode string and general string cannot be c= ompared: [%s %s %s]'=0D -ERR_ARRAY_TOKEN =3D 'Bad C array or C format GUID token: [%s].'=0D -ERR_ARRAY_ELE =3D 'This must be HEX value for NList or Array: [%= s].'=0D -ERR_EMPTY_EXPR =3D 'Empty expression is not allowed.'=0D -ERR_IN_OPERAND =3D 'Macro after IN operator can only be: $(FAMILY= ), $(ARCH), $(TOOL_CHAIN_TAG) and $(TARGET).'=0D +ERR_STRING_EXPR =3D 'This operator cannot be used in string expression: [%= s].'=0D +ERR_SNYTAX =3D 'Syntax error, the rest of expression cannot be evaluated: = [%s].'=0D +ERR_MATCH =3D 'No matching right parenthesis.'=0D +ERR_STRING_TOKEN =3D 'Bad string token: [%s].'=0D +ERR_MACRO_TOKEN =3D 'Bad macro token: [%s].'=0D +ERR_EMPTY_TOKEN =3D 'Empty token is not allowed.'=0D +ERR_PCD_RESOLVE =3D 'The PCD should be FeatureFlag type or FixedAtBuild ty= pe: [%s].'=0D +ERR_VALID_TOKEN =3D 'No more valid token found from rest of string: [%s].'= =0D +ERR_EXPR_TYPE =3D 'Different types found in expression.'=0D +ERR_OPERATOR_UNSUPPORT =3D 'Unsupported operator: [%s]'=0D +ERR_REL_NOT_IN =3D 'Expect "IN" after "not" operator.'=0D +WRN_BOOL_EXPR =3D 'Operand of boolean type cannot be used in arithmetic ex= pression.'=0D +WRN_EQCMP_STR_OTHERS =3D '=3D=3D Comparison between Operand of string type= and Boolean/Number Type always return False.'=0D +WRN_NECMP_STR_OTHERS =3D '!=3D Comparison between Operand of string type a= nd Boolean/Number Type always return True.'=0D +ERR_RELCMP_STR_OTHERS =3D 'Operator taking Operand of string type and Bool= ean/Number Type is not allowed: [%s].'=0D +ERR_STRING_CMP =3D 'Unicode string and general string cannot be compared: = [%s %s %s]'=0D +ERR_ARRAY_TOKEN =3D 'Bad C array or C format GUID token: [%s].'=0D +ERR_ARRAY_ELE =3D 'This must be HEX value for NList or Array: [%s].'=0D +ERR_EMPTY_EXPR =3D 'Empty expression is not allowed.'=0D +ERR_IN_OPERAND =3D 'Macro after IN operator can only be: $(FAMILY), $(ARCH= ), $(TOOL_CHAIN_TAG) and $(TARGET).'=0D =0D __ValidString =3D re.compile(r'[_a-zA-Z][_0-9a-zA-Z]*$')=0D _ReLabel =3D re.compile('LABEL\((\w+)\)')=0D _ReOffset =3D re.compile('OFFSET_OF\((\w+)\)')=0D PcdPattern =3D re.compile(r'^[_a-zA-Z][0-9A-Za-z_]*\.[_a-zA-Z][0-9A-Za-z_]= *$')=0D =0D -## SplitString=0D +# SplitString=0D # Split string to list according double quote=0D # For example: abc"de\"f"ghi"jkl"mn will be: ['abc', '"de\"f"', 'ghi', '"= jkl"', 'mn']=0D #=0D +=0D +=0D def SplitString(String):=0D # There might be escaped quote: "abc\"def\\\"ghi", 'abc\'def\\\'ghi'=0D RanStr =3D ''.join(sample(string.ascii_letters + string.digits, 8))=0D @@ -87,9 +89,10 @@ def SplitString(String): RetList.append(Item)=0D for i, ch in enumerate(RetList):=0D if RanStr in ch:=0D - RetList[i] =3D ch.replace(RanStr,'\\\\')=0D + RetList[i] =3D ch.replace(RanStr, '\\\\')=0D return RetList=0D =0D +=0D def SplitPcdValueString(String):=0D # There might be escaped comma in GUID() or DEVICE_PATH() or " "=0D # or ' ' or L' ' or L" "=0D @@ -129,12 +132,14 @@ def SplitPcdValueString(String): RetList.append(Item)=0D for i, ch in enumerate(RetList):=0D if RanStr in ch:=0D - RetList[i] =3D ch.replace(RanStr,'\\\\')=0D + RetList[i] =3D ch.replace(RanStr, '\\\\')=0D return RetList=0D =0D +=0D def IsValidCName(Str):=0D return True if __ValidString.match(Str) else False=0D =0D +=0D def BuildOptionValue(PcdValue, GuidDict):=0D if PcdValue.startswith('H'):=0D InputValue =3D PcdValue[1:]=0D @@ -151,9 +156,11 @@ def BuildOptionValue(PcdValue, GuidDict): =0D return PcdValue=0D =0D -## ReplaceExprMacro=0D +# ReplaceExprMacro=0D #=0D -def ReplaceExprMacro(String, Macros, ExceptionList =3D None):=0D +=0D +=0D +def ReplaceExprMacro(String, Macros, ExceptionList=3DNone):=0D StrList =3D SplitString(String)=0D for i, String in enumerate(StrList):=0D InQuote =3D False=0D @@ -200,6 +207,8 @@ def ReplaceExprMacro(String, Macros, ExceptionList =3D = None): return ''.join(StrList)=0D =0D # transfer int to string for in/not in expression=0D +=0D +=0D def IntToStr(Value):=0D StrList =3D []=0D while Value > 0:=0D @@ -208,8 +217,10 @@ def IntToStr(Value): Value =3D '"' + ''.join(StrList) + '"'=0D return Value=0D =0D +=0D SupportedInMacroList =3D ['TARGET', 'TOOL_CHAIN_TAG', 'ARCH', 'FAMILY']=0D =0D +=0D class BaseExpression(object):=0D def __init__(self, *args, **kwargs):=0D super(BaseExpression, self).__init__()=0D @@ -225,35 +236,36 @@ class BaseExpression(object): self._Idx =3D Idx=0D return False=0D =0D +=0D class ValueExpression(BaseExpression):=0D # Logical operator mapping=0D LogicalOperators =3D {=0D - '&&' : 'and', '||' : 'or',=0D - '!' : 'not', 'AND': 'and',=0D - 'OR' : 'or' , 'NOT': 'not',=0D - 'XOR': '^' , 'xor': '^',=0D - 'EQ' : '=3D=3D' , 'NE' : '!=3D',=0D - 'GT' : '>' , 'LT' : '<',=0D - 'GE' : '>=3D' , 'LE' : '<=3D',=0D - 'IN' : 'in'=0D + '&&': 'and', '||': 'or',=0D + '!': 'not', 'AND': 'and',=0D + 'OR': 'or', 'NOT': 'not',=0D + 'XOR': '^', 'xor': '^',=0D + 'EQ': '=3D=3D', 'NE': '!=3D',=0D + 'GT': '>', 'LT': '<',=0D + 'GE': '>=3D', 'LE': '<=3D',=0D + 'IN': 'in'=0D }=0D =0D - NonLetterOpLst =3D ['+', '-', TAB_STAR, '/', '%', '&', '|', '^', '~', = '<<', '>>', '!', '=3D', '>', '<', '?', ':']=0D -=0D + NonLetterOpLst =3D ['+', '-', TAB_STAR, '/', '%', '&', '|',=0D + '^', '~', '<<', '>>', '!', '=3D', '>', '<', '?', ':'= ]=0D =0D SymbolPattern =3D re.compile("("=0D - "\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+= \.\w+|"=0D - "&&|\|\||!(?!=3D)|"=0D - "(?<=3D\W)AND(?=3D\W)|(?<=3D\W)OR(?=3D\W)= |(?<=3D\W)NOT(?=3D\W)|(?<=3D\W)XOR(?=3D\W)|"=0D - "(?<=3D\W)EQ(?=3D\W)|(?<=3D\W)NE(?=3D\W)|= (?<=3D\W)GT(?=3D\W)|(?<=3D\W)LT(?=3D\W)|(?<=3D\W)GE(?=3D\W)|(?<=3D\W)LE(?= =3D\W)"=0D + "\$\([A-Z][A-Z0-9_]*\)|\$\(\w+\.\w+\)|\w+\.= \w+|"=0D + "&&|\|\||!(?!=3D)|"=0D + "(?<=3D\W)AND(?=3D\W)|(?<=3D\W)OR(?=3D\W)|(= ?<=3D\W)NOT(?=3D\W)|(?<=3D\W)XOR(?=3D\W)|"=0D + "(?<=3D\W)EQ(?=3D\W)|(?<=3D\W)NE(?=3D\W)|(?= <=3D\W)GT(?=3D\W)|(?<=3D\W)LT(?=3D\W)|(?<=3D\W)GE(?=3D\W)|(?<=3D\W)LE(?=3D\= W)"=0D ")")=0D =0D @staticmethod=0D - def Eval(Operator, Oprand1, Oprand2 =3D None):=0D + def Eval(Operator, Oprand1, Oprand2=3DNone):=0D WrnExp =3D None=0D =0D if Operator not in {"=3D=3D", "!=3D", ">=3D", "<=3D", ">", "<", "i= n", "not in"} and \=0D - (isinstance(Oprand1, type('')) or isinstance(Oprand2, type('')= )):=0D + (isinstance(Oprand1, type('')) or isinstance(Oprand2, type= (''))):=0D raise BadExpression(ERR_STRING_EXPR % Operator)=0D if Operator in {'in', 'not in'}:=0D if not isinstance(Oprand1, type('')):=0D @@ -261,11 +273,11 @@ class ValueExpression(BaseExpression): if not isinstance(Oprand2, type('')):=0D Oprand2 =3D IntToStr(Oprand2)=0D TypeDict =3D {=0D - type(0) : 0,=0D + type(0): 0,=0D # For python2 long type=0D - type(sys.maxsize + 1) : 0,=0D - type('') : 1,=0D - type(True) : 2=0D + type(sys.maxsize + 1): 0,=0D + type(''): 1,=0D + type(True): 2=0D }=0D =0D EvalStr =3D ''=0D @@ -305,15 +317,16 @@ class ValueExpression(BaseExpression): if isinstance(Oprand1, type('')) and isinstance(Oprand2, type(= '')):=0D if ((Oprand1.startswith('L"') or Oprand1.startswith("L'"))= and (not Oprand2.startswith('L"')) and (not Oprand2.startswith("L'"))) or = \=0D (((not Oprand1.startswith('L"')) and (not Oprand1.= startswith("L'"))) and (Oprand2.startswith('L"') or Oprand2.startswith("L'"= ))):=0D - raise BadExpression(ERR_STRING_CMP % (Oprand1, Operato= r, Oprand2))=0D + raise BadExpression(ERR_STRING_CMP %=0D + (Oprand1, Operator, Oprand2))=0D if 'in' in Operator and isinstance(Oprand2, type('')):=0D Oprand2 =3D Oprand2.split()=0D EvalStr =3D 'Oprand1 ' + Operator + ' Oprand2'=0D =0D # Local symbols used by built in eval function=0D Dict =3D {=0D - 'Oprand1' : Oprand1,=0D - 'Oprand2' : Oprand2=0D + 'Oprand1': Oprand1,=0D + 'Oprand2': Oprand2=0D }=0D try:=0D Val =3D eval(EvalStr, {}, Dict)=0D @@ -340,8 +353,8 @@ class ValueExpression(BaseExpression): return=0D =0D self._Expr =3D ReplaceExprMacro(Expression.strip(),=0D - SymbolTable,=0D - SupportedInMacroList)=0D + SymbolTable,=0D + SupportedInMacroList)=0D =0D if not self._Expr.strip():=0D raise BadExpression(ERR_EMPTY_EXPR)=0D @@ -447,6 +460,7 @@ class ValueExpression(BaseExpression): Val =3D Warn.result=0D return Val=0D # A [? B]*=0D +=0D def _ConExpr(self):=0D return self._ExprFuncTemplate(self._OrExpr, {'?', ':'})=0D =0D @@ -584,11 +598,11 @@ class ValueExpression(BaseExpression): # All whitespace and tabs in array are already stripped.=0D IsArray =3D IsGuid =3D False=0D if len(Token.split(',')) =3D=3D 11 and len(Token.split(',{')) =3D= =3D 2 \=0D - and len(Token.split('},')) =3D=3D 1:=0D + and len(Token.split('},')) =3D=3D 1:=0D HexLen =3D [11, 6, 6, 5, 4, 4, 4, 4, 4, 4, 6]=0D - HexList=3D Token.split(',')=0D + HexList =3D Token.split(',')=0D if HexList[3].startswith('{') and \=0D - not [Index for Index, Hex in enumerate(HexList) if len(Hex= ) > HexLen[Index]]:=0D + not [Index for Index, Hex in enumerate(HexList) if len= (Hex) > HexLen[Index]]:=0D IsGuid =3D True=0D if Token.lstrip('{').rstrip('}').find('{') =3D=3D -1:=0D if not [Hex for Hex in Token.lstrip('{').rstrip('}').split(','= ) if len(Hex) > 4]:=0D @@ -608,7 +622,8 @@ class ValueExpression(BaseExpression): =0D # Replace escape \\\", \"=0D if self._Expr[Idx] =3D=3D '"':=0D - Expr =3D self._Expr[self._Idx:].replace('\\\\', '//').replace(= '\\\"', '\\\'')=0D + Expr =3D self._Expr[self._Idx:].replace(=0D + '\\\\', '//').replace('\\\"', '\\\'')=0D for Ch in Expr:=0D self._Idx +=3D 1=0D if Ch =3D=3D '"':=0D @@ -616,9 +631,10 @@ class ValueExpression(BaseExpression): self._Token =3D self._LiteralToken =3D self._Expr[Idx:self._Id= x]=0D if not self._Token.endswith('"'):=0D raise BadExpression(ERR_STRING_TOKEN % self._Token)=0D - #Replace escape \\\', \'=0D + # Replace escape \\\', \'=0D elif self._Expr[Idx] =3D=3D "'":=0D - Expr =3D self._Expr[self._Idx:].replace('\\\\', '//').replace(= "\\\'", "\\\"")=0D + Expr =3D self._Expr[self._Idx:].replace(=0D + '\\\\', '//').replace("\\\'", "\\\"")=0D for Ch in Expr:=0D self._Idx +=3D 1=0D if Ch =3D=3D "'":=0D @@ -631,7 +647,7 @@ class ValueExpression(BaseExpression): =0D # Get token that is comprised by alphanumeric, underscore or dot(used = by PCD)=0D # @param IsAlphaOp: Indicate if parsing general token or script operat= or(EQ, NE...)=0D - def __GetIdToken(self, IsAlphaOp =3D False):=0D + def __GetIdToken(self, IsAlphaOp=3DFalse):=0D IdToken =3D ''=0D for Ch in self._Expr[self._Idx:]:=0D if not self.__IsIdChar(Ch) or ('?' in self._Expr and Ch =3D=3D= ':'):=0D @@ -655,7 +671,8 @@ class ValueExpression(BaseExpression): Ex =3D BadExpression(ERR_PCD_RESOLVE % self._Token)=0D Ex.Pcd =3D self._Token=0D raise Ex=0D - self._Token =3D ValueExpression(self._Symb[self._Token], self.= _Symb)(True, self._Depth+1)=0D + self._Token =3D ValueExpression(=0D + self._Symb[self._Token], self._Symb)(True, self._Depth+1)= =0D if not isinstance(self._Token, type('')):=0D self._LiteralToken =3D hex(self._Token)=0D return=0D @@ -697,7 +714,7 @@ class ValueExpression(BaseExpression): =0D def __IsHexLiteral(self):=0D if self._LiteralToken.startswith('{') and \=0D - self._LiteralToken.endswith('}'):=0D + self._LiteralToken.endswith('}'):=0D return True=0D =0D if gHexPattern.match(self._LiteralToken):=0D @@ -741,7 +758,7 @@ class ValueExpression(BaseExpression): try:=0D RetValue =3D Re.search(Expr).group(1)=0D except:=0D - raise BadExpression('Invalid Expression %s' % Expr)=0D + raise BadExpression('Invalid Expression %s' % Expr)=0D Idx =3D self._Idx=0D for Ch in Expr:=0D self._Idx +=3D 1=0D @@ -749,21 +766,23 @@ class ValueExpression(BaseExpression): Prefix =3D self._Expr[Idx:self._Idx - 1]=0D Idx =3D self._Idx=0D if Ch =3D=3D ')':=0D - TmpValue =3D self._Expr[Idx :self._Idx - 1]=0D + TmpValue =3D self._Expr[Idx:self._Idx - 1]=0D TmpValue =3D ValueExpression(TmpValue)(True)=0D - TmpValue =3D '0x%x' % int(TmpValue) if not isinstance(= TmpValue, type('')) else TmpValue=0D + TmpValue =3D '0x%x' % int(TmpValue) if not isinstance(= =0D + TmpValue, type('')) else TmpValue=0D break=0D self._Token, Size =3D ParseFieldValue(Prefix + '(' + TmpValue = + ')')=0D - return self._Token=0D + return self._Token=0D =0D self._Token =3D ''=0D if Expr:=0D Ch =3D Expr[0]=0D Match =3D gGuidPattern.match(Expr)=0D if Match and not Expr[Match.end():Match.end()+1].isalnum() \=0D - and Expr[Match.end():Match.end()+1] !=3D '_':=0D + and Expr[Match.end():Match.end()+1] !=3D '_':=0D self._Idx +=3D Match.end()=0D - self._Token =3D ValueExpression(GuidStringToGuidStructureS= tring(Expr[0:Match.end()]))(True, self._Depth+1)=0D + self._Token =3D ValueExpression(GuidStringToGuidStructureS= tring(=0D + Expr[0:Match.end()]))(True, self._Depth+1)=0D return self._Token=0D elif self.__IsIdChar(Ch):=0D return self.__GetIdToken()=0D @@ -781,7 +800,8 @@ class ValueExpression(BaseExpression): # Parse operator=0D def _GetOperator(self):=0D self.__SkipWS()=0D - LegalOpLst =3D ['&&', '||', '!=3D', '=3D=3D', '>=3D', '<=3D'] + se= lf.NonLetterOpLst + ['?', ':']=0D + LegalOpLst =3D ['&&', '||', '!=3D', '=3D=3D', '>=3D', '<=3D'] + \= =0D + self.NonLetterOpLst + ['?', ':']=0D =0D self._Token =3D ''=0D Expr =3D self._Expr[self._Idx:]=0D @@ -813,6 +833,7 @@ class ValueExpression(BaseExpression): self._Token =3D OpToken=0D return OpToken=0D =0D +=0D class ValueExpressionEx(ValueExpression):=0D def __init__(self, PcdValue, PcdType, SymbolTable=3D{}):=0D ValueExpression.__init__(self, PcdValue, SymbolTable)=0D @@ -828,11 +849,11 @@ class ValueExpressionEx(ValueExpression): PcdValue, Size =3D ParseFieldValue(PcdValue)=0D PcdValueList =3D []=0D for I in range(Size):=0D - PcdValueList.append('0x%02X'%(PcdValue & 0xff))=0D + PcdValueList.append('0x%02X' % (PcdValue & 0xff))= =0D PcdValue =3D PcdValue >> 8=0D PcdValue =3D '{' + ','.join(PcdValueList) + '}'=0D - elif self.PcdType in TAB_PCD_NUMERIC_TYPES and (PcdValue.s= tartswith("'") or \=0D - PcdValue.startswith('"') or PcdValue.startswith(= "L'") or PcdValue.startswith('L"') or PcdValue.startswith('{')):=0D + elif self.PcdType in TAB_PCD_NUMERIC_TYPES and (PcdValue.s= tartswith("'") or=0D + PcdValue.s= tartswith('"') or PcdValue.startswith("L'") or PcdValue.startswith('L"') or= PcdValue.startswith('{')):=0D raise BadExpression=0D except WrnExpression as Value:=0D PcdValue =3D Value.result=0D @@ -865,12 +886,14 @@ class ValueExpressionEx(ValueExpression): else:=0D ItemSize =3D 0=0D ValueType =3D TAB_UINT8=0D - Item =3D ValueExpressionEx(Item, ValueType, se= lf._Symb)(True)=0D + Item =3D ValueExpressionEx(=0D + Item, ValueType, self._Symb)(True)=0D if ItemSize =3D=3D 0:=0D try:=0D tmpValue =3D int(Item, 0)=0D if tmpValue > 255:=0D - raise BadExpression("Byte array n= umber %s should less than 0xFF." % Item)=0D + raise BadExpression(=0D + "Byte array number %s should = less than 0xFF." % Item)=0D except BadExpression as Value:=0D raise BadExpression(Value)=0D except ValueError:=0D @@ -888,24 +911,30 @@ class ValueExpressionEx(ValueExpression): try:=0D TmpValue, Size =3D ParseFieldValue(PcdValue)=0D except BadExpression as Value:=0D - raise BadExpression("Type: %s, Value: %s, %s" = % (self.PcdType, PcdValue, Value))=0D + raise BadExpression("Type: %s, Value: %s, %s" = % (=0D + self.PcdType, PcdValue, Value))=0D if isinstance(TmpValue, type('')):=0D try:=0D TmpValue =3D int(TmpValue)=0D except:=0D - raise BadExpression(Value)=0D + raise BadExpression(Value)=0D else:=0D PcdValue =3D '0x%0{}X'.format(Size) % (TmpValue)=0D if TmpValue < 0:=0D - raise BadExpression('Type %s PCD Value is negativ= e' % self.PcdType)=0D + raise BadExpression(=0D + 'Type %s PCD Value is negative' % self.PcdType= )=0D if self.PcdType =3D=3D TAB_UINT8 and Size > 1:=0D - raise BadExpression('Type %s PCD Value Size is Lar= ger than 1 byte' % self.PcdType)=0D + raise BadExpression(=0D + 'Type %s PCD Value Size is Larger than 1 byte'= % self.PcdType)=0D if self.PcdType =3D=3D TAB_UINT16 and Size > 2:=0D - raise BadExpression('Type %s PCD Value Size is Lar= ger than 2 byte' % self.PcdType)=0D + raise BadExpression(=0D + 'Type %s PCD Value Size is Larger than 2 byte'= % self.PcdType)=0D if self.PcdType =3D=3D TAB_UINT32 and Size > 4:=0D - raise BadExpression('Type %s PCD Value Size is Lar= ger than 4 byte' % self.PcdType)=0D + raise BadExpression(=0D + 'Type %s PCD Value Size is Larger than 4 byte'= % self.PcdType)=0D if self.PcdType =3D=3D TAB_UINT64 and Size > 8:=0D - raise BadExpression('Type %s PCD Value Size is Lar= ger than 8 byte' % self.PcdType)=0D + raise BadExpression(=0D + 'Type %s PCD Value Size is Larger than 8 byte'= % self.PcdType)=0D else:=0D try:=0D TmpValue =3D int(PcdValue)=0D @@ -914,11 +943,13 @@ class ValueExpressionEx(ValueExpression): PcdValue =3D '{0x00}'=0D else:=0D for I in range((TmpValue.bit_length() + 7) // = 8):=0D - TmpList.append('0x%02x' % ((TmpValue >> I = * 8) & 0xff))=0D + TmpList.append('0x%02x' %=0D + ((TmpValue >> I * 8) & 0xff= ))=0D PcdValue =3D '{' + ', '.join(TmpList) + '}'=0D except:=0D if PcdValue.strip().startswith('{'):=0D - PcdValueList =3D SplitPcdValueString(PcdValue.= strip()[1:-1])=0D + PcdValueList =3D SplitPcdValueString(=0D + PcdValue.strip()[1:-1])=0D LabelDict =3D {}=0D NewPcdValueList =3D []=0D LabelOffset =3D 0=0D @@ -930,7 +961,8 @@ class ValueExpressionEx(ValueExpression): if LabelList:=0D for Label in LabelList:=0D if not IsValidCName(Label):=0D - raise BadExpression('%s is not= a valid c variable name' % Label)=0D + raise BadExpression(=0D + '%s is not a valid c varia= ble name' % Label)=0D if Label not in LabelDict:=0D LabelDict[Label] =3D str(Label= Offset)=0D if Item.startswith(TAB_UINT8):=0D @@ -943,7 +975,8 @@ class ValueExpressionEx(ValueExpression): LabelOffset =3D LabelOffset + 8=0D else:=0D try:=0D - ItemValue, ItemSize =3D ParseField= Value(Item)=0D + ItemValue, ItemSize =3D ParseField= Value(=0D + Item)=0D LabelOffset =3D LabelOffset + Item= Size=0D except:=0D LabelOffset =3D LabelOffset + 1=0D @@ -962,9 +995,11 @@ class ValueExpressionEx(ValueExpression): # replace each offset, except errors=0D for Offset in OffsetList:=0D try:=0D - Item =3D Item.replace('OFFSET_OF({= })'.format(Offset), LabelDict[Offset])=0D + Item =3D Item.replace('OFFSET_OF({= })'.format(=0D + Offset), LabelDict[Offset])=0D except:=0D - raise BadExpression('%s not define= d' % Offset)=0D + raise BadExpression(=0D + '%s not defined' % Offset)=0D =0D NewPcdValueList.append(Item)=0D =0D @@ -975,13 +1010,16 @@ class ValueExpressionEx(ValueExpression): TokenSpaceGuidName =3D ''=0D if Item.startswith(TAB_GUID) and Item.ends= with(')'):=0D try:=0D - TokenSpaceGuidName =3D re.search('= GUID\((\w+)\)', Item).group(1)=0D + TokenSpaceGuidName =3D re.search(= =0D + 'GUID\((\w+)\)', Item).group(1= )=0D except:=0D pass=0D if TokenSpaceGuidName and TokenSpaceGu= idName in self._Symb:=0D - Item =3D 'GUID(' + self._Symb[Toke= nSpaceGuidName] + ')'=0D + Item =3D 'GUID(' + \=0D + self._Symb[TokenSpaceGuidName]= + ')'=0D elif TokenSpaceGuidName:=0D - raise BadExpression('%s not found = in DEC file' % TokenSpaceGuidName)=0D + raise BadExpression(=0D + '%s not found in DEC file' % T= okenSpaceGuidName)=0D Item, Size =3D ParseFieldValue(Item)=0D for Index in range(0, Size):=0D ValueStr =3D '0x%02X' % (int(Item)= & 255)=0D @@ -1009,26 +1047,34 @@ class ValueExpressionEx(ValueExpression): else:=0D ItemSize =3D 0=0D if ValueType:=0D - TmpValue =3D ValueExpressionEx(Ite= m, ValueType, self._Symb)(True)=0D + TmpValue =3D ValueExpressionEx(=0D + Item, ValueType, self._Symb)(T= rue)=0D else:=0D - TmpValue =3D ValueExpressionEx(Ite= m, self.PcdType, self._Symb)(True)=0D - Item =3D '0x%x' % TmpValue if not isin= stance(TmpValue, type('')) else TmpValue=0D + TmpValue =3D ValueExpressionEx(=0D + Item, self.PcdType, self._Symb= )(True)=0D + Item =3D '0x%x' % TmpValue if not isin= stance(=0D + TmpValue, type('')) else TmpValue= =0D if ItemSize =3D=3D 0:=0D - ItemValue, ItemSize =3D ParseField= Value(Item)=0D + ItemValue, ItemSize =3D ParseField= Value(=0D + Item)=0D if Item[0] not in {'"', 'L', '{'} = and ItemSize > 1:=0D - raise BadExpression("Byte arr= ay number %s should less than 0xFF." % Item)=0D + raise BadExpression(=0D + "Byte array number %s sho= uld less than 0xFF." % Item)=0D else:=0D ItemValue =3D ParseFieldValue(Item= )[0]=0D for I in range(0, ItemSize):=0D - ValueStr =3D '0x%02X' % (int(ItemV= alue) & 255)=0D + ValueStr =3D '0x%02X' % (=0D + int(ItemValue) & 255)=0D ItemValue >>=3D 8=0D AllPcdValueList.append(ValueStr)=0D Size +=3D ItemSize=0D =0D if Size > 0:=0D - PcdValue =3D '{' + ','.join(AllPcdValueLis= t) + '}'=0D + PcdValue =3D '{' + \=0D + ','.join(AllPcdValueList) + '}'=0D else:=0D - raise BadExpression("Type: %s, Value: %s, %s"= %(self.PcdType, PcdValue, Value))=0D + raise BadExpression("Type: %s, Value: %s, %s" = % (=0D + self.PcdType, PcdValue, Value))=0D =0D if PcdValue =3D=3D 'True':=0D PcdValue =3D '1'=0D @@ -1038,6 +1084,7 @@ class ValueExpressionEx(ValueExpression): if RealValue:=0D return PcdValue=0D =0D +=0D if __name__ =3D=3D '__main__':=0D pass=0D while True:=0D diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sourc= e/Python/Common/GlobalData.py index 197bd8366682..34cd90987566 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common static strings used by INF/DEC/DSC fi= les=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -35,32 +35,35 @@ gGuidDict =3D {} # definition for a MACRO name. used to create regular expressions below.= =0D _MacroNamePattern =3D "[A-Z][A-Z0-9_]*"=0D =0D -## Regular expression for matching macro used in DSC/DEC/INF file inclusio= n=0D -gMacroRefPattern =3D re.compile("\$\(({})\)".format(_MacroNamePattern), re= .UNICODE)=0D +# Regular expression for matching macro used in DSC/DEC/INF file inclusion= =0D +gMacroRefPattern =3D re.compile(=0D + "\$\(({})\)".format(_MacroNamePattern), re.UNICODE)=0D gMacroDefPattern =3D re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")=0D gMacroNamePattern =3D re.compile("^{}$".format(_MacroNamePattern))=0D =0D # definition for a GUID. used to create regular expressions below.=0D _HexChar =3D r"[0-9a-fA-F]"=0D -_GuidPattern =3D r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}= ".format(Hex=3D_HexChar)=0D +_GuidPattern =3D r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}= ".format(=0D + Hex=3D_HexChar)=0D =0D -## Regular expressions for GUID matching=0D +# Regular expressions for GUID matching=0D gGuidPattern =3D re.compile(r'{}'.format(_GuidPattern))=0D gGuidPatternEnd =3D re.compile(r'{}$'.format(_GuidPattern))=0D =0D -## Regular expressions for HEX matching=0D +# Regular expressions for HEX matching=0D g4HexChar =3D re.compile(r'{}{{4}}'.format(_HexChar))=0D gHexPattern =3D re.compile(r'0[xX]{}+'.format(_HexChar))=0D gHexPatternAll =3D re.compile(r'0[xX]{}+$'.format(_HexChar))=0D =0D -## Regular expressions for string identifier checking=0D +# Regular expressions for string identifier checking=0D gIdentifierPattern =3D re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)=0D -## Regular expression for GUID c structure format=0D +# Regular expression for GUID c structure format=0D _GuidCFormatPattern =3D r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s= *,\s*0[xX]{Hex}{{1,4}}" \=0D r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,= 2}}" \=0D r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" = \=0D r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" = \=0D - r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s= *}}\s*}}".format(Hex=3D_HexChar)=0D + r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s= *}}\s*}}".format(=0D + Hex=3D_HexChar)=0D gGuidCFormatPattern =3D re.compile(r"{}".format(_GuidCFormatPattern))=0D =0D #=0D @@ -98,7 +101,7 @@ MixedPcd =3D {} =0D # Structure Pcd dict=0D gStructurePcd =3D {}=0D -gPcdSkuOverrides=3D{}=0D +gPcdSkuOverrides =3D {}=0D # Pcd name for the Pcd which used in the Conditional directives=0D gConditionalPcds =3D []=0D =0D @@ -122,4 +125,3 @@ gEnableGenfdsMultiThread =3D True gSikpAutoGenCache =3D set()=0D # Common lock for the file access in multiple process AutoGens=0D file_lock =3D None=0D -=0D diff --git a/BaseTools/Source/Python/Common/LongFilePathOs.py b/BaseTools/S= ource/Python/Common/LongFilePathOs.py index 190f36d7ec15..1f205ce14231 100644 --- a/BaseTools/Source/Python/Common/LongFilePathOs.py +++ b/BaseTools/Source/Python/Common/LongFilePathOs.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Override built in module os to provide support for long file path=0D #=0D # Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,46 +13,58 @@ import time =0D path =3D LongFilePathOsPath=0D =0D +=0D def access(path, mode):=0D return os.access(LongFilePath(path), mode)=0D =0D +=0D def remove(path):=0D - Timeout =3D 0.0=0D - while Timeout < 5.0:=0D - try:=0D - return os.remove(LongFilePath(path))=0D - except:=0D - time.sleep(0.1)=0D - Timeout =3D Timeout + 0.1=0D - return os.remove(LongFilePath(path))=0D + Timeout =3D 0.0=0D + while Timeout < 5.0:=0D + try:=0D + return os.remove(LongFilePath(path))=0D + except:=0D + time.sleep(0.1)=0D + Timeout =3D Timeout + 0.1=0D + return os.remove(LongFilePath(path))=0D +=0D =0D def removedirs(name):=0D return os.removedirs(LongFilePath(name))=0D =0D +=0D def rmdir(path):=0D return os.rmdir(LongFilePath(path))=0D =0D +=0D def mkdir(path):=0D return os.mkdir(LongFilePath(path))=0D =0D +=0D def makedirs(name, mode=3D0o777):=0D return os.makedirs(LongFilePath(name), mode)=0D =0D +=0D def rename(old, new):=0D return os.rename(LongFilePath(old), LongFilePath(new))=0D =0D +=0D def chdir(path):=0D return os.chdir(LongFilePath(path))=0D =0D +=0D def chmod(path, mode):=0D return os.chmod(LongFilePath(path), mode)=0D =0D +=0D def stat(path):=0D return os.stat(LongFilePath(path))=0D =0D +=0D def utime(path, times):=0D return os.utime(LongFilePath(path), times)=0D =0D +=0D def listdir(path):=0D List =3D []=0D uList =3D os.listdir(u"%s" % LongFilePath(path))=0D @@ -60,6 +72,7 @@ def listdir(path): List.append(Item)=0D return List=0D =0D +=0D if hasattr(os, 'replace'):=0D def replace(src, dst):=0D return os.replace(LongFilePath(src), LongFilePath(dst))=0D diff --git a/BaseTools/Source/Python/Common/LongFilePathOsPath.py b/BaseToo= ls/Source/Python/Common/LongFilePathOsPath.py index 60a053652550..543ecb1b7bcd 100644 --- a/BaseTools/Source/Python/Common/LongFilePathOsPath.py +++ b/BaseTools/Source/Python/Common/LongFilePathOsPath.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Override built in module os.path to provide support for long file path=0D #=0D # Copyright (c) 2014, Intel Corporation. All rights reserved.
        =0D @@ -8,27 +8,35 @@ import os=0D from Common.LongFilePathSupport import LongFilePath=0D =0D +=0D def isfile(path):=0D return os.path.isfile(LongFilePath(path))=0D =0D +=0D def isdir(path):=0D return os.path.isdir(LongFilePath(path))=0D =0D +=0D def exists(path):=0D return os.path.exists(LongFilePath(path))=0D =0D +=0D def getsize(filename):=0D return os.path.getsize(LongFilePath(filename))=0D =0D +=0D def getmtime(filename):=0D return os.path.getmtime(LongFilePath(filename))=0D =0D +=0D def getatime(filename):=0D return os.path.getatime(LongFilePath(filename))=0D =0D +=0D def getctime(filename):=0D return os.path.getctime(LongFilePath(filename))=0D =0D +=0D join =3D os.path.join=0D splitext =3D os.path.splitext=0D splitdrive =3D os.path.splitdrive=0D diff --git a/BaseTools/Source/Python/Common/LongFilePathSupport.py b/BaseTo= ols/Source/Python/Common/LongFilePathSupport.py index 38c4396544cc..ca6962e0a177 100644 --- a/BaseTools/Source/Python/Common/LongFilePathSupport.py +++ b/BaseTools/Source/Python/Common/LongFilePathSupport.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Override built in function file.open to provide support for long file pa= th=0D #=0D # Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
        =0D @@ -14,6 +14,8 @@ import codecs # OpenLongPath=0D # Convert a file path to a long file path=0D #=0D +=0D +=0D def LongFilePath(FileName):=0D FileName =3D os.path.normpath(FileName)=0D if platform.system() =3D=3D 'Windows':=0D @@ -29,9 +31,12 @@ def LongFilePath(FileName): # OpenLongFilePath=0D # wrap open to support opening a long file path=0D #=0D -def OpenLongFilePath(FileName, Mode=3D'r', Buffer=3D -1):=0D +=0D +=0D +def OpenLongFilePath(FileName, Mode=3D'r', Buffer=3D-1):=0D return open(LongFilePath(FileName), Mode, Buffer)=0D =0D +=0D def CodecOpenLongFilePath(Filename, Mode=3D'rb', Encoding=3DNone, Errors= =3D'strict', Buffering=3D1):=0D return codecs.open(LongFilePath(Filename), Mode, Encoding, Errors, Buf= fering)=0D =0D @@ -39,6 +44,8 @@ def CodecOpenLongFilePath(Filename, Mode=3D'rb', Encoding= =3DNone, Errors=3D'strict', B # CopyLongFilePath=0D # wrap copyfile to support copy a long file path=0D #=0D +=0D +=0D def CopyLongFilePath(src, dst):=0D with open(LongFilePath(src), 'rb') as fsrc:=0D with open(LongFilePath(dst), 'wb') as fdst:=0D diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Pyth= on/Common/Misc.py index 4be7957138a5..4dcf72d37e28 100755 --- a/BaseTools/Source/Python/Common/Misc.py +++ b/BaseTools/Source/Python/Common/Misc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Common routines used by all tools=0D #=0D # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
        =0D @@ -42,19 +42,22 @@ from Common.caching import cached_property import struct=0D =0D ArrayIndex =3D re.compile("\[\s*[0-9a-fA-FxX]*\s*\]")=0D -## Regular expression used to find out place holders in string template=0D -gPlaceholderPattern =3D re.compile("\$\{([^$()\s]+)\}", re.MULTILINE | re.= UNICODE)=0D +# Regular expression used to find out place holders in string template=0D +gPlaceholderPattern =3D re.compile(=0D + "\$\{([^$()\s]+)\}", re.MULTILINE | re.UNICODE)=0D =0D -## regular expressions for map file processing=0D +# regular expressions for map file processing=0D startPatternGeneral =3D re.compile("^Start[' ']+Length[' ']+Name[' ']+Clas= s")=0D -addressPatternGeneral =3D re.compile("^Address[' ']+Publics by Value[' ']+= Rva\+Base")=0D +addressPatternGeneral =3D re.compile(=0D + "^Address[' ']+Publics by Value[' ']+Rva\+Base")=0D valuePatternGcc =3D re.compile('^([\w_\.]+) +([\da-fA-Fx]+) +([\da-fA-Fx]+= )$')=0D pcdPatternGcc =3D re.compile('^([\da-fA-Fx]+) +([\da-fA-Fx]+)')=0D -secReGeneral =3D re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[H= h]? +([.\w\$]+) +(\w+)', re.UNICODE)=0D +secReGeneral =3D re.compile(=0D + '^([\da-fA-F]+):([\da-fA-F]+) +([\da-fA-F]+)[Hh]? +([.\w\$]+) +(\w+)',= re.UNICODE)=0D =0D StructPattern =3D re.compile(r'[_a-zA-Z][0-9A-Za-z_]*$')=0D =0D -## Dictionary used to store dependencies of files=0D +# Dictionary used to store dependencies of files=0D gDependencyDatabase =3D {} # arch : {file path : [dependent files list]= }=0D =0D #=0D @@ -64,6 +67,7 @@ gDependencyDatabase =3D {} # arch : {file path : [depe= ndent files list]} #=0D _TempInfs =3D []=0D =0D +=0D def GetVariableOffset(mapfilepath, efifilepath, varnames):=0D """ Parse map file to get variable offset in current EFI file=0D @param mapfilepath Map file absolution path=0D @@ -80,35 +84,39 @@ def GetVariableOffset(mapfilepath, efifilepath, varname= s): except:=0D return None=0D =0D - if len(lines) =3D=3D 0: return None=0D + if len(lines) =3D=3D 0:=0D + return None=0D firstline =3D lines[0].strip()=0D if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firs= tline):=0D return _parseForXcodeAndClang9(lines, efifilepath, varnames)=0D if (firstline.startswith("Archive member included ") and=0D - firstline.endswith(" file (symbol)")):=0D + firstline.endswith(" file (symbol)")):=0D return _parseForGCC(lines, efifilepath, varnames)=0D if firstline.startswith("# Path:"):=0D return _parseForXcodeAndClang9(lines, efifilepath, varnames)=0D return _parseGeneral(lines, efifilepath, varnames)=0D =0D +=0D def _parseForXcodeAndClang9(lines, efifilepath, varnames):=0D status =3D 0=0D ret =3D []=0D for line in lines:=0D line =3D line.strip()=0D - if status =3D=3D 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out= \s*In\s*Symbol\s*$', line) \=0D - or line =3D=3D "# Symbols:"):=0D + if status =3D=3D 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out= \s*In\s*Symbol\s*$', line)=0D + or line =3D=3D "# Symbols:"):=0D status =3D 1=0D continue=0D if status =3D=3D 1 and len(line) !=3D 0:=0D for varname in varnames:=0D if varname in line:=0D # cannot pregenerate this RegEx since it uses varname = from varnames.=0D - m =3D re.match('^([\da-fA-FxX]+)([\s\S]*)([_]*%s)$' % = varname, line)=0D + m =3D re.match(=0D + '^([\da-fA-FxX]+)([\s\S]*)([_]*%s)$' % varname, li= ne)=0D if m is not None:=0D ret.append((varname, m.group(1)))=0D return ret=0D =0D +=0D def _parseForGCC(lines, efifilepath, varnames):=0D """ Parse map file generated by GCC linker """=0D status =3D 0=0D @@ -123,7 +131,7 @@ def _parseForGCC(lines, efifilepath, varnames): elif status =3D=3D 1 and line =3D=3D 'Linker script and memory map= ':=0D status =3D 2=0D continue=0D - elif status =3D=3D2 and line =3D=3D 'START GROUP':=0D + elif status =3D=3D 2 and line =3D=3D 'START GROUP':=0D status =3D 3=0D continue=0D =0D @@ -144,7 +152,8 @@ def _parseForGCC(lines, efifilepath, varnames): if Str:=0D m =3D pcdPatternGcc.match(Str.strip())=0D if m is not None:=0D - varoffset.append((varname, int(m.groups(0)[0],= 16), int(sections[-1][1], 16), sections[-1][0]))=0D + varoffset.append((varname, int(m.groups(0)[0],= 16), int(=0D + sections[-1][1], 16), sections[-1][0]))=0D =0D if not varoffset:=0D return []=0D @@ -152,7 +161,7 @@ def _parseForGCC(lines, efifilepath, varnames): efisecs =3D PeImageClass(efifilepath).SectionHeaderList=0D if efisecs is None or len(efisecs) =3D=3D 0:=0D return []=0D - #redirection=0D + # redirection=0D redirection =3D 0=0D for efisec in efisecs:=0D for section in sections:=0D @@ -163,14 +172,17 @@ def _parseForGCC(lines, efifilepath, varnames): for var in varoffset:=0D for efisec in efisecs:=0D if var[1] >=3D efisec[1] and var[1] < efisec[1]+efisec[3]:=0D - ret.append((var[0], hex(efisec[2] + var[1] - efisec[1] - r= edirection)))=0D + ret.append(=0D + (var[0], hex(efisec[2] + var[1] - efisec[1] - redirect= ion)))=0D return ret=0D =0D +=0D def _parseGeneral(lines, efifilepath, varnames):=0D - status =3D 0 #0 - beginning of file; 1 - PE section definition; 2 -= symbol table=0D - secs =3D [] # key =3D section name=0D + status =3D 0 # 0 - beginning of file; 1 - PE section definition; 2 - = symbol table=0D + secs =3D [] # key =3D section name=0D varoffset =3D []=0D - symRe =3D re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$-]= +) +([\da-fA-F]+)', re.UNICODE)=0D + symRe =3D re.compile(=0D + '^([\da-fA-F]+):([\da-fA-F]+) +([\.:\\\\\w\?@\$-]+) +([\da-fA-F]+)= ', re.UNICODE)=0D =0D for line in lines:=0D line =3D line.strip()=0D @@ -184,27 +196,30 @@ def _parseGeneral(lines, efifilepath, varnames): status =3D 3=0D continue=0D if status =3D=3D 1 and len(line) !=3D 0:=0D - m =3D secReGeneral.match(line)=0D + m =3D secReGeneral.match(line)=0D assert m is not None, "Fail to parse the section in map file ,= line is %s" % line=0D sec_no, sec_start, sec_length, sec_name, sec_class =3D m.group= s(0)=0D - secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_leng= th, 16), sec_name, sec_class])=0D + secs.append([int(sec_no, 16), int(sec_start, 16),=0D + int(sec_length, 16), sec_name, sec_class])=0D if status =3D=3D 2 and len(line) !=3D 0:=0D for varname in varnames:=0D m =3D symRe.match(line)=0D assert m is not None, "Fail to parse the symbol in map fil= e, line is %s" % line=0D sec_no, sym_offset, sym_name, vir_addr =3D m.groups(0)=0D - sec_no =3D int(sec_no, 16)=0D + sec_no =3D int(sec_no, 16)=0D sym_offset =3D int(sym_offset, 16)=0D - vir_addr =3D int(vir_addr, 16)=0D + vir_addr =3D int(vir_addr, 16)=0D # cannot pregenerate this RegEx since it uses varname from= varnames.=0D m2 =3D re.match('^[_]*(%s)' % varname, sym_name)=0D if m2 is not None:=0D # fond a binary pcd entry in map file=0D for sec in secs:=0D if sec[0] =3D=3D sec_no and (sym_offset >=3D sec[1= ] and sym_offset < sec[1] + sec[2]):=0D - varoffset.append([varname, sec[3], sym_offset,= vir_addr, sec_no])=0D + varoffset.append(=0D + [varname, sec[3], sym_offset, vir_addr, se= c_no])=0D =0D - if not varoffset: return []=0D + if not varoffset:=0D + return []=0D =0D # get section information from efi file=0D efisecs =3D PeImageClass(efifilepath).SectionHeaderList=0D @@ -223,7 +238,7 @@ def _parseGeneral(lines, efifilepath, varnames): =0D return ret=0D =0D -## Routine to process duplicated INF=0D +# Routine to process duplicated INF=0D #=0D # This function is called by following two cases:=0D # Case 1 in DSC:=0D @@ -245,6 +260,8 @@ def _parseGeneral(lines, efifilepath, varnames): #=0D # @retval return the new PathClass object=0D #=0D +=0D +=0D def ProcessDuplicatedInf(Path, BaseName, Workspace):=0D Filename =3D os.path.split(Path.File)[1]=0D if '.' in Filename:=0D @@ -295,20 +312,24 @@ def ProcessDuplicatedInf(Path, BaseName, Workspace): shutil.copy2(str(Path), TempFullPath)=0D return RtPath=0D =0D -## Remove temporary created INFs whose paths were saved in _TempInfs=0D +# Remove temporary created INFs whose paths were saved in _TempInfs=0D #=0D +=0D +=0D def ClearDuplicatedInf():=0D while _TempInfs:=0D File =3D _TempInfs.pop()=0D if os.path.exists(File):=0D os.remove(File)=0D =0D -## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C = structure style=0D +# Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C s= tructure style=0D #=0D # @param Guid The GUID string=0D #=0D # @retval string The GUID string in C structure style=0D #=0D +=0D +=0D def GuidStringToGuidStructureString(Guid):=0D GuidList =3D Guid.split('-')=0D Result =3D '{'=0D @@ -320,100 +341,112 @@ def GuidStringToGuidStructureString(Guid): Result +=3D '}}'=0D return Result=0D =0D -## Convert GUID structure in byte array to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx= xxxxx=0D +# Convert GUID structure in byte array to xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx= xxxx=0D #=0D # @param GuidValue The GUID value in byte array=0D #=0D # @retval string The GUID value in xxxxxxxx-xxxx-xxxx-xxxx-xxxx= xxxxxxxx format=0D #=0D +=0D +=0D def GuidStructureByteArrayToGuidString(GuidValue):=0D - guidValueString =3D GuidValue.lower().replace("{", "").replace("}", ""= ).replace(" ", "").replace(";", "")=0D + guidValueString =3D GuidValue.lower().replace(=0D + "{", "").replace("}", "").replace(" ", "").replace(";", "")=0D guidValueList =3D guidValueString.split(",")=0D if len(guidValueList) !=3D 16:=0D return ''=0D #EdkLogger.error(None, None, "Invalid GUID value string %s" % Guid= Value)=0D try:=0D return "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%0= 2x%02x%02x" % (=0D - int(guidValueList[3], 16),=0D - int(guidValueList[2], 16),=0D - int(guidValueList[1], 16),=0D - int(guidValueList[0], 16),=0D - int(guidValueList[5], 16),=0D - int(guidValueList[4], 16),=0D - int(guidValueList[7], 16),=0D - int(guidValueList[6], 16),=0D - int(guidValueList[8], 16),=0D - int(guidValueList[9], 16),=0D - int(guidValueList[10], 16),=0D - int(guidValueList[11], 16),=0D - int(guidValueList[12], 16),=0D - int(guidValueList[13], 16),=0D - int(guidValueList[14], 16),=0D - int(guidValueList[15], 16)=0D - )=0D + int(guidValueList[3], 16),=0D + int(guidValueList[2], 16),=0D + int(guidValueList[1], 16),=0D + int(guidValueList[0], 16),=0D + int(guidValueList[5], 16),=0D + int(guidValueList[4], 16),=0D + int(guidValueList[7], 16),=0D + int(guidValueList[6], 16),=0D + int(guidValueList[8], 16),=0D + int(guidValueList[9], 16),=0D + int(guidValueList[10], 16),=0D + int(guidValueList[11], 16),=0D + int(guidValueList[12], 16),=0D + int(guidValueList[13], 16),=0D + int(guidValueList[14], 16),=0D + int(guidValueList[15], 16)=0D + )=0D except:=0D return ''=0D =0D -## Convert GUID string in C structure style to xxxxxxxx-xxxx-xxxx-xxxx-xxx= xxxxxxxxx=0D +# Convert GUID string in C structure style to xxxxxxxx-xxxx-xxxx-xxxx-xxxx= xxxxxxxx=0D #=0D # @param GuidValue The GUID value in C structure format=0D #=0D # @retval string The GUID value in xxxxxxxx-xxxx-xxxx-xxxx-xxxx= xxxxxxxx format=0D #=0D +=0D +=0D def GuidStructureStringToGuidString(GuidValue):=0D if not GlobalData.gGuidCFormatPattern.match(GuidValue):=0D return ''=0D - guidValueString =3D GuidValue.lower().replace("{", "").replace("}", ""= ).replace(" ", "").replace(";", "")=0D + guidValueString =3D GuidValue.lower().replace(=0D + "{", "").replace("}", "").replace(" ", "").replace(";", "")=0D guidValueList =3D guidValueString.split(",")=0D if len(guidValueList) !=3D 11:=0D return ''=0D #EdkLogger.error(None, None, "Invalid GUID value string %s" % Guid= Value)=0D try:=0D return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (=0D - int(guidValueList[0], 16),=0D - int(guidValueList[1], 16),=0D - int(guidValueList[2], 16),=0D - int(guidValueList[3], 16),=0D - int(guidValueList[4], 16),=0D - int(guidValueList[5], 16),=0D - int(guidValueList[6], 16),=0D - int(guidValueList[7], 16),=0D - int(guidValueList[8], 16),=0D - int(guidValueList[9], 16),=0D - int(guidValueList[10], 16)=0D - )=0D + int(guidValueList[0], 16),=0D + int(guidValueList[1], 16),=0D + int(guidValueList[2], 16),=0D + int(guidValueList[3], 16),=0D + int(guidValueList[4], 16),=0D + int(guidValueList[5], 16),=0D + int(guidValueList[6], 16),=0D + int(guidValueList[7], 16),=0D + int(guidValueList[8], 16),=0D + int(guidValueList[9], 16),=0D + int(guidValueList[10], 16)=0D + )=0D except:=0D return ''=0D =0D -## Convert GUID string in C structure style to xxxxxxxx_xxxx_xxxx_xxxx_xxx= xxxxxxxxx=0D +# Convert GUID string in C structure style to xxxxxxxx_xxxx_xxxx_xxxx_xxxx= xxxxxxxx=0D #=0D # @param GuidValue The GUID value in C structure format=0D #=0D # @retval string The GUID value in xxxxxxxx_xxxx_xxxx_xxxx_xxxx= xxxxxxxx format=0D #=0D +=0D +=0D def GuidStructureStringToGuidValueName(GuidValue):=0D - guidValueString =3D GuidValue.lower().replace("{", "").replace("}", ""= ).replace(" ", "")=0D + guidValueString =3D GuidValue.lower().replace(=0D + "{", "").replace("}", "").replace(" ", "")=0D guidValueList =3D guidValueString.split(",")=0D if len(guidValueList) !=3D 11:=0D - EdkLogger.error(None, FORMAT_INVALID, "Invalid GUID value string [= %s]" % GuidValue)=0D + EdkLogger.error(None, FORMAT_INVALID,=0D + "Invalid GUID value string [%s]" % GuidValue)=0D return "%08x_%04x_%04x_%02x%02x_%02x%02x%02x%02x%02x%02x" % (=0D - int(guidValueList[0], 16),=0D - int(guidValueList[1], 16),=0D - int(guidValueList[2], 16),=0D - int(guidValueList[3], 16),=0D - int(guidValueList[4], 16),=0D - int(guidValueList[5], 16),=0D - int(guidValueList[6], 16),=0D - int(guidValueList[7], 16),=0D - int(guidValueList[8], 16),=0D - int(guidValueList[9], 16),=0D - int(guidValueList[10], 16)=0D - )=0D + int(guidValueList[0], 16),=0D + int(guidValueList[1], 16),=0D + int(guidValueList[2], 16),=0D + int(guidValueList[3], 16),=0D + int(guidValueList[4], 16),=0D + int(guidValueList[5], 16),=0D + int(guidValueList[6], 16),=0D + int(guidValueList[7], 16),=0D + int(guidValueList[8], 16),=0D + int(guidValueList[9], 16),=0D + int(guidValueList[10], 16)=0D + )=0D =0D -## Create directories=0D +# Create directories=0D #=0D # @param Directory The directory name=0D #=0D +=0D +=0D def CreateDirectory(Directory):=0D if Directory is None or Directory.strip() =3D=3D "":=0D return True=0D @@ -424,10 +457,12 @@ def CreateDirectory(Directory): return False=0D return True=0D =0D -## Remove directories, including files and sub-directories in it=0D +# Remove directories, including files and sub-directories in it=0D #=0D # @param Directory The directory name=0D #=0D +=0D +=0D def RemoveDirectory(Directory, Recursively=3DFalse):=0D if Directory is None or Directory.strip() =3D=3D "" or not os.path.exi= sts(Directory):=0D return=0D @@ -442,7 +477,7 @@ def RemoveDirectory(Directory, Recursively=3DFalse): os.chdir(CurrentDirectory)=0D os.rmdir(Directory)=0D =0D -## Store content in file=0D +# Store content in file=0D #=0D # This method is used to save file only when its content is changed. This= is=0D # quite useful for "make" system to decide what will be re-built and what= won't.=0D @@ -454,6 +489,8 @@ def RemoveDirectory(Directory, Recursively=3DFalse): # @retval True If the file content is changed and the fil= e is renewed=0D # @retval False If the file content is the same=0D #=0D +=0D +=0D def SaveFileOnChange(File, Content, IsBinaryFile=3DTrue, FileLock=3DNone):= =0D =0D # Convert to long file path format=0D @@ -477,12 +514,14 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3DTr= ue, FileLock=3DNone): =0D DirName =3D os.path.dirname(File)=0D if not CreateDirectory(DirName):=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, "Could not create direc= tory %s" % DirName)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + "Could not create directory %s" % DirName)=0D else:=0D if DirName =3D=3D '':=0D DirName =3D os.getcwd()=0D if not os.access(DirName, os.W_OK):=0D - EdkLogger.error(None, PERMISSION_FAILURE, "Do not have write p= ermission on directory %s" % DirName)=0D + EdkLogger.error(None, PERMISSION_FAILURE,=0D + "Do not have write permission on directory %s"= % DirName)=0D =0D OpenMode =3D "w"=0D if IsBinaryFile:=0D @@ -494,16 +533,17 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3DTr= ue, FileLock=3DNone): if FileLock:=0D FileLock.acquire()=0D =0D -=0D if GlobalData.gIsWindows and not os.path.exists(File):=0D try:=0D with open(File, OpenMode) as tf:=0D tf.write(Content)=0D except IOError as X:=0D if GlobalData.gBinCacheSource:=0D - EdkLogger.quiet("[cache error]:fails to save file with err= or: %s" % (X))=0D + EdkLogger.quiet(=0D + "[cache error]:fails to save file with error: %s" % (X= ))=0D else:=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=3D'IO= Error %s' % X)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + ExtraData=3D'IOError %s' % X)=0D finally:=0D if FileLock:=0D FileLock.release()=0D @@ -513,16 +553,18 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3DTr= ue, FileLock=3DNone): Fd.write(Content)=0D except IOError as X:=0D if GlobalData.gBinCacheSource:=0D - EdkLogger.quiet("[cache error]:fails to save file with err= or: %s" % (X))=0D + EdkLogger.quiet(=0D + "[cache error]:fails to save file with error: %s" % (X= ))=0D else:=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData=3D'IO= Error %s' % X)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + ExtraData=3D'IOError %s' % X)=0D finally:=0D if FileLock:=0D FileLock.release()=0D =0D return True=0D =0D -## Copy source file only if it is different from the destination file=0D +# Copy source file only if it is different from the destination file=0D #=0D # This method is used to copy file only if the source file and destinatio= n=0D # file content are different. This is quite useful to avoid duplicated=0D @@ -534,6 +576,8 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3DTrue= , FileLock=3DNone): # @retval True The two files content are different and the file= is copied=0D # @retval False No copy really happen=0D #=0D +=0D +=0D def CopyFileOnChange(SrcFile, Dst, FileLock=3DNone):=0D =0D # Convert to long file path format=0D @@ -541,7 +585,8 @@ def CopyFileOnChange(SrcFile, Dst, FileLock=3DNone): Dst =3D LongFilePath(Dst)=0D =0D if os.path.isdir(SrcFile):=0D - EdkLogger.error(None, FILE_COPY_FAILURE, ExtraData=3D'CopyFileOnCh= ange SrcFile is a dir, not a file: %s' % SrcFile)=0D + EdkLogger.error(None, FILE_COPY_FAILURE,=0D + ExtraData=3D'CopyFileOnChange SrcFile is a dir, no= t a file: %s' % SrcFile)=0D return False=0D =0D if os.path.isdir(Dst):=0D @@ -554,12 +599,14 @@ def CopyFileOnChange(SrcFile, Dst, FileLock=3DNone): =0D DirName =3D os.path.dirname(DstFile)=0D if not CreateDirectory(DirName):=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, "Could not create direc= tory %s" % DirName)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + "Could not create directory %s" % DirName)=0D else:=0D if DirName =3D=3D '':=0D DirName =3D os.getcwd()=0D if not os.access(DirName, os.W_OK):=0D - EdkLogger.error(None, PERMISSION_FAILURE, "Do not have write p= ermission on directory %s" % DirName)=0D + EdkLogger.error(None, PERMISSION_FAILURE,=0D + "Do not have write permission on directory %s"= % DirName)=0D =0D # use default file_lock if no input new lock=0D if not FileLock:=0D @@ -571,22 +618,26 @@ def CopyFileOnChange(SrcFile, Dst, FileLock=3DNone): CopyLong(SrcFile, DstFile)=0D except IOError as X:=0D if GlobalData.gBinCacheSource:=0D - EdkLogger.quiet("[cache error]:fails to copy file with error: = %s" % (X))=0D + EdkLogger.quiet(=0D + "[cache error]:fails to copy file with error: %s" % (X))=0D else:=0D - EdkLogger.error(None, FILE_COPY_FAILURE, ExtraData=3D'IOError = %s' % X)=0D + EdkLogger.error(None, FILE_COPY_FAILURE,=0D + ExtraData=3D'IOError %s' % X)=0D finally:=0D if FileLock:=0D FileLock.release()=0D =0D return True=0D =0D -## Retrieve and cache the real path name in file system=0D +# Retrieve and cache the real path name in file system=0D #=0D # @param Root The root directory of path relative to=0D #=0D # @retval str The path string if the path exists=0D # @retval None If path doesn't exist=0D #=0D +=0D +=0D class DirCache:=0D _CACHE_ =3D set()=0D _UPPER_CACHE_ =3D {}=0D @@ -651,6 +702,7 @@ class DirCache: return os.path.join(self._Root, self._UPPER_CACHE_[UpperPath])= =0D return None=0D =0D +=0D def RealPath(File, Dir=3D'', OverrideDir=3D''):=0D NewFile =3D os.path.normpath(os.path.join(Dir, File))=0D NewFile =3D GlobalData.gAllFiles[NewFile]=0D @@ -659,7 +711,7 @@ def RealPath(File, Dir=3D'', OverrideDir=3D''): NewFile =3D GlobalData.gAllFiles[NewFile]=0D return NewFile=0D =0D -## Get GUID value from given packages=0D +# Get GUID value from given packages=0D #=0D # @param CName The CName of the GUID=0D # @param PackageList List of packages looking-up in=0D @@ -668,7 +720,9 @@ def RealPath(File, Dir=3D'', OverrideDir=3D''): # @retval GuidValue if the CName is found in any given package=0D # @retval None if the CName is not found in all given package= s=0D #=0D -def GuidValue(CName, PackageList, Inffile =3D None):=0D +=0D +=0D +def GuidValue(CName, PackageList, Inffile=3DNone):=0D for P in PackageList:=0D GuidKeys =3D list(P.Guids.keys())=0D if Inffile and P._PrivateGuids:=0D @@ -678,7 +732,7 @@ def GuidValue(CName, PackageList, Inffile =3D None): return P.Guids[CName]=0D return None=0D =0D -## A string template class=0D +# A string template class=0D #=0D # This class implements a template for string replacement. A string templ= ate=0D # looks like following=0D @@ -691,6 +745,8 @@ def GuidValue(CName, PackageList, Inffile =3D None): # be not used and, in this case, the "placeholder_name" must not a list a= nd it=0D # will just be replaced once.=0D #=0D +=0D +=0D class TemplateString(object):=0D _REPEAT_START_FLAG =3D "BEGIN"=0D _REPEAT_END_FLAG =3D "END"=0D @@ -712,12 +768,14 @@ class TemplateString(object): # PlaceHolderName, PlaceHolderStartPoint, PlaceHolderEnd= Point=0D #=0D for PlaceHolder, Start, End in PlaceHolderList:=0D - self._SubSectionList.append(TemplateSection[SubSection= Start:Start])=0D + self._SubSectionList.append(=0D + TemplateSection[SubSectionStart:Start])=0D self._SubSectionList.append(TemplateSection[Start:End]= )=0D self._PlaceHolderList.append(PlaceHolder)=0D SubSectionStart =3D End=0D if SubSectionStart < len(TemplateSection):=0D - self._SubSectionList.append(TemplateSection[SubSection= Start:])=0D + self._SubSectionList.append(=0D + TemplateSection[SubSectionStart:])=0D else:=0D self._SubSectionList =3D [TemplateSection]=0D =0D @@ -738,11 +796,11 @@ class TemplateString(object): RepeatTime =3D len(Value)=0D elif RepeatTime !=3D len(Value):=0D EdkLogger.error(=0D - "TemplateString",=0D - PARAMETER_INVALID,=0D - "${%s} has different repeat time from = others!" % PlaceHolder,=0D - ExtraData=3Dstr(self._Template)=0D - )=0D + "TemplateString",=0D + PARAMETER_INVALID,=0D + "${%s} has different repeat time from others!"= % PlaceHolder,=0D + ExtraData=3Dstr(self._Template)=0D + )=0D RepeatPlaceHolders["${%s}" % PlaceHolder] =3D Value=0D else:=0D NonRepeatPlaceHolders["${%s}" % PlaceHolder] =3D Value= =0D @@ -764,26 +822,27 @@ class TemplateString(object): if S not in RepeatPlaceHolders:=0D TempStringList.append(S)=0D else:=0D - TempStringList.append(str(RepeatPlaceHolders[S= ][Index]))=0D + TempStringList.append(=0D + str(RepeatPlaceHolders[S][Index]))=0D StringList =3D TempStringList=0D =0D return "".join(StringList)=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Template=3DNone):=0D self.String =3D []=0D self.IsBinary =3D False=0D self._Template =3D Template=0D self._TemplateSectionList =3D self._Parse(Template)=0D =0D - ## str() operator=0D + # str() operator=0D #=0D # @retval string The string replaced=0D #=0D def __str__(self):=0D return "".join(self.String)=0D =0D - ## Split the template string into fragments per the ${BEGIN} and ${END= } flags=0D + # Split the template string into fragments per the ${BEGIN} and ${END}= flags=0D #=0D # @retval list A list of TemplateString.Section objects=0D #=0D @@ -797,7 +856,8 @@ class TemplateString(object): MatchObj =3D gPlaceholderPattern.search(Template, SearchFrom)= =0D if not MatchObj:=0D if MatchEnd <=3D len(Template):=0D - TemplateSection =3D TemplateString.Section(Template[Se= ctionStart:], PlaceHolderList)=0D + TemplateSection =3D TemplateString.Section(=0D + Template[SectionStart:], PlaceHolderList)=0D TemplateSectionList.append(TemplateSection)=0D break=0D =0D @@ -807,21 +867,24 @@ class TemplateString(object): =0D if MatchString =3D=3D self._REPEAT_START_FLAG:=0D if MatchStart > SectionStart:=0D - TemplateSection =3D TemplateString.Section(Template[Se= ctionStart:MatchStart], PlaceHolderList)=0D + TemplateSection =3D TemplateString.Section(=0D + Template[SectionStart:MatchStart], PlaceHolderList= )=0D TemplateSectionList.append(TemplateSection)=0D SectionStart =3D MatchEnd=0D PlaceHolderList =3D []=0D elif MatchString =3D=3D self._REPEAT_END_FLAG:=0D - TemplateSection =3D TemplateString.Section(Template[Sectio= nStart:MatchStart], PlaceHolderList)=0D + TemplateSection =3D TemplateString.Section(=0D + Template[SectionStart:MatchStart], PlaceHolderList)=0D TemplateSectionList.append(TemplateSection)=0D SectionStart =3D MatchEnd=0D PlaceHolderList =3D []=0D else:=0D - PlaceHolderList.append((MatchString, MatchStart - SectionS= tart, MatchEnd - SectionStart))=0D + PlaceHolderList.append(=0D + (MatchString, MatchStart - SectionStart, MatchEnd - Se= ctionStart))=0D SearchFrom =3D MatchEnd=0D return TemplateSectionList=0D =0D - ## Replace the string template with dictionary of placeholders and app= end it to previous one=0D + # Replace the string template with dictionary of placeholders and appe= nd it to previous one=0D #=0D # @param AppendString The string template to append=0D # @param Dictionary The placeholder dictionaries=0D @@ -829,14 +892,15 @@ class TemplateString(object): def Append(self, AppendString, Dictionary=3DNone):=0D if Dictionary:=0D SectionList =3D self._Parse(AppendString)=0D - self.String.append( "".join(S.Instantiate(Dictionary) for S in= SectionList))=0D + self.String.append("".join(S.Instantiate(Dictionary)=0D + for S in SectionList))=0D else:=0D - if isinstance(AppendString,list):=0D + if isinstance(AppendString, list):=0D self.String.extend(AppendString)=0D else:=0D self.String.append(AppendString)=0D =0D - ## Replace the string template with dictionary of placeholders=0D + # Replace the string template with dictionary of placeholders=0D #=0D # @param Dictionary The placeholder dictionaries=0D #=0D @@ -845,17 +909,19 @@ class TemplateString(object): def Replace(self, Dictionary=3DNone):=0D return "".join(S.Instantiate(Dictionary) for S in self._TemplateSe= ctionList)=0D =0D -## Progress indicator class=0D +# Progress indicator class=0D #=0D # This class makes use of thread to print progress on console.=0D #=0D +=0D +=0D class Progressor:=0D # for avoiding deadloop=0D _StopFlag =3D None=0D _ProgressThread =3D None=0D _CheckInterval =3D 0.25=0D =0D - ## Constructor=0D + # Constructor=0D #=0D # @param OpenMessage The string printed before progress cha= racters=0D # @param CloseMessage The string printed after progress char= acters=0D @@ -870,7 +936,7 @@ class Progressor: if Progressor._StopFlag is None:=0D Progressor._StopFlag =3D threading.Event()=0D =0D - ## Start to print progress character=0D + # Start to print progress character=0D #=0D # @param OpenMessage The string printed before progress cha= racters=0D #=0D @@ -879,11 +945,12 @@ class Progressor: self.PromptMessage =3D OpenMessage=0D Progressor._StopFlag.clear()=0D if Progressor._ProgressThread is None:=0D - Progressor._ProgressThread =3D threading.Thread(target=3Dself.= _ProgressThreadEntry)=0D + Progressor._ProgressThread =3D threading.Thread(=0D + target=3Dself._ProgressThreadEntry)=0D Progressor._ProgressThread.setDaemon(False)=0D Progressor._ProgressThread.start()=0D =0D - ## Stop printing progress character=0D + # Stop printing progress character=0D #=0D # @param CloseMessage The string printed after progress char= acters=0D #=0D @@ -894,7 +961,7 @@ class Progressor: self.Abort()=0D self.CodaMessage =3D OriginalCodaMessage=0D =0D - ## Thread entry method=0D + # Thread entry method=0D def _ProgressThreadEntry(self):=0D sys.stdout.write(self.PromptMessage + " ")=0D sys.stdout.flush()=0D @@ -909,7 +976,7 @@ class Progressor: sys.stdout.write(" " + self.CodaMessage + "\n")=0D sys.stdout.flush()=0D =0D - ## Abort the progress display=0D + # Abort the progress display=0D @staticmethod=0D def Abort():=0D if Progressor._StopFlag is not None:=0D @@ -919,7 +986,7 @@ class Progressor: Progressor._ProgressThread =3D None=0D =0D =0D -## Dictionary using prioritized list as key=0D +# Dictionary using prioritized list as key=0D #=0D class tdict:=0D _ListType =3D type([])=0D @@ -957,7 +1024,7 @@ class tdict: =0D def _GetSingleValue(self, FirstKey, RestKeys):=0D Value =3D None=0D - #print "%s-%s" % (FirstKey, self._Level_) ,=0D + # print "%s-%s" % (FirstKey, self._Level_) ,=0D if self._Level_ > 1:=0D if FirstKey =3D=3D self._Wildcard:=0D if FirstKey in self.data:=0D @@ -965,12 +1032,13 @@ class tdict: if Value is None:=0D for Key in self.data:=0D Value =3D self.data[Key][RestKeys]=0D - if Value is not None: break=0D + if Value is not None:=0D + break=0D else:=0D if FirstKey in self.data:=0D Value =3D self.data[FirstKey][RestKeys]=0D if Value is None and self._Wildcard in self.data:=0D - #print "Value=3DNone"=0D + # print "Value=3DNone"=0D Value =3D self.data[self._Wildcard][RestKeys]=0D else:=0D if FirstKey =3D=3D self._Wildcard:=0D @@ -979,7 +1047,8 @@ class tdict: if Value is None:=0D for Key in self.data:=0D Value =3D self.data[Key]=0D - if Value is not None: break=0D + if Value is not None:=0D + break=0D else:=0D if FirstKey in self.data:=0D Value =3D self.data[FirstKey]=0D @@ -1057,6 +1126,7 @@ class tdict: keys |=3D self.data[Key].GetKeys(KeyIndex - 1)=0D return keys=0D =0D +=0D def AnalyzePcdExpression(Setting):=0D RanStr =3D ''.join(sample(string.ascii_letters + string.digits, 8))=0D Setting =3D Setting.replace('\\\\', RanStr).strip()=0D @@ -1094,20 +1164,22 @@ def AnalyzePcdExpression(Setting): StartPos =3D Pos + 1=0D for i, ch in enumerate(FieldList):=0D if RanStr in ch:=0D - FieldList[i] =3D ch.replace(RanStr,'\\\\')=0D + FieldList[i] =3D ch.replace(RanStr, '\\\\')=0D return FieldList=0D =0D -def ParseFieldValue (Value):=0D - def ParseDevPathValue (Value):=0D +=0D +def ParseFieldValue(Value):=0D + def ParseDevPathValue(Value):=0D if '\\' in Value:=0D Value.replace('\\', '/').replace(' ', '')=0D =0D Cmd =3D 'DevicePath ' + '"' + Value + '"'=0D try:=0D - p =3D subprocess.Popen(Cmd, stdout=3Dsubprocess.PIPE, stderr= =3Dsubprocess.PIPE, shell=3DTrue)=0D + p =3D subprocess.Popen(Cmd, stdout=3Dsubprocess.PIPE,=0D + stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D out, err =3D p.communicate()=0D except Exception as X:=0D - raise BadExpression("DevicePath: %s" % (str(X)) )=0D + raise BadExpression("DevicePath: %s" % (str(X)))=0D finally:=0D subprocess._cleanup()=0D p.stdout.close()=0D @@ -1124,27 +1196,31 @@ def ParseFieldValue (Value): if isinstance(Value, type(0)):=0D return Value, (Value.bit_length() + 7) // 8=0D if not isinstance(Value, type('')):=0D - raise BadExpression('Type %s is %s' %(Value, type(Value)))=0D + raise BadExpression('Type %s is %s' % (Value, type(Value)))=0D Value =3D Value.strip()=0D if Value.startswith(TAB_UINT8) and Value.endswith(')'):=0D Value, Size =3D ParseFieldValue(Value.split('(', 1)[1][:-1])=0D if Size > 1:=0D - raise BadExpression('Value (%s) Size larger than %d' %(Value, = Size))=0D + raise BadExpression(=0D + 'Value (%s) Size larger than %d' % (Value, Size))=0D return Value, 1=0D if Value.startswith(TAB_UINT16) and Value.endswith(')'):=0D Value, Size =3D ParseFieldValue(Value.split('(', 1)[1][:-1])=0D if Size > 2:=0D - raise BadExpression('Value (%s) Size larger than %d' %(Value, = Size))=0D + raise BadExpression(=0D + 'Value (%s) Size larger than %d' % (Value, Size))=0D return Value, 2=0D if Value.startswith(TAB_UINT32) and Value.endswith(')'):=0D Value, Size =3D ParseFieldValue(Value.split('(', 1)[1][:-1])=0D if Size > 4:=0D - raise BadExpression('Value (%s) Size larger than %d' %(Value, = Size))=0D + raise BadExpression(=0D + 'Value (%s) Size larger than %d' % (Value, Size))=0D return Value, 4=0D if Value.startswith(TAB_UINT64) and Value.endswith(')'):=0D Value, Size =3D ParseFieldValue(Value.split('(', 1)[1][:-1])=0D if Size > 8:=0D - raise BadExpression('Value (%s) Size larger than %d' % (Value,= Size))=0D + raise BadExpression(=0D + 'Value (%s) Size larger than %d' % (Value, Size))=0D return Value, 8=0D if Value.startswith(TAB_GUID) and Value.endswith(')'):=0D Value =3D Value.split('(', 1)[1][:-1].strip()=0D @@ -1158,7 +1234,7 @@ def ParseFieldValue (Value): try:=0D Value =3D uuid.UUID(Value).bytes_le=0D ValueL, ValueH =3D struct.unpack('2Q', Value)=0D - Value =3D (ValueH << 64 ) | ValueL=0D + Value =3D (ValueH << 64) | ValueL=0D =0D except ValueError as Message:=0D raise BadExpression(Message)=0D @@ -1257,7 +1333,7 @@ def ParseFieldValue (Value): return 0, 1=0D return Value, 1=0D =0D -## AnalyzeDscPcd=0D +# AnalyzeDscPcd=0D #=0D # Analyze DSC PCD value, since there is no data type info in DSC=0D # This function is used to match functions (AnalyzePcdData) used for retr= ieving PCD value from database=0D @@ -1282,6 +1358,8 @@ def ParseFieldValue (Value): # IsValid: True if conforming EBNF, otherwise False=0D # Index: The index where PcdValue is in ValueList=0D #=0D +=0D +=0D def AnalyzeDscPcd(Setting, PcdType, DataType=3D''):=0D FieldList =3D AnalyzePcdExpression(Setting)=0D =0D @@ -1350,7 +1428,7 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=3D''): return [HiiString, Guid, Offset, Value, Attribute], IsValid, 3=0D return [], False, 0=0D =0D -## AnalyzePcdData=0D +# AnalyzePcdData=0D #=0D # Analyze the pcd Value, Datum type and TokenNumber.=0D # Used to avoid split issue while the value string contain "|" character= =0D @@ -1359,6 +1437,8 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=3D''): #=0D # @retval ValueList: A List contain value, datum type and toke number.= =0D #=0D +=0D +=0D def AnalyzePcdData(Setting):=0D ValueList =3D ['', '', '']=0D =0D @@ -1379,18 +1459,21 @@ def AnalyzePcdData(Setting): =0D return ValueList=0D =0D -## check format of PCD value against its the datum type=0D +# check format of PCD value against its the datum type=0D #=0D # For PCD value setting=0D #=0D +=0D +=0D def CheckPcdDatum(Type, Value):=0D if Type =3D=3D TAB_VOID:=0D ValueRe =3D re.compile(r'\s*L?\".*\"\s*$')=0D if not (((Value.startswith('L"') or Value.startswith('"')) and Val= ue.endswith('"'))=0D or (Value.startswith('{') and Value.endswith('}')) or (Val= ue.startswith("L'") or Value.startswith("'") and Value.endswith("'"))=0D - ):=0D + ):=0D return False, "Invalid value [%s] of type [%s]; must be in the= form of {...} for array"\=0D - ", \"...\" or \'...\' for string, L\"...\" or L\= '...\' for unicode string" % (Value, Type)=0D + ", \"...\" or \'...\' for string, L\"...\" or L\= '...\' for unicode string" % (=0D + Value, Type)=0D elif ValueRe.match(Value):=0D # Check the chars in UnicodeString or CString is printable=0D if Value.startswith("L"):=0D @@ -1419,12 +1502,14 @@ def CheckPcdDatum(Type, Value): return False, "Too large PCD value[%s] for datum type [%s]= " % (Value, Type)=0D except:=0D return False, "Invalid value [%s] of type [%s];"\=0D - " must be a hexadecimal, decimal or octal in C l= anguage format." % (Value, Type)=0D + " must be a hexadecimal, decimal or octal in C l= anguage format." % (=0D + Value, Type)=0D else:=0D return True, "StructurePcd"=0D =0D return True, ""=0D =0D +=0D def CommonPath(PathList):=0D P1 =3D min(PathList).split(os.path.sep)=0D P2 =3D max(PathList).split(os.path.sep)=0D @@ -1433,6 +1518,7 @@ def CommonPath(PathList): return os.path.sep.join(P1[:Index])=0D return os.path.sep.join(P1)=0D =0D +=0D class PathClass(object):=0D def __init__(self, File=3D'', Root=3D'', AlterRoot=3D'', Type=3D'', Is= Binary=3DFalse,=0D Arch=3D'COMMON', ToolChainFamily=3D'', Target=3D'', TagNa= me=3D'', ToolCode=3D''):=0D @@ -1484,7 +1570,7 @@ class PathClass(object): self.ToolChainFamily =3D ToolChainFamily=0D self.OriginalPath =3D self=0D =0D - ## Convert the object of this class to a string=0D + # Convert the object of this class to a string=0D #=0D # Convert member Path of the class to a string=0D #=0D @@ -1493,7 +1579,7 @@ class PathClass(object): def __str__(self):=0D return self.Path=0D =0D - ## Override __eq__ function=0D + # Override __eq__ function=0D #=0D # Check whether PathClass are the same=0D #=0D @@ -1503,7 +1589,7 @@ class PathClass(object): def __eq__(self, Other):=0D return self.Path =3D=3D str(Other)=0D =0D - ## Override __cmp__ function=0D + # Override __cmp__ function=0D #=0D # Customize the comparison operation of two PathClass=0D #=0D @@ -1521,7 +1607,7 @@ class PathClass(object): else:=0D return -1=0D =0D - ## Override __hash__ function=0D + # Override __hash__ function=0D #=0D # Use Path as key in hash table=0D #=0D @@ -1542,14 +1628,16 @@ class PathClass(object): def RealPath2(File, Dir=3D'', OverrideDir=3D''):=0D NewFile =3D None=0D if OverrideDir:=0D - NewFile =3D GlobalData.gAllFiles[os.path.normpath(os.path.= join(OverrideDir, File))]=0D + NewFile =3D GlobalData.gAllFiles[os.path.normpath(=0D + os.path.join(OverrideDir, File))]=0D if NewFile:=0D if OverrideDir[-1] =3D=3D os.path.sep:=0D return NewFile[len(OverrideDir):], NewFile[0:len(O= verrideDir)]=0D else:=0D return NewFile[len(OverrideDir) + 1:], NewFile[0:l= en(OverrideDir)]=0D if GlobalData.gAllFiles:=0D - NewFile =3D GlobalData.gAllFiles[os.path.normpath(os.path.= join(Dir, File))]=0D + NewFile =3D GlobalData.gAllFiles[os.path.normpath(=0D + os.path.join(Dir, File))]=0D if not NewFile:=0D NewFile =3D os.path.normpath(os.path.join(Dir, File))=0D if not os.path.exists(NewFile):=0D @@ -1577,7 +1665,7 @@ class PathClass(object): RealFile =3D os.path.join(self.AlterRoot, self.File)=0D elif self.Root:=0D RealFile =3D os.path.join(self.Root, self.File)=0D - if len (mws.getPkgPath()) =3D=3D 0:=0D + if len(mws.getPkgPath()) =3D=3D 0:=0D return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFi= le)=0D else:=0D return FILE_NOT_FOUND, "%s is not found in packages path:\= n\t%s" % (self.File, '\n\t'.join(mws.getPkgPath()))=0D @@ -1600,19 +1688,21 @@ class PathClass(object): self.Path =3D os.path.join(RealRoot, RealFile)=0D return ErrorCode, ErrorInfo=0D =0D -## Parse PE image to get the required PE information.=0D +# Parse PE image to get the required PE information.=0D #=0D +=0D +=0D class PeImageClass():=0D - ## Constructor=0D + # Constructor=0D #=0D # @param File FilePath of PeImage=0D #=0D def __init__(self, PeFile):=0D - self.FileName =3D PeFile=0D - self.IsValid =3D False=0D - self.Size =3D 0=0D + self.FileName =3D PeFile=0D + self.IsValid =3D False=0D + self.Size =3D 0=0D self.EntryPoint =3D 0=0D - self.SectionAlignment =3D 0=0D + self.SectionAlignment =3D 0=0D self.SectionHeaderList =3D []=0D self.ErrorInfo =3D ''=0D try:=0D @@ -1625,7 +1715,7 @@ class PeImageClass(): ByteArray.fromfile(PeObject, 0x3E)=0D ByteList =3D ByteArray.tolist()=0D # DOS signature should be 'MZ'=0D - if self._ByteListToStr (ByteList[0x0:0x2]) !=3D 'MZ':=0D + if self._ByteListToStr(ByteList[0x0:0x2]) !=3D 'MZ':=0D self.ErrorInfo =3D self.FileName + ' has no valid DOS signatur= e MZ'=0D return=0D =0D @@ -1653,20 +1743,21 @@ class PeImageClass(): ByteArray =3D array.array('B')=0D ByteArray.fromfile(PeObject, OptionalHeaderSize)=0D ByteList =3D ByteArray.tolist()=0D - self.EntryPoint =3D self._ByteListToInt(ByteList[0x10:0x14])= =0D + self.EntryPoint =3D self._ByteListToInt(ByteList[0x10:0x14])=0D self.SectionAlignment =3D self._ByteListToInt(ByteList[0x20:0x24])= =0D - self.Size =3D self._ByteListToInt(ByteList[0x38:0x3C])= =0D + self.Size =3D self._ByteListToInt(ByteList[0x38:0x3C])=0D =0D # Read each Section Header=0D for Index in range(SecNumber):=0D ByteArray =3D array.array('B')=0D ByteArray.fromfile(PeObject, 0x28)=0D ByteList =3D ByteArray.tolist()=0D - SecName =3D self._ByteListToStr(ByteList[0:8])=0D + SecName =3D self._ByteListToStr(ByteList[0:8])=0D SecVirtualSize =3D self._ByteListToInt(ByteList[8:12])=0D - SecRawAddress =3D self._ByteListToInt(ByteList[20:24])=0D + SecRawAddress =3D self._ByteListToInt(ByteList[20:24])=0D SecVirtualAddress =3D self._ByteListToInt(ByteList[12:16])=0D - self.SectionHeaderList.append((SecName, SecVirtualAddress, Sec= RawAddress, SecVirtualSize))=0D + self.SectionHeaderList.append(=0D + (SecName, SecVirtualAddress, SecRawAddress, SecVirtualSize= ))=0D self.IsValid =3D True=0D PeObject.close()=0D =0D @@ -1684,48 +1775,55 @@ class PeImageClass(): Value =3D (Value << 8) | int(ByteList[index])=0D return Value=0D =0D +=0D class DefaultStore():=0D - def __init__(self, DefaultStores ):=0D + def __init__(self, DefaultStores):=0D =0D self.DefaultStores =3D DefaultStores=0D +=0D def DefaultStoreID(self, DefaultStoreName):=0D for key, value in self.DefaultStores.items():=0D if value =3D=3D DefaultStoreName:=0D return key=0D return None=0D +=0D def GetDefaultDefault(self):=0D if not self.DefaultStores or "0" in self.DefaultStores:=0D return "0", TAB_DEFAULT_STORES_DEFAULT=0D else:=0D minvalue =3D min(int(value_str) for value_str in self.DefaultS= tores)=0D return (str(minvalue), self.DefaultStores[str(minvalue)])=0D +=0D def GetMin(self, DefaultSIdList):=0D if not DefaultSIdList:=0D return TAB_DEFAULT_STORES_DEFAULT=0D - storeidset =3D {storeid for storeid, storename in self.DefaultStor= es.values() if storename in DefaultSIdList}=0D + storeidset =3D {storeid for storeid, storename in self.DefaultStor= es.values(=0D + ) if storename in DefaultSIdList}=0D if not storeidset:=0D return ""=0D - minid =3D min(storeidset )=0D + minid =3D min(storeidset)=0D for sid, name in self.DefaultStores.values():=0D if sid =3D=3D minid:=0D return name=0D =0D +=0D class SkuClass():=0D DEFAULT =3D 0=0D SINGLE =3D 1=0D - MULTIPLE =3D2=0D + MULTIPLE =3D 2=0D =0D - def __init__(self,SkuIdentifier=3D'', SkuIds=3DNone):=0D + def __init__(self, SkuIdentifier=3D'', SkuIds=3DNone):=0D if SkuIds is None:=0D SkuIds =3D {}=0D =0D for SkuName in SkuIds:=0D SkuId =3D SkuIds[SkuName][0]=0D - skuid_num =3D int(SkuId, 16) if SkuId.upper().startswith("0X")= else int(SkuId)=0D + skuid_num =3D int(SkuId, 16) if SkuId.upper(=0D + ).startswith("0X") else int(SkuId)=0D if skuid_num > 0xFFFFFFFFFFFFFFFF:=0D EdkLogger.error("build", PARAMETER_INVALID,=0D - ExtraData =3D "SKU-ID [%s] value %s exceeds th= e max value of UINT64"=0D - % (SkuName, SkuId))=0D + ExtraData=3D"SKU-ID [%s] value %s exceeds = the max value of UINT64"=0D + % (SkuName, SkuId))=0D =0D self.AvailableSkuIds =3D OrderedDict()=0D self.SkuIdSet =3D []=0D @@ -1738,26 +1836,28 @@ class SkuClass(): self.SkuIdNumberSet =3D ['0U']=0D elif SkuIdentifier =3D=3D 'ALL':=0D self.SkuIdSet =3D list(SkuIds.keys())=0D - self.SkuIdNumberSet =3D [num[0].strip() + 'U' for num in SkuId= s.values()]=0D + self.SkuIdNumberSet =3D [=0D + num[0].strip() + 'U' for num in SkuIds.values()]=0D else:=0D r =3D SkuIdentifier.split('|')=0D - self.SkuIdSet=3D[(r[k].strip()).upper() for k in range(len(r))= ]=0D + self.SkuIdSet =3D [(r[k].strip()).upper() for k in range(len(r= ))]=0D k =3D None=0D try:=0D - self.SkuIdNumberSet =3D [SkuIds[k][0].strip() + 'U' for k = in self.SkuIdSet]=0D + self.SkuIdNumberSet =3D [=0D + SkuIds[k][0].strip() + 'U' for k in self.SkuIdSet]=0D except Exception:=0D EdkLogger.error("build", PARAMETER_INVALID,=0D - ExtraData =3D "SKU-ID [%s] is not supported by= the platform. [Valid SKU-ID: %s]"=0D - % (k, " | ".join(SkuIds.keys())))=0D + ExtraData=3D"SKU-ID [%s] is not supported = by the platform. [Valid SKU-ID: %s]"=0D + % (k, " | ".join(SkuIds.keys())))=0D for each in self.SkuIdSet:=0D if each in SkuIds:=0D self.AvailableSkuIds[each] =3D SkuIds[each][0]=0D else:=0D EdkLogger.error("build", PARAMETER_INVALID,=0D - ExtraData=3D"SKU-ID [%s] is not supported by t= he platform. [Valid SKU-ID: %s]"=0D - % (each, " | ".join(SkuIds.keys())))= =0D + ExtraData=3D"SKU-ID [%s] is not supported = by the platform. [Valid SKU-ID: %s]"=0D + % (each, " | ".join(SkuIds.keys())))=0D if self.SkuUsageType !=3D SkuClass.SINGLE:=0D - self.AvailableSkuIds.update({'DEFAULT':0, 'COMMON':0})=0D + self.AvailableSkuIds.update({'DEFAULT': 0, 'COMMON': 0})=0D if self.SkuIdSet:=0D GlobalData.gSkuids =3D (self.SkuIdSet)=0D if 'COMMON' in GlobalData.gSkuids:=0D @@ -1773,7 +1873,7 @@ class SkuClass(): if not self._SkuInherit:=0D self._SkuInherit =3D {}=0D for item in self.SkuData.values():=0D - self._SkuInherit[item[1]]=3Ditem[2] if item[2] else "DEFAU= LT"=0D + self._SkuInherit[item[1]] =3D item[2] if item[2] else "DEF= AULT"=0D return self._SkuInherit.get(skuname, "DEFAULT")=0D =0D def GetSkuChain(self, sku):=0D @@ -1788,6 +1888,7 @@ class SkuClass(): break=0D skulist.reverse()=0D return skulist=0D +=0D def SkuOverrideOrder(self):=0D skuorderset =3D []=0D for skuname in self.SkuIdSet:=0D @@ -1844,12 +1945,14 @@ class SkuClass(): else:=0D return 'DEFAULT'=0D =0D -## Get the integer value from string like "14U" or integer like 2=0D +# Get the integer value from string like "14U" or integer like 2=0D #=0D # @param Input The object that may be either a integer value or a= string=0D #=0D # @retval Value The integer value that the input represents=0D #=0D +=0D +=0D def GetIntegerValue(Input):=0D if not isinstance(Input, str):=0D return Input=0D @@ -1871,6 +1974,8 @@ def GetIntegerValue(Input): #=0D # Pack a GUID (registry format) list into a buffer and return it=0D #=0D +=0D +=0D def PackGUID(Guid):=0D return pack(PACK_PATTERN_GUID,=0D int(Guid[0], 16),=0D @@ -1889,6 +1994,8 @@ def PackGUID(Guid): #=0D # Pack a GUID (byte) list into a buffer and return it=0D #=0D +=0D +=0D def PackByteFormatGUID(Guid):=0D return pack(PACK_PATTERN_GUID,=0D Guid[0],=0D @@ -1904,19 +2011,21 @@ def PackByteFormatGUID(Guid): Guid[10],=0D )=0D =0D -## DeepCopy dict/OrderedDict recusively=0D +# DeepCopy dict/OrderedDict recusively=0D #=0D # @param ori_dict a nested dict or ordereddict=0D #=0D # @retval new dict or orderdict=0D #=0D +=0D +=0D def CopyDict(ori_dict):=0D dict_type =3D ori_dict.__class__=0D - if dict_type not in (dict,OrderedDict):=0D + if dict_type not in (dict, OrderedDict):=0D return ori_dict=0D new_dict =3D dict_type()=0D for key in ori_dict:=0D - if isinstance(ori_dict[key],(dict,OrderedDict)):=0D + if isinstance(ori_dict[key], (dict, OrderedDict)):=0D new_dict[key] =3D CopyDict(ori_dict[key])=0D else:=0D new_dict[key] =3D ori_dict[key]=0D @@ -1925,5 +2034,7 @@ def CopyDict(ori_dict): #=0D # Remove the c/c++ comments: // and /* */=0D #=0D +=0D +=0D def RemoveCComments(ctext):=0D return re.sub('//.*?\n|/\*.*?\*/', '\n', ctext, flags=3Dre.S)=0D diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTool= s/Source/Python/Common/MultipleWorkspace.py index ad5d48588b48..598ea311a724 100644 --- a/BaseTools/Source/Python/Common/MultipleWorkspace.py +++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # manage multiple workspace file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D @@ -11,7 +11,7 @@ import Common.LongFilePathOs as os=0D from Common.DataType import TAB_WORKSPACE=0D =0D -## MultipleWorkspace=0D +# MultipleWorkspace=0D #=0D # This class manage multiple workspace behavior=0D #=0D @@ -20,11 +20,13 @@ from Common.DataType import TAB_WORKSPACE # @var WORKSPACE: defined the current WORKSPACE=0D # @var PACKAGES_PATH: defined the other WORKSPACE, if current WORKSPACE i= s invalid, search valid WORKSPACE from PACKAGES_PATH=0D #=0D +=0D +=0D class MultipleWorkspace(object):=0D WORKSPACE =3D ''=0D PACKAGES_PATH =3D None=0D =0D - ## convertPackagePath()=0D + # convertPackagePath()=0D #=0D # Convert path to match workspace.=0D #=0D @@ -34,11 +36,11 @@ class MultipleWorkspace(object): #=0D @classmethod=0D def convertPackagePath(cls, Ws, Path):=0D - if str(os.path.normcase (Path)).startswith(Ws):=0D + if str(os.path.normcase(Path)).startswith(Ws):=0D return os.path.join(Ws, os.path.relpath(Path, Ws))=0D return Path=0D =0D - ## setWs()=0D + # setWs()=0D #=0D # set WORKSPACE and PACKAGES_PATH environment=0D #=0D @@ -50,11 +52,12 @@ class MultipleWorkspace(object): def setWs(cls, Ws, PackagesPath=3DNone):=0D cls.WORKSPACE =3D Ws=0D if PackagesPath:=0D - cls.PACKAGES_PATH =3D [cls.convertPackagePath (Ws, os.path.nor= mpath(Path.strip())) for Path in PackagesPath.split(os.pathsep)]=0D + cls.PACKAGES_PATH =3D [cls.convertPackagePath(Ws, os.path.norm= path(=0D + Path.strip())) for Path in PackagesPath.split(os.pathsep)]= =0D else:=0D cls.PACKAGES_PATH =3D []=0D =0D - ## join()=0D + # join()=0D #=0D # rewrite os.path.join function=0D #=0D @@ -74,7 +77,7 @@ class MultipleWorkspace(object): Path =3D os.path.join(Ws, *p)=0D return Path=0D =0D - ## relpath()=0D + # relpath()=0D #=0D # rewrite os.path.relpath function=0D #=0D @@ -93,7 +96,7 @@ class MultipleWorkspace(object): Path =3D os.path.relpath(Path, Ws)=0D return Path=0D =0D - ## getWs()=0D + # getWs()=0D #=0D # get valid workspace for the path=0D #=0D @@ -112,7 +115,7 @@ class MultipleWorkspace(object): return Pkg=0D return Ws=0D =0D - ## handleWsMacro()=0D + # handleWsMacro()=0D #=0D # handle the $(WORKSPACE) tag, if current workspace is invalid path = relative the tool, replace it.=0D #=0D @@ -128,17 +131,19 @@ class MultipleWorkspace(object): MacroStartPos =3D str.find(TAB_WORKSPACE)=0D if MacroStartPos !=3D -1:=0D Substr =3D str[MacroStartPos:]=0D - Path =3D Substr.replace(TAB_WORKSPACE, cls.WORKSPA= CE).strip()=0D + Path =3D Substr.replace(=0D + TAB_WORKSPACE, cls.WORKSPACE).strip()=0D if not os.path.exists(Path):=0D for Pkg in cls.PACKAGES_PATH:=0D - Path =3D Substr.replace(TAB_WORKSPACE, Pkg= ).strip()=0D + Path =3D Substr.replace(=0D + TAB_WORKSPACE, Pkg).strip()=0D if os.path.exists(Path):=0D break=0D PathList[i] =3D str[0:MacroStartPos] + Path=0D PathStr =3D ' '.join(PathList)=0D return PathStr=0D =0D - ## getPkgPath()=0D + # getPkgPath()=0D #=0D # get all package paths.=0D #=0D @@ -147,4 +152,3 @@ class MultipleWorkspace(object): @classmethod=0D def getPkgPath(cls):=0D return cls.PACKAGES_PATH=0D -=0D diff --git a/BaseTools/Source/Python/Common/Parsing.py b/BaseTools/Source/P= ython/Common/Parsing.py index 740283a04d85..22015fa00c12 100644 --- a/BaseTools/Source/Python/Common/Parsing.py +++ b/BaseTools/Source/Python/Common/Parsing.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common parsing related functions used in par= sing INF/DEC/DSC process=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,10 +13,12 @@ from .StringUtils import * from CommonDataClass.DataClass import *=0D from .DataType import *=0D =0D -## ParseDefineMacro=0D +# ParseDefineMacro=0D #=0D # Search whole table to find all defined Macro and replaced them with the = real values=0D #=0D +=0D +=0D def ParseDefineMacro2(Table, RecordSets, GlobalMacro):=0D Macros =3D {}=0D #=0D @@ -41,10 +43,12 @@ def ParseDefineMacro2(Table, RecordSets, GlobalMacro): for Item in Value:=0D Item[0] =3D ReplaceMacro(Item[0], Macros)=0D =0D -## ParseDefineMacro=0D +# ParseDefineMacro=0D #=0D # Search whole table to find all defined Macro and replaced them with the = real values=0D #=0D +=0D +=0D def ParseDefineMacro(Table, GlobalMacro):=0D Macros =3D {}=0D #=0D @@ -55,18 +59,18 @@ def ParseDefineMacro(Table, GlobalMacro): and Enabled > -1""" % (Table.Table, MODEL_META_DATA_DE= FINE)=0D RecordSet =3D Table.Exec(SqlCommand)=0D for Record in RecordSet:=0D -#*************************************************************************= **************************************************************************= =0D -# The follow SqlCommand (expr replace) is not supported in Sqli= te 3.3.4 which is used in Python 2.5 *= =0D -# Reserved Only = *= =0D -# SqlCommand =3D """update %s set Value1 =3D replace(Value1, '%= s', '%s') = *=0D -# where ID in (select ID from %s = *= =0D -# where Model =3D %s = = *=0D -# and Value1 like '%%%s%%' = *= =0D -# and StartLine > %s = *= =0D -# and Enabled > -1 = *= =0D -# and Arch =3D '%s')""" % \ = = *=0D -# (self.TblDsc.Table, Record[0], R= ecord[1], self.TblDsc.Table, Record[2], Record[1], Record[3], Record[4]) *= =0D -#*************************************************************************= **************************************************************************= =0D + # ****************************************************************= ***************************************************************************= ********=0D + # The follow SqlCommand (expr replace) is not supported= in Sqlite 3.3.4 which is used in Python 2.5 = *=0D + # Reserved Only = = *=0D + # SqlCommand =3D """update %s set Value1 =3D replace(Va= lue1, '%s', '%s') = *=0D + # where ID in (select ID from %s = = *=0D + # where Model =3D %s = = *=0D + # and Value1 like '%%%s%%'= = *=0D + # and StartLine > %s = = *=0D + # and Enabled > -1 = = *=0D + # and Arch =3D '%s')""" % = \ = *=0D + # (self.TblDsc.Table, Reco= rd[0], Record[1], self.TblDsc.Table, Record[2], Record[1], Record[3], Recor= d[4]) *=0D + # ****************************************************************= ***************************************************************************= ********=0D Macros[Record[0]] =3D Record[1]=0D =0D #=0D @@ -80,7 +84,7 @@ def ParseDefineMacro(Table, GlobalMacro): SqlCommand =3D """select ID, Value1 from %s=0D where Model !=3D %s=0D and Value1 like '%%$(%%' and Value1 like '%%)%%'=0D - and Enabled > -1""" % (Table.Table, MODEL_META_DATA_D= EFINE)=0D + and Enabled > -1""" % (Table.Table, MODEL_META_DATA_DE= FINE)=0D FoundRecords =3D Table.Exec(SqlCommand)=0D for FoundRecord in FoundRecords:=0D NewValue =3D ReplaceMacro(FoundRecord[1], Macros)=0D @@ -88,7 +92,7 @@ def ParseDefineMacro(Table, GlobalMacro): where ID =3D %s""" % (Table.Table, ConvertToSqlStr= ing2(NewValue), FoundRecord[0])=0D Table.Exec(SqlCommand)=0D =0D -##QueryDefinesItem=0D +# QueryDefinesItem=0D #=0D # Search item of section [Defines] by name, return its values=0D #=0D @@ -98,6 +102,8 @@ def ParseDefineMacro(Table, GlobalMacro): #=0D # @retval RecordSet: A list of all matched records=0D #=0D +=0D +=0D def QueryDefinesItem(Table, Name, Arch, BelongsToFile):=0D SqlCommand =3D """select Value2 from %s=0D where Model =3D %s=0D @@ -132,7 +138,7 @@ def QueryDefinesItem(Table, Name, Arch, BelongsToFile): RetVal.append(Item)=0D return RetVal=0D =0D -##QueryDefinesItem=0D +# QueryDefinesItem=0D #=0D # Search item of section [Defines] by name, return its values=0D #=0D @@ -142,6 +148,8 @@ def QueryDefinesItem(Table, Name, Arch, BelongsToFile): #=0D # @retval RecordSet: A list of all matched records=0D #=0D +=0D +=0D def QueryDefinesItem2(Table, Arch, BelongsToFile):=0D SqlCommand =3D """select Value1, Value2, StartLine from %s=0D where Model =3D %s=0D @@ -159,7 +167,7 @@ def QueryDefinesItem2(Table, Arch, BelongsToFile): =0D return RecordSet=0D =0D -##QueryDscItem=0D +# QueryDscItem=0D #=0D # Search all dsc item for a specific section=0D #=0D @@ -168,6 +176,8 @@ def QueryDefinesItem2(Table, Arch, BelongsToFile): #=0D # @retval RecordSet: A list of all matched records=0D #=0D +=0D +=0D def QueryDscItem(Table, Model, BelongsToItem, BelongsToFile):=0D SqlCommand =3D """select Value1, Arch, StartLine, ID, Value2 from %s=0D where Model =3D %s=0D @@ -176,7 +186,7 @@ def QueryDscItem(Table, Model, BelongsToItem, BelongsTo= File): and Enabled > -1""" % (Table.Table, Model, BelongsToIt= em, BelongsToFile)=0D return Table.Exec(SqlCommand)=0D =0D -##QueryDecItem=0D +# QueryDecItem=0D #=0D # Search all dec item for a specific section=0D #=0D @@ -185,6 +195,8 @@ def QueryDscItem(Table, Model, BelongsToItem, BelongsTo= File): #=0D # @retval RecordSet: A list of all matched records=0D #=0D +=0D +=0D def QueryDecItem(Table, Model, BelongsToItem):=0D SqlCommand =3D """select Value1, Arch, StartLine, ID, Value2 from %s=0D where Model =3D %s=0D @@ -192,7 +204,7 @@ def QueryDecItem(Table, Model, BelongsToItem): and Enabled > -1""" % (Table.Table, Model, BelongsToIt= em)=0D return Table.Exec(SqlCommand)=0D =0D -##QueryInfItem=0D +# QueryInfItem=0D #=0D # Search all dec item for a specific section=0D #=0D @@ -201,6 +213,8 @@ def QueryDecItem(Table, Model, BelongsToItem): #=0D # @retval RecordSet: A list of all matched records=0D #=0D +=0D +=0D def QueryInfItem(Table, Model, BelongsToItem):=0D SqlCommand =3D """select Value1, Arch, StartLine, ID, Value2 from %s=0D where Model =3D %s=0D @@ -208,7 +222,7 @@ def QueryInfItem(Table, Model, BelongsToItem): and Enabled > -1""" % (Table.Table, Model, BelongsToIt= em)=0D return Table.Exec(SqlCommand)=0D =0D -## GetBuildOption=0D +# GetBuildOption=0D #=0D # Parse a string with format "[:]=3DFlag"=0D # Return (Family, ToolFlag, Flag)=0D @@ -218,21 +232,24 @@ def QueryInfItem(Table, Model, BelongsToItem): #=0D # @retval truple() A truple structure as (Family, ToolChain, Flag)=0D #=0D -def GetBuildOption(String, File, LineNo =3D -1):=0D +=0D +=0D +def GetBuildOption(String, File, LineNo=3D-1):=0D (Family, ToolChain, Flag) =3D ('', '', '')=0D if String.find(TAB_EQUAL_SPLIT) < 0:=0D - RaiseParserError(String, 'BuildOptions', File, '[:]=3DFlag', LineNo)=0D + RaiseParserError(String, 'BuildOptions', File,=0D + '[:]=3DFlag', LineNo)=0D else:=0D - List =3D GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit =3D 1= )=0D + List =3D GetSplitValueList(String, TAB_EQUAL_SPLIT, MaxSplit=3D1)= =0D if List[0].find(':') > -1:=0D - Family =3D List[0][ : List[0].find(':')].strip()=0D - ToolChain =3D List[0][List[0].find(':') + 1 : ].strip()=0D + Family =3D List[0][: List[0].find(':')].strip()=0D + ToolChain =3D List[0][List[0].find(':') + 1:].strip()=0D else:=0D ToolChain =3D List[0].strip()=0D Flag =3D List[1].strip()=0D return (Family, ToolChain, Flag)=0D =0D -## Get Library Class=0D +# Get Library Class=0D #=0D # Get Library of Dsc as |=0D #=0D @@ -241,20 +258,25 @@ def GetBuildOption(String, File, LineNo =3D -1): #=0D # @retval (LibraryClassKeyWord, LibraryInstance, [SUP_MODULE_LIST]) Format= ted Library Item=0D #=0D -def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo =3D -1):=0D +=0D +=0D +def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo=3D-1):=0D List =3D GetSplitValueList(Item[0])=0D SupMod =3D SUP_MODULE_LIST_STRING=0D if len(List) !=3D 2:=0D - RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, '|')=0D + RaiseParserError(Item[0], 'LibraryClasses', ContainerFile,=0D + '|')=0D else:=0D - CheckFileType(List[1], '.Inf', ContainerFile, 'library class insta= nce', Item[0], LineNo)=0D - CheckFileExist(WorkspaceDir, List[1], ContainerFile, 'LibraryClass= es', Item[0], LineNo)=0D + CheckFileType(List[1], '.Inf', ContainerFile,=0D + 'library class instance', Item[0], LineNo)=0D + CheckFileExist(=0D + WorkspaceDir, List[1], ContainerFile, 'LibraryClasses', Item[0= ], LineNo)=0D if Item[1] !=3D '':=0D SupMod =3D Item[1]=0D =0D return (List[0], List[1], SupMod)=0D =0D -## Get Library Class=0D +# Get Library Class=0D #=0D # Get Library of Dsc as [|][|.]=0D #=0D @@ -263,23 +285,29 @@ def GetLibraryClass(Item, ContainerFile, WorkspaceDir= , LineNo =3D -1): #=0D # @retval (LibraryClassKeyWord, LibraryInstance, [SUP_MODULE_LIST]) Format= ted Library Item=0D #=0D -def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo =3D -1)= :=0D +=0D +=0D +def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo=3D-1):= =0D ItemList =3D GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2= ))=0D SupMod =3D SUP_MODULE_LIST_STRING=0D =0D if len(ItemList) > 5:=0D - RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, '[|][|.]')=0D + RaiseParserError(Item[0], 'LibraryClasses', ContainerFile,=0D + '[|][|.]')=0D else:=0D - CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses'= , Item[0], LineNo)=0D - CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile, 'LibraryC= lasses', Item[0], LineNo)=0D + CheckFileType(ItemList[1], '.Inf', ContainerFile,=0D + 'LibraryClasses', Item[0], LineNo)=0D + CheckFileExist(=0D + WorkspaceDir, ItemList[1], ContainerFile, 'LibraryClasses', It= em[0], LineNo)=0D if ItemList[2] !=3D '':=0D - CheckPcdTokenInfo(ItemList[2], 'LibraryClasses', ContainerFile= , LineNo)=0D + CheckPcdTokenInfo(=0D + ItemList[2], 'LibraryClasses', ContainerFile, LineNo)=0D if Item[1] !=3D '':=0D SupMod =3D Item[1]=0D =0D return (ItemList[0], ItemList[1], ItemList[2], SupMod)=0D =0D -## CheckPcdTokenInfo=0D +# CheckPcdTokenInfo=0D #=0D # Check if PcdTokenInfo is following .=0D #=0D @@ -289,7 +317,9 @@ def GetLibraryClassOfInf(Item, ContainerFile, Workspace= Dir, LineNo =3D -1): #=0D # @retval True PcdTokenInfo is in correct format=0D #=0D -def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo =3D -1):=0D +=0D +=0D +def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo=3D-1):=0D Format =3D '.'=0D if TokenInfoString !=3D '' and TokenInfoString is not None:=0D TokenInfoList =3D GetSplitValueList(TokenInfoString, TAB_SPLIT)=0D @@ -298,7 +328,7 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File, L= ineNo =3D -1): =0D RaiseParserError(TokenInfoString, Section, File, Format, LineNo)=0D =0D -## Get Pcd=0D +# Get Pcd=0D #=0D # Get Pcd of Dsc as .|[||= ]=0D #=0D @@ -307,12 +337,15 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File,= LineNo =3D -1): #=0D # @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], Type)=0D #=0D -def GetPcd(Item, Type, ContainerFile, LineNo =3D -1):=0D +=0D +=0D +def GetPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value, MaximumDatumSize, Token =3D '', '', '', '= ', ''=0D List =3D GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)=0D =0D if len(List) < 4 or len(List) > 6:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '.|[||]', LineNo)=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.|[|<= Type>|]', LineNo)=0D else:=0D Value =3D List[1]=0D MaximumDatumSize =3D List[2]=0D @@ -323,7 +356,7 @@ def GetPcd(Item, Type, ContainerFile, LineNo =3D -1): =0D return (TokenName, TokenGuid, Value, MaximumDatumSize, Token, Type)=0D =0D -## Get FeatureFlagPcd=0D +# Get FeatureFlagPcd=0D #=0D # Get FeatureFlagPcd of Dsc as .|TRUE/= FALSE=0D #=0D @@ -332,11 +365,14 @@ def GetPcd(Item, Type, ContainerFile, LineNo =3D -1): #=0D # @retval (TokenInfo[1], TokenInfo[0], List[1], Type)=0D #=0D -def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo =3D -1):=0D +=0D +=0D +def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value =3D '', '', ''=0D List =3D GetSplitValueList(Item)=0D if len(List) !=3D 2:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '.|TRUE/FALSE', LineNo)=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.|TRUE/FALSE= ', LineNo)=0D else:=0D Value =3D List[1]=0D if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):=0D @@ -344,7 +380,7 @@ def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo= =3D -1): =0D return (TokenName, TokenGuid, Value, Type)=0D =0D -## Get DynamicDefaultPcd=0D +# Get DynamicDefaultPcd=0D #=0D # Get DynamicDefaultPcd of Dsc as .|[|[|]]=0D #=0D @@ -353,11 +389,14 @@ def GetFeatureFlagPcd(Item, Type, ContainerFile, Line= No =3D -1): #=0D # @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], Type)=0D #=0D -def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo =3D -1):=0D +=0D +=0D +def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value, DatumTyp, MaxDatumSize =3D '', '', '', ''= , ''=0D List =3D GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)=0D if len(List) < 4 or len(List) > 8:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '.|[|[|]]', LineNo)=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.|[|<= DatumTyp>[|]]', LineNo)=0D else:=0D Value =3D List[1]=0D DatumTyp =3D List[2]=0D @@ -367,7 +406,7 @@ def GetDynamicDefaultPcd(Item, Type, ContainerFile, Lin= eNo =3D -1): =0D return (TokenName, TokenGuid, Value, DatumTyp, MaxDatumSize, Type)=0D =0D -## Get DynamicHiiPcd=0D +# Get DynamicHiiPcd=0D #=0D # Get DynamicHiiPcd of Dsc as .|||[|[|= ]]=0D #=0D @@ -376,11 +415,14 @@ def GetDynamicDefaultPcd(Item, Type, ContainerFile, L= ineNo =3D -1): #=0D # @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], List[3], List[4],= List[5], Type)=0D #=0D -def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo =3D -1):=0D +=0D +=0D +def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, L1, L2, L3, L4, L5 =3D '', '', '', '', '', '', '= '=0D List =3D GetSplitValueList(Item + TAB_VALUE_SPLIT * 2)=0D if len(List) < 6 or len(List) > 8:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '.|||[|[|]]', LineNo)=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.||<= VariableGuidCName>|[|[|]]',= LineNo)=0D else:=0D L1, L2, L3, L4, L5 =3D List[1], List[2], List[3], List[4], List[5]= =0D if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):=0D @@ -388,7 +430,7 @@ def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo = =3D -1): =0D return (TokenName, TokenGuid, L1, L2, L3, L4, L5, Type)=0D =0D -## Get DynamicVpdPcd=0D +# Get DynamicVpdPcd=0D #=0D # Get DynamicVpdPcd of Dsc as .|[|]=0D #=0D @@ -397,11 +439,14 @@ def GetDynamicHiiPcd(Item, Type, ContainerFile, LineN= o =3D -1): #=0D # @retval (TokenInfo[1], TokenInfo[0], List[1], List[2], Type)=0D #=0D -def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo =3D -1):=0D +=0D +=0D +def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, L1, L2 =3D '', '', '', ''=0D List =3D GetSplitValueList(Item + TAB_VALUE_SPLIT)=0D if len(List) < 3 or len(List) > 4:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, '.|[|]', LineNo)=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.|[|]', LineNo)=0D else:=0D L1, L2 =3D List[1], List[2]=0D if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):=0D @@ -409,7 +454,7 @@ def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo = =3D -1): =0D return (TokenName, TokenGuid, L1, L2, Type)=0D =0D -## GetComponent=0D +# GetComponent=0D #=0D # Parse block of the components defined in dsc file=0D # Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3= ], [pcd1, pcd2, pcd3]], ...]=0D @@ -419,8 +464,11 @@ def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo= =3D -1): #=0D # @retval True Get component successfully=0D #=0D +=0D +=0D def GetComponent(Lines, KeyValues):=0D - (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, fi= ndPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDyn= amicEx) =3D (False, False, False, False, False, False, False, False)=0D + (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, fi= ndPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, False, False, = False, False, False, False)=0D ListItem =3D None=0D LibraryClassItem =3D []=0D BuildOption =3D []=0D @@ -442,39 +490,49 @@ def GetComponent(Lines, KeyValues): #=0D if Line.endswith('{'):=0D findBlock =3D True=0D - ListItem =3D CleanString(Line.rsplit('{', 1)[0], DataType.= TAB_COMMENT_SPLIT)=0D + ListItem =3D CleanString(Line.rsplit(=0D + '{', 1)[0], DataType.TAB_COMMENT_SPLIT)=0D =0D #=0D # Parse a block content=0D #=0D if findBlock:=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (True, False, False, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (True, False, Fal= se, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, True, False, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, True, Fal= se, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, True, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Tr= ue, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, True, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, True, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, True, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, True, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, False, True, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, True, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, False, False, True)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, False, True)=0D continue=0D if Line.endswith('}'):=0D #=0D # find '}' at line tail=0D #=0D - KeyValues.append([ListItem, LibraryClassItem, BuildOption,= Pcd])=0D - (findBlock, findLibraryClass, findBuildOption, findPcdsFea= tureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic,= findPcdsDynamicEx) =3D (False, False, False, False, False, False, False, F= alse)=0D + KeyValues.append(=0D + [ListItem, LibraryClassItem, BuildOption, Pcd])=0D + (findBlock, findLibraryClass, findBuildOption, findPcdsFea= tureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, False, False, False)=0D LibraryClassItem, BuildOption, Pcd =3D [], [], []=0D continue=0D =0D @@ -498,7 +556,7 @@ def GetComponent(Lines, KeyValues): =0D return True=0D =0D -## GetExec=0D +# GetExec=0D #=0D # Parse a string with format "InfFilename [EXEC =3D ExecFilename]"=0D # Return (InfFilename, ExecFilename)=0D @@ -507,18 +565,20 @@ def GetComponent(Lines, KeyValues): #=0D # @retval truple() A pair as (InfFilename, ExecFilename)=0D #=0D +=0D +=0D def GetExec(String):=0D InfFilename =3D ''=0D ExecFilename =3D ''=0D if String.find('EXEC') > -1:=0D - InfFilename =3D String[ : String.find('EXEC')].strip()=0D - ExecFilename =3D String[String.find('EXEC') + len('EXEC') : ].stri= p()=0D + InfFilename =3D String[: String.find('EXEC')].strip()=0D + ExecFilename =3D String[String.find('EXEC') + len('EXEC'):].strip(= )=0D else:=0D InfFilename =3D String.strip()=0D =0D return (InfFilename, ExecFilename)=0D =0D -## GetComponents=0D +# GetComponents=0D #=0D # Parse block of the components defined in dsc file=0D # Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3= ], [pcd1, pcd2, pcd3]], ...]=0D @@ -530,10 +590,13 @@ def GetExec(String): #=0D # @retval True Get component successfully=0D #=0D +=0D +=0D def GetComponents(Lines, Key, KeyValues, CommentCharacter):=0D if Lines.find(DataType.TAB_SECTION_END) > -1:=0D Lines =3D Lines.split(DataType.TAB_SECTION_END, 1)[1]=0D - (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, fi= ndPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDyn= amicEx) =3D (False, False, False, False, False, False, False, False)=0D + (findBlock, findLibraryClass, findBuildOption, findPcdsFeatureFlag, fi= ndPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, False, False, = False, False, False, False)=0D ListItem =3D None=0D LibraryClassItem =3D []=0D BuildOption =3D []=0D @@ -552,39 +615,49 @@ def GetComponents(Lines, Key, KeyValues, CommentChara= cter): #=0D if Line.endswith('{'):=0D findBlock =3D True=0D - ListItem =3D CleanString(Line.rsplit('{', 1)[0], CommentCh= aracter)=0D + ListItem =3D CleanString(Line.rsplit('{', 1)[=0D + 0], CommentCharacter)=0D =0D #=0D # Parse a block content=0D #=0D if findBlock:=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (True, False, False, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (True, False, Fal= se, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, True, False, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, True, Fal= se, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, True, False, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Tr= ue, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, True, False, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, True, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, True, False, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, True, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, False, True, False)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, True, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic, findPcdsDy= namicEx) =3D (False, False, False, False, False, False, True)=0D + (findLibraryClass, findBuildOption, findPcdsFeatureFlag, f= indPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, False, True)=0D continue=0D if Line.endswith('}'):=0D #=0D # find '}' at line tail=0D #=0D - KeyValues.append([ListItem, LibraryClassItem, BuildOption,= Pcd])=0D - (findBlock, findLibraryClass, findBuildOption, findPcdsFea= tureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild, findPcdsDynamic,= findPcdsDynamicEx) =3D (False, False, False, False, False, False, False, F= alse)=0D + KeyValues.append(=0D + [ListItem, LibraryClassItem, BuildOption, Pcd])=0D + (findBlock, findLibraryClass, findBuildOption, findPcdsFea= tureFlag, findPcdsPatchableInModule, findPcdsFixedAtBuild,=0D + findPcdsDynamic, findPcdsDynamicEx) =3D (False, False, Fa= lse, False, False, False, False, False)=0D LibraryClassItem, BuildOption, Pcd =3D [], [], []=0D continue=0D =0D @@ -608,7 +681,7 @@ def GetComponents(Lines, Key, KeyValues, CommentCharact= er): =0D return True=0D =0D -## Get Source=0D +# Get Source=0D #=0D # Get Source of Inf as [|[|[|[|]]]]=0D #=0D @@ -617,19 +690,23 @@ def GetComponents(Lines, Key, KeyValues, CommentChara= cter): #=0D # @retval (List[0], List[1], List[2], List[3], List[4])=0D #=0D -def GetSource(Item, ContainerFile, FileRelativePath, LineNo =3D -1):=0D +=0D +=0D +def GetSource(Item, ContainerFile, FileRelativePath, LineNo=3D-1):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT * 4=0D List =3D GetSplitValueList(ItemNew)=0D if len(List) < 5 or len(List) > 9:=0D - RaiseParserError(Item, 'Sources', ContainerFile, '[|[|[|[|]]]]', LineNo)=0D + RaiseParserError(Item, 'Sources', ContainerFile,=0D + '[|[|[|[|]]]]', LineNo)=0D List[0] =3D NormPath(List[0])=0D - CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Sources', It= em, LineNo)=0D + CheckFileExist(FileRelativePath, List[0],=0D + ContainerFile, 'Sources', Item, LineNo)=0D if List[4] !=3D '':=0D CheckPcdTokenInfo(List[4], 'Sources', ContainerFile, LineNo)=0D =0D return (List[0], List[1], List[2], List[3], List[4])=0D =0D -## Get Binary=0D +# Get Binary=0D #=0D # Get Binary of Inf as [|[|[|[|]]]]=0D #=0D @@ -639,11 +716,14 @@ def GetSource(Item, ContainerFile, FileRelativePath, = LineNo =3D -1): # @retval (List[0], List[1], List[2], List[3])=0D # @retval List=0D #=0D -def GetBinary(Item, ContainerFile, FileRelativePath, LineNo =3D -1):=0D +=0D +=0D +def GetBinary(Item, ContainerFile, FileRelativePath, LineNo=3D-1):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D if len(List) !=3D 4 and len(List) !=3D 5:=0D - RaiseParserError(Item, 'Binaries', ContainerFile, "||[|.]", LineNo)=0D + RaiseParserError(Item, 'Binaries', ContainerFile,=0D + "||[|.]", LineNo)=0D else:=0D if List[3] !=3D '':=0D CheckPcdTokenInfo(List[3], 'Binaries', ContainerFile, LineNo)= =0D @@ -657,7 +737,7 @@ def GetBinary(Item, ContainerFile, FileRelativePath, Li= neNo =3D -1): elif len(List) =3D=3D 1:=0D return (List[0], '', '', '')=0D =0D -## Get Guids/Protocols/Ppis=0D +# Get Guids/Protocols/Ppis=0D #=0D # Get Guids/Protocols/Ppis of Inf as [|]=0D #=0D @@ -667,7 +747,9 @@ def GetBinary(Item, ContainerFile, FileRelativePath, Li= neNo =3D -1): #=0D # @retval (List[0], List[1])=0D #=0D -def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFile, LineNo =3D -1):= =0D +=0D +=0D +def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFile, LineNo=3D-1):=0D ItemNew =3D Item + TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D if List[1] !=3D '':=0D @@ -675,7 +757,7 @@ def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerFil= e, LineNo =3D -1): =0D return (List[0], List[1])=0D =0D -## Get Guids/Protocols/Ppis=0D +# Get Guids/Protocols/Ppis=0D #=0D # Get Guids/Protocols/Ppis of Dec as =3D=0D #=0D @@ -685,14 +767,17 @@ def GetGuidsProtocolsPpisOfInf(Item, Type, ContainerF= ile, LineNo =3D -1): #=0D # @retval (List[0], List[1])=0D #=0D -def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo =3D -1):= =0D +=0D +=0D +def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo=3D-1):=0D List =3D GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)=0D if len(List) !=3D 2:=0D - RaiseParserError(Item, Type, ContainerFile, '=3D= ', LineNo)=0D + RaiseParserError(Item, Type, ContainerFile,=0D + '=3D', LineNo)=0D =0D return (List[0], List[1])=0D =0D -## GetPackage=0D +# GetPackage=0D #=0D # Get Package of Inf as [|]=0D #=0D @@ -702,18 +787,21 @@ def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerF= ile, LineNo =3D -1): #=0D # @retval (List[0], List[1])=0D #=0D -def GetPackage(Item, ContainerFile, FileRelativePath, LineNo =3D -1):=0D +=0D +=0D +def GetPackage(Item, ContainerFile, FileRelativePath, LineNo=3D-1):=0D ItemNew =3D Item + TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], Line= No)=0D - CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', L= ist[0], LineNo)=0D + CheckFileExist(FileRelativePath,=0D + List[0], ContainerFile, 'Packages', List[0], LineNo)=0D =0D if List[1] !=3D '':=0D CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo)=0D =0D return (List[0], List[1])=0D =0D -## Get Pcd Values of Inf=0D +# Get Pcd Values of Inf=0D #=0D # Get Pcd of Inf as .[|]=0D #=0D @@ -723,6 +811,8 @@ def GetPackage(Item, ContainerFile, FileRelativePath, L= ineNo =3D -1): #=0D # @retval (TokenSpcCName, TokenCName, Value, ItemType) Formatted Pcd Item= =0D #=0D +=0D +=0D def GetPcdOfInf(Item, Type, File, LineNo):=0D Format =3D '.[|]'=0D TokenGuid, TokenName, Value, InfType =3D '', '', '', ''=0D @@ -752,12 +842,12 @@ def GetPcdOfInf(Item, Type, File, LineNo): return (TokenGuid, TokenName, Value, Type)=0D =0D =0D -## Get Pcd Values of Dec=0D +# Get Pcd Values of Dec=0D #=0D # Get Pcd of Dec as .|||=0D # @retval (TokenSpcCName, TokenCName, Value, DatumType, Token, ItemType) F= ormatted Pcd Item=0D #=0D -def GetPcdOfDec(Item, Type, File, LineNo =3D -1):=0D +def GetPcdOfDec(Item, Type, File, LineNo=3D-1):=0D Format =3D '.|||'=0D TokenGuid, TokenName, Value, DatumType, Token =3D '', '', '', '', ''=0D List =3D GetSplitValueList(Item)=0D @@ -776,7 +866,7 @@ def GetPcdOfDec(Item, Type, File, LineNo =3D -1): =0D return (TokenGuid, TokenName, Value, DatumType, Token, Type)=0D =0D -## Parse DEFINE statement=0D +# Parse DEFINE statement=0D #=0D # Get DEFINE macros=0D #=0D @@ -784,15 +874,22 @@ def GetPcdOfDec(Item, Type, File, LineNo =3D -1): # Value1: Macro Name=0D # Value2: Macro Value=0D #=0D +=0D +=0D def ParseDefine(LineValue, StartLine, Table, FileID, Filename, SectionName= , SectionModel, Arch):=0D - EdkLogger.debug(EdkLogger.DEBUG_2, "DEFINE statement '%s' found in sec= tion %s" % (LineValue, SectionName))=0D - Define =3D GetSplitValueList(CleanString(LineValue[LineValue.upper().f= ind(DataType.TAB_DEFINE.upper() + ' ') + len(DataType.TAB_DEFINE + ' ') : ]= ), TAB_EQUAL_SPLIT, 1)=0D - Table.Insert(MODEL_META_DATA_DEFINE, Define[0], Define[1], '', '', '',= Arch, SectionModel, FileID, StartLine, -1, StartLine, -1, 0)=0D + EdkLogger.debug(EdkLogger.DEBUG_2, "DEFINE statement '%s' found in sec= tion %s" % (=0D + LineValue, SectionName))=0D + Define =3D GetSplitValueList(CleanString(LineValue[LineValue.upper().f= ind(=0D + DataType.TAB_DEFINE.upper() + ' ') + len(DataType.TAB_DEFINE + ' '= ):]), TAB_EQUAL_SPLIT, 1)=0D + Table.Insert(MODEL_META_DATA_DEFINE, Define[0], Define[1], '', '',=0D + '', Arch, SectionModel, FileID, StartLine, -1, StartLine,= -1, 0)=0D =0D -## InsertSectionItems=0D +# InsertSectionItems=0D #=0D # Insert item data of a section to a dict=0D #=0D +=0D +=0D def InsertSectionItems(Model, CurrentSection, SectionItemList, ArchList, T= hirdList, RecordSet):=0D # Insert each item data of a section=0D for Index in range(0, len(ArchList)):=0D @@ -804,9 +901,10 @@ def InsertSectionItems(Model, CurrentSection, SectionI= temList, ArchList, ThirdLi Records =3D RecordSet[Model]=0D for SectionItem in SectionItemList:=0D BelongsToItem, EndLine, EndColumn =3D -1, -1, -1=0D - LineValue, StartLine, EndLine, Comment =3D SectionItem[0], Sec= tionItem[1], SectionItem[1], SectionItem[2]=0D + LineValue, StartLine, EndLine, Comment =3D SectionItem[=0D + 0], SectionItem[1], SectionItem[1], SectionItem[2]=0D =0D - EdkLogger.debug(4, "Parsing %s ..." %LineValue)=0D + EdkLogger.debug(4, "Parsing %s ..." % LineValue)=0D # And then parse DEFINE statement=0D if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') >= -1:=0D continue=0D @@ -818,7 +916,7 @@ def InsertSectionItems(Model, CurrentSection, SectionIt= emList, ArchList, ThirdLi if RecordSet !=3D {}:=0D RecordSet[Model] =3D Records=0D =0D -## Insert records to database=0D +# Insert records to database=0D #=0D # Insert item data of a section to database=0D # @param Table: The Table to be inserted=0D @@ -831,6 +929,8 @@ def InsertSectionItems(Model, CurrentSection, SectionIt= emList, ArchList, ThirdLi # @param IfDefList: A list of all conditional statements=0D # @param RecordSet: A dict of all parsed records=0D #=0D +=0D +=0D def InsertSectionItemsIntoDatabase(Table, FileID, Filename, Model, Current= Section, SectionItemList, ArchList, ThirdList, IfDefList, RecordSet):=0D #=0D # Insert each item data of a section=0D @@ -846,31 +946,35 @@ def InsertSectionItemsIntoDatabase(Table, FileID, Fil= ename, Model, CurrentSectio BelongsToItem, EndLine, EndColumn =3D -1, -1, -1=0D LineValue, StartLine, EndLine =3D SectionItem[0], SectionItem[= 1], SectionItem[1]=0D =0D - EdkLogger.debug(4, "Parsing %s ..." %LineValue)=0D + EdkLogger.debug(4, "Parsing %s ..." % LineValue)=0D #=0D # And then parse DEFINE statement=0D #=0D if LineValue.upper().find(DataType.TAB_DEFINE.upper() + ' ') >= -1:=0D - ParseDefine(LineValue, StartLine, Table, FileID, Filename,= CurrentSection, Model, Arch)=0D + ParseDefine(LineValue, StartLine, Table, FileID,=0D + Filename, CurrentSection, Model, Arch)=0D continue=0D =0D #=0D # At last parse other sections=0D #=0D - ID =3D Table.Insert(Model, LineValue, Third, Third, '', '', Ar= ch, -1, FileID, StartLine, -1, StartLine, -1, 0)=0D + ID =3D Table.Insert(Model, LineValue, Third, Third, '',=0D + '', Arch, -1, FileID, StartLine, -1, StartLi= ne, -1, 0)=0D Records.append([LineValue, Arch, StartLine, ID, Third])=0D =0D if RecordSet !=3D {}:=0D RecordSet[Model] =3D Records=0D =0D -## GenMetaDatSectionItem=0D +# GenMetaDatSectionItem=0D +=0D +=0D def GenMetaDatSectionItem(Key, Value, List):=0D if Key not in List:=0D List[Key] =3D [Value]=0D else:=0D List[Key].append(Value)=0D =0D -## IsValidWord=0D +# IsValidWord=0D #=0D # Check whether the word is valid.=0D # ::=3D (a-zA-Z0-9_)(a-zA-Z0-9_-){0,} Alphanumeric characters wi= th=0D @@ -880,6 +984,8 @@ def GenMetaDatSectionItem(Key, Value, List): #=0D # @param Word: The word string need to be checked.=0D #=0D +=0D +=0D def IsValidWord(Word):=0D if not Word:=0D return False=0D diff --git a/BaseTools/Source/Python/Common/RangeExpression.py b/BaseTools/= Source/Python/Common/RangeExpression.py index 039d2814670f..5820806e4ccb 100644 --- a/BaseTools/Source/Python/Common/RangeExpression.py +++ b/BaseTools/Source/Python/Common/RangeExpression.py @@ -36,8 +36,9 @@ ERR_ARRAY_ELE =3D 'This must be HEX value for NList or Ar= ray: [%s].' ERR_EMPTY_EXPR =3D 'Empty expression is not allowed.'=0D ERR_IN_OPERAND =3D 'Macro after IN operator can only be: $(FAMILY), $(ARCH= ), $(TOOL_CHAIN_TAG) and $(TARGET).'=0D =0D +=0D class RangeObject(object):=0D - def __init__(self, start, end, empty =3D False):=0D + def __init__(self, start, end, empty=3DFalse):=0D =0D if int(start) < int(end):=0D self.start =3D int(start)=0D @@ -47,13 +48,15 @@ class RangeObject(object): self.end =3D int(start)=0D self.empty =3D empty=0D =0D +=0D class RangeContainer(object):=0D def __init__(self):=0D self.rangelist =3D []=0D =0D def push(self, RangeObject):=0D self.rangelist.append(RangeObject)=0D - self.rangelist =3D sorted(self.rangelist, key =3D lambda rangeobj = : rangeobj.start)=0D + self.rangelist =3D sorted(=0D + self.rangelist, key=3Dlambda rangeobj: rangeobj.start)=0D self.merge()=0D =0D def pop(self):=0D @@ -68,6 +71,7 @@ class RangeContainer(object): else:=0D newrangelist.append(rangeobj)=0D self.rangelist =3D newrangelist=0D +=0D def merge(self):=0D self.__clean__()=0D for i in range(0, len(self.rangelist) - 1):=0D @@ -75,7 +79,8 @@ class RangeContainer(object): continue=0D else:=0D self.rangelist[i + 1].start =3D self.rangelist[i].start=0D - 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=0D + self.rangelist[i + 1].end =3D self.rangelist[i +=0D + 1].end > self.r= angelist[i].end and self.rangelist[i + 1].end or self.rangelist[i].end=0D self.rangelist[i].empty =3D True=0D =0D self.__clean__()=0D @@ -91,6 +96,7 @@ class RangeContainer(object): class XOROperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "XOR ..."=0D @@ -98,13 +104,16 @@ class XOROperatorObject(object): rangeId =3D str(uuid.uuid1())=0D rangeContainer =3D RangeContainer()=0D rangeContainer.push(RangeObject(0, int(Operand) - 1))=0D - rangeContainer.push(RangeObject(int(Operand) + 1, MAX_VAL_TYPE[Dat= aType]))=0D + rangeContainer.push(RangeObject(=0D + int(Operand) + 1, MAX_VAL_TYPE[DataType]))=0D SymbolTable[rangeId] =3D rangeContainer=0D return rangeId=0D =0D +=0D class LEOperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "LE ..."=0D @@ -114,9 +123,12 @@ class LEOperatorObject(object): rangeContainer.push(RangeObject(0, int(Operand)))=0D SymbolTable[rangeId1] =3D rangeContainer=0D return rangeId1=0D +=0D +=0D class LTOperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "LT ..."=0D @@ -127,9 +139,11 @@ class LTOperatorObject(object): SymbolTable[rangeId1] =3D rangeContainer=0D return rangeId1=0D =0D +=0D class GEOperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "GE ..."=0D @@ -140,22 +154,27 @@ class GEOperatorObject(object): SymbolTable[rangeId1] =3D rangeContainer=0D return rangeId1=0D =0D +=0D class GTOperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "GT ..."=0D raise BadExpression(ERR_SNYTAX % Expr)=0D rangeId1 =3D str(uuid.uuid1())=0D rangeContainer =3D RangeContainer()=0D - rangeContainer.push(RangeObject(int(Operand) + 1, MAX_VAL_TYPE[Dat= aType]))=0D + rangeContainer.push(RangeObject(=0D + int(Operand) + 1, MAX_VAL_TYPE[DataType]))=0D SymbolTable[rangeId1] =3D rangeContainer=0D return rangeId1=0D =0D +=0D class EQOperatorObject(object):=0D def __init__(self):=0D pass=0D +=0D def Calculate(self, Operand, DataType, SymbolTable):=0D if isinstance(Operand, type('')) and not Operand.isalnum():=0D Expr =3D "EQ ..."=0D @@ -166,6 +185,7 @@ class EQOperatorObject(object): SymbolTable[rangeId1] =3D rangeContainer=0D return rangeId1=0D =0D +=0D def GetOperatorObject(Operator):=0D if Operator =3D=3D '>':=0D return GTOperatorObject()=0D @@ -182,17 +202,18 @@ def GetOperatorObject(Operator): else:=0D raise BadExpression("Bad Operator")=0D =0D +=0D class RangeExpression(BaseExpression):=0D # Logical operator mapping=0D LogicalOperators =3D {=0D - '&&' : 'and', '||' : 'or',=0D - '!' : 'not', 'AND': 'and',=0D - 'OR' : 'or' , 'NOT': 'not',=0D - 'XOR': '^' , 'xor': '^',=0D - 'EQ' : '=3D=3D' , 'NE' : '!=3D',=0D - 'GT' : '>' , 'LT' : '<',=0D - 'GE' : '>=3D' , 'LE' : '<=3D',=0D - 'IN' : 'in'=0D + '&&': 'and', '||': 'or',=0D + '!': 'not', 'AND': 'and',=0D + 'OR': 'or', 'NOT': 'not',=0D + 'XOR': '^', 'xor': '^',=0D + 'EQ': '=3D=3D', 'NE': '!=3D',=0D + 'GT': '>', 'LT': '<',=0D + 'GE': '>=3D', 'LE': '<=3D',=0D + 'IN': 'in'=0D }=0D =0D NonLetterOpLst =3D ['+', '-', '&', '|', '^', '!', '=3D', '>', '<']=0D @@ -227,7 +248,6 @@ class RangeExpression(BaseExpression): self._Expr =3D expr=0D return expr=0D =0D -=0D def EvalRange(self, Operator, Oprand):=0D =0D operatorobj =3D GetOperatorObject(Operator)=0D @@ -283,23 +303,23 @@ class RangeExpression(BaseExpression): # rangeContainer.dump()=0D return rangeid=0D =0D -=0D def NegativeRange(self, Oprand1):=0D rangeContainer1 =3D self.operanddict[Oprand1]=0D =0D -=0D rangeids =3D []=0D =0D for rangeobj in rangeContainer1.pop():=0D rangeContainer =3D RangeContainer()=0D rangeid =3D str(uuid.uuid1())=0D if rangeobj.empty:=0D - rangeContainer.push(RangeObject(0, MAX_VAL_TYPE[self.PcdDa= taType]))=0D + rangeContainer.push(RangeObject(=0D + 0, MAX_VAL_TYPE[self.PcdDataType]))=0D else:=0D if rangeobj.start > 0:=0D rangeContainer.push(RangeObject(0, rangeobj.start - 1)= )=0D if rangeobj.end < MAX_VAL_TYPE[self.PcdDataType]:=0D - rangeContainer.push(RangeObject(rangeobj.end + 1, MAX_= VAL_TYPE[self.PcdDataType]))=0D + rangeContainer.push(RangeObject(=0D + rangeobj.end + 1, MAX_VAL_TYPE[self.PcdDataType]))= =0D self.operanddict[rangeid] =3D rangeContainer=0D rangeids.append(rangeid)=0D =0D @@ -321,7 +341,7 @@ class RangeExpression(BaseExpression): self.operanddict[rangeid2] =3D self.operanddict[re]=0D return rangeid2=0D =0D - def Eval(self, Operator, Oprand1, Oprand2 =3D None):=0D + def Eval(self, Operator, Oprand1, Oprand2=3DNone):=0D =0D if Operator in ["!", "NOT", "not"]:=0D if not gGuidPattern.match(Oprand1.strip()):=0D @@ -330,7 +350,7 @@ class RangeExpression(BaseExpression): else:=0D if Operator in ["=3D=3D", ">=3D", "<=3D", ">", "<", '^']:=0D return self.EvalRange(Operator, Oprand1)=0D - elif Operator =3D=3D 'and' :=0D + elif Operator =3D=3D 'and':=0D if not gGuidPatternEnd.match(Oprand1.strip()) or not gGuid= PatternEnd.match(Oprand2.strip()):=0D raise BadExpression(ERR_STRING_EXPR % Operator)=0D return self.Rangeintersection(Oprand1, Oprand2)=0D @@ -341,11 +361,11 @@ class RangeExpression(BaseExpression): else:=0D raise BadExpression(ERR_STRING_EXPR % Operator)=0D =0D -=0D - def __init__(self, Expression, PcdDataType, SymbolTable =3D None):=0D + def __init__(self, Expression, PcdDataType, SymbolTable=3DNone):=0D if SymbolTable is None:=0D SymbolTable =3D {}=0D - super(RangeExpression, self).__init__(self, Expression, PcdDataTyp= e, SymbolTable)=0D + super(RangeExpression, self).__init__(=0D + self, Expression, PcdDataType, SymbolTable)=0D self._NoProcess =3D False=0D if not isinstance(Expression, type('')):=0D self._Expr =3D Expression=0D @@ -367,7 +387,6 @@ class RangeExpression(BaseExpression): self._Token =3D ''=0D self._WarnExcept =3D None=0D =0D -=0D # Literal token without any conversion=0D self._LiteralToken =3D ''=0D =0D @@ -383,7 +402,7 @@ class RangeExpression(BaseExpression): # @return: True or False if RealValue is False=0D # Evaluated value of string format if RealValue is True=0D #=0D - def __call__(self, RealValue =3D False, Depth =3D 0):=0D + def __call__(self, RealValue=3DFalse, Depth=3D0):=0D if self._NoProcess:=0D return self._Expr=0D =0D @@ -397,7 +416,7 @@ class RangeExpression(BaseExpression): if RealValue and Depth =3D=3D 0:=0D self._Token =3D self._Expr=0D if gGuidPatternEnd.match(self._Expr):=0D - return [self.operanddict[self._Expr] ]=0D + return [self.operanddict[self._Expr]]=0D =0D self._Idx =3D 0=0D self._Token =3D ''=0D @@ -507,11 +526,11 @@ class RangeExpression(BaseExpression): # All whitespace and tabs in array are already stripped.=0D IsArray =3D IsGuid =3D False=0D if len(Token.split(',')) =3D=3D 11 and len(Token.split(',{')) =3D= =3D 2 \=0D - and len(Token.split('},')) =3D=3D 1:=0D + and len(Token.split('},')) =3D=3D 1:=0D HexLen =3D [11, 6, 6, 5, 4, 4, 4, 4, 4, 4, 6]=0D HexList =3D Token.split(',')=0D if HexList[3].startswith('{') and \=0D - not [Index for Index, Hex in enumerate(HexList) if len(Hex= ) > HexLen[Index]]:=0D + not [Index for Index, Hex in enumerate(HexList) if len= (Hex) > HexLen[Index]]:=0D IsGuid =3D True=0D if Token.lstrip('{').rstrip('}').find('{') =3D=3D -1:=0D if not [Hex for Hex in Token.lstrip('{').rstrip('}').split(','= ) if len(Hex) > 4]:=0D @@ -530,7 +549,8 @@ class RangeExpression(BaseExpression): self._Idx +=3D 1=0D =0D # Replace escape \\\", \"=0D - Expr =3D self._Expr[self._Idx:].replace('\\\\', '//').replace('\\\= "', '\\\'')=0D + Expr =3D self._Expr[self._Idx:].replace(=0D + '\\\\', '//').replace('\\\"', '\\\'')=0D for Ch in Expr:=0D self._Idx +=3D 1=0D if Ch =3D=3D '"':=0D @@ -543,7 +563,7 @@ class RangeExpression(BaseExpression): =0D # Get token that is comprised by alphanumeric, underscore or dot(used = by PCD)=0D # @param IsAlphaOp: Indicate if parsing general token or script operat= or(EQ, NE...)=0D - def __GetIdToken(self, IsAlphaOp =3D False):=0D + def __GetIdToken(self, IsAlphaOp=3DFalse):=0D IdToken =3D ''=0D for Ch in self._Expr[self._Idx:]:=0D if not self.__IsIdChar(Ch):=0D @@ -567,7 +587,8 @@ class RangeExpression(BaseExpression): Ex =3D BadExpression(ERR_PCD_RESOLVE % self._Token)=0D Ex.Pcd =3D self._Token=0D raise Ex=0D - self._Token =3D RangeExpression(self._Symb[self._Token], self.= _Symb)(True, self._Depth + 1)=0D + self._Token =3D RangeExpression(=0D + self._Symb[self._Token], self._Symb)(True, self._Depth + 1= )=0D if not isinstance(self._Token, type('')):=0D self._LiteralToken =3D hex(self._Token)=0D return=0D @@ -581,7 +602,7 @@ class RangeExpression(BaseExpression): else:=0D self.__IsNumberToken()=0D =0D - def __GetNList(self, InArray =3D False):=0D + def __GetNList(self, InArray=3DFalse):=0D self._GetSingleToken()=0D if not self.__IsHexLiteral():=0D if InArray:=0D @@ -609,7 +630,7 @@ class RangeExpression(BaseExpression): =0D def __IsHexLiteral(self):=0D if self._LiteralToken.startswith('{') and \=0D - self._LiteralToken.endswith('}'):=0D + self._LiteralToken.endswith('}'):=0D return True=0D =0D if gHexPattern.match(self._LiteralToken):=0D @@ -645,7 +666,7 @@ class RangeExpression(BaseExpression): Ch =3D Expr[0]=0D Match =3D gGuidPattern.match(Expr)=0D if Match and not Expr[Match.end():Match.end() + 1].isalnum() \= =0D - and Expr[Match.end():Match.end() + 1] !=3D '_':=0D + and Expr[Match.end():Match.end() + 1] !=3D '_':=0D self._Idx +=3D Match.end()=0D self._Token =3D Expr[0:Match.end()]=0D return self._Token=0D diff --git a/BaseTools/Source/Python/Common/StringUtils.py b/BaseTools/Sour= ce/Python/Common/StringUtils.py index 73dafa797a52..370ce7147681 100644 --- a/BaseTools/Source/Python/Common/StringUtils.py +++ b/BaseTools/Source/Python/Common/StringUtils.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common string related functions used in pars= ing process=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -24,7 +24,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as= mws gHexVerPatt =3D re.compile('0x[a-f0-9]{4}[a-f0-9]{4}$', re.IGNORECASE)=0D gHumanReadableVerPatt =3D re.compile(r'([1-9][0-9]*|0)\.[0-9]{1,2}$')=0D =0D -## GetSplitValueList=0D +# GetSplitValueList=0D #=0D # Get a value list from a string with multiple values split with SplitTag= =0D # The default SplitTag is DataType.TAB_VALUE_SPLIT=0D @@ -36,7 +36,9 @@ gHumanReadableVerPatt =3D re.compile(r'([1-9][0-9]*|0)\.[= 0-9]{1,2}$') #=0D # @retval list() A list for splitted string=0D #=0D -def GetSplitValueList(String, SplitTag=3DDataType.TAB_VALUE_SPLIT, MaxSpli= t=3D -1):=0D +=0D +=0D +def GetSplitValueList(String, SplitTag=3DDataType.TAB_VALUE_SPLIT, MaxSpli= t=3D-1):=0D ValueList =3D []=0D Last =3D 0=0D Escaped =3D False=0D @@ -80,7 +82,7 @@ def GetSplitValueList(String, SplitTag=3DDataType.TAB_VAL= UE_SPLIT, MaxSplit=3D -1): =0D return ValueList=0D =0D -## GetSplitList=0D +# GetSplitList=0D #=0D # Get a value list from a string with multiple values split with SplitStri= ng=0D # The default SplitTag is DataType.TAB_VALUE_SPLIT=0D @@ -92,10 +94,12 @@ def GetSplitValueList(String, SplitTag=3DDataType.TAB_V= ALUE_SPLIT, MaxSplit=3D -1): #=0D # @retval list() A list for splitted string=0D #=0D -def GetSplitList(String, SplitStr=3DDataType.TAB_VALUE_SPLIT, MaxSplit=3D = -1):=0D +=0D +=0D +def GetSplitList(String, SplitStr=3DDataType.TAB_VALUE_SPLIT, MaxSplit=3D-= 1):=0D return list(map(lambda l: l.strip(), String.split(SplitStr, MaxSplit))= )=0D =0D -## MergeArches=0D +# MergeArches=0D #=0D # Find a key's all arches in dict, add the new arch to the list=0D # If not exist any arch, set the arch directly=0D @@ -104,13 +108,15 @@ def GetSplitList(String, SplitStr=3DDataType.TAB_VALU= E_SPLIT, MaxSplit=3D -1): # @param Key: The input value for Key=0D # @param Arch: The Arch to be added or merged=0D #=0D +=0D +=0D def MergeArches(Dict, Key, Arch):=0D if Key in Dict:=0D Dict[Key].append(Arch)=0D else:=0D Dict[Key] =3D Arch.split()=0D =0D -## GenDefines=0D +# GenDefines=0D #=0D # Parse a string with format "DEFINE =3D "=0D # Generate a map Defines[VarName] =3D PATH=0D @@ -124,9 +130,12 @@ def MergeArches(Dict, Key, Arch): # @retval 1 DEFINE statement found, but not valid=0D # @retval -1 DEFINE statement not found=0D #=0D +=0D +=0D def GenDefines(String, Arch, Defines):=0D if String.find(DataType.TAB_DEFINE + ' ') > -1:=0D - List =3D String.replace(DataType.TAB_DEFINE + ' ', '').split(DataT= ype.TAB_EQUAL_SPLIT)=0D + List =3D String.replace(DataType.TAB_DEFINE + ' ',=0D + '').split(DataType.TAB_EQUAL_SPLIT)=0D if len(List) =3D=3D 2:=0D Defines[(CleanString(List[0]), Arch)] =3D CleanString(List[1])= =0D return 0=0D @@ -135,7 +144,7 @@ def GenDefines(String, Arch, Defines): =0D return 1=0D =0D -## GenInclude=0D +# GenInclude=0D #=0D # Parse a string with format "!include "=0D # Return the file path=0D @@ -148,15 +157,18 @@ def GenDefines(String, Arch, Defines): # @retval True=0D # @retval False=0D #=0D +=0D +=0D def GenInclude(String, IncludeFiles, Arch):=0D if String.upper().find(DataType.TAB_INCLUDE.upper() + ' ') > -1:=0D - IncludeFile =3D CleanString(String[String.upper().find(DataType.TA= B_INCLUDE.upper() + ' ') + len(DataType.TAB_INCLUDE + ' ') : ])=0D + IncludeFile =3D CleanString(String[String.upper().find(=0D + DataType.TAB_INCLUDE.upper() + ' ') + len(DataType.TAB_INCLUDE= + ' '):])=0D MergeArches(IncludeFiles, IncludeFile, Arch)=0D return True=0D else:=0D return False=0D =0D -## GetLibraryClassesWithModuleType=0D +# GetLibraryClassesWithModuleType=0D #=0D # Get Library Class definition when no module type defined=0D #=0D @@ -167,6 +179,8 @@ def GenInclude(String, IncludeFiles, Arch): #=0D # @retval True Get library classes successfully=0D #=0D +=0D +=0D def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacte= r):=0D newKey =3D SplitModuleType(Key)=0D Lines =3D Lines.split(DataType.TAB_SECTION_END, 1)[1]=0D @@ -178,7 +192,7 @@ def GetLibraryClassesWithModuleType(Lines, Key, KeyValu= es, CommentCharacter): =0D return True=0D =0D -## GetDynamics=0D +# GetDynamics=0D #=0D # Get Dynamic Pcds=0D #=0D @@ -189,6 +203,8 @@ def GetLibraryClassesWithModuleType(Lines, Key, KeyValu= es, CommentCharacter): #=0D # @retval True Get Dynamic Pcds successfully=0D #=0D +=0D +=0D def GetDynamics(Lines, Key, KeyValues, CommentCharacter):=0D #=0D # Get SkuId Name List=0D @@ -200,11 +216,12 @@ def GetDynamics(Lines, Key, KeyValues, CommentCharact= er): for Line in LineList:=0D Line =3D CleanString(Line, CommentCharacter)=0D if Line !=3D '' and Line[0] !=3D CommentCharacter:=0D - KeyValues.append([CleanString(Line, CommentCharacter), SkuIdNa= meList[1]])=0D + KeyValues.append(=0D + [CleanString(Line, CommentCharacter), SkuIdNameList[1]])=0D =0D return True=0D =0D -## SplitModuleType=0D +# SplitModuleType=0D #=0D # Split ModuleType out of section defien to get key=0D # [LibraryClass.Arch.ModuleType|ModuleType|ModuleType] -> [ 'LibraryClass.= Arch', ['ModuleType', 'ModuleType', 'ModuleType'] ]=0D @@ -213,6 +230,8 @@ def GetDynamics(Lines, Key, KeyValues, CommentCharacter= ): #=0D # @retval ReturnValue A list for module types=0D #=0D +=0D +=0D def SplitModuleType(Key):=0D KeyList =3D Key.split(DataType.TAB_SPLIT)=0D #=0D @@ -232,7 +251,7 @@ def SplitModuleType(Key): =0D return ReturnValue=0D =0D -## Replace macro in strings list=0D +# Replace macro in strings list=0D #=0D # This method replace macros used in a given string list. The macros are=0D # given in a dictionary.=0D @@ -243,19 +262,22 @@ def SplitModuleType(Key): #=0D # @retval NewList A new string list whose macros are replaced=0D #=0D +=0D +=0D def ReplaceMacros(StringList, MacroDefinitions=3DNone, SelfReplacement=3DF= alse):=0D NewList =3D []=0D if MacroDefinitions is None:=0D MacroDefinitions =3D {}=0D for String in StringList:=0D if isinstance(String, type('')):=0D - NewList.append(ReplaceMacro(String, MacroDefinitions, SelfRepl= acement))=0D + NewList.append(ReplaceMacro(=0D + String, MacroDefinitions, SelfReplacement))=0D else:=0D NewList.append(String)=0D =0D return NewList=0D =0D -## Replace macro in string=0D +# Replace macro in string=0D #=0D # This method replace macros used in given string. The macros are given in= a=0D # dictionary.=0D @@ -266,6 +288,8 @@ def ReplaceMacros(StringList, MacroDefinitions=3DNone, = SelfReplacement=3DFalse): #=0D # @retval string The string whose macros are replaced=0D #=0D +=0D +=0D def ReplaceMacro(String, MacroDefinitions=3DNone, SelfReplacement=3DFalse,= RaiseError=3DFalse):=0D LastString =3D String=0D if MacroDefinitions is None:=0D @@ -284,7 +308,8 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, SelfR= eplacement=3DFalse, RaiseErro String =3D String.replace("$(%s)" % Macro, '')=0D continue=0D if "$(%s)" % Macro not in MacroDefinitions[Macro]:=0D - String =3D String.replace("$(%s)" % Macro, MacroDefinition= s[Macro])=0D + String =3D String.replace(=0D + "$(%s)" % Macro, MacroDefinitions[Macro])=0D # in case there's macro not defined=0D if String =3D=3D LastString:=0D break=0D @@ -292,7 +317,7 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, SelfR= eplacement=3DFalse, RaiseErro =0D return String=0D =0D -## NormPath=0D +# NormPath=0D #=0D # Create a normal path=0D # And replace DEFINE in the path=0D @@ -302,6 +327,8 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, SelfR= eplacement=3DFalse, RaiseErro #=0D # @retval Path Formatted path=0D #=0D +=0D +=0D def NormPath(Path, Defines=3DNone):=0D IsRelativePath =3D False=0D if Path:=0D @@ -317,7 +344,7 @@ def NormPath(Path, Defines=3DNone): #=0D Path =3D os.path.normpath(Path)=0D if Path.startswith(GlobalData.gWorkspace) and not Path.startswith(= GlobalData.gBuildDirectory) and not os.path.exists(Path):=0D - Path =3D Path[len (GlobalData.gWorkspace):]=0D + Path =3D Path[len(GlobalData.gWorkspace):]=0D if Path[0] =3D=3D os.path.sep:=0D Path =3D Path[1:]=0D Path =3D mws.join(GlobalData.gWorkspace, Path)=0D @@ -327,7 +354,7 @@ def NormPath(Path, Defines=3DNone): =0D return Path=0D =0D -## CleanString=0D +# CleanString=0D #=0D # Remove comments in a string=0D # Remove spaces=0D @@ -337,11 +364,13 @@ def NormPath(Path, Defines=3DNone): #=0D # @retval Path Formatted path=0D #=0D +=0D +=0D def CleanString(Line, CommentCharacter=3DDataType.TAB_COMMENT_SPLIT, Allow= CppStyleComment=3DFalse, BuildOption=3DFalse):=0D #=0D # remove whitespace=0D #=0D - Line =3D Line.strip();=0D + Line =3D Line.strip()=0D #=0D # Replace Edk's comment character=0D #=0D @@ -383,11 +412,11 @@ def CleanString(Line, CommentCharacter=3DDataType.TAB= _COMMENT_SPLIT, AllowCppStyle #=0D # remove whitespace again=0D #=0D - Line =3D Line.strip();=0D + Line =3D Line.strip()=0D =0D return Line=0D =0D -## CleanString2=0D +# CleanString2=0D #=0D # Split statement with comments in a string=0D # Remove spaces=0D @@ -397,11 +426,13 @@ def CleanString(Line, CommentCharacter=3DDataType.TAB= _COMMENT_SPLIT, AllowCppStyle #=0D # @retval Path Formatted path=0D #=0D +=0D +=0D def CleanString2(Line, CommentCharacter=3DDataType.TAB_COMMENT_SPLIT, Allo= wCppStyleComment=3DFalse):=0D #=0D # remove whitespace=0D #=0D - Line =3D Line.strip();=0D + Line =3D Line.strip()=0D #=0D # Replace Edk's comment character=0D #=0D @@ -428,7 +459,7 @@ def CleanString2(Line, CommentCharacter=3DDataType.TAB_= COMMENT_SPLIT, AllowCppStyl =0D return Line, Comment=0D =0D -## GetMultipleValuesOfKeyFromLines=0D +# GetMultipleValuesOfKeyFromLines=0D #=0D # Parse multiple strings to clean comment and spaces=0D # The result is saved to KeyValues=0D @@ -440,6 +471,8 @@ def CleanString2(Line, CommentCharacter=3DDataType.TAB_= COMMENT_SPLIT, AllowCppStyl #=0D # @retval True Successfully executed=0D #=0D +=0D +=0D def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValues, CommentCharacte= r):=0D Lines =3D Lines.split(DataType.TAB_SECTION_END, 1)[1]=0D LineList =3D Lines.split('\n')=0D @@ -450,7 +483,7 @@ def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValu= es, CommentCharacter): =0D return True=0D =0D -## GetDefineValue=0D +# GetDefineValue=0D #=0D # Parse a DEFINE statement to get defined value=0D # DEFINE Key Value=0D @@ -461,11 +494,13 @@ def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyVa= lues, CommentCharacter): #=0D # @retval string The defined value=0D #=0D +=0D +=0D def GetDefineValue(String, Key, CommentCharacter):=0D String =3D CleanString(String)=0D - return String[String.find(Key + ' ') + len(Key + ' ') : ]=0D + return String[String.find(Key + ' ') + len(Key + ' '):]=0D =0D -## GetHexVerValue=0D +# GetHexVerValue=0D #=0D # Get a Hex Version Value=0D #=0D @@ -476,6 +511,8 @@ def GetDefineValue(String, Key, CommentCharacter): # If VerString is correctly formatted, return a Hex value of= the Version Number (0xmmmmnnnn)=0D # where mmmm is the major number and nnnn is the adjuste= d minor number.=0D #=0D +=0D +=0D def GetHexVerValue(VerString):=0D VerString =3D CleanString(VerString)=0D =0D @@ -485,7 +522,7 @@ def GetHexVerValue(VerString): Minor =3D ValueList[1]=0D if len(Minor) =3D=3D 1:=0D Minor +=3D '0'=0D - DeciValue =3D (int(Major) << 16) + int(Minor);=0D + DeciValue =3D (int(Major) << 16) + int(Minor)=0D return "0x%08x" % DeciValue=0D elif gHexVerPatt.match(VerString):=0D return VerString=0D @@ -493,7 +530,7 @@ def GetHexVerValue(VerString): return None=0D =0D =0D -## GetSingleValueOfKeyFromLines=0D +# GetSingleValueOfKeyFromLines=0D #=0D # Parse multiple strings as below to get value of each definition line=0D # Key1 =3D Value1=0D @@ -523,12 +560,14 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, C= ommentCharacter, KeySplitCh if Line.find(DataType.TAB_INF_DEFINES_DEFINE + ' ') > -1:=0D if '' in DefineValues:=0D DefineValues.remove('')=0D - DefineValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFI= NES_DEFINE, CommentCharacter))=0D + DefineValues.append(GetDefineValue(=0D + Line, DataType.TAB_INF_DEFINES_DEFINE, CommentCharacter))= =0D continue=0D if Line.find(DataType.TAB_INF_DEFINES_SPEC + ' ') > -1:=0D if '' in SpecValues:=0D SpecValues.remove('')=0D - SpecValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINE= S_SPEC, CommentCharacter))=0D + SpecValues.append(GetDefineValue(=0D + Line, DataType.TAB_INF_DEFINES_SPEC, CommentCharacter))=0D continue=0D =0D #=0D @@ -543,9 +582,11 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Co= mmentCharacter, KeySplitCh #=0D LineList[1] =3D CleanString(LineList[1], CommentCharacter)= =0D if ValueSplitFlag:=0D - Value =3D list(map(string.strip, LineList[1].split(Val= ueSplitCharacter)))=0D + Value =3D list(=0D + map(string.strip, LineList[1].split(ValueSplitChar= acter)))=0D else:=0D - Value =3D CleanString(LineList[1], CommentCharacter).s= plitlines()=0D + Value =3D CleanString(=0D + LineList[1], CommentCharacter).splitlines()=0D =0D if Key[0] in Dictionary:=0D if Key[0] not in Keys:=0D @@ -565,7 +606,7 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Com= mentCharacter, KeySplitCh =0D return True=0D =0D -## The content to be parsed=0D +# The content to be parsed=0D #=0D # Do pre-check for a file before it is parsed=0D # Check $()=0D @@ -575,6 +616,8 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Com= mentCharacter, KeySplitCh # @param FileContent: File content to be parsed=0D # @param SupSectionTag: Used for error report=0D #=0D +=0D +=0D def PreCheck(FileName, FileContent, SupSectionTag):=0D LineNo =3D 0=0D IsFailed =3D False=0D @@ -596,7 +639,8 @@ def PreCheck(FileName, FileContent, SupSectionTag): #=0D if Line.find('$') > -1:=0D if Line.find('$(') < 0 or Line.find(')') < 0:=0D - EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo, F= ile=3DFileName, RaiseError=3DEdkLogger.IsRaiseError)=0D + EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DEdkLogger.Is= RaiseError)=0D =0D #=0D # Check []=0D @@ -606,7 +650,8 @@ def PreCheck(FileName, FileContent, SupSectionTag): # Only get one '[' or one ']'=0D #=0D if not (Line.find('[') > -1 and Line.find(']') > -1):=0D - EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo, F= ile=3DFileName, RaiseError=3DEdkLogger.IsRaiseError)=0D + EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DEdkLogger.Is= RaiseError)=0D =0D #=0D # Regenerate FileContent=0D @@ -614,11 +659,12 @@ def PreCheck(FileName, FileContent, SupSectionTag): NewFileContent =3D NewFileContent + Line + '\r\n'=0D =0D if IsFailed:=0D - EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo, File=3DFil= eName, RaiseError=3DEdkLogger.IsRaiseError)=0D + EdkLogger.error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DEdkLogger.IsRaiseErr= or)=0D =0D return NewFileContent=0D =0D -## CheckFileType=0D +# CheckFileType=0D #=0D # Check if the Filename is including ExtName=0D # Return True if it exists=0D @@ -632,20 +678,23 @@ def PreCheck(FileName, FileContent, SupSectionTag): #=0D # @retval True The file type is correct=0D #=0D -def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, = Line, LineNo=3D -1):=0D +=0D +=0D +def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, = Line, LineNo=3D-1):=0D if CheckFilename !=3D '' and CheckFilename is not None:=0D (Root, Ext) =3D os.path.splitext(CheckFilename)=0D if Ext.upper() !=3D ExtName.upper():=0D ContainerFile =3D open(ContainerFilename, 'r').read()=0D if LineNo =3D=3D -1:=0D LineNo =3D GetLineNo(ContainerFile, Line)=0D - ErrorMsg =3D "Invalid %s. '%s' is found, but '%s' file is need= ed" % (SectionName, CheckFilename, ExtName)=0D + ErrorMsg =3D "Invalid %s. '%s' is found, but '%s' file is need= ed" % (=0D + SectionName, CheckFilename, ExtName)=0D EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, Line=3DLineN= o,=0D File=3DContainerFilename, RaiseError=3DEdkLogg= er.IsRaiseError)=0D =0D return True=0D =0D -## CheckFileExist=0D +# CheckFileExist=0D #=0D # Check if the file exists=0D # Return True if it exists=0D @@ -659,7 +708,9 @@ def CheckFileType(CheckFilename, ExtName, ContainerFile= name, SectionName, Line, #=0D # @retval The file full path if the file exists=0D #=0D -def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, Section= Name, Line, LineNo=3D -1):=0D +=0D +=0D +def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, Section= Name, Line, LineNo=3D-1):=0D CheckFile =3D ''=0D if CheckFilename !=3D '' and CheckFilename is not None:=0D CheckFile =3D WorkspaceFile(WorkspaceDir, CheckFilename)=0D @@ -667,13 +718,14 @@ def CheckFileExist(WorkspaceDir, CheckFilename, Conta= inerFilename, SectionName, ContainerFile =3D open(ContainerFilename, 'r').read()=0D if LineNo =3D=3D -1:=0D LineNo =3D GetLineNo(ContainerFile, Line)=0D - ErrorMsg =3D "Can't find file '%s' defined in section '%s'" % = (CheckFile, SectionName)=0D + ErrorMsg =3D "Can't find file '%s' defined in section '%s'" % = (=0D + CheckFile, SectionName)=0D EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg,=0D File=3DContainerFilename, Line=3DLineNo, Raise= Error=3DEdkLogger.IsRaiseError)=0D =0D return CheckFile=0D =0D -## GetLineNo=0D +# GetLineNo=0D #=0D # Find the index of a line in a file=0D #=0D @@ -683,6 +735,8 @@ def CheckFileExist(WorkspaceDir, CheckFilename, Contain= erFilename, SectionName, # @retval int Index of the line=0D # @retval -1 The line is not found=0D #=0D +=0D +=0D def GetLineNo(FileContent, Line, IsIgnoreComment=3DTrue):=0D LineList =3D FileContent.splitlines()=0D for Index in range(len(LineList)):=0D @@ -697,7 +751,7 @@ def GetLineNo(FileContent, Line, IsIgnoreComment=3DTrue= ): =0D return -1=0D =0D -## RaiseParserError=0D +# RaiseParserError=0D #=0D # Raise a parser error=0D #=0D @@ -706,15 +760,19 @@ def GetLineNo(FileContent, Line, IsIgnoreComment=3DTr= ue): # @param File: File which has the string=0D # @param Format: Correct format=0D #=0D -def RaiseParserError(Line, Section, File, Format=3D'', LineNo=3D -1):=0D +=0D +=0D +def RaiseParserError(Line, Section, File, Format=3D'', LineNo=3D-1):=0D if LineNo =3D=3D -1:=0D LineNo =3D GetLineNo(open(os.path.normpath(File), 'r').read(), Lin= e)=0D - ErrorMsg =3D "Invalid statement '%s' is found in section '%s'" % (Line= , Section)=0D + ErrorMsg =3D "Invalid statement '%s' is found in section '%s'" % (=0D + Line, Section)=0D if Format !=3D '':=0D Format =3D "Correct format is " + Format=0D - EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=3DFile, Line=3D= LineNo, ExtraData=3DFormat, RaiseError=3DEdkLogger.IsRaiseError)=0D + EdkLogger.error("Parser", PARSER_ERROR, ErrorMsg, File=3DFile,=0D + Line=3DLineNo, ExtraData=3DFormat, RaiseError=3DEdkLog= ger.IsRaiseError)=0D =0D -## WorkspaceFile=0D +# WorkspaceFile=0D #=0D # Return a full path with workspace dir=0D #=0D @@ -723,10 +781,12 @@ def RaiseParserError(Line, Section, File, Format=3D''= , LineNo=3D -1): #=0D # @retval string A full path=0D #=0D +=0D +=0D def WorkspaceFile(WorkspaceDir, Filename):=0D return mws.join(NormPath(WorkspaceDir), NormPath(Filename))=0D =0D -## Split string=0D +# Split string=0D #=0D # Remove '"' which startswith and endswith string=0D #=0D @@ -734,6 +794,8 @@ def WorkspaceFile(WorkspaceDir, Filename): #=0D # @retval String: The string after removed '""'=0D #=0D +=0D +=0D def SplitString(String):=0D if String.startswith('\"'):=0D String =3D String[1:]=0D @@ -742,27 +804,33 @@ def SplitString(String): =0D return String=0D =0D -## Convert To Sql String=0D +# Convert To Sql String=0D #=0D # 1. Replace "'" with "''" in each item of StringList=0D #=0D # @param StringList: A list for strings to be converted=0D #=0D +=0D +=0D def ConvertToSqlString(StringList):=0D return list(map(lambda s: s.replace("'", "''"), StringList))=0D =0D -## Convert To Sql String=0D +# Convert To Sql String=0D #=0D # 1. Replace "'" with "''" in the String=0D #=0D # @param String: A String to be converted=0D #=0D +=0D +=0D def ConvertToSqlString2(String):=0D return String.replace("'", "''")=0D =0D #=0D # Remove comment block=0D #=0D +=0D +=0D def RemoveBlockComment(Lines):=0D IsFindBlockComment =3D False=0D IsFindBlockCode =3D False=0D @@ -775,10 +843,12 @@ def RemoveBlockComment(Lines): # Remove comment block=0D #=0D if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:=0D - ReservedLine =3D GetSplitList(Line, DataType.TAB_COMMENT_EDK_S= TART, 1)[0]=0D + ReservedLine =3D GetSplitList(=0D + Line, DataType.TAB_COMMENT_EDK_START, 1)[0]=0D IsFindBlockComment =3D True=0D if Line.find(DataType.TAB_COMMENT_EDK_END) > -1:=0D - Line =3D ReservedLine + GetSplitList(Line, DataType.TAB_COMMEN= T_EDK_END, 1)[1]=0D + Line =3D ReservedLine + \=0D + GetSplitList(Line, DataType.TAB_COMMENT_EDK_END, 1)[1]=0D ReservedLine =3D ''=0D IsFindBlockComment =3D False=0D if IsFindBlockComment:=0D @@ -791,6 +861,8 @@ def RemoveBlockComment(Lines): #=0D # Get String of a List=0D #=0D +=0D +=0D def GetStringOfList(List, Split=3D' '):=0D if not isinstance(List, type([])):=0D return List=0D @@ -803,16 +875,20 @@ def GetStringOfList(List, Split=3D' '): #=0D # Get HelpTextList from HelpTextClassList=0D #=0D +=0D +=0D def GetHelpTextList(HelpTextClassList):=0D List =3D []=0D if HelpTextClassList:=0D for HelpText in HelpTextClassList:=0D if HelpText.String.endswith('\n'):=0D - HelpText.String =3D HelpText.String[0: len(HelpText.String= ) - len('\n')]=0D + HelpText.String =3D HelpText.String[0: len(=0D + HelpText.String) - len('\n')]=0D List.extend(HelpText.String.split('\n'))=0D =0D return List=0D =0D +=0D def StringToArray(String):=0D if String.startswith('L"'):=0D if String =3D=3D "L\"\"":=0D @@ -836,6 +912,7 @@ def StringToArray(String): else:=0D return '{%s,0,0}' % ','.join(String.split())=0D =0D +=0D def StringArrayLength(String):=0D if String.startswith('L"'):=0D return (len(String) - 3 + 1) * 2=0D @@ -844,6 +921,7 @@ def StringArrayLength(String): else:=0D return len(String.split()) + 1=0D =0D +=0D def RemoveDupOption(OptionString, Which=3D"/I", Against=3DNone):=0D OptionList =3D OptionString.split()=0D ValueList =3D []=0D @@ -863,6 +941,7 @@ def RemoveDupOption(OptionString, Which=3D"/I", Against= =3DNone): ValueList.append(Val)=0D return " ".join(OptionList)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -870,4 +949,3 @@ def RemoveDupOption(OptionString, Which=3D"/I", Against= =3DNone): #=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/Common/TargetTxtClassObject.py b/BaseT= ools/Source/Python/Common/TargetTxtClassObject.py index 363c38302b8e..77f3098f801e 100644 --- a/BaseTools/Source/Python/Common/TargetTxtClassObject.py +++ b/BaseTools/Source/Python/Common/TargetTxtClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define each component of Target.txt file=0D #=0D # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
        =0D @@ -22,7 +22,7 @@ from Common.MultipleWorkspace import MultipleWorkspace as= mws =0D gDefaultTargetTxtFile =3D "target.txt"=0D =0D -## TargetTxtClassObject=0D +# TargetTxtClassObject=0D #=0D # This class defined content used in file target.txt=0D #=0D @@ -31,23 +31,25 @@ gDefaultTargetTxtFile =3D "target.txt" #=0D # @var TargetTxtDictionary: To store keys and values defined in target.tx= t=0D #=0D +=0D +=0D class TargetTxtClassObject(object):=0D - def __init__(self, Filename =3D None):=0D + def __init__(self, Filename=3DNone):=0D self.TargetTxtDictionary =3D {=0D - DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM = : '',=0D - DataType.TAB_TAT_DEFINES_ACTIVE_MODULE = : '',=0D - DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF = : '',=0D - DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER = : '',=0D - DataType.TAB_TAT_DEFINES_TARGET = : [],=0D - DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG = : [],=0D - DataType.TAB_TAT_DEFINES_TARGET_ARCH = : [],=0D - DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF = : '',=0D + DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM: '',=0D + DataType.TAB_TAT_DEFINES_ACTIVE_MODULE: '',=0D + DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF: '',=0D + DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER: '',=0D + DataType.TAB_TAT_DEFINES_TARGET: [],=0D + DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG: [],=0D + DataType.TAB_TAT_DEFINES_TARGET_ARCH: [],=0D + DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF: '',=0D }=0D self.ConfDirectoryPath =3D ""=0D if Filename is not None:=0D self.LoadTargetTxtFile(Filename)=0D =0D - ## LoadTargetTxtFile=0D + # LoadTargetTxtFile=0D #=0D # Load target.txt file and parse it, return a set structure to store k= eys and values=0D #=0D @@ -58,12 +60,13 @@ class TargetTxtClassObject(object): #=0D def LoadTargetTxtFile(self, Filename):=0D if os.path.exists(Filename) and os.path.isfile(Filename):=0D - return self.ConvertTextFileToDict(Filename, '#', '=3D')=0D + return self.ConvertTextFileToDict(Filename, '#', '=3D')=0D else:=0D - EdkLogger.error("Target.txt Parser", FILE_NOT_FOUND, ExtraData= =3DFilename)=0D + EdkLogger.error("Target.txt Parser",=0D + FILE_NOT_FOUND, ExtraData=3DFilename)=0D return 1=0D =0D - ## ConvertTextFileToDict=0D + # ConvertTextFileToDict=0D #=0D # Convert a text file to a dictionary of (name:value) pairs.=0D # The data is saved to self.TargetTxtDictionary=0D @@ -97,30 +100,36 @@ class TargetTxtClassObject(object): else:=0D Value =3D ""=0D =0D - if Key in [DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM, DataType.= TAB_TAT_DEFINES_TOOL_CHAIN_CONF, \=0D + if Key in [DataType.TAB_TAT_DEFINES_ACTIVE_PLATFORM, DataType.= TAB_TAT_DEFINES_TOOL_CHAIN_CONF,=0D DataType.TAB_TAT_DEFINES_ACTIVE_MODULE, DataType.TA= B_TAT_DEFINES_BUILD_RULE_CONF]:=0D self.TargetTxtDictionary[Key] =3D Value.replace('\\', '/')= =0D if Key =3D=3D DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF and= self.TargetTxtDictionary[Key]:=0D if self.TargetTxtDictionary[Key].startswith("Conf/"):= =0D - Tools_Def =3D os.path.join(self.ConfDirectoryPath,= self.TargetTxtDictionary[Key].strip())=0D + Tools_Def =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDictiona= ry[Key].strip())=0D if not os.path.exists(Tools_Def) or not os.path.is= file(Tools_Def):=0D # If Conf/Conf does not exist, try just the Co= nf/ directory=0D - Tools_Def =3D os.path.join(self.ConfDirectoryP= ath, self.TargetTxtDictionary[Key].replace("Conf/", "", 1).strip())=0D + Tools_Def =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDict= ionary[Key].replace("Conf/", "", 1).strip())=0D else:=0D # The File pointed to by TOOL_CHAIN_CONF is not in= a Conf/ directory=0D - Tools_Def =3D os.path.join(self.ConfDirectoryPath,= self.TargetTxtDictionary[Key].strip())=0D + Tools_Def =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDictiona= ry[Key].strip())=0D self.TargetTxtDictionary[Key] =3D Tools_Def=0D if Key =3D=3D DataType.TAB_TAT_DEFINES_BUILD_RULE_CONF and= self.TargetTxtDictionary[Key]:=0D if self.TargetTxtDictionary[Key].startswith("Conf/"):= =0D - Build_Rule =3D os.path.join(self.ConfDirectoryPath= , self.TargetTxtDictionary[Key].strip())=0D + Build_Rule =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDictiona= ry[Key].strip())=0D if not os.path.exists(Build_Rule) or not os.path.i= sfile(Build_Rule):=0D # If Conf/Conf does not exist, try just the Co= nf/ directory=0D - Build_Rule =3D os.path.join(self.ConfDirectory= Path, self.TargetTxtDictionary[Key].replace("Conf/", "", 1).strip())=0D + Build_Rule =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDict= ionary[Key].replace("Conf/", "", 1).strip())=0D else:=0D # The File pointed to by BUILD_RULE_CONF is not in= a Conf/ directory=0D - Build_Rule =3D os.path.join(self.ConfDirectoryPath= , self.TargetTxtDictionary[Key].strip())=0D + Build_Rule =3D os.path.join(=0D + self.ConfDirectoryPath, self.TargetTxtDictiona= ry[Key].strip())=0D self.TargetTxtDictionary[Key] =3D Build_Rule=0D - elif Key in [DataType.TAB_TAT_DEFINES_TARGET, DataType.TAB_TAT= _DEFINES_TARGET_ARCH, \=0D + elif Key in [DataType.TAB_TAT_DEFINES_TARGET, DataType.TAB_TAT= _DEFINES_TARGET_ARCH,=0D DataType.TAB_TAT_DEFINES_TOOL_CHAIN_TAG]:=0D self.TargetTxtDictionary[Key] =3D Value.split()=0D elif Key =3D=3D DataType.TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD= _NUMBER:=0D @@ -130,13 +139,13 @@ class TargetTxtClassObject(object): EdkLogger.error("build", FORMAT_INVALID, "Invalid numb= er of [%s]: %s." % (Key, Value),=0D File=3DFileName)=0D self.TargetTxtDictionary[Key] =3D Value=0D - #elif Key not in GlobalData.gGlobalDefines:=0D + # elif Key not in GlobalData.gGlobalDefines:=0D # GlobalData.gGlobalDefines[Key] =3D Value=0D =0D F.close()=0D return 0=0D =0D -## TargetTxtDict=0D +# TargetTxtDict=0D #=0D # Load target.txt in input Conf dir=0D #=0D @@ -145,6 +154,7 @@ class TargetTxtClassObject(object): # @retval Target An instance of TargetTxtClassObject() with loaded target.= txt=0D #=0D =0D +=0D class TargetTxtDict():=0D =0D def __new__(cls, *args, **kw):=0D @@ -173,19 +183,23 @@ class TargetTxtDict(): if not os.path.isabs(ConfDirectoryPath):=0D # Since alternate directory name is not absolute, the alte= rnate directory is located within the WORKSPACE=0D # This also handles someone specifying the Conf directory = in the workspace. Using --conf=3DConf=0D - ConfDirectoryPath =3D mws.join(os.environ["WORKSPACE"], Co= nfDirectoryPath)=0D + ConfDirectoryPath =3D mws.join(=0D + os.environ["WORKSPACE"], ConfDirectoryPath)=0D else:=0D if "CONF_PATH" in os.environ:=0D - ConfDirectoryPath =3D os.path.normcase(os.path.normpath(os= .environ["CONF_PATH"]))=0D + ConfDirectoryPath =3D os.path.normcase(=0D + os.path.normpath(os.environ["CONF_PATH"]))=0D else:=0D # Get standard WORKSPACE/Conf use the absolute path to the= WORKSPACE/Conf=0D ConfDirectoryPath =3D mws.join(os.environ["WORKSPACE"], 'C= onf')=0D GlobalData.gConfDirectory =3D ConfDirectoryPath=0D - targettxt =3D os.path.normpath(os.path.join(ConfDirectoryPath, gDe= faultTargetTxtFile))=0D + targettxt =3D os.path.normpath(os.path.join(=0D + ConfDirectoryPath, gDefaultTargetTxtFile))=0D if os.path.exists(targettxt):=0D Target.LoadTargetTxtFile(targettxt)=0D self.TxtTarget =3D Target=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -194,6 +208,7 @@ class TargetTxtDict(): if __name__ =3D=3D '__main__':=0D pass=0D Target =3D TargetTxtDict(os.getenv("WORKSPACE"))=0D - print(Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_MAX_CONCURRE= NT_THREAD_NUMBER])=0D + print(=0D + Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_MAX_CONCURRENT= _THREAD_NUMBER])=0D print(Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TARGET])=0D print(Target.TargetTxtDictionary)=0D diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py b/BaseToo= ls/Source/Python/Common/ToolDefClassObject.py index 2b4b23849196..bad836722407 100644 --- a/BaseTools/Source/Python/Common/ToolDefClassObject.py +++ b/BaseTools/Source/Python/Common/ToolDefClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define each component of tools_def.txt file=0D #=0D # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
        =0D @@ -22,9 +22,8 @@ import Common.GlobalData as GlobalData from Common import GlobalData=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D from .DataType import TAB_TOD_DEFINES_TARGET, TAB_TOD_DEFINES_TOOL_CHAIN_T= AG,\=0D - TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_= TYPE\=0D - , TAB_TOD_DEFINES_FAMILY, TAB_TOD_DEFINES_BUILDRULEFA= MILY,\=0D - TAB_STAR, TAB_TAT_DEFINES_TOOL_CHAIN_CONF=0D + TAB_TOD_DEFINES_TARGET_ARCH, TAB_TOD_DEFINES_COMMAND_TYPE, TAB_TOD_DEF= INES_FAMILY, TAB_TOD_DEFINES_BUILDRULEFAMILY,\=0D + TAB_STAR, TAB_TAT_DEFINES_TOOL_CHAIN_CONF=0D =0D =0D ##=0D @@ -35,7 +34,7 @@ gEnvRefPattern =3D re.compile('(ENV\([^\(\)]+\))') gMacroDefPattern =3D re.compile("DEFINE\s+([^\s]+)")=0D gDefaultToolsDefFile =3D "tools_def.txt"=0D =0D -## ToolDefClassObject=0D +# ToolDefClassObject=0D #=0D # This class defined content used in file tools_def.txt=0D #=0D @@ -45,6 +44,8 @@ gDefaultToolsDefFile =3D "tools_def.txt" # @var ToolsDefTxtDictionary: To store keys and values defined in target.= txt=0D # @var MacroDictionary: To store keys and values defined in DEFINE = statement=0D #=0D +=0D +=0D class ToolDefClassObject(object):=0D def __init__(self, FileName=3DNone):=0D self.ToolsDefTxtDictionary =3D {}=0D @@ -55,7 +56,7 @@ class ToolDefClassObject(object): if FileName is not None:=0D self.LoadToolDefFile(FileName)=0D =0D - ## LoadToolDefFile=0D + # LoadToolDefFile=0D #=0D # Load target.txt file and parse it=0D #=0D @@ -67,26 +68,30 @@ class ToolDefClassObject(object): mws.setWs(GlobalData.gWorkspace, PackagesPath)=0D =0D self.ToolsDefTxtDatabase =3D {=0D - TAB_TOD_DEFINES_TARGET : [],=0D - TAB_TOD_DEFINES_TOOL_CHAIN_TAG : [],=0D - TAB_TOD_DEFINES_TARGET_ARCH : [],=0D - TAB_TOD_DEFINES_COMMAND_TYPE : []=0D + TAB_TOD_DEFINES_TARGET: [],=0D + TAB_TOD_DEFINES_TOOL_CHAIN_TAG: [],=0D + TAB_TOD_DEFINES_TARGET_ARCH: [],=0D + TAB_TOD_DEFINES_COMMAND_TYPE: []=0D }=0D =0D self.IncludeToolDefFile(FileName)=0D =0D - self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET] =3D list(set(self= .ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET]))=0D - self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG] =3D list(= set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]))=0D - self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH] =3D list(set= (self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH]))=0D + self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET] =3D list(=0D + set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET]))=0D + self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG] =3D list(= =0D + set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]))= =0D + self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH] =3D list(=0D + set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH]))=0D =0D - self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE] =3D list(se= t(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE]))=0D + self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE] =3D list(=0D + set(self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE]))=0D =0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET].sort()=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_TAG].sort()=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH].sort()=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYPE].sort()=0D =0D - ## IncludeToolDefFile=0D + # IncludeToolDefFile=0D #=0D # Load target.txt file and parse it as if its contents were inside the= main file=0D #=0D @@ -99,9 +104,11 @@ class ToolDefClassObject(object): F =3D open(FileName, 'r')=0D FileContent =3D F.readlines()=0D except:=0D - EdkLogger.error("tools_def.txt parser", FILE_OPEN_FAILURE,= ExtraData=3DFileName)=0D + EdkLogger.error("tools_def.txt parser",=0D + FILE_OPEN_FAILURE, ExtraData=3DFileName)=0D else:=0D - EdkLogger.error("tools_def.txt parser", FILE_NOT_FOUND, ExtraD= ata=3DFileName)=0D + EdkLogger.error("tools_def.txt parser",=0D + FILE_NOT_FOUND, ExtraData=3DFileName)=0D =0D for Index in range(len(FileContent)):=0D Line =3D FileContent[Index].strip()=0D @@ -114,7 +121,7 @@ class ToolDefClassObject(object): if not Done:=0D EdkLogger.error("tools_def.txt parser", ATTRIBUTE_NOT_= AVAILABLE,=0D "Macro or Environment has not been def= ined",=0D - ExtraData=3DIncFile[4:-1], File=3DFileName= , Line=3DIndex+1)=0D + ExtraData=3DIncFile[4:-1], File=3DFile= Name, Line=3DIndex+1)=0D IncFile =3D NormPath(IncFile)=0D =0D if not os.path.isabs(IncFile):=0D @@ -132,10 +139,12 @@ class ToolDefClassObject(object): #=0D # try directory of current file=0D #=0D - IncFileTmp =3D PathClass(IncFile, os.path.dirn= ame(FileName))=0D + IncFileTmp =3D PathClass(=0D + IncFile, os.path.dirname(FileName))=0D ErrorCode =3D IncFileTmp.Validate()[0]=0D if ErrorCode !=3D 0:=0D - EdkLogger.error("tools_def.txt parser", FI= LE_NOT_FOUND, ExtraData=3DIncFile)=0D + EdkLogger.error(=0D + "tools_def.txt parser", FILE_NOT_FOUND= , ExtraData=3DIncFile)=0D =0D if isinstance(IncFileTmp, PathClass):=0D IncFile =3D IncFileTmp.Path=0D @@ -147,14 +156,16 @@ class ToolDefClassObject(object): =0D NameValuePair =3D Line.split("=3D", 1)=0D if len(NameValuePair) !=3D 2:=0D - EdkLogger.warn("tools_def.txt parser", "Line %d: not corre= ct assignment statement, skipped" % (Index + 1))=0D + EdkLogger.warn(=0D + "tools_def.txt parser", "Line %d: not correct assignme= nt statement, skipped" % (Index + 1))=0D continue=0D =0D Name =3D NameValuePair[0].strip()=0D Value =3D NameValuePair[1].strip()=0D =0D if Name =3D=3D "IDENTIFIER":=0D - EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found identif= ier statement, skipped: %s" % ((Index + 1), Value))=0D + EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found identif= ier statement, skipped: %s" % (=0D + (Index + 1), Value))=0D continue=0D =0D MacroDefinition =3D gMacroDefPattern.findall(Name)=0D @@ -163,11 +174,12 @@ class ToolDefClassObject(object): if not Done:=0D EdkLogger.error("tools_def.txt parser", ATTRIBUTE_NOT_= AVAILABLE,=0D "Macro or Environment has not been def= ined",=0D - ExtraData=3DValue[4:-1], File=3DFileName, = Line=3DIndex+1)=0D + ExtraData=3DValue[4:-1], File=3DFileNa= me, Line=3DIndex+1)=0D =0D MacroName =3D MacroDefinition[0].strip()=0D self.MacroDictionary["DEF(%s)" % MacroName] =3D Value=0D - EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found macro: = %s =3D %s" % ((Index + 1), MacroName, Value))=0D + EdkLogger.debug(EdkLogger.DEBUG_8, "Line %d: Found macro: = %s =3D %s" % (=0D + (Index + 1), MacroName, Value))=0D continue=0D =0D Done, Value =3D self.ExpandMacros(Value)=0D @@ -178,10 +190,12 @@ class ToolDefClassObject(object): =0D List =3D Name.split('_')=0D if len(List) !=3D 5:=0D - EdkLogger.verbose("Line %d: Not a valid name of definition= : %s" % ((Index + 1), Name))=0D + EdkLogger.verbose(=0D + "Line %d: Not a valid name of definition: %s" % ((Inde= x + 1), Name))=0D continue=0D elif List[4] =3D=3D TAB_STAR:=0D - EdkLogger.verbose("Line %d: '*' is not allowed in last fie= ld: %s" % ((Index + 1), Name))=0D + EdkLogger.verbose(=0D + "Line %d: '*' is not allowed in last field: %s" % ((In= dex + 1), Name))=0D continue=0D else:=0D self.ToolsDefTxtDictionary[Name] =3D Value=0D @@ -197,20 +211,23 @@ class ToolDefClassObject(object): if TAB_TOD_DEFINES_FAMILY not in self.ToolsDefTxtDatab= ase:=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY] = =3D {}=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][L= ist[1]] =3D Value=0D - self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULE= FAMILY] =3D {}=0D + self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULE= FAMILY] =3D {=0D + }=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULE= FAMILY][List[1]] =3D Value=0D elif List[1] not in self.ToolsDefTxtDatabase[TAB_TOD_D= EFINES_FAMILY]:=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][L= ist[1]] =3D Value=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULE= FAMILY][List[1]] =3D Value=0D elif self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY][= List[1]] !=3D Value:=0D - EdkLogger.verbose("Line %d: No override allowed fo= r the family of a tool chain: %s" % ((Index + 1), Name))=0D + EdkLogger.verbose(=0D + "Line %d: No override allowed for the family o= f a tool chain: %s" % ((Index + 1), Name))=0D if List[4] =3D=3D TAB_TOD_DEFINES_BUILDRULEFAMILY and List= [2] =3D=3D TAB_STAR and List[3] =3D=3D TAB_STAR:=0D if TAB_TOD_DEFINES_BUILDRULEFAMILY not in self.ToolsDe= fTxtDatabase \=0D or List[1] not in self.ToolsDefTxtDatabase[TAB_TOD_= DEFINES_FAMILY]:=0D - EdkLogger.verbose("Line %d: The family is not spec= ified, but BuildRuleFamily is specified for the tool chain: %s" % ((Index += 1), Name))=0D + EdkLogger.verbose(=0D + "Line %d: The family is not specified, but Bui= ldRuleFamily is specified for the tool chain: %s" % ((Index + 1), Name))=0D self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMI= LY][List[1]] =3D Value=0D =0D - ## ExpandMacros=0D + # ExpandMacros=0D #=0D # Replace defined macros with real value=0D #=0D @@ -228,7 +245,8 @@ class ToolDefClassObject(object): if Ref in self.MacroDictionary:=0D Value =3D Value.replace(Ref, self.MacroDictionary[Ref]= )=0D else:=0D - Value =3D Value.replace(Ref, self.MacroDictionary[Ref.= upper()])=0D + Value =3D Value.replace(=0D + Ref, self.MacroDictionary[Ref.upper()])=0D MacroReference =3D gMacroRefPattern.findall(Value)=0D for Ref in MacroReference:=0D if Ref not in self.MacroDictionary:=0D @@ -237,7 +255,7 @@ class ToolDefClassObject(object): =0D return True, Value=0D =0D -## ToolDefDict=0D +# ToolDefDict=0D #=0D # Load tools_def.txt in input Conf dir=0D #=0D @@ -275,11 +293,14 @@ class ToolDefDict(): if ToolsDefFile:=0D ToolDef.LoadToolDefFile(os.path.normpath(ToolsDefFile))=0D else:=0D - ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(self= .ConfDir, gDefaultToolsDefFile)))=0D + ToolDef.LoadToolDefFile(os.path.normpath(=0D + os.path.join(self.ConfDir, gDefaultToolsDefFile)))=0D else:=0D - ToolDef.LoadToolDefFile(os.path.normpath(os.path.join(self.Con= fDir, gDefaultToolsDefFile)))=0D + ToolDef.LoadToolDefFile(os.path.normpath(=0D + os.path.join(self.ConfDir, gDefaultToolsDefFile)))=0D self._ToolDef =3D ToolDef=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.= py b/BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py index 74004857a737..c132a073d093 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/CapsuleDependency.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Module that encodes and decodes a capsule dependency.=0D #=0D # Copyright (c) 2019, Intel Corporation. All rights reserved.
        =0D @@ -14,95 +14,103 @@ import re CapsuleDependency=0D '''=0D =0D +=0D class OpConvert (object):=0D - def __init__ (self):=0D + def __init__(self):=0D # Opcode: (OperandSize, PackSize, PackFmt, EncodeConvert, DecodeCo= nvert)=0D self._DepexOperations =3D {0x00: (16, 16, 's', self.Str2Guid, s= elf.Guid2Str),=0D 0x01: (4, 1, 'I', self.Str2Uint, sel= f.Uint2Str),=0D 0x02: (1, 0, 's', self.Str2Utf8, sel= f.Byte2Str),=0D }=0D =0D - def Str2Uint (self, Data):=0D + def Str2Uint(self, Data):=0D try:=0D - Value =3D int (Data, 16)=0D + Value =3D int(Data, 16)=0D except:=0D - Message =3D '{Data} is not a valid integer value.'.format (Dat= a =3D Data)=0D - raise ValueError (Message)=0D + Message =3D '{Data} is not a valid integer value.'.format(Data= =3DData)=0D + raise ValueError(Message)=0D if Value < 0 or Value > 0xFFFFFFFF:=0D - Message =3D '{Data} is not an UINT32.'.format (Data =3D Data)= =0D - raise ValueError (Message)=0D + Message =3D '{Data} is not an UINT32.'.format(Data=3DData)=0D + raise ValueError(Message)=0D return Value=0D =0D - def Uint2Str (self, Data):=0D + def Uint2Str(self, Data):=0D if Data < 0 or Data > 0xFFFFFFFF:=0D - Message =3D '{Data} is not an UINT32.'.format (Data =3D Data)= =0D - raise ValueError (Message)=0D - return "0x{Data:08x}".format (Data =3D Data)=0D + Message =3D '{Data} is not an UINT32.'.format(Data=3DData)=0D + raise ValueError(Message)=0D + return "0x{Data:08x}".format(Data=3DData)=0D =0D - def Str2Guid (self, Data):=0D + def Str2Guid(self, Data):=0D try:=0D - Guid =3D uuid.UUID (Data)=0D + Guid =3D uuid.UUID(Data)=0D except:=0D - Message =3D '{Data} is not a valid registry format GUID value.= '.format (Data =3D Data)=0D - raise ValueError (Message)=0D + Message =3D '{Data} is not a valid registry format GUID value.= '.format(=0D + Data=3DData)=0D + raise ValueError(Message)=0D return Guid.bytes_le=0D =0D - def Guid2Str (self, Data):=0D + def Guid2Str(self, Data):=0D try:=0D - Guid =3D uuid.UUID (bytes_le =3D Data)=0D + Guid =3D uuid.UUID(bytes_le=3DData)=0D except:=0D - Message =3D '{Data} is not a valid binary format GUID value.'.= format (Data =3D Data)=0D - raise ValueError (Message)=0D - return str (Guid).upper ()=0D + Message =3D '{Data} is not a valid binary format GUID value.'.= format(=0D + Data=3DData)=0D + raise ValueError(Message)=0D + return str(Guid).upper()=0D =0D - def Str2Utf8 (self, Data):=0D - if isinstance (Data, str):=0D - return Data.encode ('utf-8')=0D + def Str2Utf8(self, Data):=0D + if isinstance(Data, str):=0D + return Data.encode('utf-8')=0D else:=0D - Message =3D '{Data} is not a valid string.'.format (Data =3D D= ata)=0D - raise ValueError (Message)=0D + Message =3D '{Data} is not a valid string.'.format(Data=3DData= )=0D + raise ValueError(Message)=0D =0D - def Byte2Str (self, Data):=0D - if isinstance (Data, bytes):=0D + def Byte2Str(self, Data):=0D + if isinstance(Data, bytes):=0D if Data[-1:] =3D=3D b'\x00':=0D - return str (Data[:-1], 'utf-8')=0D + return str(Data[:-1], 'utf-8')=0D else:=0D - return str (Data, 'utf-8')=0D + return str(Data, 'utf-8')=0D else:=0D - Message =3D '{Data} is not a valid binary string.'.format (Dat= a =3D Data)=0D - raise ValueError (Message)=0D + Message =3D '{Data} is not a valid binary string.'.format(Data= =3DData)=0D + raise ValueError(Message)=0D =0D - def OpEncode (self, Opcode, Operand =3D None):=0D - BinTemp =3D struct.pack (' 0xFFFFFFFF:=0D return False=0D except:=0D return False=0D return True=0D =0D - def IsValidBoolean (self, operand):=0D + def IsValidBoolean(self, operand):=0D try:=0D - return operand.upper () in ['TRUE', 'FALSE']=0D + return operand.upper() in ['TRUE', 'FALSE']=0D except:=0D return False=0D =0D - def IsValidOperand (self, operand):=0D - return self.IsValidVersion (operand) or self.IsValidGuid (operand)= or self.IsValidBoolean (operand)=0D + def IsValidOperand(self, operand):=0D + return self.IsValidVersion(operand) or self.IsValidGuid(operand) o= r self.IsValidBoolean(operand)=0D =0D - def IsValidString (self, operand):=0D + def IsValidString(self, operand):=0D return operand[0] =3D=3D "\"" and operand[-1] =3D=3D "\"" and len(= operand) >=3D 2=0D =0D # Check if priority of current operater is greater than pervious op=0D - def PriorityNotGreater (self, prevOp, currOp):=0D + def PriorityNotGreater(self, prevOp, currOp):=0D return self._opReference[currOp][0] <=3D self._opReference[prevOp]= [0]=0D =0D - def ValidateDepex (self):=0D + def ValidateDepex(self):=0D OpList =3D self._DepexList=0D =0D i =3D 0=0D - while i < len (OpList):=0D + while i < len(OpList):=0D Op =3D OpList[i]=0D =0D if Op =3D=3D 'DECLARE':=0D i +=3D 1=0D - if i >=3D len (OpList):=0D - Msg =3D 'No more Operand after {Op}.'.format (Op =3D O= pList[i-1])=0D - raise IndexError (Msg)=0D + if i >=3D len(OpList):=0D + Msg =3D 'No more Operand after {Op}.'.format(Op=3DOpLi= st[i-1])=0D + raise IndexError(Msg)=0D # Check valid string=0D if not self.IsValidString(OpList[i]):=0D - Msg =3D '{Operand} after {Op} is not a valid expressio= n input.'.format (Operand =3D OpList[i], Op =3D OpList[i-1])=0D - raise ValueError (Msg)=0D + Msg =3D '{Operand} after {Op} is not a valid expressio= n input.'.format(=0D + Operand=3DOpList[i], Op=3DOpList[i-1])=0D + raise ValueError(Msg)=0D =0D elif Op =3D=3D '(':=0D # Expression cannot end with (=0D - if i =3D=3D len (OpList) - 1:=0D + if i =3D=3D len(OpList) - 1:=0D Msg =3D 'Expression cannot end with \'(\''=0D - raise ValueError (Msg)=0D + raise ValueError(Msg)=0D # The previous op after '(' cannot be a binocular operator= =0D - if self.IsValidBinocularOperator (OpList[i+1]) :=0D - Msg =3D '{Op} after \'(\' is not a valid expression in= put.'.format (Op =3D OpList[i+1])=0D - raise ValueError (Msg)=0D + if self.IsValidBinocularOperator(OpList[i+1]):=0D + Msg =3D '{Op} after \'(\' is not a valid expression in= put.'.format(=0D + Op=3DOpList[i+1])=0D + raise ValueError(Msg)=0D =0D elif Op =3D=3D ')':=0D # Expression cannot start with )=0D if i =3D=3D 0:=0D Msg =3D 'Expression cannot start with \')\''=0D - raise ValueError (Msg)=0D + raise ValueError(Msg)=0D # The previous op before ')' cannot be an operator=0D - if self.IsValidOperator (OpList[i-1]):=0D - Msg =3D '{Op} before \')\' is not a valid expression i= nput.'.format (Op =3D OpList[i-1])=0D - raise ValueError (Msg)=0D + if self.IsValidOperator(OpList[i-1]):=0D + Msg =3D '{Op} before \')\' is not a valid expression i= nput.'.format(=0D + Op=3DOpList[i-1])=0D + raise ValueError(Msg)=0D # The next op after ')' cannot be operand or unary operato= r=0D - if (i + 1) < len (OpList) and (self.IsValidOperand (OpList= [i+1]) or self.IsValidUnaryOperator (OpList[i+1])):=0D - Msg =3D '{Op} after \')\' is not a valid expression in= put.'.format (Op =3D OpList[i+1])=0D - raise ValueError (Msg)=0D + if (i + 1) < len(OpList) and (self.IsValidOperand(OpList[i= +1]) or self.IsValidUnaryOperator(OpList[i+1])):=0D + Msg =3D '{Op} after \')\' is not a valid expression in= put.'.format(=0D + Op=3DOpList[i+1])=0D + raise ValueError(Msg)=0D =0D - elif self.IsValidOperand (Op):=0D + elif self.IsValidOperand(Op):=0D # The next expression of operand cannot be operand or unar= y operator=0D - if (i + 1) < len (OpList) and (self.IsValidOperand (OpList= [i+1]) or self.IsValidUnaryOperator (OpList[i+1])):=0D - Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format (Op =3D OpList[i+1], PrevOp =3D Op)=0D - raise ValueError (Msg)=0D + if (i + 1) < len(OpList) and (self.IsValidOperand(OpList[i= +1]) or self.IsValidUnaryOperator(OpList[i+1])):=0D + Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format(=0D + Op=3DOpList[i+1], PrevOp=3DOp)=0D + raise ValueError(Msg)=0D =0D - elif self.IsValidOperator (Op):=0D + elif self.IsValidOperator(Op):=0D # The next op of operator cannot binocular operator=0D - if (i + 1) < len (OpList) and self.IsValidBinocularOperato= r (OpList[i+1]):=0D - Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format (Op =3D OpList[i+1], PrevOp =3D Op)=0D - raise ValueError (Msg)=0D + if (i + 1) < len(OpList) and self.IsValidBinocularOperator= (OpList[i+1]):=0D + Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format(=0D + Op=3DOpList[i+1], PrevOp=3DOp)=0D + raise ValueError(Msg)=0D # The first op can not be binocular operator=0D - if i =3D=3D 0 and self.IsValidBinocularOperator (Op):=0D - Msg =3D 'Expression cannot start with an operator {Op}= .'.format (Op =3D Op)=0D - raise ValueError (Msg)=0D + if i =3D=3D 0 and self.IsValidBinocularOperator(Op):=0D + Msg =3D 'Expression cannot start with an operator {Op}= .'.format(=0D + Op=3DOp)=0D + raise ValueError(Msg)=0D # The last op can not be operator=0D - if i =3D=3D len (OpList) - 1:=0D - Msg =3D 'Expression cannot ended with an operator {Op}= .'.format (Op =3D Op)=0D - raise ValueError (Msg)=0D + if i =3D=3D len(OpList) - 1:=0D + Msg =3D 'Expression cannot ended with an operator {Op}= .'.format(=0D + Op=3DOp)=0D + raise ValueError(Msg)=0D # The next op of unary operator cannot be guid / version=0D - if self.IsValidUnaryOperator (Op) and (self.IsValidGuid (O= pList[i+1]) or self.IsValidVersion (OpList[i+1])):=0D - Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format (Op =3D OpList[i+1], PrevOp =3D Op)=0D - raise ValueError (Msg)=0D + if self.IsValidUnaryOperator(Op) and (self.IsValidGuid(OpL= ist[i+1]) or self.IsValidVersion(OpList[i+1])):=0D + Msg =3D '{Op} after {PrevOp} is not a valid expression= input.'.format(=0D + Op=3DOpList[i+1], PrevOp=3DOp)=0D + raise ValueError(Msg)=0D =0D else:=0D - Msg =3D '{Op} is not a valid expression input.'.format (Op= =3D Op)=0D - raise ValueError (Msg)=0D + Msg =3D '{Op} is not a valid expression input.'.format(Op= =3DOp)=0D + raise ValueError(Msg)=0D i +=3D 1=0D =0D - def Encode (self):=0D + def Encode(self):=0D # initialize=0D self.Depex =3D b''=0D self._DepexDump =3D []=0D @@ -270,80 +289,84 @@ class CapsuleDependencyClass (object): OpeartorStack =3D []=0D OpList =3D self._DepexList=0D =0D - self.ValidateDepex ()=0D + self.ValidateDepex()=0D =0D # convert=0D i =3D 0=0D - while i < len (OpList):=0D + while i < len(OpList):=0D Op =3D OpList[i]=0D if Op =3D=3D 'DECLARE':=0D # This declare next expression value is a VERSION_STRING=0D i +=3D 1=0D - self.Depex +=3D self.OpConverter.OpEncode (0x02, OpList[i]= [1:-1])=0D + self.Depex +=3D self.OpConverter.OpEncode(0x02, OpList[i][= 1:-1])=0D =0D elif Op =3D=3D '(':=0D - OpeartorStack.append (Op)=0D + OpeartorStack.append(Op)=0D =0D elif Op =3D=3D ')':=0D while (OpeartorStack and OpeartorStack[-1] !=3D '('):=0D - Operator =3D OpeartorStack.pop ()=0D - self.Depex +=3D self.OpConverter.OpEncode (self._opRef= erence[Operator][1])=0D + Operator =3D OpeartorStack.pop()=0D + self.Depex +=3D self.OpConverter.OpEncode(=0D + self._opReference[Operator][1])=0D try:=0D - OpeartorStack.pop () # pop out '('=0D + OpeartorStack.pop() # pop out '('=0D except:=0D Msg =3D 'Pop out \'(\' failed, too many \')\''=0D - raise ValueError (Msg)=0D + raise ValueError(Msg)=0D =0D - elif self.IsValidGuid (Op):=0D + elif self.IsValidGuid(Op):=0D if not OperandStack:=0D - OperandStack.append (self.OpConverter.OpEncode (0x00, = Op))=0D + OperandStack.append(self.OpConverter.OpEncode(0x00, Op= ))=0D else:=0D # accroding to uefi spec 2.8, the guid/version operand= s is a reversed order in firmware comparison.=0D - self.Depex +=3D self.OpConverter.OpEncode (0x00, Op)=0D - self.Depex +=3D OperandStack.pop ()=0D + self.Depex +=3D self.OpConverter.OpEncode(0x00, Op)=0D + self.Depex +=3D OperandStack.pop()=0D =0D - elif self.IsValidVersion (Op):=0D + elif self.IsValidVersion(Op):=0D if not OperandStack:=0D - OperandStack.append (self.OpConverter.OpEncode (0x01, = Op))=0D + OperandStack.append(self.OpConverter.OpEncode(0x01, Op= ))=0D else:=0D # accroding to uefi spec 2.8, the guid/version operand= s is a reversed order in firmware comparison.=0D - self.Depex +=3D self.OpConverter.OpEncode (0x01, Op)=0D - self.Depex +=3D OperandStack.pop ()=0D + self.Depex +=3D self.OpConverter.OpEncode(0x01, Op)=0D + self.Depex +=3D OperandStack.pop()=0D =0D - elif self.IsValidBoolean (Op):=0D - if Op.upper () =3D=3D 'FALSE':=0D - self.Depex +=3D self.OpConverter.OpEncode (0x07)=0D - elif Op.upper () =3D=3D 'TRUE':=0D - self.Depex +=3D self.OpConverter.OpEncode (0x06)=0D + elif self.IsValidBoolean(Op):=0D + if Op.upper() =3D=3D 'FALSE':=0D + self.Depex +=3D self.OpConverter.OpEncode(0x07)=0D + elif Op.upper() =3D=3D 'TRUE':=0D + self.Depex +=3D self.OpConverter.OpEncode(0x06)=0D =0D - elif self.IsValidOperator (Op):=0D - while (OpeartorStack and OpeartorStack[-1] !=3D '(' and se= lf.PriorityNotGreater (OpeartorStack[-1], Op)):=0D - Operator =3D OpeartorStack.pop ()=0D - self.Depex +=3D self.OpConverter.OpEncode (self._opRef= erence[Operator][1])=0D - OpeartorStack.append (Op)=0D + elif self.IsValidOperator(Op):=0D + while (OpeartorStack and OpeartorStack[-1] !=3D '(' and se= lf.PriorityNotGreater(OpeartorStack[-1], Op)):=0D + Operator =3D OpeartorStack.pop()=0D + self.Depex +=3D self.OpConverter.OpEncode(=0D + self._opReference[Operator][1])=0D + OpeartorStack.append(Op)=0D =0D i +=3D 1=0D =0D while OpeartorStack:=0D - Operator =3D OpeartorStack.pop ()=0D + Operator =3D OpeartorStack.pop()=0D if Operator =3D=3D '(':=0D Msg =3D 'Too many \'(\'.'=0D - raise ValueError (Msg)=0D - self.Depex +=3D self.OpConverter.OpEncode (self._opReference[O= perator][1])=0D - self.Depex +=3D self.OpConverter.OpEncode (0x0D)=0D + raise ValueError(Msg)=0D + self.Depex +=3D self.OpConverter.OpEncode(=0D + self._opReference[Operator][1])=0D + self.Depex +=3D self.OpConverter.OpEncode(0x0D)=0D =0D self._Valid =3D True=0D - self._DepexSize =3D len (self.Depex)=0D + self._DepexSize =3D len(self.Depex)=0D return self.Depex + self.Payload=0D =0D - def Decode (self, Buffer):=0D + def Decode(self, Buffer):=0D # initialize=0D self.Depex =3D Buffer=0D OperandStack =3D []=0D DepexLen =3D 0=0D =0D while True:=0D - Opcode, Operand, OperandSize =3D self.OpConverter.OpDecode (Bu= ffer[DepexLen:])=0D + Opcode, Operand, OperandSize =3D self.OpConverter.OpDecode(=0D + Buffer[DepexLen:])=0D DepexLen +=3D OperandSize + 1=0D =0D if Opcode =3D=3D 0x0D:=0D @@ -351,59 +374,68 @@ class CapsuleDependencyClass (object): =0D elif Opcode =3D=3D 0x02:=0D if not OperandStack:=0D - OperandStack.append ('DECLARE \"{String}\"'.format (St= ring =3D Operand))=0D + OperandStack.append(=0D + 'DECLARE \"{String}\"'.format(String=3DOperand))=0D else:=0D - PrevOperand =3D OperandStack.pop ()=0D - OperandStack.append ('{Operand} DECLARE \"{String}\"'.= format (Operand =3D PrevOperand, String =3D Operand))=0D + PrevOperand =3D OperandStack.pop()=0D + OperandStack.append('{Operand} DECLARE \"{String}\"'.f= ormat(=0D + Operand=3DPrevOperand, String=3DOperand))=0D =0D elif Opcode in [0x00, 0x01]:=0D - OperandStack.append (Operand)=0D + OperandStack.append(Operand)=0D =0D elif Opcode =3D=3D 0x06:=0D - OperandStack.append ('TRUE')=0D + OperandStack.append('TRUE')=0D =0D elif Opcode =3D=3D 0x07:=0D - OperandStack.append ('FALSE')=0D + OperandStack.append('FALSE')=0D =0D - elif self.IsValidOperator (self._opReferenceReverse[Opcode]):= =0D + elif self.IsValidOperator(self._opReferenceReverse[Opcode]):=0D Operator =3D self._opReferenceReverse[Opcode]=0D - if self.IsValidUnaryOperator (self._opReferenceReverse[Opc= ode]) and len (OperandStack) >=3D 1:=0D - Oprand =3D OperandStack.pop ()=0D - OperandStack.append (' ( {Operator} {Oprand} )'.format= (Operator =3D Operator, Oprand =3D Oprand))=0D - elif self.IsValidBinocularOperator (self._opReferenceRever= se[Opcode]) and len (OperandStack) >=3D 2:=0D - Oprand1 =3D OperandStack.pop ()=0D - Oprand2 =3D OperandStack.pop ()=0D - OperandStack.append (' ( {Oprand1} {Operator} {Oprand2= } )'.format (Operator =3D Operator, Oprand1 =3D Oprand1, Oprand2 =3D Oprand= 2))=0D + if self.IsValidUnaryOperator(self._opReferenceReverse[Opco= de]) and len(OperandStack) >=3D 1:=0D + Oprand =3D OperandStack.pop()=0D + OperandStack.append(' ( {Operator} {Oprand} )'.format(= =0D + Operator=3DOperator, Oprand=3DOprand))=0D + elif self.IsValidBinocularOperator(self._opReferenceRevers= e[Opcode]) and len(OperandStack) >=3D 2:=0D + Oprand1 =3D OperandStack.pop()=0D + Oprand2 =3D OperandStack.pop()=0D + OperandStack.append(' ( {Oprand1} {Operator} {Oprand2}= )'.format(=0D + Operator=3DOperator, Oprand1=3DOprand1, Oprand2=3D= Oprand2))=0D else:=0D - Msg =3D 'No enough Operands for {Opcode:02X}.'.format = (Opcode =3D Opcode)=0D - raise ValueError (Msg)=0D + Msg =3D 'No enough Operands for {Opcode:02X}.'.format(= =0D + Opcode=3DOpcode)=0D + raise ValueError(Msg)=0D =0D else:=0D - Msg =3D '{Opcode:02X} is not a valid OpCode.'.format (Opco= de =3D Opcode)=0D - raise ValueError (Msg)=0D + Msg =3D '{Opcode:02X} is not a valid OpCode.'.format(=0D + Opcode=3DOpcode)=0D + raise ValueError(Msg)=0D =0D - self.DepexExp =3D OperandStack[0].strip (' ')=0D + self.DepexExp =3D OperandStack[0].strip(' ')=0D self.Payload =3D Buffer[DepexLen:]=0D self._Valid =3D True=0D self._DepexSize =3D DepexLen=0D return self.Payload=0D =0D -=0D - def DumpInfo (self):=0D + def DumpInfo(self):=0D DepexLen =3D 0=0D Opcode =3D None=0D Buffer =3D self.Depex=0D =0D if self._Valid =3D=3D True:=0D - print ('EFI_FIRMWARE_IMAGE_DEP.Dependencies =3D {')=0D + print('EFI_FIRMWARE_IMAGE_DEP.Dependencies =3D {')=0D while Opcode !=3D 0x0D:=0D - Opcode, Operand, OperandSize =3D self.OpConverter.OpDecode= (Buffer[DepexLen:])=0D + Opcode, Operand, OperandSize =3D self.OpConverter.OpDecode= (=0D + Buffer[DepexLen:])=0D DepexLen +=3D OperandSize + 1=0D if Operand:=0D - print (' {Opcode:02X}, {Operand},'.format (Opcode = =3D Opcode, Operand =3D Operand))=0D + print(' {Opcode:02X}, {Operand},'.format(=0D + Opcode=3DOpcode, Operand=3DOperand))=0D else:=0D - print (' {Opcode:02X},'.format (Opcode =3D Opcode))= =0D - print ('}')=0D + print(' {Opcode:02X},'.format(Opcode=3DOpcode))=0D + print('}')=0D =0D - print ('sizeof (EFI_FIRMWARE_IMAGE_DEP.Dependencies) =3D {S= ize:08X}'.format (Size =3D self._DepexSize))=0D - print ('sizeof (Payload) =3D {S= ize:08X}'.format (Size =3D len (self.Payload)))=0D + print('sizeof (EFI_FIRMWARE_IMAGE_DEP.Dependencies) =3D {Si= ze:08X}'.format(=0D + Size=3Dself._DepexSize))=0D + print('sizeof (Payload) =3D {Si= ze:08X}'.format(=0D + Size=3Dlen(self.Payload)))=0D diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py b= /BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py index 48c605faa8dd..75539a3e32ad 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/FmpAuthHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Module that encodes and decodes a EFI_FIRMWARE_IMAGE_AUTHENTICATION with= =0D # certificate data and payload data.=0D #=0D @@ -13,6 +13,7 @@ FmpAuthHeader import struct=0D import uuid=0D =0D +=0D class FmpAuthHeaderClass (object):=0D # ///=0D # /// Image Attribute -Authentication Required=0D @@ -96,58 +97,58 @@ class FmpAuthHeaderClass (object): # }=0D =0D _StructFormat =3D ' len (self._EmbeddedDriverList):=0D + def GetEmbeddedDriver(self, Index):=0D + if Index > len(self._EmbeddedDriverList):=0D raise ValueError=0D return self._EmbeddedDriverList[Index]=0D =0D - def AddPayload (self, UpdateImageTypeId, Payload =3D b'', VendorCodeBy= tes =3D b'', HardwareInstance =3D 0, UpdateImageIndex =3D 1, CapsuleSupport= =3D 0):=0D - self._PayloadList.append ((UpdateImageTypeId, Payload, VendorCodeB= ytes, HardwareInstance, UpdateImageIndex, CapsuleSupport))=0D + def AddPayload(self, UpdateImageTypeId, Payload=3Db'', VendorCodeBytes= =3Db'', HardwareInstance=3D0, UpdateImageIndex=3D1, CapsuleSupport=3D0):=0D + self._PayloadList.append((UpdateImageTypeId, Payload, VendorCodeBy= tes,=0D + HardwareInstance, UpdateImageIndex, Capsu= leSupport))=0D =0D - def GetFmpCapsuleImageHeader (self, Index):=0D - if Index >=3D len (self._FmpCapsuleImageHeaderList):=0D + def GetFmpCapsuleImageHeader(self, Index):=0D + if Index >=3D len(self._FmpCapsuleImageHeaderList):=0D raise ValueError=0D return self._FmpCapsuleImageHeaderList[Index]=0D =0D - def Encode (self):=0D - self.EmbeddedDriverCount =3D len (self._EmbeddedDriverList)=0D - self.PayloadItemCount =3D len (self._PayloadList)=0D + def Encode(self):=0D + self.EmbeddedDriverCount =3D len(self._EmbeddedDriverList)=0D + self.PayloadItemCount =3D len(self._PayloadList)=0D =0D - FmpCapsuleHeader =3D struct.pack (=0D - self._StructFormat,=0D - self.Version,=0D - self.EmbeddedDriverCount,=0D - self.PayloadItemCount=0D - )=0D + FmpCapsuleHeader =3D struct.pack(=0D + self._StructFormat,=0D + self.Version,=0D + self.EmbeddedDriverCount,=0D + self.PayloadItemCount=0D + )=0D =0D FmpCapsuleData =3D b''=0D - Offset =3D self._StructSize + (self.EmbeddedDriverCount + self.Pay= loadItemCount) * self._ItemOffsetSize=0D + Offset =3D self._StructSize + \=0D + (self.EmbeddedDriverCount + self.PayloadItemCount) * self._Ite= mOffsetSize=0D for EmbeddedDriver in self._EmbeddedDriverList:=0D FmpCapsuleData =3D FmpCapsuleData + EmbeddedDriver=0D - self._ItemOffsetList.append (Offset)=0D - Offset =3D Offset + len (EmbeddedDriver)=0D + self._ItemOffsetList.append(Offset)=0D + Offset =3D Offset + len(EmbeddedDriver)=0D Index =3D 1=0D for (UpdateImageTypeId, Payload, VendorCodeBytes, HardwareInstance= , UpdateImageIndex, CapsuleSupport) in self._PayloadList:=0D - FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass ()=0D - FmpCapsuleImageHeader.UpdateImageTypeId =3D UpdateImageTy= peId=0D - FmpCapsuleImageHeader.UpdateImageIndex =3D UpdateImageIn= dex=0D - FmpCapsuleImageHeader.Payload =3D Payload=0D - FmpCapsuleImageHeader.VendorCodeBytes =3D VendorCodeByt= es=0D + FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass()=0D + FmpCapsuleImageHeader.UpdateImageTypeId =3D UpdateImageTypeId= =0D + FmpCapsuleImageHeader.UpdateImageIndex =3D UpdateImageIndex=0D + FmpCapsuleImageHeader.Payload =3D Payload=0D + FmpCapsuleImageHeader.VendorCodeBytes =3D VendorCodeBytes=0D FmpCapsuleImageHeader.UpdateHardwareInstance =3D HardwareInsta= nce=0D - FmpCapsuleImageHeader.ImageCapsuleSupport =3D CapsuleSuppor= t=0D - FmpCapsuleImage =3D FmpCapsuleImageHeader.Encode ()=0D + FmpCapsuleImageHeader.ImageCapsuleSupport =3D CapsuleSupport=0D + FmpCapsuleImage =3D FmpCapsuleImageHeader.Encode()=0D FmpCapsuleData =3D FmpCapsuleData + FmpCapsuleImage=0D =0D - self._ItemOffsetList.append (Offset)=0D - self._FmpCapsuleImageHeaderList.append (FmpCapsuleImageHeader)= =0D + self._ItemOffsetList.append(Offset)=0D + self._FmpCapsuleImageHeaderList.append(FmpCapsuleImageHeader)= =0D =0D - Offset =3D Offset + len (FmpCapsuleImage)=0D + Offset =3D Offset + len(FmpCapsuleImage)=0D Index =3D Index + 1=0D =0D for Offset in self._ItemOffsetList:=0D - FmpCapsuleHeader =3D FmpCapsuleHeader + struct.pack (self._ItemO= ffsetFormat, Offset)=0D + FmpCapsuleHeader =3D FmpCapsuleHeader + \=0D + struct.pack(self._ItemOffsetFormat, Offset)=0D =0D self._Valid =3D True=0D return FmpCapsuleHeader + FmpCapsuleData=0D =0D - def Decode (self, Buffer):=0D - if len (Buffer) < self._StructSize:=0D + def Decode(self, Buffer):=0D + if len(Buffer) < self._StructSize:=0D raise ValueError=0D (Version, EmbeddedDriverCount, PayloadItemCount) =3D \=0D - struct.unpack (=0D - self._StructFormat,=0D - Buffer[0:self._StructSize]=0D - )=0D + struct.unpack(=0D + self._StructFormat,=0D + Buffer[0:self._StructSize]=0D + )=0D if Version < self.EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER_INIT_VERS= ION:=0D raise ValueError=0D =0D - self.Version =3D Version=0D - self.EmbeddedDriverCount =3D EmbeddedDriverCount=0D - self.PayloadItemCount =3D PayloadItemCount=0D - self._ItemOffsetList =3D []=0D - self._EmbeddedDriverList =3D []=0D - self._PayloadList =3D []=0D + self.Version =3D Version=0D + self.EmbeddedDriverCount =3D EmbeddedDriverCount=0D + self.PayloadItemCount =3D PayloadItemCount=0D + self._ItemOffsetList =3D []=0D + self._EmbeddedDriverList =3D []=0D + self._PayloadList =3D []=0D self._FmpCapsuleImageHeaderList =3D []=0D =0D #=0D # Parse the ItemOffsetList values=0D #=0D Offset =3D self._StructSize=0D - for Index in range (0, EmbeddedDriverCount + PayloadItemCount):=0D - ItemOffset =3D struct.unpack (self._ItemOffsetFormat, Buffer[O= ffset:Offset + self._ItemOffsetSize])[0]=0D - if ItemOffset >=3D len (Buffer):=0D + for Index in range(0, EmbeddedDriverCount + PayloadItemCount):=0D + ItemOffset =3D struct.unpack(=0D + self._ItemOffsetFormat, Buffer[Offset:Offset + self._ItemO= ffsetSize])[0]=0D + if ItemOffset >=3D len(Buffer):=0D raise ValueError=0D - self._ItemOffsetList.append (ItemOffset)=0D + self._ItemOffsetList.append(ItemOffset)=0D Offset =3D Offset + self._ItemOffsetSize=0D Result =3D Buffer[Offset:]=0D =0D #=0D # Parse the EmbeddedDrivers=0D #=0D - for Index in range (0, EmbeddedDriverCount):=0D + for Index in range(0, EmbeddedDriverCount):=0D Offset =3D self._ItemOffsetList[Index]=0D - if Index < (len (self._ItemOffsetList) - 1):=0D + if Index < (len(self._ItemOffsetList) - 1):=0D Length =3D self._ItemOffsetList[Index + 1] - Offset=0D else:=0D - Length =3D len (Buffer) - Offset=0D - self.AddEmbeddedDriver (Buffer[Offset:Offset + Length])=0D + Length =3D len(Buffer) - Offset=0D + self.AddEmbeddedDriver(Buffer[Offset:Offset + Length])=0D =0D #=0D # Parse the Payloads that are FMP Capsule Images=0D #=0D - for Index in range (EmbeddedDriverCount, EmbeddedDriverCount + Pay= loadItemCount):=0D + for Index in range(EmbeddedDriverCount, EmbeddedDriverCount + Payl= oadItemCount):=0D Offset =3D self._ItemOffsetList[Index]=0D - if Index < (len (self._ItemOffsetList) - 1):=0D + if Index < (len(self._ItemOffsetList) - 1):=0D Length =3D self._ItemOffsetList[Index + 1] - Offset=0D else:=0D - Length =3D len (Buffer) - Offset=0D - FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass ()=0D - FmpCapsuleImageHeader.Decode (Buffer[Offset:Offset + Length])= =0D - self.AddPayload (=0D - FmpCapsuleImageHeader.UpdateImageTypeId,=0D - FmpCapsuleImageHeader.Payload,=0D - FmpCapsuleImageHeader.VendorCodeBytes=0D - )=0D - self._FmpCapsuleImageHeaderList.append (FmpCapsuleImageHeader)= =0D + Length =3D len(Buffer) - Offset=0D + FmpCapsuleImageHeader =3D FmpCapsuleImageHeaderClass()=0D + FmpCapsuleImageHeader.Decode(Buffer[Offset:Offset + Length])=0D + self.AddPayload(=0D + FmpCapsuleImageHeader.UpdateImageTypeId,=0D + FmpCapsuleImageHeader.Payload,=0D + FmpCapsuleImageHeader.VendorCodeBytes=0D + )=0D + self._FmpCapsuleImageHeaderList.append(FmpCapsuleImageHeader)= =0D =0D self._Valid =3D True=0D return Result=0D =0D - def DumpInfo (self):=0D + def DumpInfo(self):=0D if not self._Valid:=0D raise ValueError=0D - print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.Version = =3D {Version:08X}'.format (Version =3D self.Version))=0D - print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.EmbeddedDriverCount= =3D {EmbeddedDriverCount:08X}'.format (EmbeddedDriverCount =3D self.Embedd= edDriverCount))=0D + print('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.Version = =3D {Version:08X}'.format(=0D + Version=3Dself.Version))=0D + print('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.EmbeddedDriverCount = =3D {EmbeddedDriverCount:08X}'.format(=0D + EmbeddedDriverCount=3Dself.EmbeddedDriverCount))=0D for EmbeddedDriver in self._EmbeddedDriverList:=0D - print (' sizeof (EmbeddedDriver) = =3D {Size:08X}'.format (Size =3D len (EmbeddedDriver)))=0D - print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.PayloadItemCount = =3D {PayloadItemCount:08X}'.format (PayloadItemCount =3D self.PayloadItemC= ount))=0D - print ('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.ItemOffsetList = =3D ')=0D + print(' sizeof (EmbeddedDriver) = =3D {Size:08X}'.format(=0D + Size=3Dlen(EmbeddedDriver)))=0D + print('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.PayloadItemCount = =3D {PayloadItemCount:08X}'.format(=0D + PayloadItemCount=3Dself.PayloadItemCount))=0D + print('EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER.ItemOffsetList = =3D ')=0D for Offset in self._ItemOffsetList:=0D - print (' {Offset:016X}'.format (Offset =3D Offset))=0D + print(' {Offset:016X}'.format(Offset=3DOffset))=0D for FmpCapsuleImageHeader in self._FmpCapsuleImageHeaderList:=0D - FmpCapsuleImageHeader.DumpInfo ()=0D + FmpCapsuleImageHeader.DumpInfo()=0D diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/UefiCapsuleHeader.= py b/BaseTools/Source/Python/Common/Uefi/Capsule/UefiCapsuleHeader.py index 0e59028697ed..0ed4cbf5f73a 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/UefiCapsuleHeader.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/UefiCapsuleHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Module that encodes and decodes a EFI_CAPSULE_HEADER with a payload=0D #=0D # Copyright (c) 2018, Intel Corporation. All rights reserved.
        =0D @@ -12,6 +12,7 @@ UefiCapsuleHeader import struct=0D import uuid=0D =0D +=0D class UefiCapsuleHeaderClass (object):=0D # typedef struct {=0D # ///=0D @@ -41,26 +42,27 @@ class UefiCapsuleHeaderClass (object): # #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000=0D #=0D _StructFormat =3D '<16sIIII'=0D - _StructSize =3D struct.calcsize (_StructFormat)=0D + _StructSize =3D struct.calcsize(_StructFormat)=0D =0D - EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID =3D uuid.UUID ('6DCBD5ED-E82D-= 4C44-BDA1-7194199AD92A')=0D + EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID =3D uuid.UUID(=0D + '6DCBD5ED-E82D-4C44-BDA1-7194199AD92A')=0D =0D - _CAPSULE_FLAGS_PERSIST_ACROSS_RESET =3D 0x00010000=0D + _CAPSULE_FLAGS_PERSIST_ACROSS_RESET =3D 0x00010000=0D _CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE =3D 0x00020000=0D - _CAPSULE_FLAGS_INITIATE_RESET =3D 0x00040000=0D + _CAPSULE_FLAGS_INITIATE_RESET =3D 0x00040000=0D =0D - def __init__ (self):=0D - self._Valid =3D False=0D - self.CapsuleGuid =3D self.EFI_FIRMWARE_MANAGEMENT_CAPSULE_= ID_GUID=0D - self.HeaderSize =3D self._StructSize=0D - self.OemFlags =3D 0x0000=0D - self.PersistAcrossReset =3D False=0D + def __init__(self):=0D + self._Valid =3D False=0D + self.CapsuleGuid =3D self.EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID= =0D + self.HeaderSize =3D self._StructSize=0D + self.OemFlags =3D 0x0000=0D + self.PersistAcrossReset =3D False=0D self.PopulateSystemTable =3D False=0D - self.InitiateReset =3D False=0D - self.CapsuleImageSize =3D self.HeaderSize=0D - self.Payload =3D b''=0D + self.InitiateReset =3D False=0D + self.CapsuleImageSize =3D self.HeaderSize=0D + self.Payload =3D b''=0D =0D - def Encode (self):=0D + def Encode(self):=0D Flags =3D self.OemFlags=0D if self.PersistAcrossReset:=0D Flags =3D Flags | self._CAPSULE_FLAGS_PERSIST_ACROSS_RESET=0D @@ -69,44 +71,46 @@ class UefiCapsuleHeaderClass (object): if self.InitiateReset:=0D Flags =3D Flags | self._CAPSULE_FLAGS_INITIATE_RESET=0D =0D - self.CapsuleImageSize =3D self.HeaderSize + len (self.Payload)=0D + self.CapsuleImageSize =3D self.HeaderSize + len(self.Payload)=0D =0D - UefiCapsuleHeader =3D struct.pack (=0D - self._StructFormat,=0D - self.CapsuleGuid.bytes_le,=0D - self.HeaderSize,=0D - Flags,=0D - self.CapsuleImageSize,=0D - 0=0D - )=0D + UefiCapsuleHeader =3D struct.pack(=0D + self._StructFormat,=0D + self.CapsuleGuid.bytes_le,=0D + self.HeaderSize,=0D + Flags,=0D + self.CapsuleImageSize,=0D + 0=0D + )=0D self._Valid =3D True=0D return UefiCapsuleHeader + self.Payload=0D =0D - def Decode (self, Buffer):=0D - if len (Buffer) < self._StructSize:=0D + def Decode(self, Buffer):=0D + if len(Buffer) < self._StructSize:=0D raise ValueError=0D (CapsuleGuid, HeaderSize, Flags, CapsuleImageSize, Reserved) =3D \= =0D - struct.unpack (=0D - self._StructFormat,=0D - Buffer[0:self._StructSize]=0D - )=0D + struct.unpack(=0D + self._StructFormat,=0D + Buffer[0:self._StructSize]=0D + )=0D if HeaderSize < self._StructSize:=0D raise ValueError=0D - if CapsuleImageSize !=3D len (Buffer):=0D + if CapsuleImageSize !=3D len(Buffer):=0D raise ValueError=0D - self.CapsuleGuid =3D uuid.UUID (bytes_le =3D CapsuleGuid)= =0D - self.HeaderSize =3D HeaderSize=0D - self.OemFlags =3D Flags & 0xffff=0D - self.PersistAcrossReset =3D (Flags & self._CAPSULE_FLAGS_PERSIST_= ACROSS_RESET) !=3D 0=0D - self.PopulateSystemTable =3D (Flags & self._CAPSULE_FLAGS_POPULATE= _SYSTEM_TABLE) !=3D 0=0D - self.InitiateReset =3D (Flags & self._CAPSULE_FLAGS_INITIATE= _RESET) !=3D 0=0D - self.CapsuleImageSize =3D CapsuleImageSize=0D - self.Payload =3D Buffer[self.HeaderSize:]=0D + self.CapsuleGuid =3D uuid.UUID(bytes_le=3DCapsuleGuid)=0D + self.HeaderSize =3D HeaderSize=0D + self.OemFlags =3D Flags & 0xffff=0D + self.PersistAcrossReset =3D (=0D + Flags & self._CAPSULE_FLAGS_PERSIST_ACROSS_RESET) !=3D 0=0D + self.PopulateSystemTable =3D (=0D + Flags & self._CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) !=3D 0=0D + self.InitiateReset =3D (Flags & self._CAPSULE_FLAGS_INITIATE_RESET= ) !=3D 0=0D + self.CapsuleImageSize =3D CapsuleImageSize=0D + self.Payload =3D Buffer[self.HeaderSize:]=0D =0D - self._Valid =3D True=0D + self._Valid =3D True=0D return self.Payload=0D =0D - def DumpInfo (self):=0D + def DumpInfo(self):=0D if not self._Valid:=0D raise ValueError=0D Flags =3D self.OemFlags=0D @@ -116,15 +120,21 @@ class UefiCapsuleHeaderClass (object): Flags =3D Flags | self._CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE=0D if self.InitiateReset:=0D Flags =3D Flags | self._CAPSULE_FLAGS_INITIATE_RESET=0D - print ('EFI_CAPSULE_HEADER.CapsuleGuid =3D {Guid}'.format (Gu= id =3D str(self.CapsuleGuid).upper()))=0D - print ('EFI_CAPSULE_HEADER.HeaderSize =3D {Size:08X}'.format= (Size =3D self.HeaderSize))=0D - print ('EFI_CAPSULE_HEADER.Flags =3D {Flags:08X}'.forma= t (Flags =3D Flags))=0D - print (' OEM Flags =3D {Flags:04X}'.forma= t (Flags =3D self.OemFlags))=0D + print('EFI_CAPSULE_HEADER.CapsuleGuid =3D {Guid}'.format(=0D + Guid=3Dstr(self.CapsuleGuid).upper()))=0D + print('EFI_CAPSULE_HEADER.HeaderSize =3D {Size:08X}'.format(= =0D + Size=3Dself.HeaderSize))=0D + print('EFI_CAPSULE_HEADER.Flags =3D {Flags:08X}'.format= (=0D + Flags=3DFlags))=0D + print(' OEM Flags =3D {Flags:04X}'.format= (=0D + Flags=3Dself.OemFlags))=0D if self.PersistAcrossReset:=0D - print (' CAPSULE_FLAGS_PERSIST_ACROSS_RESET')=0D + print(' CAPSULE_FLAGS_PERSIST_ACROSS_RESET')=0D if self.PopulateSystemTable:=0D - print (' CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE')=0D + print(' CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE')=0D if self.InitiateReset:=0D - print (' CAPSULE_FLAGS_INITIATE_RESET')=0D - print ('EFI_CAPSULE_HEADER.CapsuleImageSize =3D {Size:08X}'.format= (Size =3D self.CapsuleImageSize))=0D - print ('sizeof (Payload) =3D {Size:08X}'.format= (Size =3D len (self.Payload)))=0D + print(' CAPSULE_FLAGS_INITIATE_RESET')=0D + print('EFI_CAPSULE_HEADER.CapsuleImageSize =3D {Size:08X}'.format(= =0D + Size=3Dself.CapsuleImageSize))=0D + print('sizeof (Payload) =3D {Size:08X}'.format(= =0D + Size=3Dlen(self.Payload)))=0D diff --git a/BaseTools/Source/Python/Common/Uefi/Capsule/__init__.py b/Base= Tools/Source/Python/Common/Uefi/Capsule/__init__.py index 329adcd51216..0420c953aa1f 100644 --- a/BaseTools/Source/Python/Common/Uefi/Capsule/__init__.py +++ b/BaseTools/Source/Python/Common/Uefi/Capsule/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Common.Uefi.Capsule' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Common/Uefi/__init__.py b/BaseTools/So= urce/Python/Common/Uefi/__init__.py index 213883d04833..1a49d89e5970 100644 --- a/BaseTools/Source/Python/Common/Uefi/__init__.py +++ b/BaseTools/Source/Python/Common/Uefi/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Common.Uefi' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Common/VariableAttributes.py b/BaseToo= ls/Source/Python/Common/VariableAttributes.py index 90c43f87d171..4477e747cc9e 100644 --- a/BaseTools/Source/Python/Common/VariableAttributes.py +++ b/BaseTools/Source/Python/Common/VariableAttributes.py @@ -13,11 +13,11 @@ class VariableAttributes(object): EFI_VARIABLE_RUNTIME_ACCESS =3D 0x00000004=0D VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY =3D 0x00000001=0D VarAttributesMap =3D {=0D - "NV":EFI_VARIABLE_NON_VOLATILE,=0D - "BS":EFI_VARIABLE_BOOTSERVICE_ACCESS,=0D - "RT":EFI_VARIABLE_RUNTIME_ACCESS,=0D - "RO":VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY=0D - }=0D + "NV": EFI_VARIABLE_NON_VOLATILE,=0D + "BS": EFI_VARIABLE_BOOTSERVICE_ACCESS,=0D + "RT": EFI_VARIABLE_RUNTIME_ACCESS,=0D + "RO": VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY=0D + }=0D =0D def __init__(self):=0D pass=0D @@ -33,8 +33,10 @@ class VariableAttributes(object): if attr =3D=3D 'RO':=0D VarProp =3D VariableAttributes.VAR_CHECK_VARIABLE_PROPERTY= _READ_ONLY=0D else:=0D - VarAttr =3D VarAttr | VariableAttributes.VarAttributesMap.= get(attr, 0x00000000)=0D + VarAttr =3D VarAttr | VariableAttributes.VarAttributesMap.= get(=0D + attr, 0x00000000)=0D return VarAttr, VarProp=0D +=0D @staticmethod=0D def ValidateVarAttributes(var_attr_str):=0D if not var_attr_str:=0D diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py b/BaseTools/Sour= ce/Python/Common/VpdInfoFile.py index 4249b9f899e7..5886cb772e42 100644 --- a/BaseTools/Source/Python/Common/VpdInfoFile.py +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This package manage the VPD PCD information file which will be generated= =0D # by build tool's autogen.=0D @@ -21,7 +21,7 @@ from Common.Misc import SaveFileOnChange from Common.DataType import *=0D =0D FILE_COMMENT_TEMPLATE =3D \=0D -"""=0D + """=0D ## @file=0D #=0D # THIS IS AUTO-GENERATED FILE BY BUILD TOOLS AND PLEASE DO NOT MAKE MODIF= ICATION.=0D @@ -40,7 +40,7 @@ FILE_COMMENT_TEMPLATE =3D \ =0D """=0D =0D -## The class manage VpdInfoFile.=0D +# The class manage VpdInfoFile.=0D #=0D # This file contains an ordered (based on position in the DSC file) list = of the PCDs specified in the platform description file (DSC). The Value fie= ld that will be assigned to the PCD comes from the DSC file, INF file (if n= ot defined in the DSC file) or the DEC file (if not defined in the INF file= ). This file is used as an input to the BPDG tool.=0D # Format for this file (using EBNF notation) is:=0D @@ -62,12 +62,15 @@ FILE_COMMENT_TEMPLATE =3D \ # ::=3D "{" ["," ]* "}"=0D # ::=3D ["," ]*=0D #=0D +=0D +=0D class VpdInfoFile:=0D =0D _rVpdPcdLine =3D None=0D - ## Constructor=0D + # Constructor=0D +=0D def __init__(self):=0D - ## Dictionary for VPD in following format=0D + # Dictionary for VPD in following format=0D #=0D # Key : PcdClassObject instance.=0D # @see BuildClassObject.PcdClassObject=0D @@ -75,7 +78,7 @@ class VpdInfoFile: self._VpdArray =3D {}=0D self._VpdInfo =3D {}=0D =0D - ## Add a VPD PCD collected from platform's autogen when building.=0D + # Add a VPD PCD collected from platform's autogen when building.=0D #=0D # @param vpds The list of VPD PCD collected for a platform.=0D # @see BuildClassObject.PcdClassObject=0D @@ -84,10 +87,12 @@ class VpdInfoFile: #=0D def Add(self, Vpd, skuname, Offset):=0D if (Vpd is None):=0D - EdkLogger.error("VpdInfoFile", BuildToolError.ATTRIBUTE_UNKNOW= N_ERROR, "Invalid VPD PCD entry.")=0D + EdkLogger.error(=0D + "VpdInfoFile", BuildToolError.ATTRIBUTE_UNKNOWN_ERROR, "In= valid VPD PCD entry.")=0D =0D if not (Offset >=3D "0" or Offset =3D=3D TAB_STAR):=0D - EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D, "Invalid offset parameter: %s." % Offset)=0D + EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D,=0D + "Invalid offset parameter: %s." % Offset)=0D =0D if Vpd.DatumType =3D=3D TAB_VOID:=0D if Vpd.MaxDatumSize <=3D "0":=0D @@ -107,14 +112,14 @@ class VpdInfoFile: #=0D self._VpdArray[Vpd] =3D {}=0D =0D - self._VpdArray[Vpd].update({skuname:Offset})=0D + self._VpdArray[Vpd].update({skuname: Offset})=0D =0D -=0D - ## Generate VPD PCD information into a text file=0D + # Generate VPD PCD information into a text file=0D #=0D # If parameter FilePath is invalid, then assert.=0D # If=0D # @param FilePath The given file path which would hold VPD inf= ormation=0D +=0D def Write(self, FilePath):=0D if not (FilePath is not None or len(FilePath) !=3D 0):=0D EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVALI= D,=0D @@ -130,15 +135,16 @@ class VpdInfoFile: PcdTokenCName =3D PcdItem[0]=0D for skuname in self._VpdArray[Pcd]:=0D PcdValue =3D str(Pcd.SkuInfoList[skuname].DefaultValue).st= rip()=0D - if PcdValue =3D=3D "" :=0D - PcdValue =3D Pcd.DefaultValue=0D + if PcdValue =3D=3D "":=0D + PcdValue =3D Pcd.DefaultValue=0D =0D - Content +=3D "%s.%s|%s|%s|%s|%s \n" % (Pcd.TokenSpaceGuid= CName, PcdTokenCName, skuname, str(self._VpdArray[Pcd][skuname]).strip(), s= tr(Pcd.MaxDatumSize).strip(), PcdValue)=0D + Content +=3D "%s.%s|%s|%s|%s|%s \n" % (Pcd.TokenSpaceGuid= CName, PcdTokenCName, skuname, str(=0D + self._VpdArray[Pcd][skuname]).strip(), str(Pcd.MaxDatu= mSize).strip(), PcdValue)=0D i +=3D 1=0D =0D return SaveFileOnChange(FilePath, Content, False)=0D =0D - ## Read an existing VPD PCD info file.=0D + # Read an existing VPD PCD info file.=0D #=0D # This routine will read VPD PCD information from existing file and c= onstruct=0D # internal PcdClassObject array.=0D @@ -162,17 +168,21 @@ class VpdInfoFile: # the line must follow output format defined in BPDG spec.=0D #=0D try:=0D - PcdName, SkuId, Offset, Size, Value =3D Line.split("#")[0]= .split("|")=0D - PcdName, SkuId, Offset, Size, Value =3D PcdName.strip(), S= kuId.strip(), Offset.strip(), Size.strip(), Value.strip()=0D + PcdName, SkuId, Offset, Size, Value =3D Line.split("#")[=0D + 0].split("|")=0D + PcdName, SkuId, Offset, Size, Value =3D PcdName.strip(=0D + ), SkuId.strip(), Offset.strip(), Size.strip(), Value.stri= p()=0D TokenSpaceName, PcdTokenName =3D PcdName.split(".")=0D except:=0D - EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Fail= to parse VPD information file %s" % FilePath)=0D + EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR,=0D + "Fail to parse VPD information file %s" % = FilePath)=0D =0D Found =3D False=0D =0D if (TokenSpaceName, PcdTokenName) not in self._VpdInfo:=0D self._VpdInfo[(TokenSpaceName, PcdTokenName)] =3D {}=0D - self._VpdInfo[(TokenSpaceName, PcdTokenName)][(SkuId, Offset)]= =3D Value=0D + self._VpdInfo[(TokenSpaceName, PcdTokenName)=0D + ][(SkuId, Offset)] =3D Value=0D for VpdObject in self._VpdArray:=0D VpdObjectTokenCName =3D VpdObject.TokenCName=0D for PcdItem in GlobalData.MixedPcd:=0D @@ -182,13 +192,15 @@ class VpdInfoFile: if VpdObject.TokenSpaceGuidCName =3D=3D TokenSpaceName= and VpdObjectTokenCName =3D=3D PcdTokenName.strip() and sku =3D=3D SkuId:= =0D if self._VpdArray[VpdObject][sku] =3D=3D TAB_STAR:= =0D if Offset =3D=3D TAB_STAR:=0D - EdkLogger.error("BPDG", BuildToolError.FOR= MAT_INVALID, "The offset of %s has not been fixed up by third-party BPDG to= ol." % PcdName)=0D + EdkLogger.error("BPDG", BuildToolError.FOR= MAT_INVALID,=0D + "The offset of %s has not = been fixed up by third-party BPDG tool." % PcdName)=0D self._VpdArray[VpdObject][sku] =3D Offset=0D Found =3D True=0D if not Found:=0D - EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR, "Can = not find PCD defined in VPD guid file.")=0D + EdkLogger.error("BPDG", BuildToolError.PARSER_ERROR,=0D + "Can not find PCD defined in VPD guid file= .")=0D =0D - ## Get count of VPD PCD collected from platform's autogen when buildin= g.=0D + # Get count of VPD PCD collected from platform's autogen when building= .=0D #=0D # @return The integer count value=0D def GetCount(self):=0D @@ -198,7 +210,7 @@ class VpdInfoFile: =0D return Count=0D =0D - ## Get an offset value for a given VPD PCD=0D + # Get an offset value for a given VPD PCD=0D #=0D # Because BPDG only support one Sku, so only return offset for SKU de= fault.=0D #=0D @@ -211,18 +223,22 @@ class VpdInfoFile: return None=0D =0D return self._VpdArray[vpd]=0D +=0D def GetVpdInfo(self, arg):=0D (PcdTokenName, TokenSpaceName) =3D arg=0D - return [(sku,offset,value) for (sku,offset),value in self._VpdInfo= .get((TokenSpaceName, PcdTokenName)).items()]=0D + return [(sku, offset, value) for (sku, offset), value in self._Vpd= Info.get((TokenSpaceName, PcdTokenName)).items()]=0D =0D -## Call external BPDG tool to process VPD file=0D +# Call external BPDG tool to process VPD file=0D #=0D # @param ToolPath The string path name for BPDG tool=0D # @param VpdFileName The string path name for VPD information guid.txt= =0D #=0D +=0D +=0D def CallExtenalBPDGTool(ToolPath, VpdFileName):=0D assert ToolPath is not None, "Invalid parameter ToolPath"=0D - assert VpdFileName is not None and os.path.exists(VpdFileName), "Inval= id parameter VpdFileName"=0D + assert VpdFileName is not None and os.path.exists(=0D + VpdFileName), "Invalid parameter VpdFileName"=0D =0D OutputDir =3D os.path.dirname(VpdFileName)=0D FileName =3D os.path.basename(VpdFileName)=0D @@ -232,24 +248,26 @@ def CallExtenalBPDGTool(ToolPath, VpdFileName): =0D try:=0D PopenObject =3D subprocess.Popen(' '.join([ToolPath,=0D - '-o', OutputBinFileName,=0D - '-m', OutputMapFileName,=0D - '-q',=0D - '-f',=0D - VpdFileName]),=0D - stdout=3Dsubprocess.PIPE,=0D - stderr=3D subprocess.PIPE,=0D - shell=3DTrue)=0D + '-o', OutputBinFileName,= =0D + '-m', OutputMapFileName,= =0D + '-q',=0D + '-f',=0D + VpdFileName]),=0D + stdout=3Dsubprocess.PIPE,=0D + stderr=3Dsubprocess.PIPE,=0D + shell=3DTrue)=0D except Exception as X:=0D - EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, ExtraData= =3Dstr(X))=0D + EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE,=0D + ExtraData=3Dstr(X))=0D (out, error) =3D PopenObject.communicate()=0D print(out.decode())=0D - while PopenObject.returncode is None :=0D + while PopenObject.returncode is None:=0D PopenObject.wait()=0D =0D if PopenObject.returncode !=3D 0:=0D - EdkLogger.debug(EdkLogger.DEBUG_1, "Fail to call BPDG tool", str(e= rror))=0D - EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to e= xecute BPDG tool with exit code: %d, the error message is: \n %s" % \=0D - (PopenObject.returncode, str(error)))=0D + EdkLogger.debug(EdkLogger.DEBUG_1,=0D + "Fail to call BPDG tool", str(error))=0D + EdkLogger.error("BPDG", BuildToolError.COMMAND_FAILURE, "Fail to e= xecute BPDG tool with exit code: %d, the error message is: \n %s" %=0D + (PopenObject.returncode, str(error)))=0D =0D return PopenObject.returncode=0D diff --git a/BaseTools/Source/Python/Common/__init__.py b/BaseTools/Source/= Python/Common/__init__.py index 7aaef6ae318c..b53b69b3d15d 100644 --- a/BaseTools/Source/Python/Common/__init__.py +++ b/BaseTools/Source/Python/Common/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Common' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Common/caching.py b/BaseTools/Source/P= ython/Common/caching.py index fda30f7321ef..1c2375026433 100644 --- a/BaseTools/Source/Python/Common/caching.py +++ b/BaseTools/Source/Python/Common/caching.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # help with caching in BaseTools=0D #=0D # Copyright (c) 2018, Intel Corporation. All rights reserved.
        =0D @@ -6,36 +6,45 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D =0D # for class function=0D class cached_class_function(object):=0D def __init__(self, function):=0D self._function =3D function=0D +=0D def __get__(self, obj, cls):=0D - def CallMeHere(*args,**kwargs):=0D - Value =3D self._function(obj, *args,**kwargs)=0D - obj.__dict__[self._function.__name__] =3D lambda *args,**kwarg= s:Value=0D + def CallMeHere(*args, **kwargs):=0D + Value =3D self._function(obj, *args, **kwargs)=0D + obj.__dict__[=0D + self._function.__name__] =3D lambda *args, **kwargs: Value= =0D return Value=0D return CallMeHere=0D =0D # for class property=0D +=0D +=0D class cached_property(object):=0D def __init__(self, function):=0D self._function =3D function=0D +=0D def __get__(self, obj, cls):=0D Value =3D obj.__dict__[self._function.__name__] =3D self._function= (obj)=0D return Value=0D =0D # for non-class function=0D +=0D +=0D class cached_basic_function(object):=0D def __init__(self, function):=0D self._function =3D function=0D # wrapper to call _do since .__dict__ doesn't support changing = __call__=0D - def __call__(self,*args,**kwargs):=0D - return self._do(*args,**kwargs)=0D - def _do(self,*args,**kwargs):=0D - Value =3D self._function(*args,**kwargs)=0D - self.__dict__['_do'] =3D lambda self,*args,**kwargs:Value=0D +=0D + def __call__(self, *args, **kwargs):=0D + return self._do(*args, **kwargs)=0D +=0D + def _do(self, *args, **kwargs):=0D + Value =3D self._function(*args, **kwargs)=0D + self.__dict__['_do'] =3D lambda self, *args, **kwargs: Value=0D return Value=0D diff --git a/BaseTools/Source/Python/CommonDataClass/CommonClass.py b/BaseT= ools/Source/Python/CommonDataClass/CommonClass.py index bcf52c7b75dd..920703b783a5 100644 --- a/BaseTools/Source/Python/CommonDataClass/CommonClass.py +++ b/BaseTools/Source/Python/CommonDataClass/CommonClass.py @@ -1,11 +1,11 @@ -## @file=0D +# @file=0D # This file is used to define common items of class object=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D =0D -## SkuInfoClass=0D +# SkuInfoClass=0D #=0D # This class defined SkuInfo item used in Module/Platform/Package files=0D #=0D @@ -29,8 +29,8 @@ # @var DefaultValue: To store value for DefaultValue=0D #=0D class SkuInfoClass(object):=0D - def __init__(self, SkuIdName =3D '', SkuId =3D '', VariableName =3D ''= , VariableGuid =3D '', VariableOffset =3D '',=0D - HiiDefaultValue =3D '', VpdOffset =3D '', DefaultValue = =3D '', VariableGuidValue =3D '', VariableAttribute =3D '', DefaultStore = =3D None):=0D + def __init__(self, SkuIdName=3D'', SkuId=3D'', VariableName=3D'', Vari= ableGuid=3D'', VariableOffset=3D'',=0D + HiiDefaultValue=3D'', VpdOffset=3D'', DefaultValue=3D'', = VariableGuidValue=3D'', VariableAttribute=3D'', DefaultStore=3DNone):=0D self.SkuIdName =3D SkuIdName=0D self.SkuId =3D SkuId=0D =0D @@ -57,7 +57,7 @@ class SkuInfoClass(object): #=0D self.DefaultValue =3D DefaultValue=0D =0D - ## Convert the class to a string=0D + # Convert the class to a string=0D #=0D # Convert each member of the class to string=0D # Organize to a single line format string=0D @@ -66,16 +66,16 @@ class SkuInfoClass(object): #=0D def __str__(self):=0D Rtn =3D 'SkuId =3D ' + str(self.SkuId) + "," + \=0D - 'SkuIdName =3D ' + str(self.SkuIdName) + "," + \=0D - 'VariableName =3D ' + str(self.VariableName) + "," + \= =0D - 'VariableGuid =3D ' + str(self.VariableGuid) + "," + \= =0D - 'VariableOffset =3D ' + str(self.VariableOffset) + ","= + \=0D - 'HiiDefaultValue =3D ' + str(self.HiiDefaultValue) + "= ," + \=0D - 'VpdOffset =3D ' + str(self.VpdOffset) + "," + \=0D - 'DefaultValue =3D ' + str(self.DefaultValue) + ","=0D + 'SkuIdName =3D ' + str(self.SkuIdName) + "," + \=0D + 'VariableName =3D ' + str(self.VariableName) + "," + \=0D + 'VariableGuid =3D ' + str(self.VariableGuid) + "," + \=0D + 'VariableOffset =3D ' + str(self.VariableOffset) + "," + \=0D + 'HiiDefaultValue =3D ' + str(self.HiiDefaultValue) + "," + \=0D + 'VpdOffset =3D ' + str(self.VpdOffset) + "," + \=0D + 'DefaultValue =3D ' + str(self.DefaultValue) + ","=0D return Rtn=0D =0D - def __deepcopy__(self,memo):=0D + def __deepcopy__(self, memo):=0D new_sku =3D SkuInfoClass()=0D new_sku.SkuIdName =3D self.SkuIdName=0D new_sku.SkuId =3D self.SkuId=0D @@ -85,7 +85,8 @@ class SkuInfoClass(object): new_sku.VariableOffset =3D self.VariableOffset=0D new_sku.HiiDefaultValue =3D self.HiiDefaultValue=0D new_sku.VariableAttribute =3D self.VariableAttribute=0D - new_sku.DefaultStoreDict =3D {key:value for key,value in self.Defa= ultStoreDict.items()}=0D + new_sku.DefaultStoreDict =3D {=0D + key: value for key, value in self.DefaultStoreDict.items()}=0D new_sku.VpdOffset =3D self.VpdOffset=0D new_sku.DefaultValue =3D self.DefaultValue=0D return new_sku=0D diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py b/BaseToo= ls/Source/Python/CommonDataClass/DataClass.py index 6f35bd4c8e8f..54b42f2806be 100644 --- a/BaseTools/Source/Python/CommonDataClass/DataClass.py +++ b/BaseTools/Source/Python/CommonDataClass/DataClass.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class for data structure used in ECC=0D #=0D # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
        =0D @@ -73,14 +73,14 @@ MODEL_PCD_DYNAMIC_DEFAULT =3D 4009 MODEL_PCD_DYNAMIC_VPD =3D 4010=0D MODEL_PCD_DYNAMIC_HII =3D 4011=0D MODEL_PCD_TYPE_LIST =3D [MODEL_PCD_FIXED_AT_BUILD,=0D - MODEL_PCD_PATCHABLE_IN_MODULE,=0D - MODEL_PCD_FEATURE_FLAG,=0D - MODEL_PCD_DYNAMIC_DEFAULT,=0D - MODEL_PCD_DYNAMIC_HII,=0D - MODEL_PCD_DYNAMIC_VPD,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT,=0D - MODEL_PCD_DYNAMIC_EX_HII,=0D - MODEL_PCD_DYNAMIC_EX_VPD=0D + MODEL_PCD_PATCHABLE_IN_MODULE,=0D + MODEL_PCD_FEATURE_FLAG,=0D + MODEL_PCD_DYNAMIC_DEFAULT,=0D + MODEL_PCD_DYNAMIC_HII,=0D + MODEL_PCD_DYNAMIC_VPD,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT,=0D + MODEL_PCD_DYNAMIC_EX_HII,=0D + MODEL_PCD_DYNAMIC_EX_VPD=0D ]=0D =0D MODEL_META_DATA_HEADER_COMMENT =3D 5000=0D @@ -119,13 +119,15 @@ MODEL_LIST =3D [('MODEL_UNKNOWN', MODEL_UNKNOWN), ('MODEL_FILE_CIF', MODEL_FILE_CIF),=0D ('MODEL_FILE_OTHERS', MODEL_FILE_OTHERS),=0D ('MODEL_IDENTIFIER_FILE_HEADER', MODEL_IDENTIFIER_FILE_HEADE= R),=0D - ('MODEL_IDENTIFIER_FUNCTION_HEADER', MODEL_IDENTIFIER_FUNCTI= ON_HEADER),=0D + ('MODEL_IDENTIFIER_FUNCTION_HEADER',=0D + MODEL_IDENTIFIER_FUNCTION_HEADER),=0D ('MODEL_IDENTIFIER_COMMENT', MODEL_IDENTIFIER_COMMENT),=0D ('MODEL_IDENTIFIER_PARAMETER', MODEL_IDENTIFIER_PARAMETER),= =0D ('MODEL_IDENTIFIER_STRUCTURE', MODEL_IDENTIFIER_STRUCTURE),= =0D ('MODEL_IDENTIFIER_VARIABLE', MODEL_IDENTIFIER_VARIABLE),=0D ('MODEL_IDENTIFIER_INCLUDE', MODEL_IDENTIFIER_INCLUDE),=0D - ('MODEL_IDENTIFIER_PREDICATE_EXPRESSION', MODEL_IDENTIFIER_P= REDICATE_EXPRESSION),=0D + ('MODEL_IDENTIFIER_PREDICATE_EXPRESSION',=0D + MODEL_IDENTIFIER_PREDICATE_EXPRESSION),=0D ('MODEL_IDENTIFIER_ENUMERATE', MODEL_IDENTIFIER_ENUMERATE),= =0D ('MODEL_IDENTIFIER_PCD', MODEL_IDENTIFIER_PCD),=0D ('MODEL_IDENTIFIER_UNION', MODEL_IDENTIFIER_UNION),=0D @@ -134,10 +136,13 @@ MODEL_LIST =3D [('MODEL_UNKNOWN', MODEL_UNKNOWN), ('MODEL_IDENTIFIER_MACRO_DEFINE', MODEL_IDENTIFIER_MACRO_DEF= INE),=0D ('MODEL_IDENTIFIER_MACRO_ENDIF', MODEL_IDENTIFIER_MACRO_ENDI= F),=0D ('MODEL_IDENTIFIER_MACRO_PROGMA', MODEL_IDENTIFIER_MACRO_PRO= GMA),=0D - ('MODEL_IDENTIFIER_FUNCTION_CALLING', MODEL_IDENTIFIER_FUNCT= ION_CALLING),=0D + ('MODEL_IDENTIFIER_FUNCTION_CALLING',=0D + MODEL_IDENTIFIER_FUNCTION_CALLING),=0D ('MODEL_IDENTIFIER_TYPEDEF', MODEL_IDENTIFIER_TYPEDEF),=0D - ('MODEL_IDENTIFIER_FUNCTION_DECLARATION', MODEL_IDENTIFIER_F= UNCTION_DECLARATION),=0D - ('MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION', MODEL_IDENTIFIER_= ASSIGNMENT_EXPRESSION),=0D + ('MODEL_IDENTIFIER_FUNCTION_DECLARATION',=0D + MODEL_IDENTIFIER_FUNCTION_DECLARATION),=0D + ('MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION',=0D + MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION),=0D ('MODEL_EFI_PROTOCOL', MODEL_EFI_PROTOCOL),=0D ('MODEL_EFI_PPI', MODEL_EFI_PPI),=0D ('MODEL_EFI_GUID', MODEL_EFI_GUID),=0D @@ -165,20 +170,25 @@ MODEL_LIST =3D [('MODEL_UNKNOWN', MODEL_UNKNOWN), ("MODEL_META_DATA_HEADER", MODEL_META_DATA_HEADER),=0D ("MODEL_META_DATA_INCLUDE", MODEL_META_DATA_INCLUDE),=0D ("MODEL_META_DATA_DEFINE", MODEL_META_DATA_DEFINE),=0D - ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IF", MODEL_META_DATA= _CONDITIONAL_STATEMENT_IF),=0D - ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE", MODEL_META_DA= TA_CONDITIONAL_STATEMENT_ELSE),=0D - ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF", MODEL_META_D= ATA_CONDITIONAL_STATEMENT_IFDEF),=0D - ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF", MODEL_META_= DATA_CONDITIONAL_STATEMENT_IFNDEF),=0D - ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR", MODEL_META_D= ATA_CONDITIONAL_STATEMENT_ERROR),=0D + ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IF",=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IF),=0D + ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE",=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE),=0D + ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF",=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF),=0D + ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF",=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF),=0D + ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR",=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR),=0D ("MODEL_META_DATA_BUILD_OPTION", MODEL_META_DATA_BUILD_OPTIO= N),=0D ("MODEL_META_DATA_COMPONENT", MODEL_META_DATA_COMPONENT),=0D ('MODEL_META_DATA_USER_EXTENSION', MODEL_META_DATA_USER_EXTE= NSION),=0D ('MODEL_META_DATA_PACKAGE', MODEL_META_DATA_PACKAGE),=0D ('MODEL_META_DATA_NMAKE', MODEL_META_DATA_NMAKE),=0D ('MODEL_META_DATA_COMMENT', MODEL_META_DATA_COMMENT)=0D - ]=0D + ]=0D =0D -## FunctionClass=0D +# FunctionClass=0D #=0D # This class defines a structure of a function=0D #=0D @@ -212,12 +222,14 @@ MODEL_LIST =3D [('MODEL_UNKNOWN', MODEL_UNKNOWN), # @var IdentifierList: IdentifierList of a File=0D # @var PcdList: PcdList of a File=0D #=0D +=0D +=0D class FunctionClass(object):=0D - def __init__(self, ID =3D -1, Header =3D '', Modifier =3D '', Name =3D= '', ReturnStatement =3D '', \=0D - StartLine =3D -1, StartColumn =3D -1, EndLine =3D -1, End= Column =3D -1, \=0D - BodyStartLine =3D -1, BodyStartColumn =3D -1, BelongsToFi= le =3D -1, \=0D - IdentifierList =3D [], PcdList =3D [], \=0D - FunNameStartLine =3D -1, FunNameStartColumn =3D -1):=0D + def __init__(self, ID=3D-1, Header=3D'', Modifier=3D'', Name=3D'', Ret= urnStatement=3D'',=0D + StartLine=3D-1, StartColumn=3D-1, EndLine=3D-1, EndColumn= =3D-1,=0D + BodyStartLine=3D-1, BodyStartColumn=3D-1, BelongsToFile= =3D-1,=0D + IdentifierList=3D[], PcdList=3D[],=0D + FunNameStartLine=3D-1, FunNameStartColumn=3D-1):=0D self.ID =3D ID=0D self.Header =3D Header=0D self.Modifier =3D Modifier=0D @@ -236,7 +248,7 @@ class FunctionClass(object): self.IdentifierList =3D IdentifierList=0D self.PcdList =3D PcdList=0D =0D -## IdentifierClass=0D +# IdentifierClass=0D #=0D # This class defines a structure of a variable=0D #=0D @@ -266,9 +278,11 @@ class FunctionClass(object): # @var EndLine: EndLine of a Identifier=0D # @var EndColumn: EndColumn of a Identifier=0D #=0D +=0D +=0D class IdentifierClass(object):=0D - def __init__(self, ID =3D -1, Modifier =3D '', Type =3D '', Name =3D '= ', Value =3D '', Model =3D MODEL_UNKNOWN, \=0D - BelongsToFile =3D -1, BelongsToFunction =3D -1, StartLine= =3D -1, StartColumn =3D -1, EndLine =3D -1, EndColumn =3D -1):=0D + def __init__(self, ID=3D-1, Modifier=3D'', Type=3D'', Name=3D'', Value= =3D'', Model=3DMODEL_UNKNOWN,=0D + BelongsToFile=3D-1, BelongsToFunction=3D-1, StartLine=3D-= 1, StartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1):=0D self.ID =3D ID=0D self.Modifier =3D Modifier=0D self.Type =3D Type=0D @@ -282,7 +296,7 @@ class IdentifierClass(object): self.EndLine =3D EndLine=0D self.EndColumn =3D EndColumn=0D =0D -## PcdClass=0D +# PcdClass=0D #=0D # This class defines a structure of a Pcd=0D #=0D @@ -312,9 +326,11 @@ class IdentifierClass(object): # @var EndLine: EndLine of a Pcd=0D # @var EndColumn: EndColumn of a Pcd=0D #=0D +=0D +=0D class PcdDataClass(object):=0D - def __init__(self, ID =3D -1, CName =3D '', TokenSpaceGuidCName =3D ''= , Token =3D '', DatumType =3D '', Model =3D MODEL_UNKNOWN, \=0D - BelongsToFile =3D -1, BelongsToFunction =3D -1, StartLine= =3D -1, StartColumn =3D -1, EndLine =3D -1, EndColumn =3D -1):=0D + def __init__(self, ID=3D-1, CName=3D'', TokenSpaceGuidCName=3D'', Toke= n=3D'', DatumType=3D'', Model=3DMODEL_UNKNOWN,=0D + BelongsToFile=3D-1, BelongsToFunction=3D-1, StartLine=3D-= 1, StartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1):=0D self.ID =3D ID=0D self.CName =3D CName=0D self.TokenSpaceGuidCName =3D TokenSpaceGuidCName=0D @@ -327,7 +343,7 @@ class PcdDataClass(object): self.EndLine =3D EndLine=0D self.EndColumn =3D EndColumn=0D =0D -## FileClass=0D +# FileClass=0D #=0D # This class defines a structure of a file=0D #=0D @@ -353,9 +369,11 @@ class PcdDataClass(object): # @var IdentifierList: IdentifierList of a File=0D # @var PcdList: PcdList of a File=0D #=0D +=0D +=0D class FileClass(object):=0D - def __init__(self, ID =3D -1, Name =3D '', ExtName =3D '', Path =3D ''= , FullPath =3D '', Model =3D MODEL_UNKNOWN, TimeStamp =3D '', \=0D - FunctionList =3D [], IdentifierList =3D [], PcdList =3D [= ]):=0D + def __init__(self, ID=3D-1, Name=3D'', ExtName=3D'', Path=3D'', FullPa= th=3D'', Model=3DMODEL_UNKNOWN, TimeStamp=3D'',=0D + FunctionList=3D[], IdentifierList=3D[], PcdList=3D[]):=0D self.ID =3D ID=0D self.Name =3D Name=0D self.ExtName =3D ExtName=0D diff --git a/BaseTools/Source/Python/CommonDataClass/Exceptions.py b/BaseTo= ols/Source/Python/CommonDataClass/Exceptions.py index 4489b757e881..3d31d7b074ea 100644 --- a/BaseTools/Source/Python/CommonDataClass/Exceptions.py +++ b/BaseTools/Source/Python/CommonDataClass/Exceptions.py @@ -1,23 +1,27 @@ -## @file=0D +# @file=0D # This file is used to define common Exceptions class used in python tools= =0D #=0D # Copyright (c) 2011, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D -## Exceptions used in Expression=0D +# Exceptions used in Expression=0D class EvaluationException(Exception):=0D pass=0D =0D +=0D class BadExpression(EvaluationException):=0D pass=0D =0D +=0D class WrnExpression(Exception):=0D pass=0D =0D -## Exceptions used in macro replacements=0D +# Exceptions used in macro replacements=0D +=0D +=0D class MacroException(Exception):=0D pass=0D =0D +=0D class SymbolNotFound(MacroException):=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/CommonDataClass/FdfClass.py b/BaseTool= s/Source/Python/CommonDataClass/FdfClass.py index 2fbb7b436a9b..de1edb6f04fe 100644 --- a/BaseTools/Source/Python/CommonDataClass/FdfClass.py +++ b/BaseTools/Source/Python/CommonDataClass/FdfClass.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # classes represent data in FDF=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -6,11 +6,11 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## FD data in FDF=0D +# FD data in FDF=0D #=0D #=0D class FDClassObject:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -30,11 +30,13 @@ class FDClassObject: self.SetVarDict =3D {}=0D self.RegionList =3D []=0D =0D -## FFS data in FDF=0D +# FFS data in FDF=0D #=0D #=0D +=0D +=0D class FfsClassObject:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -45,11 +47,13 @@ class FfsClassObject: self.Alignment =3D None=0D self.SectionList =3D []=0D =0D -## FILE statement data in FDF=0D +# FILE statement data in FDF=0D #=0D #=0D -class FileStatementClassObject (FfsClassObject) :=0D - ## The constructor=0D +=0D +=0D +class FileStatementClassObject (FfsClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -63,11 +67,13 @@ class FileStatementClassObject (FfsClassObject) : self.DefineVarDict =3D {}=0D self.KeepReloc =3D None=0D =0D -## INF statement data in FDF=0D +# INF statement data in FDF=0D #=0D #=0D +=0D +=0D class FfsInfStatementClassObject(FfsClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -82,22 +88,26 @@ class FfsInfStatementClassObject(FfsClassObject): self.KeepReloc =3D None=0D self.UseArch =3D None=0D =0D -## section data in FDF=0D +# section data in FDF=0D #=0D #=0D +=0D +=0D class SectionClassObject:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D self.Alignment =3D None=0D =0D -## Depex expression section in FDF=0D +# Depex expression section in FDF=0D #=0D #=0D +=0D +=0D class DepexSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -106,11 +116,13 @@ class DepexSectionClassObject (SectionClassObject): self.Expression =3D None=0D self.ExpressionProcessed =3D False=0D =0D -## Compress section data in FDF=0D +# Compress section data in FDF=0D #=0D #=0D -class CompressSectionClassObject (SectionClassObject) :=0D - ## The constructor=0D +=0D +=0D +class CompressSectionClassObject (SectionClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -119,11 +131,13 @@ class CompressSectionClassObject (SectionClassObject)= : self.CompType =3D None=0D self.SectionList =3D []=0D =0D -## Data section data in FDF=0D +# Data section data in FDF=0D #=0D #=0D +=0D +=0D class DataSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -134,11 +148,13 @@ class DataSectionClassObject (SectionClassObject): self.SectionList =3D []=0D self.KeepReloc =3D True=0D =0D -## Rule section data in FDF=0D +# Rule section data in FDF=0D #=0D #=0D +=0D +=0D class EfiSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -153,11 +169,13 @@ class EfiSectionClassObject (SectionClassObject): self.BuildNum =3D None=0D self.KeepReloc =3D None=0D =0D -## FV image section data in FDF=0D +# FV image section data in FDF=0D #=0D #=0D +=0D +=0D class FvImageSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -170,11 +188,13 @@ class FvImageSectionClassObject (SectionClassObject): self.FvFileExtension =3D None=0D self.FvAddr =3D None=0D =0D -## GUIDed section data in FDF=0D +# GUIDed section data in FDF=0D #=0D #=0D -class GuidSectionClassObject (SectionClassObject) :=0D - ## The constructor=0D +=0D +=0D +class GuidSectionClassObject (SectionClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -190,11 +210,13 @@ class GuidSectionClassObject (SectionClassObject) : self.FvParentAddr =3D None=0D self.IncludeFvSection =3D False=0D =0D -## UI section data in FDF=0D +# UI section data in FDF=0D #=0D #=0D +=0D +=0D class UiSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -203,11 +225,13 @@ class UiSectionClassObject (SectionClassObject): self.StringData =3D None=0D self.FileName =3D None=0D =0D -## Version section data in FDF=0D +# Version section data in FDF=0D #=0D #=0D +=0D +=0D class VerSectionClassObject (SectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -217,11 +241,13 @@ class VerSectionClassObject (SectionClassObject): self.StringData =3D None=0D self.FileName =3D None=0D =0D -## Rule data in FDF=0D +# Rule data in FDF=0D #=0D #=0D -class RuleClassObject :=0D - ## The constructor=0D +=0D +=0D +class RuleClassObject:=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -238,11 +264,13 @@ class RuleClassObject : self.KeyStringList =3D []=0D self.KeepReloc =3D None=0D =0D -## Complex rule data in FDF=0D +# Complex rule data in FDF=0D #=0D #=0D -class RuleComplexFileClassObject(RuleClassObject) :=0D - ## The constructor=0D +=0D +=0D +class RuleComplexFileClassObject(RuleClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -250,11 +278,13 @@ class RuleComplexFileClassObject(RuleClassObject) : RuleClassObject.__init__(self)=0D self.SectionList =3D []=0D =0D -## Simple rule data in FDF=0D +# Simple rule data in FDF=0D #=0D #=0D -class RuleSimpleFileClassObject(RuleClassObject) :=0D - ## The constructor=0D +=0D +=0D +class RuleSimpleFileClassObject(RuleClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -264,11 +294,13 @@ class RuleSimpleFileClassObject(RuleClassObject) : self.SectionType =3D ''=0D self.FileExtension =3D None=0D =0D -## File extension rule data in FDF=0D +# File extension rule data in FDF=0D #=0D #=0D +=0D +=0D class RuleFileExtensionClassObject(RuleClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -276,11 +308,13 @@ class RuleFileExtensionClassObject(RuleClassObject): RuleClassObject.__init__(self)=0D self.FileExtension =3D None=0D =0D -## Capsule data in FDF=0D +# Capsule data in FDF=0D #=0D #=0D -class CapsuleClassObject :=0D - ## The constructor=0D +=0D +=0D +class CapsuleClassObject:=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -298,15 +332,16 @@ class CapsuleClassObject : self.CapsuleDataList =3D []=0D self.FmpPayloadList =3D []=0D =0D -## OptionROM data in FDF=0D +# OptionROM data in FDF=0D #=0D #=0D +=0D +=0D class OptionRomClassObject:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D self.DriverName =3D None=0D self.FfsList =3D []=0D -=0D diff --git a/BaseTools/Source/Python/CommonDataClass/__init__.py b/BaseTool= s/Source/Python/CommonDataClass/__init__.py index 81af4c07a36e..b56969e90fe2 100644 --- a/BaseTools/Source/Python/CommonDataClass/__init__.py +++ b/BaseTools/Source/Python/CommonDataClass/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'CommonDataClass' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Ecc/CParser3/CLexer.py b/BaseTools/Sou= rce/Python/Ecc/CParser3/CLexer.py index ca03adea7a65..c48cb2404bf0 100644 --- a/BaseTools/Source/Python/Ecc/CParser3/CLexer.py +++ b/BaseTools/Source/Python/Ecc/CParser3/CLexer.py @@ -3,7 +3,7 @@ from antlr3 import *=0D from antlr3.compat import set, frozenset=0D =0D -## @file=0D +# @file=0D # The file defines the Lexer for C source files.=0D #=0D # THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.=0D @@ -17,127 +17,127 @@ from antlr3.compat import set, frozenset ##=0D =0D =0D -=0D # for convenience in actions=0D HIDDEN =3D BaseRecognizer.HIDDEN=0D =0D # token types=0D -T114=3D114=0D -T115=3D115=0D -T116=3D116=0D -T117=3D117=0D -FloatTypeSuffix=3D16=0D -LETTER=3D11=0D -T29=3D29=0D -T28=3D28=0D -T27=3D27=0D -T26=3D26=0D -T25=3D25=0D -EOF=3D-1=0D -STRING_LITERAL=3D9=0D -FLOATING_POINT_LITERAL=3D10=0D -T38=3D38=0D -T37=3D37=0D -T39=3D39=0D -T34=3D34=0D -COMMENT=3D22=0D -T33=3D33=0D -T36=3D36=0D -T35=3D35=0D -T30=3D30=0D -T32=3D32=0D -T31=3D31=0D -LINE_COMMENT=3D23=0D -IntegerTypeSuffix=3D14=0D -CHARACTER_LITERAL=3D8=0D -T49=3D49=0D -T48=3D48=0D -T100=3D100=0D -T43=3D43=0D -T42=3D42=0D -T102=3D102=0D -T41=3D41=0D -T101=3D101=0D -T40=3D40=0D -T47=3D47=0D -T46=3D46=0D -T45=3D45=0D -T44=3D44=0D -T109=3D109=0D -T107=3D107=0D -T108=3D108=0D -T105=3D105=0D -WS=3D19=0D -T106=3D106=0D -T103=3D103=0D -T104=3D104=0D -T50=3D50=0D -LINE_COMMAND=3D24=0D -T59=3D59=0D -T113=3D113=0D -T52=3D52=0D -T112=3D112=0D -T51=3D51=0D -T111=3D111=0D -T54=3D54=0D -T110=3D110=0D -EscapeSequence=3D12=0D -DECIMAL_LITERAL=3D7=0D -T53=3D53=0D -T56=3D56=0D -T55=3D55=0D -T58=3D58=0D -T57=3D57=0D -T75=3D75=0D -T76=3D76=0D -T73=3D73=0D -T74=3D74=0D -T79=3D79=0D -T77=3D77=0D -T78=3D78=0D -Exponent=3D15=0D -HexDigit=3D13=0D -T72=3D72=0D -T71=3D71=0D -T70=3D70=0D -T62=3D62=0D -T63=3D63=0D -T64=3D64=0D -T65=3D65=0D -T66=3D66=0D -T67=3D67=0D -T68=3D68=0D -T69=3D69=0D -IDENTIFIER=3D4=0D -UnicodeVocabulary=3D21=0D -HEX_LITERAL=3D5=0D -T61=3D61=0D -T60=3D60=0D -T99=3D99=0D -T97=3D97=0D -BS=3D20=0D -T98=3D98=0D -T95=3D95=0D -T96=3D96=0D -OCTAL_LITERAL=3D6=0D -T94=3D94=0D -Tokens=3D118=0D -T93=3D93=0D -T92=3D92=0D -T91=3D91=0D -T90=3D90=0D -T88=3D88=0D -T89=3D89=0D -T84=3D84=0D -T85=3D85=0D -T86=3D86=0D -T87=3D87=0D -UnicodeEscape=3D18=0D -T81=3D81=0D -T80=3D80=0D -T83=3D83=0D -OctalEscape=3D17=0D -T82=3D82=0D +T114 =3D 114=0D +T115 =3D 115=0D +T116 =3D 116=0D +T117 =3D 117=0D +FloatTypeSuffix =3D 16=0D +LETTER =3D 11=0D +T29 =3D 29=0D +T28 =3D 28=0D +T27 =3D 27=0D +T26 =3D 26=0D +T25 =3D 25=0D +EOF =3D -1=0D +STRING_LITERAL =3D 9=0D +FLOATING_POINT_LITERAL =3D 10=0D +T38 =3D 38=0D +T37 =3D 37=0D +T39 =3D 39=0D +T34 =3D 34=0D +COMMENT =3D 22=0D +T33 =3D 33=0D +T36 =3D 36=0D +T35 =3D 35=0D +T30 =3D 30=0D +T32 =3D 32=0D +T31 =3D 31=0D +LINE_COMMENT =3D 23=0D +IntegerTypeSuffix =3D 14=0D +CHARACTER_LITERAL =3D 8=0D +T49 =3D 49=0D +T48 =3D 48=0D +T100 =3D 100=0D +T43 =3D 43=0D +T42 =3D 42=0D +T102 =3D 102=0D +T41 =3D 41=0D +T101 =3D 101=0D +T40 =3D 40=0D +T47 =3D 47=0D +T46 =3D 46=0D +T45 =3D 45=0D +T44 =3D 44=0D +T109 =3D 109=0D +T107 =3D 107=0D +T108 =3D 108=0D +T105 =3D 105=0D +WS =3D 19=0D +T106 =3D 106=0D +T103 =3D 103=0D +T104 =3D 104=0D +T50 =3D 50=0D +LINE_COMMAND =3D 24=0D +T59 =3D 59=0D +T113 =3D 113=0D +T52 =3D 52=0D +T112 =3D 112=0D +T51 =3D 51=0D +T111 =3D 111=0D +T54 =3D 54=0D +T110 =3D 110=0D +EscapeSequence =3D 12=0D +DECIMAL_LITERAL =3D 7=0D +T53 =3D 53=0D +T56 =3D 56=0D +T55 =3D 55=0D +T58 =3D 58=0D +T57 =3D 57=0D +T75 =3D 75=0D +T76 =3D 76=0D +T73 =3D 73=0D +T74 =3D 74=0D +T79 =3D 79=0D +T77 =3D 77=0D +T78 =3D 78=0D +Exponent =3D 15=0D +HexDigit =3D 13=0D +T72 =3D 72=0D +T71 =3D 71=0D +T70 =3D 70=0D +T62 =3D 62=0D +T63 =3D 63=0D +T64 =3D 64=0D +T65 =3D 65=0D +T66 =3D 66=0D +T67 =3D 67=0D +T68 =3D 68=0D +T69 =3D 69=0D +IDENTIFIER =3D 4=0D +UnicodeVocabulary =3D 21=0D +HEX_LITERAL =3D 5=0D +T61 =3D 61=0D +T60 =3D 60=0D +T99 =3D 99=0D +T97 =3D 97=0D +BS =3D 20=0D +T98 =3D 98=0D +T95 =3D 95=0D +T96 =3D 96=0D +OCTAL_LITERAL =3D 6=0D +T94 =3D 94=0D +Tokens =3D 118=0D +T93 =3D 93=0D +T92 =3D 92=0D +T91 =3D 91=0D +T90 =3D 90=0D +T88 =3D 88=0D +T89 =3D 89=0D +T84 =3D 84=0D +T85 =3D 85=0D +T86 =3D 86=0D +T87 =3D 87=0D +UnicodeEscape =3D 18=0D +T81 =3D 81=0D +T80 =3D 80=0D +T83 =3D 83=0D +OctalEscape =3D 17=0D +T82 =3D 82=0D +=0D =0D class CLexer(Lexer):=0D =0D @@ -147,31 +147,27 @@ class CLexer(Lexer): Lexer.__init__(self, input)=0D self.dfa25 =3D self.DFA25(=0D self, 25,=0D - eot =3D self.DFA25_eot,=0D - eof =3D self.DFA25_eof,=0D - min =3D self.DFA25_min,=0D - max =3D self.DFA25_max,=0D - accept =3D self.DFA25_accept,=0D - special =3D self.DFA25_special,=0D - transition =3D self.DFA25_transition=0D - )=0D + eot=3Dself.DFA25_eot,=0D + eof=3Dself.DFA25_eof,=0D + min=3Dself.DFA25_min,=0D + max=3Dself.DFA25_max,=0D + accept=3Dself.DFA25_accept,=0D + special=3Dself.DFA25_special,=0D + transition=3Dself.DFA25_transition=0D + )=0D self.dfa35 =3D self.DFA35(=0D self, 35,=0D - eot =3D self.DFA35_eot,=0D - eof =3D self.DFA35_eof,=0D - min =3D self.DFA35_min,=0D - max =3D self.DFA35_max,=0D - accept =3D self.DFA35_accept,=0D - special =3D self.DFA35_special,=0D - transition =3D self.DFA35_transition=0D - )=0D -=0D -=0D -=0D -=0D -=0D + eot=3Dself.DFA35_eot,=0D + eof=3Dself.DFA35_eof,=0D + min=3Dself.DFA35_min,=0D + max=3Dself.DFA35_max,=0D + accept=3Dself.DFA35_accept,=0D + special=3Dself.DFA35_special,=0D + transition=3Dself.DFA35_transition=0D + )=0D =0D # $ANTLR start T25=0D +=0D def mT25(self, ):=0D =0D try:=0D @@ -181,19 +177,14 @@ class CLexer(Lexer): # C.g:27:7: ';'=0D self.match(u';')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T25=0D =0D -=0D -=0D # $ANTLR start T26=0D +=0D def mT26(self, ):=0D =0D try:=0D @@ -203,20 +194,14 @@ class CLexer(Lexer): # C.g:28:7: 'typedef'=0D self.match("typedef")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T26=0D =0D -=0D -=0D # $ANTLR start T27=0D +=0D def mT27(self, ):=0D =0D try:=0D @@ -226,19 +211,14 @@ class CLexer(Lexer): # C.g:29:7: ','=0D self.match(u',')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T27=0D =0D -=0D -=0D # $ANTLR start T28=0D +=0D def mT28(self, ):=0D =0D try:=0D @@ -248,19 +228,14 @@ class CLexer(Lexer): # C.g:30:7: '=3D'=0D self.match(u'=3D')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T28=0D =0D -=0D -=0D # $ANTLR start T29=0D +=0D def mT29(self, ):=0D =0D try:=0D @@ -270,20 +245,14 @@ class CLexer(Lexer): # C.g:31:7: 'extern'=0D self.match("extern")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T29=0D =0D -=0D -=0D # $ANTLR start T30=0D +=0D def mT30(self, ):=0D =0D try:=0D @@ -293,20 +262,14 @@ class CLexer(Lexer): # C.g:32:7: 'static'=0D self.match("static")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T30=0D =0D -=0D -=0D # $ANTLR start T31=0D +=0D def mT31(self, ):=0D =0D try:=0D @@ -316,20 +279,14 @@ class CLexer(Lexer): # C.g:33:7: 'auto'=0D self.match("auto")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T31=0D =0D -=0D -=0D # $ANTLR start T32=0D +=0D def mT32(self, ):=0D =0D try:=0D @@ -339,20 +296,14 @@ class CLexer(Lexer): # C.g:34:7: 'register'=0D self.match("register")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T32=0D =0D -=0D -=0D # $ANTLR start T33=0D +=0D def mT33(self, ):=0D =0D try:=0D @@ -362,20 +313,14 @@ class CLexer(Lexer): # C.g:35:7: 'STATIC'=0D self.match("STATIC")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T33=0D =0D -=0D -=0D # $ANTLR start T34=0D +=0D def mT34(self, ):=0D =0D try:=0D @@ -385,20 +330,14 @@ class CLexer(Lexer): # C.g:36:7: 'void'=0D self.match("void")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T34=0D =0D -=0D -=0D # $ANTLR start T35=0D +=0D def mT35(self, ):=0D =0D try:=0D @@ -408,20 +347,14 @@ class CLexer(Lexer): # C.g:37:7: 'char'=0D self.match("char")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T35=0D =0D -=0D -=0D # $ANTLR start T36=0D +=0D def mT36(self, ):=0D =0D try:=0D @@ -431,20 +364,14 @@ class CLexer(Lexer): # C.g:38:7: 'short'=0D self.match("short")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T36=0D =0D -=0D -=0D # $ANTLR start T37=0D +=0D def mT37(self, ):=0D =0D try:=0D @@ -454,20 +381,14 @@ class CLexer(Lexer): # C.g:39:7: 'int'=0D self.match("int")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T37=0D =0D -=0D -=0D # $ANTLR start T38=0D +=0D def mT38(self, ):=0D =0D try:=0D @@ -477,20 +398,14 @@ class CLexer(Lexer): # C.g:40:7: 'long'=0D self.match("long")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T38=0D =0D -=0D -=0D # $ANTLR start T39=0D +=0D def mT39(self, ):=0D =0D try:=0D @@ -500,20 +415,14 @@ class CLexer(Lexer): # C.g:41:7: 'float'=0D self.match("float")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T39=0D =0D -=0D -=0D # $ANTLR start T40=0D +=0D def mT40(self, ):=0D =0D try:=0D @@ -523,20 +432,14 @@ class CLexer(Lexer): # C.g:42:7: 'double'=0D self.match("double")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T40=0D =0D -=0D -=0D # $ANTLR start T41=0D +=0D def mT41(self, ):=0D =0D try:=0D @@ -546,20 +449,14 @@ class CLexer(Lexer): # C.g:43:7: 'signed'=0D self.match("signed")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T41=0D =0D -=0D -=0D # $ANTLR start T42=0D +=0D def mT42(self, ):=0D =0D try:=0D @@ -569,20 +466,14 @@ class CLexer(Lexer): # C.g:44:7: 'unsigned'=0D self.match("unsigned")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T42=0D =0D -=0D -=0D # $ANTLR start T43=0D +=0D def mT43(self, ):=0D =0D try:=0D @@ -592,19 +483,14 @@ class CLexer(Lexer): # C.g:45:7: '{'=0D self.match(u'{')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T43=0D =0D -=0D -=0D # $ANTLR start T44=0D +=0D def mT44(self, ):=0D =0D try:=0D @@ -614,19 +500,14 @@ class CLexer(Lexer): # C.g:46:7: '}'=0D self.match(u'}')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T44=0D =0D -=0D -=0D # $ANTLR start T45=0D +=0D def mT45(self, ):=0D =0D try:=0D @@ -636,20 +517,14 @@ class CLexer(Lexer): # C.g:47:7: 'struct'=0D self.match("struct")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T45=0D =0D -=0D -=0D # $ANTLR start T46=0D +=0D def mT46(self, ):=0D =0D try:=0D @@ -659,20 +534,14 @@ class CLexer(Lexer): # C.g:48:7: 'union'=0D self.match("union")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T46=0D =0D -=0D -=0D # $ANTLR start T47=0D +=0D def mT47(self, ):=0D =0D try:=0D @@ -682,19 +551,14 @@ class CLexer(Lexer): # C.g:49:7: ':'=0D self.match(u':')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T47=0D =0D -=0D -=0D # $ANTLR start T48=0D +=0D def mT48(self, ):=0D =0D try:=0D @@ -704,20 +568,14 @@ class CLexer(Lexer): # C.g:50:7: 'enum'=0D self.match("enum")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T48=0D =0D -=0D -=0D # $ANTLR start T49=0D +=0D def mT49(self, ):=0D =0D try:=0D @@ -727,20 +585,14 @@ class CLexer(Lexer): # C.g:51:7: 'const'=0D self.match("const")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T49=0D =0D -=0D -=0D # $ANTLR start T50=0D +=0D def mT50(self, ):=0D =0D try:=0D @@ -750,20 +602,14 @@ class CLexer(Lexer): # C.g:52:7: 'volatile'=0D self.match("volatile")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T50=0D =0D -=0D -=0D # $ANTLR start T51=0D +=0D def mT51(self, ):=0D =0D try:=0D @@ -773,20 +619,14 @@ class CLexer(Lexer): # C.g:53:7: 'IN'=0D self.match("IN")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T51=0D =0D -=0D -=0D # $ANTLR start T52=0D +=0D def mT52(self, ):=0D =0D try:=0D @@ -796,20 +636,14 @@ class CLexer(Lexer): # C.g:54:7: 'OUT'=0D self.match("OUT")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T52=0D =0D -=0D -=0D # $ANTLR start T53=0D +=0D def mT53(self, ):=0D =0D try:=0D @@ -819,20 +653,14 @@ class CLexer(Lexer): # C.g:55:7: 'OPTIONAL'=0D self.match("OPTIONAL")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T53=0D =0D -=0D -=0D # $ANTLR start T54=0D +=0D def mT54(self, ):=0D =0D try:=0D @@ -842,20 +670,14 @@ class CLexer(Lexer): # C.g:56:7: 'CONST'=0D self.match("CONST")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T54=0D =0D -=0D -=0D # $ANTLR start T55=0D +=0D def mT55(self, ):=0D =0D try:=0D @@ -865,20 +687,14 @@ class CLexer(Lexer): # C.g:57:7: 'UNALIGNED'=0D self.match("UNALIGNED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T55=0D =0D -=0D -=0D # $ANTLR start T56=0D +=0D def mT56(self, ):=0D =0D try:=0D @@ -888,20 +704,14 @@ class CLexer(Lexer): # C.g:58:7: 'VOLATILE'=0D self.match("VOLATILE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T56=0D =0D -=0D -=0D # $ANTLR start T57=0D +=0D def mT57(self, ):=0D =0D try:=0D @@ -911,20 +721,14 @@ class CLexer(Lexer): # C.g:59:7: 'GLOBAL_REMOVE_IF_UNREFERENCED'=0D self.match("GLOBAL_REMOVE_IF_UNREFERENCED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T57=0D =0D -=0D -=0D # $ANTLR start T58=0D +=0D def mT58(self, ):=0D =0D try:=0D @@ -934,20 +738,14 @@ class CLexer(Lexer): # C.g:60:7: 'EFIAPI'=0D self.match("EFIAPI")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T58=0D =0D -=0D -=0D # $ANTLR start T59=0D +=0D def mT59(self, ):=0D =0D try:=0D @@ -957,20 +755,14 @@ class CLexer(Lexer): # C.g:61:7: 'EFI_BOOTSERVICE'=0D self.match("EFI_BOOTSERVICE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T59=0D =0D -=0D -=0D # $ANTLR start T60=0D +=0D def mT60(self, ):=0D =0D try:=0D @@ -980,20 +772,14 @@ class CLexer(Lexer): # C.g:62:7: 'EFI_RUNTIMESERVICE'=0D self.match("EFI_RUNTIMESERVICE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T60=0D =0D -=0D -=0D # $ANTLR start T61=0D +=0D def mT61(self, ):=0D =0D try:=0D @@ -1003,20 +789,14 @@ class CLexer(Lexer): # C.g:63:7: 'PACKED'=0D self.match("PACKED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T61=0D =0D -=0D -=0D # $ANTLR start T62=0D +=0D def mT62(self, ):=0D =0D try:=0D @@ -1026,19 +806,14 @@ class CLexer(Lexer): # C.g:64:7: '('=0D self.match(u'(')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T62=0D =0D -=0D -=0D # $ANTLR start T63=0D +=0D def mT63(self, ):=0D =0D try:=0D @@ -1048,19 +823,14 @@ class CLexer(Lexer): # C.g:65:7: ')'=0D self.match(u')')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T63=0D =0D -=0D -=0D # $ANTLR start T64=0D +=0D def mT64(self, ):=0D =0D try:=0D @@ -1070,19 +840,14 @@ class CLexer(Lexer): # C.g:66:7: '['=0D self.match(u'[')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T64=0D =0D -=0D -=0D # $ANTLR start T65=0D +=0D def mT65(self, ):=0D =0D try:=0D @@ -1092,19 +857,14 @@ class CLexer(Lexer): # C.g:67:7: ']'=0D self.match(u']')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T65=0D =0D -=0D -=0D # $ANTLR start T66=0D +=0D def mT66(self, ):=0D =0D try:=0D @@ -1114,19 +874,14 @@ class CLexer(Lexer): # C.g:68:7: '*'=0D self.match(u'*')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T66=0D =0D -=0D -=0D # $ANTLR start T67=0D +=0D def mT67(self, ):=0D =0D try:=0D @@ -1136,20 +891,14 @@ class CLexer(Lexer): # C.g:69:7: '...'=0D self.match("...")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T67=0D =0D -=0D -=0D # $ANTLR start T68=0D +=0D def mT68(self, ):=0D =0D try:=0D @@ -1159,19 +908,14 @@ class CLexer(Lexer): # C.g:70:7: '+'=0D self.match(u'+')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T68=0D =0D -=0D -=0D # $ANTLR start T69=0D +=0D def mT69(self, ):=0D =0D try:=0D @@ -1181,19 +925,14 @@ class CLexer(Lexer): # C.g:71:7: '-'=0D self.match(u'-')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T69=0D =0D -=0D -=0D # $ANTLR start T70=0D +=0D def mT70(self, ):=0D =0D try:=0D @@ -1203,19 +942,14 @@ class CLexer(Lexer): # C.g:72:7: '/'=0D self.match(u'/')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T70=0D =0D -=0D -=0D # $ANTLR start T71=0D +=0D def mT71(self, ):=0D =0D try:=0D @@ -1225,19 +959,14 @@ class CLexer(Lexer): # C.g:73:7: '%'=0D self.match(u'%')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T71=0D =0D -=0D -=0D # $ANTLR start T72=0D +=0D def mT72(self, ):=0D =0D try:=0D @@ -1247,20 +976,14 @@ class CLexer(Lexer): # C.g:74:7: '++'=0D self.match("++")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T72=0D =0D -=0D -=0D # $ANTLR start T73=0D +=0D def mT73(self, ):=0D =0D try:=0D @@ -1270,20 +993,14 @@ class CLexer(Lexer): # C.g:75:7: '--'=0D self.match("--")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T73=0D =0D -=0D -=0D # $ANTLR start T74=0D +=0D def mT74(self, ):=0D =0D try:=0D @@ -1293,20 +1010,14 @@ class CLexer(Lexer): # C.g:76:7: 'sizeof'=0D self.match("sizeof")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T74=0D =0D -=0D -=0D # $ANTLR start T75=0D +=0D def mT75(self, ):=0D =0D try:=0D @@ -1316,19 +1027,14 @@ class CLexer(Lexer): # C.g:77:7: '.'=0D self.match(u'.')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T75=0D =0D -=0D -=0D # $ANTLR start T76=0D +=0D def mT76(self, ):=0D =0D try:=0D @@ -1338,20 +1044,14 @@ class CLexer(Lexer): # C.g:78:7: '->'=0D self.match("->")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T76=0D =0D -=0D -=0D # $ANTLR start T77=0D +=0D def mT77(self, ):=0D =0D try:=0D @@ -1361,19 +1061,14 @@ class CLexer(Lexer): # C.g:79:7: '&'=0D self.match(u'&')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T77=0D =0D -=0D -=0D # $ANTLR start T78=0D +=0D def mT78(self, ):=0D =0D try:=0D @@ -1383,19 +1078,14 @@ class CLexer(Lexer): # C.g:80:7: '~'=0D self.match(u'~')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T78=0D =0D -=0D -=0D # $ANTLR start T79=0D +=0D def mT79(self, ):=0D =0D try:=0D @@ -1405,19 +1095,14 @@ class CLexer(Lexer): # C.g:81:7: '!'=0D self.match(u'!')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T79=0D =0D -=0D -=0D # $ANTLR start T80=0D +=0D def mT80(self, ):=0D =0D try:=0D @@ -1427,20 +1112,14 @@ class CLexer(Lexer): # C.g:82:7: '*=3D'=0D self.match("*=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T80=0D =0D -=0D -=0D # $ANTLR start T81=0D +=0D def mT81(self, ):=0D =0D try:=0D @@ -1450,20 +1129,14 @@ class CLexer(Lexer): # C.g:83:7: '/=3D'=0D self.match("/=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T81=0D =0D -=0D -=0D # $ANTLR start T82=0D +=0D def mT82(self, ):=0D =0D try:=0D @@ -1473,20 +1146,14 @@ class CLexer(Lexer): # C.g:84:7: '%=3D'=0D self.match("%=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T82=0D =0D -=0D -=0D # $ANTLR start T83=0D +=0D def mT83(self, ):=0D =0D try:=0D @@ -1496,20 +1163,14 @@ class CLexer(Lexer): # C.g:85:7: '+=3D'=0D self.match("+=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T83=0D =0D -=0D -=0D # $ANTLR start T84=0D +=0D def mT84(self, ):=0D =0D try:=0D @@ -1519,20 +1180,14 @@ class CLexer(Lexer): # C.g:86:7: '-=3D'=0D self.match("-=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T84=0D =0D -=0D -=0D # $ANTLR start T85=0D +=0D def mT85(self, ):=0D =0D try:=0D @@ -1542,20 +1197,14 @@ class CLexer(Lexer): # C.g:87:7: '<<=3D'=0D self.match("<<=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T85=0D =0D -=0D -=0D # $ANTLR start T86=0D +=0D def mT86(self, ):=0D =0D try:=0D @@ -1565,20 +1214,14 @@ class CLexer(Lexer): # C.g:88:7: '>>=3D'=0D self.match(">>=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T86=0D =0D -=0D -=0D # $ANTLR start T87=0D +=0D def mT87(self, ):=0D =0D try:=0D @@ -1588,20 +1231,14 @@ class CLexer(Lexer): # C.g:89:7: '&=3D'=0D self.match("&=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T87=0D =0D -=0D -=0D # $ANTLR start T88=0D +=0D def mT88(self, ):=0D =0D try:=0D @@ -1611,20 +1248,14 @@ class CLexer(Lexer): # C.g:90:7: '^=3D'=0D self.match("^=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T88=0D =0D -=0D -=0D # $ANTLR start T89=0D +=0D def mT89(self, ):=0D =0D try:=0D @@ -1634,20 +1265,14 @@ class CLexer(Lexer): # C.g:91:7: '|=3D'=0D self.match("|=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T89=0D =0D -=0D -=0D # $ANTLR start T90=0D +=0D def mT90(self, ):=0D =0D try:=0D @@ -1657,19 +1282,14 @@ class CLexer(Lexer): # C.g:92:7: '?'=0D self.match(u'?')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T90=0D =0D -=0D -=0D # $ANTLR start T91=0D +=0D def mT91(self, ):=0D =0D try:=0D @@ -1679,20 +1299,14 @@ class CLexer(Lexer): # C.g:93:7: '||'=0D self.match("||")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T91=0D =0D -=0D -=0D # $ANTLR start T92=0D +=0D def mT92(self, ):=0D =0D try:=0D @@ -1702,20 +1316,14 @@ class CLexer(Lexer): # C.g:94:7: '&&'=0D self.match("&&")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T92=0D =0D -=0D -=0D # $ANTLR start T93=0D +=0D def mT93(self, ):=0D =0D try:=0D @@ -1725,19 +1333,14 @@ class CLexer(Lexer): # C.g:95:7: '|'=0D self.match(u'|')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T93=0D =0D -=0D -=0D # $ANTLR start T94=0D +=0D def mT94(self, ):=0D =0D try:=0D @@ -1747,19 +1350,14 @@ class CLexer(Lexer): # C.g:96:7: '^'=0D self.match(u'^')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T94=0D =0D -=0D -=0D # $ANTLR start T95=0D +=0D def mT95(self, ):=0D =0D try:=0D @@ -1769,20 +1367,14 @@ class CLexer(Lexer): # C.g:97:7: '=3D=3D'=0D self.match("=3D=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T95=0D =0D -=0D -=0D # $ANTLR start T96=0D +=0D def mT96(self, ):=0D =0D try:=0D @@ -1792,20 +1384,14 @@ class CLexer(Lexer): # C.g:98:7: '!=3D'=0D self.match("!=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T96=0D =0D -=0D -=0D # $ANTLR start T97=0D +=0D def mT97(self, ):=0D =0D try:=0D @@ -1815,19 +1401,14 @@ class CLexer(Lexer): # C.g:99:7: '<'=0D self.match(u'<')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T97=0D =0D -=0D -=0D # $ANTLR start T98=0D +=0D def mT98(self, ):=0D =0D try:=0D @@ -1837,19 +1418,14 @@ class CLexer(Lexer): # C.g:100:7: '>'=0D self.match(u'>')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T98=0D =0D -=0D -=0D # $ANTLR start T99=0D +=0D def mT99(self, ):=0D =0D try:=0D @@ -1859,20 +1435,14 @@ class CLexer(Lexer): # C.g:101:7: '<=3D'=0D self.match("<=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T99=0D =0D -=0D -=0D # $ANTLR start T100=0D +=0D def mT100(self, ):=0D =0D try:=0D @@ -1882,20 +1452,14 @@ class CLexer(Lexer): # C.g:102:8: '>=3D'=0D self.match(">=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T100=0D =0D -=0D -=0D # $ANTLR start T101=0D +=0D def mT101(self, ):=0D =0D try:=0D @@ -1905,20 +1469,14 @@ class CLexer(Lexer): # C.g:103:8: '<<'=0D self.match("<<")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T101=0D =0D -=0D -=0D # $ANTLR start T102=0D +=0D def mT102(self, ):=0D =0D try:=0D @@ -1928,20 +1486,14 @@ class CLexer(Lexer): # C.g:104:8: '>>'=0D self.match(">>")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T102=0D =0D -=0D -=0D # $ANTLR start T103=0D +=0D def mT103(self, ):=0D =0D try:=0D @@ -1951,20 +1503,14 @@ class CLexer(Lexer): # C.g:105:8: '__asm__'=0D self.match("__asm__")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T103=0D =0D -=0D -=0D # $ANTLR start T104=0D +=0D def mT104(self, ):=0D =0D try:=0D @@ -1974,20 +1520,14 @@ class CLexer(Lexer): # C.g:106:8: '_asm'=0D self.match("_asm")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T104=0D =0D -=0D -=0D # $ANTLR start T105=0D +=0D def mT105(self, ):=0D =0D try:=0D @@ -1997,20 +1537,14 @@ class CLexer(Lexer): # C.g:107:8: '__asm'=0D self.match("__asm")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T105=0D =0D -=0D -=0D # $ANTLR start T106=0D +=0D def mT106(self, ):=0D =0D try:=0D @@ -2020,20 +1554,14 @@ class CLexer(Lexer): # C.g:108:8: 'case'=0D self.match("case")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T106=0D =0D -=0D -=0D # $ANTLR start T107=0D +=0D def mT107(self, ):=0D =0D try:=0D @@ -2043,20 +1571,14 @@ class CLexer(Lexer): # C.g:109:8: 'default'=0D self.match("default")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T107=0D =0D -=0D -=0D # $ANTLR start T108=0D +=0D def mT108(self, ):=0D =0D try:=0D @@ -2066,20 +1588,14 @@ class CLexer(Lexer): # C.g:110:8: 'if'=0D self.match("if")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T108=0D =0D -=0D -=0D # $ANTLR start T109=0D +=0D def mT109(self, ):=0D =0D try:=0D @@ -2089,20 +1605,14 @@ class CLexer(Lexer): # C.g:111:8: 'else'=0D self.match("else")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T109=0D =0D -=0D -=0D # $ANTLR start T110=0D +=0D def mT110(self, ):=0D =0D try:=0D @@ -2112,20 +1622,14 @@ class CLexer(Lexer): # C.g:112:8: 'switch'=0D self.match("switch")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T110=0D =0D -=0D -=0D # $ANTLR start T111=0D +=0D def mT111(self, ):=0D =0D try:=0D @@ -2135,20 +1639,14 @@ class CLexer(Lexer): # C.g:113:8: 'while'=0D self.match("while")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T111=0D =0D -=0D -=0D # $ANTLR start T112=0D +=0D def mT112(self, ):=0D =0D try:=0D @@ -2158,20 +1656,14 @@ class CLexer(Lexer): # C.g:114:8: 'do'=0D self.match("do")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T112=0D =0D -=0D -=0D # $ANTLR start T113=0D +=0D def mT113(self, ):=0D =0D try:=0D @@ -2181,20 +1673,14 @@ class CLexer(Lexer): # C.g:115:8: 'for'=0D self.match("for")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T113=0D =0D -=0D -=0D # $ANTLR start T114=0D +=0D def mT114(self, ):=0D =0D try:=0D @@ -2204,20 +1690,14 @@ class CLexer(Lexer): # C.g:116:8: 'goto'=0D self.match("goto")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T114=0D =0D -=0D -=0D # $ANTLR start T115=0D +=0D def mT115(self, ):=0D =0D try:=0D @@ -2227,20 +1707,14 @@ class CLexer(Lexer): # C.g:117:8: 'continue'=0D self.match("continue")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T115=0D =0D -=0D -=0D # $ANTLR start T116=0D +=0D def mT116(self, ):=0D =0D try:=0D @@ -2250,20 +1724,14 @@ class CLexer(Lexer): # C.g:118:8: 'break'=0D self.match("break")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T116=0D =0D -=0D -=0D # $ANTLR start T117=0D +=0D def mT117(self, ):=0D =0D try:=0D @@ -2273,20 +1741,14 @@ class CLexer(Lexer): # C.g:119:8: 'return'=0D self.match("return")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T117=0D =0D -=0D -=0D # $ANTLR start IDENTIFIER=0D +=0D def mIDENTIFIER(self, ):=0D =0D try:=0D @@ -2297,34 +1759,25 @@ class CLexer(Lexer): self.mLETTER()=0D =0D # C.g:586:11: ( LETTER | '0' .. '9' )*=0D - while True: #loop1=0D + while True: # loop1=0D alt1 =3D 2=0D LA1_0 =3D self.input.LA(1)=0D =0D - if (LA1_0 =3D=3D u'$' or (u'0' <=3D LA1_0 <=3D u'9') or (u= 'A' <=3D LA1_0 <=3D u'Z') or LA1_0 =3D=3D u'_' or (u'a' <=3D LA1_0 <=3D u'z= ')) :=0D + if (LA1_0 =3D=3D u'$' or (u'0' <=3D LA1_0 <=3D u'9') or (u= 'A' <=3D LA1_0 <=3D u'Z') or LA1_0 =3D=3D u'_' or (u'a' <=3D LA1_0 <=3D u'z= ')):=0D alt1 =3D 1=0D =0D -=0D if alt1 =3D=3D 1:=0D # C.g:=0D if self.input.LA(1) =3D=3D u'$' or (u'0' <=3D self.inp= ut.LA(1) <=3D u'9') or (u'A' <=3D self.input.LA(1) <=3D u'Z') or self.input= .LA(1) =3D=3D u'_' or (u'a' <=3D self.input.LA(1) <=3D u'z'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop1=0D -=0D -=0D -=0D -=0D -=0D + break # loop1=0D =0D finally:=0D =0D @@ -2332,36 +1785,29 @@ class CLexer(Lexer): =0D # $ANTLR end IDENTIFIER=0D =0D -=0D -=0D # $ANTLR start LETTER=0D +=0D def mLETTER(self, ):=0D =0D try:=0D # C.g:591:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )=0D # C.g:=0D if self.input.LA(1) =3D=3D u'$' or (u'A' <=3D self.input.LA(1)= <=3D u'Z') or self.input.LA(1) =3D=3D u'_' or (u'a' <=3D self.input.LA(1) = <=3D u'z'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end LETTER=0D =0D -=0D -=0D # $ANTLR start CHARACTER_LITERAL=0D +=0D def mCHARACTER_LITERAL(self, ):=0D =0D try:=0D @@ -2373,27 +1819,25 @@ class CLexer(Lexer): alt2 =3D 2=0D LA2_0 =3D self.input.LA(1)=0D =0D - if (LA2_0 =3D=3D u'L') :=0D + if (LA2_0 =3D=3D u'L'):=0D alt2 =3D 1=0D if alt2 =3D=3D 1:=0D # C.g:598:10: 'L'=0D self.match(u'L')=0D =0D -=0D -=0D -=0D self.match(u'\'')=0D =0D # C.g:598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )=0D alt3 =3D 2=0D LA3_0 =3D self.input.LA(1)=0D =0D - if (LA3_0 =3D=3D u'\\') :=0D + if (LA3_0 =3D=3D u'\\'):=0D alt3 =3D 1=0D - elif ((u'\u0000' <=3D LA3_0 <=3D u'&') or (u'(' <=3D LA3_0 <= =3D u'[') or (u']' <=3D LA3_0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA3_0 <=3D u'&') or (u'(' <=3D LA3_0 <= =3D u'[') or (u']' <=3D LA3_0 <=3D u'\uFFFE')):=0D alt3 =3D 2=0D else:=0D - nvae =3D NoViableAltException("598:21: ( EscapeSequence | = ~ ( '\\'' | '\\\\' ) )", 3, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 3= , 0, self.input)=0D =0D raise nvae=0D =0D @@ -2401,37 +1845,26 @@ class CLexer(Lexer): # C.g:598:23: EscapeSequence=0D self.mEscapeSequence()=0D =0D -=0D -=0D elif alt3 =3D=3D 2:=0D # C.g:598:40: ~ ( '\\'' | '\\\\' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'&') or (u'(' <= =3D self.input.LA(1) <=3D u'[') or (u']' <=3D self.input.LA(1) <=3D u'\uFFF= E'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D self.match(u'\'')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end CHARACTER_LITERAL=0D =0D -=0D -=0D # $ANTLR start STRING_LITERAL=0D +=0D def mSTRING_LITERAL(self, ):=0D =0D try:=0D @@ -2443,66 +1876,51 @@ class CLexer(Lexer): alt4 =3D 2=0D LA4_0 =3D self.input.LA(1)=0D =0D - if (LA4_0 =3D=3D u'L') :=0D + if (LA4_0 =3D=3D u'L'):=0D alt4 =3D 1=0D if alt4 =3D=3D 1:=0D # C.g:602:9: 'L'=0D self.match(u'L')=0D =0D -=0D -=0D -=0D self.match(u'"')=0D =0D # C.g:602:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*=0D - while True: #loop5=0D + while True: # loop5=0D alt5 =3D 3=0D LA5_0 =3D self.input.LA(1)=0D =0D - if (LA5_0 =3D=3D u'\\') :=0D + if (LA5_0 =3D=3D u'\\'):=0D alt5 =3D 1=0D - elif ((u'\u0000' <=3D LA5_0 <=3D u'!') or (u'#' <=3D LA5_0= <=3D u'[') or (u']' <=3D LA5_0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA5_0 <=3D u'!') or (u'#' <=3D LA5_0= <=3D u'[') or (u']' <=3D LA5_0 <=3D u'\uFFFE')):=0D alt5 =3D 2=0D =0D -=0D if alt5 =3D=3D 1:=0D # C.g:602:21: EscapeSequence=0D self.mEscapeSequence()=0D =0D -=0D -=0D elif alt5 =3D=3D 2:=0D # C.g:602:38: ~ ( '\\\\' | '\"' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'!') or (u'#= ' <=3D self.input.LA(1) <=3D u'[') or (u']' <=3D self.input.LA(1) <=3D u'\u= FFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop5=0D -=0D + break # loop5=0D =0D self.match(u'"')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end STRING_LITERAL=0D =0D -=0D -=0D # $ANTLR start HEX_LITERAL=0D +=0D def mHEX_LITERAL(self, ):=0D =0D try:=0D @@ -2513,66 +1931,53 @@ class CLexer(Lexer): self.match(u'0')=0D =0D if self.input.LA(1) =3D=3D u'X' or self.input.LA(1) =3D=3D u'x= ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D # C.g:605:29: ( HexDigit )+=0D cnt6 =3D 0=0D - while True: #loop6=0D + while True: # loop6=0D alt6 =3D 2=0D LA6_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA6_0 <=3D u'9') or (u'A' <=3D LA6_0 <=3D u= 'F') or (u'a' <=3D LA6_0 <=3D u'f')) :=0D + if ((u'0' <=3D LA6_0 <=3D u'9') or (u'A' <=3D LA6_0 <=3D u= 'F') or (u'a' <=3D LA6_0 <=3D u'f')):=0D alt6 =3D 1=0D =0D -=0D if alt6 =3D=3D 1:=0D # C.g:605:29: HexDigit=0D self.mHexDigit()=0D =0D -=0D -=0D else:=0D if cnt6 >=3D 1:=0D - break #loop6=0D + break # loop6=0D =0D eee =3D EarlyExitException(6, self.input)=0D raise eee=0D =0D cnt6 +=3D 1=0D =0D -=0D # C.g:605:39: ( IntegerTypeSuffix )?=0D alt7 =3D 2=0D LA7_0 =3D self.input.LA(1)=0D =0D - if (LA7_0 =3D=3D u'L' or LA7_0 =3D=3D u'U' or LA7_0 =3D=3D u'l= ' or LA7_0 =3D=3D u'u') :=0D + if (LA7_0 =3D=3D u'L' or LA7_0 =3D=3D u'U' or LA7_0 =3D=3D u'l= ' or LA7_0 =3D=3D u'u'):=0D alt7 =3D 1=0D if alt7 =3D=3D 1:=0D # C.g:605:39: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end HEX_LITERAL=0D =0D -=0D -=0D # $ANTLR start DECIMAL_LITERAL=0D +=0D def mDECIMAL_LITERAL(self, ):=0D =0D try:=0D @@ -2584,12 +1989,13 @@ class CLexer(Lexer): alt9 =3D 2=0D LA9_0 =3D self.input.LA(1)=0D =0D - if (LA9_0 =3D=3D u'0') :=0D + if (LA9_0 =3D=3D u'0'):=0D alt9 =3D 1=0D - elif ((u'1' <=3D LA9_0 <=3D u'9')) :=0D + elif ((u'1' <=3D LA9_0 <=3D u'9')):=0D alt9 =3D 2=0D else:=0D - nvae =3D NoViableAltException("607:19: ( '0' | '1' .. '9' = ( '0' .. '9' )* )", 9, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 9, 0, = self.input)=0D =0D raise nvae=0D =0D @@ -2597,60 +2003,43 @@ class CLexer(Lexer): # C.g:607:20: '0'=0D self.match(u'0')=0D =0D -=0D -=0D elif alt9 =3D=3D 2:=0D # C.g:607:26: '1' .. '9' ( '0' .. '9' )*=0D self.matchRange(u'1', u'9')=0D =0D # C.g:607:35: ( '0' .. '9' )*=0D - while True: #loop8=0D + while True: # loop8=0D alt8 =3D 2=0D LA8_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA8_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA8_0 <=3D u'9')):=0D alt8 =3D 1=0D =0D -=0D if alt8 =3D=3D 1:=0D # C.g:607:35: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D - break #loop8=0D -=0D -=0D -=0D -=0D + break # loop8=0D =0D # C.g:607:46: ( IntegerTypeSuffix )?=0D alt10 =3D 2=0D LA10_0 =3D self.input.LA(1)=0D =0D - if (LA10_0 =3D=3D u'L' or LA10_0 =3D=3D u'U' or LA10_0 =3D=3D = u'l' or LA10_0 =3D=3D u'u') :=0D + if (LA10_0 =3D=3D u'L' or LA10_0 =3D=3D u'U' or LA10_0 =3D=3D = u'l' or LA10_0 =3D=3D u'u'):=0D alt10 =3D 1=0D if alt10 =3D=3D 1:=0D # C.g:607:46: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end DECIMAL_LITERAL=0D =0D -=0D -=0D # $ANTLR start OCTAL_LITERAL=0D +=0D def mOCTAL_LITERAL(self, ):=0D =0D try:=0D @@ -2662,83 +2051,65 @@ class CLexer(Lexer): =0D # C.g:609:21: ( '0' .. '7' )+=0D cnt11 =3D 0=0D - while True: #loop11=0D + while True: # loop11=0D alt11 =3D 2=0D LA11_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA11_0 <=3D u'7')) :=0D + if ((u'0' <=3D LA11_0 <=3D u'7')):=0D alt11 =3D 1=0D =0D -=0D if alt11 =3D=3D 1:=0D # C.g:609:22: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D else:=0D if cnt11 >=3D 1:=0D - break #loop11=0D + break # loop11=0D =0D eee =3D EarlyExitException(11, self.input)=0D raise eee=0D =0D cnt11 +=3D 1=0D =0D -=0D # C.g:609:33: ( IntegerTypeSuffix )?=0D alt12 =3D 2=0D LA12_0 =3D self.input.LA(1)=0D =0D - if (LA12_0 =3D=3D u'L' or LA12_0 =3D=3D u'U' or LA12_0 =3D=3D = u'l' or LA12_0 =3D=3D u'u') :=0D + if (LA12_0 =3D=3D u'L' or LA12_0 =3D=3D u'U' or LA12_0 =3D=3D = u'l' or LA12_0 =3D=3D u'u'):=0D alt12 =3D 1=0D if alt12 =3D=3D 1:=0D # C.g:609:33: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end OCTAL_LITERAL=0D =0D -=0D -=0D # $ANTLR start HexDigit=0D +=0D def mHexDigit(self, ):=0D =0D try:=0D # C.g:612:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )=0D # C.g:612:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )=0D if (u'0' <=3D self.input.LA(1) <=3D u'9') or (u'A' <=3D self.i= nput.LA(1) <=3D u'F') or (u'a' <=3D self.input.LA(1) <=3D u'f'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end HexDigit=0D =0D -=0D -=0D # $ANTLR start IntegerTypeSuffix=0D +=0D def mIntegerTypeSuffix(self, ):=0D =0D try:=0D @@ -2746,114 +2117,98 @@ class CLexer(Lexer): alt13 =3D 4=0D LA13_0 =3D self.input.LA(1)=0D =0D - if (LA13_0 =3D=3D u'U' or LA13_0 =3D=3D u'u') :=0D + if (LA13_0 =3D=3D u'U' or LA13_0 =3D=3D u'u'):=0D LA13_1 =3D self.input.LA(2)=0D =0D - if (LA13_1 =3D=3D u'L' or LA13_1 =3D=3D u'l') :=0D + if (LA13_1 =3D=3D u'L' or LA13_1 =3D=3D u'l'):=0D LA13_3 =3D self.input.LA(3)=0D =0D - if (LA13_3 =3D=3D u'L' or LA13_3 =3D=3D u'l') :=0D + if (LA13_3 =3D=3D u'L' or LA13_3 =3D=3D u'l'):=0D alt13 =3D 4=0D else:=0D alt13 =3D 3=0D else:=0D alt13 =3D 1=0D - elif (LA13_0 =3D=3D u'L' or LA13_0 =3D=3D u'l') :=0D + elif (LA13_0 =3D=3D u'L' or LA13_0 =3D=3D u'l'):=0D alt13 =3D 2=0D else:=0D - nvae =3D NoViableAltException("614:1: fragment IntegerType= Suffix : ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( = 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) );", 13, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "614:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' ) |= ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) = ( 'l' | 'L' ) );", 13, 0, self.input)=0D =0D raise nvae=0D =0D if alt13 =3D=3D 1:=0D # C.g:616:4: ( 'u' | 'U' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 2:=0D # C.g:617:4: ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 3:=0D # C.g:618:4: ( 'u' | 'U' ) ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 4:=0D # C.g:619:4: ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end IntegerTypeSuffix=0D =0D -=0D -=0D # $ANTLR start FLOATING_POINT_LITERAL=0D +=0D def mFLOATING_POINT_LITERAL(self, ):=0D =0D try:=0D @@ -2866,337 +2221,269 @@ class CLexer(Lexer): # C.g:623:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponen= t )? ( FloatTypeSuffix )?=0D # C.g:623:9: ( '0' .. '9' )+=0D cnt14 =3D 0=0D - while True: #loop14=0D + while True: # loop14=0D alt14 =3D 2=0D LA14_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA14_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA14_0 <=3D u'9')):=0D alt14 =3D 1=0D =0D -=0D if alt14 =3D=3D 1:=0D # C.g:623:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt14 >=3D 1:=0D - break #loop14=0D + break # loop14=0D =0D eee =3D EarlyExitException(14, self.input)=0D raise eee=0D =0D cnt14 +=3D 1=0D =0D -=0D self.match(u'.')=0D =0D # C.g:623:25: ( '0' .. '9' )*=0D - while True: #loop15=0D + while True: # loop15=0D alt15 =3D 2=0D LA15_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA15_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA15_0 <=3D u'9')):=0D alt15 =3D 1=0D =0D -=0D if alt15 =3D=3D 1:=0D # C.g:623:26: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D - break #loop15=0D -=0D + break # loop15=0D =0D # C.g:623:37: ( Exponent )?=0D alt16 =3D 2=0D LA16_0 =3D self.input.LA(1)=0D =0D - if (LA16_0 =3D=3D u'E' or LA16_0 =3D=3D u'e') :=0D + if (LA16_0 =3D=3D u'E' or LA16_0 =3D=3D u'e'):=0D alt16 =3D 1=0D if alt16 =3D=3D 1:=0D # C.g:623:37: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D # C.g:623:47: ( FloatTypeSuffix )?=0D alt17 =3D 2=0D LA17_0 =3D self.input.LA(1)=0D =0D - if (LA17_0 =3D=3D u'D' or LA17_0 =3D=3D u'F' or LA17_0 =3D= =3D u'd' or LA17_0 =3D=3D u'f') :=0D + if (LA17_0 =3D=3D u'D' or LA17_0 =3D=3D u'F' or LA17_0 =3D= =3D u'd' or LA17_0 =3D=3D u'f'):=0D alt17 =3D 1=0D if alt17 =3D=3D 1:=0D # C.g:623:47: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 2:=0D # C.g:624:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatType= Suffix )?=0D self.match(u'.')=0D =0D # C.g:624:13: ( '0' .. '9' )+=0D cnt18 =3D 0=0D - while True: #loop18=0D + while True: # loop18=0D alt18 =3D 2=0D LA18_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA18_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA18_0 <=3D u'9')):=0D alt18 =3D 1=0D =0D -=0D if alt18 =3D=3D 1:=0D # C.g:624:14: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt18 >=3D 1:=0D - break #loop18=0D + break # loop18=0D =0D eee =3D EarlyExitException(18, self.input)=0D raise eee=0D =0D cnt18 +=3D 1=0D =0D -=0D # C.g:624:25: ( Exponent )?=0D alt19 =3D 2=0D LA19_0 =3D self.input.LA(1)=0D =0D - if (LA19_0 =3D=3D u'E' or LA19_0 =3D=3D u'e') :=0D + if (LA19_0 =3D=3D u'E' or LA19_0 =3D=3D u'e'):=0D alt19 =3D 1=0D if alt19 =3D=3D 1:=0D # C.g:624:25: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D # C.g:624:35: ( FloatTypeSuffix )?=0D alt20 =3D 2=0D LA20_0 =3D self.input.LA(1)=0D =0D - if (LA20_0 =3D=3D u'D' or LA20_0 =3D=3D u'F' or LA20_0 =3D= =3D u'd' or LA20_0 =3D=3D u'f') :=0D + if (LA20_0 =3D=3D u'D' or LA20_0 =3D=3D u'F' or LA20_0 =3D= =3D u'd' or LA20_0 =3D=3D u'f'):=0D alt20 =3D 1=0D if alt20 =3D=3D 1:=0D # C.g:624:35: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 3:=0D # C.g:625:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?= =0D # C.g:625:9: ( '0' .. '9' )+=0D cnt21 =3D 0=0D - while True: #loop21=0D + while True: # loop21=0D alt21 =3D 2=0D LA21_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA21_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA21_0 <=3D u'9')):=0D alt21 =3D 1=0D =0D -=0D if alt21 =3D=3D 1:=0D # C.g:625:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt21 >=3D 1:=0D - break #loop21=0D + break # loop21=0D =0D eee =3D EarlyExitException(21, self.input)=0D raise eee=0D =0D cnt21 +=3D 1=0D =0D -=0D self.mExponent()=0D =0D # C.g:625:30: ( FloatTypeSuffix )?=0D alt22 =3D 2=0D LA22_0 =3D self.input.LA(1)=0D =0D - if (LA22_0 =3D=3D u'D' or LA22_0 =3D=3D u'F' or LA22_0 =3D= =3D u'd' or LA22_0 =3D=3D u'f') :=0D + if (LA22_0 =3D=3D u'D' or LA22_0 =3D=3D u'F' or LA22_0 =3D= =3D u'd' or LA22_0 =3D=3D u'f'):=0D alt22 =3D 1=0D if alt22 =3D=3D 1:=0D # C.g:625:30: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 4:=0D # C.g:626:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix= =0D # C.g:626:9: ( '0' .. '9' )+=0D cnt23 =3D 0=0D - while True: #loop23=0D + while True: # loop23=0D alt23 =3D 2=0D LA23_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA23_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA23_0 <=3D u'9')):=0D alt23 =3D 1=0D =0D -=0D if alt23 =3D=3D 1:=0D # C.g:626:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt23 >=3D 1:=0D - break #loop23=0D + break # loop23=0D =0D eee =3D EarlyExitException(23, self.input)=0D raise eee=0D =0D cnt23 +=3D 1=0D =0D -=0D # C.g:626:21: ( Exponent )?=0D alt24 =3D 2=0D LA24_0 =3D self.input.LA(1)=0D =0D - if (LA24_0 =3D=3D u'E' or LA24_0 =3D=3D u'e') :=0D + if (LA24_0 =3D=3D u'E' or LA24_0 =3D=3D u'e'):=0D alt24 =3D 1=0D if alt24 =3D=3D 1:=0D # C.g:626:21: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end FLOATING_POINT_LITERAL=0D =0D -=0D -=0D # $ANTLR start Exponent=0D +=0D def mExponent(self, ):=0D =0D try:=0D # C.g:630:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )= =0D # C.g:630:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+=0D if self.input.LA(1) =3D=3D u'E' or self.input.LA(1) =3D=3D u'e= ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D # C.g:630:22: ( '+' | '-' )?=0D alt26 =3D 2=0D LA26_0 =3D self.input.LA(1)=0D =0D - if (LA26_0 =3D=3D u'+' or LA26_0 =3D=3D u'-') :=0D + if (LA26_0 =3D=3D u'+' or LA26_0 =3D=3D u'-'):=0D alt26 =3D 1=0D if alt26 =3D=3D 1:=0D # C.g:=0D if self.input.LA(1) =3D=3D u'+' or self.input.LA(1) =3D=3D= u'-':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D # C.g:630:33: ( '0' .. '9' )+=0D cnt27 =3D 0=0D - while True: #loop27=0D + while True: # loop27=0D alt27 =3D 2=0D LA27_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA27_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA27_0 <=3D u'9')):=0D alt27 =3D 1=0D =0D -=0D if alt27 =3D=3D 1:=0D # C.g:630:34: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt27 >=3D 1:=0D - break #loop27=0D + break # loop27=0D =0D eee =3D EarlyExitException(27, self.input)=0D raise eee=0D =0D cnt27 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end Exponent=0D =0D -=0D -=0D # $ANTLR start FloatTypeSuffix=0D +=0D def mFloatTypeSuffix(self, ):=0D =0D try:=0D # C.g:633:17: ( ( 'f' | 'F' | 'd' | 'D' ) )=0D # C.g:633:19: ( 'f' | 'F' | 'd' | 'D' )=0D if self.input.LA(1) =3D=3D u'D' or self.input.LA(1) =3D=3D u'F= ' or self.input.LA(1) =3D=3D u'd' or self.input.LA(1) =3D=3D u'f':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end FloatTypeSuffix=0D =0D -=0D -=0D # $ANTLR start EscapeSequence=0D +=0D def mEscapeSequence(self, ):=0D =0D try:=0D @@ -3204,20 +2491,22 @@ class CLexer(Lexer): alt28 =3D 2=0D LA28_0 =3D self.input.LA(1)=0D =0D - if (LA28_0 =3D=3D u'\\') :=0D + if (LA28_0 =3D=3D u'\\'):=0D LA28_1 =3D self.input.LA(2)=0D =0D - if (LA28_1 =3D=3D u'"' or LA28_1 =3D=3D u'\'' or LA28_1 = =3D=3D u'\\' or LA28_1 =3D=3D u'b' or LA28_1 =3D=3D u'f' or LA28_1 =3D=3D u= 'n' or LA28_1 =3D=3D u'r' or LA28_1 =3D=3D u't') :=0D + if (LA28_1 =3D=3D u'"' or LA28_1 =3D=3D u'\'' or LA28_1 = =3D=3D u'\\' or LA28_1 =3D=3D u'b' or LA28_1 =3D=3D u'f' or LA28_1 =3D=3D u= 'n' or LA28_1 =3D=3D u'r' or LA28_1 =3D=3D u't'):=0D alt28 =3D 1=0D - elif ((u'0' <=3D LA28_1 <=3D u'7')) :=0D + elif ((u'0' <=3D LA28_1 <=3D u'7')):=0D alt28 =3D 2=0D else:=0D - nvae =3D NoViableAltException("635:1: fragment EscapeS= equence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' = ) | OctalEscape );", 28, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "635:1: fragment EscapeSequence : ( '\\\\' ( 'b' |= 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 1= , self.input)=0D =0D raise nvae=0D =0D else:=0D - nvae =3D NoViableAltException("635:1: fragment EscapeSeque= nce : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | = OctalEscape );", 28, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't'= | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 0, se= lf.input)=0D =0D raise nvae=0D =0D @@ -3226,32 +2515,25 @@ class CLexer(Lexer): self.match(u'\\')=0D =0D if self.input.LA(1) =3D=3D u'"' or self.input.LA(1) =3D=3D= u'\'' or self.input.LA(1) =3D=3D u'\\' or self.input.LA(1) =3D=3D u'b' or = self.input.LA(1) =3D=3D u'f' or self.input.LA(1) =3D=3D u'n' or self.input.= LA(1) =3D=3D u'r' or self.input.LA(1) =3D=3D u't':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt28 =3D=3D 2:=0D # C.g:638:9: OctalEscape=0D self.mOctalEscape()=0D =0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end EscapeSequence=0D =0D -=0D -=0D # $ANTLR start OctalEscape=0D +=0D def mOctalEscape(self, ):=0D =0D try:=0D @@ -3259,35 +2541,37 @@ class CLexer(Lexer): alt29 =3D 3=0D LA29_0 =3D self.input.LA(1)=0D =0D - if (LA29_0 =3D=3D u'\\') :=0D + if (LA29_0 =3D=3D u'\\'):=0D LA29_1 =3D self.input.LA(2)=0D =0D - if ((u'0' <=3D LA29_1 <=3D u'3')) :=0D + if ((u'0' <=3D LA29_1 <=3D u'3')):=0D LA29_2 =3D self.input.LA(3)=0D =0D - if ((u'0' <=3D LA29_2 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_2 <=3D u'7')):=0D LA29_4 =3D self.input.LA(4)=0D =0D - if ((u'0' <=3D LA29_4 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_4 <=3D u'7')):=0D alt29 =3D 1=0D else:=0D alt29 =3D 2=0D else:=0D alt29 =3D 3=0D - elif ((u'4' <=3D LA29_1 <=3D u'7')) :=0D + elif ((u'4' <=3D LA29_1 <=3D u'7')):=0D LA29_3 =3D self.input.LA(3)=0D =0D - if ((u'0' <=3D LA29_3 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_3 <=3D u'7')):=0D alt29 =3D 2=0D else:=0D alt29 =3D 3=0D else:=0D - nvae =3D NoViableAltException("641:1: fragment OctalEs= cape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0'= .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '= 3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) |= '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)=0D =0D raise nvae=0D =0D else:=0D - nvae =3D NoViableAltException("641:1: fragment OctalEscape= : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. = '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' )= ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\= \\' ( '0' .. '7' ) );", 29, 0, self.input)=0D =0D raise nvae=0D =0D @@ -3299,25 +2583,14 @@ class CLexer(Lexer): # C.g:643:15: '0' .. '3'=0D self.matchRange(u'0', u'3')=0D =0D -=0D -=0D -=0D # C.g:643:25: ( '0' .. '7' )=0D # C.g:643:26: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D # C.g:643:36: ( '0' .. '7' )=0D # C.g:643:37: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt29 =3D=3D 2:=0D # C.g:644:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )=0D self.match(u'\\')=0D @@ -3326,18 +2599,10 @@ class CLexer(Lexer): # C.g:644:15: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D # C.g:644:25: ( '0' .. '7' )=0D # C.g:644:26: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt29 =3D=3D 3:=0D # C.g:645:9: '\\\\' ( '0' .. '7' )=0D self.match(u'\\')=0D @@ -3346,21 +2611,14 @@ class CLexer(Lexer): # C.g:645:15: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end OctalEscape=0D =0D -=0D -=0D # $ANTLR start UnicodeEscape=0D +=0D def mUnicodeEscape(self, ):=0D =0D try:=0D @@ -3378,19 +2636,14 @@ class CLexer(Lexer): =0D self.mHexDigit()=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end UnicodeEscape=0D =0D -=0D -=0D # $ANTLR start WS=0D +=0D def mWS(self, ):=0D =0D try:=0D @@ -3399,20 +2652,16 @@ class CLexer(Lexer): # C.g:653:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )=0D # C.g:653:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )=0D if (u'\t' <=3D self.input.LA(1) <=3D u'\n') or (u'\f' <=3D sel= f.input.LA(1) <=3D u'\r') or self.input.LA(1) =3D=3D u' ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3420,9 +2669,8 @@ class CLexer(Lexer): =0D # $ANTLR end WS=0D =0D -=0D -=0D # $ANTLR start BS=0D +=0D def mBS(self, ):=0D =0D try:=0D @@ -3434,15 +2682,9 @@ class CLexer(Lexer): # C.g:657:8: '\\\\'=0D self.match(u'\\')=0D =0D -=0D -=0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3450,9 +2692,8 @@ class CLexer(Lexer): =0D # $ANTLR end BS=0D =0D -=0D -=0D # $ANTLR start UnicodeVocabulary=0D +=0D def mUnicodeVocabulary(self, ):=0D =0D try:=0D @@ -3462,19 +2703,14 @@ class CLexer(Lexer): # C.g:665:7: '\\u0003' .. '\\uFFFE'=0D self.matchRange(u'\u0003', u'\uFFFE')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end UnicodeVocabulary=0D =0D -=0D -=0D # $ANTLR start COMMENT=0D +=0D def mCOMMENT(self, ):=0D =0D try:=0D @@ -3484,44 +2720,34 @@ class CLexer(Lexer): # C.g:668:9: '/*' ( options {greedy=3Dfalse; } : . )* '*/'=0D self.match("/*")=0D =0D -=0D # C.g:668:14: ( options {greedy=3Dfalse; } : . )*=0D - while True: #loop30=0D + while True: # loop30=0D alt30 =3D 2=0D LA30_0 =3D self.input.LA(1)=0D =0D - if (LA30_0 =3D=3D u'*') :=0D + if (LA30_0 =3D=3D u'*'):=0D LA30_1 =3D self.input.LA(2)=0D =0D - if (LA30_1 =3D=3D u'/') :=0D + if (LA30_1 =3D=3D u'/'):=0D alt30 =3D 2=0D - elif ((u'\u0000' <=3D LA30_1 <=3D u'.') or (u'0' <=3D = LA30_1 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA30_1 <=3D u'.') or (u'0' <=3D = LA30_1 <=3D u'\uFFFE')):=0D alt30 =3D 1=0D =0D -=0D - elif ((u'\u0000' <=3D LA30_0 <=3D u')') or (u'+' <=3D LA30= _0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA30_0 <=3D u')') or (u'+' <=3D LA30= _0 <=3D u'\uFFFE')):=0D alt30 =3D 1=0D =0D -=0D if alt30 =3D=3D 1:=0D # C.g:668:42: .=0D self.matchAny()=0D =0D -=0D -=0D else:=0D - break #loop30=0D -=0D + break # loop30=0D =0D self.match("*/")=0D =0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3529,9 +2755,8 @@ class CLexer(Lexer): =0D # $ANTLR end COMMENT=0D =0D -=0D -=0D # $ANTLR start LINE_COMMENT=0D +=0D def mLINE_COMMENT(self, ):=0D =0D try:=0D @@ -3541,54 +2766,42 @@ class CLexer(Lexer): # C.g:673:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'=0D self.match("//")=0D =0D -=0D # C.g:673:12: (~ ( '\\n' | '\\r' ) )*=0D - while True: #loop31=0D + while True: # loop31=0D alt31 =3D 2=0D LA31_0 =3D self.input.LA(1)=0D =0D - if ((u'\u0000' <=3D LA31_0 <=3D u'\t') or (u'\u000B' <=3D = LA31_0 <=3D u'\f') or (u'\u000E' <=3D LA31_0 <=3D u'\uFFFE')) :=0D + if ((u'\u0000' <=3D LA31_0 <=3D u'\t') or (u'\u000B' <=3D = LA31_0 <=3D u'\f') or (u'\u000E' <=3D LA31_0 <=3D u'\uFFFE')):=0D alt31 =3D 1=0D =0D -=0D if alt31 =3D=3D 1:=0D # C.g:673:12: ~ ( '\\n' | '\\r' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'\t') or (u'= \u000B' <=3D self.input.LA(1) <=3D u'\f') or (u'\u000E' <=3D self.input.LA(= 1) <=3D u'\uFFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop31=0D -=0D + break # loop31=0D =0D # C.g:673:26: ( '\\r' )?=0D alt32 =3D 2=0D LA32_0 =3D self.input.LA(1)=0D =0D - if (LA32_0 =3D=3D u'\r') :=0D + if (LA32_0 =3D=3D u'\r'):=0D alt32 =3D 1=0D if alt32 =3D=3D 1:=0D # C.g:673:26: '\\r'=0D self.match(u'\r')=0D =0D -=0D -=0D -=0D self.match(u'\n')=0D =0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3596,9 +2809,8 @@ class CLexer(Lexer): =0D # $ANTLR end LINE_COMMENT=0D =0D -=0D -=0D # $ANTLR start LINE_COMMAND=0D +=0D def mLINE_COMMAND(self, ):=0D =0D try:=0D @@ -3609,52 +2821,41 @@ class CLexer(Lexer): self.match(u'#')=0D =0D # C.g:678:11: (~ ( '\\n' | '\\r' ) )*=0D - while True: #loop33=0D + while True: # loop33=0D alt33 =3D 2=0D LA33_0 =3D self.input.LA(1)=0D =0D - if ((u'\u0000' <=3D LA33_0 <=3D u'\t') or (u'\u000B' <=3D = LA33_0 <=3D u'\f') or (u'\u000E' <=3D LA33_0 <=3D u'\uFFFE')) :=0D + if ((u'\u0000' <=3D LA33_0 <=3D u'\t') or (u'\u000B' <=3D = LA33_0 <=3D u'\f') or (u'\u000E' <=3D LA33_0 <=3D u'\uFFFE')):=0D alt33 =3D 1=0D =0D -=0D if alt33 =3D=3D 1:=0D # C.g:678:11: ~ ( '\\n' | '\\r' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'\t') or (u'= \u000B' <=3D self.input.LA(1) <=3D u'\f') or (u'\u000E' <=3D self.input.LA(= 1) <=3D u'\uFFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop33=0D -=0D + break # loop33=0D =0D # C.g:678:25: ( '\\r' )?=0D alt34 =3D 2=0D LA34_0 =3D self.input.LA(1)=0D =0D - if (LA34_0 =3D=3D u'\r') :=0D + if (LA34_0 =3D=3D u'\r'):=0D alt34 =3D 1=0D if alt34 =3D=3D 1:=0D # C.g:678:25: '\\r'=0D self.match(u'\r')=0D =0D -=0D -=0D -=0D self.match(u'\n')=0D =0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3662,8 +2863,6 @@ class CLexer(Lexer): =0D # $ANTLR end LINE_COMMAND=0D =0D -=0D -=0D def mTokens(self):=0D # C.g:1:8: ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 |= T34 | T35 | T36 | T37 | T38 | T39 | T40 | T41 | T42 | T43 | T44 | T45 | T4= 6 | T47 | T48 | T49 | T50 | T51 | T52 | T53 | T54 | T55 | T56 | T57 | T58 |= T59 | T60 | T61 | T62 | T63 | T64 | T65 | T66 | T67 | T68 | T69 | T70 | T7= 1 | T72 | T73 | T74 | T75 | T76 | T77 | T78 | T79 | T80 | T81 | T82 | T83 |= T84 | T85 | T86 | T87 | T88 | T89 | T90 | T91 | T92 | T93 | T94 | T95 | T9= 6 | T97 | T98 | T99 | T100 | T101 | T102 | T103 | T104 | T105 | T106 | T107= | T108 | T109 | T110 | T111 | T112 | T113 | T114 | T115 | T116 | T117 | ID= ENTIFIER | CHARACTER_LITERAL | STRING_LITERAL | HEX_LITERAL | DECIMAL_LITER= AL | OCTAL_LITERAL | FLOATING_POINT_LITERAL | WS | BS | UnicodeVocabulary |= COMMENT | LINE_COMMENT | LINE_COMMAND )=0D alt35 =3D 106=0D @@ -3672,681 +2871,463 @@ class CLexer(Lexer): # C.g:1:10: T25=0D self.mT25()=0D =0D -=0D -=0D elif alt35 =3D=3D 2:=0D # C.g:1:14: T26=0D self.mT26()=0D =0D -=0D -=0D elif alt35 =3D=3D 3:=0D # C.g:1:18: T27=0D self.mT27()=0D =0D -=0D -=0D elif alt35 =3D=3D 4:=0D # C.g:1:22: T28=0D self.mT28()=0D =0D -=0D -=0D elif alt35 =3D=3D 5:=0D # C.g:1:26: T29=0D self.mT29()=0D =0D -=0D -=0D elif alt35 =3D=3D 6:=0D # C.g:1:30: T30=0D self.mT30()=0D =0D -=0D -=0D elif alt35 =3D=3D 7:=0D # C.g:1:34: T31=0D self.mT31()=0D =0D -=0D -=0D elif alt35 =3D=3D 8:=0D # C.g:1:38: T32=0D self.mT32()=0D =0D -=0D -=0D elif alt35 =3D=3D 9:=0D # C.g:1:42: T33=0D self.mT33()=0D =0D -=0D -=0D elif alt35 =3D=3D 10:=0D # C.g:1:46: T34=0D self.mT34()=0D =0D -=0D -=0D elif alt35 =3D=3D 11:=0D # C.g:1:50: T35=0D self.mT35()=0D =0D -=0D -=0D elif alt35 =3D=3D 12:=0D # C.g:1:54: T36=0D self.mT36()=0D =0D -=0D -=0D elif alt35 =3D=3D 13:=0D # C.g:1:58: T37=0D self.mT37()=0D =0D -=0D -=0D elif alt35 =3D=3D 14:=0D # C.g:1:62: T38=0D self.mT38()=0D =0D -=0D -=0D elif alt35 =3D=3D 15:=0D # C.g:1:66: T39=0D self.mT39()=0D =0D -=0D -=0D elif alt35 =3D=3D 16:=0D # C.g:1:70: T40=0D self.mT40()=0D =0D -=0D -=0D elif alt35 =3D=3D 17:=0D # C.g:1:74: T41=0D self.mT41()=0D =0D -=0D -=0D elif alt35 =3D=3D 18:=0D # C.g:1:78: T42=0D self.mT42()=0D =0D -=0D -=0D elif alt35 =3D=3D 19:=0D # C.g:1:82: T43=0D self.mT43()=0D =0D -=0D -=0D elif alt35 =3D=3D 20:=0D # C.g:1:86: T44=0D self.mT44()=0D =0D -=0D -=0D elif alt35 =3D=3D 21:=0D # C.g:1:90: T45=0D self.mT45()=0D =0D -=0D -=0D elif alt35 =3D=3D 22:=0D # C.g:1:94: T46=0D self.mT46()=0D =0D -=0D -=0D elif alt35 =3D=3D 23:=0D # C.g:1:98: T47=0D self.mT47()=0D =0D -=0D -=0D elif alt35 =3D=3D 24:=0D # C.g:1:102: T48=0D self.mT48()=0D =0D -=0D -=0D elif alt35 =3D=3D 25:=0D # C.g:1:106: T49=0D self.mT49()=0D =0D -=0D -=0D elif alt35 =3D=3D 26:=0D # C.g:1:110: T50=0D self.mT50()=0D =0D -=0D -=0D elif alt35 =3D=3D 27:=0D # C.g:1:114: T51=0D self.mT51()=0D =0D -=0D -=0D elif alt35 =3D=3D 28:=0D # C.g:1:118: T52=0D self.mT52()=0D =0D -=0D -=0D elif alt35 =3D=3D 29:=0D # C.g:1:122: T53=0D self.mT53()=0D =0D -=0D -=0D elif alt35 =3D=3D 30:=0D # C.g:1:126: T54=0D self.mT54()=0D =0D -=0D -=0D elif alt35 =3D=3D 31:=0D # C.g:1:130: T55=0D self.mT55()=0D =0D -=0D -=0D elif alt35 =3D=3D 32:=0D # C.g:1:134: T56=0D self.mT56()=0D =0D -=0D -=0D elif alt35 =3D=3D 33:=0D # C.g:1:138: T57=0D self.mT57()=0D =0D -=0D -=0D elif alt35 =3D=3D 34:=0D # C.g:1:142: T58=0D self.mT58()=0D =0D -=0D -=0D elif alt35 =3D=3D 35:=0D # C.g:1:146: T59=0D self.mT59()=0D =0D -=0D -=0D elif alt35 =3D=3D 36:=0D # C.g:1:150: T60=0D self.mT60()=0D =0D -=0D -=0D elif alt35 =3D=3D 37:=0D # C.g:1:154: T61=0D self.mT61()=0D =0D -=0D -=0D elif alt35 =3D=3D 38:=0D # C.g:1:158: T62=0D self.mT62()=0D =0D -=0D -=0D elif alt35 =3D=3D 39:=0D # C.g:1:162: T63=0D self.mT63()=0D =0D -=0D -=0D elif alt35 =3D=3D 40:=0D # C.g:1:166: T64=0D self.mT64()=0D =0D -=0D -=0D elif alt35 =3D=3D 41:=0D # C.g:1:170: T65=0D self.mT65()=0D =0D -=0D -=0D elif alt35 =3D=3D 42:=0D # C.g:1:174: T66=0D self.mT66()=0D =0D -=0D -=0D elif alt35 =3D=3D 43:=0D # C.g:1:178: T67=0D self.mT67()=0D =0D -=0D -=0D elif alt35 =3D=3D 44:=0D # C.g:1:182: T68=0D self.mT68()=0D =0D -=0D -=0D elif alt35 =3D=3D 45:=0D # C.g:1:186: T69=0D self.mT69()=0D =0D -=0D -=0D elif alt35 =3D=3D 46:=0D # C.g:1:190: T70=0D self.mT70()=0D =0D -=0D -=0D elif alt35 =3D=3D 47:=0D # C.g:1:194: T71=0D self.mT71()=0D =0D -=0D -=0D elif alt35 =3D=3D 48:=0D # C.g:1:198: T72=0D self.mT72()=0D =0D -=0D -=0D elif alt35 =3D=3D 49:=0D # C.g:1:202: T73=0D self.mT73()=0D =0D -=0D -=0D elif alt35 =3D=3D 50:=0D # C.g:1:206: T74=0D self.mT74()=0D =0D -=0D -=0D elif alt35 =3D=3D 51:=0D # C.g:1:210: T75=0D self.mT75()=0D =0D -=0D -=0D elif alt35 =3D=3D 52:=0D # C.g:1:214: T76=0D self.mT76()=0D =0D -=0D -=0D elif alt35 =3D=3D 53:=0D # C.g:1:218: T77=0D self.mT77()=0D =0D -=0D -=0D elif alt35 =3D=3D 54:=0D # C.g:1:222: T78=0D self.mT78()=0D =0D -=0D -=0D elif alt35 =3D=3D 55:=0D # C.g:1:226: T79=0D self.mT79()=0D =0D -=0D -=0D elif alt35 =3D=3D 56:=0D # C.g:1:230: T80=0D self.mT80()=0D =0D -=0D -=0D elif alt35 =3D=3D 57:=0D # C.g:1:234: T81=0D self.mT81()=0D =0D -=0D -=0D elif alt35 =3D=3D 58:=0D # C.g:1:238: T82=0D self.mT82()=0D =0D -=0D -=0D elif alt35 =3D=3D 59:=0D # C.g:1:242: T83=0D self.mT83()=0D =0D -=0D -=0D elif alt35 =3D=3D 60:=0D # C.g:1:246: T84=0D self.mT84()=0D =0D -=0D -=0D elif alt35 =3D=3D 61:=0D # C.g:1:250: T85=0D self.mT85()=0D =0D -=0D -=0D elif alt35 =3D=3D 62:=0D # C.g:1:254: T86=0D self.mT86()=0D =0D -=0D -=0D elif alt35 =3D=3D 63:=0D # C.g:1:258: T87=0D self.mT87()=0D =0D -=0D -=0D elif alt35 =3D=3D 64:=0D # C.g:1:262: T88=0D self.mT88()=0D =0D -=0D -=0D elif alt35 =3D=3D 65:=0D # C.g:1:266: T89=0D self.mT89()=0D =0D -=0D -=0D elif alt35 =3D=3D 66:=0D # C.g:1:270: T90=0D self.mT90()=0D =0D -=0D -=0D elif alt35 =3D=3D 67:=0D # C.g:1:274: T91=0D self.mT91()=0D =0D -=0D -=0D elif alt35 =3D=3D 68:=0D # C.g:1:278: T92=0D self.mT92()=0D =0D -=0D -=0D elif alt35 =3D=3D 69:=0D # C.g:1:282: T93=0D self.mT93()=0D =0D -=0D -=0D elif alt35 =3D=3D 70:=0D # C.g:1:286: T94=0D self.mT94()=0D =0D -=0D -=0D elif alt35 =3D=3D 71:=0D # C.g:1:290: T95=0D self.mT95()=0D =0D -=0D -=0D elif alt35 =3D=3D 72:=0D # C.g:1:294: T96=0D self.mT96()=0D =0D -=0D -=0D elif alt35 =3D=3D 73:=0D # C.g:1:298: T97=0D self.mT97()=0D =0D -=0D -=0D elif alt35 =3D=3D 74:=0D # C.g:1:302: T98=0D self.mT98()=0D =0D -=0D -=0D elif alt35 =3D=3D 75:=0D # C.g:1:306: T99=0D self.mT99()=0D =0D -=0D -=0D elif alt35 =3D=3D 76:=0D # C.g:1:310: T100=0D self.mT100()=0D =0D -=0D -=0D elif alt35 =3D=3D 77:=0D # C.g:1:315: T101=0D self.mT101()=0D =0D -=0D -=0D elif alt35 =3D=3D 78:=0D # C.g:1:320: T102=0D self.mT102()=0D =0D -=0D -=0D elif alt35 =3D=3D 79:=0D # C.g:1:325: T103=0D self.mT103()=0D =0D -=0D -=0D elif alt35 =3D=3D 80:=0D # C.g:1:330: T104=0D self.mT104()=0D =0D -=0D -=0D elif alt35 =3D=3D 81:=0D # C.g:1:335: T105=0D self.mT105()=0D =0D -=0D -=0D elif alt35 =3D=3D 82:=0D # C.g:1:340: T106=0D self.mT106()=0D =0D -=0D -=0D elif alt35 =3D=3D 83:=0D # C.g:1:345: T107=0D self.mT107()=0D =0D -=0D -=0D elif alt35 =3D=3D 84:=0D # C.g:1:350: T108=0D self.mT108()=0D =0D -=0D -=0D elif alt35 =3D=3D 85:=0D # C.g:1:355: T109=0D self.mT109()=0D =0D -=0D -=0D elif alt35 =3D=3D 86:=0D # C.g:1:360: T110=0D self.mT110()=0D =0D -=0D -=0D elif alt35 =3D=3D 87:=0D # C.g:1:365: T111=0D self.mT111()=0D =0D -=0D -=0D elif alt35 =3D=3D 88:=0D # C.g:1:370: T112=0D self.mT112()=0D =0D -=0D -=0D elif alt35 =3D=3D 89:=0D # C.g:1:375: T113=0D self.mT113()=0D =0D -=0D -=0D elif alt35 =3D=3D 90:=0D # C.g:1:380: T114=0D self.mT114()=0D =0D -=0D -=0D elif alt35 =3D=3D 91:=0D # C.g:1:385: T115=0D self.mT115()=0D =0D -=0D -=0D elif alt35 =3D=3D 92:=0D # C.g:1:390: T116=0D self.mT116()=0D =0D -=0D -=0D elif alt35 =3D=3D 93:=0D # C.g:1:395: T117=0D self.mT117()=0D =0D -=0D -=0D elif alt35 =3D=3D 94:=0D # C.g:1:400: IDENTIFIER=0D self.mIDENTIFIER()=0D =0D -=0D -=0D elif alt35 =3D=3D 95:=0D # C.g:1:411: CHARACTER_LITERAL=0D self.mCHARACTER_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 96:=0D # C.g:1:429: STRING_LITERAL=0D self.mSTRING_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 97:=0D # C.g:1:444: HEX_LITERAL=0D self.mHEX_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 98:=0D # C.g:1:456: DECIMAL_LITERAL=0D self.mDECIMAL_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 99:=0D # C.g:1:472: OCTAL_LITERAL=0D self.mOCTAL_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 100:=0D # C.g:1:486: FLOATING_POINT_LITERAL=0D self.mFLOATING_POINT_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 101:=0D # C.g:1:509: WS=0D self.mWS()=0D =0D -=0D -=0D elif alt35 =3D=3D 102:=0D # C.g:1:512: BS=0D self.mBS()=0D =0D -=0D -=0D elif alt35 =3D=3D 103:=0D # C.g:1:515: UnicodeVocabulary=0D self.mUnicodeVocabulary()=0D =0D -=0D -=0D elif alt35 =3D=3D 104:=0D # C.g:1:533: COMMENT=0D self.mCOMMENT()=0D =0D -=0D -=0D elif alt35 =3D=3D 105:=0D # C.g:1:541: LINE_COMMENT=0D self.mLINE_COMMENT()=0D =0D -=0D -=0D elif alt35 =3D=3D 106:=0D # C.g:1:554: LINE_COMMAND=0D self.mLINE_COMMAND()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D # lookup tables for DFA #25=0D =0D DFA25_eot =3D DFA.unpack(=0D u"\7\uffff\1\10\2\uffff"=0D - )=0D + )=0D =0D DFA25_eof =3D DFA.unpack(=0D u"\12\uffff"=0D - )=0D + )=0D =0D DFA25_min =3D DFA.unpack(=0D u"\2\56\2\uffff\1\53\1\uffff\2\60\2\uffff"=0D - )=0D + )=0D =0D DFA25_max =3D DFA.unpack(=0D u"\1\71\1\146\2\uffff\1\71\1\uffff\1\71\1\146\2\uffff"=0D - )=0D + )=0D =0D DFA25_accept =3D DFA.unpack(=0D u"\2\uffff\1\2\1\1\1\uffff\1\4\2\uffff\2\3"=0D - )=0D + )=0D =0D DFA25_special =3D DFA.unpack(=0D u"\12\uffff"=0D - )=0D -=0D + )=0D =0D DFA25_transition =3D [=0D DFA.unpack(u"\1\2\1\uffff\12\1"),=0D DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5"= =0D - u"\1\4\1\5"),=0D + u"\1\4\1\5"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\6\1\uffff\1\6\2\uffff\12\7"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\12\7"),=0D DFA.unpack(u"\12\7\12\uffff\1\11\1\uffff\1\11\35\uffff\1\11\1\ufff= f"=0D - u"\1\11"),=0D + u"\1\11"),=0D DFA.unpack(u""),=0D DFA.unpack(u"")=0D ]=0D @@ -4376,11 +3357,11 @@ class CLexer(Lexer): u"\uffff\1\u0164\1\u0165\1\76\1\u0167\3\76\6\uffff\1\u016b\1\uffff= "=0D u"\3\76\1\uffff\21\76\1\u0180\2\76\1\uffff\3\76\1\u0186\1\76\1\uff= ff"=0D u"\11\76\1\u0191\1\uffff"=0D - )=0D + )=0D =0D DFA35_eof =3D DFA.unpack(=0D u"\u0192\uffff"=0D - )=0D + )=0D =0D DFA35_min =3D DFA.unpack(=0D u"\1\3\1\uffff\1\171\1\uffff\1\75\1\154\1\150\1\165\1\145\1\124\1"= =0D @@ -4413,7 +3394,7 @@ class CLexer(Lexer): u"\1\111\1\137\1\122\1\103\1\111\1\126\1\105\1\106\1\111\1\44\1\13= 7"=0D u"\1\103\1\uffff\1\125\1\105\1\116\1\44\1\122\1\uffff\1\105\1\106"= =0D u"\1\105\1\122\1\105\1\116\1\103\1\105\1\104\1\44\1\uffff"=0D - )=0D + )=0D =0D DFA35_max =3D DFA.unpack(=0D u"\1\ufffe\1\uffff\1\171\1\uffff\1\75\1\170\1\167\1\165\1\145\1\12= 4"=0D @@ -4447,7 +3428,7 @@ class CLexer(Lexer): u"\1\106\1\111\1\172\1\137\1\103\1\uffff\1\125\1\105\1\116\1\172"= =0D u"\1\122\1\uffff\1\105\1\106\1\105\1\122\1\105\1\116\1\103\1\105"= =0D u"\1\104\1\172\1\uffff"=0D - )=0D + )=0D =0D DFA35_accept =3D DFA.unpack(=0D u"\1\uffff\1\1\1\uffff\1\3\15\uffff\1\23\1\24\1\27\10\uffff\1\46"= =0D @@ -4467,21 +3448,20 @@ class CLexer(Lexer): u"\uffff\1\42\1\45\1\uffff\1\2\3\uffff\1\123\7\uffff\1\117\1\10\1"= =0D u"\32\1\133\1\22\1\35\1\uffff\1\40\3\uffff\1\37\24\uffff\1\43\5\uf= fff"=0D u"\1\44\12\uffff\1\41"=0D - )=0D + )=0D =0D DFA35_special =3D DFA.unpack(=0D u"\u0192\uffff"=0D - )=0D -=0D + )=0D =0D DFA35_transition =3D [=0D DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63"= =0D - 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"= =0D - u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1\32\1\63\1"= =0D - u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63\1\27\1\30"= =0D - u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\17\1\5\1\16"= =0D - u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12\1\57\3\63"= =0D - u"\1\21\1\54\1\22\1\47\uff80\73"),=0D + u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\4= 4\1\66\11"=0D + u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1= \32\1\63\1"=0D + u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63= \1\27\1\30"=0D + u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\1= 7\1\5\1\16"=0D + u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12= \1\57\3\63"=0D + u"\1\21\1\54\1\22\1\47\uff80\73"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\75"),=0D DFA.unpack(u""),=0D @@ -4536,7 +3516,7 @@ class CLexer(Lexer): DFA.unpack(u"\47\u0092\1\uffff\uffd7\u0092"),=0D DFA.unpack(u"\uffff\u0091"),=0D DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\21\uffff= "=0D - u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),=0D + u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),=0D DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154= "),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D @@ -4563,20 +3543,20 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00ab"),=0D DFA.unpack(u"\1\u00ac"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00ae"),=0D DFA.unpack(u"\1\u00af"),=0D DFA.unpack(u"\1\u00b0"),=0D DFA.unpack(u"\1\u00b1"),=0D DFA.unpack(u"\1\u00b2"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\24\76\1\u00b3\5\76"),=0D + u"\24\76\1\u00b3\5\76"),=0D DFA.unpack(u"\1\u00b6\11\uffff\1\u00b5"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00b8"),=0D DFA.unpack(u"\1\u00b9"),=0D DFA.unpack(u"\1\u00ba"),=0D @@ -4634,7 +3614,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\35\uffff= "=0D - u"\3\154"),=0D + u"\3\154"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154= "),=0D DFA.unpack(u""),=0D @@ -4661,10 +3641,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00dd"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00df"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00e1"),=0D DFA.unpack(u"\1\u00e2"),=0D DFA.unpack(u"\1\u00e3"),=0D @@ -4674,7 +3654,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u00e6"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00e8"),=0D DFA.unpack(u"\1\u00e9"),=0D DFA.unpack(u"\1\u00ea"),=0D @@ -4693,10 +3673,10 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u00f4"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00f6"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00f8"),=0D DFA.unpack(u"\1\u00f9"),=0D DFA.unpack(u"\1\u00fa"),=0D @@ -4704,22 +3684,22 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00fc"),=0D DFA.unpack(u"\1\u00fd"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00ff"),=0D DFA.unpack(u"\1\u0100"),=0D DFA.unpack(u"\1\u0101"),=0D DFA.unpack(u"\1\u0102"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0105"),=0D DFA.unpack(u"\1\u0106"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0109"),=0D DFA.unpack(u"\1\u010a"),=0D @@ -4737,10 +3717,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0116"),=0D DFA.unpack(u"\1\u0117"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0119"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u011b"),=0D DFA.unpack(u"\1\u011c"),=0D DFA.unpack(u""),=0D @@ -4752,7 +3732,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0121"),=0D DFA.unpack(u"\1\u0122"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0124"),=0D DFA.unpack(u"\1\u0125"),=0D @@ -4762,19 +3742,19 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u0128"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u012b"),=0D DFA.unpack(u"\1\u012c"),=0D DFA.unpack(u"\1\u012d"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u012f"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0131"),=0D DFA.unpack(u"\1\u0132"),=0D DFA.unpack(u"\1\u0133"),=0D @@ -4783,39 +3763,39 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0136"),=0D DFA.unpack(u"\1\u0137"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\u0138\1"= =0D - u"\uffff\32\76"),=0D + u"\uffff\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u013c"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0143"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0146"),=0D DFA.unpack(u"\1\u0147"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0148"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u014a"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u014b"),=0D @@ -4826,15 +3806,15 @@ class CLexer(Lexer): DFA.unpack(u"\1\u014f"),=0D DFA.unpack(u"\1\u0150"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0153"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D @@ -4847,7 +3827,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0156"),=0D DFA.unpack(u"\1\u0157"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0159"),=0D DFA.unpack(u"\1\u015a"),=0D @@ -4859,22 +3839,22 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0166"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0168"),=0D DFA.unpack(u"\1\u0169"),=0D DFA.unpack(u"\1\u016a"),=0D @@ -4885,7 +3865,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u016c"),=0D DFA.unpack(u"\1\u016d"),=0D @@ -4909,7 +3889,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u017e"),=0D DFA.unpack(u"\1\u017f"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0181"),=0D DFA.unpack(u"\1\u0182"),=0D DFA.unpack(u""),=0D @@ -4917,7 +3897,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0184"),=0D DFA.unpack(u"\1\u0185"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0187"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0188"),=0D @@ -4930,12 +3910,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u018f"),=0D DFA.unpack(u"\1\u0190"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"")=0D ]=0D =0D # class definition for DFA #35=0D =0D DFA35 =3D DFA=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/CParser3/CParser.py b/BaseTools/So= urce/Python/Ecc/CParser3/CParser.py index b078397969f9..aaba24b977ea 100644 --- a/BaseTools/Source/Python/Ecc/CParser3/CParser.py +++ b/BaseTools/Source/Python/Ecc/CParser3/CParser.py @@ -5,7 +5,7 @@ from __future__ import absolute_import from antlr3 import *=0D from antlr3.compat import set, frozenset=0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.=0D @@ -22,33 +22,32 @@ from Ecc import CodeFragment from Ecc import FileProfile=0D =0D =0D -=0D # for convenience in actions=0D HIDDEN =3D BaseRecognizer.HIDDEN=0D =0D # token types=0D -BS=3D20=0D -LINE_COMMENT=3D23=0D -FloatTypeSuffix=3D16=0D -IntegerTypeSuffix=3D14=0D -LETTER=3D11=0D -OCTAL_LITERAL=3D6=0D -CHARACTER_LITERAL=3D8=0D -Exponent=3D15=0D -EOF=3D-1=0D -HexDigit=3D13=0D -STRING_LITERAL=3D9=0D -WS=3D19=0D -FLOATING_POINT_LITERAL=3D10=0D -IDENTIFIER=3D4=0D -UnicodeEscape=3D18=0D -LINE_COMMAND=3D24=0D -UnicodeVocabulary=3D21=0D -HEX_LITERAL=3D5=0D -COMMENT=3D22=0D -DECIMAL_LITERAL=3D7=0D -EscapeSequence=3D12=0D -OctalEscape=3D17=0D +BS =3D 20=0D +LINE_COMMENT =3D 23=0D +FloatTypeSuffix =3D 16=0D +IntegerTypeSuffix =3D 14=0D +LETTER =3D 11=0D +OCTAL_LITERAL =3D 6=0D +CHARACTER_LITERAL =3D 8=0D +Exponent =3D 15=0D +EOF =3D -1=0D +HexDigit =3D 13=0D +STRING_LITERAL =3D 9=0D +WS =3D 19=0D +FLOATING_POINT_LITERAL =3D 10=0D +IDENTIFIER =3D 4=0D +UnicodeEscape =3D 18=0D +LINE_COMMAND =3D 24=0D +UnicodeVocabulary =3D 21=0D +HEX_LITERAL =3D 5=0D +COMMENT =3D 22=0D +DECIMAL_LITERAL =3D 7=0D +EscapeSequence =3D 12=0D +OctalEscape =3D 17=0D =0D # token names=0D tokenNames =3D [=0D @@ -81,6 +80,8 @@ class function_definition_scope(object): self.LBOffset =3D None=0D self.DeclLine =3D None=0D self.DeclOffset =3D None=0D +=0D +=0D class postfix_expression_scope(object):=0D def __init__(self):=0D self.FuncCallText =3D None=0D @@ -98,41 +99,46 @@ class CParser(Parser): self.postfix_expression_stack =3D []=0D =0D def printTokenInfo(self, line, offset, tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Start= Offset), (EndLine, EndOffset))=0D - FileProfile.PredicateExpressionList.append(PredExp)=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.PredicateExpressionList.append(PredExp)=0D =0D def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D - FileProfile.EnumerationDefinitionList.append(EnumDef)=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Start= Offset), (EndLine, EndOffset))=0D - FileProfile.StructUnionDefinitionList.append(SUDef)=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLine= , StartOffset), (EndLine, EndOffset))=0D - FileProfile.TypedefDefinitionList.append(Tdef)=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D + FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText, = (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOf= fset), (DeclLine, DeclOffset))=0D - FileProfile.FunctionDefinitionList.append(FuncDef)=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D + FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclText,= (StartLine, StartOffset), (EndLine, EndOffset))=0D - FileProfile.VariableDeclarationList.append(VarDecl)=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D + FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (Star= tLine, StartOffset), (EndLine, EndOffset))=0D - FileProfile.FunctionCallingList.append(FuncCall)=0D -=0D -=0D -=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D + FileProfile.FunctionCallingList.append(FuncCall)=0D =0D # $ANTLR start translation_unit=0D # C.g:102:1: translation_unit : ( external_declaration )* ;=0D +=0D def translation_unit(self, ):=0D =0D translation_unit_StartIndex =3D self.input.index()=0D @@ -144,30 +150,24 @@ class CParser(Parser): # C.g:103:2: ( ( external_declaration )* )=0D # C.g:103:4: ( external_declaration )*=0D # C.g:103:4: ( external_declaration )*=0D - while True: #loop1=0D + while True: # loop1=0D alt1 =3D 2=0D LA1_0 =3D self.input.LA(1)=0D =0D - if (LA1_0 =3D=3D IDENTIFIER or LA1_0 =3D=3D 26 or (29 = <=3D LA1_0 <=3D 42) or (45 <=3D LA1_0 <=3D 46) or (48 <=3D LA1_0 <=3D 62) o= r LA1_0 =3D=3D 66) :=0D + if (LA1_0 =3D=3D IDENTIFIER or LA1_0 =3D=3D 26 or (29 = <=3D LA1_0 <=3D 42) or (45 <=3D LA1_0 <=3D 46) or (48 <=3D LA1_0 <=3D 62) o= r LA1_0 =3D=3D 66):=0D alt1 =3D 1=0D =0D -=0D if alt1 =3D=3D 1:=0D # C.g:0:0: external_declaration=0D - self.following.append(self.FOLLOW_external_declara= tion_in_translation_unit74)=0D + self.following.append(=0D + self.FOLLOW_external_declaration_in_translatio= n_unit74)=0D self.external_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop1=0D -=0D -=0D -=0D -=0D -=0D + break # loop1=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -182,9 +182,9 @@ class CParser(Parser): =0D # $ANTLR end translation_unit=0D =0D -=0D # $ANTLR start external_declaration=0D # C.g:114:1: external_declaration options {k=3D1; } : ( ( ( declaratio= n_specifiers )? declarator ( declaration )* '{' )=3D> function_definition |= declaration | macro_statement ( ';' )? );=0D +=0D def external_declaration(self, ):=0D =0D external_declaration_StartIndex =3D self.input.index()=0D @@ -197,316 +197,335 @@ class CParser(Parser): alt3 =3D 3=0D LA3_0 =3D self.input.LA(1)=0D =0D - if ((29 <=3D LA3_0 <=3D 33)) :=0D + if ((29 <=3D LA3_0 <=3D 33)):=0D LA3_1 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 34) :=0D + elif (LA3_0 =3D=3D 34):=0D LA3_2 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 35) :=0D + elif (LA3_0 =3D=3D 35):=0D LA3_3 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 36) :=0D + elif (LA3_0 =3D=3D 36):=0D LA3_4 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 37) :=0D + elif (LA3_0 =3D=3D 37):=0D LA3_5 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 38) :=0D + elif (LA3_0 =3D=3D 38):=0D LA3_6 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 39) :=0D + elif (LA3_0 =3D=3D 39):=0D LA3_7 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 40) :=0D + elif (LA3_0 =3D=3D 40):=0D LA3_8 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 41) :=0D + elif (LA3_0 =3D=3D 41):=0D LA3_9 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 42) :=0D + elif (LA3_0 =3D=3D 42):=0D LA3_10 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 10, self= .input)=0D =0D raise nvae=0D =0D - elif ((45 <=3D LA3_0 <=3D 46)) :=0D + elif ((45 <=3D LA3_0 <=3D 46)):=0D LA3_11 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 11, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 48) :=0D + elif (LA3_0 =3D=3D 48):=0D LA3_12 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 12, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D IDENTIFIER) :=0D + elif (LA3_0 =3D=3D IDENTIFIER):=0D LA3_13 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D - elif (True) :=0D + elif (True):=0D alt3 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 13, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 58) :=0D + elif (LA3_0 =3D=3D 58):=0D LA3_14 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 14, self= .input)=0D =0D raise nvae=0D =0D elif (LA3_0 =3D=3D 66) and (self.synpred4()):=0D alt3 =3D 1=0D - elif (LA3_0 =3D=3D 59) :=0D + elif (LA3_0 =3D=3D 59):=0D LA3_16 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 16, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 60) :=0D + elif (LA3_0 =3D=3D 60):=0D LA3_17 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 17, self= .input)=0D =0D raise nvae=0D =0D - elif ((49 <=3D LA3_0 <=3D 57) or LA3_0 =3D=3D 61) :=0D + elif ((49 <=3D LA3_0 <=3D 57) or LA3_0 =3D=3D 61):=0D LA3_18 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 18, self= .input)=0D =0D raise nvae=0D =0D elif (LA3_0 =3D=3D 62) and (self.synpred4()):=0D alt3 =3D 1=0D - elif (LA3_0 =3D=3D 26) :=0D + elif (LA3_0 =3D=3D 26):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; } : (= ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> functi= on_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.inpu= t)=0D =0D raise nvae=0D =0D if alt3 =3D=3D 1:=0D # C.g:119:4: ( ( declaration_specifiers )? declarator = ( declaration )* '{' )=3D> function_definition=0D - self.following.append(self.FOLLOW_function_definition_= in_external_declaration113)=0D + self.following.append(=0D + self.FOLLOW_function_definition_in_external_declar= ation113)=0D self.function_definition()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt3 =3D=3D 2:=0D # C.g:120:4: declaration=0D - self.following.append(self.FOLLOW_declaration_in_exter= nal_declaration118)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_external_declaration118= )=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt3 =3D=3D 3:=0D # C.g:121:4: macro_statement ( ';' )?=0D - self.following.append(self.FOLLOW_macro_statement_in_e= xternal_declaration123)=0D + self.following.append(=0D + self.FOLLOW_macro_statement_in_external_declaratio= n123)=0D self.macro_statement()=0D self.following.pop()=0D if self.failed:=0D @@ -515,19 +534,15 @@ class CParser(Parser): alt2 =3D 2=0D LA2_0 =3D self.input.LA(1)=0D =0D - if (LA2_0 =3D=3D 25) :=0D + if (LA2_0 =3D=3D 25):=0D alt2 =3D 1=0D if alt2 =3D=3D 1:=0D # C.g:121:21: ';'=0D - self.match(self.input, 25, self.FOLLOW_25_in_exter= nal_declaration126)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_external_declaration1= 26)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -546,10 +561,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start function_definition=0D # C.g:126:1: function_definition : (d=3D declaration_specifiers )? dec= larator ( ( declaration )+ a=3D compound_statement | b=3D compound_statemen= t ) ;=0D +=0D def function_definition(self, ):=0D self.function_definition_stack.append(function_definition_scope())= =0D retval =3D self.function_definition_return()=0D @@ -563,14 +577,12 @@ class CParser(Parser): =0D declarator1 =3D None=0D =0D -=0D -=0D - self.function_definition_stack[-1].ModifierText =3D ''=0D - self.function_definition_stack[-1].DeclText =3D ''=0D - self.function_definition_stack[-1].LBLine =3D 0=0D - self.function_definition_stack[-1].LBOffset =3D 0=0D - self.function_definition_stack[-1].DeclLine =3D 0=0D - self.function_definition_stack[-1].DeclOffset =3D 0=0D + self.function_definition_stack[-1].ModifierText =3D ''=0D + self.function_definition_stack[-1].DeclText =3D ''=0D + self.function_definition_stack[-1].LBLine =3D 0=0D + self.function_definition_stack[-1].LBOffset =3D 0=0D + self.function_definition_stack[-1].DeclLine =3D 0=0D + self.function_definition_stack[-1].DeclOffset =3D 0=0D =0D try:=0D try:=0D @@ -591,119 +603,119 @@ class CParser(Parser): elif LA4 =3D=3D 58:=0D LA4_21 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 59:=0D LA4_22 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 60:=0D LA4_23 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D IDENTIFIER:=0D LA4_24 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 62:=0D LA4_25 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 29 or LA4 =3D=3D 30 or LA4 =3D=3D 31 o= r LA4 =3D=3D 32 or LA4 =3D=3D 33:=0D LA4_26 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 34:=0D LA4_27 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 35:=0D LA4_28 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 36:=0D LA4_29 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 37:=0D LA4_30 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 38:=0D LA4_31 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 39:=0D LA4_32 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 40:=0D LA4_33 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 41:=0D LA4_34 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 42:=0D LA4_35 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 45 or LA4 =3D=3D 46:=0D LA4_36 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 48:=0D LA4_37 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 49 or LA4 =3D=3D 50 or LA4 =3D=3D 51 o= r LA4 =3D=3D 52 or LA4 =3D=3D 53 or LA4 =3D=3D 54 or LA4 =3D=3D 55 or LA4 = =3D=3D 56 or LA4 =3D=3D 57 or LA4 =3D=3D 61:=0D LA4_38 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 58:=0D LA4_14 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 59:=0D LA4_16 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 60:=0D LA4_17 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D if alt4 =3D=3D 1:=0D # C.g:0:0: d=3D declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_function_definition157)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_function_def= inition157)=0D d =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_declarator_in_function_d= efinition160)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_function_definition160)=0D declarator1 =3D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -712,16 +724,17 @@ class CParser(Parser): alt6 =3D 2=0D LA6_0 =3D self.input.LA(1)=0D =0D - if (LA6_0 =3D=3D IDENTIFIER or LA6_0 =3D=3D 26 or (29 <=3D= LA6_0 <=3D 42) or (45 <=3D LA6_0 <=3D 46) or (48 <=3D LA6_0 <=3D 61)) :=0D + if (LA6_0 =3D=3D IDENTIFIER or LA6_0 =3D=3D 26 or (29 <=3D= LA6_0 <=3D 42) or (45 <=3D LA6_0 <=3D 46) or (48 <=3D LA6_0 <=3D 61)):=0D alt6 =3D 1=0D - elif (LA6_0 =3D=3D 43) :=0D + elif (LA6_0 =3D=3D 43):=0D alt6 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("147:3: ( ( declaration = )+ a=3D compound_statement | b=3D compound_statement )", 6, 0, self.input)= =0D + nvae =3D NoViableAltException(=0D + "147:3: ( ( declaration )+ a=3D compound_statement= | b=3D compound_statement )", 6, 0, self.input)=0D =0D raise nvae=0D =0D @@ -729,26 +742,25 @@ class CParser(Parser): # C.g:147:5: ( declaration )+ a=3D compound_statement= =0D # C.g:147:5: ( declaration )+=0D cnt5 =3D 0=0D - while True: #loop5=0D + while True: # loop5=0D alt5 =3D 2=0D LA5_0 =3D self.input.LA(1)=0D =0D - if (LA5_0 =3D=3D IDENTIFIER or LA5_0 =3D=3D 26 or = (29 <=3D LA5_0 <=3D 42) or (45 <=3D LA5_0 <=3D 46) or (48 <=3D LA5_0 <=3D 6= 1)) :=0D + if (LA5_0 =3D=3D IDENTIFIER or LA5_0 =3D=3D 26 or = (29 <=3D LA5_0 <=3D 42) or (45 <=3D LA5_0 <=3D 46) or (48 <=3D LA5_0 <=3D 6= 1)):=0D alt5 =3D 1=0D =0D -=0D if alt5 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_= in_function_definition166)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_function_defini= tion166)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D if cnt5 >=3D 1:=0D - break #loop5=0D + break # loop5=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -759,51 +771,46 @@ class CParser(Parser): =0D cnt5 +=3D 1=0D =0D -=0D - self.following.append(self.FOLLOW_compound_statement_i= n_function_definition171)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_function_definit= ion171)=0D a =3D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt6 =3D=3D 2:=0D # C.g:148:5: b=3D compound_statement=0D - self.following.append(self.FOLLOW_compound_statement_i= n_function_definition180)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_function_definit= ion180)=0D b =3D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D if self.backtracking =3D=3D 0:=0D =0D if d is not None:=0D - self.function_definition_stack[-1].ModifierText =3D = self.input.toString(d.start, d.stop)=0D + self.function_definition_stack[-1].ModifierText = =3D self.input.toString(=0D + d.start, d.stop)=0D else:=0D - self.function_definition_stack[-1].ModifierText =3D = ''=0D - self.function_definition_stack[-1].DeclText =3D self.i= nput.toString(declarator1.start, declarator1.stop)=0D + self.function_definition_stack[-1].ModifierText = =3D ''=0D + self.function_definition_stack[-1].DeclText =3D self.i= nput.toString(=0D + declarator1.start, declarator1.stop)=0D self.function_definition_stack[-1].DeclLine =3D declar= ator1.start.line=0D self.function_definition_stack[-1].DeclOffset =3D decl= arator1.start.charPositionInLine=0D if a is not None:=0D - self.function_definition_stack[-1].LBLine =3D a.star= t.line=0D - self.function_definition_stack[-1].LBOffset =3D a.st= art.charPositionInLine=0D + self.function_definition_stack[-1].LBLine =3D a.st= art.line=0D + self.function_definition_stack[-1].LBOffset =3D a.= start.charPositionInLine=0D else:=0D - self.function_definition_stack[-1].LBLine =3D b.star= t.line=0D - self.function_definition_stack[-1].LBOffset =3D b.st= art.charPositionInLine=0D -=0D -=0D -=0D -=0D + self.function_definition_stack[-1].LBLine =3D b.st= art.line=0D + self.function_definition_stack[-1].LBOffset =3D b.= start.charPositionInLine=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D if self.backtracking =3D=3D 0:=0D =0D - 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)=0D -=0D -=0D + self.StoreFunctionDefinition(retval.start.line, retval= .start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine= , self.function_definition_stack[-1].ModifierText, self.function_definition= _stack[=0D + -1].DeclText, self.functi= on_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset= , self.function_definition_stack[-1].DeclLine, self.function_definition_sta= ck[-1].DeclOffset)=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -819,9 +826,9 @@ class CParser(Parser): =0D # $ANTLR end function_definition=0D =0D -=0D # $ANTLR start declaration=0D # C.g:166:1: declaration : (a=3D 'typedef' (b=3D declaration_specifier= s )? c=3D init_declarator_list d=3D ';' | s=3D declaration_specifiers (t=3D= init_declarator_list )? e=3D ';' );=0D +=0D def declaration(self, ):=0D =0D declaration_StartIndex =3D self.input.index()=0D @@ -836,7 +843,6 @@ class CParser(Parser): =0D t =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 4):=0D @@ -846,23 +852,25 @@ class CParser(Parser): alt9 =3D 2=0D LA9_0 =3D self.input.LA(1)=0D =0D - if (LA9_0 =3D=3D 26) :=0D + if (LA9_0 =3D=3D 26):=0D alt9 =3D 1=0D - elif (LA9_0 =3D=3D IDENTIFIER or (29 <=3D LA9_0 <=3D 42) o= r (45 <=3D LA9_0 <=3D 46) or (48 <=3D LA9_0 <=3D 61)) :=0D + elif (LA9_0 =3D=3D IDENTIFIER or (29 <=3D LA9_0 <=3D 42) o= r (45 <=3D LA9_0 <=3D 46) or (48 <=3D LA9_0 <=3D 61)):=0D alt9 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "166:1: declaration : (a=3D 'typedef' (b=3D declar= ation_specifiers )? c=3D init_declarator_list d=3D ';' | s=3D declaration_s= pecifiers (t=3D init_declarator_list )? e=3D ';' );", 9, 0, self.input)=0D =0D raise nvae=0D =0D if alt9 =3D=3D 1:=0D # C.g:167:4: a=3D 'typedef' (b=3D declaration_specifie= rs )? c=3D init_declarator_list d=3D ';'=0D a =3D self.input.LT(1)=0D - self.match(self.input, 26, self.FOLLOW_26_in_declarati= on203)=0D + self.match(self.input, 26,=0D + self.FOLLOW_26_in_declaration203)=0D if self.failed:=0D return=0D # C.g:167:17: (b=3D declaration_specifiers )?=0D @@ -873,60 +881,61 @@ class CParser(Parser): elif LA7 =3D=3D IDENTIFIER:=0D LA7_13 =3D self.input.LA(2)=0D =0D - if (LA7_13 =3D=3D 62) :=0D + if (LA7_13 =3D=3D 62):=0D LA7_21 =3D self.input.LA(3)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D - elif (LA7_13 =3D=3D IDENTIFIER or (29 <=3D LA7_13 = <=3D 42) or (45 <=3D LA7_13 <=3D 46) or (48 <=3D LA7_13 <=3D 61) or LA7_13 = =3D=3D 66) :=0D + elif (LA7_13 =3D=3D IDENTIFIER or (29 <=3D LA7_13 = <=3D 42) or (45 <=3D LA7_13 <=3D 46) or (48 <=3D LA7_13 <=3D 61) or LA7_13 = =3D=3D 66):=0D alt7 =3D 1=0D elif LA7 =3D=3D 58:=0D LA7_14 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D elif LA7 =3D=3D 59:=0D LA7_16 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D elif LA7 =3D=3D 60:=0D LA7_17 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D if alt7 =3D=3D 1:=0D # C.g:0:0: b=3D declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_spec= ifiers_in_declaration207)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_declarat= ion207)=0D b =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_init_declarator_list= _in_declaration216)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_list_in_declaration216= )=0D c =3D self.init_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D d =3D self.input.LT(1)=0D - self.match(self.input, 25, self.FOLLOW_25_in_declarati= on220)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_declaration220)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D =0D if b is not None:=0D - 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))=0D + self.StoreTypedefDefinition(a.line, a.charPosi= tionInLine, d.line, d.charPositionInLine, self.input.toString(=0D + b.start, b.stop), self.input.toString(c.st= art, c.stop))=0D else:=0D - self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start, c.= stop))=0D -=0D -=0D -=0D + self.StoreTypedefDefinition(=0D + a.line, a.charPositionInLine, d.line, d.ch= arPositionInLine, '', self.input.toString(c.start, c.stop))=0D =0D elif alt9 =3D=3D 2:=0D # C.g:175:4: s=3D declaration_specifiers (t=3D init_de= clarator_list )? e=3D ';'=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_declaration234)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_declaration2= 34)=0D s =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D @@ -935,30 +944,27 @@ class CParser(Parser): alt8 =3D 2=0D LA8_0 =3D self.input.LA(1)=0D =0D - if (LA8_0 =3D=3D IDENTIFIER or (58 <=3D LA8_0 <=3D 60)= or LA8_0 =3D=3D 62 or LA8_0 =3D=3D 66) :=0D + if (LA8_0 =3D=3D IDENTIFIER or (58 <=3D LA8_0 <=3D 60)= or LA8_0 =3D=3D 62 or LA8_0 =3D=3D 66):=0D alt8 =3D 1=0D if alt8 =3D=3D 1:=0D # C.g:0:0: t=3D init_declarator_list=0D - self.following.append(self.FOLLOW_init_declarator_= list_in_declaration238)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_list_in_declaratio= n238)=0D t =3D self.init_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D e =3D self.input.LT(1)=0D - self.match(self.input, 25, self.FOLLOW_25_in_declarati= on243)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_declaration243)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D =0D if t is not None:=0D - 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))=0D -=0D -=0D -=0D -=0D + self.StoreVariableDeclaration(s.start.line, s.= start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.in= put.toString(=0D + s.start, s.stop), self.input.toString(t.st= art, t.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -978,10 +984,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start declaration_specifiers=0D # C.g:182:1: declaration_specifiers : ( storage_class_specifier | type= _specifier | type_qualifier )+ ;=0D +=0D def declaration_specifiers(self, ):=0D =0D retval =3D self.declaration_specifiers_return()=0D @@ -996,44 +1001,39 @@ class CParser(Parser): # C.g:183:6: ( storage_class_specifier | type_specifier | = type_qualifier )+=0D # C.g:183:6: ( storage_class_specifier | type_specifier | = type_qualifier )+=0D cnt10 =3D 0=0D - while True: #loop10=0D + while True: # loop10=0D alt10 =3D 4=0D LA10 =3D self.input.LA(1)=0D if LA10 =3D=3D 58:=0D LA10_2 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 59:=0D LA10_3 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 60:=0D LA10_4 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D IDENTIFIER:=0D LA10_5 =3D self.input.LA(2)=0D =0D - if (self.synpred14()) :=0D + if (self.synpred14()):=0D alt10 =3D 2=0D =0D -=0D elif LA10 =3D=3D 53:=0D LA10_9 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 29 or LA10 =3D=3D 30 or LA10 =3D=3D 3= 1 or LA10 =3D=3D 32 or LA10 =3D=3D 33:=0D alt10 =3D 1=0D elif LA10 =3D=3D 34 or LA10 =3D=3D 35 or LA10 =3D=3D 3= 6 or LA10 =3D=3D 37 or LA10 =3D=3D 38 or LA10 =3D=3D 39 or LA10 =3D=3D 40 o= r LA10 =3D=3D 41 or LA10 =3D=3D 42 or LA10 =3D=3D 45 or LA10 =3D=3D 46 or L= A10 =3D=3D 48:=0D @@ -1043,34 +1043,34 @@ class CParser(Parser): =0D if alt10 =3D=3D 1:=0D # C.g:183:10: storage_class_specifier=0D - self.following.append(self.FOLLOW_storage_class_sp= ecifier_in_declaration_specifiers264)=0D + self.following.append(=0D + self.FOLLOW_storage_class_specifier_in_declara= tion_specifiers264)=0D self.storage_class_specifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt10 =3D=3D 2:=0D # C.g:184:7: type_specifier=0D - self.following.append(self.FOLLOW_type_specifier_i= n_declaration_specifiers272)=0D + self.following.append(=0D + self.FOLLOW_type_specifier_in_declaration_spec= ifiers272)=0D self.type_specifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt10 =3D=3D 3:=0D # C.g:185:13: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_i= n_declaration_specifiers286)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_declaration_spec= ifiers286)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D if cnt10 >=3D 1:=0D - break #loop10=0D + break # loop10=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1081,13 +1081,8 @@ class CParser(Parser): =0D cnt10 +=3D 1=0D =0D -=0D -=0D -=0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1106,10 +1101,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start init_declarator_list=0D # C.g:189:1: init_declarator_list : init_declarator ( ',' init_declara= tor )* ;=0D +=0D def init_declarator_list(self, ):=0D =0D retval =3D self.init_declarator_list_return()=0D @@ -1122,42 +1116,38 @@ class CParser(Parser): =0D # C.g:190:2: ( init_declarator ( ',' init_declarator )* )= =0D # C.g:190:4: init_declarator ( ',' init_declarator )*=0D - self.following.append(self.FOLLOW_init_declarator_in_init_= declarator_list308)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_in_init_declarator_list308= )=0D self.init_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:190:20: ( ',' init_declarator )*=0D - while True: #loop11=0D + while True: # loop11=0D alt11 =3D 2=0D LA11_0 =3D self.input.LA(1)=0D =0D - if (LA11_0 =3D=3D 27) :=0D + if (LA11_0 =3D=3D 27):=0D alt11 =3D 1=0D =0D -=0D if alt11 =3D=3D 1:=0D # C.g:190:21: ',' init_declarator=0D - self.match(self.input, 27, self.FOLLOW_27_in_init_= declarator_list311)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_init_declarator_list3= 11)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_init_declarator_= in_init_declarator_list313)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_in_init_declarator= _list313)=0D self.init_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop11=0D -=0D -=0D -=0D -=0D + break # loop11=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1171,9 +1161,9 @@ class CParser(Parser): =0D # $ANTLR end init_declarator_list=0D =0D -=0D # $ANTLR start init_declarator=0D # C.g:193:1: init_declarator : declarator ( '=3D' initializer )? ;=0D +=0D def init_declarator(self, ):=0D =0D init_declarator_StartIndex =3D self.input.index()=0D @@ -1184,7 +1174,8 @@ class CParser(Parser): =0D # C.g:194:2: ( declarator ( '=3D' initializer )? )=0D # C.g:194:4: declarator ( '=3D' initializer )?=0D - self.following.append(self.FOLLOW_declarator_in_init_decla= rator326)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_init_declarator326)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -1193,25 +1184,21 @@ class CParser(Parser): alt12 =3D 2=0D LA12_0 =3D self.input.LA(1)=0D =0D - if (LA12_0 =3D=3D 28) :=0D + if (LA12_0 =3D=3D 28):=0D alt12 =3D 1=0D if alt12 =3D=3D 1:=0D # C.g:194:16: '=3D' initializer=0D - self.match(self.input, 28, self.FOLLOW_28_in_init_decl= arator329)=0D + self.match(self.input, 28,=0D + self.FOLLOW_28_in_init_declarator329)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_in_init_= declarator331)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_init_declarator331)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1225,9 +1212,9 @@ class CParser(Parser): =0D # $ANTLR end init_declarator=0D =0D -=0D # $ANTLR start storage_class_specifier=0D # C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' = | 'register' | 'STATIC' );=0D +=0D def storage_class_specifier(self, ):=0D =0D storage_class_specifier_StartIndex =3D self.input.index()=0D @@ -1239,7 +1226,7 @@ class CParser(Parser): # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' |= 'STATIC' )=0D # C.g:=0D if (29 <=3D self.input.LA(1) <=3D 33):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -1251,14 +1238,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_storage_class_= specifier0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1272,9 +1254,9 @@ class CParser(Parser): =0D # $ANTLR end storage_class_specifier=0D =0D -=0D # $ANTLR start type_specifier=0D # C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'l= ong' | 'float' | 'double' | 'signed' | 'unsigned' | s=3D struct_or_union_sp= ecifier | e=3D enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator= )=3D> type_id );=0D +=0D def type_specifier(self, ):=0D =0D type_specifier_StartIndex =3D self.input.index()=0D @@ -1282,7 +1264,6 @@ class CParser(Parser): =0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 9):=0D @@ -1292,27 +1273,27 @@ class CParser(Parser): alt13 =3D 12=0D LA13_0 =3D self.input.LA(1)=0D =0D - if (LA13_0 =3D=3D 34) :=0D + if (LA13_0 =3D=3D 34):=0D alt13 =3D 1=0D - elif (LA13_0 =3D=3D 35) :=0D + elif (LA13_0 =3D=3D 35):=0D alt13 =3D 2=0D - elif (LA13_0 =3D=3D 36) :=0D + elif (LA13_0 =3D=3D 36):=0D alt13 =3D 3=0D - elif (LA13_0 =3D=3D 37) :=0D + elif (LA13_0 =3D=3D 37):=0D alt13 =3D 4=0D - elif (LA13_0 =3D=3D 38) :=0D + elif (LA13_0 =3D=3D 38):=0D alt13 =3D 5=0D - elif (LA13_0 =3D=3D 39) :=0D + elif (LA13_0 =3D=3D 39):=0D alt13 =3D 6=0D - elif (LA13_0 =3D=3D 40) :=0D + elif (LA13_0 =3D=3D 40):=0D alt13 =3D 7=0D - elif (LA13_0 =3D=3D 41) :=0D + elif (LA13_0 =3D=3D 41):=0D alt13 =3D 8=0D - elif (LA13_0 =3D=3D 42) :=0D + elif (LA13_0 =3D=3D 42):=0D alt13 =3D 9=0D - elif ((45 <=3D LA13_0 <=3D 46)) :=0D + elif ((45 <=3D LA13_0 <=3D 46)):=0D alt13 =3D 10=0D - elif (LA13_0 =3D=3D 48) :=0D + elif (LA13_0 =3D=3D 48):=0D alt13 =3D 11=0D elif (LA13_0 =3D=3D IDENTIFIER) and (self.synpred34()):=0D alt13 =3D 12=0D @@ -1321,76 +1302,78 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "205:1: type_specifier : ( 'void' | 'char' | 'shor= t' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s=3D str= uct_or_union_specifier | e=3D enum_specifier | ( IDENTIFIER ( type_qualifie= r )* declarator )=3D> type_id );", 13, 0, self.input)=0D =0D raise nvae=0D =0D if alt13 =3D=3D 1:=0D # C.g:206:4: 'void'=0D - self.match(self.input, 34, self.FOLLOW_34_in_type_spec= ifier376)=0D + self.match(self.input, 34,=0D + self.FOLLOW_34_in_type_specifier376)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 2:=0D # C.g:207:4: 'char'=0D - self.match(self.input, 35, self.FOLLOW_35_in_type_spec= ifier381)=0D + self.match(self.input, 35,=0D + self.FOLLOW_35_in_type_specifier381)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 3:=0D # C.g:208:4: 'short'=0D - self.match(self.input, 36, self.FOLLOW_36_in_type_spec= ifier386)=0D + self.match(self.input, 36,=0D + self.FOLLOW_36_in_type_specifier386)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 4:=0D # C.g:209:4: 'int'=0D - self.match(self.input, 37, self.FOLLOW_37_in_type_spec= ifier391)=0D + self.match(self.input, 37,=0D + self.FOLLOW_37_in_type_specifier391)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 5:=0D # C.g:210:4: 'long'=0D - self.match(self.input, 38, self.FOLLOW_38_in_type_spec= ifier396)=0D + self.match(self.input, 38,=0D + self.FOLLOW_38_in_type_specifier396)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 6:=0D # C.g:211:4: 'float'=0D - self.match(self.input, 39, self.FOLLOW_39_in_type_spec= ifier401)=0D + self.match(self.input, 39,=0D + self.FOLLOW_39_in_type_specifier401)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 7:=0D # C.g:212:4: 'double'=0D - self.match(self.input, 40, self.FOLLOW_40_in_type_spec= ifier406)=0D + self.match(self.input, 40,=0D + self.FOLLOW_40_in_type_specifier406)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 8:=0D # C.g:213:4: 'signed'=0D - self.match(self.input, 41, self.FOLLOW_41_in_type_spec= ifier411)=0D + self.match(self.input, 41,=0D + self.FOLLOW_41_in_type_specifier411)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 9:=0D # C.g:214:4: 'unsigned'=0D - self.match(self.input, 42, self.FOLLOW_42_in_type_spec= ifier416)=0D + self.match(self.input, 42,=0D + self.FOLLOW_42_in_type_specifier416)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 10:=0D # C.g:215:4: s=3D struct_or_union_specifier=0D - self.following.append(self.FOLLOW_struct_or_union_spec= ifier_in_type_specifier423)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_specifier_in_type_spec= ifier423)=0D s =3D self.struct_or_union_specifier()=0D self.following.pop()=0D if self.failed:=0D @@ -1398,14 +1381,13 @@ class CParser(Parser): if self.backtracking =3D=3D 0:=0D =0D if s.stop is not None:=0D - self.StoreStructUnionDefinition(s.start.line, s.= start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.inpu= t.toString(s.start, s.stop))=0D -=0D -=0D -=0D + self.StoreStructUnionDefinition(=0D + s.start.line, s.start.charPositionInLine, = s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start, s.stop= ))=0D =0D elif alt13 =3D=3D 11:=0D # C.g:220:4: e=3D enum_specifier=0D - self.following.append(self.FOLLOW_enum_specifier_in_ty= pe_specifier433)=0D + self.following.append(=0D + self.FOLLOW_enum_specifier_in_type_specifier433)=0D e =3D self.enum_specifier()=0D self.following.pop()=0D if self.failed:=0D @@ -1413,21 +1395,18 @@ class CParser(Parser): if self.backtracking =3D=3D 0:=0D =0D if e.stop is not None:=0D - self.StoreEnumerationDefinition(e.start.line, e.= start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.inpu= t.toString(e.start, e.stop))=0D -=0D -=0D -=0D + self.StoreEnumerationDefinition(=0D + e.start.line, e.start.charPositionInLine, = e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop= ))=0D =0D elif alt13 =3D=3D 12:=0D # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarat= or )=3D> type_id=0D - self.following.append(self.FOLLOW_type_id_in_type_spec= ifier451)=0D + self.following.append(=0D + self.FOLLOW_type_id_in_type_specifier451)=0D self.type_id()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1441,9 +1420,9 @@ class CParser(Parser): =0D # $ANTLR end type_specifier=0D =0D -=0D # $ANTLR start type_id=0D # C.g:228:1: type_id : IDENTIFIER ;=0D +=0D def type_id(self, ):=0D =0D type_id_StartIndex =3D self.input.index()=0D @@ -1454,13 +1433,11 @@ class CParser(Parser): =0D # C.g:229:5: ( IDENTIFIER )=0D # C.g:229:9: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_type_id467)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_type_id467)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1479,10 +1456,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start struct_or_union_specifier=0D # C.g:233:1: struct_or_union_specifier options {k=3D3; } : ( struct_or= _union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union ID= ENTIFIER );=0D +=0D def struct_or_union_specifier(self, ):=0D =0D retval =3D self.struct_or_union_specifier_return()=0D @@ -1497,33 +1473,35 @@ class CParser(Parser): alt15 =3D 2=0D LA15_0 =3D self.input.LA(1)=0D =0D - if ((45 <=3D LA15_0 <=3D 46)) :=0D + if ((45 <=3D LA15_0 <=3D 46)):=0D LA15_1 =3D self.input.LA(2)=0D =0D - if (LA15_1 =3D=3D IDENTIFIER) :=0D + if (LA15_1 =3D=3D IDENTIFIER):=0D LA15_2 =3D self.input.LA(3)=0D =0D - if (LA15_2 =3D=3D 43) :=0D + if (LA15_2 =3D=3D 43):=0D alt15 =3D 1=0D - elif (LA15_2 =3D=3D EOF or LA15_2 =3D=3D IDENTIFIE= R or LA15_2 =3D=3D 25 or LA15_2 =3D=3D 27 or (29 <=3D LA15_2 <=3D 42) or (4= 5 <=3D LA15_2 <=3D 64) or LA15_2 =3D=3D 66) :=0D + elif (LA15_2 =3D=3D EOF or LA15_2 =3D=3D IDENTIFIE= R or LA15_2 =3D=3D 25 or LA15_2 =3D=3D 27 or (29 <=3D LA15_2 <=3D 42) or (4= 5 <=3D LA15_2 <=3D 64) or LA15_2 =3D=3D 66):=0D alt15 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_o= r_union_specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{'= struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.= input)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options = {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '= }' | struct_or_union IDENTIFIER );", 15, 2, self.input)=0D =0D raise nvae=0D =0D - elif (LA15_1 =3D=3D 43) :=0D + elif (LA15_1 =3D=3D 43):=0D alt15 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_or_un= ion_specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' str= uct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.inpu= t)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options {k= =3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'= | struct_or_union IDENTIFIER );", 15, 1, self.input)=0D =0D raise nvae=0D =0D @@ -1532,13 +1510,15 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_or_union_= specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_= declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options {k=3D3; = } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | str= uct_or_union IDENTIFIER );", 15, 0, self.input)=0D =0D raise nvae=0D =0D if alt15 =3D=3D 1:=0D # C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struc= t_declaration_list '}'=0D - self.following.append(self.FOLLOW_struct_or_union_in_s= truct_or_union_specifier494)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_in_struct_or_union_spe= cifier494)=0D self.struct_or_union()=0D self.following.pop()=0D if self.failed:=0D @@ -1547,50 +1527,52 @@ class CParser(Parser): alt14 =3D 2=0D LA14_0 =3D self.input.LA(1)=0D =0D - if (LA14_0 =3D=3D IDENTIFIER) :=0D + if (LA14_0 =3D=3D IDENTIFIER):=0D alt14 =3D 1=0D if alt14 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_struct_or_union_specifier496)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_struct_or_union_specifier496)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 43, self.FOLLOW_43_in_struct_or= _union_specifier499)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_struct_or_union_specifier= 499)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_struct_declaration_l= ist_in_struct_or_union_specifier501)=0D + self.following.append(=0D + self.FOLLOW_struct_declaration_list_in_struct_or_u= nion_specifier501)=0D self.struct_declaration_list()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 44, self.FOLLOW_44_in_struct_or= _union_specifier503)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_struct_or_union_specifier= 503)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt15 =3D=3D 2:=0D # C.g:236:4: struct_or_union IDENTIFIER=0D - self.following.append(self.FOLLOW_struct_or_union_in_s= truct_or_union_specifier508)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_in_struct_or_union_spe= cifier508)=0D self.struct_or_union()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_struct_or_union_specifier510)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_= struct_or_union_specifier510)=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 11, struct_or_union_specifier_Sta= rtIndex)=0D + self.memoize(self.input, 11,=0D + struct_or_union_specifier_StartIndex)=0D =0D pass=0D =0D @@ -1598,9 +1580,9 @@ class CParser(Parser): =0D # $ANTLR end struct_or_union_specifier=0D =0D -=0D # $ANTLR start struct_or_union=0D # C.g:239:1: struct_or_union : ( 'struct' | 'union' );=0D +=0D def struct_or_union(self, ):=0D =0D struct_or_union_StartIndex =3D self.input.index()=0D @@ -1612,7 +1594,7 @@ class CParser(Parser): # C.g:240:2: ( 'struct' | 'union' )=0D # C.g:=0D if (45 <=3D self.input.LA(1) <=3D 46):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -1624,14 +1606,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_struct_or_unio= n0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1645,9 +1622,9 @@ class CParser(Parser): =0D # $ANTLR end struct_or_union=0D =0D -=0D # $ANTLR start struct_declaration_list=0D # C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;=0D +=0D def struct_declaration_list(self, ):=0D =0D struct_declaration_list_StartIndex =3D self.input.index()=0D @@ -1660,26 +1637,25 @@ class CParser(Parser): # C.g:245:4: ( struct_declaration )+=0D # C.g:245:4: ( struct_declaration )+=0D cnt16 =3D 0=0D - while True: #loop16=0D + while True: # loop16=0D alt16 =3D 2=0D LA16_0 =3D self.input.LA(1)=0D =0D - if (LA16_0 =3D=3D IDENTIFIER or (34 <=3D LA16_0 <=3D 4= 2) or (45 <=3D LA16_0 <=3D 46) or (48 <=3D LA16_0 <=3D 61)) :=0D + if (LA16_0 =3D=3D IDENTIFIER or (34 <=3D LA16_0 <=3D 4= 2) or (45 <=3D LA16_0 <=3D 46) or (48 <=3D LA16_0 <=3D 61)):=0D alt16 =3D 1=0D =0D -=0D if alt16 =3D=3D 1:=0D # C.g:0:0: struct_declaration=0D - self.following.append(self.FOLLOW_struct_declarati= on_in_struct_declaration_list537)=0D + self.following.append(=0D + self.FOLLOW_struct_declaration_in_struct_decla= ration_list537)=0D self.struct_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt16 >=3D 1:=0D - break #loop16=0D + break # loop16=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1690,17 +1666,13 @@ class CParser(Parser): =0D cnt16 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 13, struct_declaration_list_Start= Index)=0D + self.memoize(self.input, 13,=0D + struct_declaration_list_StartIndex)=0D =0D pass=0D =0D @@ -1708,9 +1680,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declaration_list=0D =0D -=0D # $ANTLR start struct_declaration=0D # C.g:248:1: struct_declaration : specifier_qualifier_list struct_decl= arator_list ';' ;=0D +=0D def struct_declaration(self, ):=0D =0D struct_declaration_StartIndex =3D self.input.index()=0D @@ -1721,23 +1693,23 @@ class CParser(Parser): =0D # C.g:249:2: ( specifier_qualifier_list struct_declarator_= list ';' )=0D # C.g:249:4: specifier_qualifier_list struct_declarator_li= st ';'=0D - self.following.append(self.FOLLOW_specifier_qualifier_list= _in_struct_declaration549)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_struct_declara= tion549)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_struct_declarator_list_i= n_struct_declaration551)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_list_in_struct_declarati= on551)=0D self.struct_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_struct_declar= ation553)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_struct_declaration553)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1751,9 +1723,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declaration=0D =0D -=0D # $ANTLR start specifier_qualifier_list=0D # C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specif= ier )+ ;=0D +=0D def specifier_qualifier_list(self, ):=0D =0D specifier_qualifier_list_StartIndex =3D self.input.index()=0D @@ -1766,30 +1738,27 @@ class CParser(Parser): # C.g:253:4: ( type_qualifier | type_specifier )+=0D # C.g:253:4: ( type_qualifier | type_specifier )+=0D cnt17 =3D 0=0D - while True: #loop17=0D + while True: # loop17=0D alt17 =3D 3=0D LA17 =3D self.input.LA(1)=0D if LA17 =3D=3D 58:=0D LA17_2 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D 59:=0D LA17_3 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D 60:=0D LA17_4 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D IDENTIFIER:=0D LA17 =3D self.input.LA(2)=0D if LA17 =3D=3D EOF or LA17 =3D=3D IDENTIFIER or LA= 17 =3D=3D 34 or LA17 =3D=3D 35 or LA17 =3D=3D 36 or LA17 =3D=3D 37 or LA17 = =3D=3D 38 or LA17 =3D=3D 39 or LA17 =3D=3D 40 or LA17 =3D=3D 41 or LA17 =3D= =3D 42 or LA17 =3D=3D 45 or LA17 =3D=3D 46 or LA17 =3D=3D 48 or LA17 =3D=3D= 49 or LA17 =3D=3D 50 or LA17 =3D=3D 51 or LA17 =3D=3D 52 or LA17 =3D=3D 53= or LA17 =3D=3D 54 or LA17 =3D=3D 55 or LA17 =3D=3D 56 or LA17 =3D=3D 57 or= LA17 =3D=3D 58 or LA17 =3D=3D 59 or LA17 =3D=3D 60 or LA17 =3D=3D 61 or LA= 17 =3D=3D 63 or LA17 =3D=3D 66:=0D @@ -1797,25 +1766,21 @@ class CParser(Parser): elif LA17 =3D=3D 62:=0D LA17_94 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D elif LA17 =3D=3D 47:=0D LA17_95 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D elif LA17 =3D=3D 64:=0D LA17_96 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D -=0D elif LA17 =3D=3D 49 or LA17 =3D=3D 50 or LA17 =3D=3D 5= 1 or LA17 =3D=3D 52 or LA17 =3D=3D 53 or LA17 =3D=3D 54 or LA17 =3D=3D 55 o= r LA17 =3D=3D 56 or LA17 =3D=3D 57 or LA17 =3D=3D 61:=0D alt17 =3D 1=0D elif LA17 =3D=3D 34 or LA17 =3D=3D 35 or LA17 =3D=3D 3= 6 or LA17 =3D=3D 37 or LA17 =3D=3D 38 or LA17 =3D=3D 39 or LA17 =3D=3D 40 o= r LA17 =3D=3D 41 or LA17 =3D=3D 42 or LA17 =3D=3D 45 or LA17 =3D=3D 46 or L= A17 =3D=3D 48:=0D @@ -1823,25 +1788,25 @@ class CParser(Parser): =0D if alt17 =3D=3D 1:=0D # C.g:253:6: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_i= n_specifier_qualifier_list566)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_specifier_qualif= ier_list566)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt17 =3D=3D 2:=0D # C.g:253:23: type_specifier=0D - self.following.append(self.FOLLOW_type_specifier_i= n_specifier_qualifier_list570)=0D + self.following.append(=0D + self.FOLLOW_type_specifier_in_specifier_qualif= ier_list570)=0D self.type_specifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt17 >=3D 1:=0D - break #loop17=0D + break # loop17=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1852,17 +1817,13 @@ class CParser(Parser): =0D cnt17 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 15, specifier_qualifier_list_Star= tIndex)=0D + self.memoize(self.input, 15,=0D + specifier_qualifier_list_StartIndex)=0D =0D pass=0D =0D @@ -1870,9 +1831,9 @@ class CParser(Parser): =0D # $ANTLR end specifier_qualifier_list=0D =0D -=0D # $ANTLR start struct_declarator_list=0D # C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_d= eclarator )* ;=0D +=0D def struct_declarator_list(self, ):=0D =0D struct_declarator_list_StartIndex =3D self.input.index()=0D @@ -1883,39 +1844,35 @@ class CParser(Parser): =0D # C.g:257:2: ( struct_declarator ( ',' struct_declarator )= * )=0D # C.g:257:4: struct_declarator ( ',' struct_declarator )*= =0D - self.following.append(self.FOLLOW_struct_declarator_in_str= uct_declarator_list584)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_in_struct_declarator_lis= t584)=0D self.struct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:257:22: ( ',' struct_declarator )*=0D - while True: #loop18=0D + while True: # loop18=0D alt18 =3D 2=0D LA18_0 =3D self.input.LA(1)=0D =0D - if (LA18_0 =3D=3D 27) :=0D + if (LA18_0 =3D=3D 27):=0D alt18 =3D 1=0D =0D -=0D if alt18 =3D=3D 1:=0D # C.g:257:23: ',' struct_declarator=0D - self.match(self.input, 27, self.FOLLOW_27_in_struc= t_declarator_list587)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_struct_declarator_lis= t587)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_struct_declarato= r_in_struct_declarator_list589)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_in_struct_declar= ator_list589)=0D self.struct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop18=0D -=0D -=0D -=0D -=0D -=0D + break # loop18=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -1930,9 +1887,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declarator_list=0D =0D -=0D # $ANTLR start struct_declarator=0D # C.g:260:1: struct_declarator : ( declarator ( ':' constant_expressio= n )? | ':' constant_expression );=0D +=0D def struct_declarator(self, ):=0D =0D struct_declarator_StartIndex =3D self.input.index()=0D @@ -1945,22 +1902,24 @@ class CParser(Parser): alt20 =3D 2=0D LA20_0 =3D self.input.LA(1)=0D =0D - if (LA20_0 =3D=3D IDENTIFIER or (58 <=3D LA20_0 <=3D 60) o= r LA20_0 =3D=3D 62 or LA20_0 =3D=3D 66) :=0D + if (LA20_0 =3D=3D IDENTIFIER or (58 <=3D LA20_0 <=3D 60) o= r LA20_0 =3D=3D 62 or LA20_0 =3D=3D 66):=0D alt20 =3D 1=0D - elif (LA20_0 =3D=3D 47) :=0D + elif (LA20_0 =3D=3D 47):=0D alt20 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("260:1: struct_declarato= r : ( declarator ( ':' constant_expression )? | ':' constant_expression );"= , 20, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "260:1: struct_declarator : ( declarator ( ':' con= stant_expression )? | ':' constant_expression );", 20, 0, self.input)=0D =0D raise nvae=0D =0D if alt20 =3D=3D 1:=0D # C.g:261:4: declarator ( ':' constant_expression )?=0D - self.following.append(self.FOLLOW_declarator_in_struct= _declarator602)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_struct_declarator602)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -1969,36 +1928,34 @@ class CParser(Parser): alt19 =3D 2=0D LA19_0 =3D self.input.LA(1)=0D =0D - if (LA19_0 =3D=3D 47) :=0D + if (LA19_0 =3D=3D 47):=0D alt19 =3D 1=0D if alt19 =3D=3D 1:=0D # C.g:261:16: ':' constant_expression=0D - self.match(self.input, 47, self.FOLLOW_47_in_struc= t_declarator605)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_struct_declarator605)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_express= ion_in_struct_declarator607)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_struct_decl= arator607)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt20 =3D=3D 2:=0D # C.g:262:4: ':' constant_expression=0D - self.match(self.input, 47, self.FOLLOW_47_in_struct_de= clarator614)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_struct_declarator614)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_struct_declarator616)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_struct_declarat= or616)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2017,10 +1974,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start enum_specifier=0D # C.g:265:1: enum_specifier options {k=3D3; } : ( 'enum' '{' enumerato= r_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | = 'enum' IDENTIFIER );=0D +=0D def enum_specifier(self, ):=0D =0D retval =3D self.enum_specifier_return()=0D @@ -2035,33 +1991,35 @@ class CParser(Parser): alt23 =3D 3=0D LA23_0 =3D self.input.LA(1)=0D =0D - if (LA23_0 =3D=3D 48) :=0D + if (LA23_0 =3D=3D 48):=0D LA23_1 =3D self.input.LA(2)=0D =0D - if (LA23_1 =3D=3D IDENTIFIER) :=0D + if (LA23_1 =3D=3D IDENTIFIER):=0D LA23_2 =3D self.input.LA(3)=0D =0D - if (LA23_2 =3D=3D 43) :=0D + if (LA23_2 =3D=3D 43):=0D alt23 =3D 2=0D - elif (LA23_2 =3D=3D EOF or LA23_2 =3D=3D IDENTIFIE= R or LA23_2 =3D=3D 25 or LA23_2 =3D=3D 27 or (29 <=3D LA23_2 <=3D 42) or (4= 5 <=3D LA23_2 <=3D 64) or LA23_2 =3D=3D 66) :=0D + elif (LA23_2 =3D=3D EOF or LA23_2 =3D=3D IDENTIFIE= R or LA23_2 =3D=3D 25 or LA23_2 =3D=3D 27 or (29 <=3D LA23_2 <=3D 42) or (4= 5 <=3D LA23_2 <=3D 64) or LA23_2 =3D=3D 66):=0D alt23 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_spe= cifier options {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enu= m' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23,= 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } := ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerat= or_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)=0D =0D raise nvae=0D =0D - elif (LA23_1 =3D=3D 43) :=0D + elif (LA23_1 =3D=3D 43):=0D alt23 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_specifi= er options {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' I= DENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, = self.input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } : ( '= enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_l= ist ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)=0D =0D raise nvae=0D =0D @@ -2070,19 +2028,23 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_specifier o= ptions {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENT= IFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self= .input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } : ( 'enum= ' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list = ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)=0D =0D raise nvae=0D =0D if alt23 =3D=3D 1:=0D # C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier634)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier634)=0D if self.failed:=0D return retval=0D - self.match(self.input, 43, self.FOLLOW_43_in_enum_spec= ifier636)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_enum_specifier636)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_enumerator_list_in_e= num_specifier638)=0D + self.following.append(=0D + self.FOLLOW_enumerator_list_in_enum_specifier638)= =0D self.enumerator_list()=0D self.following.pop()=0D if self.failed:=0D @@ -2091,33 +2053,36 @@ class CParser(Parser): alt21 =3D 2=0D LA21_0 =3D self.input.LA(1)=0D =0D - if (LA21_0 =3D=3D 27) :=0D + if (LA21_0 =3D=3D 27):=0D alt21 =3D 1=0D if alt21 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_enum_= specifier640)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enum_specifier640)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_enum_spec= ifier643)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_enum_specifier643)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt23 =3D=3D 2:=0D # C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( '= ,' )? '}'=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier648)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier648)=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_enum_specifier650)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enum_specifier650= )=0D if self.failed:=0D return retval=0D - self.match(self.input, 43, self.FOLLOW_43_in_enum_spec= ifier652)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_enum_specifier652)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_enumerator_list_in_e= num_specifier654)=0D + self.following.append(=0D + self.FOLLOW_enumerator_list_in_enum_specifier654)= =0D self.enumerator_list()=0D self.following.pop()=0D if self.failed:=0D @@ -2126,34 +2091,33 @@ class CParser(Parser): alt22 =3D 2=0D LA22_0 =3D self.input.LA(1)=0D =0D - if (LA22_0 =3D=3D 27) :=0D + if (LA22_0 =3D=3D 27):=0D alt22 =3D 1=0D if alt22 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_enum_= specifier656)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enum_specifier656)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_enum_spec= ifier659)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_enum_specifier659)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt23 =3D=3D 3:=0D # C.g:269:4: 'enum' IDENTIFIER=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier664)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier664)=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_enum_specifier666)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enum_specifier666= )=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2167,9 +2131,9 @@ class CParser(Parser): =0D # $ANTLR end enum_specifier=0D =0D -=0D # $ANTLR start enumerator_list=0D # C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;=0D +=0D def enumerator_list(self, ):=0D =0D enumerator_list_StartIndex =3D self.input.index()=0D @@ -2180,44 +2144,38 @@ class CParser(Parser): =0D # C.g:273:2: ( enumerator ( ',' enumerator )* )=0D # C.g:273:4: enumerator ( ',' enumerator )*=0D - self.following.append(self.FOLLOW_enumerator_in_enumerator= _list677)=0D + self.following.append(=0D + self.FOLLOW_enumerator_in_enumerator_list677)=0D self.enumerator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:273:15: ( ',' enumerator )*=0D - while True: #loop24=0D + while True: # loop24=0D alt24 =3D 2=0D LA24_0 =3D self.input.LA(1)=0D =0D - if (LA24_0 =3D=3D 27) :=0D + if (LA24_0 =3D=3D 27):=0D LA24_1 =3D self.input.LA(2)=0D =0D - if (LA24_1 =3D=3D IDENTIFIER) :=0D + if (LA24_1 =3D=3D IDENTIFIER):=0D alt24 =3D 1=0D =0D -=0D -=0D -=0D if alt24 =3D=3D 1:=0D # C.g:273:16: ',' enumerator=0D - self.match(self.input, 27, self.FOLLOW_27_in_enume= rator_list680)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enumerator_list680)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_enumerator_in_en= umerator_list682)=0D + self.following.append(=0D + self.FOLLOW_enumerator_in_enumerator_list682)= =0D self.enumerator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop24=0D -=0D -=0D -=0D -=0D -=0D + break # loop24=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -2232,9 +2190,9 @@ class CParser(Parser): =0D # $ANTLR end enumerator_list=0D =0D -=0D # $ANTLR start enumerator=0D # C.g:276:1: enumerator : IDENTIFIER ( '=3D' constant_expression )? ;= =0D +=0D def enumerator(self, ):=0D =0D enumerator_StartIndex =3D self.input.index()=0D @@ -2245,32 +2203,28 @@ class CParser(Parser): =0D # C.g:277:2: ( IDENTIFIER ( '=3D' constant_expression )? )= =0D # C.g:277:4: IDENTIFIER ( '=3D' constant_expression )?=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_enumerator695)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enumerator695)=0D if self.failed:=0D return=0D # C.g:277:15: ( '=3D' constant_expression )?=0D alt25 =3D 2=0D LA25_0 =3D self.input.LA(1)=0D =0D - if (LA25_0 =3D=3D 28) :=0D + if (LA25_0 =3D=3D 28):=0D alt25 =3D 1=0D if alt25 =3D=3D 1:=0D # C.g:277:16: '=3D' constant_expression=0D self.match(self.input, 28, self.FOLLOW_28_in_enumerato= r698)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_enumerator700)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_enumerator700)= =0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2284,9 +2238,9 @@ class CParser(Parser): =0D # $ANTLR end enumerator=0D =0D -=0D # $ANTLR start type_qualifier=0D # C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | = 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFER= ENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );= =0D +=0D def type_qualifier(self, ):=0D =0D type_qualifier_StartIndex =3D self.input.index()=0D @@ -2298,7 +2252,7 @@ class CParser(Parser): # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTI= ONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED= ' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )=0D # C.g:=0D if (49 <=3D self.input.LA(1) <=3D 61):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -2310,14 +2264,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_type_qualifier= 0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2336,10 +2285,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start declarator=0D # C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERV= ICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );=0D +=0D def declarator(self, ):=0D =0D retval =3D self.declarator_return()=0D @@ -2354,30 +2302,32 @@ class CParser(Parser): alt30 =3D 2=0D LA30_0 =3D self.input.LA(1)=0D =0D - if (LA30_0 =3D=3D 66) :=0D + if (LA30_0 =3D=3D 66):=0D LA30_1 =3D self.input.LA(2)=0D =0D - if (self.synpred66()) :=0D + if (self.synpred66()):=0D alt30 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt30 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("296:1: declarator := ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE'= )? direct_declarator | pointer );", 30, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "296:1: declarator : ( ( pointer )? ( 'EFIAPI'= )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | po= inter );", 30, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA30_0 =3D=3D IDENTIFIER or (58 <=3D LA30_0 <=3D 60)= or LA30_0 =3D=3D 62) :=0D + elif (LA30_0 =3D=3D IDENTIFIER or (58 <=3D LA30_0 <=3D 60)= or LA30_0 =3D=3D 62):=0D alt30 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("296:1: declarator : ( (= pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? = direct_declarator | pointer );", 30, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? = ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointe= r );", 30, 0, self.input)=0D =0D raise nvae=0D =0D @@ -2387,67 +2337,63 @@ class CParser(Parser): alt26 =3D 2=0D LA26_0 =3D self.input.LA(1)=0D =0D - if (LA26_0 =3D=3D 66) :=0D + if (LA26_0 =3D=3D 66):=0D alt26 =3D 1=0D if alt26 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_decla= rator784)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_declarator784)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:13: ( 'EFIAPI' )?=0D alt27 =3D 2=0D LA27_0 =3D self.input.LA(1)=0D =0D - if (LA27_0 =3D=3D 58) :=0D + if (LA27_0 =3D=3D 58):=0D alt27 =3D 1=0D if alt27 =3D=3D 1:=0D # C.g:297:14: 'EFIAPI'=0D - self.match(self.input, 58, self.FOLLOW_58_in_decla= rator788)=0D + self.match(self.input, 58,=0D + self.FOLLOW_58_in_declarator788)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:25: ( 'EFI_BOOTSERVICE' )?=0D alt28 =3D 2=0D LA28_0 =3D self.input.LA(1)=0D =0D - if (LA28_0 =3D=3D 59) :=0D + if (LA28_0 =3D=3D 59):=0D alt28 =3D 1=0D if alt28 =3D=3D 1:=0D # C.g:297:26: 'EFI_BOOTSERVICE'=0D - self.match(self.input, 59, self.FOLLOW_59_in_decla= rator793)=0D + self.match(self.input, 59,=0D + self.FOLLOW_59_in_declarator793)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?=0D alt29 =3D 2=0D LA29_0 =3D self.input.LA(1)=0D =0D - if (LA29_0 =3D=3D 60) :=0D + if (LA29_0 =3D=3D 60):=0D alt29 =3D 1=0D if alt29 =3D=3D 1:=0D # C.g:297:47: 'EFI_RUNTIMESERVICE'=0D - self.match(self.input, 60, self.FOLLOW_60_in_decla= rator798)=0D + self.match(self.input, 60,=0D + self.FOLLOW_60_in_declarator798)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_direct_declarator_in= _declarator802)=0D + self.following.append(=0D + self.FOLLOW_direct_declarator_in_declarator802)=0D self.direct_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt30 =3D=3D 2:=0D # C.g:299:4: pointer=0D self.following.append(self.FOLLOW_pointer_in_declarato= r808)=0D @@ -2456,10 +2402,8 @@ class CParser(Parser): if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2473,9 +2417,9 @@ class CParser(Parser): =0D # $ANTLR end declarator=0D =0D -=0D # $ANTLR start direct_declarator=0D # C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* |= '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );=0D +=0D def direct_declarator(self, ):=0D =0D direct_declarator_StartIndex =3D self.input.index()=0D @@ -2488,556 +2432,485 @@ class CParser(Parser): alt34 =3D 2=0D LA34_0 =3D self.input.LA(1)=0D =0D - if (LA34_0 =3D=3D IDENTIFIER) :=0D + if (LA34_0 =3D=3D IDENTIFIER):=0D alt34 =3D 1=0D - elif (LA34_0 =3D=3D 62) :=0D + elif (LA34_0 =3D=3D 62):=0D alt34 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("302:1: direct_declarato= r : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' = ( declarator_suffix )+ );", 34, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "302:1: direct_declarator : ( IDENTIFIER ( declara= tor_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );"= , 34, 0, self.input)=0D =0D raise nvae=0D =0D if alt34 =3D=3D 1:=0D # C.g:303:4: IDENTIFIER ( declarator_suffix )*=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_direct_declarator819)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_direct_declarator= 819)=0D if self.failed:=0D return=0D # C.g:303:15: ( declarator_suffix )*=0D - while True: #loop31=0D + while True: # loop31=0D alt31 =3D 2=0D LA31_0 =3D self.input.LA(1)=0D =0D - if (LA31_0 =3D=3D 62) :=0D + if (LA31_0 =3D=3D 62):=0D LA31 =3D self.input.LA(2)=0D if LA31 =3D=3D 63:=0D LA31_30 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 58:=0D LA31_31 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 66:=0D LA31_32 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 59:=0D LA31_33 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 60:=0D LA31_34 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D IDENTIFIER:=0D LA31_35 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 29 or LA31 =3D=3D 30 or LA31 = =3D=3D 31 or LA31 =3D=3D 32 or LA31 =3D=3D 33:=0D LA31_37 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 34:=0D LA31_38 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 35:=0D LA31_39 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 36:=0D LA31_40 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 37:=0D LA31_41 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 38:=0D LA31_42 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 39:=0D LA31_43 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 40:=0D LA31_44 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 41:=0D LA31_45 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 42:=0D LA31_46 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 45 or LA31 =3D=3D 46:=0D LA31_47 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 48:=0D LA31_48 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 49 or LA31 =3D=3D 50 or LA31 = =3D=3D 51 or LA31 =3D=3D 52 or LA31 =3D=3D 53 or LA31 =3D=3D 54 or LA31 =3D= =3D 55 or LA31 =3D=3D 56 or LA31 =3D=3D 57 or LA31 =3D=3D 61:=0D LA31_49 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D -=0D - elif (LA31_0 =3D=3D 64) :=0D + elif (LA31_0 =3D=3D 64):=0D LA31 =3D self.input.LA(2)=0D if LA31 =3D=3D 65:=0D LA31_51 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 62:=0D LA31_52 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D IDENTIFIER:=0D LA31_53 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D HEX_LITERAL:=0D LA31_54 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D OCTAL_LITERAL:=0D LA31_55 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D DECIMAL_LITERAL:=0D LA31_56 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D CHARACTER_LITERAL:=0D LA31_57 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D STRING_LITERAL:=0D LA31_58 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D FLOATING_POINT_LITERAL:=0D LA31_59 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 72:=0D LA31_60 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 73:=0D LA31_61 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 66 or LA31 =3D=3D 68 or LA31 = =3D=3D 69 or LA31 =3D=3D 77 or LA31 =3D=3D 78 or LA31 =3D=3D 79:=0D LA31_62 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 74:=0D LA31_63 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt31 =3D=3D 1:=0D # C.g:0:0: declarator_suffix=0D - self.following.append(self.FOLLOW_declarator_s= uffix_in_direct_declarator821)=0D + self.following.append(=0D + self.FOLLOW_declarator_suffix_in_direct_de= clarator821)=0D self.declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop31=0D -=0D -=0D -=0D + break # loop31=0D =0D elif alt34 =3D=3D 2:=0D # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declar= ator_suffix )+=0D - self.match(self.input, 62, self.FOLLOW_62_in_direct_de= clarator827)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_direct_declarator827)=0D if self.failed:=0D return=0D # C.g:304:8: ( 'EFIAPI' )?=0D alt32 =3D 2=0D LA32_0 =3D self.input.LA(1)=0D =0D - if (LA32_0 =3D=3D 58) :=0D + if (LA32_0 =3D=3D 58):=0D LA32_1 =3D self.input.LA(2)=0D =0D - if (self.synpred69()) :=0D + if (self.synpred69()):=0D alt32 =3D 1=0D if alt32 =3D=3D 1:=0D # C.g:304:9: 'EFIAPI'=0D - self.match(self.input, 58, self.FOLLOW_58_in_direc= t_declarator830)=0D + self.match(self.input, 58,=0D + self.FOLLOW_58_in_direct_declarator830)= =0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_declarator_in_direct= _declarator834)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_direct_declarator834)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_direct_de= clarator836)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_direct_declarator836)=0D if self.failed:=0D return=0D # C.g:304:35: ( declarator_suffix )+=0D cnt33 =3D 0=0D - while True: #loop33=0D + while True: # loop33=0D alt33 =3D 2=0D LA33_0 =3D self.input.LA(1)=0D =0D - if (LA33_0 =3D=3D 62) :=0D + if (LA33_0 =3D=3D 62):=0D LA33 =3D self.input.LA(2)=0D if LA33 =3D=3D 63:=0D LA33_30 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 58:=0D LA33_31 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 66:=0D LA33_32 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 59:=0D LA33_33 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 60:=0D LA33_34 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D IDENTIFIER:=0D LA33_35 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 29 or LA33 =3D=3D 30 or LA33 = =3D=3D 31 or LA33 =3D=3D 32 or LA33 =3D=3D 33:=0D LA33_37 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 34:=0D LA33_38 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 35:=0D LA33_39 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 36:=0D LA33_40 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 37:=0D LA33_41 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 38:=0D LA33_42 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 39:=0D LA33_43 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 40:=0D LA33_44 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 41:=0D LA33_45 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 42:=0D LA33_46 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 45 or LA33 =3D=3D 46:=0D LA33_47 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 48:=0D LA33_48 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 49 or LA33 =3D=3D 50 or LA33 = =3D=3D 51 or LA33 =3D=3D 52 or LA33 =3D=3D 53 or LA33 =3D=3D 54 or LA33 =3D= =3D 55 or LA33 =3D=3D 56 or LA33 =3D=3D 57 or LA33 =3D=3D 61:=0D LA33_49 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D -=0D - elif (LA33_0 =3D=3D 64) :=0D + elif (LA33_0 =3D=3D 64):=0D LA33 =3D self.input.LA(2)=0D if LA33 =3D=3D 65:=0D LA33_51 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 62:=0D LA33_52 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D IDENTIFIER:=0D LA33_53 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D HEX_LITERAL:=0D LA33_54 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D OCTAL_LITERAL:=0D LA33_55 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D DECIMAL_LITERAL:=0D LA33_56 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D CHARACTER_LITERAL:=0D LA33_57 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D STRING_LITERAL:=0D LA33_58 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D FLOATING_POINT_LITERAL:=0D LA33_59 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 72:=0D LA33_60 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 73:=0D LA33_61 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 66 or LA33 =3D=3D 68 or LA33 = =3D=3D 69 or LA33 =3D=3D 77 or LA33 =3D=3D 78 or LA33 =3D=3D 79:=0D LA33_62 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 74:=0D LA33_63 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt33 =3D=3D 1:=0D # C.g:0:0: declarator_suffix=0D - self.following.append(self.FOLLOW_declarator_s= uffix_in_direct_declarator838)=0D + self.following.append(=0D + self.FOLLOW_declarator_suffix_in_direct_de= clarator838)=0D self.declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt33 >=3D 1:=0D - break #loop33=0D + break # loop33=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -3048,10 +2921,6 @@ class CParser(Parser): =0D cnt33 +=3D 1=0D =0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3065,9 +2934,9 @@ class CParser(Parser): =0D # $ANTLR end direct_declarator=0D =0D -=0D # $ANTLR start declarator_suffix=0D # C.g:307:1: declarator_suffix : ( '[' constant_expression ']' | '[' '= ]' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );=0D +=0D def declarator_suffix(self, ):=0D =0D declarator_suffix_StartIndex =3D self.input.index()=0D @@ -3080,23 +2949,24 @@ class CParser(Parser): alt35 =3D 5=0D LA35_0 =3D self.input.LA(1)=0D =0D - if (LA35_0 =3D=3D 64) :=0D + if (LA35_0 =3D=3D 64):=0D LA35_1 =3D self.input.LA(2)=0D =0D - if (LA35_1 =3D=3D 65) :=0D + if (LA35_1 =3D=3D 65):=0D alt35 =3D 2=0D - elif ((IDENTIFIER <=3D LA35_1 <=3D FLOATING_POINT_LITE= RAL) or LA35_1 =3D=3D 62 or LA35_1 =3D=3D 66 or (68 <=3D LA35_1 <=3D 69) or= (72 <=3D LA35_1 <=3D 74) or (77 <=3D LA35_1 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA35_1 <=3D FLOATING_POINT_LITE= RAL) or LA35_1 =3D=3D 62 or LA35_1 =3D=3D 66 or (68 <=3D LA35_1 <=3D 69) or= (72 <=3D LA35_1 <=3D 74) or (77 <=3D LA35_1 <=3D 79)):=0D alt35 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_exp= ression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list '= )' | '(' ')' );", 35, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA35_0 =3D=3D 62) :=0D + elif (LA35_0 =3D=3D 62):=0D LA35 =3D self.input.LA(2)=0D if LA35 =3D=3D 63:=0D alt35 =3D 5=0D @@ -3105,16 +2975,17 @@ class CParser(Parser): elif LA35 =3D=3D IDENTIFIER:=0D LA35_29 =3D self.input.LA(3)=0D =0D - if (self.synpred73()) :=0D + if (self.synpred73()):=0D alt35 =3D 3=0D - elif (self.synpred74()) :=0D + elif (self.synpred74()):=0D alt35 =3D 4=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarat= or_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_li= st ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant= _expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_li= st ')' | '(' ')' );", 35, 29, self.input)=0D =0D raise nvae=0D =0D @@ -3123,7 +2994,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_exp= ression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list '= )' | '(' ')' );", 35, 2, self.input)=0D =0D raise nvae=0D =0D @@ -3132,76 +3004,84 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_suffi= x : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' |= '(' identifier_list ')' | '(' ')' );", 35, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_express= ion ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' |= '(' ')' );", 35, 0, self.input)=0D =0D raise nvae=0D =0D if alt35 =3D=3D 1:=0D # C.g:308:6: '[' constant_expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix852)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_declarator_suffix852)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_declarator_suffix854)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_declarator_suff= ix854)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix856)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_declarator_suffix856)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 2:=0D # C.g:309:9: '[' ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix866)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_declarator_suffix866)=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix868)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_declarator_suffix868)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 3:=0D # C.g:310:9: '(' parameter_type_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix878)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix878)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_type_list_= in_declarator_suffix880)=0D + self.following.append(=0D + self.FOLLOW_parameter_type_list_in_declarator_suff= ix880)=0D self.parameter_type_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix882)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix882)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 4:=0D # C.g:311:9: '(' identifier_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix892)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix892)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_identifier_list_in_d= eclarator_suffix894)=0D + self.following.append(=0D + self.FOLLOW_identifier_list_in_declarator_suffix89= 4)=0D self.identifier_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix896)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix896)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 5:=0D # C.g:312:9: '(' ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix906)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix906)=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix908)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix908)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3215,9 +3095,9 @@ class CParser(Parser): =0D # $ANTLR end declarator_suffix=0D =0D -=0D # $ANTLR start pointer=0D # C.g:315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' po= inter | '*' );=0D +=0D def pointer(self, ):=0D =0D pointer_StartIndex =3D self.input.index()=0D @@ -3230,69 +3110,73 @@ class CParser(Parser): alt38 =3D 3=0D LA38_0 =3D self.input.LA(1)=0D =0D - if (LA38_0 =3D=3D 66) :=0D + if (LA38_0 =3D=3D 66):=0D LA38 =3D self.input.LA(2)=0D if LA38 =3D=3D 66:=0D LA38_2 =3D self.input.LA(3)=0D =0D - if (self.synpred78()) :=0D + if (self.synpred78()):=0D alt38 =3D 2=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 2, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 58:=0D LA38_3 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 3, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 59:=0D LA38_4 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 4, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 60:=0D LA38_5 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 5, self.input)=0D =0D raise nvae=0D =0D @@ -3301,32 +3185,34 @@ class CParser(Parser): elif LA38 =3D=3D 53:=0D LA38_21 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, s= elf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 21, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 49 or LA38 =3D=3D 50 or LA38 =3D=3D 5= 1 or LA38 =3D=3D 52 or LA38 =3D=3D 54 or LA38 =3D=3D 55 or LA38 =3D=3D 56 o= r LA38 =3D=3D 57 or LA38 =3D=3D 61:=0D LA38_29 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, s= elf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 29, self.input)=0D =0D raise nvae=0D =0D @@ -3335,7 +3221,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer : ( = '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.i= nput)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )+ ( = pointer )? | '*' pointer | '*' );", 38, 1, self.input)=0D =0D raise nvae=0D =0D @@ -3344,7 +3231,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer : ( '*' = ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input= )=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )+ ( poin= ter )? | '*' pointer | '*' );", 38, 0, self.input)=0D =0D raise nvae=0D =0D @@ -3355,57 +3243,51 @@ class CParser(Parser): return=0D # C.g:316:8: ( type_qualifier )+=0D cnt36 =3D 0=0D - while True: #loop36=0D + while True: # loop36=0D alt36 =3D 2=0D LA36 =3D self.input.LA(1)=0D if LA36 =3D=3D 58:=0D LA36_2 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 59:=0D LA36_3 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 60:=0D LA36_4 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 53:=0D LA36_20 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 49 or LA36 =3D=3D 50 or LA36 =3D= =3D 51 or LA36 =3D=3D 52 or LA36 =3D=3D 54 or LA36 =3D=3D 55 or LA36 =3D=3D= 56 or LA36 =3D=3D 57 or LA36 =3D=3D 61:=0D LA36_28 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D -=0D if alt36 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifi= er_in_pointer921)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_pointer921)= =0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt36 >=3D 1:=0D - break #loop36=0D + break # loop36=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -3416,28 +3298,24 @@ class CParser(Parser): =0D cnt36 +=3D 1=0D =0D -=0D # C.g:316:24: ( pointer )?=0D alt37 =3D 2=0D LA37_0 =3D self.input.LA(1)=0D =0D - if (LA37_0 =3D=3D 66) :=0D + if (LA37_0 =3D=3D 66):=0D LA37_1 =3D self.input.LA(2)=0D =0D - if (self.synpred76()) :=0D + if (self.synpred76()):=0D alt37 =3D 1=0D if alt37 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_point= er924)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_pointer924)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt38 =3D=3D 2:=0D # C.g:317:4: '*' pointer=0D self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 0)=0D @@ -3449,15 +3327,12 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D elif alt38 =3D=3D 3:=0D # C.g:318:4: '*'=0D self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 7)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3471,9 +3346,9 @@ class CParser(Parser): =0D # $ANTLR end pointer=0D =0D -=0D # $ANTLR start parameter_type_list=0D # C.g:321:1: parameter_type_list : parameter_list ( ',' ( 'OPTIONAL' )= ? '...' )? ;=0D +=0D def parameter_type_list(self, ):=0D =0D parameter_type_list_StartIndex =3D self.input.index()=0D @@ -3484,7 +3359,8 @@ class CParser(Parser): =0D # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' = )? )=0D # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )?= =0D - self.following.append(self.FOLLOW_parameter_list_in_parame= ter_type_list948)=0D + self.following.append(=0D + self.FOLLOW_parameter_list_in_parameter_type_list948)= =0D self.parameter_list()=0D self.following.pop()=0D if self.failed:=0D @@ -3493,37 +3369,32 @@ class CParser(Parser): alt40 =3D 2=0D LA40_0 =3D self.input.LA(1)=0D =0D - if (LA40_0 =3D=3D 27) :=0D + if (LA40_0 =3D=3D 27):=0D alt40 =3D 1=0D if alt40 =3D=3D 1:=0D # C.g:322:20: ',' ( 'OPTIONAL' )? '...'=0D - self.match(self.input, 27, self.FOLLOW_27_in_parameter= _type_list951)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_parameter_type_list951)=0D if self.failed:=0D return=0D # C.g:322:24: ( 'OPTIONAL' )?=0D alt39 =3D 2=0D LA39_0 =3D self.input.LA(1)=0D =0D - if (LA39_0 =3D=3D 53) :=0D + if (LA39_0 =3D=3D 53):=0D alt39 =3D 1=0D if alt39 =3D=3D 1:=0D # C.g:322:25: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_param= eter_type_list954)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_type_list95= 4)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 67, self.FOLLOW_67_in_parameter= _type_list958)=0D + self.match(self.input, 67,=0D + self.FOLLOW_67_in_parameter_type_list958)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3537,9 +3408,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_type_list=0D =0D -=0D # $ANTLR start parameter_list=0D # C.g:325:1: parameter_list : parameter_declaration ( ',' ( 'OPTIONAL'= )? parameter_declaration )* ;=0D +=0D def parameter_list(self, ):=0D =0D parameter_list_StartIndex =3D self.input.index()=0D @@ -3550,68 +3421,60 @@ class CParser(Parser): =0D # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )?= parameter_declaration )* )=0D # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? p= arameter_declaration )*=0D - self.following.append(self.FOLLOW_parameter_declaration_in= _parameter_list971)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_parameter_list971= )=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration = )*=0D - while True: #loop42=0D + while True: # loop42=0D alt42 =3D 2=0D LA42_0 =3D self.input.LA(1)=0D =0D - if (LA42_0 =3D=3D 27) :=0D + if (LA42_0 =3D=3D 27):=0D LA42_1 =3D self.input.LA(2)=0D =0D - if (LA42_1 =3D=3D 53) :=0D + if (LA42_1 =3D=3D 53):=0D LA42_3 =3D self.input.LA(3)=0D =0D - if (self.synpred82()) :=0D + if (self.synpred82()):=0D alt42 =3D 1=0D =0D -=0D - elif (LA42_1 =3D=3D IDENTIFIER or (29 <=3D LA42_1 = <=3D 42) or (45 <=3D LA42_1 <=3D 46) or (48 <=3D LA42_1 <=3D 52) or (54 <= =3D LA42_1 <=3D 61) or LA42_1 =3D=3D 66) :=0D + elif (LA42_1 =3D=3D IDENTIFIER or (29 <=3D LA42_1 = <=3D 42) or (45 <=3D LA42_1 <=3D 46) or (48 <=3D LA42_1 <=3D 52) or (54 <= =3D LA42_1 <=3D 61) or LA42_1 =3D=3D 66):=0D alt42 =3D 1=0D =0D -=0D -=0D -=0D if alt42 =3D=3D 1:=0D # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declar= ation=0D - self.match(self.input, 27, self.FOLLOW_27_in_param= eter_list974)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_parameter_list974)=0D if self.failed:=0D return=0D # C.g:326:31: ( 'OPTIONAL' )?=0D alt41 =3D 2=0D LA41_0 =3D self.input.LA(1)=0D =0D - if (LA41_0 =3D=3D 53) :=0D + if (LA41_0 =3D=3D 53):=0D LA41_1 =3D self.input.LA(2)=0D =0D - if (self.synpred81()) :=0D + if (self.synpred81()):=0D alt41 =3D 1=0D if alt41 =3D=3D 1:=0D # C.g:326:32: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_p= arameter_list977)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_list977= )=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_parameter_declar= ation_in_parameter_list981)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_parameter= _list981)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop42=0D -=0D -=0D -=0D -=0D -=0D + break # loop42=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -3626,9 +3489,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_list=0D =0D -=0D # $ANTLR start parameter_declaration=0D # C.g:329:1: parameter_declaration : ( declaration_specifiers ( declar= ator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );= =0D +=0D def parameter_declaration(self, ):=0D =0D parameter_declaration_StartIndex =3D self.input.index()=0D @@ -3645,16 +3508,17 @@ class CParser(Parser): elif LA46 =3D=3D IDENTIFIER:=0D LA46_13 =3D self.input.LA(2)=0D =0D - if (self.synpred86()) :=0D + if (self.synpred86()):=0D alt46 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt46 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("329:1: parameter_de= claration : ( declaration_specifiers ( declarator | abstract_declarator )* = ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input)=0D + nvae =3D NoViableAltException(=0D + "329:1: parameter_declaration : ( declaration_= specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointe= r )* IDENTIFIER );", 46, 13, self.input)=0D =0D raise nvae=0D =0D @@ -3665,30 +3529,31 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("329:1: parameter_declar= ation : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'O= PTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "329:1: parameter_declaration : ( declaration_spec= ifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )*= IDENTIFIER );", 46, 0, self.input)=0D =0D raise nvae=0D =0D if alt46 =3D=3D 1:=0D # C.g:330:4: declaration_specifiers ( declarator | abs= tract_declarator )* ( 'OPTIONAL' )?=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_parameter_declaration994)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_parameter_de= claration994)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:330:27: ( declarator | abstract_declarator )*=0D - while True: #loop43=0D + while True: # loop43=0D alt43 =3D 3=0D LA43 =3D self.input.LA(1)=0D if LA43 =3D=3D 66:=0D LA43_5 =3D self.input.LA(2)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D IDENTIFIER or LA43 =3D=3D 58 or L= A43 =3D=3D 59 or LA43 =3D=3D 60:=0D alt43 =3D 1=0D elif LA43 =3D=3D 62:=0D @@ -3698,129 +3563,115 @@ class CParser(Parser): elif LA43 =3D=3D IDENTIFIER:=0D LA43_37 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 58:=0D LA43_38 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 66:=0D LA43_39 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 59:=0D LA43_40 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 60:=0D LA43_41 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 62:=0D LA43_43 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D -=0D elif LA43 =3D=3D 64:=0D alt43 =3D 2=0D =0D if alt43 =3D=3D 1:=0D # C.g:330:28: declarator=0D - self.following.append(self.FOLLOW_declarator_i= n_parameter_declaration997)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_parameter_declar= ation997)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt43 =3D=3D 2:=0D # C.g:330:39: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_dec= larator_in_parameter_declaration999)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_paramet= er_declaration999)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop43=0D -=0D + break # loop43=0D =0D # C.g:330:61: ( 'OPTIONAL' )?=0D alt44 =3D 2=0D LA44_0 =3D self.input.LA(1)=0D =0D - if (LA44_0 =3D=3D 53) :=0D + if (LA44_0 =3D=3D 53):=0D alt44 =3D 1=0D if alt44 =3D=3D 1:=0D # C.g:330:62: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_param= eter_declaration1004)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_declaration= 1004)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt46 =3D=3D 2:=0D # C.g:332:4: ( pointer )* IDENTIFIER=0D # C.g:332:4: ( pointer )*=0D - while True: #loop45=0D + while True: # loop45=0D alt45 =3D 2=0D LA45_0 =3D self.input.LA(1)=0D =0D - if (LA45_0 =3D=3D 66) :=0D + if (LA45_0 =3D=3D 66):=0D alt45 =3D 1=0D =0D -=0D if alt45 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_p= arameter_declaration1013)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_parameter_declarati= on1013)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop45=0D + break # loop45=0D =0D -=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_parameter_declaration1016)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_parameter_declara= tion1016)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3834,9 +3685,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_declaration=0D =0D -=0D # $ANTLR start identifier_list=0D # C.g:335:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;=0D +=0D def identifier_list(self, ):=0D =0D identifier_list_StartIndex =3D self.input.index()=0D @@ -3847,35 +3698,31 @@ class CParser(Parser): =0D # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* )=0D # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )*=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_identifier_list1027)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_identifier_list1027)= =0D if self.failed:=0D return=0D # C.g:337:2: ( ',' IDENTIFIER )*=0D - while True: #loop47=0D + while True: # loop47=0D alt47 =3D 2=0D LA47_0 =3D self.input.LA(1)=0D =0D - if (LA47_0 =3D=3D 27) :=0D + if (LA47_0 =3D=3D 27):=0D alt47 =3D 1=0D =0D -=0D if alt47 =3D=3D 1:=0D # C.g:337:3: ',' IDENTIFIER=0D - self.match(self.input, 27, self.FOLLOW_27_in_ident= ifier_list1031)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_identifier_list1031)= =0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_identifier_list1033)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_identifier_li= st1033)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop47=0D -=0D -=0D -=0D -=0D -=0D + break # loop47=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -3890,9 +3737,9 @@ class CParser(Parser): =0D # $ANTLR end identifier_list=0D =0D -=0D # $ANTLR start type_name=0D # C.g:340:1: type_name : ( specifier_qualifier_list ( abstract_declara= tor )? | type_id );=0D +=0D def type_name(self, ):=0D =0D type_name_StartIndex =3D self.input.index()=0D @@ -3905,21 +3752,22 @@ class CParser(Parser): alt49 =3D 2=0D LA49_0 =3D self.input.LA(1)=0D =0D - if ((34 <=3D LA49_0 <=3D 42) or (45 <=3D LA49_0 <=3D 46) o= r (48 <=3D LA49_0 <=3D 61)) :=0D + if ((34 <=3D LA49_0 <=3D 42) or (45 <=3D LA49_0 <=3D 46) o= r (48 <=3D LA49_0 <=3D 61)):=0D alt49 =3D 1=0D - elif (LA49_0 =3D=3D IDENTIFIER) :=0D + elif (LA49_0 =3D=3D IDENTIFIER):=0D LA49_13 =3D self.input.LA(2)=0D =0D - if (self.synpred90()) :=0D + if (self.synpred90()):=0D alt49 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt49 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("340:1: type_name : = ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, = self.input)=0D + nvae =3D NoViableAltException(=0D + "340:1: type_name : ( specifier_qualifier_list= ( abstract_declarator )? | type_id );", 49, 13, self.input)=0D =0D raise nvae=0D =0D @@ -3928,13 +3776,15 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("340:1: type_name : ( sp= ecifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.= input)=0D + nvae =3D NoViableAltException(=0D + "340:1: type_name : ( specifier_qualifier_list ( a= bstract_declarator )? | type_id );", 49, 0, self.input)=0D =0D raise nvae=0D =0D if alt49 =3D=3D 1:=0D # C.g:341:4: specifier_qualifier_list ( abstract_decla= rator )?=0D - self.following.append(self.FOLLOW_specifier_qualifier_= list_in_type_name1046)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_type_name1= 046)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D @@ -3943,20 +3793,17 @@ class CParser(Parser): alt48 =3D 2=0D LA48_0 =3D self.input.LA(1)=0D =0D - if (LA48_0 =3D=3D 62 or LA48_0 =3D=3D 64 or LA48_0 =3D= =3D 66) :=0D + if (LA48_0 =3D=3D 62 or LA48_0 =3D=3D 64 or LA48_0 =3D= =3D 66):=0D alt48 =3D 1=0D if alt48 =3D=3D 1:=0D # C.g:0:0: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declara= tor_in_type_name1048)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_type_name10= 48)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt49 =3D=3D 2:=0D # C.g:342:4: type_id=0D self.following.append(self.FOLLOW_type_id_in_type_name= 1054)=0D @@ -3965,8 +3812,6 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3980,9 +3825,9 @@ class CParser(Parser): =0D # $ANTLR end type_name=0D =0D -=0D # $ANTLR start abstract_declarator=0D # C.g:345:1: abstract_declarator : ( pointer ( direct_abstract_declara= tor )? | direct_abstract_declarator );=0D +=0D def abstract_declarator(self, ):=0D =0D abstract_declarator_StartIndex =3D self.input.index()=0D @@ -3995,22 +3840,24 @@ class CParser(Parser): alt51 =3D 2=0D LA51_0 =3D self.input.LA(1)=0D =0D - if (LA51_0 =3D=3D 66) :=0D + if (LA51_0 =3D=3D 66):=0D alt51 =3D 1=0D - elif (LA51_0 =3D=3D 62 or LA51_0 =3D=3D 64) :=0D + elif (LA51_0 =3D=3D 62 or LA51_0 =3D=3D 64):=0D alt51 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("345:1: abstract_declara= tor : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarato= r );", 51, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "345:1: abstract_declarator : ( pointer ( direct_a= bstract_declarator )? | direct_abstract_declarator );", 51, 0, self.input)= =0D =0D raise nvae=0D =0D if alt51 =3D=3D 1:=0D # C.g:346:4: pointer ( direct_abstract_declarator )?=0D - self.following.append(self.FOLLOW_pointer_in_abstract_= declarator1065)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_abstract_declarator1065)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D @@ -4019,202 +3866,198 @@ class CParser(Parser): alt50 =3D 2=0D LA50_0 =3D self.input.LA(1)=0D =0D - if (LA50_0 =3D=3D 62) :=0D + if (LA50_0 =3D=3D 62):=0D LA50 =3D self.input.LA(2)=0D if LA50 =3D=3D 63:=0D LA50_12 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 58:=0D LA50_13 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 66:=0D LA50_14 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 59:=0D LA50_15 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 60:=0D LA50_16 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D IDENTIFIER:=0D LA50_17 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 62:=0D LA50_18 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 64:=0D LA50_19 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 29 or LA50 =3D=3D 30 or LA50 =3D= =3D 31 or LA50 =3D=3D 32 or LA50 =3D=3D 33:=0D LA50_20 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 34:=0D LA50_21 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 35:=0D LA50_22 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 36:=0D LA50_23 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 37:=0D LA50_24 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 38:=0D LA50_25 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 39:=0D LA50_26 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 40:=0D LA50_27 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 41:=0D LA50_28 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 42:=0D LA50_29 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 45 or LA50 =3D=3D 46:=0D LA50_30 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 48:=0D LA50_31 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 49 or LA50 =3D=3D 50 or LA50 =3D= =3D 51 or LA50 =3D=3D 52 or LA50 =3D=3D 53 or LA50 =3D=3D 54 or LA50 =3D=3D= 55 or LA50 =3D=3D 56 or LA50 =3D=3D 57 or LA50 =3D=3D 61:=0D LA50_32 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D - elif (LA50_0 =3D=3D 64) :=0D + elif (LA50_0 =3D=3D 64):=0D LA50 =3D self.input.LA(2)=0D if LA50 =3D=3D 65:=0D LA50_33 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 62:=0D LA50_34 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D IDENTIFIER:=0D LA50_35 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D HEX_LITERAL:=0D LA50_36 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D OCTAL_LITERAL:=0D LA50_37 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D DECIMAL_LITERAL:=0D LA50_38 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D CHARACTER_LITERAL:=0D LA50_39 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D STRING_LITERAL:=0D LA50_40 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D FLOATING_POINT_LITERAL:=0D LA50_41 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 72:=0D LA50_42 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 73:=0D LA50_43 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 66 or LA50 =3D=3D 68 or LA50 =3D= =3D 69 or LA50 =3D=3D 77 or LA50 =3D=3D 78 or LA50 =3D=3D 79:=0D LA50_44 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 74:=0D LA50_45 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D if alt50 =3D=3D 1:=0D # C.g:0:0: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_= declarator_in_abstract_declarator1067)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_abst= ract_declarator1067)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt51 =3D=3D 2:=0D # C.g:347:4: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_decl= arator_in_abstract_declarator1073)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_abstract= _declarator1073)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -4228,9 +4071,9 @@ class CParser(Parser): =0D # $ANTLR end abstract_declarator=0D =0D -=0D # $ANTLR start direct_abstract_declarator=0D # C.g:350:1: direct_abstract_declarator : ( '(' abstract_declarator ')= ' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;=0D +=0D def direct_abstract_declarator(self, ):=0D =0D direct_abstract_declarator_StartIndex =3D self.input.index()=0D @@ -4245,23 +4088,24 @@ class CParser(Parser): alt52 =3D 2=0D LA52_0 =3D self.input.LA(1)=0D =0D - if (LA52_0 =3D=3D 62) :=0D + if (LA52_0 =3D=3D 62):=0D LA52 =3D self.input.LA(2)=0D if LA52 =3D=3D IDENTIFIER or LA52 =3D=3D 29 or LA52 = =3D=3D 30 or LA52 =3D=3D 31 or LA52 =3D=3D 32 or LA52 =3D=3D 33 or LA52 =3D= =3D 34 or LA52 =3D=3D 35 or LA52 =3D=3D 36 or LA52 =3D=3D 37 or LA52 =3D=3D= 38 or LA52 =3D=3D 39 or LA52 =3D=3D 40 or LA52 =3D=3D 41 or LA52 =3D=3D 42= or LA52 =3D=3D 45 or LA52 =3D=3D 46 or LA52 =3D=3D 48 or LA52 =3D=3D 49 or= LA52 =3D=3D 50 or LA52 =3D=3D 51 or LA52 =3D=3D 52 or LA52 =3D=3D 53 or LA= 52 =3D=3D 54 or LA52 =3D=3D 55 or LA52 =3D=3D 56 or LA52 =3D=3D 57 or LA52 = =3D=3D 58 or LA52 =3D=3D 59 or LA52 =3D=3D 60 or LA52 =3D=3D 61 or LA52 =3D= =3D 63:=0D alt52 =3D 2=0D elif LA52 =3D=3D 66:=0D LA52_18 =3D self.input.LA(3)=0D =0D - if (self.synpred93()) :=0D + if (self.synpred93()):=0D alt52 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt52 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' ab= stract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input)= =0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | ab= stract_declarator_suffix )", 52, 18, self.input)=0D =0D raise nvae=0D =0D @@ -4272,306 +4116,269 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' abstra= ct_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | abstra= ct_declarator_suffix )", 52, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA52_0 =3D=3D 64) :=0D + elif (LA52_0 =3D=3D 64):=0D alt52 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' abstract_d= eclarator ')' | abstract_declarator_suffix )", 52, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | abstract_d= eclarator_suffix )", 52, 0, self.input)=0D =0D raise nvae=0D =0D if alt52 =3D=3D 1:=0D # C.g:351:6: '(' abstract_declarator ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_direct_ab= stract_declarator1086)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_direct_abstract_= declarator1086)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_abstract_declarator_= in_direct_abstract_declarator1088)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_direct_abstract= _declarator1088)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_direct_ab= stract_declarator1090)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_direct_abstract_= declarator1090)=0D if self.failed:=0D return=0D =0D -=0D elif alt52 =3D=3D 2:=0D # C.g:351:36: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declarator_= suffix_in_direct_abstract_declarator1094)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_direct_a= bstract_declarator1094)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:351:65: ( abstract_declarator_suffix )*=0D - while True: #loop53=0D + while True: # loop53=0D alt53 =3D 2=0D LA53_0 =3D self.input.LA(1)=0D =0D - if (LA53_0 =3D=3D 62) :=0D + if (LA53_0 =3D=3D 62):=0D LA53 =3D self.input.LA(2)=0D if LA53 =3D=3D 63:=0D LA53_12 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 58:=0D LA53_13 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 66:=0D LA53_14 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 59:=0D LA53_15 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 60:=0D LA53_16 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D IDENTIFIER:=0D LA53_17 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 29 or LA53 =3D=3D 30 or LA53 =3D= =3D 31 or LA53 =3D=3D 32 or LA53 =3D=3D 33:=0D LA53_19 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 34:=0D LA53_20 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 35:=0D LA53_21 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 36:=0D LA53_22 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 37:=0D LA53_23 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 38:=0D LA53_24 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 39:=0D LA53_25 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 40:=0D LA53_26 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 41:=0D LA53_27 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 42:=0D LA53_28 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 45 or LA53 =3D=3D 46:=0D LA53_29 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 48:=0D LA53_30 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 49 or LA53 =3D=3D 50 or LA53 =3D= =3D 51 or LA53 =3D=3D 52 or LA53 =3D=3D 53 or LA53 =3D=3D 54 or LA53 =3D=3D= 55 or LA53 =3D=3D 56 or LA53 =3D=3D 57 or LA53 =3D=3D 61:=0D LA53_31 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D -=0D - elif (LA53_0 =3D=3D 64) :=0D + elif (LA53_0 =3D=3D 64):=0D LA53 =3D self.input.LA(2)=0D if LA53 =3D=3D 65:=0D LA53_33 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 62:=0D LA53_34 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D IDENTIFIER:=0D LA53_35 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D HEX_LITERAL:=0D LA53_36 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D OCTAL_LITERAL:=0D LA53_37 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D DECIMAL_LITERAL:=0D LA53_38 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D CHARACTER_LITERAL:=0D LA53_39 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D STRING_LITERAL:=0D LA53_40 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D FLOATING_POINT_LITERAL:=0D LA53_41 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 72:=0D LA53_42 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 73:=0D LA53_43 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 66 or LA53 =3D=3D 68 or LA53 =3D= =3D 69 or LA53 =3D=3D 77 or LA53 =3D=3D 78 or LA53 =3D=3D 79:=0D LA53_44 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 74:=0D LA53_45 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt53 =3D=3D 1:=0D # C.g:0:0: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declara= tor_suffix_in_direct_abstract_declarator1098)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_dire= ct_abstract_declarator1098)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop53=0D -=0D -=0D -=0D -=0D -=0D + break # loop53=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 32, direct_abstract_declarator_St= artIndex)=0D + self.memoize(self.input, 32,=0D + direct_abstract_declarator_StartIndex)=0D =0D pass=0D =0D @@ -4579,9 +4386,9 @@ class CParser(Parser): =0D # $ANTLR end direct_abstract_declarator=0D =0D -=0D # $ANTLR start abstract_declarator_suffix=0D # C.g:354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_exp= ression ']' | '(' ')' | '(' parameter_type_list ')' );=0D +=0D def abstract_declarator_suffix(self, ):=0D =0D abstract_declarator_suffix_StartIndex =3D self.input.index()=0D @@ -4594,35 +4401,37 @@ class CParser(Parser): alt54 =3D 4=0D LA54_0 =3D self.input.LA(1)=0D =0D - if (LA54_0 =3D=3D 64) :=0D + if (LA54_0 =3D=3D 64):=0D LA54_1 =3D self.input.LA(2)=0D =0D - if (LA54_1 =3D=3D 65) :=0D + if (LA54_1 =3D=3D 65):=0D alt54 =3D 1=0D - elif ((IDENTIFIER <=3D LA54_1 <=3D FLOATING_POINT_LITE= RAL) or LA54_1 =3D=3D 62 or LA54_1 =3D=3D 66 or (68 <=3D LA54_1 <=3D 69) or= (72 <=3D LA54_1 <=3D 74) or (77 <=3D LA54_1 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA54_1 <=3D FLOATING_POINT_LITE= RAL) or LA54_1 =3D=3D 62 or LA54_1 =3D=3D 66 or (68 <=3D LA54_1 <=3D 69) or= (72 <=3D LA54_1 <=3D 74) or (77 <=3D LA54_1 <=3D 79)):=0D alt54 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']'= | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );",= 54, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA54_0 =3D=3D 62) :=0D + elif (LA54_0 =3D=3D 62):=0D LA54_2 =3D self.input.LA(2)=0D =0D - if (LA54_2 =3D=3D 63) :=0D + if (LA54_2 =3D=3D 63):=0D alt54 =3D 3=0D - elif (LA54_2 =3D=3D IDENTIFIER or (29 <=3D LA54_2 <=3D= 42) or (45 <=3D LA54_2 <=3D 46) or (48 <=3D LA54_2 <=3D 61) or LA54_2 =3D= =3D 66) :=0D + elif (LA54_2 =3D=3D IDENTIFIER or (29 <=3D LA54_2 <=3D= 42) or (45 <=3D LA54_2 <=3D 46) or (48 <=3D LA54_2 <=3D 61) or LA54_2 =3D= =3D 66):=0D alt54 =3D 4=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']'= | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );",= 54, 2, self.input)=0D =0D raise nvae=0D =0D @@ -4631,67 +4440,74 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_declara= tor_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parame= ter_type_list ')' );", 54, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']' | '= [' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54,= 0, self.input)=0D =0D raise nvae=0D =0D if alt54 =3D=3D 1:=0D # C.g:355:4: '[' ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1110)=0D + self.match(=0D + self.input, 64, self.FOLLOW_64_in_abstract_declara= tor_suffix1110)=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1112)=0D + self.match(=0D + self.input, 65, self.FOLLOW_65_in_abstract_declara= tor_suffix1112)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 2:=0D # C.g:356:4: '[' constant_expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1117)=0D + self.match(=0D + self.input, 64, self.FOLLOW_64_in_abstract_declara= tor_suffix1117)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_abstract_declarator_suffix1119)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_abstract_declar= ator_suffix1119)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1121)=0D + self.match(=0D + self.input, 65, self.FOLLOW_65_in_abstract_declara= tor_suffix1121)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 3:=0D # C.g:357:4: '(' ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1126)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_abstract_declara= tor_suffix1126)=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1128)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_abstract_declara= tor_suffix1128)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 4:=0D # C.g:358:4: '(' parameter_type_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1133)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_abstract_declara= tor_suffix1133)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_type_list_= in_abstract_declarator_suffix1135)=0D + self.following.append(=0D + self.FOLLOW_parameter_type_list_in_abstract_declar= ator_suffix1135)=0D self.parameter_type_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1137)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_abstract_declara= tor_suffix1137)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 33, abstract_declarator_suffix_St= artIndex)=0D + self.memoize(self.input, 33,=0D + abstract_declarator_suffix_StartIndex)=0D =0D pass=0D =0D @@ -4699,9 +4515,9 @@ class CParser(Parser): =0D # $ANTLR end abstract_declarator_suffix=0D =0D -=0D # $ANTLR start initializer=0D # C.g:361:1: initializer : ( assignment_expression | '{' initializer_l= ist ( ',' )? '}' );=0D +=0D def initializer(self, ):=0D =0D initializer_StartIndex =3D self.input.index()=0D @@ -4714,34 +4530,37 @@ class CParser(Parser): alt56 =3D 2=0D LA56_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA56_0 <=3D FLOATING_POINT_LITERAL) o= r LA56_0 =3D=3D 62 or LA56_0 =3D=3D 66 or (68 <=3D LA56_0 <=3D 69) or (72 <= =3D LA56_0 <=3D 74) or (77 <=3D LA56_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA56_0 <=3D FLOATING_POINT_LITERAL) o= r LA56_0 =3D=3D 62 or LA56_0 =3D=3D 66 or (68 <=3D LA56_0 <=3D 69) or (72 <= =3D LA56_0 <=3D 74) or (77 <=3D LA56_0 <=3D 79)):=0D alt56 =3D 1=0D - elif (LA56_0 =3D=3D 43) :=0D + elif (LA56_0 =3D=3D 43):=0D alt56 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("361:1: initializer : ( = assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.= input)=0D + nvae =3D NoViableAltException(=0D + "361:1: initializer : ( assignment_expression | '{= ' initializer_list ( ',' )? '}' );", 56, 0, self.input)=0D =0D raise nvae=0D =0D if alt56 =3D=3D 1:=0D # C.g:363:4: assignment_expression=0D - self.following.append(self.FOLLOW_assignment_expressio= n_in_initializer1150)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_initializer11= 50)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt56 =3D=3D 2:=0D # C.g:364:4: '{' initializer_list ( ',' )? '}'=0D - self.match(self.input, 43, self.FOLLOW_43_in_initializ= er1155)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_initializer1155)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_list_in_= initializer1157)=0D + self.following.append(=0D + self.FOLLOW_initializer_list_in_initializer1157)=0D self.initializer_list()=0D self.following.pop()=0D if self.failed:=0D @@ -4750,22 +4569,20 @@ class CParser(Parser): alt55 =3D 2=0D LA55_0 =3D self.input.LA(1)=0D =0D - if (LA55_0 =3D=3D 27) :=0D + if (LA55_0 =3D=3D 27):=0D alt55 =3D 1=0D if alt55 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer1159)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_initializer1159)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_initializ= er1162)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_initializer1162)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -4779,9 +4596,9 @@ class CParser(Parser): =0D # $ANTLR end initializer=0D =0D -=0D # $ANTLR start initializer_list=0D # C.g:367:1: initializer_list : initializer ( ',' initializer )* ;=0D +=0D def initializer_list(self, ):=0D =0D initializer_list_StartIndex =3D self.input.index()=0D @@ -4792,44 +4609,38 @@ class CParser(Parser): =0D # C.g:368:2: ( initializer ( ',' initializer )* )=0D # C.g:368:4: initializer ( ',' initializer )*=0D - self.following.append(self.FOLLOW_initializer_in_initializ= er_list1173)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_initializer_list1173)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:368:16: ( ',' initializer )*=0D - while True: #loop57=0D + while True: # loop57=0D alt57 =3D 2=0D LA57_0 =3D self.input.LA(1)=0D =0D - if (LA57_0 =3D=3D 27) :=0D + if (LA57_0 =3D=3D 27):=0D LA57_1 =3D self.input.LA(2)=0D =0D - if ((IDENTIFIER <=3D LA57_1 <=3D FLOATING_POINT_LI= TERAL) or LA57_1 =3D=3D 43 or LA57_1 =3D=3D 62 or LA57_1 =3D=3D 66 or (68 <= =3D LA57_1 <=3D 69) or (72 <=3D LA57_1 <=3D 74) or (77 <=3D LA57_1 <=3D 79)= ) :=0D + if ((IDENTIFIER <=3D LA57_1 <=3D FLOATING_POINT_LI= TERAL) or LA57_1 =3D=3D 43 or LA57_1 =3D=3D 62 or LA57_1 =3D=3D 66 or (68 <= =3D LA57_1 <=3D 69) or (72 <=3D LA57_1 <=3D 74) or (77 <=3D LA57_1 <=3D 79)= ):=0D alt57 =3D 1=0D =0D -=0D -=0D -=0D if alt57 =3D=3D 1:=0D # C.g:368:17: ',' initializer=0D - self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer_list1176)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_initializer_list1176)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_in_i= nitializer_list1178)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_initializer_list117= 8)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop57=0D -=0D -=0D -=0D -=0D -=0D + break # loop57=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -4849,10 +4660,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start argument_expression_list=0D # C.g:373:1: argument_expression_list : assignment_expression ( 'OPTIO= NAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* ;=0D +=0D def argument_expression_list(self, ):=0D =0D retval =3D self.argument_expression_list_return()=0D @@ -4865,7 +4675,8 @@ class CParser(Parser): =0D # C.g:374:2: ( assignment_expression ( 'OPTIONAL' )? ( ','= assignment_expression ( 'OPTIONAL' )? )* )=0D # C.g:374:6: assignment_expression ( 'OPTIONAL' )? ( ',' a= ssignment_expression ( 'OPTIONAL' )? )*=0D - self.following.append(self.FOLLOW_assignment_expression_in= _argument_expression_list1196)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_argument_expressi= on_list1196)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -4874,31 +4685,31 @@ class CParser(Parser): alt58 =3D 2=0D LA58_0 =3D self.input.LA(1)=0D =0D - if (LA58_0 =3D=3D 53) :=0D + if (LA58_0 =3D=3D 53):=0D alt58 =3D 1=0D if alt58 =3D=3D 1:=0D # C.g:374:29: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_argument_= expression_list1199)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_argument_expression_list1= 199)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:374:42: ( ',' assignment_expression ( 'OPTIONAL' )? = )*=0D - while True: #loop60=0D + while True: # loop60=0D alt60 =3D 2=0D LA60_0 =3D self.input.LA(1)=0D =0D - if (LA60_0 =3D=3D 27) :=0D + if (LA60_0 =3D=3D 27):=0D alt60 =3D 1=0D =0D -=0D if alt60 =3D=3D 1:=0D # C.g:374:43: ',' assignment_expression ( 'OPTIONA= L' )?=0D - self.match(self.input, 27, self.FOLLOW_27_in_argum= ent_expression_list1204)=0D + self.match(=0D + self.input, 27, self.FOLLOW_27_in_argument_exp= ression_list1204)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_assignment_expre= ssion_in_argument_expression_list1206)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_argument_= expression_list1206)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -4907,34 +4718,27 @@ class CParser(Parser): alt59 =3D 2=0D LA59_0 =3D self.input.LA(1)=0D =0D - if (LA59_0 =3D=3D 53) :=0D + if (LA59_0 =3D=3D 53):=0D alt59 =3D 1=0D if alt59 =3D=3D 1:=0D # C.g:374:70: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_a= rgument_expression_list1209)=0D + self.match(=0D + self.input, 53, self.FOLLOW_53_in_argument= _expression_list1209)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D -=0D -=0D else:=0D - break #loop60=0D -=0D -=0D -=0D -=0D + break # loop60=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 36, argument_expression_list_Star= tIndex)=0D + self.memoize(self.input, 36,=0D + argument_expression_list_StartIndex)=0D =0D pass=0D =0D @@ -4942,9 +4746,9 @@ class CParser(Parser): =0D # $ANTLR end argument_expression_list=0D =0D -=0D # $ANTLR start additive_expression=0D # C.g:377:1: additive_expression : ( multiplicative_expression ) ( '+'= multiplicative_expression | '-' multiplicative_expression )* ;=0D +=0D def additive_expression(self, ):=0D =0D additive_expression_StartIndex =3D self.input.index()=0D @@ -4957,56 +4761,51 @@ class CParser(Parser): # C.g:378:4: ( multiplicative_expression ) ( '+' multiplic= ative_expression | '-' multiplicative_expression )*=0D # C.g:378:4: ( multiplicative_expression )=0D # C.g:378:5: multiplicative_expression=0D - self.following.append(self.FOLLOW_multiplicative_expressio= n_in_additive_expression1225)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_additive_expr= ession1225)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:378:32: ( '+' multiplicative_expression | '-' multip= licative_expression )*=0D - while True: #loop61=0D + while True: # loop61=0D alt61 =3D 3=0D LA61_0 =3D self.input.LA(1)=0D =0D - if (LA61_0 =3D=3D 68) :=0D + if (LA61_0 =3D=3D 68):=0D alt61 =3D 1=0D - elif (LA61_0 =3D=3D 69) :=0D + elif (LA61_0 =3D=3D 69):=0D alt61 =3D 2=0D =0D -=0D if alt61 =3D=3D 1:=0D # C.g:378:33: '+' multiplicative_expression=0D - self.match(self.input, 68, self.FOLLOW_68_in_addit= ive_expression1229)=0D + self.match(self.input, 68,=0D + self.FOLLOW_68_in_additive_expression12= 29)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1231)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_addit= ive_expression1231)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt61 =3D=3D 2:=0D # C.g:378:65: '-' multiplicative_expression=0D - self.match(self.input, 69, self.FOLLOW_69_in_addit= ive_expression1235)=0D + self.match(self.input, 69,=0D + self.FOLLOW_69_in_additive_expression12= 35)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1237)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_addit= ive_expression1237)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop61=0D -=0D -=0D -=0D -=0D -=0D + break # loop61=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5021,9 +4820,9 @@ class CParser(Parser): =0D # $ANTLR end additive_expression=0D =0D -=0D # $ANTLR start multiplicative_expression=0D # C.g:381:1: multiplicative_expression : ( cast_expression ) ( '*' cas= t_expression | '/' cast_expression | '%' cast_expression )* ;=0D +=0D def multiplicative_expression(self, ):=0D =0D multiplicative_expression_StartIndex =3D self.input.index()=0D @@ -5036,16 +4835,15 @@ class CParser(Parser): # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '= /' cast_expression | '%' cast_expression )*=0D # C.g:382:4: ( cast_expression )=0D # C.g:382:5: cast_expression=0D - self.following.append(self.FOLLOW_cast_expression_in_multi= plicative_expression1251)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_expressi= on1251)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:382:22: ( '*' cast_expression | '/' cast_expression = | '%' cast_expression )*=0D - while True: #loop62=0D + while True: # loop62=0D alt62 =3D 4=0D LA62 =3D self.input.LA(1)=0D if LA62 =3D=3D 66:=0D @@ -5057,54 +4855,53 @@ class CParser(Parser): =0D if alt62 =3D=3D 1:=0D # C.g:382:23: '*' cast_expression=0D - self.match(self.input, 66, self.FOLLOW_66_in_multi= plicative_expression1255)=0D + self.match(=0D + self.input, 66, self.FOLLOW_66_in_multiplicati= ve_expression1255)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1257)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1257)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt62 =3D=3D 2:=0D # C.g:382:45: '/' cast_expression=0D - self.match(self.input, 70, self.FOLLOW_70_in_multi= plicative_expression1261)=0D + self.match(=0D + self.input, 70, self.FOLLOW_70_in_multiplicati= ve_expression1261)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1263)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1263)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt62 =3D=3D 3:=0D # C.g:382:67: '%' cast_expression=0D - self.match(self.input, 71, self.FOLLOW_71_in_multi= plicative_expression1267)=0D + self.match(=0D + self.input, 71, self.FOLLOW_71_in_multiplicati= ve_expression1267)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1269)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1269)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop62=0D -=0D -=0D -=0D -=0D -=0D + break # loop62=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 38, multiplicative_expression_Sta= rtIndex)=0D + self.memoize(self.input, 38,=0D + multiplicative_expression_StartIndex)=0D =0D pass=0D =0D @@ -5112,9 +4909,9 @@ class CParser(Parser): =0D # $ANTLR end multiplicative_expression=0D =0D -=0D # $ANTLR start cast_expression=0D # C.g:385:1: cast_expression : ( '(' type_name ')' cast_expression | u= nary_expression );=0D +=0D def cast_expression(self, ):=0D =0D cast_expression_StartIndex =3D self.input.index()=0D @@ -5127,23 +4924,24 @@ class CParser(Parser): alt63 =3D 2=0D LA63_0 =3D self.input.LA(1)=0D =0D - if (LA63_0 =3D=3D 62) :=0D + if (LA63_0 =3D=3D 62):=0D LA63 =3D self.input.LA(2)=0D if LA63 =3D=3D 34 or LA63 =3D=3D 35 or LA63 =3D=3D 36 = or LA63 =3D=3D 37 or LA63 =3D=3D 38 or LA63 =3D=3D 39 or LA63 =3D=3D 40 or = LA63 =3D=3D 41 or LA63 =3D=3D 42 or LA63 =3D=3D 45 or LA63 =3D=3D 46 or LA6= 3 =3D=3D 48 or LA63 =3D=3D 49 or LA63 =3D=3D 50 or LA63 =3D=3D 51 or LA63 = =3D=3D 52 or LA63 =3D=3D 53 or LA63 =3D=3D 54 or LA63 =3D=3D 55 or LA63 =3D= =3D 56 or LA63 =3D=3D 57 or LA63 =3D=3D 58 or LA63 =3D=3D 59 or LA63 =3D=3D= 60 or LA63 =3D=3D 61:=0D alt63 =3D 1=0D elif LA63 =3D=3D IDENTIFIER:=0D LA63_25 =3D self.input.LA(3)=0D =0D - if (self.synpred109()) :=0D + if (self.synpred109()):=0D alt63 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt63 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_exp= ression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 2= 5, self.input)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name = ')' cast_expression | unary_expression );", 63, 25, self.input)=0D =0D raise nvae=0D =0D @@ -5154,51 +4952,55 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_express= ion : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name ')' = cast_expression | unary_expression );", 63, 1, self.input)=0D =0D raise nvae=0D =0D - elif ((IDENTIFIER <=3D LA63_0 <=3D FLOATING_POINT_LITERAL)= or LA63_0 =3D=3D 66 or (68 <=3D LA63_0 <=3D 69) or (72 <=3D LA63_0 <=3D 74= ) or (77 <=3D LA63_0 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA63_0 <=3D FLOATING_POINT_LITERAL)= or LA63_0 =3D=3D 66 or (68 <=3D LA63_0 <=3D 69) or (72 <=3D LA63_0 <=3D 74= ) or (77 <=3D LA63_0 <=3D 79)):=0D alt63 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_expression = : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.i= nput)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name ')' cast= _expression | unary_expression );", 63, 0, self.input)=0D =0D raise nvae=0D =0D if alt63 =3D=3D 1:=0D # C.g:386:4: '(' type_name ')' cast_expression=0D - self.match(self.input, 62, self.FOLLOW_62_in_cast_expr= ession1282)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_cast_expression1282)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_type_name_in_cast_ex= pression1284)=0D + self.following.append(=0D + self.FOLLOW_type_name_in_cast_expression1284)=0D self.type_name()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_cast_expr= ession1286)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_cast_expression1286)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_in_c= ast_expression1288)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_cast_expression1288= )=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt63 =3D=3D 2:=0D # C.g:387:4: unary_expression=0D - self.following.append(self.FOLLOW_unary_expression_in_= cast_expression1293)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_cast_expression129= 3)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5212,9 +5014,9 @@ class CParser(Parser): =0D # $ANTLR end cast_expression=0D =0D -=0D # $ANTLR start unary_expression=0D # C.g:390:1: unary_expression : ( postfix_expression | '++' unary_expr= ession | '--' unary_expression | unary_operator cast_expression | 'sizeof' = unary_expression | 'sizeof' '(' type_name ')' );=0D +=0D def unary_expression(self, ):=0D =0D unary_expression_StartIndex =3D self.input.index()=0D @@ -5237,30 +5039,32 @@ class CParser(Parser): elif LA64 =3D=3D 74:=0D LA64_12 =3D self.input.LA(2)=0D =0D - if (LA64_12 =3D=3D 62) :=0D + if (LA64_12 =3D=3D 62):=0D LA64_13 =3D self.input.LA(3)=0D =0D - if (self.synpred114()) :=0D + if (self.synpred114()):=0D alt64 =3D 5=0D - elif (True) :=0D + elif (True):=0D alt64 =3D 6=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expre= ssion | '++' unary_expression | '--' unary_expression | unary_operator cast= _expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 6= 4, 13, self.input)=0D =0D raise nvae=0D =0D - elif ((IDENTIFIER <=3D LA64_12 <=3D FLOATING_POINT_LIT= ERAL) or LA64_12 =3D=3D 66 or (68 <=3D LA64_12 <=3D 69) or (72 <=3D LA64_12= <=3D 74) or (77 <=3D LA64_12 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA64_12 <=3D FLOATING_POINT_LIT= ERAL) or LA64_12 =3D=3D 66 or (68 <=3D LA64_12 <=3D 69) or (72 <=3D LA64_12= <=3D 74) or (77 <=3D LA64_12 <=3D 79)):=0D alt64 =3D 5=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expressio= n | '++' unary_expression | '--' unary_expression | unary_operator cast_exp= ression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 1= 2, self.input)=0D =0D raise nvae=0D =0D @@ -5269,88 +5073,95 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expression | = '++' unary_expression | '--' unary_expression | unary_operator cast_express= ion | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 0, se= lf.input)=0D =0D raise nvae=0D =0D if alt64 =3D=3D 1:=0D # C.g:391:4: postfix_expression=0D - self.following.append(self.FOLLOW_postfix_expression_i= n_unary_expression1304)=0D + self.following.append(=0D + self.FOLLOW_postfix_expression_in_unary_expression= 1304)=0D self.postfix_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 2:=0D # C.g:392:4: '++' unary_expression=0D - self.match(self.input, 72, self.FOLLOW_72_in_unary_exp= ression1309)=0D + self.match(self.input, 72,=0D + self.FOLLOW_72_in_unary_expression1309)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1311)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 11)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 3:=0D # C.g:393:4: '--' unary_expression=0D - self.match(self.input, 73, self.FOLLOW_73_in_unary_exp= ression1316)=0D + self.match(self.input, 73,=0D + self.FOLLOW_73_in_unary_expression1316)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1318)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 18)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 4:=0D # C.g:394:4: unary_operator cast_expression=0D - self.following.append(self.FOLLOW_unary_operator_in_un= ary_expression1323)=0D + self.following.append(=0D + self.FOLLOW_unary_operator_in_unary_expression1323= )=0D self.unary_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_in_u= nary_expression1325)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_unary_expression132= 5)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 5:=0D # C.g:395:4: 'sizeof' unary_expression=0D - self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1330)=0D + self.match(self.input, 74,=0D + self.FOLLOW_74_in_unary_expression1330)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1332)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 32)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 6:=0D # C.g:396:4: 'sizeof' '(' type_name ')'=0D - self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1337)=0D + self.match(self.input, 74,=0D + self.FOLLOW_74_in_unary_expression1337)=0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_unary_exp= ression1339)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_unary_expression1339)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_type_name_in_unary_e= xpression1341)=0D + self.following.append(=0D + self.FOLLOW_type_name_in_unary_expression1341)=0D self.type_name()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_unary_exp= ression1343)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_unary_expression1343)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5364,9 +5175,9 @@ class CParser(Parser): =0D # $ANTLR end unary_expression=0D =0D -=0D # $ANTLR start postfix_expression=0D # C.g:399:1: postfix_expression : p=3D primary_expression ( '[' expres= sion ']' | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' = macro_parameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->'= z=3D IDENTIFIER | '++' | '--' )* ;=0D +=0D def postfix_expression(self, ):=0D self.postfix_expression_stack.append(postfix_expression_scope())=0D postfix_expression_StartIndex =3D self.input.index()=0D @@ -5379,9 +5190,7 @@ class CParser(Parser): =0D c =3D None=0D =0D -=0D -=0D - self.postfix_expression_stack[-1].FuncCallText =3D ''=0D + self.postfix_expression_stack[-1].FuncCallText =3D ''=0D =0D try:=0D try:=0D @@ -5390,30 +5199,29 @@ class CParser(Parser): =0D # 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 | '++' | '--' )* )=0D # 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 | '++' | '--' )*=0D - self.following.append(self.FOLLOW_primary_expression_in_po= stfix_expression1367)=0D + self.following.append(=0D + self.FOLLOW_primary_expression_in_postfix_expression13= 67)=0D p =3D self.primary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(p.start, p.stop)=0D + self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(=0D + p.start, p.stop)=0D =0D # C.g:407:9: ( '[' expression ']' | '(' a=3D ')' | '(' c= =3D argument_expression_list b=3D ')' | '(' macro_parameter_list ')' | '.' = x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D IDENTIFIER | '++' | '--' = )*=0D - while True: #loop65=0D + while True: # loop65=0D alt65 =3D 10=0D LA65 =3D self.input.LA(1)=0D if LA65 =3D=3D 66:=0D LA65_1 =3D self.input.LA(2)=0D =0D - if (LA65_1 =3D=3D IDENTIFIER) :=0D + if (LA65_1 =3D=3D IDENTIFIER):=0D LA65_30 =3D self.input.LA(3)=0D =0D - if (self.synpred120()) :=0D + if (self.synpred120()):=0D alt65 =3D 6=0D =0D -=0D -=0D -=0D elif LA65 =3D=3D 64:=0D alt65 =3D 1=0D elif LA65 =3D=3D 62:=0D @@ -5425,21 +5233,19 @@ class CParser(Parser): elif LA65 =3D=3D IDENTIFIER:=0D LA65_55 =3D self.input.LA(3)=0D =0D - if (self.synpred117()) :=0D + if (self.synpred117()):=0D alt65 =3D 3=0D - elif (self.synpred118()) :=0D + elif (self.synpred118()):=0D alt65 =3D 4=0D =0D -=0D elif LA65 =3D=3D 66:=0D LA65_57 =3D self.input.LA(3)=0D =0D - if (self.synpred117()) :=0D + if (self.synpred117()):=0D alt65 =3D 3=0D - elif (self.synpred118()) :=0D + elif (self.synpred118()):=0D alt65 =3D 4=0D =0D -=0D elif LA65 =3D=3D HEX_LITERAL or LA65 =3D=3D OCTAL_= LITERAL or LA65 =3D=3D DECIMAL_LITERAL or LA65 =3D=3D CHARACTER_LITERAL or = LA65 =3D=3D STRING_LITERAL or LA65 =3D=3D FLOATING_POINT_LITERAL or LA65 = =3D=3D 62 or LA65 =3D=3D 68 or LA65 =3D=3D 69 or LA65 =3D=3D 72 or LA65 =3D= =3D 73 or LA65 =3D=3D 74 or LA65 =3D=3D 77 or LA65 =3D=3D 78 or LA65 =3D=3D= 79:=0D alt65 =3D 3=0D =0D @@ -5454,130 +5260,132 @@ class CParser(Parser): =0D if alt65 =3D=3D 1:=0D # C.g:407:13: '[' expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_postf= ix_expression1383)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_postfix_expression138= 3)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_po= stfix_expression1385)=0D + self.following.append(=0D + self.FOLLOW_expression_in_postfix_expression13= 85)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_postf= ix_expression1387)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_postfix_expression138= 7)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 2:=0D # C.g:408:13: '(' a=3D ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1401)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression140= 1)=0D if self.failed:=0D return=0D a =3D self.input.LT(1)=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1405)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression140= 5)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, '')=0D -=0D -=0D + self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line,=0D + a.charPositionInLine= , self.postfix_expression_stack[-1].FuncCallText, '')=0D =0D elif alt65 =3D=3D 3:=0D # C.g:409:13: '(' c=3D argument_expression_list b= =3D ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1420)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression142= 0)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_argument_express= ion_list_in_postfix_expression1424)=0D + self.following.append(=0D + self.FOLLOW_argument_expression_list_in_postfi= x_expression1424)=0D c =3D self.argument_expression_list()=0D self.following.pop()=0D if self.failed:=0D return=0D b =3D self.input.LT(1)=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1428)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression142= 8)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - 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))=0D -=0D -=0D + self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, b.line, b.charPositionInLine,=0D + self.postfix_express= ion_stack[-1].FuncCallText, self.input.toString(c.start, c.stop))=0D =0D elif alt65 =3D=3D 4:=0D # C.g:410:13: '(' macro_parameter_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1444)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression144= 4)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_macro_parameter_= list_in_postfix_expression1446)=0D + self.following.append(=0D + self.FOLLOW_macro_parameter_list_in_postfix_ex= pression1446)=0D self.macro_parameter_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1448)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression144= 8)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 5:=0D # C.g:411:13: '.' x=3D IDENTIFIER=0D - self.match(self.input, 75, self.FOLLOW_75_in_postf= ix_expression1462)=0D + self.match(self.input, 75,=0D + self.FOLLOW_75_in_postfix_expression146= 2)=0D if self.failed:=0D return=0D x =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1466)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1466)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= +=3D '.' + x.text=0D =0D -=0D -=0D elif alt65 =3D=3D 6:=0D # C.g:412:13: '*' y=3D IDENTIFIER=0D - self.match(self.input, 66, self.FOLLOW_66_in_postf= ix_expression1482)=0D + self.match(self.input, 66,=0D + self.FOLLOW_66_in_postfix_expression148= 2)=0D if self.failed:=0D return=0D y =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1486)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1486)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= =3D y.text=0D =0D -=0D -=0D elif alt65 =3D=3D 7:=0D # C.g:413:13: '->' z=3D IDENTIFIER=0D - self.match(self.input, 76, self.FOLLOW_76_in_postf= ix_expression1502)=0D + self.match(self.input, 76,=0D + self.FOLLOW_76_in_postfix_expression150= 2)=0D if self.failed:=0D return=0D z =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1506)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1506)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= +=3D '->' + z.text=0D =0D -=0D -=0D elif alt65 =3D=3D 8:=0D # C.g:414:13: '++'=0D - self.match(self.input, 72, self.FOLLOW_72_in_postf= ix_expression1522)=0D + self.match(self.input, 72,=0D + self.FOLLOW_72_in_postfix_expression152= 2)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 9:=0D # C.g:415:13: '--'=0D - self.match(self.input, 73, self.FOLLOW_73_in_postf= ix_expression1536)=0D + self.match(self.input, 73,=0D + self.FOLLOW_73_in_postfix_expression153= 6)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop65=0D -=0D -=0D -=0D -=0D -=0D + break # loop65=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5593,9 +5401,9 @@ class CParser(Parser): =0D # $ANTLR end postfix_expression=0D =0D -=0D # $ANTLR start macro_parameter_list=0D # C.g:419:1: macro_parameter_list : parameter_declaration ( ',' parame= ter_declaration )* ;=0D +=0D def macro_parameter_list(self, ):=0D =0D macro_parameter_list_StartIndex =3D self.input.index()=0D @@ -5606,39 +5414,35 @@ class CParser(Parser): =0D # C.g:420:2: ( parameter_declaration ( ',' parameter_decla= ration )* )=0D # C.g:420:4: parameter_declaration ( ',' parameter_declara= tion )*=0D - self.following.append(self.FOLLOW_parameter_declaration_in= _macro_parameter_list1559)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_macro_parameter_l= ist1559)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:420:26: ( ',' parameter_declaration )*=0D - while True: #loop66=0D + while True: # loop66=0D alt66 =3D 2=0D LA66_0 =3D self.input.LA(1)=0D =0D - if (LA66_0 =3D=3D 27) :=0D + if (LA66_0 =3D=3D 27):=0D alt66 =3D 1=0D =0D -=0D if alt66 =3D=3D 1:=0D # C.g:420:27: ',' parameter_declaration=0D - self.match(self.input, 27, self.FOLLOW_27_in_macro= _parameter_list1562)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_macro_parameter_list1= 562)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_declar= ation_in_macro_parameter_list1564)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_macro_par= ameter_list1564)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop66=0D -=0D -=0D -=0D -=0D -=0D + break # loop66=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5653,9 +5457,9 @@ class CParser(Parser): =0D # $ANTLR end macro_parameter_list=0D =0D -=0D # $ANTLR start unary_operator=0D # C.g:423:1: unary_operator : ( '&' | '*' | '+' | '-' | '~' | '!' );=0D +=0D def unary_operator(self, ):=0D =0D unary_operator_StartIndex =3D self.input.index()=0D @@ -5667,7 +5471,7 @@ class CParser(Parser): # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' )=0D # C.g:=0D if self.input.LA(1) =3D=3D 66 or (68 <=3D self.input.LA(1)= <=3D 69) or (77 <=3D self.input.LA(1) <=3D 79):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -5679,14 +5483,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_unary_operator= 0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5705,10 +5504,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start primary_expression=0D # C.g:432:1: primary_expression : ( IDENTIFIER | constant | '(' expres= sion ')' );=0D +=0D def primary_expression(self, ):=0D =0D retval =3D self.primary_expression_return()=0D @@ -5725,16 +5523,17 @@ class CParser(Parser): if LA67 =3D=3D IDENTIFIER:=0D LA67_1 =3D self.input.LA(2)=0D =0D - if (LA67_1 =3D=3D EOF or LA67_1 =3D=3D 25 or (27 <=3D = LA67_1 <=3D 28) or LA67_1 =3D=3D 44 or LA67_1 =3D=3D 47 or LA67_1 =3D=3D 53= or (62 <=3D LA67_1 <=3D 66) or (68 <=3D LA67_1 <=3D 73) or (75 <=3D LA67_1= <=3D 77) or (80 <=3D LA67_1 <=3D 102)) :=0D + if (LA67_1 =3D=3D EOF or LA67_1 =3D=3D 25 or (27 <=3D = LA67_1 <=3D 28) or LA67_1 =3D=3D 44 or LA67_1 =3D=3D 47 or LA67_1 =3D=3D 53= or (62 <=3D LA67_1 <=3D 66) or (68 <=3D LA67_1 <=3D 73) or (75 <=3D LA67_1= <=3D 77) or (80 <=3D LA67_1 <=3D 102)):=0D alt67 =3D 1=0D - elif (LA67_1 =3D=3D IDENTIFIER or LA67_1 =3D=3D STRING= _LITERAL) :=0D + elif (LA67_1 =3D=3D IDENTIFIER or LA67_1 =3D=3D STRING= _LITERAL):=0D alt67 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("432:1: primary_expr= ession : ( IDENTIFIER | constant | '(' expression ')' );", 67, 1, self.inpu= t)=0D + nvae =3D NoViableAltException(=0D + "432:1: primary_expression : ( IDENTIFIER | co= nstant | '(' expression ')' );", 67, 1, self.input)=0D =0D raise nvae=0D =0D @@ -5747,44 +5546,46 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("432:1: primary_expressi= on : ( IDENTIFIER | constant | '(' expression ')' );", 67, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "432:1: primary_expression : ( IDENTIFIER | consta= nt | '(' expression ')' );", 67, 0, self.input)=0D =0D raise nvae=0D =0D if alt67 =3D=3D 1:=0D # C.g:433:4: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_primary_expression1613)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_primary_expressio= n1613)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt67 =3D=3D 2:=0D # C.g:434:4: constant=0D - self.following.append(self.FOLLOW_constant_in_primary_= expression1618)=0D + self.following.append(=0D + self.FOLLOW_constant_in_primary_expression1618)=0D self.constant()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt67 =3D=3D 3:=0D # C.g:435:4: '(' expression ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_primary_e= xpression1623)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_primary_expression1623)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_expression_in_primar= y_expression1625)=0D + self.following.append(=0D + self.FOLLOW_expression_in_primary_expression1625)= =0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 63, self.FOLLOW_63_in_primary_e= xpression1627)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_primary_expression1627)=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5798,9 +5599,9 @@ class CParser(Parser): =0D # $ANTLR end primary_expression=0D =0D -=0D # $ANTLR start constant=0D # C.g:438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERA= L | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFI= ER )* | FLOATING_POINT_LITERAL );=0D +=0D def constant(self, ):=0D =0D constant_StartIndex =3D self.input.index()=0D @@ -5829,111 +5630,103 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL |= DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )= + )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );", 72, 0, self.input)=0D =0D raise nvae=0D =0D if alt72 =3D=3D 1:=0D # C.g:439:9: HEX_LITERAL=0D - self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LI= TERAL_in_constant1643)=0D + self.match(self.input, HEX_LITERAL,=0D + self.FOLLOW_HEX_LITERAL_in_constant1643)=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 2:=0D # C.g:440:9: OCTAL_LITERAL=0D - self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTA= L_LITERAL_in_constant1653)=0D + self.match(self.input, OCTAL_LITERAL,=0D + self.FOLLOW_OCTAL_LITERAL_in_constant1653)= =0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 3:=0D # C.g:441:9: DECIMAL_LITERAL=0D - self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DE= CIMAL_LITERAL_in_constant1663)=0D + self.match(self.input, DECIMAL_LITERAL,=0D + self.FOLLOW_DECIMAL_LITERAL_in_constant1663= )=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 4:=0D # C.g:442:7: CHARACTER_LITERAL=0D - self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_= CHARACTER_LITERAL_in_constant1671)=0D + self.match(self.input, CHARACTER_LITERAL,=0D + self.FOLLOW_CHARACTER_LITERAL_in_constant16= 71)=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 5:=0D # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ = ( IDENTIFIER )*=0D # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+= =0D cnt70 =3D 0=0D - while True: #loop70=0D + while True: # loop70=0D alt70 =3D 2=0D LA70_0 =3D self.input.LA(1)=0D =0D - if (LA70_0 =3D=3D IDENTIFIER) :=0D + if (LA70_0 =3D=3D IDENTIFIER):=0D LA70_1 =3D self.input.LA(2)=0D =0D - if (LA70_1 =3D=3D STRING_LITERAL) :=0D + if (LA70_1 =3D=3D STRING_LITERAL):=0D alt70 =3D 1=0D - elif (LA70_1 =3D=3D IDENTIFIER) :=0D + elif (LA70_1 =3D=3D IDENTIFIER):=0D LA70_33 =3D self.input.LA(3)=0D =0D - if (self.synpred138()) :=0D + if (self.synpred138()):=0D alt70 =3D 1=0D =0D -=0D -=0D -=0D - elif (LA70_0 =3D=3D STRING_LITERAL) :=0D + elif (LA70_0 =3D=3D STRING_LITERAL):=0D alt70 =3D 1=0D =0D -=0D if alt70 =3D=3D 1:=0D # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL = )+=0D # C.g:443:8: ( IDENTIFIER )*=0D - while True: #loop68=0D + while True: # loop68=0D alt68 =3D 2=0D LA68_0 =3D self.input.LA(1)=0D =0D - if (LA68_0 =3D=3D IDENTIFIER) :=0D + if (LA68_0 =3D=3D IDENTIFIER):=0D alt68 =3D 1=0D =0D -=0D if alt68 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, sel= f.FOLLOW_IDENTIFIER_in_constant1680)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLO= W_IDENTIFIER_in_constant1680)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop68=0D -=0D + break # loop68=0D =0D # C.g:443:20: ( STRING_LITERAL )+=0D cnt69 =3D 0=0D - while True: #loop69=0D + while True: # loop69=0D alt69 =3D 2=0D LA69_0 =3D self.input.LA(1)=0D =0D - if (LA69_0 =3D=3D STRING_LITERAL) :=0D + if (LA69_0 =3D=3D STRING_LITERAL):=0D LA69_31 =3D self.input.LA(2)=0D =0D - if (self.synpred137()) :=0D + if (self.synpred137()):=0D alt69 =3D 1=0D =0D -=0D -=0D -=0D if alt69 =3D=3D 1:=0D # C.g:0:0: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL,= self.FOLLOW_STRING_LITERAL_in_constant1683)=0D + self.match(=0D + self.input, STRING_LITERAL, self.F= OLLOW_STRING_LITERAL_in_constant1683)=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt69 >=3D 1:=0D - break #loop69=0D + break # loop69=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -5944,12 +5737,9 @@ class CParser(Parser): =0D cnt69 +=3D 1=0D =0D -=0D -=0D -=0D else:=0D if cnt70 >=3D 1:=0D - break #loop70=0D + break # loop70=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -5960,37 +5750,31 @@ class CParser(Parser): =0D cnt70 +=3D 1=0D =0D -=0D # C.g:443:38: ( IDENTIFIER )*=0D - while True: #loop71=0D + while True: # loop71=0D alt71 =3D 2=0D LA71_0 =3D self.input.LA(1)=0D =0D - if (LA71_0 =3D=3D IDENTIFIER) :=0D + if (LA71_0 =3D=3D IDENTIFIER):=0D alt71 =3D 1=0D =0D -=0D if alt71 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW= _IDENTIFIER_in_constant1688)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_constant1= 688)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop71=0D -=0D -=0D -=0D + break # loop71=0D =0D elif alt72 =3D=3D 6:=0D # C.g:444:9: FLOATING_POINT_LITERAL=0D - self.match(self.input, FLOATING_POINT_LITERAL, self.FO= LLOW_FLOATING_POINT_LITERAL_in_constant1699)=0D + self.match(self.input, FLOATING_POINT_LITERAL,=0D + self.FOLLOW_FLOATING_POINT_LITERAL_in_const= ant1699)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6009,10 +5793,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start expression=0D # C.g:449:1: expression : assignment_expression ( ',' assignment_expre= ssion )* ;=0D +=0D def expression(self, ):=0D =0D retval =3D self.expression_return()=0D @@ -6025,42 +5808,38 @@ class CParser(Parser): =0D # C.g:450:2: ( assignment_expression ( ',' assignment_expr= ession )* )=0D # C.g:450:4: assignment_expression ( ',' assignment_expres= sion )*=0D - self.following.append(self.FOLLOW_assignment_expression_in= _expression1715)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_expression1715)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:450:26: ( ',' assignment_expression )*=0D - while True: #loop73=0D + while True: # loop73=0D alt73 =3D 2=0D LA73_0 =3D self.input.LA(1)=0D =0D - if (LA73_0 =3D=3D 27) :=0D + if (LA73_0 =3D=3D 27):=0D alt73 =3D 1=0D =0D -=0D if alt73 =3D=3D 1:=0D # C.g:450:27: ',' assignment_expression=0D - self.match(self.input, 27, self.FOLLOW_27_in_expre= ssion1718)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_expression1718)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_assignment_expre= ssion_in_expression1720)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_expressio= n1720)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop73=0D -=0D -=0D -=0D -=0D + break # loop73=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6074,9 +5853,9 @@ class CParser(Parser): =0D # $ANTLR end expression=0D =0D -=0D # $ANTLR start constant_expression=0D # C.g:453:1: constant_expression : conditional_expression ;=0D +=0D def constant_expression(self, ):=0D =0D constant_expression_StartIndex =3D self.input.index()=0D @@ -6087,15 +5866,13 @@ class CParser(Parser): =0D # C.g:454:2: ( conditional_expression )=0D # C.g:454:4: conditional_expression=0D - self.following.append(self.FOLLOW_conditional_expression_i= n_constant_expression1733)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_constant_express= ion1733)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6109,9 +5886,9 @@ class CParser(Parser): =0D # $ANTLR end constant_expression=0D =0D -=0D # $ANTLR start assignment_expression=0D # C.g:457:1: assignment_expression : ( lvalue assignment_operator assi= gnment_expression | conditional_expression );=0D +=0D def assignment_expression(self, ):=0D =0D assignment_expression_StartIndex =3D self.input.index()=0D @@ -6128,112 +5905,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_13 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 13, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 13, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_14 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 14, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 14, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_15 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 15, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 15, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_16 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 16, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 16, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_17 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 17, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 17, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_18 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 18, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 18, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_19 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 19, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 19, self.input)=0D =0D raise nvae=0D =0D @@ -6242,32 +6026,34 @@ class CParser(Parser): elif LA74 =3D=3D STRING_LITERAL:=0D LA74_21 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 21, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 21, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_22 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 22, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 22, self.input)=0D =0D raise nvae=0D =0D @@ -6278,7 +6064,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 1, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6287,112 +6074,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_44 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 44, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 44, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_45 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 45, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 45, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_46 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 46, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 46, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_47 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 47, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 47, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_48 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 48, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 48, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_49 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 49, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 49, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_50 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 50, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 50, self.input)=0D =0D raise nvae=0D =0D @@ -6405,7 +6199,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 2, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6414,112 +6209,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_73 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 73, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 73, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_74 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 74, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 74, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_75 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 75, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 75, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_76 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 76, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 76, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_77 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 77, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 77, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_78 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 78, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 78, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_79 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 79, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 79, self.input)=0D =0D raise nvae=0D =0D @@ -6532,7 +6334,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 3, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 3, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6541,112 +6344,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_102 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 102, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 102, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_103 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 103, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 103, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_104 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 104, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 104, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_105 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 105, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 105, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_106 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 106, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 106, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_107 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 107, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 107, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_108 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 108, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 108, self.input)=0D =0D raise nvae=0D =0D @@ -6659,7 +6469,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 4, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 4, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6668,112 +6479,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_131 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 131, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 131, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_132 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 132, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 132, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_133 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 133, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 133, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_134 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 134, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 134, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_135 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 135, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 135, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_136 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 136, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 136, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_137 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 137, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 137, self.input)=0D =0D raise nvae=0D =0D @@ -6786,7 +6604,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 5, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 5, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6795,128 +6614,136 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_160 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 160, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 160, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 64:=0D LA74_161 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 161, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 161, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_162 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 162, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 162, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_163 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 163, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 163, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_164 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 164, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 164, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_165 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 165, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 165, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_166 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 166, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 166, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_167 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 167, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 167, self.input)=0D =0D raise nvae=0D =0D @@ -6925,16 +6752,17 @@ class CParser(Parser): elif LA74 =3D=3D STRING_LITERAL:=0D LA74_189 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 189, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 189, self.input)=0D =0D raise nvae=0D =0D @@ -6945,7 +6773,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 6, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 6, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6954,112 +6783,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_191 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 191, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 191, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_192 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 192, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 192, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_193 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 193, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 193, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_194 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 194, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 194, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_195 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 195, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 195, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_196 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 196, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 196, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_197 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 197, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 197, self.input)=0D =0D raise nvae=0D =0D @@ -7072,7 +6908,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 7, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 7, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7081,192 +6918,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_220 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 220, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 220, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_221 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 221, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 221, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_222 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 222, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 222, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_223 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 223, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 223, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_224 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 224, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 224, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_225 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 225, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 225, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_226 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 226, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 226, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_227 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 227, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 227, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_228 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 228, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 228, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_229 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 229, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 229, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_230 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 230, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 230, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_231 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 231, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 231, self.input)=0D =0D raise nvae=0D =0D @@ -7277,7 +7126,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 8, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 8, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7286,192 +7136,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_244 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 244, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 244, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_245 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 245, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 245, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_246 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 246, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 246, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_247 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 247, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 247, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_248 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 248, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 248, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_249 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 249, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 249, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_250 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 250, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 250, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_251 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 251, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 251, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_252 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 252, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 252, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_253 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 253, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 253, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_254 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 254, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 254, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_255 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 255, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 255, self.input)=0D =0D raise nvae=0D =0D @@ -7480,7 +7342,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 9, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 9, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7489,192 +7352,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_256 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 256, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 256, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_257 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 257, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 257, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_258 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 258, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 258, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_259 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 259, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 259, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_260 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 260, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 260, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_261 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 261, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 261, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_262 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 262, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 262, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_263 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 263, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 263, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_264 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 264, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 264, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_265 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 265, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 265, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_266 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 266, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 266, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_267 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 267, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 267, self.input)=0D =0D raise nvae=0D =0D @@ -7683,7 +7558,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 10, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 10, = self.input)=0D =0D raise nvae=0D =0D @@ -7692,192 +7568,204 @@ class CParser(Parser): if LA74 =3D=3D 62:=0D LA74_268 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 268, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 268, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_269 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 269, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 269, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_270 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 270, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 270, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_271 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 271, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 271, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_272 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 272, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 272, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_273 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 273, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 273, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_274 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 274, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 274, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_275 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 275, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 275, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_276 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 276, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 276, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_277 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 277, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 277, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_278 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 278, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 278, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_279 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 279, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 279, self.input)=0D =0D raise nvae=0D =0D @@ -7886,7 +7774,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 11, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 11, = self.input)=0D =0D raise nvae=0D =0D @@ -7895,192 +7784,204 @@ class CParser(Parser): if LA74 =3D=3D 62:=0D LA74_280 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 280, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 280, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_281 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 281, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 281, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_282 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 282, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 282, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_283 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 283, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 283, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_284 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 284, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 284, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_285 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 285, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 285, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_286 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 286, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 286, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_287 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 287, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 287, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_288 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 288, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 288, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_289 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 289, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 289, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_290 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 290, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 290, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_291 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 291, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 291, self.input)=0D =0D raise nvae=0D =0D @@ -8089,7 +7990,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 12, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 12, = self.input)=0D =0D raise nvae=0D =0D @@ -8098,39 +8000,41 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_expre= ssion : ( lvalue assignment_operator assignment_expression | conditional_ex= pression );", 74, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assignmen= t_operator assignment_expression | conditional_expression );", 74, 0, self.= input)=0D =0D raise nvae=0D =0D if alt74 =3D=3D 1:=0D # C.g:458:4: lvalue assignment_operator assignment_exp= ression=0D - self.following.append(self.FOLLOW_lvalue_in_assignment= _expression1744)=0D + self.following.append(=0D + self.FOLLOW_lvalue_in_assignment_expression1744)=0D self.lvalue()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_operator_= in_assignment_expression1746)=0D + self.following.append(=0D + self.FOLLOW_assignment_operator_in_assignment_expr= ession1746)=0D self.assignment_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_expressio= n_in_assignment_expression1748)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_assignment_ex= pression1748)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt74 =3D=3D 2:=0D # C.g:459:4: conditional_expression=0D - self.following.append(self.FOLLOW_conditional_expressi= on_in_assignment_expression1753)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_assignment_e= xpression1753)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8144,9 +8048,9 @@ class CParser(Parser): =0D # $ANTLR end assignment_expression=0D =0D -=0D # $ANTLR start lvalue=0D # C.g:462:1: lvalue : unary_expression ;=0D +=0D def lvalue(self, ):=0D =0D lvalue_StartIndex =3D self.input.index()=0D @@ -8157,15 +8061,13 @@ class CParser(Parser): =0D # C.g:463:2: ( unary_expression )=0D # C.g:463:4: unary_expression=0D - self.following.append(self.FOLLOW_unary_expression_in_lval= ue1765)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_lvalue1765)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8179,9 +8081,9 @@ class CParser(Parser): =0D # $ANTLR end lvalue=0D =0D -=0D # $ANTLR start assignment_operator=0D # C.g:466:1: assignment_operator : ( '=3D' | '*=3D' | '/=3D' | '%=3D' = | '+=3D' | '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' );=0D +=0D def assignment_operator(self, ):=0D =0D assignment_operator_StartIndex =3D self.input.index()=0D @@ -8193,7 +8095,7 @@ class CParser(Parser): # C.g:467:2: ( '=3D' | '*=3D' | '/=3D' | '%=3D' | '+=3D' |= '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' )=0D # C.g:=0D if self.input.LA(1) =3D=3D 28 or (80 <=3D self.input.LA(1)= <=3D 89):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8205,14 +8107,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_assignment_ope= rator0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8226,15 +8123,14 @@ class CParser(Parser): =0D # $ANTLR end assignment_operator=0D =0D -=0D # $ANTLR start conditional_expression=0D # C.g:480:1: conditional_expression : e=3D logical_or_expression ( '?'= expression ':' conditional_expression )? ;=0D +=0D def conditional_expression(self, ):=0D =0D conditional_expression_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 51):=0D @@ -8242,7 +8138,8 @@ class CParser(Parser): =0D # C.g:481:2: (e=3D logical_or_expression ( '?' expression = ':' conditional_expression )? )=0D # C.g:481:4: e=3D logical_or_expression ( '?' expression '= :' conditional_expression )?=0D - self.following.append(self.FOLLOW_logical_or_expression_in= _conditional_expression1839)=0D + self.following.append(=0D + self.FOLLOW_logical_or_expression_in_conditional_expre= ssion1839)=0D e =3D self.logical_or_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -8251,35 +8148,33 @@ class CParser(Parser): alt75 =3D 2=0D LA75_0 =3D self.input.LA(1)=0D =0D - if (LA75_0 =3D=3D 90) :=0D + if (LA75_0 =3D=3D 90):=0D alt75 =3D 1=0D if alt75 =3D=3D 1:=0D # C.g:481:29: '?' expression ':' conditional_expressio= n=0D - self.match(self.input, 90, self.FOLLOW_90_in_condition= al_expression1842)=0D + self.match(self.input, 90,=0D + self.FOLLOW_90_in_conditional_expression184= 2)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_condit= ional_expression1844)=0D + self.following.append(=0D + self.FOLLOW_expression_in_conditional_expression18= 44)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_condition= al_expression1846)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_conditional_expression184= 6)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_conditional_expressi= on_in_conditional_expression1848)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_conditional_= expression1848)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8299,10 +8194,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start logical_or_expression=0D # C.g:484:1: logical_or_expression : logical_and_expression ( '||' log= ical_and_expression )* ;=0D +=0D def logical_or_expression(self, ):=0D =0D retval =3D self.logical_or_expression_return()=0D @@ -8315,42 +8209,38 @@ class CParser(Parser): =0D # C.g:485:2: ( logical_and_expression ( '||' logical_and_e= xpression )* )=0D # C.g:485:4: logical_and_expression ( '||' logical_and_exp= ression )*=0D - self.following.append(self.FOLLOW_logical_and_expression_i= n_logical_or_expression1863)=0D + self.following.append(=0D + self.FOLLOW_logical_and_expression_in_logical_or_expre= ssion1863)=0D self.logical_and_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:485:27: ( '||' logical_and_expression )*=0D - while True: #loop76=0D + while True: # loop76=0D alt76 =3D 2=0D LA76_0 =3D self.input.LA(1)=0D =0D - if (LA76_0 =3D=3D 91) :=0D + if (LA76_0 =3D=3D 91):=0D alt76 =3D 1=0D =0D -=0D if alt76 =3D=3D 1:=0D # C.g:485:28: '||' logical_and_expression=0D - self.match(self.input, 91, self.FOLLOW_91_in_logic= al_or_expression1866)=0D + self.match(self.input, 91,=0D + self.FOLLOW_91_in_logical_or_expression= 1866)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_logical_and_expr= ession_in_logical_or_expression1868)=0D + self.following.append(=0D + self.FOLLOW_logical_and_expression_in_logical_= or_expression1868)=0D self.logical_and_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop76=0D -=0D -=0D -=0D -=0D + break # loop76=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8364,9 +8254,9 @@ class CParser(Parser): =0D # $ANTLR end logical_or_expression=0D =0D -=0D # $ANTLR start logical_and_expression=0D # C.g:488:1: logical_and_expression : inclusive_or_expression ( '&&' i= nclusive_or_expression )* ;=0D +=0D def logical_and_expression(self, ):=0D =0D logical_and_expression_StartIndex =3D self.input.index()=0D @@ -8377,39 +8267,35 @@ class CParser(Parser): =0D # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or= _expression )* )=0D # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_e= xpression )*=0D - self.following.append(self.FOLLOW_inclusive_or_expression_= in_logical_and_expression1881)=0D + self.following.append(=0D + self.FOLLOW_inclusive_or_expression_in_logical_and_exp= ression1881)=0D self.inclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:489:28: ( '&&' inclusive_or_expression )*=0D - while True: #loop77=0D + while True: # loop77=0D alt77 =3D 2=0D LA77_0 =3D self.input.LA(1)=0D =0D - if (LA77_0 =3D=3D 92) :=0D + if (LA77_0 =3D=3D 92):=0D alt77 =3D 1=0D =0D -=0D if alt77 =3D=3D 1:=0D # C.g:489:29: '&&' inclusive_or_expression=0D - self.match(self.input, 92, self.FOLLOW_92_in_logic= al_and_expression1884)=0D + self.match(=0D + self.input, 92, self.FOLLOW_92_in_logical_and_= expression1884)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_inclusive_or_exp= ression_in_logical_and_expression1886)=0D + self.following.append(=0D + self.FOLLOW_inclusive_or_expression_in_logical= _and_expression1886)=0D self.inclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop77=0D -=0D -=0D -=0D -=0D -=0D + break # loop77=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8424,9 +8310,9 @@ class CParser(Parser): =0D # $ANTLR end logical_and_expression=0D =0D -=0D # $ANTLR start inclusive_or_expression=0D # C.g:492:1: inclusive_or_expression : exclusive_or_expression ( '|' e= xclusive_or_expression )* ;=0D +=0D def inclusive_or_expression(self, ):=0D =0D inclusive_or_expression_StartIndex =3D self.input.index()=0D @@ -8437,46 +8323,43 @@ class CParser(Parser): =0D # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_= expression )* )=0D # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_ex= pression )*=0D - self.following.append(self.FOLLOW_exclusive_or_expression_= in_inclusive_or_expression1899)=0D + self.following.append(=0D + self.FOLLOW_exclusive_or_expression_in_inclusive_or_ex= pression1899)=0D self.exclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:493:28: ( '|' exclusive_or_expression )*=0D - while True: #loop78=0D + while True: # loop78=0D alt78 =3D 2=0D LA78_0 =3D self.input.LA(1)=0D =0D - if (LA78_0 =3D=3D 93) :=0D + if (LA78_0 =3D=3D 93):=0D alt78 =3D 1=0D =0D -=0D if alt78 =3D=3D 1:=0D # C.g:493:29: '|' exclusive_or_expression=0D - self.match(self.input, 93, self.FOLLOW_93_in_inclu= sive_or_expression1902)=0D + self.match(=0D + self.input, 93, self.FOLLOW_93_in_inclusive_or= _expression1902)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_exclusive_or_exp= ression_in_inclusive_or_expression1904)=0D + self.following.append(=0D + self.FOLLOW_exclusive_or_expression_in_inclusi= ve_or_expression1904)=0D self.exclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop78=0D -=0D -=0D -=0D -=0D -=0D + break # loop78=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 54, inclusive_or_expression_Start= Index)=0D + self.memoize(self.input, 54,=0D + inclusive_or_expression_StartIndex)=0D =0D pass=0D =0D @@ -8484,9 +8367,9 @@ class CParser(Parser): =0D # $ANTLR end inclusive_or_expression=0D =0D -=0D # $ANTLR start exclusive_or_expression=0D # C.g:496:1: exclusive_or_expression : and_expression ( '^' and_expres= sion )* ;=0D +=0D def exclusive_or_expression(self, ):=0D =0D exclusive_or_expression_StartIndex =3D self.input.index()=0D @@ -8497,46 +8380,43 @@ class CParser(Parser): =0D # C.g:497:2: ( and_expression ( '^' and_expression )* )=0D # C.g:497:4: and_expression ( '^' and_expression )*=0D - self.following.append(self.FOLLOW_and_expression_in_exclus= ive_or_expression1917)=0D + self.following.append(=0D + self.FOLLOW_and_expression_in_exclusive_or_expression1= 917)=0D self.and_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:497:19: ( '^' and_expression )*=0D - while True: #loop79=0D + while True: # loop79=0D alt79 =3D 2=0D LA79_0 =3D self.input.LA(1)=0D =0D - if (LA79_0 =3D=3D 94) :=0D + if (LA79_0 =3D=3D 94):=0D alt79 =3D 1=0D =0D -=0D if alt79 =3D=3D 1:=0D # C.g:497:20: '^' and_expression=0D - self.match(self.input, 94, self.FOLLOW_94_in_exclu= sive_or_expression1920)=0D + self.match(=0D + self.input, 94, self.FOLLOW_94_in_exclusive_or= _expression1920)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_and_expression_i= n_exclusive_or_expression1922)=0D + self.following.append(=0D + self.FOLLOW_and_expression_in_exclusive_or_exp= ression1922)=0D self.and_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop79=0D -=0D -=0D -=0D -=0D -=0D + break # loop79=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 55, exclusive_or_expression_Start= Index)=0D + self.memoize(self.input, 55,=0D + exclusive_or_expression_StartIndex)=0D =0D pass=0D =0D @@ -8544,9 +8424,9 @@ class CParser(Parser): =0D # $ANTLR end exclusive_or_expression=0D =0D -=0D # $ANTLR start and_expression=0D # C.g:500:1: and_expression : equality_expression ( '&' equality_expre= ssion )* ;=0D +=0D def and_expression(self, ):=0D =0D and_expression_StartIndex =3D self.input.index()=0D @@ -8557,39 +8437,35 @@ class CParser(Parser): =0D # C.g:501:2: ( equality_expression ( '&' equality_expressi= on )* )=0D # C.g:501:4: equality_expression ( '&' equality_expression= )*=0D - self.following.append(self.FOLLOW_equality_expression_in_a= nd_expression1935)=0D + self.following.append(=0D + self.FOLLOW_equality_expression_in_and_expression1935)= =0D self.equality_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:501:24: ( '&' equality_expression )*=0D - while True: #loop80=0D + while True: # loop80=0D alt80 =3D 2=0D LA80_0 =3D self.input.LA(1)=0D =0D - if (LA80_0 =3D=3D 77) :=0D + if (LA80_0 =3D=3D 77):=0D alt80 =3D 1=0D =0D -=0D if alt80 =3D=3D 1:=0D # C.g:501:25: '&' equality_expression=0D - self.match(self.input, 77, self.FOLLOW_77_in_and_e= xpression1938)=0D + self.match(self.input, 77,=0D + self.FOLLOW_77_in_and_expression1938)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_equality_express= ion_in_and_expression1940)=0D + self.following.append(=0D + self.FOLLOW_equality_expression_in_and_express= ion1940)=0D self.equality_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop80=0D -=0D -=0D -=0D -=0D -=0D + break # loop80=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8604,9 +8480,9 @@ class CParser(Parser): =0D # $ANTLR end and_expression=0D =0D -=0D # $ANTLR start equality_expression=0D # C.g:503:1: equality_expression : relational_expression ( ( '=3D=3D' = | '!=3D' ) relational_expression )* ;=0D +=0D def equality_expression(self, ):=0D =0D equality_expression_StartIndex =3D self.input.index()=0D @@ -8617,24 +8493,24 @@ class CParser(Parser): =0D # C.g:504:2: ( relational_expression ( ( '=3D=3D' | '!=3D'= ) relational_expression )* )=0D # C.g:504:4: relational_expression ( ( '=3D=3D' | '!=3D' )= relational_expression )*=0D - self.following.append(self.FOLLOW_relational_expression_in= _equality_expression1952)=0D + self.following.append(=0D + self.FOLLOW_relational_expression_in_equality_expressi= on1952)=0D self.relational_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:504:26: ( ( '=3D=3D' | '!=3D' ) relational_expressio= n )*=0D - while True: #loop81=0D + while True: # loop81=0D alt81 =3D 2=0D LA81_0 =3D self.input.LA(1)=0D =0D - if ((95 <=3D LA81_0 <=3D 96)) :=0D + if ((95 <=3D LA81_0 <=3D 96)):=0D alt81 =3D 1=0D =0D -=0D if alt81 =3D=3D 1:=0D # C.g:504:27: ( '=3D=3D' | '!=3D' ) relational_exp= ression=0D if (95 <=3D self.input.LA(1) <=3D 96):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8646,24 +8522,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_equali= ty_expression1955=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_relational_expre= ssion_in_equality_expression1961)=0D + self.following.append(=0D + self.FOLLOW_relational_expression_in_equality_= expression1961)=0D self.relational_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop81=0D -=0D -=0D -=0D -=0D -=0D + break # loop81=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8678,9 +8548,9 @@ class CParser(Parser): =0D # $ANTLR end equality_expression=0D =0D -=0D # $ANTLR start relational_expression=0D # C.g:507:1: relational_expression : shift_expression ( ( '<' | '>' | = '<=3D' | '>=3D' ) shift_expression )* ;=0D +=0D def relational_expression(self, ):=0D =0D relational_expression_StartIndex =3D self.input.index()=0D @@ -8691,24 +8561,24 @@ class CParser(Parser): =0D # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=3D' | '= >=3D' ) shift_expression )* )=0D # C.g:508:4: shift_expression ( ( '<' | '>' | '<=3D' | '>= =3D' ) shift_expression )*=0D - self.following.append(self.FOLLOW_shift_expression_in_rela= tional_expression1975)=0D + self.following.append(=0D + self.FOLLOW_shift_expression_in_relational_expression1= 975)=0D self.shift_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:508:21: ( ( '<' | '>' | '<=3D' | '>=3D' ) shift_expr= ession )*=0D - while True: #loop82=0D + while True: # loop82=0D alt82 =3D 2=0D LA82_0 =3D self.input.LA(1)=0D =0D - if ((97 <=3D LA82_0 <=3D 100)) :=0D + if ((97 <=3D LA82_0 <=3D 100)):=0D alt82 =3D 1=0D =0D -=0D if alt82 =3D=3D 1:=0D # C.g:508:22: ( '<' | '>' | '<=3D' | '>=3D' ) shif= t_expression=0D if (97 <=3D self.input.LA(1) <=3D 100):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8720,24 +8590,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_relati= onal_expression1978=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_shift_expression= _in_relational_expression1988)=0D + self.following.append(=0D + self.FOLLOW_shift_expression_in_relational_exp= ression1988)=0D self.shift_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop82=0D -=0D -=0D -=0D -=0D -=0D + break # loop82=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8752,9 +8616,9 @@ class CParser(Parser): =0D # $ANTLR end relational_expression=0D =0D -=0D # $ANTLR start shift_expression=0D # C.g:511:1: shift_expression : additive_expression ( ( '<<' | '>>' ) = additive_expression )* ;=0D +=0D def shift_expression(self, ):=0D =0D shift_expression_StartIndex =3D self.input.index()=0D @@ -8765,24 +8629,24 @@ class CParser(Parser): =0D # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) addit= ive_expression )* )=0D # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additiv= e_expression )*=0D - self.following.append(self.FOLLOW_additive_expression_in_s= hift_expression2001)=0D + self.following.append(=0D + self.FOLLOW_additive_expression_in_shift_expression200= 1)=0D self.additive_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )*=0D - while True: #loop83=0D + while True: # loop83=0D alt83 =3D 2=0D LA83_0 =3D self.input.LA(1)=0D =0D - if ((101 <=3D LA83_0 <=3D 102)) :=0D + if ((101 <=3D LA83_0 <=3D 102)):=0D alt83 =3D 1=0D =0D -=0D if alt83 =3D=3D 1:=0D # C.g:512:25: ( '<<' | '>>' ) additive_expression= =0D if (101 <=3D self.input.LA(1) <=3D 102):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8794,24 +8658,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_shift_= expression2004=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_additive_express= ion_in_shift_expression2010)=0D + self.following.append(=0D + self.FOLLOW_additive_expression_in_shift_expre= ssion2010)=0D self.additive_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop83=0D -=0D -=0D -=0D -=0D -=0D + break # loop83=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8826,9 +8684,9 @@ class CParser(Parser): =0D # $ANTLR end shift_expression=0D =0D -=0D # $ANTLR start statement=0D # C.g:517:1: statement : ( labeled_statement | compound_statement | ex= pression_statement | selection_statement | iteration_statement | jump_state= ment | macro_statement | asm2_statement | asm1_statement | asm_statement | = declaration );=0D +=0D def statement(self, ):=0D =0D statement_StartIndex =3D self.input.index()=0D @@ -8845,20 +8703,21 @@ class CParser(Parser): if LA84 =3D=3D 62:=0D LA84_43 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (self.synpred173()) :=0D + elif (self.synpred173()):=0D alt84 =3D 7=0D - elif (self.synpred174()) :=0D + elif (self.synpred174()):=0D alt84 =3D 8=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 43, self.input)=0D =0D raise nvae=0D =0D @@ -8869,48 +8728,51 @@ class CParser(Parser): elif LA84 =3D=3D 66:=0D LA84_47 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 47, self.input)=0D =0D raise nvae=0D =0D elif LA84 =3D=3D IDENTIFIER:=0D LA84_53 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 53, self.input)=0D =0D raise nvae=0D =0D elif LA84 =3D=3D 25:=0D LA84_68 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 68, self.input)=0D =0D raise nvae=0D =0D @@ -8921,7 +8783,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | comp= ound_statement | expression_statement | selection_statement | iteration_sta= tement | jump_statement | macro_statement | asm2_statement | asm1_statement= | asm_statement | declaration );", 84, 1, self.input)=0D =0D raise nvae=0D =0D @@ -8950,110 +8813,110 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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= )=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | compound= _statement | expression_statement | selection_statement | iteration_stateme= nt | jump_statement | macro_statement | asm2_statement | asm1_statement | a= sm_statement | declaration );", 84, 0, self.input)=0D =0D raise nvae=0D =0D if alt84 =3D=3D 1:=0D # C.g:518:4: labeled_statement=0D - self.following.append(self.FOLLOW_labeled_statement_in= _statement2025)=0D + self.following.append(=0D + self.FOLLOW_labeled_statement_in_statement2025)=0D self.labeled_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 2:=0D # C.g:519:4: compound_statement=0D - self.following.append(self.FOLLOW_compound_statement_i= n_statement2030)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_statement2030)=0D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 3:=0D # C.g:520:4: expression_statement=0D - self.following.append(self.FOLLOW_expression_statement= _in_statement2035)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_statement2035)= =0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 4:=0D # C.g:521:4: selection_statement=0D - self.following.append(self.FOLLOW_selection_statement_= in_statement2040)=0D + self.following.append(=0D + self.FOLLOW_selection_statement_in_statement2040)= =0D self.selection_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 5:=0D # C.g:522:4: iteration_statement=0D - self.following.append(self.FOLLOW_iteration_statement_= in_statement2045)=0D + self.following.append(=0D + self.FOLLOW_iteration_statement_in_statement2045)= =0D self.iteration_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 6:=0D # C.g:523:4: jump_statement=0D - self.following.append(self.FOLLOW_jump_statement_in_st= atement2050)=0D + self.following.append(=0D + self.FOLLOW_jump_statement_in_statement2050)=0D self.jump_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 7:=0D # C.g:524:4: macro_statement=0D - self.following.append(self.FOLLOW_macro_statement_in_s= tatement2055)=0D + self.following.append(=0D + self.FOLLOW_macro_statement_in_statement2055)=0D self.macro_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 8:=0D # C.g:525:4: asm2_statement=0D - self.following.append(self.FOLLOW_asm2_statement_in_st= atement2060)=0D + self.following.append(=0D + self.FOLLOW_asm2_statement_in_statement2060)=0D self.asm2_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 9:=0D # C.g:526:4: asm1_statement=0D - self.following.append(self.FOLLOW_asm1_statement_in_st= atement2065)=0D + self.following.append(=0D + self.FOLLOW_asm1_statement_in_statement2065)=0D self.asm1_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 10:=0D # C.g:527:4: asm_statement=0D - self.following.append(self.FOLLOW_asm_statement_in_sta= tement2070)=0D + self.following.append(=0D + self.FOLLOW_asm_statement_in_statement2070)=0D self.asm_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 11:=0D # C.g:528:4: declaration=0D - self.following.append(self.FOLLOW_declaration_in_state= ment2075)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_statement2075)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9067,9 +8930,9 @@ class CParser(Parser): =0D # $ANTLR end statement=0D =0D -=0D # $ANTLR start asm2_statement=0D # C.g:531:1: asm2_statement : ( '__asm__' )? IDENTIFIER '(' (~ ( ';' )= )* ')' ';' ;=0D +=0D def asm2_statement(self, ):=0D =0D asm2_statement_StartIndex =3D self.input.index()=0D @@ -9084,42 +8947,41 @@ class CParser(Parser): alt85 =3D 2=0D LA85_0 =3D self.input.LA(1)=0D =0D - if (LA85_0 =3D=3D 103) :=0D + if (LA85_0 =3D=3D 103):=0D alt85 =3D 1=0D if alt85 =3D=3D 1:=0D # C.g:0:0: '__asm__'=0D - self.match(self.input, 103, self.FOLLOW_103_in_asm2_st= atement2086)=0D + self.match(self.input, 103,=0D + self.FOLLOW_103_in_asm2_statement2086)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_asm2_statement2089)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_asm2_statement2089)=0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_asm2_statemen= t2091)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_asm2_statement2091)=0D if self.failed:=0D return=0D # C.g:532:30: (~ ( ';' ) )*=0D - while True: #loop86=0D + while True: # loop86=0D alt86 =3D 2=0D LA86_0 =3D self.input.LA(1)=0D =0D - if (LA86_0 =3D=3D 63) :=0D + if (LA86_0 =3D=3D 63):=0D LA86_1 =3D self.input.LA(2)=0D =0D - if ((IDENTIFIER <=3D LA86_1 <=3D LINE_COMMAND) or = (26 <=3D LA86_1 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA86_1 <=3D LINE_COMMAND) or = (26 <=3D LA86_1 <=3D 117)):=0D alt86 =3D 1=0D =0D -=0D - elif ((IDENTIFIER <=3D LA86_0 <=3D LINE_COMMAND) or (2= 6 <=3D LA86_0 <=3D 62) or (64 <=3D LA86_0 <=3D 117)) :=0D + elif ((IDENTIFIER <=3D LA86_0 <=3D LINE_COMMAND) or (2= 6 <=3D LA86_0 <=3D 62) or (64 <=3D LA86_0 <=3D 117)):=0D alt86 =3D 1=0D =0D -=0D if alt86 =3D=3D 1:=0D # C.g:532:31: ~ ( ';' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D LINE_COM= MAND) or (26 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9131,26 +8993,21 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm2_s= tatement2094=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop86=0D + break # loop86=0D =0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_asm2_statemen= t2101)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_asm2_statement2101)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_asm2_statemen= t2103)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_asm2_statement2103)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9164,9 +9021,9 @@ class CParser(Parser): =0D # $ANTLR end asm2_statement=0D =0D -=0D # $ANTLR start asm1_statement=0D # C.g:535:1: asm1_statement : '_asm' '{' (~ ( '}' ) )* '}' ;=0D +=0D def asm1_statement(self, ):=0D =0D asm1_statement_StartIndex =3D self.input.index()=0D @@ -9177,25 +9034,26 @@ class CParser(Parser): =0D # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' )=0D # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}'=0D - self.match(self.input, 104, self.FOLLOW_104_in_asm1_statem= ent2115)=0D + self.match(self.input, 104,=0D + self.FOLLOW_104_in_asm1_statement2115)=0D if self.failed:=0D return=0D - self.match(self.input, 43, self.FOLLOW_43_in_asm1_statemen= t2117)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_asm1_statement2117)=0D if self.failed:=0D return=0D # C.g:536:15: (~ ( '}' ) )*=0D - while True: #loop87=0D + while True: # loop87=0D alt87 =3D 2=0D LA87_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA87_0 <=3D 43) or (45 <=3D LA87_= 0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA87_0 <=3D 43) or (45 <=3D LA87_= 0 <=3D 117)):=0D alt87 =3D 1=0D =0D -=0D if alt87 =3D=3D 1:=0D # C.g:536:16: ~ ( '}' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D 43) or (= 45 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9207,23 +9065,17 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm1_s= tatement2120=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop87=0D + break # loop87=0D =0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_asm1_statemen= t2127)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_asm1_statement2127)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9237,9 +9089,9 @@ class CParser(Parser): =0D # $ANTLR end asm1_statement=0D =0D -=0D # $ANTLR start asm_statement=0D # C.g:539:1: asm_statement : '__asm' '{' (~ ( '}' ) )* '}' ;=0D +=0D def asm_statement(self, ):=0D =0D asm_statement_StartIndex =3D self.input.index()=0D @@ -9250,25 +9102,25 @@ class CParser(Parser): =0D # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' )=0D # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}'=0D - self.match(self.input, 105, self.FOLLOW_105_in_asm_stateme= nt2138)=0D + self.match(self.input, 105,=0D + self.FOLLOW_105_in_asm_statement2138)=0D if self.failed:=0D return=0D self.match(self.input, 43, self.FOLLOW_43_in_asm_statement= 2140)=0D if self.failed:=0D return=0D # C.g:540:16: (~ ( '}' ) )*=0D - while True: #loop88=0D + while True: # loop88=0D alt88 =3D 2=0D LA88_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA88_0 <=3D 43) or (45 <=3D LA88_= 0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA88_0 <=3D 43) or (45 <=3D LA88_= 0 <=3D 117)):=0D alt88 =3D 1=0D =0D -=0D if alt88 =3D=3D 1:=0D # C.g:540:17: ~ ( '}' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D 43) or (= 45 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9280,23 +9132,16 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm_st= atement2143=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop88=0D -=0D + break # loop88=0D =0D self.match(self.input, 44, self.FOLLOW_44_in_asm_statement= 2150)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9310,9 +9155,9 @@ class CParser(Parser): =0D # $ANTLR end asm_statement=0D =0D -=0D # $ANTLR start macro_statement=0D # C.g:543:1: macro_statement : IDENTIFIER '(' ( declaration )* ( state= ment_list )? ( expression )? ')' ;=0D +=0D def macro_statement(self, ):=0D =0D macro_statement_StartIndex =3D self.input.index()=0D @@ -9323,14 +9168,16 @@ class CParser(Parser): =0D # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement= _list )? ( expression )? ')' )=0D # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_l= ist )? ( expression )? ')'=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_macro_statement2162)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_macro_statement2162)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_macro_stateme= nt2164)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_macro_statement2164)=0D if self.failed:=0D return=0D # C.g:544:19: ( declaration )*=0D - while True: #loop89=0D + while True: # loop89=0D alt89 =3D 2=0D LA89 =3D self.input.LA(1)=0D if LA89 =3D=3D IDENTIFIER:=0D @@ -9338,1904 +9185,1622 @@ class CParser(Parser): if LA89 =3D=3D 62:=0D LA89_45 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_47 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 66:=0D LA89_50 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_68 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_71 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_72 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_73 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_74 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_75 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_76 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_77 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_78 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_79 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_80 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_81 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_82 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_83 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_84 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_85 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_86 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 26:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D=3D= 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_87 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_88 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_89 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_90 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_91 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_92 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_93 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_94 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_95 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_96 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_97 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_98 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_99 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_100 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 66:=0D LA89_101 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_102 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_103 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_104 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_105 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D=3D 3= 1 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_106 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_107 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_108 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_109 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_110 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_111 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_112 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_113 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_114 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_115 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_116 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_117 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_118 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_119 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_120 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_121 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_122 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_123 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_124 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_125 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 34:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_126 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_127 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_128 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_129 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_130 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_131 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_132 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_133 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_134 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_135 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_136 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_137 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_138 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_139 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_140 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_141 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_142 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_143 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_144 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_145 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 35:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_146 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_147 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_148 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_149 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_150 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_151 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_152 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_153 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_154 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_155 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_156 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_157 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_158 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_159 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_160 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_161 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_162 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_163 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_164 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_165 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 36:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_166 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_167 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_168 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_169 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_170 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_171 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_172 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_173 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_174 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_175 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_176 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_177 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_178 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_179 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_180 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_181 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_182 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_183 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_184 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_185 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 37:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_186 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_187 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_188 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_189 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_190 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_191 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_192 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_193 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_194 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_195 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_196 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_197 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_198 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_199 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_200 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_201 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_202 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_203 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_204 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_205 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 38:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_206 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_207 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_208 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_209 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_210 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_211 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_212 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_213 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_214 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_215 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_216 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_217 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_218 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_219 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_220 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_221 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_222 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_223 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_224 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_225 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 39:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_226 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_227 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_228 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_229 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_230 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_231 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_232 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_233 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_234 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_235 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_236 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_237 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_238 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_239 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_240 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_241 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_242 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_243 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_244 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_245 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 40:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_246 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_247 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_248 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_249 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_250 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_251 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_252 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_253 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_254 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_255 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_256 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_257 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_258 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_259 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_260 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_261 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_262 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_263 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_264 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_265 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 41:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_266 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_267 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_268 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_269 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_270 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_271 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_272 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_273 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_274 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_275 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_276 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_277 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_278 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_279 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_280 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_281 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_282 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_283 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_284 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_285 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 42:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_286 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_287 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_288 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_289 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_290 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_291 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_292 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_293 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_294 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_295 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_296 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_297 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_298 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_299 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_300 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_301 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_302 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_303 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_304 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_305 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_40 =3D self.input.LA(2)=0D =0D - if (LA89_40 =3D=3D IDENTIFIER) :=0D + if (LA89_40 =3D=3D IDENTIFIER):=0D LA89_306 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D - elif (LA89_40 =3D=3D 43) :=0D + elif (LA89_40 =3D=3D 43):=0D LA89_307 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D elif LA89 =3D=3D 48:=0D LA89_41 =3D self.input.LA(2)=0D =0D - if (LA89_41 =3D=3D 43) :=0D + if (LA89_41 =3D=3D 43):=0D LA89_308 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D - elif (LA89_41 =3D=3D IDENTIFIER) :=0D + elif (LA89_41 =3D=3D IDENTIFIER):=0D LA89_309 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D=3D 5= 1 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D 55 o= r LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 58 or LA89 =3D=3D 59 or L= A89 =3D=3D 60 or LA89 =3D=3D 61:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_310 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_311 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_312 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_313 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_314 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_315 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_316 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_317 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_318 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_319 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_320 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_321 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_322 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_323 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_324 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_325 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_326 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_327 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_328 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_329 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D if alt89 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_in_m= acro_statement2166)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_macro_statement2166= )=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop89=0D -=0D + break # loop89=0D =0D # C.g:544:33: ( statement_list )?=0D alt90 =3D 2=0D @@ -11247,122 +10812,122 @@ class CParser(Parser): elif LA90 =3D=3D 62:=0D LA90_45 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_46 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_47 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 64:=0D LA90_48 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_49 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_50 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_51 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_52 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_53 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_54 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_55 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_56 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_57 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_58 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_59 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_60 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_61 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_62 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_63 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_64 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_65 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_66 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_67 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_70 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25 or LA90 =3D=3D 26 or LA90 =3D=3D 29 or= LA90 =3D=3D 30 or LA90 =3D=3D 31 or LA90 =3D=3D 32 or LA90 =3D=3D 33 or LA= 90 =3D=3D 34 or LA90 =3D=3D 35 or LA90 =3D=3D 36 or LA90 =3D=3D 37 or LA90 = =3D=3D 38 or LA90 =3D=3D 39 or LA90 =3D=3D 40 or LA90 =3D=3D 41 or LA90 =3D= =3D 42 or LA90 =3D=3D 43 or LA90 =3D=3D 45 or LA90 =3D=3D 46 or LA90 =3D=3D= 48 or LA90 =3D=3D 49 or LA90 =3D=3D 50 or LA90 =3D=3D 51 or LA90 =3D=3D 52= or LA90 =3D=3D 53 or LA90 =3D=3D 54 or LA90 =3D=3D 55 or LA90 =3D=3D 56 or= LA90 =3D=3D 57 or LA90 =3D=3D 58 or LA90 =3D=3D 59 or LA90 =3D=3D 60 or LA= 90 =3D=3D 61 or LA90 =3D=3D 103 or LA90 =3D=3D 104 or LA90 =3D=3D 105 or LA= 90 =3D=3D 106 or LA90 =3D=3D 107 or LA90 =3D=3D 108 or LA90 =3D=3D 110 or L= A90 =3D=3D 111 or LA90 =3D=3D 112 or LA90 =3D=3D 113 or LA90 =3D=3D 114 or = LA90 =3D=3D 115 or LA90 =3D=3D 116 or LA90 =3D=3D 117:=0D alt90 =3D 1=0D @@ -11371,112 +10936,112 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_87 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_88 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_89 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_90 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_91 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_92 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_93 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_94 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_95 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_96 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_97 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_98 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_99 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_100 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_101 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_102 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_103 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_104 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_105 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_106 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_107 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_108 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11485,226 +11050,226 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_111 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_112 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_113 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_114 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_115 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_116 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_117 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_118 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_119 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_120 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_121 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_122 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_123 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_124 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_125 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_126 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_127 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_128 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_129 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_130 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_131 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_134 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 64:=0D LA90_135 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_136 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_137 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_138 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_139 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_140 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_141 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_142 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_143 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_144 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_145 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_146 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_147 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_148 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_149 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_150 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_151 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_152 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_153 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_154 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_155 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_156 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11713,236 +11278,236 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_159 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_160 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_161 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_162 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_163 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_164 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_165 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_166 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_167 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_168 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_169 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_170 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_171 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_172 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_173 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_174 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_175 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_176 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_177 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_178 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_179 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_181 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_183 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 64:=0D LA90_184 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_185 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_186 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_187 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_188 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_189 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_190 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_191 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_192 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_193 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_194 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_195 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_196 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_197 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_198 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_199 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_200 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_201 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_202 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_203 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_204 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_205 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_206 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11951,112 +11516,112 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_209 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_210 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_211 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_212 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_213 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_214 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_215 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_216 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_217 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_218 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_219 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_220 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_221 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_222 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_223 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_224 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_225 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_226 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_227 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_228 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_229 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_230 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -12065,404 +11630,400 @@ class CParser(Parser): if LA90 =3D=3D IDENTIFIER:=0D LA90_233 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_234 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_235 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_236 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_237 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_238 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_239 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_240 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_241 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_242 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_243 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_244 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 49 or LA90 =3D=3D 50 or LA90 =3D=3D 5= 1 or LA90 =3D=3D 52 or LA90 =3D=3D 53 or LA90 =3D=3D 54 or LA90 =3D=3D 55 o= r LA90 =3D=3D 56 or LA90 =3D=3D 57 or LA90 =3D=3D 58 or LA90 =3D=3D 59 or L= A90 =3D=3D 60 or LA90 =3D=3D 61:=0D LA90_245 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 34:=0D LA90_246 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 35:=0D LA90_247 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 36:=0D LA90_248 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 37:=0D LA90_249 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 38:=0D LA90_250 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 39:=0D LA90_251 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 40:=0D LA90_252 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 41:=0D LA90_253 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 42:=0D LA90_254 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 45 or LA90 =3D=3D 46:=0D LA90_255 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 48:=0D LA90_256 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_257 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_258 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_259 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_260 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_261 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_262 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_263 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_264 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_265 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_266 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_267 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_268 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_269 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_270 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_271 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_272 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_273 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_274 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_275 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_276 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_277 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_278 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_279 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_280 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 69 or= LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 62:=0D LA90_281 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_282 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_283 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_284 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_285 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_286 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_287 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_288 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_289 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_290 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_291 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_292 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 62:=0D LA90_293 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_294 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_295 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_296 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_297 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_298 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_299 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_300 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_301 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_302 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_303 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_304 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D if alt90 =3D=3D 1:=0D # C.g:0:0: statement_list=0D - self.following.append(self.FOLLOW_statement_list_in_ma= cro_statement2170)=0D + self.following.append(=0D + self.FOLLOW_statement_list_in_macro_statement2170)= =0D self.statement_list()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:544:49: ( expression )?=0D alt91 =3D 2=0D LA91_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA91_0 <=3D FLOATING_POINT_LITERAL) o= r LA91_0 =3D=3D 62 or LA91_0 =3D=3D 66 or (68 <=3D LA91_0 <=3D 69) or (72 <= =3D LA91_0 <=3D 74) or (77 <=3D LA91_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA91_0 <=3D FLOATING_POINT_LITERAL) o= r LA91_0 =3D=3D 62 or LA91_0 =3D=3D 66 or (68 <=3D LA91_0 <=3D 69) or (72 <= =3D LA91_0 <=3D 74) or (77 <=3D LA91_0 <=3D 79)):=0D alt91 =3D 1=0D if alt91 =3D=3D 1:=0D # C.g:0:0: expression=0D - self.following.append(self.FOLLOW_expression_in_macro_= statement2173)=0D + self.following.append(=0D + self.FOLLOW_expression_in_macro_statement2173)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_macro_stateme= nt2176)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_macro_statement2176)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -12476,9 +12037,9 @@ class CParser(Parser): =0D # $ANTLR end macro_statement=0D =0D -=0D # $ANTLR start labeled_statement=0D # C.g:547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' c= onstant_expression ':' statement | 'default' ':' statement );=0D +=0D def labeled_statement(self, ):=0D =0D labeled_statement_StartIndex =3D self.input.index()=0D @@ -12501,61 +12062,68 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("547:1: labeled_statemen= t : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement |= 'default' ':' statement );", 92, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "547:1: labeled_statement : ( IDENTIFIER ':' state= ment | 'case' constant_expression ':' statement | 'default' ':' statement )= ;", 92, 0, self.input)=0D =0D raise nvae=0D =0D if alt92 =3D=3D 1:=0D # C.g:548:4: IDENTIFIER ':' statement=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_labeled_statement2188)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_labeled_statement= 2188)=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2190)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2190)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2192)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2192)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt92 =3D=3D 2:=0D # C.g:549:4: 'case' constant_expression ':' statement= =0D - self.match(self.input, 106, self.FOLLOW_106_in_labeled= _statement2197)=0D + self.match(self.input, 106,=0D + self.FOLLOW_106_in_labeled_statement2197)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_labeled_statement2199)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_labeled_stateme= nt2199)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2201)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2201)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2203)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2203)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt92 =3D=3D 3:=0D # C.g:550:4: 'default' ':' statement=0D - self.match(self.input, 107, self.FOLLOW_107_in_labeled= _statement2208)=0D + self.match(self.input, 107,=0D + self.FOLLOW_107_in_labeled_statement2208)=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2210)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2210)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2212)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2212)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -12574,10 +12142,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start compound_statement=0D # C.g:553:1: compound_statement : '{' ( declaration )* ( statement_lis= t )? '}' ;=0D +=0D def compound_statement(self, ):=0D =0D retval =3D self.compound_statement_return()=0D @@ -12590,11 +12157,12 @@ class CParser(Parser): =0D # C.g:554:2: ( '{' ( declaration )* ( statement_list )? '}= ' )=0D # C.g:554:4: '{' ( declaration )* ( statement_list )? '}'= =0D - self.match(self.input, 43, self.FOLLOW_43_in_compound_stat= ement2223)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_compound_statement2223)=0D if self.failed:=0D return retval=0D # C.g:554:8: ( declaration )*=0D - while True: #loop93=0D + while True: # loop93=0D alt93 =3D 2=0D LA93 =3D self.input.LA(1)=0D if LA93 =3D=3D IDENTIFIER:=0D @@ -12602,1930 +12170,1645 @@ class CParser(Parser): if LA93 =3D=3D 62:=0D LA93_44 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_47 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 66:=0D LA93_48 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_49 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_50 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_51 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_52 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_53 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_54 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_55 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_56 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_57 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_58 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_59 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_60 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_61 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_62 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_63 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_64 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_65 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 26:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D=3D= 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_86 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_87 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_88 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_89 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_90 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_91 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_92 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_93 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_94 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_95 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_96 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_97 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_98 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_99 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 66:=0D LA93_100 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_101 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_102 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_103 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_104 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D=3D 3= 1 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_105 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_106 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_107 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_108 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_109 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_110 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_111 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_112 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_113 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_114 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_115 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_116 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_117 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_118 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_119 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_120 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_121 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_122 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_123 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_124 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 34:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_125 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_126 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_127 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_128 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_129 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_130 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_131 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_132 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_133 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_134 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_135 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_136 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_137 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_138 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_139 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_140 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_141 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_142 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_143 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_144 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 35:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_145 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_146 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_147 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_148 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_149 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_150 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_151 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_152 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_153 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_154 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_155 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_156 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_157 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_158 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_159 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_160 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_161 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_162 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_163 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_164 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 36:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_165 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_166 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_167 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_168 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_169 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_170 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_171 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_172 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_173 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_174 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_175 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_176 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_177 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_178 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_179 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_180 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_181 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_182 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_183 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_184 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 37:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_185 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_186 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_187 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_188 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_189 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_190 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_191 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_192 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_193 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_194 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_195 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_196 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_197 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_198 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_199 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_200 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_201 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_202 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_203 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_204 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 38:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_205 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_206 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_207 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_208 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_209 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_210 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_211 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_212 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_213 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_214 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_215 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_216 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_217 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_218 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_219 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_220 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_221 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_222 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_223 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_224 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 39:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_225 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_226 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_227 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_228 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_229 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_230 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_231 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_232 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_233 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_234 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_235 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_236 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_237 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_238 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_239 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_240 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_241 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_242 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_243 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_244 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 40:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_245 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_246 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_247 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_248 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_249 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_250 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_251 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_252 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_253 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_254 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_255 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_256 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_257 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_258 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_259 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_260 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_261 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_262 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_263 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_264 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 41:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_265 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_266 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_267 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_268 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_269 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_270 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_271 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_272 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_273 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_274 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_275 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_276 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_277 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_278 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_279 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_280 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_281 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_282 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_283 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_284 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 42:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_285 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_286 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_287 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_288 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_289 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_290 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_291 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_292 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_293 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_294 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_295 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_296 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_297 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_298 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_299 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_300 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_301 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_302 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_303 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_304 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_40 =3D self.input.LA(2)=0D =0D - if (LA93_40 =3D=3D IDENTIFIER) :=0D + if (LA93_40 =3D=3D IDENTIFIER):=0D LA93_305 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D - elif (LA93_40 =3D=3D 43) :=0D + elif (LA93_40 =3D=3D 43):=0D LA93_306 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D elif LA93 =3D=3D 48:=0D LA93_41 =3D self.input.LA(2)=0D =0D - if (LA93_41 =3D=3D 43) :=0D + if (LA93_41 =3D=3D 43):=0D LA93_307 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D - elif (LA93_41 =3D=3D IDENTIFIER) :=0D + elif (LA93_41 =3D=3D IDENTIFIER):=0D LA93_308 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D=3D 5= 1 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D 55 o= r LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 58 or LA93 =3D=3D 59 or L= A93 =3D=3D 60 or LA93 =3D=3D 61:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_309 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_310 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_311 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_312 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_313 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_314 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_315 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_316 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_317 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_318 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_319 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_320 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_321 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_322 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_323 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_324 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_325 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_326 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_327 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_328 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D if alt93 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_in_c= ompound_statement2225)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_compound_statement2= 225)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop93=0D -=0D + break # loop93=0D =0D # C.g:554:21: ( statement_list )?=0D alt94 =3D 2=0D LA94_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA94_0 <=3D FLOATING_POINT_LITERAL) o= r (25 <=3D LA94_0 <=3D 26) or (29 <=3D LA94_0 <=3D 43) or (45 <=3D LA94_0 <= =3D 46) or (48 <=3D LA94_0 <=3D 62) or LA94_0 =3D=3D 66 or (68 <=3D LA94_0 = <=3D 69) or (72 <=3D LA94_0 <=3D 74) or (77 <=3D LA94_0 <=3D 79) or (103 <= =3D LA94_0 <=3D 108) or (110 <=3D LA94_0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA94_0 <=3D FLOATING_POINT_LITERAL) o= r (25 <=3D LA94_0 <=3D 26) or (29 <=3D LA94_0 <=3D 43) or (45 <=3D LA94_0 <= =3D 46) or (48 <=3D LA94_0 <=3D 62) or LA94_0 =3D=3D 66 or (68 <=3D LA94_0 = <=3D 69) or (72 <=3D LA94_0 <=3D 74) or (77 <=3D LA94_0 <=3D 79) or (103 <= =3D LA94_0 <=3D 108) or (110 <=3D LA94_0 <=3D 117)):=0D alt94 =3D 1=0D if alt94 =3D=3D 1:=0D # C.g:0:0: statement_list=0D - self.following.append(self.FOLLOW_statement_list_in_co= mpound_statement2228)=0D + self.following.append(=0D + self.FOLLOW_statement_list_in_compound_statement22= 28)=0D self.statement_list()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_compound_stat= ement2231)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_compound_statement2231)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -14539,9 +13822,9 @@ class CParser(Parser): =0D # $ANTLR end compound_statement=0D =0D -=0D # $ANTLR start statement_list=0D # C.g:557:1: statement_list : ( statement )+ ;=0D +=0D def statement_list(self, ):=0D =0D statement_list_StartIndex =3D self.input.index()=0D @@ -14554,7 +13837,7 @@ class CParser(Parser): # C.g:558:4: ( statement )+=0D # C.g:558:4: ( statement )+=0D cnt95 =3D 0=0D - while True: #loop95=0D + while True: # loop95=0D alt95 =3D 2=0D LA95 =3D self.input.LA(1)=0D if LA95 =3D=3D IDENTIFIER:=0D @@ -14562,330 +13845,283 @@ class CParser(Parser): if LA95 =3D=3D 62:=0D LA95_46 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25 or LA95 =3D=3D 29 or LA95 =3D= =3D 30 or LA95 =3D=3D 31 or LA95 =3D=3D 32 or LA95 =3D=3D 33 or LA95 =3D=3D= 34 or LA95 =3D=3D 35 or LA95 =3D=3D 36 or LA95 =3D=3D 37 or LA95 =3D=3D 38= or LA95 =3D=3D 39 or LA95 =3D=3D 40 or LA95 =3D=3D 41 or LA95 =3D=3D 42 or= LA95 =3D=3D 45 or LA95 =3D=3D 46 or LA95 =3D=3D 47 or LA95 =3D=3D 48 or LA= 95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D=3D 51 or LA95 =3D=3D 52 or LA95 = =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D 55 or LA95 =3D=3D 56 or LA95 =3D= =3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59 or LA95 =3D=3D 60 or LA95 =3D=3D= 61:=0D alt95 =3D 1=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_48 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_49 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 64:=0D LA95_50 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_51 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_52 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_53 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_54 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_55 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_56 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_57 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_58 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_59 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_60 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_61 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_62 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_63 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_64 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_65 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_66 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_67 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_68 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_69 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_88 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 64:=0D LA95_89 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_90 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_91 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_92 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_93 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_94 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_95 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_96 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_97 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_98 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_99 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_100 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_101 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_102 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_103 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_104 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_105 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_106 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_107 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_108 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_109 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_110 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -14894,157 +14130,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_113 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_114 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_115 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_116 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_117 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_118 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_119 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_120 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_121 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_122 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_123 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_124 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_125 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_126 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_127 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_128 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_129 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_130 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_131 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_132 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_133 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_135 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15053,157 +14267,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_137 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_138 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_139 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_140 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_141 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_142 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_143 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_144 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_145 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_146 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_147 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_148 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_149 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_150 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_151 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_152 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_153 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_154 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_155 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_156 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_157 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_158 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15212,157 +14404,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_161 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_162 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_163 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_164 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_165 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_166 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_167 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_168 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_169 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_170 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_171 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_172 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_173 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_174 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_175 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_176 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_177 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_178 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_179 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_180 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_181 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_182 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15371,867 +14541,742 @@ class CParser(Parser): if LA95 =3D=3D IDENTIFIER:=0D LA95_185 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 64:=0D LA95_186 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_187 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_188 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_189 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_190 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_191 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_192 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_193 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_194 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_195 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_196 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_197 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_198 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_199 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_200 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_201 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_202 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_203 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_204 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_205 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_206 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_208 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_209 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 64:=0D LA95_211 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_212 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_213 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_214 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_215 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_216 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_217 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_218 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_219 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_220 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_221 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_222 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_223 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_224 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_225 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_226 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_227 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_228 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_229 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_230 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_231 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_234 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 62:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_235 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_236 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_237 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_238 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_239 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_240 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_241 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_242 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_243 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_244 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_245 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_246 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D= =3D 51 or LA95 =3D=3D 52 or LA95 =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D= 55 or LA95 =3D=3D 56 or LA95 =3D=3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59= or LA95 =3D=3D 60 or LA95 =3D=3D 61:=0D LA95_247 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 34:=0D LA95_248 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 35:=0D LA95_249 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 36:=0D LA95_250 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 37:=0D LA95_251 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 38:=0D LA95_252 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 39:=0D LA95_253 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 40:=0D LA95_254 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 41:=0D LA95_255 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 42:=0D LA95_256 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 45 or LA95 =3D=3D 46:=0D LA95_257 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 48:=0D LA95_258 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 72:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_259 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_260 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_261 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_262 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_263 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_264 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_265 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_266 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_267 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_268 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_269 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_270 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 73:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_271 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_272 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_273 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_274 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_275 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_276 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_277 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_278 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_279 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_280 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_281 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_282 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D=3D 6= 9 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 62:=0D LA95_283 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_284 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_285 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_286 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_287 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_288 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_289 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_290 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_291 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_292 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_293 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_294 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 74:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 62:=0D LA95_295 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_296 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_297 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_298 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_299 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_300 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_301 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_302 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_303 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_304 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_305 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_306 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 25 or LA95 =3D=3D 26 or LA95 =3D=3D 2= 9 or LA95 =3D=3D 30 or LA95 =3D=3D 31 or LA95 =3D=3D 32 or LA95 =3D=3D 33 o= r LA95 =3D=3D 34 or LA95 =3D=3D 35 or LA95 =3D=3D 36 or LA95 =3D=3D 37 or L= A95 =3D=3D 38 or LA95 =3D=3D 39 or LA95 =3D=3D 40 or LA95 =3D=3D 41 or LA95= =3D=3D 42 or LA95 =3D=3D 43 or LA95 =3D=3D 45 or LA95 =3D=3D 46 or LA95 = =3D=3D 48 or LA95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D=3D 51 or LA95 =3D= =3D 52 or LA95 =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D 55 or LA95 =3D=3D= 56 or LA95 =3D=3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59 or LA95 =3D=3D 60= or LA95 =3D=3D 61 or LA95 =3D=3D 103 or LA95 =3D=3D 104 or LA95 =3D=3D 105= or LA95 =3D=3D 106 or LA95 =3D=3D 107 or LA95 =3D=3D 108 or LA95 =3D=3D 11= 0 or LA95 =3D=3D 111 or LA95 =3D=3D 112 or LA95 =3D=3D 113 or LA95 =3D=3D 1= 14 or LA95 =3D=3D 115 or LA95 =3D=3D 116 or LA95 =3D=3D 117:=0D alt95 =3D 1=0D =0D if alt95 =3D=3D 1:=0D # C.g:0:0: statement=0D - self.following.append(self.FOLLOW_statement_in_sta= tement_list2242)=0D + self.following.append(=0D + self.FOLLOW_statement_in_statement_list2242)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt95 >=3D 1:=0D - break #loop95=0D + break # loop95=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -16242,11 +15287,6 @@ class CParser(Parser): =0D cnt95 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16265,10 +15305,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start expression_statement=0D # C.g:561:1: expression_statement : ( ';' | expression ';' );=0D +=0D def expression_statement(self, ):=0D =0D retval =3D self.expression_statement_return()=0D @@ -16283,41 +15322,42 @@ class CParser(Parser): alt96 =3D 2=0D LA96_0 =3D self.input.LA(1)=0D =0D - if (LA96_0 =3D=3D 25) :=0D + if (LA96_0 =3D=3D 25):=0D alt96 =3D 1=0D - elif ((IDENTIFIER <=3D LA96_0 <=3D FLOATING_POINT_LITERAL)= or LA96_0 =3D=3D 62 or LA96_0 =3D=3D 66 or (68 <=3D LA96_0 <=3D 69) or (72= <=3D LA96_0 <=3D 74) or (77 <=3D LA96_0 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA96_0 <=3D FLOATING_POINT_LITERAL)= or LA96_0 =3D=3D 62 or LA96_0 =3D=3D 66 or (68 <=3D LA96_0 <=3D 69) or (72= <=3D LA96_0 <=3D 74) or (77 <=3D LA96_0 <=3D 79)):=0D alt96 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("561:1: expression_state= ment : ( ';' | expression ';' );", 96, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "561:1: expression_statement : ( ';' | expression = ';' );", 96, 0, self.input)=0D =0D raise nvae=0D =0D if alt96 =3D=3D 1:=0D # C.g:562:4: ';'=0D - self.match(self.input, 25, self.FOLLOW_25_in_expressio= n_statement2254)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_expression_statement2254)= =0D if self.failed:=0D return retval=0D =0D -=0D elif alt96 =3D=3D 2:=0D # C.g:563:4: expression ';'=0D - self.following.append(self.FOLLOW_expression_in_expres= sion_statement2259)=0D + self.following.append(=0D + self.FOLLOW_expression_in_expression_statement2259= )=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 25, self.FOLLOW_25_in_expressio= n_statement2261)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_expression_statement2261)= =0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16331,15 +15371,14 @@ class CParser(Parser): =0D # $ANTLR end expression_statement=0D =0D -=0D # $ANTLR start selection_statement=0D # C.g:566:1: selection_statement : ( 'if' '(' e=3D expression ')' stat= ement ( options {k=3D1; backtrack=3Dfalse; } : 'else' statement )? | 'switc= h' '(' expression ')' statement );=0D +=0D def selection_statement(self, ):=0D =0D selection_statement_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 69):=0D @@ -16349,39 +15388,46 @@ class CParser(Parser): alt98 =3D 2=0D LA98_0 =3D self.input.LA(1)=0D =0D - if (LA98_0 =3D=3D 108) :=0D + if (LA98_0 =3D=3D 108):=0D alt98 =3D 1=0D - elif (LA98_0 =3D=3D 110) :=0D + elif (LA98_0 =3D=3D 110):=0D alt98 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "566:1: selection_statement : ( 'if' '(' e=3D expr= ession ')' statement ( options {k=3D1; backtrack=3Dfalse; } : 'else' statem= ent )? | 'switch' '(' expression ')' statement );", 98, 0, self.input)=0D =0D raise nvae=0D =0D if alt98 =3D=3D 1:=0D # C.g:567:4: 'if' '(' e=3D expression ')' statement ( = options {k=3D1; backtrack=3Dfalse; } : 'else' statement )?=0D - self.match(self.input, 108, self.FOLLOW_108_in_selecti= on_statement2272)=0D + self.match(self.input, 108,=0D + self.FOLLOW_108_in_selection_statement2272)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2274)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_selection_statement2274)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_select= ion_statement2278)=0D + self.following.append(=0D + self.FOLLOW_expression_in_selection_statement2278)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2280)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_selection_statement2280)= =0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D - self.following.append(self.FOLLOW_statement_in_selecti= on_statement2284)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement2284)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D @@ -16390,47 +15436,48 @@ class CParser(Parser): alt97 =3D 2=0D LA97_0 =3D self.input.LA(1)=0D =0D - if (LA97_0 =3D=3D 109) :=0D + if (LA97_0 =3D=3D 109):=0D alt97 =3D 1=0D if alt97 =3D=3D 1:=0D # C.g:567:200: 'else' statement=0D - self.match(self.input, 109, self.FOLLOW_109_in_sel= ection_statement2299)=0D + self.match(self.input, 109,=0D + self.FOLLOW_109_in_selection_statement2= 299)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_sel= ection_statement2301)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement23= 01)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt98 =3D=3D 2:=0D # C.g:568:4: 'switch' '(' expression ')' statement=0D - self.match(self.input, 110, self.FOLLOW_110_in_selecti= on_statement2308)=0D + self.match(self.input, 110,=0D + self.FOLLOW_110_in_selection_statement2308)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2310)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_selection_statement2310)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_select= ion_statement2312)=0D + self.following.append(=0D + self.FOLLOW_expression_in_selection_statement2312)= =0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2314)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_selection_statement2314)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_selecti= on_statement2316)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement2316)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16444,15 +15491,14 @@ class CParser(Parser): =0D # $ANTLR end selection_statement=0D =0D -=0D # $ANTLR start iteration_statement=0D # C.g:571:1: iteration_statement : ( 'while' '(' e=3D expression ')' s= tatement | 'do' statement 'while' '(' e=3D expression ')' ';' | 'for' '(' e= xpression_statement e=3D expression_statement ( expression )? ')' statement= );=0D +=0D def iteration_statement(self, ):=0D =0D iteration_statement_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 70):=0D @@ -16472,82 +15518,97 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "571:1: iteration_statement : ( 'while' '(' e=3D e= xpression ')' statement | 'do' statement 'while' '(' e=3D expression ')' ';= ' | 'for' '(' expression_statement e=3D expression_statement ( expression )= ? ')' statement );", 100, 0, self.input)=0D =0D raise nvae=0D =0D if alt100 =3D=3D 1:=0D # C.g:572:4: 'while' '(' e=3D expression ')' statement= =0D - self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2327)=0D + self.match(self.input, 111,=0D + self.FOLLOW_111_in_iteration_statement2327)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2329)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2329)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2333)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2333)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2335)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2335)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2337)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2337)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D elif alt100 =3D=3D 2:=0D # C.g:573:4: 'do' statement 'while' '(' e=3D expressio= n ')' ';'=0D - self.match(self.input, 112, self.FOLLOW_112_in_iterati= on_statement2344)=0D + self.match(self.input, 112,=0D + self.FOLLOW_112_in_iteration_statement2344)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2346)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2346)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2348)=0D + self.match(self.input, 111,=0D + self.FOLLOW_111_in_iteration_statement2348)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2350)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2350)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2354)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2354)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2356)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2356)= =0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_iteration= _statement2358)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_iteration_statement2358)= =0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D elif alt100 =3D=3D 3:=0D # C.g:574:4: 'for' '(' expression_statement e=3D expre= ssion_statement ( expression )? ')' statement=0D - self.match(self.input, 113, self.FOLLOW_113_in_iterati= on_statement2365)=0D + self.match(self.input, 113,=0D + self.FOLLOW_113_in_iteration_statement2365)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2367)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2367)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2369)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_iteration_stat= ement2369)=0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2373)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_iteration_stat= ement2373)=0D e =3D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D @@ -16556,31 +15617,30 @@ class CParser(Parser): alt99 =3D 2=0D LA99_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA99_0 <=3D FLOATING_POINT_LITERA= L) or LA99_0 =3D=3D 62 or LA99_0 =3D=3D 66 or (68 <=3D LA99_0 <=3D 69) or (= 72 <=3D LA99_0 <=3D 74) or (77 <=3D LA99_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA99_0 <=3D FLOATING_POINT_LITERA= L) or LA99_0 =3D=3D 62 or LA99_0 =3D=3D 66 or (68 <=3D LA99_0 <=3D 69) or (= 72 <=3D LA99_0 <=3D 74) or (77 <=3D LA99_0 <=3D 79)):=0D alt99 =3D 1=0D if alt99 =3D=3D 1:=0D # C.g:0:0: expression=0D - self.following.append(self.FOLLOW_expression_in_it= eration_statement2375)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2= 375)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2378)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2378)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2380)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2380)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -16595,9 +15655,9 @@ class CParser(Parser): =0D # $ANTLR end iteration_statement=0D =0D -=0D # $ANTLR start jump_statement=0D # C.g:577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';'= | 'break' ';' | 'return' ';' | 'return' expression ';' );=0D +=0D def jump_statement(self, ):=0D =0D jump_statement_StartIndex =3D self.input.index()=0D @@ -16618,16 +15678,17 @@ class CParser(Parser): elif LA101 =3D=3D 117:=0D LA101_4 =3D self.input.LA(2)=0D =0D - if (LA101_4 =3D=3D 25) :=0D + if (LA101_4 =3D=3D 25):=0D alt101 =3D 4=0D - elif ((IDENTIFIER <=3D LA101_4 <=3D FLOATING_POINT_LIT= ERAL) or LA101_4 =3D=3D 62 or LA101_4 =3D=3D 66 or (68 <=3D LA101_4 <=3D 69= ) or (72 <=3D LA101_4 <=3D 74) or (77 <=3D LA101_4 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA101_4 <=3D FLOATING_POINT_LIT= ERAL) or LA101_4 =3D=3D 62 or LA101_4 =3D=3D 66 or (68 <=3D LA101_4 <=3D 69= ) or (72 <=3D LA101_4 <=3D 74) or (77 <=3D LA101_4 <=3D 79)):=0D alt101 =3D 5=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("577:1: jump_stateme= nt : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' = | 'return' expression ';' );", 101, 4, self.input)=0D + nvae =3D NoViableAltException(=0D + "577:1: jump_statement : ( 'goto' IDENTIFIER '= ;' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' = );", 101, 4, self.input)=0D =0D raise nvae=0D =0D @@ -16636,69 +15697,76 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("577:1: jump_statement := ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'r= eturn' expression ';' );", 101, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "577:1: jump_statement : ( 'goto' IDENTIFIER ';' |= 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );",= 101, 0, self.input)=0D =0D raise nvae=0D =0D if alt101 =3D=3D 1:=0D # C.g:578:4: 'goto' IDENTIFIER ';'=0D - self.match(self.input, 114, self.FOLLOW_114_in_jump_st= atement2393)=0D + self.match(self.input, 114,=0D + self.FOLLOW_114_in_jump_statement2393)=0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_jump_statement2395)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_jump_statement239= 5)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2397)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2397)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 2:=0D # C.g:579:4: 'continue' ';'=0D - self.match(self.input, 115, self.FOLLOW_115_in_jump_st= atement2402)=0D + self.match(self.input, 115,=0D + self.FOLLOW_115_in_jump_statement2402)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2404)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2404)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 3:=0D # C.g:580:4: 'break' ';'=0D - self.match(self.input, 116, self.FOLLOW_116_in_jump_st= atement2409)=0D + self.match(self.input, 116,=0D + self.FOLLOW_116_in_jump_statement2409)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2411)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2411)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 4:=0D # C.g:581:4: 'return' ';'=0D - self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2416)=0D + self.match(self.input, 117,=0D + self.FOLLOW_117_in_jump_statement2416)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2418)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2418)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 5:=0D # C.g:582:4: 'return' expression ';'=0D - self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2423)=0D + self.match(self.input, 117,=0D + self.FOLLOW_117_in_jump_statement2423)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_jump_s= tatement2425)=0D + self.following.append(=0D + self.FOLLOW_expression_in_jump_statement2425)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2427)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2427)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16716,18 +15784,17 @@ class CParser(Parser): def synpred2_fragment(self, ):=0D # C.g:119:6: ( declaration_specifiers )=0D # C.g:119:6: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d2100)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred2100)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred2=0D =0D -=0D -=0D # $ANTLR start synpred4=0D +=0D def synpred4_fragment(self, ):=0D # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaratio= n )* '{' )=0D # C.g:119:6: ( declaration_specifiers )? declarator ( declaration = )* '{'=0D @@ -16741,134 +15808,132 @@ class CParser(Parser): if LA102 =3D=3D 62:=0D LA102_21 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 29 or LA102 =3D=3D 30 or LA102 =3D=3D 31 or = LA102 =3D=3D 32 or LA102 =3D=3D 33:=0D LA102_23 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 34:=0D LA102_24 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 35:=0D LA102_25 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 36:=0D LA102_26 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 37:=0D LA102_27 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 38:=0D LA102_28 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 39:=0D LA102_29 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 40:=0D LA102_30 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 41:=0D LA102_31 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 42:=0D LA102_32 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 45 or LA102 =3D=3D 46:=0D LA102_33 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 48:=0D LA102_34 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D IDENTIFIER:=0D LA102_35 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 58:=0D LA102_36 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 66:=0D alt102 =3D 1=0D elif LA102 =3D=3D 59:=0D LA102_39 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 60:=0D LA102_40 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 49 or LA102 =3D=3D 50 or LA102 =3D=3D 51 or = LA102 =3D=3D 52 or LA102 =3D=3D 53 or LA102 =3D=3D 54 or LA102 =3D=3D 55 or= LA102 =3D=3D 56 or LA102 =3D=3D 57 or LA102 =3D=3D 61:=0D LA102_41 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 58:=0D LA102_14 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 59:=0D LA102_16 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 60:=0D LA102_17 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D if alt102 =3D=3D 1:=0D # C.g:0:0: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_sy= npred4100)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred4100)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D self.following.append(self.FOLLOW_declarator_in_synpred4103)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:119:41: ( declaration )*=0D - while True: #loop103=0D + while True: # loop103=0D alt103 =3D 2=0D LA103_0 =3D self.input.LA(1)=0D =0D - if (LA103_0 =3D=3D IDENTIFIER or LA103_0 =3D=3D 26 or (29 <=3D= LA103_0 <=3D 42) or (45 <=3D LA103_0 <=3D 46) or (48 <=3D LA103_0 <=3D 61)= ) :=0D + if (LA103_0 =3D=3D IDENTIFIER or LA103_0 =3D=3D 26 or (29 <=3D= LA103_0 <=3D 42) or (45 <=3D LA103_0 <=3D 46) or (48 <=3D LA103_0 <=3D 61)= ):=0D alt103 =3D 1=0D =0D -=0D if alt103 =3D=3D 1:=0D # C.g:0:0: declaration=0D self.following.append(self.FOLLOW_declaration_in_synpred41= 05)=0D @@ -16877,21 +15942,17 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop103=0D -=0D + break # loop103=0D =0D self.match(self.input, 43, self.FOLLOW_43_in_synpred4108)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred4=0D =0D -=0D -=0D # $ANTLR start synpred5=0D +=0D def synpred5_fragment(self, ):=0D # C.g:120:4: ( declaration )=0D # C.g:120:4: declaration=0D @@ -16901,42 +15962,38 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred5=0D =0D -=0D -=0D # $ANTLR start synpred7=0D +=0D def synpred7_fragment(self, ):=0D # C.g:146:6: ( declaration_specifiers )=0D # C.g:146:6: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d7157)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred7157)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred7=0D =0D -=0D -=0D # $ANTLR start synpred10=0D +=0D def synpred10_fragment(self, ):=0D # C.g:167:18: ( declaration_specifiers )=0D # C.g:167:18: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d10207)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred10207)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred10=0D =0D -=0D -=0D # $ANTLR start synpred14=0D +=0D def synpred14_fragment(self, ):=0D # C.g:184:7: ( type_specifier )=0D # C.g:184:7: type_specifier=0D @@ -16946,12 +16003,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred14=0D =0D -=0D -=0D # $ANTLR start synpred15=0D +=0D def synpred15_fragment(self, ):=0D # C.g:185:13: ( type_qualifier )=0D # C.g:185:13: type_qualifier=0D @@ -16961,12 +16016,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred15=0D =0D -=0D -=0D # $ANTLR start synpred33=0D +=0D def synpred33_fragment(self, ):=0D # C.g:225:16: ( type_qualifier )=0D # C.g:225:16: type_qualifier=0D @@ -16976,58 +16029,53 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred33=0D =0D -=0D -=0D # $ANTLR start synpred34=0D +=0D def synpred34_fragment(self, ):=0D # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=0D # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed34442)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred34442)=0D if self.failed:=0D return=0D # C.g:225:16: ( type_qualifier )*=0D - while True: #loop106=0D + while True: # loop106=0D alt106 =3D 2=0D LA106 =3D self.input.LA(1)=0D if LA106 =3D=3D 58:=0D LA106_2 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 59:=0D LA106_3 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 60:=0D LA106_4 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 49 or LA106 =3D=3D 50 or LA106 =3D=3D 51 or = LA106 =3D=3D 52 or LA106 =3D=3D 53 or LA106 =3D=3D 54 or LA106 =3D=3D 55 or= LA106 =3D=3D 56 or LA106 =3D=3D 57 or LA106 =3D=3D 61:=0D alt106 =3D 1=0D =0D if alt106 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_in_synpre= d34444)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_synpred34444)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop106=0D -=0D + break # loop106=0D =0D self.following.append(self.FOLLOW_declarator_in_synpred34447)=0D self.declarator()=0D @@ -17035,12 +16083,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred34=0D =0D -=0D -=0D # $ANTLR start synpred39=0D +=0D def synpred39_fragment(self, ):=0D # C.g:253:6: ( type_qualifier )=0D # C.g:253:6: type_qualifier=0D @@ -17050,12 +16096,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred39=0D =0D -=0D -=0D # $ANTLR start synpred40=0D +=0D def synpred40_fragment(self, ):=0D # C.g:253:23: ( type_specifier )=0D # C.g:253:23: type_specifier=0D @@ -17065,12 +16109,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred40=0D =0D -=0D -=0D # $ANTLR start synpred66=0D +=0D def synpred66_fragment(self, ):=0D # C.g:297:4: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? (= 'EFI_RUNTIMESERVICE' )? direct_declarator )=0D # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( '= EFI_RUNTIMESERVICE' )? direct_declarator=0D @@ -17078,7 +16120,7 @@ class CParser(Parser): alt111 =3D 2=0D LA111_0 =3D self.input.LA(1)=0D =0D - if (LA111_0 =3D=3D 66) :=0D + if (LA111_0 =3D=3D 66):=0D alt111 =3D 1=0D if alt111 =3D=3D 1:=0D # C.g:0:0: pointer=0D @@ -17088,13 +16130,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:13: ( 'EFIAPI' )?=0D alt112 =3D 2=0D LA112_0 =3D self.input.LA(1)=0D =0D - if (LA112_0 =3D=3D 58) :=0D + if (LA112_0 =3D=3D 58):=0D alt112 =3D 1=0D if alt112 =3D=3D 1:=0D # C.g:297:14: 'EFIAPI'=0D @@ -17102,13 +16142,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:25: ( 'EFI_BOOTSERVICE' )?=0D alt113 =3D 2=0D LA113_0 =3D self.input.LA(1)=0D =0D - if (LA113_0 =3D=3D 59) :=0D + if (LA113_0 =3D=3D 59):=0D alt113 =3D 1=0D if alt113 =3D=3D 1:=0D # C.g:297:26: 'EFI_BOOTSERVICE'=0D @@ -17116,13 +16154,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?=0D alt114 =3D 2=0D LA114_0 =3D self.input.LA(1)=0D =0D - if (LA114_0 =3D=3D 60) :=0D + if (LA114_0 =3D=3D 60):=0D alt114 =3D 1=0D if alt114 =3D=3D 1:=0D # C.g:297:47: 'EFI_RUNTIMESERVICE'=0D @@ -17130,20 +16166,16 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D self.following.append(self.FOLLOW_direct_declarator_in_synpred6680= 2)=0D self.direct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred66=0D =0D -=0D -=0D # $ANTLR start synpred67=0D +=0D def synpred67_fragment(self, ):=0D # C.g:303:15: ( declarator_suffix )=0D # C.g:303:15: declarator_suffix=0D @@ -17153,12 +16185,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred67=0D =0D -=0D -=0D # $ANTLR start synpred69=0D +=0D def synpred69_fragment(self, ):=0D # C.g:304:9: ( 'EFIAPI' )=0D # C.g:304:9: 'EFIAPI'=0D @@ -17166,12 +16196,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred69=0D =0D -=0D -=0D # $ANTLR start synpred70=0D +=0D def synpred70_fragment(self, ):=0D # C.g:304:35: ( declarator_suffix )=0D # C.g:304:35: declarator_suffix=0D @@ -17181,12 +16209,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred70=0D =0D -=0D -=0D # $ANTLR start synpred73=0D +=0D def synpred73_fragment(self, ):=0D # C.g:310:9: ( '(' parameter_type_list ')' )=0D # C.g:310:9: '(' parameter_type_list ')'=0D @@ -17202,12 +16228,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred73=0D =0D -=0D -=0D # $ANTLR start synpred74=0D +=0D def synpred74_fragment(self, ):=0D # C.g:311:9: ( '(' identifier_list ')' )=0D # C.g:311:9: '(' identifier_list ')'=0D @@ -17223,12 +16247,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred74=0D =0D -=0D -=0D # $ANTLR start synpred75=0D +=0D def synpred75_fragment(self, ):=0D # C.g:316:8: ( type_qualifier )=0D # C.g:316:8: type_qualifier=0D @@ -17238,12 +16260,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred75=0D =0D -=0D -=0D # $ANTLR start synpred76=0D +=0D def synpred76_fragment(self, ):=0D # C.g:316:24: ( pointer )=0D # C.g:316:24: pointer=0D @@ -17253,12 +16273,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred76=0D =0D -=0D -=0D # $ANTLR start synpred77=0D +=0D def synpred77_fragment(self, ):=0D # C.g:316:4: ( '*' ( type_qualifier )+ ( pointer )? )=0D # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?=0D @@ -17267,26 +16285,25 @@ class CParser(Parser): return=0D # C.g:316:8: ( type_qualifier )+=0D cnt116 =3D 0=0D - while True: #loop116=0D + while True: # loop116=0D alt116 =3D 2=0D LA116_0 =3D self.input.LA(1)=0D =0D - if ((49 <=3D LA116_0 <=3D 61)) :=0D + if ((49 <=3D LA116_0 <=3D 61)):=0D alt116 =3D 1=0D =0D -=0D if alt116 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_in_synpre= d77921)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_synpred77921)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt116 >=3D 1:=0D - break #loop116=0D + break # loop116=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -17297,12 +16314,11 @@ class CParser(Parser): =0D cnt116 +=3D 1=0D =0D -=0D # C.g:316:24: ( pointer )?=0D alt117 =3D 2=0D LA117_0 =3D self.input.LA(1)=0D =0D - if (LA117_0 =3D=3D 66) :=0D + if (LA117_0 =3D=3D 66):=0D alt117 =3D 1=0D if alt117 =3D=3D 1:=0D # C.g:0:0: pointer=0D @@ -17312,15 +16328,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred77=0D =0D -=0D -=0D # $ANTLR start synpred78=0D +=0D def synpred78_fragment(self, ):=0D # C.g:317:4: ( '*' pointer )=0D # C.g:317:4: '*' pointer=0D @@ -17333,12 +16344,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred78=0D =0D -=0D -=0D # $ANTLR start synpred81=0D +=0D def synpred81_fragment(self, ):=0D # C.g:326:32: ( 'OPTIONAL' )=0D # C.g:326:32: 'OPTIONAL'=0D @@ -17346,12 +16355,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred81=0D =0D -=0D -=0D # $ANTLR start synpred82=0D +=0D def synpred82_fragment(self, ):=0D # C.g:326:27: ( ',' ( 'OPTIONAL' )? parameter_declaration )=0D # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration=0D @@ -17362,10 +16369,10 @@ class CParser(Parser): alt119 =3D 2=0D LA119_0 =3D self.input.LA(1)=0D =0D - if (LA119_0 =3D=3D 53) :=0D + if (LA119_0 =3D=3D 53):=0D LA119_1 =3D self.input.LA(2)=0D =0D - if (self.synpred81()) :=0D + if (self.synpred81()):=0D alt119 =3D 1=0D if alt119 =3D=3D 1:=0D # C.g:326:32: 'OPTIONAL'=0D @@ -17373,20 +16380,17 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_parameter_declaration_in_synpred= 82981)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_synpred82981)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred82=0D =0D -=0D -=0D # $ANTLR start synpred83=0D +=0D def synpred83_fragment(self, ):=0D # C.g:330:28: ( declarator )=0D # C.g:330:28: declarator=0D @@ -17396,12 +16400,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred83=0D =0D -=0D -=0D # $ANTLR start synpred84=0D +=0D def synpred84_fragment(self, ):=0D # C.g:330:39: ( abstract_declarator )=0D # C.g:330:39: abstract_declarator=0D @@ -17411,33 +16413,31 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred84=0D =0D -=0D -=0D # $ANTLR start synpred86=0D +=0D def synpred86_fragment(self, ):=0D # C.g:330:4: ( declaration_specifiers ( declarator | abstract_decl= arator )* ( 'OPTIONAL' )? )=0D # C.g:330:4: declaration_specifiers ( declarator | abstract_declar= ator )* ( 'OPTIONAL' )?=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d86994)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred86994)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:330:27: ( declarator | abstract_declarator )*=0D - while True: #loop120=0D + while True: # loop120=0D alt120 =3D 3=0D LA120 =3D self.input.LA(1)=0D if LA120 =3D=3D 66:=0D LA120_3 =3D self.input.LA(2)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D IDENTIFIER or LA120 =3D=3D 58 or LA120 =3D= =3D 59 or LA120 =3D=3D 60:=0D alt120 =3D 1=0D elif LA120 =3D=3D 62:=0D @@ -17447,58 +16447,51 @@ class CParser(Parser): elif LA120 =3D=3D 58:=0D LA120_21 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 66:=0D LA120_22 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 59:=0D LA120_23 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 60:=0D LA120_24 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D IDENTIFIER:=0D LA120_25 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 62:=0D LA120_26 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D -=0D elif LA120 =3D=3D 64:=0D alt120 =3D 2=0D =0D @@ -17510,25 +16503,23 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D elif alt120 =3D=3D 2:=0D # C.g:330:39: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declarator_in_s= ynpred86999)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_synpred86999)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop120=0D -=0D + break # loop120=0D =0D # C.g:330:61: ( 'OPTIONAL' )?=0D alt121 =3D 2=0D LA121_0 =3D self.input.LA(1)=0D =0D - if (LA121_0 =3D=3D 53) :=0D + if (LA121_0 =3D=3D 53):=0D alt121 =3D 1=0D if alt121 =3D=3D 1:=0D # C.g:330:62: 'OPTIONAL'=0D @@ -17536,19 +16527,15 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred86=0D =0D -=0D -=0D # $ANTLR start synpred90=0D +=0D def synpred90_fragment(self, ):=0D # C.g:341:4: ( specifier_qualifier_list ( abstract_declarator )? )= =0D # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?=0D - self.following.append(self.FOLLOW_specifier_qualifier_list_in_synp= red901046)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_synpred901046)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17557,40 +16544,35 @@ class CParser(Parser): alt122 =3D 2=0D LA122_0 =3D self.input.LA(1)=0D =0D - if (LA122_0 =3D=3D 62 or LA122_0 =3D=3D 64 or LA122_0 =3D=3D 66) := =0D + if (LA122_0 =3D=3D 62 or LA122_0 =3D=3D 64 or LA122_0 =3D=3D 66):= =0D alt122 =3D 1=0D if alt122 =3D=3D 1:=0D # C.g:0:0: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declarator_in_synpr= ed901048)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_synpred901048)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred90=0D =0D -=0D -=0D # $ANTLR start synpred91=0D +=0D def synpred91_fragment(self, ):=0D # C.g:346:12: ( direct_abstract_declarator )=0D # C.g:346:12: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_declarator_in_sy= npred911067)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_synpred911067)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred91=0D =0D -=0D -=0D # $ANTLR start synpred93=0D +=0D def synpred93_fragment(self, ):=0D # C.g:351:6: ( '(' abstract_declarator ')' )=0D # C.g:351:6: '(' abstract_declarator ')'=0D @@ -17606,27 +16588,24 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred93=0D =0D -=0D -=0D # $ANTLR start synpred94=0D +=0D def synpred94_fragment(self, ):=0D # C.g:351:65: ( abstract_declarator_suffix )=0D # C.g:351:65: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declarator_suffix_in_sy= npred941098)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_synpred941098)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred94=0D =0D -=0D -=0D # $ANTLR start synpred109=0D +=0D def synpred109_fragment(self, ):=0D # C.g:386:4: ( '(' type_name ')' cast_expression )=0D # C.g:386:4: '(' type_name ')' cast_expression=0D @@ -17647,12 +16626,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred109=0D =0D -=0D -=0D # $ANTLR start synpred114=0D +=0D def synpred114_fragment(self, ):=0D # C.g:395:4: ( 'sizeof' unary_expression )=0D # C.g:395:4: 'sizeof' unary_expression=0D @@ -17665,19 +16642,18 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred114=0D =0D -=0D -=0D # $ANTLR start synpred117=0D +=0D def synpred117_fragment(self, ):=0D # C.g:409:13: ( '(' argument_expression_list ')' )=0D # C.g:409:13: '(' argument_expression_list ')'=0D self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_argument_expression_list_in_synp= red1171424)=0D + self.following.append(=0D + self.FOLLOW_argument_expression_list_in_synpred1171424)=0D self.argument_expression_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17686,19 +16662,18 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred117=0D =0D -=0D -=0D # $ANTLR start synpred118=0D +=0D def synpred118_fragment(self, ):=0D # C.g:410:13: ( '(' macro_parameter_list ')' )=0D # C.g:410:13: '(' macro_parameter_list ')'=0D self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1= 181446)=0D + self.following.append(=0D + self.FOLLOW_macro_parameter_list_in_synpred1181446)=0D self.macro_parameter_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17707,84 +16682,77 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred118=0D =0D -=0D -=0D # $ANTLR start synpred120=0D +=0D def synpred120_fragment(self, ):=0D # C.g:412:13: ( '*' IDENTIFIER )=0D # C.g:412:13: '*' IDENTIFIER=0D self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482)=0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed1201486)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred1201486)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred120=0D =0D -=0D -=0D # $ANTLR start synpred137=0D +=0D def synpred137_fragment(self, ):=0D # C.g:443:20: ( STRING_LITERAL )=0D # C.g:443:20: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_= in_synpred1371683)=0D + self.match(self.input, STRING_LITERAL,=0D + self.FOLLOW_STRING_LITERAL_in_synpred1371683)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred137=0D =0D -=0D -=0D # $ANTLR start synpred138=0D +=0D def synpred138_fragment(self, ):=0D # C.g:443:8: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )=0D # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+=0D # C.g:443:8: ( IDENTIFIER )*=0D - while True: #loop125=0D + while True: # loop125=0D alt125 =3D 2=0D LA125_0 =3D self.input.LA(1)=0D =0D - if (LA125_0 =3D=3D IDENTIFIER) :=0D + if (LA125_0 =3D=3D IDENTIFIER):=0D alt125 =3D 1=0D =0D -=0D if alt125 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_synpred1381680)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred1381680)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop125=0D -=0D + break # loop125=0D =0D # C.g:443:20: ( STRING_LITERAL )+=0D cnt126 =3D 0=0D - while True: #loop126=0D + while True: # loop126=0D alt126 =3D 2=0D LA126_0 =3D self.input.LA(1)=0D =0D - if (LA126_0 =3D=3D STRING_LITERAL) :=0D + if (LA126_0 =3D=3D STRING_LITERAL):=0D alt126 =3D 1=0D =0D -=0D if alt126 =3D=3D 1:=0D # C.g:0:0: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_= LITERAL_in_synpred1381683)=0D + self.match(self.input, STRING_LITERAL,=0D + self.FOLLOW_STRING_LITERAL_in_synpred1381683)=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt126 >=3D 1:=0D - break #loop126=0D + break # loop126=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -17795,14 +16763,10 @@ class CParser(Parser): =0D cnt126 +=3D 1=0D =0D -=0D -=0D -=0D # $ANTLR end synpred138=0D =0D -=0D -=0D # $ANTLR start synpred142=0D +=0D def synpred142_fragment(self, ):=0D # C.g:458:4: ( lvalue assignment_operator assignment_expression )= =0D # C.g:458:4: lvalue assignment_operator assignment_expression=0D @@ -17811,38 +16775,37 @@ class CParser(Parser): self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_operator_in_synpred14= 21746)=0D + self.following.append(=0D + self.FOLLOW_assignment_operator_in_synpred1421746)=0D self.assignment_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_expression_in_synpred= 1421748)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_synpred1421748)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred142=0D =0D -=0D -=0D # $ANTLR start synpred169=0D +=0D def synpred169_fragment(self, ):=0D # C.g:520:4: ( expression_statement )=0D # C.g:520:4: expression_statement=0D - self.following.append(self.FOLLOW_expression_statement_in_synpred1= 692035)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_synpred1692035)=0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred169=0D =0D -=0D -=0D # $ANTLR start synpred173=0D +=0D def synpred173_fragment(self, ):=0D # C.g:524:4: ( macro_statement )=0D # C.g:524:4: macro_statement=0D @@ -17852,12 +16815,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred173=0D =0D -=0D -=0D # $ANTLR start synpred174=0D +=0D def synpred174_fragment(self, ):=0D # C.g:525:4: ( asm2_statement )=0D # C.g:525:4: asm2_statement=0D @@ -17867,12 +16828,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred174=0D =0D -=0D -=0D # $ANTLR start synpred181=0D +=0D def synpred181_fragment(self, ):=0D # C.g:544:19: ( declaration )=0D # C.g:544:19: declaration=0D @@ -17882,12 +16841,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred181=0D =0D -=0D -=0D # $ANTLR start synpred182=0D +=0D def synpred182_fragment(self, ):=0D # C.g:544:33: ( statement_list )=0D # C.g:544:33: statement_list=0D @@ -17897,12 +16854,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred182=0D =0D -=0D -=0D # $ANTLR start synpred186=0D +=0D def synpred186_fragment(self, ):=0D # C.g:554:8: ( declaration )=0D # C.g:554:8: declaration=0D @@ -17912,12 +16867,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred186=0D =0D -=0D -=0D # $ANTLR start synpred188=0D +=0D def synpred188_fragment(self, ):=0D # C.g:558:4: ( statement )=0D # C.g:558:4: statement=0D @@ -17927,11 +16880,8 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred188=0D =0D -=0D -=0D def synpred69(self):=0D self.backtracking +=3D 1=0D start =3D self.input.mark()=0D @@ -18382,35 +17332,42 @@ class CParser(Parser): self.failed =3D False=0D return success=0D =0D -=0D -=0D -=0D -=0D - 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])=0D + FOLLOW_external_declaration_in_translation_unit74 =3D frozenset(=0D + [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])=0D FOLLOW_function_definition_in_external_declaration113 =3D frozenset([1= ])=0D FOLLOW_declaration_in_external_declaration118 =3D frozenset([1])=0D FOLLOW_macro_statement_in_external_declaration123 =3D frozenset([1, 25= ])=0D FOLLOW_25_in_external_declaration126 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_function_definition157 =3D frozenset(= [4, 58, 59, 60, 62, 66])=0D - FOLLOW_declarator_in_function_definition160 =3D frozenset([4, 26, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50,= 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_declaration_in_function_definition166 =3D frozenset([4, 26, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50= , 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_specifiers_in_function_definition157 =3D frozenset(= =0D + [4, 58, 59, 60, 62, 66])=0D + FOLLOW_declarator_in_function_definition160 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_in_function_definition166 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D FOLLOW_compound_statement_in_function_definition171 =3D frozenset([1])= =0D FOLLOW_compound_statement_in_function_definition180 =3D frozenset([1])= =0D - FOLLOW_26_in_declaration203 =3D frozenset([4, 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])=0D - FOLLOW_declaration_specifiers_in_declaration207 =3D frozenset([4, 58, = 59, 60, 62, 66])=0D + FOLLOW_26_in_declaration203 =3D frozenset([4, 29, 30, 31, 32, 33, 34, = 35, 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50= , 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_declaration_specifiers_in_declaration207 =3D frozenset(=0D + [4, 58, 59, 60, 62, 66])=0D FOLLOW_init_declarator_list_in_declaration216 =3D frozenset([25])=0D FOLLOW_25_in_declaration220 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_declaration234 =3D frozenset([4, 25, = 58, 59, 60, 62, 66])=0D + FOLLOW_declaration_specifiers_in_declaration234 =3D frozenset(=0D + [4, 25, 58, 59, 60, 62, 66])=0D FOLLOW_init_declarator_list_in_declaration238 =3D frozenset([25])=0D FOLLOW_25_in_declaration243 =3D frozenset([1])=0D - FOLLOW_storage_class_specifier_in_declaration_specifiers264 =3D frozen= set([1, 4, 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])=0D - FOLLOW_type_specifier_in_declaration_specifiers272 =3D frozenset([1, 4= , 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 5= 0, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_declaration_specifiers286 =3D frozenset([1, 4= , 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 5= 0, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_storage_class_specifier_in_declaration_specifiers264 =3D frozen= set(=0D + [1, 4, 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])=0D + FOLLOW_type_specifier_in_declaration_specifiers272 =3D frozenset(=0D + [1, 4, 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])=0D + FOLLOW_type_qualifier_in_declaration_specifiers286 =3D frozenset(=0D + [1, 4, 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])=0D FOLLOW_init_declarator_in_init_declarator_list308 =3D frozenset([1, 27= ])=0D FOLLOW_27_in_init_declarator_list311 =3D frozenset([4, 58, 59, 60, 62,= 66])=0D FOLLOW_init_declarator_in_init_declarator_list313 =3D frozenset([1, 27= ])=0D FOLLOW_declarator_in_init_declarator326 =3D frozenset([1, 28])=0D - FOLLOW_28_in_init_declarator329 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 4= 3, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_28_in_init_declarator329 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_in_init_declarator331 =3D frozenset([1])=0D FOLLOW_set_in_storage_class_specifier0 =3D frozenset([1])=0D FOLLOW_34_in_type_specifier376 =3D frozenset([1])=0D @@ -18428,25 +17385,34 @@ class CParser(Parser): FOLLOW_IDENTIFIER_in_type_id467 =3D frozenset([1])=0D FOLLOW_struct_or_union_in_struct_or_union_specifier494 =3D frozenset([= 4, 43])=0D FOLLOW_IDENTIFIER_in_struct_or_union_specifier496 =3D frozenset([43])= =0D - FOLLOW_43_in_struct_or_union_specifier499 =3D frozenset([4, 34, 35, 36= , 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 5= 8, 59, 60, 61])=0D - FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 =3D fro= zenset([44])=0D + FOLLOW_43_in_struct_or_union_specifier499 =3D frozenset(=0D + [4, 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])=0D + FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 =3D fro= zenset([=0D + = 44])=0D FOLLOW_44_in_struct_or_union_specifier503 =3D frozenset([1])=0D FOLLOW_struct_or_union_in_struct_or_union_specifier508 =3D frozenset([= 4])=0D FOLLOW_IDENTIFIER_in_struct_or_union_specifier510 =3D frozenset([1])=0D FOLLOW_set_in_struct_or_union0 =3D frozenset([1])=0D - FOLLOW_struct_declaration_in_struct_declaration_list537 =3D frozenset(= [1, 4, 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])=0D - FOLLOW_specifier_qualifier_list_in_struct_declaration549 =3D frozenset= ([4, 47, 58, 59, 60, 62, 66])=0D + FOLLOW_struct_declaration_in_struct_declaration_list537 =3D frozenset(= =0D + [1, 4, 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])=0D + FOLLOW_specifier_qualifier_list_in_struct_declaration549 =3D frozenset= (=0D + [4, 47, 58, 59, 60, 62, 66])=0D FOLLOW_struct_declarator_list_in_struct_declaration551 =3D frozenset([= 25])=0D FOLLOW_25_in_struct_declaration553 =3D frozenset([1])=0D - FOLLOW_type_qualifier_in_specifier_qualifier_list566 =3D frozenset([1,= 4, 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])=0D - FOLLOW_type_specifier_in_specifier_qualifier_list570 =3D frozenset([1,= 4, 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])=0D + FOLLOW_type_qualifier_in_specifier_qualifier_list566 =3D frozenset(=0D + [1, 4, 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])=0D + FOLLOW_type_specifier_in_specifier_qualifier_list570 =3D frozenset(=0D + [1, 4, 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])=0D FOLLOW_struct_declarator_in_struct_declarator_list584 =3D frozenset([1= , 27])=0D - FOLLOW_27_in_struct_declarator_list587 =3D frozenset([4, 47, 58, 59, 6= 0, 62, 66])=0D + FOLLOW_27_in_struct_declarator_list587 =3D frozenset(=0D + [4, 47, 58, 59, 60, 62, 66])=0D FOLLOW_struct_declarator_in_struct_declarator_list589 =3D frozenset([1= , 27])=0D FOLLOW_declarator_in_struct_declarator602 =3D frozenset([1, 47])=0D - FOLLOW_47_in_struct_declarator605 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_47_in_struct_declarator605 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_struct_declarator607 =3D frozenset([1])= =0D - FOLLOW_47_in_struct_declarator614 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_47_in_struct_declarator614 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_struct_declarator616 =3D frozenset([1])= =0D FOLLOW_48_in_enum_specifier634 =3D frozenset([43])=0D FOLLOW_43_in_enum_specifier636 =3D frozenset([4])=0D @@ -18465,7 +17431,8 @@ class CParser(Parser): FOLLOW_27_in_enumerator_list680 =3D frozenset([4])=0D FOLLOW_enumerator_in_enumerator_list682 =3D frozenset([1, 27])=0D FOLLOW_IDENTIFIER_in_enumerator695 =3D frozenset([1, 28])=0D - FOLLOW_28_in_enumerator698 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66= , 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_28_in_enumerator698 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_enumerator700 =3D frozenset([1])=0D FOLLOW_set_in_type_qualifier0 =3D frozenset([1])=0D FOLLOW_pointer_in_declarator784 =3D frozenset([4, 58, 59, 60, 62])=0D @@ -18481,12 +17448,14 @@ class CParser(Parser): FOLLOW_declarator_in_direct_declarator834 =3D frozenset([63])=0D FOLLOW_63_in_direct_declarator836 =3D frozenset([62, 64])=0D FOLLOW_declarator_suffix_in_direct_declarator838 =3D frozenset([1, 62,= 64])=0D - FOLLOW_64_in_declarator_suffix852 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_64_in_declarator_suffix852 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_declarator_suffix854 =3D frozenset([65])= =0D FOLLOW_65_in_declarator_suffix856 =3D frozenset([1])=0D FOLLOW_64_in_declarator_suffix866 =3D frozenset([65])=0D FOLLOW_65_in_declarator_suffix868 =3D frozenset([1])=0D - FOLLOW_62_in_declarator_suffix878 =3D frozenset([4, 29, 30, 31, 32, 33= , 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 5= 5, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_62_in_declarator_suffix878 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_parameter_type_list_in_declarator_suffix880 =3D frozenset([63])= =0D FOLLOW_63_in_declarator_suffix882 =3D frozenset([1])=0D FOLLOW_62_in_declarator_suffix892 =3D frozenset([4])=0D @@ -18494,8 +17463,10 @@ class CParser(Parser): FOLLOW_63_in_declarator_suffix896 =3D frozenset([1])=0D FOLLOW_62_in_declarator_suffix906 =3D frozenset([63])=0D FOLLOW_63_in_declarator_suffix908 =3D frozenset([1])=0D - FOLLOW_66_in_pointer919 =3D frozenset([49, 50, 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_pointer921 =3D frozenset([1, 49, 50, 51, 52, = 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_66_in_pointer919 =3D frozenset(=0D + [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_type_qualifier_in_pointer921 =3D frozenset(=0D + [1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_pointer_in_pointer924 =3D frozenset([1])=0D FOLLOW_66_in_pointer930 =3D frozenset([66])=0D FOLLOW_pointer_in_pointer932 =3D frozenset([1])=0D @@ -18505,109 +17476,165 @@ class CParser(Parser): FOLLOW_53_in_parameter_type_list954 =3D frozenset([67])=0D FOLLOW_67_in_parameter_type_list958 =3D frozenset([1])=0D FOLLOW_parameter_declaration_in_parameter_list971 =3D frozenset([1, 27= ])=0D - FOLLOW_27_in_parameter_list974 =3D frozenset([4, 29, 30, 31, 32, 33, 3= 4, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, = 56, 57, 58, 59, 60, 61, 66])=0D - FOLLOW_53_in_parameter_list977 =3D frozenset([4, 29, 30, 31, 32, 33, 3= 4, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, = 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_27_in_parameter_list974 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_53_in_parameter_list977 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_parameter_declaration_in_parameter_list981 =3D frozenset([1, 27= ])=0D - FOLLOW_declaration_specifiers_in_parameter_declaration994 =3D frozense= t([1, 4, 53, 58, 59, 60, 62, 64, 66])=0D - FOLLOW_declarator_in_parameter_declaration997 =3D frozenset([1, 4, 53,= 58, 59, 60, 62, 64, 66])=0D - FOLLOW_abstract_declarator_in_parameter_declaration999 =3D frozenset([= 1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declaration_specifiers_in_parameter_declaration994 =3D frozense= t(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declarator_in_parameter_declaration997 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_abstract_declarator_in_parameter_declaration999 =3D frozenset(= =0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D FOLLOW_53_in_parameter_declaration1004 =3D frozenset([1])=0D FOLLOW_pointer_in_parameter_declaration1013 =3D frozenset([4, 66])=0D FOLLOW_IDENTIFIER_in_parameter_declaration1016 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_identifier_list1027 =3D frozenset([1, 27])=0D FOLLOW_27_in_identifier_list1031 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_identifier_list1033 =3D frozenset([1, 27])=0D - FOLLOW_specifier_qualifier_list_in_type_name1046 =3D frozenset([1, 62,= 64, 66])=0D + FOLLOW_specifier_qualifier_list_in_type_name1046 =3D frozenset([=0D + 1, 62, 64= , 66])=0D FOLLOW_abstract_declarator_in_type_name1048 =3D frozenset([1])=0D FOLLOW_type_id_in_type_name1054 =3D frozenset([1])=0D FOLLOW_pointer_in_abstract_declarator1065 =3D frozenset([1, 62, 64])=0D - FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 =3D froze= nset([1])=0D - FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 =3D froze= nset([1])=0D + FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 =3D froze= nset([=0D + = 1])=0D + FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 =3D froze= nset([=0D + = 1])=0D FOLLOW_62_in_direct_abstract_declarator1086 =3D frozenset([62, 64, 66]= )=0D - FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 =3D froze= nset([63])=0D + FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 =3D froze= nset([=0D + = 63])=0D FOLLOW_63_in_direct_abstract_declarator1090 =3D frozenset([1, 62, 64])= =0D - FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = =3D frozenset([1, 62, 64])=0D - FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = =3D frozenset([1, 62, 64])=0D + FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = =3D frozenset([=0D + = 1, 62, 64])=0D + FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = =3D frozenset([=0D + = 1, 62, 64])=0D FOLLOW_64_in_abstract_declarator_suffix1110 =3D frozenset([65])=0D FOLLOW_65_in_abstract_declarator_suffix1112 =3D frozenset([1])=0D - FOLLOW_64_in_abstract_declarator_suffix1117 =3D frozenset([4, 5, 6, 7,= 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_constant_expression_in_abstract_declarator_suffix1119 =3D froze= nset([65])=0D + FOLLOW_64_in_abstract_declarator_suffix1117 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_constant_expression_in_abstract_declarator_suffix1119 =3D froze= nset([=0D + = 65])=0D FOLLOW_65_in_abstract_declarator_suffix1121 =3D frozenset([1])=0D FOLLOW_62_in_abstract_declarator_suffix1126 =3D frozenset([63])=0D FOLLOW_63_in_abstract_declarator_suffix1128 =3D frozenset([1])=0D - FOLLOW_62_in_abstract_declarator_suffix1133 =3D frozenset([4, 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, 66])=0D - FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 =3D froze= nset([63])=0D + FOLLOW_62_in_abstract_declarator_suffix1133 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 =3D froze= nset([=0D + = 63])=0D FOLLOW_63_in_abstract_declarator_suffix1137 =3D frozenset([1])=0D FOLLOW_assignment_expression_in_initializer1150 =3D frozenset([1])=0D - FOLLOW_43_in_initializer1155 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 43, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_43_in_initializer1155 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_list_in_initializer1157 =3D frozenset([27, 44])=0D FOLLOW_27_in_initializer1159 =3D frozenset([44])=0D FOLLOW_44_in_initializer1162 =3D frozenset([1])=0D FOLLOW_initializer_in_initializer_list1173 =3D frozenset([1, 27])=0D - FOLLOW_27_in_initializer_list1176 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_27_in_initializer_list1176 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_in_initializer_list1178 =3D frozenset([1, 27])=0D - FOLLOW_assignment_expression_in_argument_expression_list1196 =3D froze= nset([1, 27, 53])=0D + FOLLOW_assignment_expression_in_argument_expression_list1196 =3D froze= nset([=0D + = 1, 27, 53])=0D FOLLOW_53_in_argument_expression_list1199 =3D frozenset([1, 27])=0D - FOLLOW_27_in_argument_expression_list1204 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_assignment_expression_in_argument_expression_list1206 =3D froze= nset([1, 27, 53])=0D + FOLLOW_27_in_argument_expression_list1204 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_assignment_expression_in_argument_expression_list1206 =3D froze= nset([=0D + = 1, 27, 53])=0D FOLLOW_53_in_argument_expression_list1209 =3D frozenset([1, 27])=0D - FOLLOW_multiplicative_expression_in_additive_expression1225 =3D frozen= set([1, 68, 69])=0D - FOLLOW_68_in_additive_expression1229 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_multiplicative_expression_in_additive_expression1231 =3D frozen= set([1, 68, 69])=0D - FOLLOW_69_in_additive_expression1235 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_multiplicative_expression_in_additive_expression1237 =3D frozen= set([1, 68, 69])=0D - FOLLOW_cast_expression_in_multiplicative_expression1251 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_66_in_multiplicative_expression1255 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1257 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_70_in_multiplicative_expression1261 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1263 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_71_in_multiplicative_expression1267 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1269 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_62_in_cast_expression1282 =3D frozenset([4, 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])=0D + FOLLOW_multiplicative_expression_in_additive_expression1225 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_68_in_additive_expression1229 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_multiplicative_expression_in_additive_expression1231 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_69_in_additive_expression1235 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_multiplicative_expression_in_additive_expression1237 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_cast_expression_in_multiplicative_expression1251 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_66_in_multiplicative_expression1255 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1257 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_70_in_multiplicative_expression1261 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1263 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_71_in_multiplicative_expression1267 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1269 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_62_in_cast_expression1282 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_cast_expression1284 =3D frozenset([63])=0D - FOLLOW_63_in_cast_expression1286 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_cast_expression1286 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_cast_expression1288 =3D frozenset([1])=0D FOLLOW_unary_expression_in_cast_expression1293 =3D frozenset([1])=0D FOLLOW_postfix_expression_in_unary_expression1304 =3D frozenset([1])=0D - FOLLOW_72_in_unary_expression1309 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_72_in_unary_expression1309 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1311 =3D frozenset([1])=0D - FOLLOW_73_in_unary_expression1316 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_73_in_unary_expression1316 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1318 =3D frozenset([1])=0D - FOLLOW_unary_operator_in_unary_expression1323 =3D frozenset([4, 5, 6, = 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_unary_operator_in_unary_expression1323 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_unary_expression1325 =3D frozenset([1])=0D - FOLLOW_74_in_unary_expression1330 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_74_in_unary_expression1330 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1332 =3D frozenset([1])=0D FOLLOW_74_in_unary_expression1337 =3D frozenset([62])=0D - FOLLOW_62_in_unary_expression1339 =3D frozenset([4, 34, 35, 36, 37, 38= , 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6= 0, 61])=0D + FOLLOW_62_in_unary_expression1339 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_unary_expression1341 =3D frozenset([63])=0D FOLLOW_63_in_unary_expression1343 =3D frozenset([1])=0D - FOLLOW_primary_expression_in_postfix_expression1367 =3D frozenset([1, = 62, 64, 66, 72, 73, 75, 76])=0D - FOLLOW_64_in_postfix_expression1383 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_primary_expression_in_postfix_expression1367 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_64_in_postfix_expression1383 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_postfix_expression1385 =3D frozenset([65])=0D - FOLLOW_65_in_postfix_expression1387 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D + FOLLOW_65_in_postfix_expression1387 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_62_in_postfix_expression1401 =3D frozenset([63])=0D - FOLLOW_63_in_postfix_expression1405 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_62_in_postfix_expression1420 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_postfix_expression1405 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_62_in_postfix_expression1420 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_argument_expression_list_in_postfix_expression1424 =3D frozense= t([63])=0D - FOLLOW_63_in_postfix_expression1428 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_62_in_postfix_expression1444 =3D frozenset([4, 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, 66])=0D + FOLLOW_63_in_postfix_expression1428 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_62_in_postfix_expression1444 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_macro_parameter_list_in_postfix_expression1446 =3D frozenset([6= 3])=0D - FOLLOW_63_in_postfix_expression1448 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D + FOLLOW_63_in_postfix_expression1448 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_75_in_postfix_expression1462 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1466 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1466 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_66_in_postfix_expression1482 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1486 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1486 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_76_in_postfix_expression1502 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1506 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D - FOLLOW_72_in_postfix_expression1522 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_73_in_postfix_expression1536 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_parameter_declaration_in_macro_parameter_list1559 =3D frozenset= ([1, 27])=0D - FOLLOW_27_in_macro_parameter_list1562 =3D frozenset([4, 29, 30, 31, 32= , 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 5= 4, 55, 56, 57, 58, 59, 60, 61, 66])=0D - FOLLOW_parameter_declaration_in_macro_parameter_list1564 =3D frozenset= ([1, 27])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1506 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_72_in_postfix_expression1522 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_73_in_postfix_expression1536 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_parameter_declaration_in_macro_parameter_list1559 =3D frozenset= ([=0D + 1= , 27])=0D + FOLLOW_27_in_macro_parameter_list1562 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_parameter_declaration_in_macro_parameter_list1564 =3D frozenset= ([=0D + 1= , 27])=0D FOLLOW_set_in_unary_operator0 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_primary_expression1613 =3D frozenset([1])=0D FOLLOW_constant_in_primary_expression1618 =3D frozenset([1])=0D - FOLLOW_62_in_primary_expression1623 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_primary_expression1623 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_primary_expression1625 =3D frozenset([63])=0D FOLLOW_63_in_primary_expression1627 =3D frozenset([1])=0D FOLLOW_HEX_LITERAL_in_constant1643 =3D frozenset([1])=0D @@ -18619,44 +17646,71 @@ class CParser(Parser): FOLLOW_IDENTIFIER_in_constant1688 =3D frozenset([1, 4])=0D FOLLOW_FLOATING_POINT_LITERAL_in_constant1699 =3D frozenset([1])=0D FOLLOW_assignment_expression_in_expression1715 =3D frozenset([1, 27])= =0D - FOLLOW_27_in_expression1718 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_27_in_expression1718 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_expression1720 =3D frozenset([1, 27])= =0D FOLLOW_conditional_expression_in_constant_expression1733 =3D frozenset= ([1])=0D - FOLLOW_lvalue_in_assignment_expression1744 =3D frozenset([28, 80, 81, = 82, 83, 84, 85, 86, 87, 88, 89])=0D - FOLLOW_assignment_operator_in_assignment_expression1746 =3D frozenset(= [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_lvalue_in_assignment_expression1744 =3D frozenset(=0D + [28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])=0D + FOLLOW_assignment_operator_in_assignment_expression1746 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_assignment_expression1748 =3D frozense= t([1])=0D FOLLOW_conditional_expression_in_assignment_expression1753 =3D frozens= et([1])=0D FOLLOW_unary_expression_in_lvalue1765 =3D frozenset([1])=0D FOLLOW_set_in_assignment_operator0 =3D frozenset([1])=0D - FOLLOW_logical_or_expression_in_conditional_expression1839 =3D frozens= et([1, 90])=0D - FOLLOW_90_in_conditional_expression1842 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_logical_or_expression_in_conditional_expression1839 =3D frozens= et([=0D + = 1, 90])=0D + FOLLOW_90_in_conditional_expression1842 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_conditional_expression1844 =3D frozenset([47])=0D - FOLLOW_47_in_conditional_expression1846 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_conditional_expression_in_conditional_expression1848 =3D frozen= set([1])=0D - FOLLOW_logical_and_expression_in_logical_or_expression1863 =3D frozens= et([1, 91])=0D - FOLLOW_91_in_logical_or_expression1866 =3D frozenset([4, 5, 6, 7, 8, 9= , 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_logical_and_expression_in_logical_or_expression1868 =3D frozens= et([1, 91])=0D - FOLLOW_inclusive_or_expression_in_logical_and_expression1881 =3D froze= nset([1, 92])=0D - FOLLOW_92_in_logical_and_expression1884 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_inclusive_or_expression_in_logical_and_expression1886 =3D froze= nset([1, 92])=0D - FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 =3D froz= enset([1, 93])=0D - FOLLOW_93_in_inclusive_or_expression1902 =3D frozenset([4, 5, 6, 7, 8,= 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 =3D froz= enset([1, 93])=0D + FOLLOW_47_in_conditional_expression1846 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_conditional_expression_in_conditional_expression1848 =3D frozen= set([=0D + = 1])=0D + FOLLOW_logical_and_expression_in_logical_or_expression1863 =3D frozens= et([=0D + = 1, 91])=0D + FOLLOW_91_in_logical_or_expression1866 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_logical_and_expression_in_logical_or_expression1868 =3D frozens= et([=0D + = 1, 91])=0D + FOLLOW_inclusive_or_expression_in_logical_and_expression1881 =3D froze= nset([=0D + = 1, 92])=0D + FOLLOW_92_in_logical_and_expression1884 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_inclusive_or_expression_in_logical_and_expression1886 =3D froze= nset([=0D + = 1, 92])=0D + FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 =3D froz= enset([=0D + = 1, 93])=0D + FOLLOW_93_in_inclusive_or_expression1902 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 =3D froz= enset([=0D + = 1, 93])=0D FOLLOW_and_expression_in_exclusive_or_expression1917 =3D frozenset([1,= 94])=0D - FOLLOW_94_in_exclusive_or_expression1920 =3D frozenset([4, 5, 6, 7, 8,= 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_94_in_exclusive_or_expression1920 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_and_expression_in_exclusive_or_expression1922 =3D frozenset([1,= 94])=0D FOLLOW_equality_expression_in_and_expression1935 =3D frozenset([1, 77]= )=0D - FOLLOW_77_in_and_expression1938 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 6= 2, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_77_in_and_expression1938 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_equality_expression_in_and_expression1940 =3D frozenset([1, 77]= )=0D - FOLLOW_relational_expression_in_equality_expression1952 =3D frozenset(= [1, 95, 96])=0D - FOLLOW_set_in_equality_expression1955 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_relational_expression_in_equality_expression1961 =3D frozenset(= [1, 95, 96])=0D - FOLLOW_shift_expression_in_relational_expression1975 =3D frozenset([1,= 97, 98, 99, 100])=0D - FOLLOW_set_in_relational_expression1978 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_shift_expression_in_relational_expression1988 =3D frozenset([1,= 97, 98, 99, 100])=0D - FOLLOW_additive_expression_in_shift_expression2001 =3D frozenset([1, 1= 01, 102])=0D - FOLLOW_set_in_shift_expression2004 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_additive_expression_in_shift_expression2010 =3D frozenset([1, 1= 01, 102])=0D + FOLLOW_relational_expression_in_equality_expression1952 =3D frozenset(= [=0D + 1,= 95, 96])=0D + FOLLOW_set_in_equality_expression1955 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_relational_expression_in_equality_expression1961 =3D frozenset(= [=0D + 1,= 95, 96])=0D + FOLLOW_shift_expression_in_relational_expression1975 =3D frozenset([=0D + 1, 97= , 98, 99, 100])=0D + FOLLOW_set_in_relational_expression1978 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_shift_expression_in_relational_expression1988 =3D frozenset([=0D + 1, 97= , 98, 99, 100])=0D + FOLLOW_additive_expression_in_shift_expression2001 =3D frozenset([=0D + 1, 101,= 102])=0D + FOLLOW_set_in_shift_expression2004 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_additive_expression_in_shift_expression2010 =3D frozenset([=0D + 1, 101,= 102])=0D FOLLOW_labeled_statement_in_statement2025 =3D frozenset([1])=0D FOLLOW_compound_statement_in_statement2030 =3D frozenset([1])=0D FOLLOW_expression_statement_in_statement2035 =3D frozenset([1])=0D @@ -18670,72 +17724,101 @@ class CParser(Parser): FOLLOW_declaration_in_statement2075 =3D frozenset([1])=0D FOLLOW_103_in_asm2_statement2086 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_asm2_statement2089 =3D frozenset([62])=0D - FOLLOW_62_in_asm2_statement2091 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, = 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,= 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68= , 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 8= 7, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,= 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm2_statement2094 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30,= 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 6= 8, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, = 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104= , 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_62_in_asm2_statement2091 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, = 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,= 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D + FOLLOW_set_in_asm2_statement2094 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30,= 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 6= 5, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, = 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1= 02, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 1= 17])=0D FOLLOW_63_in_asm2_statement2101 =3D frozenset([25])=0D FOLLOW_25_in_asm2_statement2103 =3D frozenset([1])=0D FOLLOW_104_in_asm1_statement2115 =3D frozenset([43])=0D - FOLLOW_43_in_asm1_statement2117 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67= , 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 8= 6, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, = 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm1_statement2120 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48= , 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 6= 7, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, = 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,= 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_asm1_statement2117 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D + FOLLOW_set_in_asm1_statement2120 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48= , 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 6= 5, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, = 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1= 02, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 1= 17])=0D FOLLOW_44_in_asm1_statement2127 =3D frozenset([1])=0D FOLLOW_105_in_asm_statement2138 =3D frozenset([43])=0D - FOLLOW_43_in_asm_statement2140 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 11= , 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3= 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, = 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,= 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86= , 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 1= 04, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm_statement2143 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67= , 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 8= 6, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, = 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_asm_statement2140 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 11= , 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3= 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, = 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65,= 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84= , 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102= , 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117= ])=0D + FOLLOW_set_in_asm_statement2143 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D FOLLOW_44_in_asm_statement2150 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_macro_statement2162 =3D frozenset([62])=0D - FOLLOW_62_in_macro_statement2164 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46,= 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D - FOLLOW_declaration_in_macro_statement2166 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, = 112, 113, 114, 115, 116, 117])=0D - FOLLOW_statement_list_in_macro_statement2170 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_macro_statement2164 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46,= 48, 49, 50, 51,=0D + 52, 53, 54, 55, 56, 57, 5= 8, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 1= 06, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_declaration_in_macro_statement2166 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49,=0D + 50, 51, 52, 53, = 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79,= 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_statement_list_in_macro_statement2170 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_expression_in_macro_statement2173 =3D frozenset([63])=0D FOLLOW_63_in_macro_statement2176 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_labeled_statement2188 =3D frozenset([47])=0D - FOLLOW_47_in_labeled_statement2190 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2190 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2192 =3D frozenset([1])=0D - FOLLOW_106_in_labeled_statement2197 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_106_in_labeled_statement2197 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_labeled_statement2199 =3D frozenset([47]= )=0D - FOLLOW_47_in_labeled_statement2201 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2201 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2203 =3D frozenset([1])=0D FOLLOW_107_in_labeled_statement2208 =3D frozenset([47])=0D - FOLLOW_47_in_labeled_statement2210 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2210 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2212 =3D frozenset([1])=0D - FOLLOW_43_in_compound_statement2223 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, = 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68,= 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 1= 13, 114, 115, 116, 117])=0D - FOLLOW_declaration_in_compound_statement2225 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,= 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62= , 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 11= 1, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_compound_statement2223 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, = 45, 46, 48, 49,=0D + 50, 51, 52, 53, 54, 55= , 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104,= 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_declaration_in_compound_statement2225 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,= 43, 44, 45, 46, 48,=0D + 49, 50, 51, 5= 2, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, = 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])= =0D FOLLOW_statement_list_in_compound_statement2228 =3D frozenset([44])=0D FOLLOW_44_in_compound_statement2231 =3D frozenset([1])=0D - FOLLOW_statement_in_statement_list2242 =3D frozenset([1, 4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 6= 8, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112,= 113, 114, 115, 116, 117])=0D + FOLLOW_statement_in_statement_list2242 =3D frozenset([1, 4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49,=0D + 50, 51, 52, 53, 54,= 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 1= 04, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_25_in_expression_statement2254 =3D frozenset([1])=0D FOLLOW_expression_in_expression_statement2259 =3D frozenset([25])=0D FOLLOW_25_in_expression_statement2261 =3D frozenset([1])=0D FOLLOW_108_in_selection_statement2272 =3D frozenset([62])=0D - FOLLOW_62_in_selection_statement2274 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_selection_statement2274 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_selection_statement2278 =3D frozenset([63])=0D - FOLLOW_63_in_selection_statement2280 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_selection_statement2280 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2284 =3D frozenset([1, 109])=0D - FOLLOW_109_in_selection_statement2299 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 6= 9, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113= , 114, 115, 116, 117])=0D + FOLLOW_109_in_selection_statement2299 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49,=0D + 50, 51, 52, 53, 54, = 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 10= 4, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2301 =3D frozenset([1])=0D FOLLOW_110_in_selection_statement2308 =3D frozenset([62])=0D - FOLLOW_62_in_selection_statement2310 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_selection_statement2310 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_selection_statement2312 =3D frozenset([63])=0D - FOLLOW_63_in_selection_statement2314 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_selection_statement2314 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2316 =3D frozenset([1])=0D FOLLOW_111_in_iteration_statement2327 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2329 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2329 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_iteration_statement2333 =3D frozenset([63])=0D - FOLLOW_63_in_iteration_statement2335 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_iteration_statement2335 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2337 =3D frozenset([1])=0D - FOLLOW_112_in_iteration_statement2344 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 6= 9, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113= , 114, 115, 116, 117])=0D + FOLLOW_112_in_iteration_statement2344 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49,=0D + 50, 51, 52, 53, 54, = 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 10= 4, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2346 =3D frozenset([111])=0D FOLLOW_111_in_iteration_statement2348 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2350 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2350 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_iteration_statement2354 =3D frozenset([63])=0D FOLLOW_63_in_iteration_statement2356 =3D frozenset([25])=0D FOLLOW_25_in_iteration_statement2358 =3D frozenset([1])=0D FOLLOW_113_in_iteration_statement2365 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2367 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_expression_statement_in_iteration_statement2369 =3D frozenset([= 4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_expression_statement_in_iteration_statement2373 =3D frozenset([= 4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2367 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D + FOLLOW_expression_statement_in_iteration_statement2369 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D + FOLLOW_expression_statement_in_iteration_statement2373 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_expression_in_iteration_statement2375 =3D frozenset([63])=0D - FOLLOW_63_in_iteration_statement2378 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_iteration_statement2378 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2380 =3D frozenset([1])=0D FOLLOW_114_in_jump_statement2393 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_jump_statement2395 =3D frozenset([25])=0D @@ -18746,13 +17829,17 @@ class CParser(Parser): FOLLOW_25_in_jump_statement2411 =3D frozenset([1])=0D FOLLOW_117_in_jump_statement2416 =3D frozenset([25])=0D FOLLOW_25_in_jump_statement2418 =3D frozenset([1])=0D - FOLLOW_117_in_jump_statement2423 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_117_in_jump_statement2423 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_jump_statement2425 =3D frozenset([25])=0D FOLLOW_25_in_jump_statement2427 =3D frozenset([1])=0D FOLLOW_declaration_specifiers_in_synpred2100 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_synpred4100 =3D frozenset([4, 58, 59,= 60, 62, 66])=0D - FOLLOW_declarator_in_synpred4103 =3D frozenset([4, 26, 29, 30, 31, 32,= 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53= , 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_declaration_in_synpred4105 =3D frozenset([4, 26, 29, 30, 31, 32= , 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 5= 3, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_specifiers_in_synpred4100 =3D frozenset(=0D + [4, 58, 59, 60, 62, 66])=0D + FOLLOW_declarator_in_synpred4103 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_in_synpred4105 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D FOLLOW_43_in_synpred4108 =3D frozenset([1])=0D FOLLOW_declaration_in_synpred5118 =3D frozenset([1])=0D FOLLOW_declaration_specifiers_in_synpred7157 =3D frozenset([1])=0D @@ -18760,8 +17847,10 @@ class CParser(Parser): FOLLOW_type_specifier_in_synpred14272 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred15286 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred33444 =3D frozenset([1])=0D - FOLLOW_IDENTIFIER_in_synpred34442 =3D frozenset([4, 49, 50, 51, 52, 53= , 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D - FOLLOW_type_qualifier_in_synpred34444 =3D frozenset([4, 49, 50, 51, 52= , 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_IDENTIFIER_in_synpred34442 =3D frozenset(=0D + [4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_type_qualifier_in_synpred34444 =3D frozenset(=0D + [4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D FOLLOW_declarator_in_synpred34447 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred39566 =3D frozenset([1])=0D FOLLOW_type_specifier_in_synpred40570 =3D frozenset([1])=0D @@ -18773,7 +17862,8 @@ class CParser(Parser): FOLLOW_declarator_suffix_in_synpred67821 =3D frozenset([1])=0D FOLLOW_58_in_synpred69830 =3D frozenset([1])=0D FOLLOW_declarator_suffix_in_synpred70838 =3D frozenset([1])=0D - FOLLOW_62_in_synpred73878 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D + FOLLOW_62_in_synpred73878 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_parameter_type_list_in_synpred73880 =3D frozenset([63])=0D FOLLOW_63_in_synpred73882 =3D frozenset([1])=0D FOLLOW_62_in_synpred74892 =3D frozenset([4])=0D @@ -18781,38 +17871,51 @@ class CParser(Parser): FOLLOW_63_in_synpred74896 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred75921 =3D frozenset([1])=0D FOLLOW_pointer_in_synpred76924 =3D frozenset([1])=0D - FOLLOW_66_in_synpred77919 =3D frozenset([49, 50, 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_synpred77921 =3D frozenset([1, 49, 50, 51, 52= , 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_66_in_synpred77919 =3D frozenset(=0D + [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_type_qualifier_in_synpred77921 =3D frozenset(=0D + [1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_pointer_in_synpred77924 =3D frozenset([1])=0D FOLLOW_66_in_synpred78930 =3D frozenset([66])=0D FOLLOW_pointer_in_synpred78932 =3D frozenset([1])=0D FOLLOW_53_in_synpred81977 =3D frozenset([1])=0D - FOLLOW_27_in_synpred82974 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D - FOLLOW_53_in_synpred82977 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D + FOLLOW_27_in_synpred82974 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_53_in_synpred82977 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_parameter_declaration_in_synpred82981 =3D frozenset([1])=0D FOLLOW_declarator_in_synpred83997 =3D frozenset([1])=0D FOLLOW_abstract_declarator_in_synpred84999 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_synpred86994 =3D frozenset([1, 4, 53,= 58, 59, 60, 62, 64, 66])=0D - FOLLOW_declarator_in_synpred86997 =3D frozenset([1, 4, 53, 58, 59, 60,= 62, 64, 66])=0D - FOLLOW_abstract_declarator_in_synpred86999 =3D frozenset([1, 4, 53, 58= , 59, 60, 62, 64, 66])=0D + FOLLOW_declaration_specifiers_in_synpred86994 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declarator_in_synpred86997 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_abstract_declarator_in_synpred86999 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D FOLLOW_53_in_synpred861004 =3D frozenset([1])=0D - FOLLOW_specifier_qualifier_list_in_synpred901046 =3D frozenset([1, 62,= 64, 66])=0D + FOLLOW_specifier_qualifier_list_in_synpred901046 =3D frozenset([=0D + 1, 62, 64= , 66])=0D FOLLOW_abstract_declarator_in_synpred901048 =3D frozenset([1])=0D FOLLOW_direct_abstract_declarator_in_synpred911067 =3D frozenset([1])= =0D FOLLOW_62_in_synpred931086 =3D frozenset([62, 64, 66])=0D FOLLOW_abstract_declarator_in_synpred931088 =3D frozenset([63])=0D FOLLOW_63_in_synpred931090 =3D frozenset([1])=0D FOLLOW_abstract_declarator_suffix_in_synpred941098 =3D frozenset([1])= =0D - FOLLOW_62_in_synpred1091282 =3D frozenset([4, 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]= )=0D + FOLLOW_62_in_synpred1091282 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_synpred1091284 =3D frozenset([63])=0D - FOLLOW_63_in_synpred1091286 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_synpred1091286 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_synpred1091288 =3D frozenset([1])=0D - FOLLOW_74_in_synpred1141330 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_74_in_synpred1141330 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_synpred1141332 =3D frozenset([1])=0D - FOLLOW_62_in_synpred1171420 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_synpred1171420 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_argument_expression_list_in_synpred1171424 =3D frozenset([63])= =0D FOLLOW_63_in_synpred1171428 =3D frozenset([1])=0D - FOLLOW_62_in_synpred1181444 =3D frozenset([4, 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, 66])=0D + FOLLOW_62_in_synpred1181444 =3D frozenset([4, 29, 30, 31, 32, 33, 34, = 35, 36, 37, 38,=0D + 39, 40, 41, 42, 45, 46, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_macro_parameter_list_in_synpred1181446 =3D frozenset([63])=0D FOLLOW_63_in_synpred1181448 =3D frozenset([1])=0D FOLLOW_66_in_synpred1201482 =3D frozenset([4])=0D @@ -18820,8 +17923,10 @@ class CParser(Parser): FOLLOW_STRING_LITERAL_in_synpred1371683 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_synpred1381680 =3D frozenset([4, 9])=0D FOLLOW_STRING_LITERAL_in_synpred1381683 =3D frozenset([1, 9])=0D - FOLLOW_lvalue_in_synpred1421744 =3D frozenset([28, 80, 81, 82, 83, 84,= 85, 86, 87, 88, 89])=0D - FOLLOW_assignment_operator_in_synpred1421746 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_lvalue_in_synpred1421744 =3D frozenset(=0D + [28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])=0D + FOLLOW_assignment_operator_in_synpred1421746 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_synpred1421748 =3D frozenset([1])=0D FOLLOW_expression_statement_in_synpred1692035 =3D frozenset([1])=0D FOLLOW_macro_statement_in_synpred1732055 =3D frozenset([1])=0D @@ -18830,4 +17935,3 @@ class CParser(Parser): FOLLOW_statement_list_in_synpred1822170 =3D frozenset([1])=0D FOLLOW_declaration_in_synpred1862225 =3D frozenset([1])=0D FOLLOW_statement_in_synpred1882242 =3D frozenset([1])=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py b/BaseTools/Sou= rce/Python/Ecc/CParser4/CLexer.py index a2cc5bf56e66..739152edf0f5 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CLexer.py @@ -5,7 +5,7 @@ from typing.io import TextIO import sys=0D =0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -21,6 +21,7 @@ import sys import Ecc.CodeFragment as CodeFragment=0D import Ecc.FileProfile as FileProfile=0D =0D +=0D def serializedATN():=0D with StringIO() as buf:=0D buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2k")= =0D @@ -423,7 +424,7 @@ class CLexer(Lexer): =0D atn =3D ATNDeserializer().deserialize(serializedATN())=0D =0D - decisionsToDFA =3D [ DFA(ds, i) for i, ds in enumerate(atn.decisionToS= tate) ]=0D + decisionsToDFA =3D [DFA(ds, i) for i, ds in enumerate(atn.decisionToSt= ate)]=0D =0D T__0 =3D 1=0D T__1 =3D 2=0D @@ -531,96 +532,99 @@ class CLexer(Lexer): LINE_COMMENT =3D 104=0D LINE_COMMAND =3D 105=0D =0D - channelNames =3D [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]=0D + channelNames =3D [u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN"]=0D =0D - modeNames =3D [ "DEFAULT_MODE" ]=0D + modeNames =3D ["DEFAULT_MODE"]=0D =0D - literalNames =3D [ "",=0D - "'{'", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stati= c'",=0D - "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'shor= t'",=0D - "'int'", "'long'", "'float'", "'double'", "'signed'", "'unsign= ed'",=0D - "'}'", "'struct'", "'union'", "':'", "'enum'", "'const'", "'vo= latile'",=0D - "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOL= ATILE'",=0D - "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFIAPI'", "'EFI_BOOTSERVI= CE'",=0D - "'EFI_RUNTIMESERVICE'", "'PACKED'", "'('", "')'", "'['", "']'"= ,=0D - "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", "'++'", "'--'",=0D - "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/= =3D'",=0D - "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", = "'^=3D'", "'|=3D'",=0D - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<= '",=0D - "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm= '",=0D - "'__asm'", "'case'", "'default'", "'if'", "'else'", "'switch'"= ,=0D - "'while'", "'do'", "'goto'", "'continue'", "'break'", "'return= '" ]=0D + literalNames =3D ["",=0D + "'{'", "';'", "'typedef'", "','", "'=3D'", "'extern'",= "'static'",=0D + "'auto'", "'register'", "'STATIC'", "'void'", "'char'"= , "'short'",=0D + "'int'", "'long'", "'float'", "'double'", "'signed'", = "'unsigned'",=0D + "'}'", "'struct'", "'union'", "':'", "'enum'", "'const= '", "'volatile'",=0D + "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'= ", "'VOLATILE'",=0D + "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFIAPI'", "'EFI_B= OOTSERVICE'",=0D + "'EFI_RUNTIMESERVICE'", "'PACKED'", "'('", "')'", "'['= ", "']'",=0D + "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", "'++'", "'= --'",=0D + "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '", "'/=3D'",=0D + "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'= &=3D'", "'^=3D'", "'|=3D'",=0D + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'", "'<'",=0D + "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__asm__'"= , "'_asm'",=0D + "'__asm'", "'case'", "'default'", "'if'", "'else'", "'= switch'",=0D + "'while'", "'do'", "'goto'", "'continue'", "'break'", = "'return'"]=0D =0D - symbolicNames =3D [ "",=0D - "IDENTIFIER", "CHARACTER_LITERAL", "STRING_LITERAL", "HEX_LITE= RAL",=0D - "DECIMAL_LITERAL", "OCTAL_LITERAL", "FLOATING_POINT_LITERAL",= =0D - "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",=0D - "LINE_COMMAND" ]=0D + symbolicNames =3D ["",=0D + "IDENTIFIER", "CHARACTER_LITERAL", "STRING_LITERAL", = "HEX_LITERAL",=0D + "DECIMAL_LITERAL", "OCTAL_LITERAL", "FLOATING_POINT_L= ITERAL",=0D + "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT",=0D + "LINE_COMMAND"]=0D =0D - ruleNames =3D [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6"= ,=0D - "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__1= 3",=0D - "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",=0D - "T__20", "T__21", "T__22", "T__23", "T__24", "T__25",=0D - "T__26", "T__27", "T__28", "T__29", "T__30", "T__31",=0D - "T__32", "T__33", "T__34", "T__35", "T__36", "T__37",=0D - "T__38", "T__39", "T__40", "T__41", "T__42", "T__43",=0D - "T__44", "T__45", "T__46", "T__47", "T__48", "T__49",=0D - "T__50", "T__51", "T__52", "T__53", "T__54", "T__55",=0D - "T__56", "T__57", "T__58", "T__59", "T__60", "T__61",=0D - "T__62", "T__63", "T__64", "T__65", "T__66", "T__67",=0D - "T__68", "T__69", "T__70", "T__71", "T__72", "T__73",=0D - "T__74", "T__75", "T__76", "T__77", "T__78", "T__79",=0D - "T__80", "T__81", "T__82", "T__83", "T__84", "T__85",=0D - "T__86", "T__87", "T__88", "T__89", "T__90", "T__91",=0D - "IDENTIFIER", "LETTER", "CHARACTER_LITERAL", "STRING_LIT= ERAL",=0D - "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL", "HexD= igit",=0D - "IntegerTypeSuffix", "FLOATING_POINT_LITERAL", "Exponent= ",=0D - "FloatTypeSuffix", "EscapeSequence", "OctalEscape", "Uni= codeEscape",=0D - "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMEN= T",=0D - "LINE_COMMAND" ]=0D + ruleNames =3D ["T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",= =0D + "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13= ",=0D + "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",=0D + "T__20", "T__21", "T__22", "T__23", "T__24", "T__25",=0D + "T__26", "T__27", "T__28", "T__29", "T__30", "T__31",=0D + "T__32", "T__33", "T__34", "T__35", "T__36", "T__37",=0D + "T__38", "T__39", "T__40", "T__41", "T__42", "T__43",=0D + "T__44", "T__45", "T__46", "T__47", "T__48", "T__49",=0D + "T__50", "T__51", "T__52", "T__53", "T__54", "T__55",=0D + "T__56", "T__57", "T__58", "T__59", "T__60", "T__61",=0D + "T__62", "T__63", "T__64", "T__65", "T__66", "T__67",=0D + "T__68", "T__69", "T__70", "T__71", "T__72", "T__73",=0D + "T__74", "T__75", "T__76", "T__77", "T__78", "T__79",=0D + "T__80", "T__81", "T__82", "T__83", "T__84", "T__85",=0D + "T__86", "T__87", "T__88", "T__89", "T__90", "T__91",=0D + "IDENTIFIER", "LETTER", "CHARACTER_LITERAL", "STRING_LITE= RAL",=0D + "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL", "HexDi= git",=0D + "IntegerTypeSuffix", "FLOATING_POINT_LITERAL", "Exponent"= ,=0D + "FloatTypeSuffix", "EscapeSequence", "OctalEscape", "Unic= odeEscape",=0D + "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT= ",=0D + "LINE_COMMAND"]=0D =0D grammarFileName =3D "C.g4"=0D =0D # @param output=3D sys.stdout Type: TextIO=0D - def __init__(self,input=3DNone,output=3D sys.stdout):=0D + def __init__(self, input=3DNone, output=3Dsys.stdout):=0D super().__init__(input, output)=0D self.checkVersion("4.7.1")=0D - self._interp =3D LexerATNSimulator(self, self.atn, self.decisionsT= oDFA, PredictionContextCache())=0D + self._interp =3D LexerATNSimulator(=0D + self, self.atn, self.decisionsToDFA, PredictionContextCache())= =0D self._actions =3D None=0D self._predicates =3D None=0D =0D + def printTokenInfo(self, line, offset, tokenText):=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D -=0D - def printTokenInfo(self,line,offset,tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D -=0D - def StorePredicateExpression(self,StartLine,StartOffset,EndLine,EndOff= set,Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.PredicateExpressionList.append(PredExp)=0D =0D - def StoreEnumerationDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, S= tartOffset), (EndLine, EndOffset))=0D + def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D - def StoreStructUnionDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D - def StoreTypedefDefinition(self,StartLine,StartOffset,EndLine,EndOffse= t,FromText,ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLi= ne, StartOffset), (EndLine, EndOffset))=0D + def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D - def StoreFunctionDefinition(self,StartLine,StartOffset,EndLine,EndOffs= et,ModifierText,DeclText,LeftBraceLine,LeftBraceOffset,DeclLine,DeclOffset)= :=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBrace= Offset), (DeclLine, DeclOffset))=0D + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D - def StoreVariableDeclaration(self,StartLine,StartOffset,EndLine,EndOff= set,ModifierText,DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclTex= t, (StartLine, StartOffset), (EndLine, EndOffset))=0D + def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D - def StoreFunctionCalling(self,StartLine,StartOffset,EndLine,EndOffset,= FuncName,ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (St= artLine, StartOffset), (EndLine, EndOffset))=0D + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D FileProfile.FunctionCallingList.append(FuncCall)=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/CParser4/CListener.py b/BaseTools/= Source/Python/Ecc/CParser4/CListener.py index bb4351d9249a..866d5717d42b 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CListener.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CListener.py @@ -5,7 +5,7 @@ if __name__ is not None and "." in __name__: else:=0D from CParser import CParser=0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -27,783 +27,710 @@ class CListener(ParseTreeListener): =0D # Enter a parse tree produced by CParser#translation_unit.=0D # @param ctx Type: CParser.Translation_unitContext=0D - def enterTranslation_unit(self,ctx):=0D + def enterTranslation_unit(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#translation_unit.=0D # @param ctx Type: CParser.Translation_unitContext=0D - def exitTranslation_unit(self,ctx):=0D + def exitTranslation_unit(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#external_declaration.=0D # @param ctx Type: CParser.External_declarationContext=0D - def enterExternal_declaration(self,ctx):=0D + def enterExternal_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#external_declaration.=0D # @param ctx Type: CParser.External_declarationContext=0D - def exitExternal_declaration(self,ctx):=0D + def exitExternal_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#function_definition.=0D # @param ctx Type: CParser.Function_definitionContext=0D - def enterFunction_definition(self,ctx):=0D + def enterFunction_definition(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#function_definition.=0D # @param ctx Type: CParser.Function_definitionContext=0D - def exitFunction_definition(self,ctx):=0D + def exitFunction_definition(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declaration_specifiers.=0D # @param ctx Type: CParser.Declaration_specifiersContext=0D - def enterDeclaration_specifiers(self,ctx):=0D + def enterDeclaration_specifiers(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declaration_specifiers.=0D # @param ctx Type: CParser.Declaration_specifiersContext=0D - def exitDeclaration_specifiers(self,ctx):=0D + def exitDeclaration_specifiers(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declaration.=0D # @param ctx Type: CParser.DeclarationContext=0D - def enterDeclaration(self,ctx):=0D + def enterDeclaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declaration.=0D # @param ctx Type: CParser.DeclarationContext=0D - def exitDeclaration(self,ctx):=0D + def exitDeclaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#init_declarator_list.=0D # @param ctx Type: CParser.Init_declarator_listContext=0D - def enterInit_declarator_list(self,ctx):=0D + def enterInit_declarator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#init_declarator_list.=0D # @param ctx Type: CParser.Init_declarator_listContext=0D - def exitInit_declarator_list(self,ctx):=0D + def exitInit_declarator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#init_declarator.=0D # @param ctx Type: CParser.Init_declaratorContext=0D - def enterInit_declarator(self,ctx):=0D + def enterInit_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#init_declarator.=0D # @param ctx Type: CParser.Init_declaratorContext=0D - def exitInit_declarator(self,ctx):=0D + def exitInit_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#storage_class_specifier.=0D # @param ctx Type: CParser.Storage_class_specifierContext=0D - def enterStorage_class_specifier(self,ctx):=0D + def enterStorage_class_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#storage_class_specifier.=0D # @param ctx Type: CParser.Storage_class_specifierContext=0D - def exitStorage_class_specifier(self,ctx):=0D + def exitStorage_class_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_specifier.=0D # @param ctx Type: CParser.Type_specifierContext=0D - def enterType_specifier(self,ctx):=0D + def enterType_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_specifier.=0D # @param ctx Type: CParser.Type_specifierContext=0D - def exitType_specifier(self,ctx):=0D + def exitType_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_id.=0D # @param ctx Type: CParser.Type_idContext=0D - def enterType_id(self,ctx):=0D + def enterType_id(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_id.=0D # @param ctx Type: CParser.Type_idContext=0D - def exitType_id(self,ctx):=0D + def exitType_id(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_or_union_specifier.=0D # @param ctx Type: CParser.Struct_or_union_specifierContext=0D - def enterStruct_or_union_specifier(self,ctx):=0D + def enterStruct_or_union_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_or_union_specifier.=0D # @param ctx Type: CParser.Struct_or_union_specifierContext=0D - def exitStruct_or_union_specifier(self,ctx):=0D + def exitStruct_or_union_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_or_union.=0D # @param ctx Type: CParser.Struct_or_unionContext=0D - def enterStruct_or_union(self,ctx):=0D + def enterStruct_or_union(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_or_union.=0D # @param ctx Type: CParser.Struct_or_unionContext=0D - def exitStruct_or_union(self,ctx):=0D + def exitStruct_or_union(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declaration_list.=0D # @param ctx Type: CParser.Struct_declaration_listContext=0D - def enterStruct_declaration_list(self,ctx):=0D + def enterStruct_declaration_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declaration_list.=0D # @param ctx Type: CParser.Struct_declaration_listContext=0D - def exitStruct_declaration_list(self,ctx):=0D + def exitStruct_declaration_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declaration.=0D # @param ctx Type: CParser.Struct_declarationContext=0D - def enterStruct_declaration(self,ctx):=0D + def enterStruct_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declaration.=0D # @param ctx Type: CParser.Struct_declarationContext=0D - def exitStruct_declaration(self,ctx):=0D + def exitStruct_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#specifier_qualifier_list.=0D # @param ctx Type: CParser.Specifier_qualifier_listContext=0D - def enterSpecifier_qualifier_list(self,ctx):=0D + def enterSpecifier_qualifier_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#specifier_qualifier_list.=0D # @param ctx Type: CParser.Specifier_qualifier_listContext=0D - def exitSpecifier_qualifier_list(self,ctx):=0D + def exitSpecifier_qualifier_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declarator_list.=0D # @param ctx Type: CParser.Struct_declarator_listContext=0D - def enterStruct_declarator_list(self,ctx):=0D + def enterStruct_declarator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declarator_list.=0D # @param ctx Type: CParser.Struct_declarator_listContext=0D - def exitStruct_declarator_list(self,ctx):=0D + def exitStruct_declarator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declarator.=0D # @param ctx Type: CParser.Struct_declaratorContext=0D - def enterStruct_declarator(self,ctx):=0D + def enterStruct_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declarator.=0D # @param ctx Type: CParser.Struct_declaratorContext=0D - def exitStruct_declarator(self,ctx):=0D + def exitStruct_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enum_specifier.=0D # @param ctx Type: CParser.Enum_specifierContext=0D - def enterEnum_specifier(self,ctx):=0D + def enterEnum_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enum_specifier.=0D # @param ctx Type: CParser.Enum_specifierContext=0D - def exitEnum_specifier(self,ctx):=0D + def exitEnum_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enumerator_list.=0D # @param ctx Type: CParser.Enumerator_listContext=0D - def enterEnumerator_list(self,ctx):=0D + def enterEnumerator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enumerator_list.=0D # @param ctx Type: CParser.Enumerator_listContext=0D - def exitEnumerator_list(self,ctx):=0D + def exitEnumerator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enumerator.=0D # @param ctx Type: CParser.EnumeratorContext=0D - def enterEnumerator(self,ctx):=0D + def enterEnumerator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enumerator.=0D # @param ctx Type: CParser.EnumeratorContext=0D - def exitEnumerator(self,ctx):=0D + def exitEnumerator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_qualifier.=0D # @param ctx Type: CParser.Type_qualifierContext=0D - def enterType_qualifier(self,ctx):=0D + def enterType_qualifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_qualifier.=0D # @param ctx Type: CParser.Type_qualifierContext=0D - def exitType_qualifier(self,ctx):=0D + def exitType_qualifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declarator.=0D # @param ctx Type: CParser.DeclaratorContext=0D - def enterDeclarator(self,ctx):=0D + def enterDeclarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declarator.=0D # @param ctx Type: CParser.DeclaratorContext=0D - def exitDeclarator(self,ctx):=0D + def exitDeclarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#direct_declarator.=0D # @param ctx Type: CParser.Direct_declaratorContext=0D - def enterDirect_declarator(self,ctx):=0D + def enterDirect_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#direct_declarator.=0D # @param ctx Type: CParser.Direct_declaratorContext=0D - def exitDirect_declarator(self,ctx):=0D + def exitDirect_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declarator_suffix.=0D # @param ctx Type: CParser.Declarator_suffixContext=0D - def enterDeclarator_suffix(self,ctx):=0D + def enterDeclarator_suffix(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declarator_suffix.=0D # @param ctx Type: CParser.Declarator_suffixContext=0D - def exitDeclarator_suffix(self,ctx):=0D + def exitDeclarator_suffix(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#pointer.=0D # @param ctx Type: CParser.PointerContext=0D - def enterPointer(self,ctx):=0D + def enterPointer(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#pointer.=0D # @param ctx Type: CParser.PointerContext=0D - def exitPointer(self,ctx):=0D + def exitPointer(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_type_list.=0D # @param ctx Type: CParser.Parameter_type_listContext=0D - def enterParameter_type_list(self,ctx):=0D + def enterParameter_type_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_type_list.=0D # @param ctx Type: CParser.Parameter_type_listContext=0D - def exitParameter_type_list(self,ctx):=0D + def exitParameter_type_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_list.=0D # @param ctx Type: CParser.Parameter_listContext=0D - def enterParameter_list(self,ctx):=0D + def enterParameter_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_list.=0D # @param ctx Type: CParser.Parameter_listContext=0D - def exitParameter_list(self,ctx):=0D + def exitParameter_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_declaration.=0D # @param ctx Type: CParser.Parameter_declarationContext=0D - def enterParameter_declaration(self,ctx):=0D + def enterParameter_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_declaration.=0D # @param ctx Type: CParser.Parameter_declarationContext=0D - def exitParameter_declaration(self,ctx):=0D + def exitParameter_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#identifier_list.=0D # @param ctx Type: CParser.Identifier_listContext=0D - def enterIdentifier_list(self,ctx):=0D + def enterIdentifier_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#identifier_list.=0D # @param ctx Type: CParser.Identifier_listContext=0D - def exitIdentifier_list(self,ctx):=0D + def exitIdentifier_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_name.=0D # @param ctx Type: CParser.Type_nameContext=0D - def enterType_name(self,ctx):=0D + def enterType_name(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_name.=0D # @param ctx Type: CParser.Type_nameContext=0D - def exitType_name(self,ctx):=0D + def exitType_name(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#abstract_declarator.=0D # @param ctx Type: CParser.Abstract_declaratorContext=0D - def enterAbstract_declarator(self,ctx):=0D + def enterAbstract_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#abstract_declarator.=0D # @param ctx Type: CParser.Abstract_declaratorContext=0D - def exitAbstract_declarator(self,ctx):=0D + def exitAbstract_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#direct_abstract_declarator.=0D # @param ctx Type: CParser.Direct_abstract_declaratorContext=0D - def enterDirect_abstract_declarator(self,ctx):=0D + def enterDirect_abstract_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#direct_abstract_declarator.=0D # @param ctx Type: CParser.Direct_abstract_declaratorContext=0D - def exitDirect_abstract_declarator(self,ctx):=0D + def exitDirect_abstract_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#abstract_declarator_suffix.=0D # @param ctx Type: CParser.Abstract_declarator_suffixContext=0D - def enterAbstract_declarator_suffix(self,ctx):=0D + def enterAbstract_declarator_suffix(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#abstract_declarator_suffix.=0D # @param ctx Type: CParser.Abstract_declarator_suffixContext=0D - def exitAbstract_declarator_suffix(self,ctx):=0D + def exitAbstract_declarator_suffix(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#initializer.=0D # @param ctx Type: CParser.InitializerContext=0D - def enterInitializer(self,ctx):=0D + def enterInitializer(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#initializer.=0D # @param ctx Type: CParser.InitializerContext=0D - def exitInitializer(self,ctx):=0D + def exitInitializer(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#initializer_list.=0D # @param ctx Type: CParser.Initializer_listContext=0D - def enterInitializer_list(self,ctx):=0D + def enterInitializer_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#initializer_list.=0D # @param ctx Type: CParser.Initializer_listContext=0D - def exitInitializer_list(self,ctx):=0D + def exitInitializer_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#argument_expression_list.=0D # @param ctx Type: CParser.Argument_expression_listContext=0D - def enterArgument_expression_list(self,ctx):=0D + def enterArgument_expression_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#argument_expression_list.=0D # @param ctx Type: CParser.Argument_expression_listContext=0D - def exitArgument_expression_list(self,ctx):=0D + def exitArgument_expression_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#additive_expression.=0D # @param ctx Type: CParser.Additive_expressionContext=0D - def enterAdditive_expression(self,ctx):=0D + def enterAdditive_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#additive_expression.=0D # @param ctx Type: CParser.Additive_expressionContext=0D - def exitAdditive_expression(self,ctx):=0D + def exitAdditive_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#multiplicative_expression.=0D # @param ctx Type: CParser.Multiplicative_expressionContext=0D - def enterMultiplicative_expression(self,ctx):=0D + def enterMultiplicative_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#multiplicative_expression.=0D # @param ctx Type: CParser.Multiplicative_expressionContext=0D - def exitMultiplicative_expression(self,ctx):=0D + def exitMultiplicative_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#cast_expression.=0D # @param ctx Type: CParser.Cast_expressionContext=0D - def enterCast_expression(self,ctx):=0D + def enterCast_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#cast_expression.=0D # @param ctx Type: CParser.Cast_expressionContext=0D - def exitCast_expression(self,ctx):=0D + def exitCast_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#unary_expression.=0D # @param ctx Type: CParser.Unary_expressionContext=0D - def enterUnary_expression(self,ctx):=0D + def enterUnary_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#unary_expression.=0D # @param ctx Type: CParser.Unary_expressionContext=0D - def exitUnary_expression(self,ctx):=0D + def exitUnary_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#postfix_expression.=0D # @param ctx Type: CParser.Postfix_expressionContext=0D - def enterPostfix_expression(self,ctx):=0D + def enterPostfix_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#postfix_expression.=0D # @param ctx Type: CParser.Postfix_expressionContext=0D - def exitPostfix_expression(self,ctx):=0D + def exitPostfix_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#macro_parameter_list.=0D # @param ctx Type: CParser.Macro_parameter_listContext=0D - def enterMacro_parameter_list(self,ctx):=0D + def enterMacro_parameter_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#macro_parameter_list.=0D # @param ctx Type: CParser.Macro_parameter_listContext=0D - def exitMacro_parameter_list(self,ctx):=0D + def exitMacro_parameter_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#unary_operator.=0D # @param ctx Type: CParser.Unary_operatorContext=0D - def enterUnary_operator(self,ctx):=0D + def enterUnary_operator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#unary_operator.=0D # @param ctx Type: CParser.Unary_operatorContext=0D - def exitUnary_operator(self,ctx):=0D + def exitUnary_operator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#primary_expression.=0D # @param ctx Type: CParser.Primary_expressionContext=0D - def enterPrimary_expression(self,ctx):=0D + def enterPrimary_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#primary_expression.=0D # @param ctx Type: CParser.Primary_expressionContext=0D - def exitPrimary_expression(self,ctx):=0D + def exitPrimary_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#constant.=0D # @param ctx Type: CParser.ConstantContext=0D - def enterConstant(self,ctx):=0D + def enterConstant(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#constant.=0D # @param ctx Type: CParser.ConstantContext=0D - def exitConstant(self,ctx):=0D + def exitConstant(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#expression.=0D # @param ctx Type: CParser.ExpressionContext=0D - def enterExpression(self,ctx):=0D + def enterExpression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#expression.=0D # @param ctx Type: CParser.ExpressionContext=0D - def exitExpression(self,ctx):=0D + def exitExpression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#constant_expression.=0D # @param ctx Type: CParser.Constant_expressionContext=0D - def enterConstant_expression(self,ctx):=0D + def enterConstant_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#constant_expression.=0D # @param ctx Type: CParser.Constant_expressionContext=0D - def exitConstant_expression(self,ctx):=0D + def exitConstant_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#assignment_expression.=0D # @param ctx Type: CParser.Assignment_expressionContext=0D - def enterAssignment_expression(self,ctx):=0D + def enterAssignment_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#assignment_expression.=0D # @param ctx Type: CParser.Assignment_expressionContext=0D - def exitAssignment_expression(self,ctx):=0D + def exitAssignment_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#lvalue.=0D # @param ctx Type: CParser.LvalueContext=0D - def enterLvalue(self,ctx):=0D + def enterLvalue(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#lvalue.=0D # @param ctx Type: CParser.LvalueContext=0D - def exitLvalue(self,ctx):=0D + def exitLvalue(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#assignment_operator.=0D # @param ctx Type: CParser.Assignment_operatorContext=0D - def enterAssignment_operator(self,ctx):=0D + def enterAssignment_operator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#assignment_operator.=0D # @param ctx Type: CParser.Assignment_operatorContext=0D - def exitAssignment_operator(self,ctx):=0D + def exitAssignment_operator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#conditional_expression.=0D # @param ctx Type: CParser.Conditional_expressionContext=0D - def enterConditional_expression(self,ctx):=0D + def enterConditional_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#conditional_expression.=0D # @param ctx Type: CParser.Conditional_expressionContext=0D - def exitConditional_expression(self,ctx):=0D + def exitConditional_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#logical_or_expression.=0D # @param ctx Type: CParser.Logical_or_expressionContext=0D - def enterLogical_or_expression(self,ctx):=0D + def enterLogical_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#logical_or_expression.=0D # @param ctx Type: CParser.Logical_or_expressionContext=0D - def exitLogical_or_expression(self,ctx):=0D + def exitLogical_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#logical_and_expression.=0D # @param ctx Type: CParser.Logical_and_expressionContext=0D - def enterLogical_and_expression(self,ctx):=0D + def enterLogical_and_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#logical_and_expression.=0D # @param ctx Type: CParser.Logical_and_expressionContext=0D - def exitLogical_and_expression(self,ctx):=0D + def exitLogical_and_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#inclusive_or_expression.=0D # @param ctx Type: CParser.Inclusive_or_expressionContext=0D - def enterInclusive_or_expression(self,ctx):=0D + def enterInclusive_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#inclusive_or_expression.=0D # @param ctx Type: CParser.Inclusive_or_expressionContext=0D - def exitInclusive_or_expression(self,ctx):=0D + def exitInclusive_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#exclusive_or_expression.=0D # @param ctx Type: CParser.Exclusive_or_expressionContext=0D - def enterExclusive_or_expression(self,ctx):=0D + def enterExclusive_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#exclusive_or_expression.=0D # @param ctx Type: CParser.Exclusive_or_expressionContext=0D - def exitExclusive_or_expression(self,ctx):=0D + def exitExclusive_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#and_expression.=0D # @param ctx Type: CParser.And_expressionContext=0D - def enterAnd_expression(self,ctx):=0D + def enterAnd_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#and_expression.=0D # @param ctx Type: CParser.And_expressionContext=0D - def exitAnd_expression(self,ctx):=0D + def exitAnd_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#equality_expression.=0D # @param ctx Type: CParser.Equality_expressionContext=0D - def enterEquality_expression(self,ctx):=0D + def enterEquality_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#equality_expression.=0D # @param ctx Type: CParser.Equality_expressionContext=0D - def exitEquality_expression(self,ctx):=0D + def exitEquality_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#relational_expression.=0D # @param ctx Type: CParser.Relational_expressionContext=0D - def enterRelational_expression(self,ctx):=0D + def enterRelational_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#relational_expression.=0D # @param ctx Type: CParser.Relational_expressionContext=0D - def exitRelational_expression(self,ctx):=0D + def exitRelational_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#shift_expression.=0D # @param ctx Type: CParser.Shift_expressionContext=0D - def enterShift_expression(self,ctx):=0D + def enterShift_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#shift_expression.=0D # @param ctx Type: CParser.Shift_expressionContext=0D - def exitShift_expression(self,ctx):=0D + def exitShift_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#statement.=0D # @param ctx Type: CParser.StatementContext=0D - def enterStatement(self,ctx):=0D + def enterStatement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#statement.=0D # @param ctx Type: CParser.StatementContext=0D - def exitStatement(self,ctx):=0D + def exitStatement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm2_statement.=0D # @param ctx Type: CParser.Asm2_statementContext=0D - def enterAsm2_statement(self,ctx):=0D + def enterAsm2_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm2_statement.=0D # @param ctx Type: CParser.Asm2_statementContext=0D - def exitAsm2_statement(self,ctx):=0D + def exitAsm2_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm1_statement.=0D # @param ctx Type: CParser.Asm1_statementContext=0D - def enterAsm1_statement(self,ctx):=0D + def enterAsm1_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm1_statement.=0D # @param ctx Type: CParser.Asm1_statementContext=0D - def exitAsm1_statement(self,ctx):=0D + def exitAsm1_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm_statement.=0D # @param ctx Type: CParser.Asm_statementContext=0D - def enterAsm_statement(self,ctx):=0D + def enterAsm_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm_statement.=0D # @param ctx Type: CParser.Asm_statementContext=0D - def exitAsm_statement(self,ctx):=0D + def exitAsm_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#macro_statement.=0D # @param ctx Type: CParser.Macro_statementContext=0D - def enterMacro_statement(self,ctx):=0D + def enterMacro_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#macro_statement.=0D # @param ctx Type: CParser.Macro_statementContext=0D - def exitMacro_statement(self,ctx):=0D + def exitMacro_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#labeled_statement.=0D # @param ctx Type: CParser.Labeled_statementContext=0D - def enterLabeled_statement(self,ctx):=0D + def enterLabeled_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#labeled_statement.=0D # @param ctx Type: CParser.Labeled_statementContext=0D - def exitLabeled_statement(self,ctx):=0D + def exitLabeled_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#compound_statement.=0D # @param ctx Type: CParser.Compound_statementContext=0D - def enterCompound_statement(self,ctx):=0D + def enterCompound_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#compound_statement.=0D # @param ctx Type: CParser.Compound_statementContext=0D - def exitCompound_statement(self,ctx):=0D + def exitCompound_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#statement_list.=0D # @param ctx Type: CParser.Statement_listContext=0D - def enterStatement_list(self,ctx):=0D + def enterStatement_list(self, ctx):=0D pass=0D =0D -=0D # Exit a parse tree produced by CParser#statement_list.=0D # @param ctx Type: CParser.Statement_listContext=0D - def exitStatement_list(self,ctx):=0D + def exitStatement_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#expression_statement.=0D # @param ctx Type: CParser.Expression_statementContext=0D - def enterExpression_statement(self,ctx):=0D + def enterExpression_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#expression_statement.=0D # @param ctx Type: CParser.Expression_statementContext=0D - def exitExpression_statement(self,ctx):=0D + def exitExpression_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#selection_statement.=0D # @param ctx Type: CParser.Selection_statementContext=0D - def enterSelection_statement(self,ctx):=0D + def enterSelection_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#selection_statement.=0D # @param ctx Type: CParser.Selection_statementContext=0D - def exitSelection_statement(self,ctx):=0D + def exitSelection_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#iteration_statement.=0D # @param ctx Type: CParser.Iteration_statementContext=0D - def enterIteration_statement(self,ctx):=0D + def enterIteration_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#iteration_statement.=0D # @param ctx Type: CParser.Iteration_statementContext=0D - def exitIteration_statement(self,ctx):=0D + def exitIteration_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#jump_statement.=0D # @param ctx Type: CParser.Jump_statementContext=0D - def enterJump_statement(self,ctx):=0D + def enterJump_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#jump_statement.=0D # @param ctx Type: CParser.Jump_statementContext=0D - def exitJump_statement(self,ctx):=0D + def exitJump_statement(self, ctx):=0D pass=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/CParser4/CParser.py b/BaseTools/So= urce/Python/Ecc/CParser4/CParser.py index 31d23d55aa57..22c17c66680a 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CParser.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CParser.py @@ -6,7 +6,7 @@ from typing.io import TextIO import sys=0D =0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -22,6 +22,7 @@ import sys import Ecc.CodeFragment as CodeFragment=0D import Ecc.FileProfile as FileProfile=0D =0D +=0D def serializedATN():=0D with StringIO() as buf:=0D buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3k")= =0D @@ -475,61 +476,61 @@ def serializedATN(): return buf.getvalue()=0D =0D =0D -class CParser ( Parser ):=0D +class CParser (Parser):=0D =0D grammarFileName =3D "C.g4"=0D =0D atn =3D ATNDeserializer().deserialize(serializedATN())=0D =0D - decisionsToDFA =3D [ DFA(ds, i) for i, ds in enumerate(atn.decisionToS= tate) ]=0D + decisionsToDFA =3D [DFA(ds, i) for i, ds in enumerate(atn.decisionToSt= ate)]=0D =0D sharedContextCache =3D PredictionContextCache()=0D =0D - literalNames =3D [ "", "'{'", "';'", "'typedef'", "','", "'= =3D'",=0D - "'extern'", "'static'", "'auto'", "'register'", "'STA= TIC'",=0D - "'void'", "'char'", "'short'", "'int'", "'long'", "'f= loat'",=0D - "'double'", "'signed'", "'unsigned'", "'}'", "'struct= '",=0D - "'union'", "':'", "'enum'", "'const'", "'volatile'",= =0D - "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED= '",=0D - "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EF= IAPI'",=0D - "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED= '",=0D - "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'",=0D - "'-'", "'/'", "'%'", "'++'", "'--'", "'sizeof'", "'.'= ",=0D - "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/=3D'", "'%= =3D'",=0D - "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", "= '^=3D'", "'|=3D'",=0D - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'",=0D - "'<'", "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'_= _asm__'",=0D - "'_asm'", "'__asm'", "'case'", "'default'", "'if'",=0D - "'else'", "'switch'", "'while'", "'do'", "'goto'",=0D - "'continue'", "'break'", "'return'" ]=0D + literalNames =3D ["", "'{'", "';'", "'typedef'", "','", "'=3D= '",=0D + "'extern'", "'static'", "'auto'", "'register'", "'STAT= IC'",=0D + "'void'", "'char'", "'short'", "'int'", "'long'", "'fl= oat'",=0D + "'double'", "'signed'", "'unsigned'", "'}'", "'struct'= ",=0D + "'union'", "':'", "'enum'", "'const'", "'volatile'",=0D + "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'= ",=0D + "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFI= API'",=0D + "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'= ",=0D + "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'",=0D + "'-'", "'/'", "'%'", "'++'", "'--'", "'sizeof'", "'.'"= ,=0D + "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/=3D'", "'%= =3D'",=0D + "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", "'= ^=3D'", "'|=3D'",=0D + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'",=0D + "'<'", "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__= asm__'",=0D + "'_asm'", "'__asm'", "'case'", "'default'", "'if'",=0D + "'else'", "'switch'", "'while'", "'do'", "'goto'",=0D + "'continue'", "'break'", "'return'"]=0D =0D - symbolicNames =3D [ "", "", "", ""= ,=0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "IDENTIFIER", "CHARACTER_LITERAL", "STR= ING_LITERAL",=0D - "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL",=0D - "FLOATING_POINT_LITERAL", "WS", "BS", "UnicodeVocabu= lary",=0D - "COMMENT", "LINE_COMMENT", "LINE_COMMAND" ]=0D + symbolicNames =3D ["", "", "", "",= =0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "IDENTIFIER", "CHARACTER_LITERAL", "STRI= NG_LITERAL",=0D + "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL",=0D + "FLOATING_POINT_LITERAL", "WS", "BS", "UnicodeVocabul= ary",=0D + "COMMENT", "LINE_COMMENT", "LINE_COMMAND"]=0D =0D RULE_translation_unit =3D 0=0D RULE_external_declaration =3D 1=0D @@ -603,225 +604,224 @@ class CParser ( Parser ): RULE_iteration_statement =3D 69=0D RULE_jump_statement =3D 70=0D =0D - ruleNames =3D [ "translation_unit", "external_declaration", "function= _definition",=0D - "declaration_specifiers", "declaration", "init_declarat= or_list",=0D - "init_declarator", "storage_class_specifier", "type_spe= cifier",=0D - "type_id", "struct_or_union_specifier", "struct_or_unio= n",=0D - "struct_declaration_list", "struct_declaration", "speci= fier_qualifier_list",=0D - "struct_declarator_list", "struct_declarator", "enum_sp= ecifier",=0D - "enumerator_list", "enumerator", "type_qualifier", "dec= larator",=0D - "direct_declarator", "declarator_suffix", "pointer",=0D - "parameter_type_list", "parameter_list", "parameter_dec= laration",=0D - "identifier_list", "type_name", "abstract_declarator",= =0D - "direct_abstract_declarator", "abstract_declarator_suff= ix",=0D - "initializer", "initializer_list", "argument_expression= _list",=0D - "additive_expression", "multiplicative_expression", "ca= st_expression",=0D - "unary_expression", "postfix_expression", "macro_parame= ter_list",=0D - "unary_operator", "primary_expression", "constant", "ex= pression",=0D - "constant_expression", "assignment_expression", "lvalue= ",=0D - "assignment_operator", "conditional_expression", "logic= al_or_expression",=0D - "logical_and_expression", "inclusive_or_expression",=0D - "exclusive_or_expression", "and_expression", "equality_= expression",=0D - "relational_expression", "shift_expression", "statement= ",=0D - "asm2_statement", "asm1_statement", "asm_statement",=0D - "macro_statement", "labeled_statement", "compound_state= ment",=0D - "statement_list", "expression_statement", "selection_st= atement",=0D - "iteration_statement", "jump_statement" ]=0D + ruleNames =3D ["translation_unit", "external_declaration", "function_d= efinition",=0D + "declaration_specifiers", "declaration", "init_declarator= _list",=0D + "init_declarator", "storage_class_specifier", "type_speci= fier",=0D + "type_id", "struct_or_union_specifier", "struct_or_union"= ,=0D + "struct_declaration_list", "struct_declaration", "specifi= er_qualifier_list",=0D + "struct_declarator_list", "struct_declarator", "enum_spec= ifier",=0D + "enumerator_list", "enumerator", "type_qualifier", "decla= rator",=0D + "direct_declarator", "declarator_suffix", "pointer",=0D + "parameter_type_list", "parameter_list", "parameter_decla= ration",=0D + "identifier_list", "type_name", "abstract_declarator",=0D + "direct_abstract_declarator", "abstract_declarator_suffix= ",=0D + "initializer", "initializer_list", "argument_expression_l= ist",=0D + "additive_expression", "multiplicative_expression", "cast= _expression",=0D + "unary_expression", "postfix_expression", "macro_paramete= r_list",=0D + "unary_operator", "primary_expression", "constant", "expr= ession",=0D + "constant_expression", "assignment_expression", "lvalue",= =0D + "assignment_operator", "conditional_expression", "logical= _or_expression",=0D + "logical_and_expression", "inclusive_or_expression",=0D + "exclusive_or_expression", "and_expression", "equality_ex= pression",=0D + "relational_expression", "shift_expression", "statement",= =0D + "asm2_statement", "asm1_statement", "asm_statement",=0D + "macro_statement", "labeled_statement", "compound_stateme= nt",=0D + "statement_list", "expression_statement", "selection_stat= ement",=0D + "iteration_statement", "jump_statement"]=0D =0D EOF =3D Token.EOF=0D - T__0=3D1=0D - T__1=3D2=0D - T__2=3D3=0D - T__3=3D4=0D - T__4=3D5=0D - T__5=3D6=0D - T__6=3D7=0D - T__7=3D8=0D - T__8=3D9=0D - T__9=3D10=0D - T__10=3D11=0D - T__11=3D12=0D - T__12=3D13=0D - T__13=3D14=0D - T__14=3D15=0D - T__15=3D16=0D - T__16=3D17=0D - T__17=3D18=0D - T__18=3D19=0D - T__19=3D20=0D - T__20=3D21=0D - T__21=3D22=0D - T__22=3D23=0D - T__23=3D24=0D - T__24=3D25=0D - T__25=3D26=0D - T__26=3D27=0D - T__27=3D28=0D - T__28=3D29=0D - T__29=3D30=0D - T__30=3D31=0D - T__31=3D32=0D - T__32=3D33=0D - T__33=3D34=0D - T__34=3D35=0D - T__35=3D36=0D - T__36=3D37=0D - T__37=3D38=0D - T__38=3D39=0D - T__39=3D40=0D - T__40=3D41=0D - T__41=3D42=0D - T__42=3D43=0D - T__43=3D44=0D - T__44=3D45=0D - T__45=3D46=0D - T__46=3D47=0D - T__47=3D48=0D - T__48=3D49=0D - T__49=3D50=0D - T__50=3D51=0D - T__51=3D52=0D - T__52=3D53=0D - T__53=3D54=0D - T__54=3D55=0D - T__55=3D56=0D - T__56=3D57=0D - T__57=3D58=0D - T__58=3D59=0D - T__59=3D60=0D - T__60=3D61=0D - T__61=3D62=0D - T__62=3D63=0D - T__63=3D64=0D - T__64=3D65=0D - T__65=3D66=0D - T__66=3D67=0D - T__67=3D68=0D - T__68=3D69=0D - T__69=3D70=0D - T__70=3D71=0D - T__71=3D72=0D - T__72=3D73=0D - T__73=3D74=0D - T__74=3D75=0D - T__75=3D76=0D - T__76=3D77=0D - T__77=3D78=0D - T__78=3D79=0D - T__79=3D80=0D - T__80=3D81=0D - T__81=3D82=0D - T__82=3D83=0D - T__83=3D84=0D - T__84=3D85=0D - T__85=3D86=0D - T__86=3D87=0D - T__87=3D88=0D - T__88=3D89=0D - T__89=3D90=0D - T__90=3D91=0D - T__91=3D92=0D - IDENTIFIER=3D93=0D - CHARACTER_LITERAL=3D94=0D - STRING_LITERAL=3D95=0D - HEX_LITERAL=3D96=0D - DECIMAL_LITERAL=3D97=0D - OCTAL_LITERAL=3D98=0D - FLOATING_POINT_LITERAL=3D99=0D - WS=3D100=0D - BS=3D101=0D - UnicodeVocabulary=3D102=0D - COMMENT=3D103=0D - LINE_COMMENT=3D104=0D - LINE_COMMAND=3D105=0D + T__0 =3D 1=0D + T__1 =3D 2=0D + T__2 =3D 3=0D + T__3 =3D 4=0D + T__4 =3D 5=0D + T__5 =3D 6=0D + T__6 =3D 7=0D + T__7 =3D 8=0D + T__8 =3D 9=0D + T__9 =3D 10=0D + T__10 =3D 11=0D + T__11 =3D 12=0D + T__12 =3D 13=0D + T__13 =3D 14=0D + T__14 =3D 15=0D + T__15 =3D 16=0D + T__16 =3D 17=0D + T__17 =3D 18=0D + T__18 =3D 19=0D + T__19 =3D 20=0D + T__20 =3D 21=0D + T__21 =3D 22=0D + T__22 =3D 23=0D + T__23 =3D 24=0D + T__24 =3D 25=0D + T__25 =3D 26=0D + T__26 =3D 27=0D + T__27 =3D 28=0D + T__28 =3D 29=0D + T__29 =3D 30=0D + T__30 =3D 31=0D + T__31 =3D 32=0D + T__32 =3D 33=0D + T__33 =3D 34=0D + T__34 =3D 35=0D + T__35 =3D 36=0D + T__36 =3D 37=0D + T__37 =3D 38=0D + T__38 =3D 39=0D + T__39 =3D 40=0D + T__40 =3D 41=0D + T__41 =3D 42=0D + T__42 =3D 43=0D + T__43 =3D 44=0D + T__44 =3D 45=0D + T__45 =3D 46=0D + T__46 =3D 47=0D + T__47 =3D 48=0D + T__48 =3D 49=0D + T__49 =3D 50=0D + T__50 =3D 51=0D + T__51 =3D 52=0D + T__52 =3D 53=0D + T__53 =3D 54=0D + T__54 =3D 55=0D + T__55 =3D 56=0D + T__56 =3D 57=0D + T__57 =3D 58=0D + T__58 =3D 59=0D + T__59 =3D 60=0D + T__60 =3D 61=0D + T__61 =3D 62=0D + T__62 =3D 63=0D + T__63 =3D 64=0D + T__64 =3D 65=0D + T__65 =3D 66=0D + T__66 =3D 67=0D + T__67 =3D 68=0D + T__68 =3D 69=0D + T__69 =3D 70=0D + T__70 =3D 71=0D + T__71 =3D 72=0D + T__72 =3D 73=0D + T__73 =3D 74=0D + T__74 =3D 75=0D + T__75 =3D 76=0D + T__76 =3D 77=0D + T__77 =3D 78=0D + T__78 =3D 79=0D + T__79 =3D 80=0D + T__80 =3D 81=0D + T__81 =3D 82=0D + T__82 =3D 83=0D + T__83 =3D 84=0D + T__84 =3D 85=0D + T__85 =3D 86=0D + T__86 =3D 87=0D + T__87 =3D 88=0D + T__88 =3D 89=0D + T__89 =3D 90=0D + T__90 =3D 91=0D + T__91 =3D 92=0D + IDENTIFIER =3D 93=0D + CHARACTER_LITERAL =3D 94=0D + STRING_LITERAL =3D 95=0D + HEX_LITERAL =3D 96=0D + DECIMAL_LITERAL =3D 97=0D + OCTAL_LITERAL =3D 98=0D + FLOATING_POINT_LITERAL =3D 99=0D + WS =3D 100=0D + BS =3D 101=0D + UnicodeVocabulary =3D 102=0D + COMMENT =3D 103=0D + LINE_COMMENT =3D 104=0D + LINE_COMMAND =3D 105=0D =0D # @param input Type: TokenStream=0D # @param output=3D sys.stdout Type: TextIO=0D - def __init__(self,input,output=3D sys.stdout):=0D + def __init__(self, input, output=3Dsys.stdout):=0D super().__init__(input, output)=0D self.checkVersion("4.7.1")=0D - self._interp =3D ParserATNSimulator(self, self.atn, self.decisions= ToDFA, self.sharedContextCache)=0D + self._interp =3D ParserATNSimulator(=0D + self, self.atn, self.decisionsToDFA, self.sharedContextCache)= =0D self._predicates =3D None=0D =0D + def printTokenInfo(self, line, offset, tokenText):=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D -=0D -=0D - def printTokenInfo(self,line,offset,tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D -=0D - def StorePredicateExpression(self,StartLine,StartOffset,EndLine,EndOff= set,Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.PredicateExpressionList.append(PredExp)=0D =0D - def StoreEnumerationDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, S= tartOffset), (EndLine, EndOffset))=0D + def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D - def StoreStructUnionDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D - def StoreTypedefDefinition(self,StartLine,StartOffset,EndLine,EndOffse= t,FromText,ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLi= ne, StartOffset), (EndLine, EndOffset))=0D + def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D - def StoreFunctionDefinition(self,StartLine,StartOffset,EndLine,EndOffs= et,ModifierText,DeclText,LeftBraceLine,LeftBraceOffset,DeclLine,DeclOffset)= :=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBrace= Offset), (DeclLine, DeclOffset))=0D + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D - def StoreVariableDeclaration(self,StartLine,StartOffset,EndLine,EndOff= set,ModifierText,DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclTex= t, (StartLine, StartOffset), (EndLine, EndOffset))=0D + def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D - def StoreFunctionCalling(self,StartLine,StartOffset,EndLine,EndOffset,= FuncName,ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (St= artLine, StartOffset), (EndLine, EndOffset))=0D + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D FileProfile.FunctionCallingList.append(FuncCall)=0D =0D -=0D -=0D class Translation_unitContext(ParserRuleContext):=0D =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def external_declaration(self,i=3DNone):=0D + def external_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.External_declarat= ionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.External_declarati= onContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.External_declarati= onContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_translation_unit=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterTranslation_unit" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterTranslation_unit"):=0D listener.enterTranslation_unit(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitTranslation_unit" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitTranslation_unit"):=0D listener.exitTranslation_unit(self)=0D =0D -=0D -=0D -=0D def translation_unit(self):=0D =0D localctx =3D CParser.Translation_unitContext(self, self._ctx, self= .state)=0D self.enterRule(localctx, 0, self.RULE_translation_unit)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 145=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T__7) = | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1 << = CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CParse= r.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.T__1= 7) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21) | (= 1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 << C= Parser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CParser= .T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T__32= ) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) | (1= << CParser.T__36) | (1 << CParser.T__37) | (1 << CParser.T__41))) !=3D 0) = or _la=3D=3DCParser.IDENTIFIER:=0D + while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T__7) = | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1 << = CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CParse= r.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.T__1= 7) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21) | (= 1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 << C= Parser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CParser= .T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T__32= ) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) | (1= << CParser.T__36) | (1 << CParser.T__37) | (1 << CParser.T__41))) !=3D 0) = or _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 142=0D self.external_declaration()=0D self.state =3D 147=0D @@ -840,75 +840,67 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def function_definition(self):=0D - return self.getTypedRuleContext(CParser.Function_definitionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Function_definitionCon= text, 0)=0D =0D def macro_statement(self):=0D - return self.getTypedRuleContext(CParser.Macro_statementContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_statementContext= , 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_external_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExternal_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExternal_declaration"):=0D listener.enterExternal_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExternal_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExternal_declaration"):=0D listener.exitExternal_declaration(self)=0D =0D -=0D -=0D -=0D def external_declaration(self):=0D =0D - localctx =3D CParser.External_declarationContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.External_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 2, self.RULE_external_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 166=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,4,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 4, self._ctx= )=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 149=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,1,self._c= tx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 1, self.= _ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 148=0D self.declaration_specifiers()=0D =0D -=0D self.state =3D 151=0D self.declarator()=0D self.state =3D 155=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << C= Parser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T_= _7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1= << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CP= arser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.= T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21)= | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 = << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CPa= rser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T= __32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) = | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.IDENTIFIER:=0D + while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << C= Parser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T_= _7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1= << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CP= arser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.= T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21)= | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 = << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CPa= rser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T= __32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) = | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 152=0D self.declaration()=0D self.state =3D 157=0D @@ -938,14 +930,12 @@ class CParser ( Parser ): self.state =3D 164=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__1:=0D + if _la =3D=3D CParser.T__1:=0D self.state =3D 163=0D self.match(CParser.T__1)=0D =0D -=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -958,7 +948,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D self.ModifierText =3D ''=0D @@ -967,71 +957,64 @@ class CParser ( Parser ): self.LBOffset =3D 0=0D self.DeclLine =3D 0=0D self.DeclOffset =3D 0=0D - self.d =3D None # Declaration_specifiersContext=0D - self._declaration_specifiers =3D None # Declaration_specifiers= Context=0D - self._declarator =3D None # DeclaratorContext=0D - self.a =3D None # Compound_statementContext=0D - self.b =3D None # Compound_statementContext=0D + self.d =3D None # Declaration_specifiersContext=0D + self._declaration_specifiers =3D None # Declaration_specifier= sContext=0D + self._declarator =3D None # DeclaratorContext=0D + self.a =3D None # Compound_statementContext=0D + self.b =3D None # Compound_statementContext=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def compound_statement(self):=0D - return self.getTypedRuleContext(CParser.Compound_statementCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Compound_statementCont= ext, 0)=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_function_definition=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterFunction_definition" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterFunction_definition"):=0D listener.enterFunction_definition(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitFunction_definition" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitFunction_definition"):=0D listener.exitFunction_definition(self)=0D =0D -=0D -=0D -=0D def function_definition(self):=0D =0D - localctx =3D CParser.Function_definitionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Function_definitionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 4, self.RULE_function_definition)=0D =0D - ModifierText =3D '';=0D - DeclText =3D '';=0D - LBLine =3D 0;=0D - LBOffset =3D 0;=0D - DeclLine =3D 0;=0D - DeclOffset =3D 0;=0D + ModifierText =3D ''=0D + DeclText =3D ''=0D + LBLine =3D 0=0D + LBOffset =3D 0=0D + DeclLine =3D 0=0D + DeclOffset =3D 0=0D =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 169=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,5,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 5, self._ctx= )=0D if la_ =3D=3D 1:=0D self.state =3D 168=0D localctx.d =3D localctx._declaration_specifiers =3D self.d= eclaration_specifiers()=0D =0D -=0D self.state =3D 171=0D localctx._declarator =3D self.declarator()=0D self.state =3D 180=0D @@ -1047,7 +1030,7 @@ class CParser ( Parser ): self.state =3D 175=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((= 1 << CParser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CPar= ser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10= ) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1= << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CP= arser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.= T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25)= | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 = << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CPa= rser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T= __35) | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.IDENTIFIER):=0D + if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((= 1 << CParser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CPar= ser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10= ) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1= << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CP= arser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.= T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25)= | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 = << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CPa= rser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T= __35) | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.IDENTIFIER):=0D break=0D =0D self.state =3D 177=0D @@ -1060,24 +1043,30 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D if localctx.d !=3D None:=0D - ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText((localctx._declaration_specifiers.start,l= ocalctx._declaration_specifiers.stop)))=0D + ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText(=0D + (localctx._declaration_specifiers.start, localctx._dec= laration_specifiers.stop)))=0D else:=0D ModifierText =3D ''=0D - DeclText =3D (None if localctx._declarator is None else self._= input.getText((localctx._declarator.start,localctx._declarator.stop)))=0D - DeclLine =3D (None if localctx._declarator is None else localc= tx._declarator.start).line=0D - DeclOffset =3D (None if localctx._declarator is None else loca= lctx._declarator.start).column=0D + DeclText =3D (None if localctx._declarator is None else self._= input.getText(=0D + (localctx._declarator.start, localctx._declarator.stop)))= =0D + DeclLine =3D (=0D + None if localctx._declarator is None else localctx._declar= ator.start).line=0D + DeclOffset =3D (=0D + None if localctx._declarator is None else localctx._declar= ator.start).column=0D if localctx.a !=3D None:=0D LBLine =3D (None if localctx.a is None else localctx.a.sta= rt).line=0D - LBOffset =3D (None if localctx.a is None else localctx.a.s= tart).column=0D + LBOffset =3D (=0D + None if localctx.a is None else localctx.a.start).colu= mn=0D else:=0D LBLine =3D (None if localctx.b is None else localctx.b.sta= rt).line=0D - LBOffset =3D (None if localctx.b is None else localctx.b.s= tart).column=0D + LBOffset =3D (=0D + None if localctx.b is None else localctx.b.start).colu= mn=0D =0D self._ctx.stop =3D self._input.LT(-1)=0D =0D - self.StoreFunctionDefinition(localctx.start.line, localctx.sta= rt.column, localctx.stop.line, localctx.stop.column, ModifierText, DeclText= , LBLine, LBOffset, DeclLine, DeclOffset)=0D + self.StoreFunctionDefinition(localctx.start.line, localctx.sta= rt.column, localctx.stop.line,=0D + localctx.stop.column, ModifierTex= t, DeclText, LBLine, LBOffset, DeclLine, DeclOffset)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1091,60 +1080,55 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def storage_class_specifier(self,i=3DNone):=0D + def storage_class_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Storage_class_spe= cifierContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Storage_class_spec= ifierContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Storage_class_spec= ifierContext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_specifier(self,i=3DNone):=0D + def type_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_specifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_specifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_specifierCont= ext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declaration_specifiers=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclaration_specifiers" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclaration_specifiers"):=0D listener.enterDeclaration_specifiers(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclaration_specifiers" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclaration_specifiers"):=0D listener.exitDeclaration_specifiers(self)=0D =0D -=0D -=0D -=0D def declaration_specifiers(self):=0D =0D - localctx =3D CParser.Declaration_specifiersContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Declaration_specifiersContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 6, self.RULE_declaration_specifiers)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 187=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 187=0D self._errHandler.sync(self)=0D @@ -1164,12 +1148,11 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D else:=0D raise NoViableAltException(self)=0D self.state =3D 189=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,9,self._= ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 9, self= ._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1183,46 +1166,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.a =3D None # Token=0D - self.b =3D None # Declaration_specifiersContext=0D - self.c =3D None # Init_declarator_listContext=0D - self.d =3D None # Token=0D - self.s =3D None # Declaration_specifiersContext=0D - self.t =3D None # Init_declarator_listContext=0D - self.e =3D None # Token=0D + self.a =3D None # Token=0D + self.b =3D None # Declaration_specifiersContext=0D + self.c =3D None # Init_declarator_listContext=0D + self.d =3D None # Token=0D + self.s =3D None # Declaration_specifiersContext=0D + self.t =3D None # Init_declarator_listContext=0D + self.e =3D None # Token=0D =0D def init_declarator_list(self):=0D - return self.getTypedRuleContext(CParser.Init_declarator_listCo= ntext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Init_declarator_listCo= ntext, 0)=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclaration"):=0D listener.enterDeclaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclaration"):=0D listener.exitDeclaration(self)=0D =0D -=0D -=0D -=0D def declaration(self):=0D =0D localctx =3D CParser.DeclarationContext(self, self._ctx, self.stat= e)=0D self.enterRule(localctx, 8, self.RULE_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 206=0D self._errHandler.sync(self)=0D @@ -1233,21 +1211,22 @@ class CParser ( Parser ): localctx.a =3D self.match(CParser.T__2)=0D self.state =3D 193=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,10,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 10, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 192=0D localctx.b =3D self.declaration_specifiers()=0D =0D -=0D self.state =3D 195=0D localctx.c =3D self.init_declarator_list()=0D self.state =3D 196=0D localctx.d =3D self.match(CParser.T__1)=0D =0D if localctx.b is not None:=0D - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText((localctx.b.start,lo= calctx.b.stop))), (None if localctx.c is None else self._input.getText((loc= alctx.c.start,localctx.c.stop))))=0D + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText(=0D + (localctx.b.start, localctx.b.stop))), (None if lo= calctx.c is None else self._input.getText((localctx.c.start, localctx.c.sto= p))))=0D else:=0D - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , '', (None if localctx.c is None else self._input.getText((localctx.c.star= t,localctx.c.stop))))=0D + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line),=0D + localctx.d.column, '', (No= ne if localctx.c is None else self._input.getText((localctx.c.start, localc= tx.c.stop))))=0D =0D pass=0D elif token in [CParser.T__5, CParser.T__6, CParser.T__7, CPars= er.T__8, CParser.T__9, CParser.T__10, CParser.T__11, CParser.T__12, CParser= .T__13, CParser.T__14, CParser.T__15, CParser.T__16, CParser.T__17, CParser= .T__18, CParser.T__20, CParser.T__21, CParser.T__23, CParser.T__24, CParser= .T__25, CParser.T__26, CParser.T__27, CParser.T__28, CParser.T__29, CParser= .T__30, CParser.T__31, CParser.T__32, CParser.T__33, CParser.T__34, CParser= .T__35, CParser.T__36, CParser.IDENTIFIER]:=0D @@ -1261,12 +1240,12 @@ class CParser ( Parser ): self.state =3D 200=0D localctx.t =3D self.init_declarator_list()=0D =0D -=0D self.state =3D 203=0D localctx.e =3D self.match(CParser.T__1)=0D =0D if localctx.t is not None:=0D - self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= None if localctx.t is None else localctx.t.start).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop))), (= None if localctx.t is None else self._input.getText((localctx.t.start,local= ctx.t.stop))))=0D + self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= =0D + None if localctx.t is None else localctx.t.start).= column, (None if localctx.s is None else self._input.getText((localctx.s.st= art, localctx.s.stop))), (None if localctx.t is None else self._input.getTe= xt((localctx.t.start, localctx.t.stop))))=0D =0D pass=0D else:=0D @@ -1284,39 +1263,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def init_declarator(self,i=3DNone):=0D + def init_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Init_declaratorCo= ntext)=0D else:=0D - return self.getTypedRuleContext(CParser.Init_declaratorCon= text,i)=0D -=0D + return self.getTypedRuleContext(CParser.Init_declaratorCon= text, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_init_declarator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInit_declarator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInit_declarator_list"):=0D listener.enterInit_declarator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInit_declarator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInit_declarator_list"):=0D listener.exitInit_declarator_list(self)=0D =0D -=0D -=0D -=0D def init_declarator_list(self):=0D =0D - localctx =3D CParser.Init_declarator_listContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Init_declarator_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 10, self.RULE_init_declarator_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 208=0D @@ -1324,7 +1300,7 @@ class CParser ( Parser ): self.state =3D 213=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 209=0D self.match(CParser.T__3)=0D self.state =3D 210=0D @@ -1345,39 +1321,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def initializer(self):=0D - return self.getTypedRuleContext(CParser.InitializerContext,0)= =0D -=0D + return self.getTypedRuleContext(CParser.InitializerContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_init_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInit_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInit_declarator"):=0D listener.enterInit_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInit_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInit_declarator"):=0D listener.exitInit_declarator(self)=0D =0D -=0D -=0D -=0D def init_declarator(self):=0D =0D localctx =3D CParser.Init_declaratorContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 12, self.RULE_init_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 216=0D @@ -1385,13 +1356,12 @@ class CParser ( Parser ): self.state =3D 219=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__4:=0D + if _la =3D=3D CParser.T__4:=0D self.state =3D 217=0D self.match(CParser.T__4)=0D self.state =3D 218=0D self.initializer()=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1404,32 +1374,29 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_storage_class_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStorage_class_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStorage_class_specifier"):=0D listener.enterStorage_class_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStorage_class_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStorage_class_specifier"):=0D listener.exitStorage_class_specifier(self)=0D =0D -=0D -=0D -=0D def storage_class_specifier(self):=0D =0D - localctx =3D CParser.Storage_class_specifierContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Storage_class_specifierContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 14, self.RULE_storage_class_specifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 221=0D @@ -1451,55 +1418,47 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.s =3D None # Struct_or_union_specifierContext=0D - self.e =3D None # Enum_specifierContext=0D + self.s =3D None # Struct_or_union_specifierContext=0D + self.e =3D None # Enum_specifierContext=0D =0D def struct_or_union_specifier(self):=0D - return self.getTypedRuleContext(CParser.Struct_or_union_specif= ierContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_or_union_specif= ierContext, 0)=0D =0D def enum_specifier(self):=0D - return self.getTypedRuleContext(CParser.Enum_specifierContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Enum_specifierContext,= 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def type_id(self):=0D - return self.getTypedRuleContext(CParser.Type_idContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_idContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_type_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_specifier"):=0D listener.enterType_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_specifier"):=0D listener.exitType_specifier(self)=0D =0D -=0D -=0D -=0D def type_specifier(self):=0D =0D localctx =3D CParser.Type_specifierContext(self, self._ctx, self.s= tate)=0D @@ -1507,7 +1466,7 @@ class CParser ( Parser ): try:=0D self.state =3D 247=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,16,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 16, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 223=0D @@ -1568,7 +1527,8 @@ class CParser ( Parser ): localctx.s =3D self.struct_or_union_specifier()=0D =0D if localctx.s.stop is not None:=0D - self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (None if localctx.s is None else localctx.s.stop).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop))))=0D + self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (=0D + None if localctx.s is None else localctx.s.stop).c= olumn, (None if localctx.s is None else self._input.getText((localctx.s.sta= rt, localctx.s.stop))))=0D =0D pass=0D =0D @@ -1578,7 +1538,8 @@ class CParser ( Parser ): localctx.e =3D self.enum_specifier()=0D =0D if localctx.e.stop is not None:=0D - self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (None if localctx.e is None else localctx.e.stop).column, (None if localctx= .e is None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (=0D + None if localctx.e is None else localctx.e.stop).c= olumn, (None if localctx.e is None else self._input.getText((localctx.e.sta= rt, localctx.e.stop))))=0D =0D pass=0D =0D @@ -1588,14 +1549,15 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D self.state =3D 242=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,15,self.= _ctx)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 15, sel= f._ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 239=0D self.type_qualifier()=0D self.state =3D 244=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,15,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 15, self._ctx)=0D =0D self.state =3D 245=0D self.declarator()=0D @@ -1607,7 +1569,6 @@ class CParser ( Parser ): self.type_id()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1620,7 +1581,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -1631,18 +1592,15 @@ class CParser ( Parser ): return CParser.RULE_type_id=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_id" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_id"):=0D listener.enterType_id(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_id" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_id"):=0D listener.exitType_id(self)=0D =0D -=0D -=0D -=0D def type_id(self):=0D =0D localctx =3D CParser.Type_idContext(self, self._ctx, self.state)=0D @@ -1663,17 +1621,15 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def struct_or_union(self):=0D - return self.getTypedRuleContext(CParser.Struct_or_unionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_or_unionContext= , 0)=0D =0D def struct_declaration_list(self):=0D - return self.getTypedRuleContext(CParser.Struct_declaration_lis= tContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaration_lis= tContext, 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D @@ -1682,27 +1638,25 @@ class CParser ( Parser ): return CParser.RULE_struct_or_union_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_or_union_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_or_union_specifier"):=0D listener.enterStruct_or_union_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_or_union_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_or_union_specifier"):=0D listener.exitStruct_or_union_specifier(self)=0D =0D -=0D -=0D -=0D def struct_or_union_specifier(self):=0D =0D - localctx =3D CParser.Struct_or_union_specifierContext(self, self._= ctx, self.state)=0D + localctx =3D CParser.Struct_or_union_specifierContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 20, self.RULE_struct_or_union_specifier)= =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 262=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,18,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 18, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 251=0D @@ -1710,11 +1664,10 @@ class CParser ( Parser ): self.state =3D 253=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.IDENTIFIER:=0D + if _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 252=0D self.match(CParser.IDENTIFIER)=0D =0D -=0D self.state =3D 255=0D self.match(CParser.T__0)=0D self.state =3D 256=0D @@ -1731,7 +1684,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1744,37 +1696,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_struct_or_union=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_or_union" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_or_union"):=0D listener.enterStruct_or_union(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_or_union" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_or_union"):=0D listener.exitStruct_or_union(self)=0D =0D -=0D -=0D -=0D def struct_or_union(self):=0D =0D localctx =3D CParser.Struct_or_unionContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 22, self.RULE_struct_or_union)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 264=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__20 or _la=3D=3DCParser.T__21):=0D + if not(_la =3D=3D CParser.T__20 or _la =3D=3D CParser.T__21):= =0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -1791,39 +1739,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def struct_declaration(self,i=3DNone):=0D + def struct_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Struct_declaratio= nContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Struct_declaration= Context,i)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaration= Context, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declaration_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declaration_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declaration_list"):=0D listener.enterStruct_declaration_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declaration_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declaration_list"):=0D listener.exitStruct_declaration_list(self)=0D =0D -=0D -=0D -=0D def struct_declaration_list(self):=0D =0D - localctx =3D CParser.Struct_declaration_listContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Struct_declaration_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 24, self.RULE_struct_declaration_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 267=0D @@ -1835,7 +1780,7 @@ class CParser ( Parser ): self.state =3D 269=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 <<= CParser.T__10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CPars= er.T__13) | (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__= 16) | (1 << CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | = (1 << CParser.T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << = CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParse= r.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__3= 1) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (= 1 << CParser.T__35) | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.ID= ENTIFIER):=0D + if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 <<= CParser.T__10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CPars= er.T__13) | (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__= 16) | (1 << CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | = (1 << CParser.T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << = CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParse= r.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__3= 1) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (= 1 << CParser.T__35) | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.= IDENTIFIER):=0D break=0D =0D except RecognitionException as re:=0D @@ -1850,37 +1795,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def specifier_qualifier_list(self):=0D - return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext, 0)=0D =0D def struct_declarator_list(self):=0D - return self.getTypedRuleContext(CParser.Struct_declarator_list= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declarator_list= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declaration"):=0D listener.enterStruct_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declaration"):=0D listener.exitStruct_declaration(self)=0D =0D -=0D -=0D -=0D def struct_declaration(self):=0D =0D - localctx =3D CParser.Struct_declarationContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Struct_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 26, self.RULE_struct_declaration)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D @@ -1902,52 +1843,48 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_specifier(self,i=3DNone):=0D + def type_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_specifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_specifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_specifierCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_specifier_qualifier_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterSpecifier_qualifier_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterSpecifier_qualifier_list"):=0D listener.enterSpecifier_qualifier_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitSpecifier_qualifier_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitSpecifier_qualifier_list"):=0D listener.exitSpecifier_qualifier_list(self)=0D =0D -=0D -=0D -=0D def specifier_qualifier_list(self):=0D =0D - localctx =3D CParser.Specifier_qualifier_listContext(self, self._c= tx, self.state)=0D + localctx =3D CParser.Specifier_qualifier_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 28, self.RULE_specifier_qualifier_list)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 277=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 277=0D self._errHandler.sync(self)=0D @@ -1963,12 +1900,11 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D else:=0D raise NoViableAltException(self)=0D self.state =3D 279=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,21,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 21, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1982,39 +1918,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def struct_declarator(self,i=3DNone):=0D + def struct_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Struct_declarator= Context)=0D else:=0D - return self.getTypedRuleContext(CParser.Struct_declaratorC= ontext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaratorC= ontext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declarator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declarator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declarator_list"):=0D listener.enterStruct_declarator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declarator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declarator_list"):=0D listener.exitStruct_declarator_list(self)=0D =0D -=0D -=0D -=0D def struct_declarator_list(self):=0D =0D - localctx =3D CParser.Struct_declarator_listContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Struct_declarator_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 30, self.RULE_struct_declarator_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 281=0D @@ -2022,7 +1955,7 @@ class CParser ( Parser ): self.state =3D 286=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 282=0D self.match(CParser.T__3)=0D self.state =3D 283=0D @@ -2043,39 +1976,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declarator"):=0D listener.enterStruct_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declarator"):=0D listener.exitStruct_declarator(self)=0D =0D -=0D -=0D -=0D def struct_declarator(self):=0D =0D - localctx =3D CParser.Struct_declaratorContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Struct_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 32, self.RULE_struct_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 296=0D self._errHandler.sync(self)=0D @@ -2087,13 +2016,12 @@ class CParser ( Parser ): self.state =3D 292=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__22:=0D + if _la =3D=3D CParser.T__22:=0D self.state =3D 290=0D self.match(CParser.T__22)=0D self.state =3D 291=0D self.constant_expression()=0D =0D -=0D pass=0D elif token in [CParser.T__22]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -2117,13 +2045,12 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def enumerator_list(self):=0D - return self.getTypedRuleContext(CParser.Enumerator_listContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Enumerator_listContext= , 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D @@ -2132,27 +2059,24 @@ class CParser ( Parser ): return CParser.RULE_enum_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnum_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnum_specifier"):=0D listener.enterEnum_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnum_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnum_specifier"):=0D listener.exitEnum_specifier(self)=0D =0D -=0D -=0D -=0D def enum_specifier(self):=0D =0D localctx =3D CParser.Enum_specifierContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 34, self.RULE_enum_specifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 317=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,27,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 27, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 298=0D @@ -2164,11 +2088,10 @@ class CParser ( Parser ): self.state =3D 302=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 301=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 304=0D self.match(CParser.T__19)=0D pass=0D @@ -2186,11 +2109,10 @@ class CParser ( Parser ): self.state =3D 311=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 310=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 313=0D self.match(CParser.T__19)=0D pass=0D @@ -2203,7 +2125,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2216,34 +2137,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def enumerator(self,i=3DNone):=0D + def enumerator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.EnumeratorContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.EnumeratorContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.EnumeratorContext,= i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_enumerator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnumerator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnumerator_list"):=0D listener.enterEnumerator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnumerator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnumerator_list"):=0D listener.exitEnumerator_list(self)=0D =0D -=0D -=0D -=0D def enumerator_list(self):=0D =0D localctx =3D CParser.Enumerator_listContext(self, self._ctx, self.= state)=0D @@ -2254,16 +2171,16 @@ class CParser ( Parser ): self.enumerator()=0D self.state =3D 324=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,28,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 28, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 320=0D self.match(CParser.T__3)=0D self.state =3D 321=0D self.enumerator()=0D self.state =3D 326=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,28,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 28, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -2277,7 +2194,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -2285,30 +2202,26 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_enumerator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnumerator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnumerator"):=0D listener.enterEnumerator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnumerator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnumerator"):=0D listener.exitEnumerator(self)=0D =0D -=0D -=0D -=0D def enumerator(self):=0D =0D localctx =3D CParser.EnumeratorContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 38, self.RULE_enumerator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 327=0D @@ -2316,13 +2229,12 @@ class CParser ( Parser ): self.state =3D 330=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__4:=0D + if _la =3D=3D CParser.T__4:=0D self.state =3D 328=0D self.match(CParser.T__4)=0D self.state =3D 329=0D self.constant_expression()=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2335,32 +2247,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_type_qualifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_qualifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_qualifier"):=0D listener.enterType_qualifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_qualifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_qualifier"):=0D listener.exitType_qualifier(self)=0D =0D -=0D -=0D -=0D def type_qualifier(self):=0D =0D localctx =3D CParser.Type_qualifierContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 40, self.RULE_type_qualifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 332=0D @@ -2382,77 +2290,68 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def direct_declarator(self):=0D - return self.getTypedRuleContext(CParser.Direct_declaratorConte= xt,0)=0D -=0D + return self.getTypedRuleContext(CParser.Direct_declaratorConte= xt, 0)=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclarator"):=0D listener.enterDeclarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclarator"):=0D listener.exitDeclarator(self)=0D =0D -=0D -=0D -=0D def declarator(self):=0D =0D localctx =3D CParser.DeclaratorContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 42, self.RULE_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 348=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,34,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 34, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 335=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__41:=0D + if _la =3D=3D CParser.T__41:=0D self.state =3D 334=0D self.pointer()=0D =0D -=0D self.state =3D 338=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__33:=0D + if _la =3D=3D CParser.T__33:=0D self.state =3D 337=0D self.match(CParser.T__33)=0D =0D -=0D self.state =3D 341=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__34:=0D + if _la =3D=3D CParser.T__34:=0D self.state =3D 340=0D self.match(CParser.T__34)=0D =0D -=0D self.state =3D 344=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__35:=0D + if _la =3D=3D CParser.T__35:=0D self.state =3D 343=0D self.match(CParser.T__35)=0D =0D -=0D self.state =3D 346=0D self.direct_declarator()=0D pass=0D @@ -2463,7 +2362,6 @@ class CParser ( Parser ): self.pointer()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2476,7 +2374,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -2484,36 +2382,32 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def declarator_suffix(self,i=3DNone):=0D + def declarator_suffix(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Declarator_suffix= Context)=0D else:=0D - return self.getTypedRuleContext(CParser.Declarator_suffixC= ontext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Declarator_suffixC= ontext, i)=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_direct_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDirect_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDirect_declarator"):=0D listener.enterDirect_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDirect_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDirect_declarator"):=0D listener.exitDirect_declarator(self)=0D =0D -=0D -=0D -=0D def direct_declarator(self):=0D =0D - localctx =3D CParser.Direct_declaratorContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Direct_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 44, self.RULE_direct_declarator)=0D try:=0D self.state =3D 368=0D @@ -2525,14 +2419,15 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D self.state =3D 354=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,35,self.= _ctx)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 35, sel= f._ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 351=0D self.declarator_suffix()=0D self.state =3D 356=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,35,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 35, self._ctx)=0D =0D pass=0D elif token in [CParser.T__37]:=0D @@ -2541,12 +2436,11 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 359=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,36,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 36, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 358=0D self.match(CParser.T__33)=0D =0D -=0D self.state =3D 361=0D self.declarator()=0D self.state =3D 362=0D @@ -2554,7 +2448,7 @@ class CParser ( Parser ): self.state =3D 364=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 363=0D self.declarator_suffix()=0D @@ -2563,7 +2457,8 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 366=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,37,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 37, self._ctx)=0D =0D pass=0D else:=0D @@ -2581,46 +2476,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def parameter_type_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_type_listCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_type_listCon= text, 0)=0D =0D def identifier_list(self):=0D - return self.getTypedRuleContext(CParser.Identifier_listContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Identifier_listContext= , 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declarator_suffix=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclarator_suffix" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclarator_suffix"):=0D listener.enterDeclarator_suffix(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclarator_suffix" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclarator_suffix"):=0D listener.exitDeclarator_suffix(self)=0D =0D -=0D -=0D -=0D def declarator_suffix(self):=0D =0D - localctx =3D CParser.Declarator_suffixContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Declarator_suffixContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 46, self.RULE_declarator_suffix)=0D try:=0D self.state =3D 386=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,39,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 39, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 370=0D @@ -2667,7 +2557,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2680,38 +2569,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_pointer=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPointer" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPointer"):=0D listener.enterPointer(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPointer" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPointer"):=0D listener.exitPointer(self)=0D =0D -=0D -=0D -=0D def pointer(self):=0D =0D localctx =3D CParser.PointerContext(self, self._ctx, self.state)=0D @@ -2719,7 +2603,7 @@ class CParser ( Parser ): try:=0D self.state =3D 400=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,42,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 42, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 388=0D @@ -2727,7 +2611,7 @@ class CParser ( Parser ): self.state =3D 390=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 389=0D self.type_qualifier()=0D @@ -2736,16 +2620,16 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 392=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,40,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 40, self._ctx)=0D =0D self.state =3D 395=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,41,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 41, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 394=0D self.pointer()=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -2762,7 +2646,6 @@ class CParser ( Parser ): self.match(CParser.T__41)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2775,35 +2658,32 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def parameter_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_listContext,= 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_type_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_type_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_type_list"):=0D listener.enterParameter_type_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_type_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_type_list"):=0D listener.exitParameter_type_list(self)=0D =0D -=0D -=0D -=0D def parameter_type_list(self):=0D =0D - localctx =3D CParser.Parameter_type_listContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Parameter_type_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 50, self.RULE_parameter_type_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 402=0D @@ -2811,21 +2691,19 @@ class CParser ( Parser ): self.state =3D 408=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 403=0D self.match(CParser.T__3)=0D self.state =3D 405=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 404=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 407=0D self.match(CParser.T__42)=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2838,34 +2716,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def parameter_declaration(self,i=3DNone):=0D + def parameter_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Parameter_declara= tionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_list"):=0D listener.enterParameter_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_list"):=0D listener.exitParameter_list(self)=0D =0D -=0D -=0D -=0D def parameter_list(self):=0D =0D localctx =3D CParser.Parameter_listContext(self, self._ctx, self.s= tate)=0D @@ -2876,24 +2750,24 @@ class CParser ( Parser ): self.parameter_declaration()=0D self.state =3D 418=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,46,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 46, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 411=0D self.match(CParser.T__3)=0D self.state =3D 413=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,45,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 45, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 412=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 415=0D self.parameter_declaration()=0D self.state =3D 420=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,46,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 46, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -2907,66 +2781,60 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declarator(self,i=3DNone):=0D + def declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclaratorContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext,= i)=0D =0D # @param i=3DNone Type: int=0D - def abstract_declarator(self,i=3DNone):=0D + def abstract_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Abstract_declarat= orContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Abstract_declarato= rContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declarato= rContext, i)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def pointer(self,i=3DNone):=0D + def pointer(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.PointerContext)=0D else:=0D - return self.getTypedRuleContext(CParser.PointerContext,i)= =0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, i)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_declaration"):=0D listener.enterParameter_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_declaration"):=0D listener.exitParameter_declaration(self)=0D =0D -=0D -=0D -=0D def parameter_declaration(self):=0D =0D - localctx =3D CParser.Parameter_declarationContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Parameter_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 54, self.RULE_parameter_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 439=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,51,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 51, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 421=0D @@ -2977,7 +2845,8 @@ class CParser ( Parser ): while ((((_la - 34)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 3= 4)) & ((1 << (CParser.T__33 - 34)) | (1 << (CParser.T__34 - 34)) | (1 << (C= Parser.T__35 - 34)) | (1 << (CParser.T__37 - 34)) | (1 << (CParser.T__39 - = 34)) | (1 << (CParser.T__41 - 34)) | (1 << (CParser.IDENTIFIER - 34)))) != =3D 0):=0D self.state =3D 424=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,47,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 47, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 422=0D self.declarator()=0D @@ -2988,7 +2857,6 @@ class CParser ( Parser ): self.abstract_declarator()=0D pass=0D =0D -=0D self.state =3D 428=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -2996,11 +2864,10 @@ class CParser ( Parser ): self.state =3D 430=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 429=0D self.match(CParser.T__28)=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -3008,7 +2875,7 @@ class CParser ( Parser ): self.state =3D 435=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__41:=0D + while _la =3D=3D CParser.T__41:=0D self.state =3D 432=0D self.pointer()=0D self.state =3D 437=0D @@ -3019,7 +2886,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3032,12 +2898,12 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D @@ -3047,23 +2913,20 @@ class CParser ( Parser ): return CParser.RULE_identifier_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterIdentifier_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterIdentifier_list"):=0D listener.enterIdentifier_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitIdentifier_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitIdentifier_list"):=0D listener.exitIdentifier_list(self)=0D =0D -=0D -=0D -=0D def identifier_list(self):=0D =0D localctx =3D CParser.Identifier_listContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 56, self.RULE_identifier_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 441=0D @@ -3071,7 +2934,7 @@ class CParser ( Parser ): self.state =3D 446=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 442=0D self.match(CParser.T__3)=0D self.state =3D 443=0D @@ -3092,47 +2955,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def specifier_qualifier_list(self):=0D - return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext, 0)=0D =0D def abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text, 0)=0D =0D def type_id(self):=0D - return self.getTypedRuleContext(CParser.Type_idContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_idContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_type_name=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_name" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_name"):=0D listener.enterType_name(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_name" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_name"):=0D listener.exitType_name(self)=0D =0D -=0D -=0D -=0D def type_name(self):=0D =0D localctx =3D CParser.Type_nameContext(self, self._ctx, self.state)= =0D self.enterRule(localctx, 58, self.RULE_type_name)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 454=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,54,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 54, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 449=0D @@ -3144,7 +3001,6 @@ class CParser ( Parser ): self.state =3D 450=0D self.abstract_declarator()=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -3153,7 +3009,6 @@ class CParser ( Parser ): self.type_id()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3166,37 +3021,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def direct_abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Direct_abstract_declar= atorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Direct_abstract_declar= atorContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_abstract_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAbstract_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAbstract_declarator"):=0D listener.enterAbstract_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAbstract_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAbstract_declarator"):=0D listener.exitAbstract_declarator(self)=0D =0D -=0D -=0D -=0D def abstract_declarator(self):=0D =0D - localctx =3D CParser.Abstract_declaratorContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Abstract_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 60, self.RULE_abstract_declarator)=0D try:=0D self.state =3D 461=0D @@ -3208,12 +3059,11 @@ class CParser ( Parser ): self.pointer()=0D self.state =3D 458=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,55,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 55, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 457=0D self.direct_abstract_declarator()=0D =0D -=0D pass=0D elif token in [CParser.T__37, CParser.T__39]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -3235,46 +3085,43 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text, 0)=0D =0D # @param i=3DNone Type: int=0D - def abstract_declarator_suffix(self,i=3DNone):=0D + def abstract_declarator_suffix(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Abstract_declarat= or_suffixContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Abstract_declarato= r_suffixContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declarato= r_suffixContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_direct_abstract_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDirect_abstract_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDirect_abstract_declarator"):=0D listener.enterDirect_abstract_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDirect_abstract_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDirect_abstract_declarator"):=0D listener.exitDirect_abstract_declarator(self)=0D =0D -=0D -=0D def direct_abstract_declarator(self):=0D =0D - localctx =3D CParser.Direct_abstract_declaratorContext(self, self.= _ctx, self.state)=0D + localctx =3D CParser.Direct_abstract_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 62, self.RULE_direct_abstract_declarator)= =0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 468=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,57,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 57, self._ct= x)=0D if la_ =3D=3D 1:=0D self.state =3D 463=0D self.match(CParser.T__37)=0D @@ -3289,17 +3136,16 @@ class CParser ( Parser ): self.abstract_declarator_suffix()=0D pass=0D =0D -=0D self.state =3D 473=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,58,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 58, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 470=0D self.abstract_declarator_suffix()=0D self.state =3D 475=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,58,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 58, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -3313,42 +3159,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def parameter_type_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_type_listCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_type_listCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_abstract_declarator_suffix=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAbstract_declarator_suffix" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAbstract_declarator_suffix"):=0D listener.enterAbstract_declarator_suffix(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAbstract_declarator_suffix" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAbstract_declarator_suffix"):=0D listener.exitAbstract_declarator_suffix(self)=0D =0D -=0D -=0D -=0D def abstract_declarator_suffix(self):=0D =0D - localctx =3D CParser.Abstract_declarator_suffixContext(self, self.= _ctx, self.state)=0D + localctx =3D CParser.Abstract_declarator_suffixContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 64, self.RULE_abstract_declarator_suffix)= =0D try:=0D self.state =3D 488=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,59,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 59, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 476=0D @@ -3385,7 +3227,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3398,39 +3239,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def assignment_expression(self):=0D - return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext, 0)=0D =0D def initializer_list(self):=0D - return self.getTypedRuleContext(CParser.Initializer_listContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Initializer_listContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_initializer=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInitializer" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInitializer"):=0D listener.enterInitializer(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInitializer" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInitializer"):=0D listener.exitInitializer(self)=0D =0D -=0D -=0D -=0D def initializer(self):=0D =0D localctx =3D CParser.InitializerContext(self, self._ctx, self.stat= e)=0D self.enterRule(localctx, 66, self.RULE_initializer)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 498=0D self._errHandler.sync(self)=0D @@ -3449,11 +3285,10 @@ class CParser ( Parser ): self.state =3D 494=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 493=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 496=0D self.match(CParser.T__19)=0D pass=0D @@ -3472,34 +3307,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def initializer(self,i=3DNone):=0D + def initializer(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.InitializerContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.InitializerContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.InitializerContext= , i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_initializer_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInitializer_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInitializer_list"):=0D listener.enterInitializer_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInitializer_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInitializer_list"):=0D listener.exitInitializer_list(self)=0D =0D -=0D -=0D -=0D def initializer_list(self):=0D =0D localctx =3D CParser.Initializer_listContext(self, self._ctx, self= .state)=0D @@ -3510,16 +3341,16 @@ class CParser ( Parser ): self.initializer()=0D self.state =3D 505=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,62,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 62, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 501=0D self.match(CParser.T__3)=0D self.state =3D 502=0D self.initializer()=0D self.state =3D 507=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,62,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 62, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -3533,39 +3364,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def assignment_expression(self,i=3DNone):=0D + def assignment_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Assignment_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Assignment_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_argument_expression_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterArgument_expression_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterArgument_expression_list"):=0D listener.enterArgument_expression_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitArgument_expression_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitArgument_expression_list"):=0D listener.exitArgument_expression_list(self)=0D =0D -=0D -=0D -=0D def argument_expression_list(self):=0D =0D - localctx =3D CParser.Argument_expression_listContext(self, self._c= tx, self.state)=0D + localctx =3D CParser.Argument_expression_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 70, self.RULE_argument_expression_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 508=0D @@ -3573,15 +3401,14 @@ class CParser ( Parser ): self.state =3D 510=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 509=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 519=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 512=0D self.match(CParser.T__3)=0D self.state =3D 513=0D @@ -3589,11 +3416,10 @@ class CParser ( Parser ): self.state =3D 515=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 514=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 521=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -3610,39 +3436,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def multiplicative_expression(self,i=3DNone):=0D + def multiplicative_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Multiplicative_ex= pressionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Multiplicative_exp= ressionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Multiplicative_exp= ressionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_additive_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAdditive_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAdditive_expression"):=0D listener.enterAdditive_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAdditive_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAdditive_expression"):=0D listener.exitAdditive_expression(self)=0D =0D -=0D -=0D -=0D def additive_expression(self):=0D =0D - localctx =3D CParser.Additive_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Additive_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 72, self.RULE_additive_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 522=0D @@ -3650,7 +3473,7 @@ class CParser ( Parser ): self.state =3D 529=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__43 or _la=3D=3DCParser.T__44:=0D + while _la =3D=3D CParser.T__43 or _la =3D=3D CParser.T__44:=0D self.state =3D 527=0D self._errHandler.sync(self)=0D token =3D self._input.LA(1)=0D @@ -3685,39 +3508,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def cast_expression(self,i=3DNone):=0D + def cast_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Cast_expressionCo= ntext)=0D else:=0D - return self.getTypedRuleContext(CParser.Cast_expressionCon= text,i)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionCon= text, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_multiplicative_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMultiplicative_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMultiplicative_expression"):=0D listener.enterMultiplicative_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMultiplicative_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMultiplicative_expression"):=0D listener.exitMultiplicative_expression(self)=0D =0D -=0D -=0D -=0D def multiplicative_expression(self):=0D =0D - localctx =3D CParser.Multiplicative_expressionContext(self, self._= ctx, self.state)=0D + localctx =3D CParser.Multiplicative_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 74, self.RULE_multiplicative_expression)= =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 532=0D @@ -3766,38 +3586,32 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def type_name(self):=0D - return self.getTypedRuleContext(CParser.Type_nameContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_nameContext, 0)=0D =0D def cast_expression(self):=0D - return self.getTypedRuleContext(CParser.Cast_expressionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionContext= , 0)=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_cast_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterCast_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterCast_expression"):=0D listener.enterCast_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitCast_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitCast_expression"):=0D listener.exitCast_expression(self)=0D =0D -=0D -=0D -=0D def cast_expression(self):=0D =0D localctx =3D CParser.Cast_expressionContext(self, self._ctx, self.= state)=0D @@ -3805,7 +3619,7 @@ class CParser ( Parser ): try:=0D self.state =3D 550=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,70,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 70, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 544=0D @@ -3824,7 +3638,6 @@ class CParser ( Parser ): self.unary_expression()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3837,46 +3650,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def postfix_expression(self):=0D - return self.getTypedRuleContext(CParser.Postfix_expressionCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Postfix_expressionCont= ext, 0)=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def unary_operator(self):=0D - return self.getTypedRuleContext(CParser.Unary_operatorContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_operatorContext,= 0)=0D =0D def cast_expression(self):=0D - return self.getTypedRuleContext(CParser.Cast_expressionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionContext= , 0)=0D =0D def type_name(self):=0D - return self.getTypedRuleContext(CParser.Type_nameContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_nameContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_unary_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterUnary_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterUnary_expression"):=0D listener.enterUnary_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitUnary_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitUnary_expression"):=0D listener.exitUnary_expression(self)=0D =0D -=0D -=0D -=0D def unary_expression(self):=0D =0D localctx =3D CParser.Unary_expressionContext(self, self._ctx, self= .state)=0D @@ -3884,7 +3689,7 @@ class CParser ( Parser ): try:=0D self.state =3D 567=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,71,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 71, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 552=0D @@ -3935,7 +3740,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3948,48 +3752,44 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D self.FuncCallText =3D ''=0D - self.p =3D None # Primary_expressionContext=0D - self.a =3D None # Token=0D - self.c =3D None # Argument_expression_listContext=0D - self.b =3D None # Token=0D - self.x =3D None # Token=0D - self.y =3D None # Token=0D - self.z =3D None # Token=0D + self.p =3D None # Primary_expressionContext=0D + self.a =3D None # Token=0D + self.c =3D None # Argument_expression_listContext=0D + self.b =3D None # Token=0D + self.x =3D None # Token=0D + self.y =3D None # Token=0D + self.z =3D None # Token=0D =0D def primary_expression(self):=0D - return self.getTypedRuleContext(CParser.Primary_expressionCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Primary_expressionCont= ext, 0)=0D =0D # @param i=3DNone Type: int=0D - def expression(self,i=3DNone):=0D + def expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.ExpressionContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.ExpressionContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext,= i)=0D =0D # @param i=3DNone Type: int=0D - def macro_parameter_list(self,i=3DNone):=0D + def macro_parameter_list(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Macro_parameter_l= istContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Macro_parameter_li= stContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_parameter_li= stContext, i)=0D =0D # @param i=3DNone Type: int=0D - def argument_expression_list(self,i=3DNone):=0D + def argument_expression_list(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Argument_expressi= on_listContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Argument_expressio= n_listContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Argument_expressio= n_listContext, i)=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D @@ -3999,38 +3799,38 @@ class CParser ( Parser ): return CParser.RULE_postfix_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPostfix_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPostfix_expression"):=0D listener.enterPostfix_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPostfix_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPostfix_expression"):=0D listener.exitPostfix_expression(self)=0D =0D -=0D -=0D -=0D def postfix_expression(self):=0D =0D - localctx =3D CParser.Postfix_expressionContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Postfix_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 80, self.RULE_postfix_expression)=0D =0D - self.FuncCallText=3D''=0D + self.FuncCallText =3D ''=0D =0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 569=0D localctx.p =3D self.primary_expression()=0D - self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText((localctx.p.start,localctx.p.stop)))=0D + self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText(=0D + (localctx.p.start, localctx.p.stop)))=0D self.state =3D 600=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,73,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 73, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 598=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,72,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 72, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 571=0D self.match(CParser.T__39)=0D @@ -4045,7 +3845,8 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 576=0D localctx.a =3D self.match(CParser.T__38)=0D - self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.a is None else localctx.a.line), localctx.a= .column, self.FuncCallText, '')=0D + self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (=0D + 0 if localctx.a is None else localctx.a.line),= localctx.a.column, self.FuncCallText, '')=0D pass=0D =0D elif la_ =3D=3D 3:=0D @@ -4055,7 +3856,8 @@ class CParser ( Parser ): localctx.c =3D self.argument_expression_list()=0D self.state =3D 580=0D localctx.b =3D self.match(CParser.T__38)=0D - self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.b is None else localctx.b.line), localctx.b= .column, self.FuncCallText, (None if localctx.c is None else self._input.ge= tText((localctx.c.start,localctx.c.stop))))=0D + self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (=0D + 0 if localctx.b is None else localctx.b.line),= localctx.b.column, self.FuncCallText, (None if localctx.c is None else sel= f._input.getText((localctx.c.start, localctx.c.stop))))=0D pass=0D =0D elif la_ =3D=3D 4:=0D @@ -4072,7 +3874,8 @@ class CParser ( Parser ): self.match(CParser.T__50)=0D self.state =3D 588=0D localctx.x =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText +=3D '.' + (None if localctx.x i= s None else localctx.x.text)=0D + self.FuncCallText +=3D '.' + \=0D + (None if localctx.x is None else localctx.x.te= xt)=0D pass=0D =0D elif la_ =3D=3D 6:=0D @@ -4080,7 +3883,8 @@ class CParser ( Parser ): self.match(CParser.T__41)=0D self.state =3D 591=0D localctx.y =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText =3D (None if localctx.y is None = else localctx.y.text)=0D + self.FuncCallText =3D (=0D + None if localctx.y is None else localctx.y.tex= t)=0D pass=0D =0D elif la_ =3D=3D 7:=0D @@ -4088,7 +3892,8 @@ class CParser ( Parser ): self.match(CParser.T__51)=0D self.state =3D 594=0D localctx.z =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText +=3D '->' + (None if localctx.z = is None else localctx.z.text)=0D + self.FuncCallText +=3D '->' + \=0D + (None if localctx.z is None else localctx.z.te= xt)=0D pass=0D =0D elif la_ =3D=3D 8:=0D @@ -4101,10 +3906,9 @@ class CParser ( Parser ): self.match(CParser.T__48)=0D pass=0D =0D -=0D self.state =3D 602=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,73,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 73, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -4118,39 +3922,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def parameter_declaration(self,i=3DNone):=0D + def parameter_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Parameter_declara= tionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_macro_parameter_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMacro_parameter_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMacro_parameter_list"):=0D listener.enterMacro_parameter_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMacro_parameter_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMacro_parameter_list"):=0D listener.exitMacro_parameter_list(self)=0D =0D -=0D -=0D -=0D def macro_parameter_list(self):=0D =0D - localctx =3D CParser.Macro_parameter_listContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Macro_parameter_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 82, self.RULE_macro_parameter_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 603=0D @@ -4158,7 +3959,7 @@ class CParser ( Parser ): self.state =3D 608=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 604=0D self.match(CParser.T__3)=0D self.state =3D 605=0D @@ -4179,32 +3980,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_unary_operator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterUnary_operator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterUnary_operator"):=0D listener.enterUnary_operator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitUnary_operator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitUnary_operator"):=0D listener.exitUnary_operator(self)=0D =0D -=0D -=0D -=0D def unary_operator(self):=0D =0D localctx =3D CParser.Unary_operatorContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 84, self.RULE_unary_operator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 611=0D @@ -4226,7 +4023,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -4234,37 +4031,33 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def constant(self):=0D - return self.getTypedRuleContext(CParser.ConstantContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ConstantContext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_primary_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPrimary_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPrimary_expression"):=0D listener.enterPrimary_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPrimary_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPrimary_expression"):=0D listener.exitPrimary_expression(self)=0D =0D -=0D -=0D -=0D def primary_expression(self):=0D =0D - localctx =3D CParser.Primary_expressionContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Primary_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 86, self.RULE_primary_expression)=0D try:=0D self.state =3D 619=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,75,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 75, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 613=0D @@ -4287,7 +4080,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -4300,7 +4092,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -4317,14 +4109,14 @@ class CParser ( Parser ): return self.getToken(CParser.CHARACTER_LITERAL, 0)=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D return self.getToken(CParser.IDENTIFIER, i)=0D =0D # @param i=3DNone Type: int=0D - def STRING_LITERAL(self,i=3DNone):=0D + def STRING_LITERAL(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.STRING_LITERAL)=0D else:=0D @@ -4337,23 +4129,20 @@ class CParser ( Parser ): return CParser.RULE_constant=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConstant" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConstant"):=0D listener.enterConstant(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConstant" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConstant"):=0D listener.exitConstant(self)=0D =0D -=0D -=0D -=0D def constant(self):=0D =0D localctx =3D CParser.ConstantContext(self, self._ctx, self.state)= =0D self.enterRule(localctx, 88, self.RULE_constant)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 647=0D self._errHandler.sync(self)=0D @@ -4383,12 +4172,12 @@ class CParser ( Parser ): self.state =3D 636=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 628=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.IDENTIFIER:=0D + while _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 625=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 630=0D @@ -4398,7 +4187,7 @@ class CParser ( Parser ): self.state =3D 632=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER= :=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NU= MBER:=0D if _alt =3D=3D 1:=0D self.state =3D 631=0D self.match(CParser.STRING_LITERAL)=0D @@ -4407,19 +4196,20 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 634=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._in= put,77,self._ctx)=0D -=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 77, self._ctx)=0D =0D else:=0D raise NoViableAltException(self)=0D self.state =3D 638=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,78,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 78, self._ctx)=0D =0D self.state =3D 643=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.IDENTIFIER:=0D + while _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 640=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 645=0D @@ -4447,39 +4237,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def assignment_expression(self,i=3DNone):=0D + def assignment_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Assignment_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Assignment_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExpression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExpression"):=0D listener.enterExpression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExpression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExpression"):=0D listener.exitExpression(self)=0D =0D -=0D -=0D -=0D def expression(self):=0D =0D localctx =3D CParser.ExpressionContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 90, self.RULE_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 649=0D @@ -4487,7 +4273,7 @@ class CParser ( Parser ): self.state =3D 654=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 650=0D self.match(CParser.T__3)=0D self.state =3D 651=0D @@ -4508,33 +4294,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_constant_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConstant_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConstant_expression"):=0D listener.enterConstant_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConstant_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConstant_expression"):=0D listener.exitConstant_expression(self)=0D =0D -=0D -=0D -=0D def constant_expression(self):=0D =0D - localctx =3D CParser.Constant_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Constant_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 92, self.RULE_constant_expression)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D @@ -4552,50 +4335,44 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def lvalue(self):=0D - return self.getTypedRuleContext(CParser.LvalueContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.LvalueContext, 0)=0D =0D def assignment_operator(self):=0D - return self.getTypedRuleContext(CParser.Assignment_operatorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_operatorCon= text, 0)=0D =0D def assignment_expression(self):=0D - return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext, 0)=0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_assignment_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAssignment_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAssignment_expression"):=0D listener.enterAssignment_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAssignment_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAssignment_expression"):=0D listener.exitAssignment_expression(self)=0D =0D -=0D -=0D -=0D def assignment_expression(self):=0D =0D - localctx =3D CParser.Assignment_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Assignment_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 94, self.RULE_assignment_expression)=0D try:=0D self.state =3D 664=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,82,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 82, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 659=0D @@ -4612,7 +4389,6 @@ class CParser ( Parser ): self.conditional_expression()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -4625,30 +4401,26 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_lvalue=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLvalue" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLvalue"):=0D listener.enterLvalue(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLvalue" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLvalue"):=0D listener.exitLvalue(self)=0D =0D -=0D -=0D -=0D def lvalue(self):=0D =0D localctx =3D CParser.LvalueContext(self, self._ctx, self.state)=0D @@ -4669,32 +4441,29 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_assignment_operator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAssignment_operator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAssignment_operator"):=0D listener.enterAssignment_operator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAssignment_operator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAssignment_operator"):=0D listener.exitAssignment_operator(self)=0D =0D -=0D -=0D -=0D def assignment_operator(self):=0D =0D - localctx =3D CParser.Assignment_operatorContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Assignment_operatorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 98, self.RULE_assignment_operator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 668=0D @@ -4716,44 +4485,39 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # Logical_or_expressionContext=0D + self.e =3D None # Logical_or_expressionContext=0D =0D def logical_or_expression(self):=0D - return self.getTypedRuleContext(CParser.Logical_or_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Logical_or_expressionC= ontext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_conditional_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConditional_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConditional_expression"):=0D listener.enterConditional_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConditional_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConditional_expression"):=0D listener.exitConditional_expression(self)=0D =0D -=0D -=0D -=0D def conditional_expression(self):=0D =0D - localctx =3D CParser.Conditional_expressionContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Conditional_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 100, self.RULE_conditional_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 670=0D @@ -4761,7 +4525,7 @@ class CParser ( Parser ): self.state =3D 677=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__65:=0D + if _la =3D=3D CParser.T__65:=0D self.state =3D 671=0D self.match(CParser.T__65)=0D self.state =3D 672=0D @@ -4770,8 +4534,8 @@ class CParser ( Parser ): self.match(CParser.T__22)=0D self.state =3D 674=0D self.conditional_expression()=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D -=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -4785,39 +4549,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def logical_and_expression(self,i=3DNone):=0D + def logical_and_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Logical_and_expre= ssionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Logical_and_expres= sionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Logical_and_expres= sionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_logical_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLogical_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLogical_or_expression"):=0D listener.enterLogical_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLogical_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLogical_or_expression"):=0D listener.exitLogical_or_expression(self)=0D =0D -=0D -=0D -=0D def logical_or_expression(self):=0D =0D - localctx =3D CParser.Logical_or_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Logical_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 102, self.RULE_logical_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 679=0D @@ -4825,7 +4586,7 @@ class CParser ( Parser ): self.state =3D 684=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__66:=0D + while _la =3D=3D CParser.T__66:=0D self.state =3D 680=0D self.match(CParser.T__66)=0D self.state =3D 681=0D @@ -4846,39 +4607,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def inclusive_or_expression(self,i=3DNone):=0D + def inclusive_or_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Inclusive_or_expr= essionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Inclusive_or_expre= ssionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Inclusive_or_expre= ssionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_logical_and_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLogical_and_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLogical_and_expression"):=0D listener.enterLogical_and_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLogical_and_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLogical_and_expression"):=0D listener.exitLogical_and_expression(self)=0D =0D -=0D -=0D -=0D def logical_and_expression(self):=0D =0D - localctx =3D CParser.Logical_and_expressionContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Logical_and_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 104, self.RULE_logical_and_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 687=0D @@ -4886,7 +4644,7 @@ class CParser ( Parser ): self.state =3D 692=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__67:=0D + while _la =3D=3D CParser.T__67:=0D self.state =3D 688=0D self.match(CParser.T__67)=0D self.state =3D 689=0D @@ -4907,39 +4665,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def exclusive_or_expression(self,i=3DNone):=0D + def exclusive_or_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Exclusive_or_expr= essionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Exclusive_or_expre= ssionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Exclusive_or_expre= ssionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_inclusive_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInclusive_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInclusive_or_expression"):=0D listener.enterInclusive_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInclusive_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInclusive_or_expression"):=0D listener.exitInclusive_or_expression(self)=0D =0D -=0D -=0D -=0D def inclusive_or_expression(self):=0D =0D - localctx =3D CParser.Inclusive_or_expressionContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Inclusive_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 106, self.RULE_inclusive_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 695=0D @@ -4947,7 +4702,7 @@ class CParser ( Parser ): self.state =3D 700=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__68:=0D + while _la =3D=3D CParser.T__68:=0D self.state =3D 696=0D self.match(CParser.T__68)=0D self.state =3D 697=0D @@ -4968,39 +4723,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def and_expression(self,i=3DNone):=0D + def and_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.And_expressionCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.And_expressionCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.And_expressionCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_exclusive_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExclusive_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExclusive_or_expression"):=0D listener.enterExclusive_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExclusive_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExclusive_or_expression"):=0D listener.exitExclusive_or_expression(self)=0D =0D -=0D -=0D -=0D def exclusive_or_expression(self):=0D =0D - localctx =3D CParser.Exclusive_or_expressionContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Exclusive_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 108, self.RULE_exclusive_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 703=0D @@ -5008,7 +4760,7 @@ class CParser ( Parser ): self.state =3D 708=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__69:=0D + while _la =3D=3D CParser.T__69:=0D self.state =3D 704=0D self.match(CParser.T__69)=0D self.state =3D 705=0D @@ -5029,39 +4781,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def equality_expression(self,i=3DNone):=0D + def equality_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Equality_expressi= onContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Equality_expressio= nContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Equality_expressio= nContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_and_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAnd_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAnd_expression"):=0D listener.enterAnd_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAnd_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAnd_expression"):=0D listener.exitAnd_expression(self)=0D =0D -=0D -=0D -=0D def and_expression(self):=0D =0D localctx =3D CParser.And_expressionContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 110, self.RULE_and_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 711=0D @@ -5069,7 +4817,7 @@ class CParser ( Parser ): self.state =3D 716=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__52:=0D + while _la =3D=3D CParser.T__52:=0D self.state =3D 712=0D self.match(CParser.T__52)=0D self.state =3D 713=0D @@ -5090,39 +4838,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def relational_expression(self,i=3DNone):=0D + def relational_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Relational_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Relational_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Relational_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_equality_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEquality_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEquality_expression"):=0D listener.enterEquality_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEquality_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEquality_expression"):=0D listener.exitEquality_expression(self)=0D =0D -=0D -=0D -=0D def equality_expression(self):=0D =0D - localctx =3D CParser.Equality_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Equality_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 112, self.RULE_equality_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 719=0D @@ -5130,10 +4875,10 @@ class CParser ( Parser ): self.state =3D 724=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__70 or _la=3D=3DCParser.T__71:=0D + while _la =3D=3D CParser.T__70 or _la =3D=3D CParser.T__71:=0D self.state =3D 720=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__70 or _la=3D=3DCParser.T__71):= =0D + if not(_la =3D=3D CParser.T__70 or _la =3D=3D CParser.T__7= 1):=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5156,39 +4901,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def shift_expression(self,i=3DNone):=0D + def shift_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Shift_expressionC= ontext)=0D else:=0D - return self.getTypedRuleContext(CParser.Shift_expressionCo= ntext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Shift_expressionCo= ntext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_relational_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterRelational_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterRelational_expression"):=0D listener.enterRelational_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitRelational_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitRelational_expression"):=0D listener.exitRelational_expression(self)=0D =0D -=0D -=0D -=0D def relational_expression(self):=0D =0D - localctx =3D CParser.Relational_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Relational_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 114, self.RULE_relational_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 727=0D @@ -5222,39 +4964,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def additive_expression(self,i=3DNone):=0D + def additive_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Additive_expressi= onContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Additive_expressio= nContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Additive_expressio= nContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_shift_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterShift_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterShift_expression"):=0D listener.enterShift_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitShift_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitShift_expression"):=0D listener.exitShift_expression(self)=0D =0D -=0D -=0D -=0D def shift_expression(self):=0D =0D localctx =3D CParser.Shift_expressionContext(self, self._ctx, self= .state)=0D self.enterRule(localctx, 116, self.RULE_shift_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 735=0D @@ -5262,10 +5000,10 @@ class CParser ( Parser ): self.state =3D 740=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__76 or _la=3D=3DCParser.T__77:=0D + while _la =3D=3D CParser.T__76 or _la =3D=3D CParser.T__77:=0D self.state =3D 736=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__76 or _la=3D=3DCParser.T__77):= =0D + if not(_la =3D=3D CParser.T__76 or _la =3D=3D CParser.T__7= 7):=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5288,70 +5026,56 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def labeled_statement(self):=0D - return self.getTypedRuleContext(CParser.Labeled_statementConte= xt,0)=0D -=0D + return self.getTypedRuleContext(CParser.Labeled_statementConte= xt, 0)=0D =0D def compound_statement(self):=0D - return self.getTypedRuleContext(CParser.Compound_statementCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Compound_statementCont= ext, 0)=0D =0D def expression_statement(self):=0D - return self.getTypedRuleContext(CParser.Expression_statementCo= ntext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Expression_statementCo= ntext, 0)=0D =0D def selection_statement(self):=0D - return self.getTypedRuleContext(CParser.Selection_statementCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Selection_statementCon= text, 0)=0D =0D def iteration_statement(self):=0D - return self.getTypedRuleContext(CParser.Iteration_statementCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Iteration_statementCon= text, 0)=0D =0D def jump_statement(self):=0D - return self.getTypedRuleContext(CParser.Jump_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Jump_statementContext,= 0)=0D =0D def macro_statement(self):=0D - return self.getTypedRuleContext(CParser.Macro_statementContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_statementContext= , 0)=0D =0D def asm2_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm2_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Asm2_statementContext,= 0)=0D =0D def asm1_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm1_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Asm1_statementContext,= 0)=0D =0D def asm_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm_statementContext,0= )=0D -=0D + return self.getTypedRuleContext(CParser.Asm_statementContext, = 0)=0D =0D def declaration(self):=0D - return self.getTypedRuleContext(CParser.DeclarationContext,0)= =0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStatement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStatement"):=0D listener.enterStatement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStatement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStatement"):=0D listener.exitStatement(self)=0D =0D -=0D -=0D -=0D def statement(self):=0D =0D localctx =3D CParser.StatementContext(self, self._ctx, self.state)= =0D @@ -5359,7 +5083,7 @@ class CParser ( Parser ): try:=0D self.state =3D 754=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,92,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 92, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 743=0D @@ -5426,7 +5150,6 @@ class CParser ( Parser ): self.declaration()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -5439,7 +5162,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5450,52 +5173,48 @@ class CParser ( Parser ): return CParser.RULE_asm2_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm2_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm2_statement"):=0D listener.enterAsm2_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm2_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm2_statement"):=0D listener.exitAsm2_statement(self)=0D =0D -=0D -=0D -=0D def asm2_statement(self):=0D =0D localctx =3D CParser.Asm2_statementContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 120, self.RULE_asm2_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 757=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__78:=0D + if _la =3D=3D CParser.T__78:=0D self.state =3D 756=0D self.match(CParser.T__78)=0D =0D -=0D self.state =3D 759=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 760=0D self.match(CParser.T__37)=0D self.state =3D 764=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,94,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 94, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 761=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__1:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__1:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D self.consume()=0D self.state =3D 766=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,94,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 94, sel= f._ctx)=0D =0D self.state =3D 767=0D self.match(CParser.T__38)=0D @@ -5513,32 +5232,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_asm1_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm1_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm1_statement"):=0D listener.enterAsm1_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm1_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm1_statement"):=0D listener.exitAsm1_statement(self)=0D =0D -=0D -=0D -=0D def asm1_statement(self):=0D =0D localctx =3D CParser.Asm1_statementContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 122, self.RULE_asm1_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 770=0D @@ -5551,7 +5266,7 @@ class CParser ( Parser ): while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__0) | (1 << CParser.T__1) | (1 << CParser.T__2) | (1 << CParser.T__3) = | (1 << CParser.T__4) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << C= Parser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T_= _10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) |= (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 <<= CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CPars= er.T__21) | (1 << CParser.T__22) | (1 << CParser.T__23) | (1 << CParser.T__= 24) | (1 << CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | = (1 << CParser.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << = CParser.T__31) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParse= r.T__34) | (1 << CParser.T__35) | (1 << CParser.T__36) | (1 << CParser.T__3= 7) | (1 << CParser.T__38) | (1 << CParser.T__39) | (1 << CParser.T__40) | (= 1 << CParser.T__41) | (1 << CParser.T__42) | (1 << CParser.T__43) | (1 << C= Parser.T__44) | (1 << CParser.T__45) | (1 << CParser.T__46) | (1 << CParser= .T__47) | (1 << CParser.T__48) | (1 << CParser.T__49) | (1 << CParser.T__50= ) | (1 << CParser.T__51) | (1 << CParser.T__52) | (1 << CParser.T__53) | (1= << CParser.T__54) | (1 << CParser.T__55) | (1 << CParser.T__56) | (1 << CP= arser.T__57) | (1 << CParser.T__58) | (1 << CParser.T__59) | (1 << CParser.= T__60) | (1 << CParser.T__61) | (1 << CParser.T__62))) !=3D 0) or ((((_la -= 64)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 64)) & ((1 << (CParser.T__63 - 64= )) | (1 << (CParser.T__64 - 64)) | (1 << (CParser.T__65 - 64)) | (1 << (CPa= rser.T__66 - 64)) | (1 << (CParser.T__67 - 64)) | (1 << (CParser.T__68 - 64= )) | (1 << (CParser.T__69 - 64)) | (1 << (CParser.T__70 - 64)) | (1 << (CPa= rser.T__71 - 64)) | (1 << (CParser.T__72 - 64)) | (1 << (CParser.T__73 - 64= )) | (1 << (CParser.T__74 - 64)) | (1 << (CParser.T__75 - 64)) | (1 << (CPa= rser.T__76 - 64)) | (1 << (CParser.T__77 - 64)) | (1 << (CParser.T__78 - 64= )) | (1 << (CParser.T__79 - 64)) | (1 << (CParser.T__80 - 64)) | (1 << (CPa= rser.T__81 - 64)) | (1 << (CParser.T__82 - 64)) | (1 << (CParser.T__83 - 64= )) | (1 << (CParser.T__84 - 64)) | (1 << (CParser.T__85 - 64)) | (1 << (CPa= rser.T__86 - 64)) | (1 << (CParser.T__87 - 64)) | (1 << (CParser.T__88 - 64= )) | (1 << (CParser.T__89 - 64)) | (1 << (CParser.T__90 - 64)) | (1 << (CPa= rser.T__91 - 64)) | (1 << (CParser.IDENTIFIER - 64)) | (1 << (CParser.CHARA= CTER_LITERAL - 64)) | (1 << (CParser.STRING_LITERAL - 64)) | (1 << (CParser= .HEX_LITERAL - 64)) | (1 << (CParser.DECIMAL_LITERAL - 64)) | (1 << (CParse= r.OCTAL_LITERAL - 64)) | (1 << (CParser.FLOATING_POINT_LITERAL - 64)) | (1 = << (CParser.WS - 64)) | (1 << (CParser.BS - 64)) | (1 << (CParser.UnicodeVo= cabulary - 64)) | (1 << (CParser.COMMENT - 64)) | (1 << (CParser.LINE_COMME= NT - 64)) | (1 << (CParser.LINE_COMMAND - 64)))) !=3D 0):=0D self.state =3D 772=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__19:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__19:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5574,32 +5289,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_asm_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm_statement"):=0D listener.enterAsm_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm_statement"):=0D listener.exitAsm_statement(self)=0D =0D -=0D -=0D -=0D def asm_statement(self):=0D =0D localctx =3D CParser.Asm_statementContext(self, self._ctx, self.st= ate)=0D self.enterRule(localctx, 124, self.RULE_asm_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 780=0D @@ -5612,7 +5323,7 @@ class CParser ( Parser ): while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__0) | (1 << CParser.T__1) | (1 << CParser.T__2) | (1 << CParser.T__3) = | (1 << CParser.T__4) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << C= Parser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T_= _10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) |= (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 <<= CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CPars= er.T__21) | (1 << CParser.T__22) | (1 << CParser.T__23) | (1 << CParser.T__= 24) | (1 << CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | = (1 << CParser.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << = CParser.T__31) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParse= r.T__34) | (1 << CParser.T__35) | (1 << CParser.T__36) | (1 << CParser.T__3= 7) | (1 << CParser.T__38) | (1 << CParser.T__39) | (1 << CParser.T__40) | (= 1 << CParser.T__41) | (1 << CParser.T__42) | (1 << CParser.T__43) | (1 << C= Parser.T__44) | (1 << CParser.T__45) | (1 << CParser.T__46) | (1 << CParser= .T__47) | (1 << CParser.T__48) | (1 << CParser.T__49) | (1 << CParser.T__50= ) | (1 << CParser.T__51) | (1 << CParser.T__52) | (1 << CParser.T__53) | (1= << CParser.T__54) | (1 << CParser.T__55) | (1 << CParser.T__56) | (1 << CP= arser.T__57) | (1 << CParser.T__58) | (1 << CParser.T__59) | (1 << CParser.= T__60) | (1 << CParser.T__61) | (1 << CParser.T__62))) !=3D 0) or ((((_la -= 64)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 64)) & ((1 << (CParser.T__63 - 64= )) | (1 << (CParser.T__64 - 64)) | (1 << (CParser.T__65 - 64)) | (1 << (CPa= rser.T__66 - 64)) | (1 << (CParser.T__67 - 64)) | (1 << (CParser.T__68 - 64= )) | (1 << (CParser.T__69 - 64)) | (1 << (CParser.T__70 - 64)) | (1 << (CPa= rser.T__71 - 64)) | (1 << (CParser.T__72 - 64)) | (1 << (CParser.T__73 - 64= )) | (1 << (CParser.T__74 - 64)) | (1 << (CParser.T__75 - 64)) | (1 << (CPa= rser.T__76 - 64)) | (1 << (CParser.T__77 - 64)) | (1 << (CParser.T__78 - 64= )) | (1 << (CParser.T__79 - 64)) | (1 << (CParser.T__80 - 64)) | (1 << (CPa= rser.T__81 - 64)) | (1 << (CParser.T__82 - 64)) | (1 << (CParser.T__83 - 64= )) | (1 << (CParser.T__84 - 64)) | (1 << (CParser.T__85 - 64)) | (1 << (CPa= rser.T__86 - 64)) | (1 << (CParser.T__87 - 64)) | (1 << (CParser.T__88 - 64= )) | (1 << (CParser.T__89 - 64)) | (1 << (CParser.T__90 - 64)) | (1 << (CPa= rser.T__91 - 64)) | (1 << (CParser.IDENTIFIER - 64)) | (1 << (CParser.CHARA= CTER_LITERAL - 64)) | (1 << (CParser.STRING_LITERAL - 64)) | (1 << (CParser= .HEX_LITERAL - 64)) | (1 << (CParser.DECIMAL_LITERAL - 64)) | (1 << (CParse= r.OCTAL_LITERAL - 64)) | (1 << (CParser.FLOATING_POINT_LITERAL - 64)) | (1 = << (CParser.WS - 64)) | (1 << (CParser.BS - 64)) | (1 << (CParser.UnicodeVo= cabulary - 64)) | (1 << (CParser.COMMENT - 64)) | (1 << (CParser.LINE_COMME= NT - 64)) | (1 << (CParser.LINE_COMMAND - 64)))) !=3D 0):=0D self.state =3D 782=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__19:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__19:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5635,7 +5346,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5643,42 +5354,36 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def statement_list(self):=0D - return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_macro_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMacro_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMacro_statement"):=0D listener.enterMacro_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMacro_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMacro_statement"):=0D listener.exitMacro_statement(self)=0D =0D -=0D -=0D -=0D def macro_statement(self):=0D =0D localctx =3D CParser.Macro_statementContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 126, self.RULE_macro_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 790=0D @@ -5687,23 +5392,22 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 795=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,97,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 97, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 792=0D self.declaration()=0D self.state =3D 797=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,97,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 97, sel= f._ctx)=0D =0D self.state =3D 799=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,98,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 98, self._ct= x)=0D if la_ =3D=3D 1:=0D self.state =3D 798=0D self.statement_list()=0D =0D -=0D self.state =3D 802=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -5711,7 +5415,6 @@ class CParser ( Parser ): self.state =3D 801=0D self.expression()=0D =0D -=0D self.state =3D 804=0D self.match(CParser.T__38)=0D except RecognitionException as re:=0D @@ -5726,7 +5429,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5734,32 +5437,28 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def statement(self):=0D - return self.getTypedRuleContext(CParser.StatementContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, 0)=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_labeled_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLabeled_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLabeled_statement"):=0D listener.enterLabeled_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLabeled_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLabeled_statement"):=0D listener.exitLabeled_statement(self)=0D =0D -=0D -=0D -=0D def labeled_statement(self):=0D =0D - localctx =3D CParser.Labeled_statementContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Labeled_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 128, self.RULE_labeled_statement)=0D try:=0D self.state =3D 817=0D @@ -5809,57 +5508,54 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def statement_list(self):=0D - return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_compound_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterCompound_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterCompound_statement"):=0D listener.enterCompound_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitCompound_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitCompound_statement"):=0D listener.exitCompound_statement(self)=0D =0D -=0D -=0D -=0D def compound_statement(self):=0D =0D - localctx =3D CParser.Compound_statementContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Compound_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 130, self.RULE_compound_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 819=0D self.match(CParser.T__0)=0D self.state =3D 823=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,101,self._ct= x)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 101, self._= ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 820=0D self.declaration()=0D self.state =3D 825=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,101,self= ._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 101, self._ctx)=0D =0D self.state =3D 827=0D self._errHandler.sync(self)=0D @@ -5868,7 +5564,6 @@ class CParser ( Parser ): self.state =3D 826=0D self.statement_list()=0D =0D -=0D self.state =3D 829=0D self.match(CParser.T__19)=0D except RecognitionException as re:=0D @@ -5883,34 +5578,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def statement(self,i=3DNone):=0D + def statement(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.StatementContext)= =0D else:=0D - return self.getTypedRuleContext(CParser.StatementContext,i= )=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, = i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_statement_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStatement_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStatement_list"):=0D listener.enterStatement_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStatement_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStatement_list"):=0D listener.exitStatement_list(self)=0D =0D -=0D -=0D -=0D def statement_list(self):=0D =0D localctx =3D CParser.Statement_listContext(self, self._ctx, self.s= tate)=0D @@ -5920,7 +5611,7 @@ class CParser ( Parser ): self.state =3D 832=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 831=0D self.statement()=0D @@ -5929,7 +5620,8 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 834=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,103,self= ._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 103, self._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -5943,33 +5635,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_expression_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExpression_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExpression_statement"):=0D listener.enterExpression_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExpression_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExpression_statement"):=0D listener.exitExpression_statement(self)=0D =0D -=0D -=0D -=0D def expression_statement(self):=0D =0D - localctx =3D CParser.Expression_statementContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Expression_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 134, self.RULE_expression_statement)=0D try:=0D self.state =3D 840=0D @@ -6002,42 +5691,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # ExpressionContext=0D + self.e =3D None # ExpressionContext=0D =0D # @param i=3DNone Type: int=0D - def statement(self,i=3DNone):=0D + def statement(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.StatementContext)= =0D else:=0D - return self.getTypedRuleContext(CParser.StatementContext,i= )=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, = i)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_selection_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterSelection_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterSelection_statement"):=0D listener.enterSelection_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitSelection_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitSelection_statement"):=0D listener.exitSelection_statement(self)=0D =0D -=0D -=0D -=0D def selection_statement(self):=0D =0D - localctx =3D CParser.Selection_statementContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Selection_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 136, self.RULE_selection_statement)=0D try:=0D self.state =3D 858=0D @@ -6053,19 +5738,19 @@ class CParser ( Parser ): localctx.e =3D self.expression()=0D self.state =3D 845=0D self.match(CParser.T__38)=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D self.state =3D 847=0D self.statement()=0D self.state =3D 850=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,105,self.= _ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 105, sel= f._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 848=0D self.match(CParser.T__84)=0D self.state =3D 849=0D self.statement()=0D =0D -=0D pass=0D elif token in [CParser.T__85]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -6095,38 +5780,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # ExpressionContext=0D + self.e =3D None # ExpressionContext=0D =0D def statement(self):=0D - return self.getTypedRuleContext(CParser.StatementContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_iteration_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterIteration_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterIteration_statement"):=0D listener.enterIteration_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitIteration_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitIteration_statement"):=0D listener.exitIteration_statement(self)=0D =0D -=0D -=0D -=0D def iteration_statement(self):=0D =0D - localctx =3D CParser.Iteration_statementContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Iteration_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 138, self.RULE_iteration_statement)=0D try:=0D self.state =3D 876=0D @@ -6144,7 +5825,8 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D self.state =3D 864=0D self.statement()=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D pass=0D elif token in [CParser.T__87]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -6162,7 +5844,8 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D self.state =3D 873=0D self.match(CParser.T__1)=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D pass=0D else:=0D raise NoViableAltException(self)=0D @@ -6179,7 +5862,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -6187,25 +5870,21 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_jump_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterJump_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterJump_statement"):=0D listener.enterJump_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitJump_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitJump_statement"):=0D listener.exitJump_statement(self)=0D =0D -=0D -=0D -=0D def jump_statement(self):=0D =0D localctx =3D CParser.Jump_statementContext(self, self._ctx, self.s= tate)=0D @@ -6213,7 +5892,7 @@ class CParser ( Parser ): try:=0D self.state =3D 891=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,108,self._ctx= )=0D + la_ =3D self._interp.adaptivePredict(self._input, 108, self._c= tx)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 878=0D @@ -6258,7 +5937,6 @@ class CParser ( Parser ): self.match(CParser.T__1)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -6266,8 +5944,3 @@ class CParser ( Parser ): finally:=0D self.exitRule()=0D return localctx=0D -=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index 33060db5f27a..362d4247560f 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define checkpoints used by ECC tool=0D #=0D # Copyright (c) 2021, Arm Limited. All rights reserved.
        =0D @@ -17,12 +17,14 @@ from Ecc import c from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## Check=0D +# Check=0D #=0D # This class is to define checkpoints used by ECC tool=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class Check(object):=0D def __init__(self):=0D pass=0D @@ -42,7 +44,6 @@ class Check(object): def SmmCommParaCheck(self):=0D self.SmmCommParaCheckBufferType()=0D =0D -=0D # Check if SMM communication function has correct parameter type=0D # 1. Get function calling with instance./->Communicate() interface=0D # and make sure the protocol instance is of type EFI_SMM_COMMUNICATION= _PROTOCOL.=0D @@ -59,6 +60,7 @@ class Check(object): # report warning to indicate human code review.=0D # e. it is a buffer from other kind of pointers (may need to trace = into nested function calls to locate),=0D # repeat checks in a.b.c and d.=0D +=0D def SmmCommParaCheckBufferType(self):=0D if EccGlobalData.gConfig.SmmCommParaCheckBufferType =3D=3D '1' or = EccGlobalData.gConfig.SmmCommParaCheckAll =3D=3D '1':=0D EdkLogger.quiet("Checking SMM communication parameter type ...= ")=0D @@ -88,7 +90,8 @@ class Check(object): if SecondPara.startswith('&'):=0D SecondPara =3D SecondPara[1:]=0D if SecondPara.endswith(']'):=0D - SecondParaIndex =3D SecondPara[SecondPara.= find('[') + 1:-1]=0D + SecondParaIndex =3D SecondPara[SecondPara.= find(=0D + '[') + 1:-1]=0D SecondPara =3D SecondPara[:SecondPara.find= ('[')]=0D # Get the ID=0D Id =3D Record[0]=0D @@ -96,7 +99,8 @@ class Check(object): BelongsToFile =3D Record[3]=0D # Get the source file path=0D SqlCommand =3D """select FullPath from File wh= ere ID =3D %s""" % BelongsToFile=0D - NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(SqlCommand)=0D + NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(=0D + SqlCommand)=0D FullPath =3D NewRecordSet[0][0]=0D # Get the line no of function calling=0D StartLine =3D Record[4]=0D @@ -104,7 +108,8 @@ class Check(object): SqlCommand =3D """select Value3 from INF where= BelongsToFile =3D (select ID from File=0D where Path =3D (select Path fr= om File where ID =3D %s) and Model =3D 1011)=0D and Value2 =3D 'MODULE_TYPE'""= " % BelongsToFile=0D - NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(SqlCommand)=0D + NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(=0D + SqlCommand)=0D ModuleType =3D NewRecordSet[0][0] if NewRecord= Set else None=0D =0D # print BelongsToFile, FullPath, StartLine, Mo= duleType, SecondPara=0D @@ -113,14 +118,14 @@ class Check(object): # Find the value of the parameter=0D if Value:=0D if 'AllocatePage' in Value \=0D - or 'AllocatePool' in Value \=0D - or 'AllocateRuntimePool' in Value \=0D - or 'AllocateZeroPool' in Value:=0D + or 'AllocatePool' in Value \=0D + or 'AllocateRuntimePool' in Value = \=0D + or 'AllocateZeroPool' in Value:=0D pass=0D else:=0D if '->' in Value:=0D if not EccGlobalData.gException.Is= Exception(=0D - ERROR_SMM_COMM_PARA_CHECK_B= UFFER_TYPE, Value):=0D + ERROR_SMM_COMM_PARA_CHECK_= BUFFER_TYPE, Value):=0D EccGlobalData.gDb.TblReport.In= sert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,=0D = OtherMsg=3D"Please review the buffer type"=0D = + "is correct or not. If it is correct" +=0D @@ -130,7 +135,7 @@ class Check(object): = BelongsToItem=3DId)=0D else:=0D if not EccGlobalData.gException.Is= Exception(=0D - ERROR_SMM_COMM_PARA_CHECK_B= UFFER_TYPE, Value):=0D + ERROR_SMM_COMM_PARA_CHECK_= BUFFER_TYPE, Value):=0D EccGlobalData.gDb.TblReport.In= sert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,=0D = OtherMsg=3D"Please review the buffer type"=0D = + "is correct or not. If it is correct" +=0D @@ -139,23 +144,23 @@ class Check(object): = BelongsToTable=3DIdentifierTable,=0D = BelongsToItem=3DId)=0D =0D -=0D # Not find the value of the parameter=0D else:=0D SqlCommand =3D """select ID, Modifier, Nam= e, Value, Model, BelongsToFunction from %s=0D where Name =3D '%s' and St= artLine < %s order by StartLine DESC""" \=0D % (IdentifierTable, Second= Para, StartLine)=0D - NewRecordSet =3D EccGlobalData.gDb.TblFile= .Exec(SqlCommand)=0D + NewRecordSet =3D EccGlobalData.gDb.TblFile= .Exec(=0D + SqlCommand)=0D if NewRecordSet:=0D Value =3D NewRecordSet[0][1]=0D if 'AllocatePage' in Value \=0D - or 'AllocatePool' in Value \=0D - or 'AllocateRuntimePool' in Value = \=0D - or 'AllocateZeroPool' in Value:=0D + or 'AllocatePool' in Value \=0D + or 'AllocateRuntimePool' in Va= lue \=0D + or 'AllocateZeroPool' in Value= :=0D pass=0D else:=0D if not EccGlobalData.gException.Is= Exception(=0D - ERROR_SMM_COMM_PARA_CHECK_BUFF= ER_TYPE, Value):=0D + ERROR_SMM_COMM_PARA_CHECK_= BUFFER_TYPE, Value):=0D EccGlobalData.gDb.TblReport.In= sert(ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE,=0D = OtherMsg=3D"Please review the buffer type"=0D = + "is correct or not. If it is correct" +=0D @@ -177,7 +182,8 @@ class Check(object): FileIn =3D open(File, 'rb').read(2)=0D if FileIn !=3D '\xff\xfe':=0D OtherMsg =3D "File %s is not a valid UTF-16 UNI file" = % Record[1]=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_GENERAL_CHECK= _UNI, OtherMsg=3DOtherMsg, BelongsToTable=3D'File', BelongsToItem=3DRecord[= 0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_GENERAL_CHECK_UNI, OtherMsg=3DOtherMsg, Belo= ngsToTable=3D'File', BelongsToItem=3DRecord[0])=0D =0D # General Checking=0D def GeneralCheck(self):=0D @@ -203,8 +209,10 @@ class Check(object): for Char in Line:=0D IndexOfChar +=3D 1=0D if Char =3D=3D '\t':=0D - OtherMsg =3D "File %s has TAB char at line= %s column %s" % (Record[1], IndexOfLine, IndexOfChar)=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_G= ENERAL_CHECK_NO_TAB, OtherMsg=3DOtherMsg, BelongsToTable=3D'File', BelongsT= oItem=3DRecord[0])=0D + OtherMsg =3D "File %s has TAB char at line= %s column %s" % (=0D + Record[1], IndexOfLine, IndexOfChar)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_GENERAL_CHECK_NO_TAB, OtherMsg= =3DOtherMsg, BelongsToTable=3D'File', BelongsToItem=3DRecord[0])=0D =0D # Check Only use CRLF (Carriage Return Line Feed) line endings.=0D def GeneralCheckLineEnding(self):=0D @@ -219,8 +227,10 @@ class Check(object): for Line in op:=0D IndexOfLine +=3D 1=0D if not bytes.decode(Line).endswith('\r\n'):=0D - OtherMsg =3D "File %s has invalid line ending = at line %s" % (Record[1], IndexOfLine)=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_GENER= AL_CHECK_INVALID_LINE_ENDING, OtherMsg=3DOtherMsg, BelongsToTable=3D'File',= BelongsToItem=3DRecord[0])=0D + OtherMsg =3D "File %s has invalid line ending = at line %s" % (=0D + Record[1], IndexOfLine)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_GENERAL_CHECK_INVALID_LINE_ENDING, O= therMsg=3DOtherMsg, BelongsToTable=3D'File', BelongsToItem=3DRecord[0])=0D =0D # Check if there is no trailing white space in one line.=0D def GeneralCheckTrailingWhiteSpaceLine(self):=0D @@ -235,8 +245,10 @@ class Check(object): for Line in op:=0D IndexOfLine +=3D 1=0D if Line.replace('\r', '').replace('\n', '').endswi= th(' '):=0D - OtherMsg =3D "File %s has trailing white space= s at line %s" % (Record[1], IndexOfLine)=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_GENER= AL_CHECK_TRAILING_WHITE_SPACE_LINE, OtherMsg=3DOtherMsg, BelongsToTable=3D'= File', BelongsToItem=3DRecord[0])=0D + OtherMsg =3D "File %s has trailing white space= s at line %s" % (=0D + Record[1], IndexOfLine)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_GENERAL_CHECK_TRAILING_WHITE_SPACE_L= INE, OtherMsg=3DOtherMsg, BelongsToTable=3D'File', BelongsToItem=3DRecord[0= ])=0D =0D # Check whether file has non ACSII char=0D def GeneralCheckNonAcsii(self):=0D @@ -254,8 +266,10 @@ class Check(object): for Char in Line:=0D IndexOfChar +=3D 1=0D if ord(Char) > 126:=0D - OtherMsg =3D "File %s has Non-ASCII char a= t line %s column %s" % (Record[1], IndexOfLine, IndexOfChar)=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_G= ENERAL_CHECK_NON_ACSII, OtherMsg=3DOtherMsg, BelongsToTable=3D'File', Belon= gsToItem=3DRecord[0])=0D + OtherMsg =3D "File %s has Non-ASCII char a= t line %s column %s" % (=0D + Record[1], IndexOfLine, IndexOfChar)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_GENERAL_CHECK_NON_ACSII, OtherMs= g=3DOtherMsg, BelongsToTable=3D'File', BelongsToItem=3DRecord[0])=0D =0D # C Function Layout Checking=0D def FunctionLayoutCheck(self):=0D @@ -270,7 +284,8 @@ class Check(object): # To check if the deprecated functions are used=0D def FunctionLayoutCheckDeprecated(self):=0D if EccGlobalData.gConfig.CFunctionLayoutCheckNoDeprecated =3D=3D '= 1' or EccGlobalData.gConfig.CFunctionLayoutCheckAll =3D=3D '1' or EccGlobal= Data.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking function no deprecated one being use= d ...")=0D + EdkLogger.quiet(=0D + "Checking function no deprecated one being used ...")=0D =0D DeprecatedFunctionSet =3D ('UnicodeValueToString',=0D 'AsciiValueToString',=0D @@ -441,8 +456,8 @@ class Check(object): self.DeclCheckSameStructure()=0D self.DeclCheckUnionType()=0D =0D -=0D # Check whether no use of int, unsigned, char, void, long in any .c, .= h or .asl files.=0D +=0D def DeclCheckNoUseCType(self):=0D if EccGlobalData.gConfig.DeclarationDataTypeCheckNoUseCType =3D=3D= '1' or EccGlobalData.gConfig.DeclarationDataTypeCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1':=0D EdkLogger.quiet("Checking Declaration No use C type ...")=0D @@ -509,7 +524,8 @@ class Check(object): EdkLogger.quiet("Checking same struct ...")=0D AllStructure =3D {}=0D for IdentifierTable in EccGlobalData.gIdentifierTableList:=0D - SqlCommand =3D """select ID, Name, BelongsToFile from %s w= here Model =3D %s""" % (IdentifierTable, MODEL_IDENTIFIER_STRUCTURE)=0D + SqlCommand =3D """select ID, Name, BelongsToFile from %s w= here Model =3D %s""" % (=0D + IdentifierTable, MODEL_IDENTIFIER_STRUCTURE)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D if Record[1] !=3D '':=0D @@ -518,12 +534,15 @@ class Check(object): else:=0D ID =3D AllStructure[Record[1]]=0D SqlCommand =3D """select FullPath from File wh= ere ID =3D %s """ % ID=0D - NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(SqlCommand)=0D + NewRecordSet =3D EccGlobalData.gDb.TblFile.Exe= c(=0D + SqlCommand)=0D OtherMsg =3D "The structure name '%s' is dupli= cate" % Record[1]=0D if NewRecordSet !=3D []:=0D - OtherMsg =3D "The structure name [%s] is d= uplicate with the one defined in %s, maybe struct NOT typedefed or the type= def new type NOT used to qualify variables" % (Record[1], NewRecordSet[0][0= ])=0D + OtherMsg =3D "The structure name [%s] is d= uplicate with the one defined in %s, maybe struct NOT typedefed or the type= def new type NOT used to qualify variables" % (=0D + Record[1], NewRecordSet[0][0])=0D if not EccGlobalData.gException.IsException(ER= ROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_D= ECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE, OtherMsg=3DOtherMsg, BelongsToTa= ble=3DIdentifierTable, BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_SAME= _STRUCTURE, OtherMsg=3DOtherMsg, BelongsToTable=3DIdentifierTable, BelongsT= oItem=3DRecord[0])=0D =0D # Check whether Union Type has a 'typedef' and the name is capital=0D def DeclCheckUnionType(self):=0D @@ -564,7 +583,8 @@ class Check(object): # Check whether Non-Boolean comparisons use a compare operator (=3D=3D= , !=3D, >, < >=3D, <=3D).=0D def PredicateExpressionCheckNonBooleanOperator(self):=0D if EccGlobalData.gConfig.PredicateExpressionCheckNonBooleanOperato= r =3D=3D '1' or EccGlobalData.gConfig.PredicateExpressionCheckAll =3D=3D '1= ' or EccGlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking predicate expression Non-Boolean var= iable...")=0D + EdkLogger.quiet(=0D + "Checking predicate expression Non-Boolean variable...")=0D =0D # for Dirpath, Dirnames, Filenames in self.WalkTree():=0D # for F in Filenames:=0D @@ -621,7 +641,8 @@ class Check(object): for Item in RecordDict[Key]:=0D Path =3D mws.relpath(Item[1], EccGlobalData.gWorks= pace)=0D if not EccGlobalData.gException.IsException(ERROR_= INCLUDE_FILE_CHECK_NAME, Path):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_INCLU= DE_FILE_CHECK_NAME, OtherMsg=3D"The file name for [%s] is duplicate" % Path= , BelongsToTable=3D'File', BelongsToItem=3DItem[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_INCLUDE_FILE_CHECK_NAME, OtherMsg=3D= "The file name for [%s] is duplicate" % Path, BelongsToTable=3D'File', Belo= ngsToItem=3DItem[0])=0D =0D # Check whether all include file contents is guarded by a #ifndef stat= ement.=0D def IncludeFileCheckIfndef(self):=0D @@ -682,15 +703,15 @@ class Check(object): FullName =3D os.path.join(Dirpath, F)=0D op =3D open(FullName).readlines()=0D FileLinesList =3D op=0D - LineNo =3D 0=0D - CurrentSection =3D MODEL_UNKNOWN=0D - HeaderSectionLines =3D []=0D + LineNo =3D 0=0D + CurrentSection =3D MODEL_UNKNOWN=0D + HeaderSectionLines =3D []=0D HeaderCommentStart =3D False=0D - HeaderCommentEnd =3D False=0D + HeaderCommentEnd =3D False=0D =0D for Line in FileLinesList:=0D - LineNo =3D LineNo + 1=0D - Line =3D Line.strip()=0D + LineNo =3D LineNo + 1=0D + Line =3D Line.strip()=0D if (LineNo < len(FileLinesList) - 1):=0D NextLine =3D FileLinesList[LineNo].strip()= =0D =0D @@ -705,13 +726,15 @@ class Check(object): #=0D if Line.startswith('#') and \=0D (Line.find('@file') > -1) and \=0D - not HeaderCommentStart:=0D + not HeaderCommentStart:=0D if CurrentSection !=3D MODEL_UNKNOWN:=0D SqlStatement =3D """ select ID from Fi= le where FullPath like '%s'""" % FullName=0D - ResultSet =3D EccGlobalData.gDb.TblFil= e.Exec(SqlStatement)=0D + ResultSet =3D EccGlobalData.gDb.TblFil= e.Exec(=0D + SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'INF/DEC/DSC/FDF file head= er comment should begin with ""## @file"" or ""# @file""at the very top fil= e'=0D - EccGlobalData.gDb.TblReport.Insert= (ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert= (=0D + ERROR_DOXYGEN_CHECK_FILE_HEADE= R, Msg, "File", Result[0])=0D =0D else:=0D CurrentSection =3D MODEL_IDENTIFIER_FI= LE_HEADER=0D @@ -726,38 +749,42 @@ class Check(object): # Collect Header content.=0D #=0D if (Line.startswith('#') and CurrentSection = =3D=3D MODEL_IDENTIFIER_FILE_HEADER) and\=0D - HeaderCommentStart and not Line.startswith= ('##') and not\=0D - HeaderCommentEnd and NextLine !=3D '':=0D + HeaderCommentStart and not Line.starts= with('##') and not\=0D + HeaderCommentEnd and NextLine !=3D '':= =0D HeaderSectionLines.append((Line, LineNo))= =0D continue=0D #=0D # Header content end=0D #=0D if (Line.startswith('##') or not Line.strip().= startswith("#")) and HeaderCommentStart \=0D - and not HeaderCommentEnd:=0D + and not HeaderCommentEnd:=0D if Line.startswith('##'):=0D HeaderCommentEnd =3D True=0D HeaderSectionLines.append((Line, LineNo))= =0D - ParseHeaderCommentSection(HeaderSectionLin= es, FullName)=0D + ParseHeaderCommentSection(=0D + HeaderSectionLines, FullName)=0D break=0D if HeaderCommentStart =3D=3D False:=0D SqlStatement =3D """ select ID from File where= FullPath like '%s'""" % FullName=0D - ResultSet =3D EccGlobalData.gDb.TblFile.Exec(S= qlStatement)=0D + ResultSet =3D EccGlobalData.gDb.TblFile.Exec(= =0D + SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'INF/DEC/DSC/FDF file header comme= nt should begin with ""## @file"" or ""# @file"" at the very top file'=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_D= OXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, = "File", Result[0])=0D if HeaderCommentEnd =3D=3D False:=0D SqlStatement =3D """ select ID from File where= FullPath like '%s'""" % FullName=0D - ResultSet =3D EccGlobalData.gDb.TblFile.Exec(S= qlStatement)=0D + ResultSet =3D EccGlobalData.gDb.TblFile.Exec(= =0D + SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'INF/DEC/DSC/FDF file header comme= nt should end with ""##"" at the end of file header comment block'=0D # Check whether File header Comment End wi= th '##'=0D if EccGlobalData.gConfig.HeaderCheckFileCo= mmentEnd =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or E= ccGlobalData.gConfig.CheckAll =3D=3D '1':=0D - EccGlobalData.gDb.TblReport.Insert(ERR= OR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D -=0D -=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, M= sg, "File", Result[0])=0D =0D # Check whether the function headers are followed Doxygen special docu= mentation blocks in section 2.3.5=0D +=0D def DoxygenCheckFunctionHeader(self):=0D if EccGlobalData.gConfig.DoxygenCheckFunctionHeader =3D=3D '1' or = EccGlobalData.gConfig.DoxygenCheckAll =3D=3D '1' or EccGlobalData.gConfig.C= heckAll =3D=3D '1':=0D EdkLogger.quiet("Checking Doxygen function header ...")=0D @@ -770,9 +797,9 @@ class Check(object): for FullName in EccGlobalData.gCFileList + EccGlobalData.gHFil= eList:=0D MsgList =3D c.CheckFuncHeaderDoxygenComments(FullName)=0D =0D -=0D # Check whether the first line of text in a comment block is a brief d= escription of the element being documented.=0D # The brief description must end with a period.=0D +=0D def DoxygenCheckCommentDescription(self):=0D if EccGlobalData.gConfig.DoxygenCheckCommentDescription =3D=3D '1'= or EccGlobalData.gConfig.DoxygenCheckAll =3D=3D '1' or EccGlobalData.gConf= ig.CheckAll =3D=3D '1':=0D pass=0D @@ -853,7 +880,8 @@ class Check(object): List =3D Record[1].split('|', 1)=0D SupModType =3D []=0D if len(List) =3D=3D 1:=0D - SupModType =3D DT.SUP_MODULE_LIST_STRING.split(DT.TAB_= VALUE_SPLIT)=0D + SupModType =3D DT.SUP_MODULE_LIST_STRING.split(=0D + DT.TAB_VALUE_SPLIT)=0D elif len(List) =3D=3D 2:=0D SupModType =3D List[1].split()=0D =0D @@ -865,7 +893,8 @@ class Check(object): LibraryClasses[List[0]].append(Item)=0D =0D if Record[2] !=3D DT.SUP_MODULE_BASE and Record[2] not in = SupModType:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_LIBRARY_INSTANCE_2, OtherMsg=3D"The Library Class '%s' does not spe= cify its supported module types" % (List[0]), BelongsToTable=3D'Inf', Belon= gsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_LIBRARY_INSTANCE_2, OtherMsg=3D"The Library Class '%s' does not spe= cify its supported module types" % (=0D + List[0]), BelongsToTable=3D'Inf', BelongsToItem=3D= Record[0])=0D =0D SqlCommand =3D """select A.ID, A.Value1, B.Value3 from Inf as = A left join Inf as B=0D where A.Model =3D %s and B.Value2 =3D '%s' and= B.Model =3D %s=0D @@ -885,22 +914,26 @@ class Check(object): if Record[1] in LibraryClasses:=0D if Record[2] not in LibraryClasses[Record[1]] and DT.S= UP_MODULE_BASE not in RecordDict[Record[1]]:=0D if not EccGlobalData.gException.IsException(ERROR_= META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg=3D"The type of Library Class [= %s] defined in Inf file does not match the type of the module" % (Record[1]= ), BelongsToTable=3D'Inf', BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg=3D"The type of Library Class [= %s] defined in Inf file does not match the type of the module" % (=0D + Record[1]), BelongsToTable=3D'Inf', Belong= sToItem=3DRecord[0])=0D else:=0D if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_LIBRARY_INSTANCE_1, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg=3D"The type of Library Class [%s] = defined in Inf file does not match the type of the module" % (Record[1]), B= elongsToTable=3D'Inf', BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_LIBRARY_INSTANCE_1, OtherMsg=3D"The type of Library Class [%s] = defined in Inf file does not match the type of the module" % (=0D + Record[1]), BelongsToTable=3D'Inf', BelongsToI= tem=3DRecord[0])=0D =0D # Check whether a Library Instance has been defined for all dependent = library classes=0D def MetaDataFileCheckLibraryInstanceDependent(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckLibraryInstanceDependent= =3D=3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for library instance dependent issue= ...")=0D + EdkLogger.quiet(=0D + "Checking for library instance dependent issue ...")=0D SqlCommand =3D """select ID, Value1, Value2 from Dsc where Mod= el =3D %s""" % MODEL_EFI_LIBRARY_CLASS=0D LibraryClasses =3D EccGlobalData.gDb.TblDsc.Exec(SqlCommand)=0D for LibraryClass in LibraryClasses:=0D if LibraryClass[1].upper() =3D=3D 'NULL' or LibraryClass[1= ].startswith('!ifdef') or LibraryClass[1].startswith('!ifndef') or LibraryC= lass[1].endswith('!endif'):=0D continue=0D else:=0D - LibraryIns =3D os.path.normpath(mws.join(EccGlobalData= .gWorkspace, LibraryClass[2]))=0D + LibraryIns =3D os.path.normpath(=0D + mws.join(EccGlobalData.gWorkspace, LibraryClass[2]= ))=0D SkipDirString =3D '|'.join(EccGlobalData.gConfig.SkipD= irList)=0D p =3D re.compile(r'.*[\\/](?:%s^\S)[\\/]?.*' % SkipDir= String)=0D if p.match(os.path.split(LibraryIns)[0].upper()):=0D @@ -916,7 +949,8 @@ class Check(object): IsFound =3D True=0D if not IsFound:=0D if not EccGlobalData.gException.IsException(ERROR_= META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT, LibraryClass[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT, OtherMsg=3D"The Library Class [= %s] is not specified in '%s'" % (LibraryClass[1], LibraryClass[2]), Belongs= ToTable=3D'Dsc', BelongsToItem=3DLibraryClass[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT, OtherMsg=3D"The Library Class [= %s] is not specified in '%s'" % (=0D + LibraryClass[1], LibraryClass[2]), Belongs= ToTable=3D'Dsc', BelongsToItem=3DLibraryClass[0])=0D =0D # Check whether the Library Instances specified by the LibraryClasses = sections are listed in order of dependencies=0D def MetaDataFileCheckLibraryInstanceOrder(self):=0D @@ -929,11 +963,13 @@ class Check(object): def MetaDataFileCheckLibraryNoUse(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckLibraryNoUse =3D=3D '1' = or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.g= Config.CheckAll =3D=3D '1':=0D EdkLogger.quiet("Checking for library instance not used ...")= =0D - SqlCommand =3D """select ID, Value1 from Inf as A where A.Mode= l =3D %s and A.Value1 not in (select B.Value1 from Dsc as B where Model =3D= %s)""" % (MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)=0D + SqlCommand =3D """select ID, Value1 from Inf as A where A.Mode= l =3D %s and A.Value1 not in (select B.Value1 from Dsc as B where Model =3D= %s)""" % (=0D + MODEL_EFI_LIBRARY_CLASS, MODEL_EFI_LIBRARY_CLASS)=0D RecordSet =3D EccGlobalData.gDb.TblInf.Exec(SqlCommand)=0D for Record in RecordSet:=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_LIBRARY_NO_USE, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_LIBRARY_NO_USE, OtherMsg=3D"The Library Class [%s] is not used in a= ny platform" % (Record[1]), BelongsToTable=3D'Inf', BelongsToItem=3DRecord[= 0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_LIBRARY_NO_USE, OtherMsg=3D"The Library Class [%s] is not used in a= ny platform" % (=0D + Record[1]), BelongsToTable=3D'Inf', BelongsToItem= =3DRecord[0])=0D SqlCommand =3D """=0D select A.ID, A.Value1, A.BelongsToFile, A.StartLi= ne, B.StartLine from Dsc as A left join Dsc as B=0D where A.Model =3D %s and B.Model =3D %s and A.Sco= pe1 =3D B.Scope1 and A.Scope2 =3D B.Scope2 and A.ID !=3D B.ID=0D @@ -942,16 +978,19 @@ class Check(object): RecordSet =3D EccGlobalData.gDb.TblDsc.Exec(SqlCommand)=0D for Record in RecordSet:=0D if Record[3] and Record[4] and Record[3] !=3D Record[4] an= d Record[1] !=3D 'NULL':=0D - SqlCommand =3D """select FullPath from File where ID = =3D %s""" % (Record[2])=0D + SqlCommand =3D """select FullPath from File where ID = =3D %s""" % (=0D + Record[2])=0D FilePathList =3D EccGlobalData.gDb.TblFile.Exec(SqlCom= mand)=0D for FilePath in FilePathList:=0D if not EccGlobalData.gException.IsException(ERROR_= META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, Record[1]):=0D - 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])=0D + 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." % (=0D + Record[1], FilePath, Record[3], Record[4])= , BelongsToTable=3D'Dsc', BelongsToItem=3DRecord[0])=0D =0D # Check the header file in Include\Library directory whether be define= d in the package DEC file.=0D def MetaDataFileCheckLibraryDefinedInDec(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckLibraryDefinedInDec =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for library instance whether be defi= ned in the package dec file ...")=0D + EdkLogger.quiet(=0D + "Checking for library instance whether be defined in the p= ackage dec file ...")=0D SqlCommand =3D """=0D select A.Value1, A.StartLine, A.ID, B.Value1 from Inf = as A left join Dec as B=0D on A.Model =3D B.Model and A.Value1 =3D B.Value1 where= A.Model=3D%s=0D @@ -961,14 +1000,16 @@ class Check(object): LibraryInInf, Line, ID, LibraryDec =3D Record=0D if not LibraryDec:=0D if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_LIBRARY_NOT_DEFINED, LibraryInInf):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_LIBRARY_NOT_DEFINED, \=0D - OtherMsg=3D"The Library Class = [%s] in %s line is not defined in the associated package file." % (LibraryI= nInf, Line),=0D - BelongsToTable=3D'Inf', Belong= sToItem=3DID)=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_LIBRARY_NOT_DEFINED,=0D + OtherMsg=3D"The= Library Class [%s] in %s line is not defined in the associated package fil= e." % (=0D + LibraryInIn= f, Line),=0D + BelongsToTable= =3D'Inf', BelongsToItem=3DID)=0D =0D # 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=0D def MetaDataFileCheckBinaryInfInFdf(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckBinaryInfInFdf =3D=3D '1= ' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData= .gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for non-binary modules defined in FD= F files ...")=0D + EdkLogger.quiet(=0D + "Checking for non-binary modules defined in FDF files ..."= )=0D SqlCommand =3D """select A.ID, A.Value1 from Fdf as A=0D where A.Model =3D %s=0D and A.Enabled > -1=0D @@ -980,18 +1021,21 @@ class Check(object): for Record in RecordSet:=0D FdfID =3D Record[0]=0D FilePath =3D Record[1]=0D - FilePath =3D os.path.normpath(mws.join(EccGlobalData.gWork= space, FilePath))=0D + FilePath =3D os.path.normpath(=0D + mws.join(EccGlobalData.gWorkspace, FilePath))=0D SqlCommand =3D """select ID from Inf where Model =3D %s an= d BelongsToFile =3D (select ID from File where FullPath like '%s')=0D """ % (MODEL_EFI_SOURCE_FILE, FilePath)=0D NewRecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand= )=0D if NewRecordSet !=3D []:=0D if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_BINARY_INF_IN_FDF, FilePath):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_BINARY_INF_IN_FDF, OtherMsg=3D"File [%s] defined in FDF file an= d not in DSC file must be a binary module" % (FilePath), BelongsToTable=3D'= Fdf', BelongsToItem=3DFdfID)=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_BINARY_INF_IN_FDF, OtherMsg=3D"File [%s] defined in FDF file an= d not in DSC file must be a binary module" % (=0D + FilePath), BelongsToTable=3D'Fdf', BelongsToIt= em=3DFdfID)=0D =0D # Check whether a PCD is set in a Dsc file or the FDF file, but not in= both.=0D def MetaDataFileCheckPcdDuplicate(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckPcdDuplicate =3D=3D '1' = or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.g= Config.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for duplicate PCDs defined in both D= SC and FDF files ...")=0D + EdkLogger.quiet(=0D + "Checking for duplicate PCDs defined in both DSC and FDF f= iles ...")=0D SqlCommand =3D """=0D select A.ID, A.Value1, A.Value2, A.BelongsToFile,= B.ID, B.Value1, B.Value2, B.BelongsToFile from Dsc as A, Fdf as B=0D where A.Model >=3D %s and A.Model < %s=0D @@ -1006,16 +1050,21 @@ class Check(object): for Record in RecordSet:=0D SqlCommand1 =3D """select Name from File where ID =3D %s""= " % Record[3]=0D SqlCommand2 =3D """select Name from File where ID =3D %s""= " % Record[7]=0D - DscFileName =3D os.path.splitext(EccGlobalData.gDb.TblDsc.= Exec(SqlCommand1)[0][0])[0]=0D - FdfFileName =3D os.path.splitext(EccGlobalData.gDb.TblDsc.= Exec(SqlCommand2)[0][0])[0]=0D + DscFileName =3D os.path.splitext(=0D + EccGlobalData.gDb.TblDsc.Exec(SqlCommand1)[0][0])[0]=0D + FdfFileName =3D os.path.splitext(=0D + EccGlobalData.gDb.TblDsc.Exec(SqlCommand2)[0][0])[0]=0D if DscFileName !=3D FdfFileName:=0D continue=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_PCD_DUPLICATE, Record[1] + '.' + Record[2]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_DUPLICATE, OtherMsg=3D"The PCD [%s] is defined in both FDF file= and DSC file" % (Record[1] + '.' + Record[2]), BelongsToTable=3D'Dsc', Bel= ongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_DUPLICATE, OtherMsg=3D"The PCD [%s] is defined in both FDF file= and DSC file" % (=0D + Record[1] + '.' + Record[2]), BelongsToTable=3D'Ds= c', BelongsToItem=3DRecord[0])=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_PCD_DUPLICATE, Record[5] + '.' + Record[6]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_DUPLICATE, OtherMsg=3D"The PCD [%s] is defined in both FDF file= and DSC file" % (Record[5] + '.' + Record[6]), BelongsToTable=3D'Fdf', Bel= ongsToItem=3DRecord[4])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_DUPLICATE, OtherMsg=3D"The PCD [%s] is defined in both FDF file= and DSC file" % (=0D + Record[5] + '.' + Record[6]), BelongsToTable=3D'Fd= f', BelongsToItem=3DRecord[4])=0D =0D - EdkLogger.quiet("Checking for duplicate PCDs defined in DEC fi= les ...")=0D + EdkLogger.quiet(=0D + "Checking for duplicate PCDs defined in DEC files ...")=0D SqlCommand =3D """=0D select A.ID, A.Value1, A.Value2, A.Model, B.Model= from Dec as A left join Dec as B=0D where A.Model >=3D %s and A.Model < %s=0D @@ -1034,12 +1083,14 @@ class Check(object): for Record in RecordSet:=0D RecordCat =3D Record[1] + '.' + Record[2]=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_PCD_DUPLICATE, RecordCat):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_DUPLICATE, OtherMsg=3D"The PCD [%s] is defined duplicated in DE= C file" % RecordCat, BelongsToTable=3D'Dec', BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE, OtherMsg= =3D"The PCD [%s] is defined duplicated in DEC file" % RecordCat, BelongsToT= able=3D'Dec', BelongsToItem=3DRecord[0])=0D =0D # Check whether PCD settings in the FDF file can only be related to fl= ash.=0D def MetaDataFileCheckPcdFlash(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckPcdFlash =3D=3D '1' or E= ccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.gConf= ig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking only Flash related PCDs are used in = FDF ...")=0D + EdkLogger.quiet(=0D + "Checking only Flash related PCDs are used in FDF ...")=0D SqlCommand =3D """=0D select ID, Value1, Value2, BelongsToFile from Fdf= as A=0D where A.Model >=3D %s and Model < %s=0D @@ -1049,7 +1100,8 @@ class Check(object): RecordSet =3D EccGlobalData.gDb.TblFdf.Exec(SqlCommand)=0D for Record in RecordSet:=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_PCD_FLASH, Record[1] + '.' + Record[2]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_FLASH, OtherMsg=3D"The PCD [%s] defined in FDF file is not rela= ted to Flash" % (Record[1] + '.' + Record[2]), BelongsToTable=3D'Fdf', Belo= ngsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_FLASH, OtherMsg=3D"The PCD [%s] defined in FDF file is not rela= ted to Flash" % (=0D + Record[1] + '.' + Record[2]), BelongsToTable=3D'Fd= f', BelongsToItem=3DRecord[0])=0D =0D # Check whether PCDs used in Inf files but not specified in Dsc or FDF= files=0D def MetaDataFileCheckPcdNoUse(self):=0D @@ -1071,24 +1123,34 @@ class Check(object): RecordSet =3D EccGlobalData.gDb.TblInf.Exec(SqlCommand)=0D for Record in RecordSet:=0D if not EccGlobalData.gException.IsException(ERROR_META_DAT= A_FILE_CHECK_PCD_NO_USE, Record[1] + '.' + Record[2]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_NO_USE, OtherMsg=3D"The PCD [%s] defined in INF file is not spe= cified in either DSC or FDF files" % (Record[1] + '.' + Record[2]), Belongs= ToTable=3D'Inf', BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_PCD_NO_USE, OtherMsg=3D"The PCD [%s] defined in INF file is not spe= cified in either DSC or FDF files" % (=0D + Record[1] + '.' + Record[2]), BelongsToTable=3D'In= f', BelongsToItem=3DRecord[0])=0D =0D # Check whether having duplicate guids defined for Guid/Protocol/Ppi=0D def MetaDataFileCheckGuidDuplicate(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckGuidDuplicate =3D=3D '1'= or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.= gConfig.CheckAll =3D=3D '1':=0D EdkLogger.quiet("Checking for duplicate GUID/PPI/PROTOCOL ..."= )=0D # Check Guid=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _GUID, MODEL_EFI_GUID, EccGlobalData.gDb.TblDec)=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _GUID, MODEL_EFI_GUID, EccGlobalData.gDb.TblDsc)=0D - self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPL= ICATE_GUID, MODEL_EFI_GUID)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID,= EccGlobalData.gDb.TblDec)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID,= EccGlobalData.gDb.TblDsc)=0D + self.CheckGuidProtocolPpiValue(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID, MODEL_EFI_GUID)= =0D # Check protocol=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _PROTOCOL, MODEL_EFI_PROTOCOL, EccGlobalData.gDb.TblDec)=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _PROTOCOL, MODEL_EFI_PROTOCOL, EccGlobalData.gDb.TblDsc)=0D - self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPL= ICATE_PROTOCOL, MODEL_EFI_PROTOCOL)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_P= ROTOCOL, EccGlobalData.gDb.TblDec)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_P= ROTOCOL, EccGlobalData.gDb.TblDsc)=0D + self.CheckGuidProtocolPpiValue(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL, MODEL_EFI_P= ROTOCOL)=0D # Check ppi=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _PPI, MODEL_EFI_PPI, EccGlobalData.gDb.TblDec)=0D - self.CheckGuidProtocolPpi(ERROR_META_DATA_FILE_CHECK_DUPLICATE= _PPI, MODEL_EFI_PPI, EccGlobalData.gDb.TblDsc)=0D - self.CheckGuidProtocolPpiValue(ERROR_META_DATA_FILE_CHECK_DUPL= ICATE_PPI, MODEL_EFI_PPI)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI, E= ccGlobalData.gDb.TblDec)=0D + self.CheckGuidProtocolPpi(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI, E= ccGlobalData.gDb.TblDsc)=0D + self.CheckGuidProtocolPpiValue(=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI, MODEL_EFI_PPI)=0D =0D # Check whether all files under module directory are described in INF = files=0D def MetaDataFileCheckModuleFileNoUse(self):=0D @@ -1112,15 +1174,18 @@ class Check(object): RecordSet =3D EccGlobalData.gDb.TblInf.Exec(SqlCommand)=0D for Record in RecordSet:=0D Path =3D Record[1]=0D - Path =3D Path.upper().replace('\X64', '').replace('\IA32',= '').replace('\EBC', '').replace('\IPF', '').replace('\ARM', '')=0D + Path =3D Path.upper().replace('\X64', '').replace('\IA32',= '').replace(=0D + '\EBC', '').replace('\IPF', '').replace('\ARM', '')=0D if Path in InfPathList:=0D if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_MODULE_FILE_NO_USE, Record[2]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_MODULE_FILE_NO_USE, OtherMsg=3D"The source file [%s] is existin= g in module directory but it is not described in INF file." % (Record[2]), = BelongsToTable=3D'File', BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_MODULE_FILE_NO_USE, OtherMsg=3D"The source file [%s] is existin= g in module directory but it is not described in INF file." % (=0D + Record[2]), BelongsToTable=3D'File', BelongsTo= Item=3DRecord[0])=0D =0D # Check whether the PCD is correctly used in C function via its type=0D def MetaDataFileCheckPcdType(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckPcdType =3D=3D '1' or Ec= cGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlobalData.gConfi= g.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for pcd type in c code function usag= e ...")=0D + EdkLogger.quiet(=0D + "Checking for pcd type in c code function usage ...")=0D SqlCommand =3D """=0D select ID, Model, Value1, Value2, BelongsToFile f= rom INF where Model > %s and Model < %s=0D """ % (MODEL_PCD, MODEL_META_DATA_HEADER)=0D @@ -1148,19 +1213,23 @@ class Check(object): FunName =3D Record[0]=0D if not EccGlobalData.gException.IsException(ERROR_= META_DATA_FILE_CHECK_PCD_TYPE, FunName):=0D if Model in [MODEL_PCD_FIXED_AT_BUILD] and not= FunName.startswith('FixedPcdGet'):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a FixP= cd but now it is called by c function [%s]" % (PcdName, FunName), BelongsTo= Table=3DTblName, BelongsToItem=3DRecord[1])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a FixP= cd but now it is called by c function [%s]" % (=0D + PcdName, FunName), BelongsToTable=3DTb= lName, BelongsToItem=3DRecord[1])=0D if Model in [MODEL_PCD_FEATURE_FLAG] and (not = FunName.startswith('FeaturePcdGet') and not FunName.startswith('FeaturePcdS= et')):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a Feat= urePcd but now it is called by c function [%s]" % (PcdName, FunName), Belon= gsToTable=3DTblName, BelongsToItem=3DRecord[1])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a Feat= urePcd but now it is called by c function [%s]" % (=0D + PcdName, FunName), BelongsToTable=3DTb= lName, BelongsToItem=3DRecord[1])=0D if Model in [MODEL_PCD_PATCHABLE_IN_MODULE] an= d (not FunName.startswith('PatchablePcdGet') and not FunName.startswith('Pa= tchablePcdSet')):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a Patc= hablePcd but now it is called by c function [%s]" % (PcdName, FunName), Bel= ongsToTable=3DTblName, BelongsToItem=3DRecord[1])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_PCD_TYPE, OtherMsg=3D"The pcd '%s' is defined as a Patc= hablePcd but now it is called by c function [%s]" % (=0D + PcdName, FunName), BelongsToTable=3DTb= lName, BelongsToItem=3DRecord[1])=0D =0D - #ERROR_META_DATA_FILE_CHECK_PCD_TYPE=0D + # ERROR_META_DATA_FILE_CHECK_PCD_TYPE=0D pass=0D =0D # Internal worker function to get the INF workspace relative path from= FileID=0D def GetInfFilePathFromID(self, FileID):=0D Table =3D EccGlobalData.gDb.TblFile=0D - SqlCommand =3D """select A.FullPath from %s as A where A.ID =3D %s= """ % (Table.Table, FileID)=0D + SqlCommand =3D """select A.FullPath from %s as A where A.ID =3D %s= """ % (=0D + Table.Table, FileID)=0D RecordSet =3D Table.Exec(SqlCommand)=0D Path =3D ""=0D for Record in RecordSet:=0D @@ -1170,7 +1239,8 @@ class Check(object): # Check whether two module INFs under one workspace has the same FILE_= GUID value=0D def MetaDataFileCheckModuleFileGuidDuplication(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidDuplicatio= n =3D=3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or Ec= cGlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking for pcd type in c code function usag= e ...")=0D + EdkLogger.quiet(=0D + "Checking for pcd type in c code function usage ...")=0D Table =3D EccGlobalData.gDb.TblInf=0D SqlCommand =3D """=0D select A.ID, A.Value3, A.BelongsToFile, B.Belongs= ToFile from %s as A, %s as B=0D @@ -1183,11 +1253,13 @@ class Check(object): InfPath2 =3D self.GetInfFilePathFromID(Record[3])=0D if InfPath1 and InfPath2:=0D if not EccGlobalData.gException.IsException(ERROR_META= _DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, InfPath1):=0D - Msg =3D "The FILE_GUID of INF file [%s] is duplica= ted with that of %s" % (InfPath1, InfPath2)=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_MODULE_FILE_GUID_DUPLICATION, OtherMsg=3DMsg, BelongsToTable=3D= Table.Table, BelongsToItem=3DRecord[0])=0D -=0D + Msg =3D "The FILE_GUID of INF file [%s] is duplica= ted with that of %s" % (=0D + InfPath1, InfPath2)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DU= PLICATION, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRe= cord[0])=0D =0D # Check Guid Format in module INF=0D +=0D def MetaDataFileCheckModuleFileGuidFormat(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckModuleFileGuidFormat =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1':=0D EdkLogger.quiet("Check Guid Format in module INF ...")=0D @@ -1201,7 +1273,8 @@ class Check(object): Value2 =3D Record[2]=0D GuidCommentList =3D []=0D InfPath =3D self.GetInfFilePathFromID(Record[3])=0D - Msg =3D "The GUID format of %s in INF file [%s] does not f= ollow rules" % (Value1, InfPath)=0D + Msg =3D "The GUID format of %s in INF file [%s] does not f= ollow rules" % (=0D + Value1, InfPath)=0D if Value2.startswith(DT.TAB_SPECIAL_COMMENT):=0D GuidCommentList =3D Value2[2:].split(DT.TAB_SPECIAL_CO= MMENT)=0D if GuidCommentList[0].strip().startswith(DT.TAB_INF_US= AGE_UNDEFINED):=0D @@ -1211,7 +1284,8 @@ class Check(object): DT.T= AB_INF_USAGE_SOME_PRO,=0D DT.T= AB_INF_USAGE_CON,=0D DT.T= AB_INF_USAGE_SOME_CON)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_FORMAT_GUID, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, = BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_GUID, Ot= herMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D if not (GuidCommentList[1].strip()).startswith(DT.= TAB_INF_GUIDTYPE_VAR) and \=0D not GuidCommentList[1].strip().startswith((DT.= TAB_INF_GUIDTYPE_EVENT,=0D DT.= TAB_INF_GUIDTYPE_HII,=0D @@ -1224,11 +1298,14 @@ class Check(object): DT.= TAB_INF_GUIDTYPE_PROTOCOL,=0D DT.= TAB_INF_GUIDTYPE_PPI,=0D DT.= TAB_INF_USAGE_UNDEFINED)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_M= ETA_DATA_FILE_CHECK_FORMAT_GUID, OtherMsg=3DMsg, BelongsToTable=3DTable.Tab= le, BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_GUID, Ot= herMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D else:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA= _FILE_CHECK_FORMAT_GUID, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, Belo= ngsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_GUID, OtherM= sg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D else:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_FORMAT_GUID, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsT= oItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_GUID, OtherMsg= =3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D =0D # Check Protocol Format in module INF=0D def MetaDataFileCheckModuleFileProtocolFormat(self):=0D @@ -1244,7 +1321,8 @@ class Check(object): Value2 =3D Record[2]=0D GuidCommentList =3D []=0D InfPath =3D self.GetInfFilePathFromID(Record[3])=0D - Msg =3D "The Protocol format of %s in INF file [%s] does n= ot follow rules" % (Value1, InfPath)=0D + Msg =3D "The Protocol format of %s in INF file [%s] does n= ot follow rules" % (=0D + Value1, InfPath)=0D if Value2.startswith(DT.TAB_SPECIAL_COMMENT):=0D GuidCommentList =3D Value2[2:].split(DT.TAB_SPECIAL_CO= MMENT)=0D if len(GuidCommentList) >=3D 1:=0D @@ -1256,12 +1334,14 @@ class Check(object): DT.T= AB_INF_USAGE_TO_START,=0D DT.T= AB_INF_USAGE_BY_START,=0D DT.T= AB_INF_USAGE_UNDEFINED)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_FORMAT_PROTOCOL, OtherMsg=3DMsg, BelongsToTable=3DTable.Tab= le, BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PROTOCOL= , OtherMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])= =0D else:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_FORMAT_PROTOCOL, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, Belo= ngsToItem=3DRecord[0])=0D -=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PROTOCOL, OtherM= sg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D =0D # Check Ppi Format in module INF=0D +=0D def MetaDataFileCheckModuleFilePpiFormat(self):=0D if EccGlobalData.gConfig.MetaDataFileCheckModuleFilePpiFormat =3D= =3D '1' or EccGlobalData.gConfig.MetaDataFileCheckAll =3D=3D '1' or EccGlob= alData.gConfig.CheckAll =3D=3D '1':=0D EdkLogger.quiet("Check Ppi Format in module INF ...")=0D @@ -1275,7 +1355,8 @@ class Check(object): Value2 =3D Record[2]=0D GuidCommentList =3D []=0D InfPath =3D self.GetInfFilePathFromID(Record[3])=0D - Msg =3D "The Ppi format of %s in INF file [%s] does not fo= llow rules" % (Value1, InfPath)=0D + Msg =3D "The Ppi format of %s in INF file [%s] does not fo= llow rules" % (=0D + Value1, InfPath)=0D if Value2.startswith(DT.TAB_SPECIAL_COMMENT):=0D GuidCommentList =3D Value2[2:].split(DT.TAB_SPECIAL_CO= MMENT)=0D if len(GuidCommentList) >=3D 1:=0D @@ -1285,9 +1366,11 @@ class Check(object): DT.T= AB_INF_USAGE_SOME_CON,=0D DT.T= AB_INF_USAGE_NOTIFY,=0D DT.T= AB_INF_USAGE_UNDEFINED)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_FORMAT_PPI, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, B= elongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PPI, Oth= erMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D else:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_FORMAT_PPI, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsTo= Item=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PPI, OtherMsg=3D= Msg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D =0D # Check Pcd Format in module INF=0D def MetaDataFileCheckModuleFilePcdFormat(self):=0D @@ -1304,7 +1387,8 @@ class Check(object): Usage =3D Record[4]=0D PcdCommentList =3D []=0D InfPath =3D self.GetInfFilePathFromID(Record[5])=0D - Msg =3D "The Pcd format of %s in INF file [%s] does not fo= llow rules" % (PcdName, InfPath)=0D + Msg =3D "The Pcd format of %s in INF file [%s] does not fo= llow rules" % (=0D + PcdName, InfPath)=0D if Usage.startswith(DT.TAB_SPECIAL_COMMENT):=0D PcdCommentList =3D Usage[2:].split(DT.TAB_SPECIAL_COMM= ENT)=0D if len(PcdCommentList) >=3D 1:=0D @@ -1312,16 +1396,19 @@ class Check(object): and not PcdCommentList[0].strip().startswith((= DT.TAB_INF_USAGE_SOME_PRO,=0D = DT.TAB_INF_USAGE_CON,=0D = DT.TAB_INF_USAGE_UNDEFINED)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_FORMAT_PCD, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, B= elongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PCD, Oth= erMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D if Model in [MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_= PCD_DYNAMIC, MODEL_PCD_DYNAMIC_EX] \=0D and not PcdCommentList[0].strip().startswith((= DT.TAB_INF_USAGE_PRO,=0D = DT.TAB_INF_USAGE_SOME_PRO,=0D = DT.TAB_INF_USAGE_CON,=0D = DT.TAB_INF_USAGE_SOME_CON,=0D = DT.TAB_INF_USAGE_UNDEFINED)):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_= DATA_FILE_CHECK_FORMAT_PCD, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, B= elongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PCD, Oth= erMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D else:=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FIL= E_CHECK_FORMAT_PCD, OtherMsg=3DMsg, BelongsToTable=3DTable.Table, BelongsTo= Item=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PCD, OtherMsg=3D= Msg, BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D =0D # Check whether these is duplicate Guid/Ppi/Protocol name=0D def CheckGuidProtocolPpi(self, ErrorID, Model, Table):=0D @@ -1344,7 +1431,8 @@ class Check(object): RecordSet =3D Table.Exec(SqlCommand)=0D for Record in RecordSet:=0D if not EccGlobalData.gException.IsException(ErrorID, Record[1]= ):=0D - EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg=3D"Th= e %s name [%s] is defined more than one time" % (Name.upper(), Record[1]), = BelongsToTable=3DTable.Table, BelongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg=3D"Th= e %s name [%s] is defined more than one time" % (=0D + Name.upper(), Record[1]), BelongsToTable=3DTable.Table= , BelongsToItem=3DRecord[0])=0D =0D # Check whether these is duplicate Guid/Ppi/Protocol value=0D def CheckGuidProtocolPpiValue(self, ErrorID, Model):=0D @@ -1366,17 +1454,18 @@ class Check(object): RecordSet =3D Table.Exec(SqlCommand)=0D for Record in RecordSet:=0D if not EccGlobalData.gException.IsException(ErrorID, Record[2]= ):=0D - 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])=0D + EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg=3D"Th= e %s value [%s] is used more than one time" % (=0D + Name.upper(), Record[2]), BelongsToTable=3DTable.Table= , BelongsToItem=3DRecord[0])=0D =0D # Naming Convention Check=0D def NamingConventionCheck(self):=0D if EccGlobalData.gConfig.NamingConventionCheckDefineStatement =3D= =3D '1' \=0D - or EccGlobalData.gConfig.NamingConventionCheckTypedefStatement =3D= =3D '1' \=0D - or EccGlobalData.gConfig.NamingConventionCheckIfndefStatement =3D= =3D '1' \=0D - or EccGlobalData.gConfig.NamingConventionCheckVariableName =3D=3D = '1' \=0D - or EccGlobalData.gConfig.NamingConventionCheckSingleCharacterVaria= ble =3D=3D '1' \=0D - or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1'\=0D - or EccGlobalData.gConfig.CheckAll =3D=3D '1':=0D + or EccGlobalData.gConfig.NamingConventionCheckTypedefState= ment =3D=3D '1' \=0D + or EccGlobalData.gConfig.NamingConventionCheckIfndefStatem= ent =3D=3D '1' \=0D + or EccGlobalData.gConfig.NamingConventionCheckVariableName= =3D=3D '1' \=0D + or EccGlobalData.gConfig.NamingConventionCheckSingleCharac= terVariable =3D=3D '1' \=0D + or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '= 1'\=0D + or EccGlobalData.gConfig.CheckAll =3D=3D '1':=0D for Dirpath, Dirnames, Filenames in self.WalkTree():=0D for F in Filenames:=0D if os.path.splitext(F)[1] in ('.h', '.c'):=0D @@ -1388,9 +1477,11 @@ class Check(object): self.NamingConventionCheckDefineStatement(FileTabl= e)=0D self.NamingConventionCheckTypedefStatement(FileTab= le)=0D self.NamingConventionCheckVariableName(FileTable)= =0D - self.NamingConventionCheckSingleCharacterVariable(= FileTable)=0D + self.NamingConventionCheckSingleCharacterVariable(= =0D + FileTable)=0D if os.path.splitext(F)[1] in ('.h'):=0D - self.NamingConventionCheckIfndefStatement(File= Table)=0D + self.NamingConventionCheckIfndefStatement(=0D + FileTable)=0D =0D self.NamingConventionCheckPathName()=0D self.NamingConventionCheckFunctionName()=0D @@ -1398,9 +1489,11 @@ class Check(object): # Check whether only capital letters are used for #define declarations= =0D def NamingConventionCheckDefineStatement(self, FileTable):=0D if EccGlobalData.gConfig.NamingConventionCheckDefineStatement =3D= =3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking naming convention of #define stateme= nt ...")=0D + EdkLogger.quiet(=0D + "Checking naming convention of #define statement ...")=0D =0D - SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (FileTable, MODEL_IDENTIFIER_MACRO_DEFINE)=0D + SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (=0D + FileTable, MODEL_IDENTIFIER_MACRO_DEFINE)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D Name =3D Record[1].strip().split()[1]=0D @@ -1408,14 +1501,17 @@ class Check(object): Name =3D Name[0:Name.find('(')]=0D if Name.upper() !=3D Name:=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_DEFINE_STATEMENT, Name):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_DEFINE_STATEMENT, OtherMsg=3D"The #define name [%s] does not= follow the rules" % (Name), BelongsToTable=3DFileTable, BelongsToItem=3DRe= cord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_DEFINE_STATEMENT, OtherMsg=3D"The #define name [%s] does not= follow the rules" % (=0D + Name), BelongsToTable=3DFileTable, BelongsToIt= em=3DRecord[0])=0D =0D # Check whether only capital letters are used for typedef declarations= =0D def NamingConventionCheckTypedefStatement(self, FileTable):=0D if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement =3D= =3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking naming convention of #typedef statem= ent ...")=0D + EdkLogger.quiet(=0D + "Checking naming convention of #typedef statement ...")=0D =0D - SqlCommand =3D """select ID, Name from %s where Model =3D %s""= " % (FileTable, MODEL_IDENTIFIER_TYPEDEF)=0D + SqlCommand =3D """select ID, Name from %s where Model =3D %s""= " % (=0D + FileTable, MODEL_IDENTIFIER_TYPEDEF)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D Name =3D Record[1].strip()=0D @@ -1423,27 +1519,32 @@ class Check(object): if Name[0] =3D=3D '(':=0D Name =3D Name[1:Name.find(')')]=0D if Name.find('(') > -1:=0D - Name =3D Name[Name.find('(') + 1 : Name.find(')')]= =0D + Name =3D Name[Name.find('(') + 1: Name.find(')')]= =0D Name =3D Name.replace('WINAPI', '')=0D Name =3D Name.replace('*', '').strip()=0D if Name.upper() !=3D Name:=0D if not EccGlobalData.gException.IsException(ERROR_= NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT, Name):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMIN= G_CONVENTION_CHECK_TYPEDEF_STATEMENT, OtherMsg=3D"The #typedef name [%s] do= es not follow the rules" % (Name), BelongsToTable=3DFileTable, BelongsToIte= m=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMIN= G_CONVENTION_CHECK_TYPEDEF_STATEMENT, OtherMsg=3D"The #typedef name [%s] do= es not follow the rules" % (=0D + Name), BelongsToTable=3DFileTable, Belongs= ToItem=3DRecord[0])=0D =0D # Check whether the #ifndef at the start of an include file uses both = prefix and postfix underscore characters, '_'.=0D def NamingConventionCheckIfndefStatement(self, FileTable):=0D if EccGlobalData.gConfig.NamingConventionCheckIfndefStatement =3D= =3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1' or Ecc= GlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking naming convention of #ifndef stateme= nt ...")=0D + EdkLogger.quiet(=0D + "Checking naming convention of #ifndef statement ...")=0D =0D - SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF)=0D + SqlCommand =3D """select ID, Value from %s where Model =3D %s"= "" % (=0D + FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D if RecordSet:=0D # Only check the first ifndef statement of the file=0D - FirstDefine =3D sorted(RecordSet, key=3Dlambda Record: Rec= ord[0])[0]=0D + FirstDefine =3D sorted(=0D + RecordSet, key=3Dlambda Record: Record[0])[0]=0D Name =3D FirstDefine[1].replace('#ifndef', '').strip()=0D if Name[0] =3D=3D '_' or Name[-1] !=3D '_' or Name[-2] =3D= =3D '_':=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_IFNDEF_STATEMENT, Name):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_IFNDEF_STATEMENT, OtherMsg=3D"The #ifndef name [%s] does not= follow the rules" % (Name), BelongsToTable=3DFileTable, BelongsToItem=3DFi= rstDefine[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_IFNDEF_STATEMENT, OtherMsg=3D"The #ifndef name [%s] does not= follow the rules" % (=0D + Name), BelongsToTable=3DFileTable, BelongsToIt= em=3DFirstDefine[0])=0D =0D # Rule for path name, variable name and function name=0D # 1. First character should be upper case=0D @@ -1459,7 +1560,8 @@ class Check(object): for Record in RecordSet:=0D if not Pattern.match(Record[1]):=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_PATH_NAME, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_PATH_NAME, OtherMsg=3D"The file path [%s] does not follow th= e rules" % (Record[1]), BelongsToTable=3D'File', BelongsToItem=3DRecord[0])= =0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_PATH_NAME, OtherMsg=3D"The file path [%s] does not follow th= e rules" % (=0D + Record[1]), BelongsToTable=3D'File', BelongsTo= Item=3DRecord[0])=0D =0D # Rule for path name, variable name and function name=0D # 1. First character should be upper case=0D @@ -1472,7 +1574,8 @@ class Check(object): EdkLogger.quiet("Checking naming convention of variable name .= ..")=0D Pattern =3D re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')=0D =0D - SqlCommand =3D """select ID, Name, Modifier from %s where Mode= l =3D %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)=0D + SqlCommand =3D """select ID, Name, Modifier from %s where Mode= l =3D %s""" % (=0D + FileTable, MODEL_IDENTIFIER_VARIABLE)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D Var =3D Record[1]=0D @@ -1481,7 +1584,8 @@ class Check(object): Var =3D Var[5:].lstrip()=0D if not Pattern.match(Var) and not (Modifier.endswith('*') = and Var.startswith('p')):=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_VARIABLE_NAME, OtherMsg=3D"The variable name [%s] does not f= ollow the rules" % (Record[1]), BelongsToTable=3DFileTable, BelongsToItem= =3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_VARIABLE_NAME, OtherMsg=3D"The variable name [%s] does not f= ollow the rules" % (=0D + Record[1]), BelongsToTable=3DFileTable, Belong= sToItem=3DRecord[0])=0D =0D # Rule for path name, variable name and function name=0D # 1. First character should be upper case=0D @@ -1497,20 +1601,25 @@ class Check(object): for Record in RecordSet:=0D if not Pattern.match(Record[1]):=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_FUNCTION_NAME, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_FUNCTION_NAME, OtherMsg=3D"The function name [%s] does not f= ollow the rules" % (Record[1]), BelongsToTable=3D'Function', BelongsToItem= =3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_FUNCTION_NAME, OtherMsg=3D"The function name [%s] does not f= ollow the rules" % (=0D + Record[1]), BelongsToTable=3D'Function', Belon= gsToItem=3DRecord[0])=0D =0D # Check whether NO use short variable name with single character=0D def NamingConventionCheckSingleCharacterVariable(self, FileTable):=0D if EccGlobalData.gConfig.NamingConventionCheckSingleCharacterVaria= ble =3D=3D '1' or EccGlobalData.gConfig.NamingConventionCheckAll =3D=3D '1'= or EccGlobalData.gConfig.CheckAll =3D=3D '1':=0D - EdkLogger.quiet("Checking naming convention of single characte= r variable name ...")=0D + EdkLogger.quiet(=0D + "Checking naming convention of single character variable n= ame ...")=0D =0D - SqlCommand =3D """select ID, Name from %s where Model =3D %s""= " % (FileTable, MODEL_IDENTIFIER_VARIABLE)=0D + SqlCommand =3D """select ID, Name from %s where Model =3D %s""= " % (=0D + FileTable, MODEL_IDENTIFIER_VARIABLE)=0D RecordSet =3D EccGlobalData.gDb.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D Variable =3D Record[1].replace('*', '')=0D if len(Variable) =3D=3D 1:=0D if not EccGlobalData.gException.IsException(ERROR_NAMI= NG_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, Record[1]):=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, OtherMsg=3D"The variable name [%s= ] does not follow the rules" % (Record[1]), BelongsToTable=3DFileTable, Bel= ongsToItem=3DRecord[0])=0D + EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CO= NVENTION_CHECK_SINGLE_CHARACTER_VARIABLE, OtherMsg=3D"The variable name [%s= ] does not follow the rules" % (=0D + Record[1]), BelongsToTable=3DFileTable, Belong= sToItem=3DRecord[0])=0D +=0D =0D def FindPara(FilePath, Para, CallingLine):=0D Lines =3D open(FilePath).readlines()=0D @@ -1525,6 +1634,7 @@ def FindPara(FilePath, Para, CallingLine): =0D return ''=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Ecc/CodeFragment.py b/BaseTools/Source= /Python/Ecc/CodeFragment.py index 8ced51f25bde..2f558196ae3c 100644 --- a/BaseTools/Source/Python/Ecc/CodeFragment.py +++ b/BaseTools/Source/Python/Ecc/CodeFragment.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # fragments of source file=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -7,11 +7,11 @@ #=0D =0D =0D -## The description of comment contents and start & end position=0D +# The description of comment contents and start & end position=0D #=0D #=0D -class Comment :=0D - ## The constructor=0D +class Comment:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -25,11 +25,13 @@ class Comment : self.EndPos =3D End=0D self.Type =3D CommentType=0D =0D -## The description of preprocess directives and start & end position=0D +# The description of preprocess directives and start & end position=0D #=0D #=0D -class PP_Directive :=0D - ## The constructor=0D +=0D +=0D +class PP_Directive:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -41,11 +43,13 @@ class PP_Directive : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of predicate expression and start & end position=0D +# The description of predicate expression and start & end position=0D #=0D #=0D -class PredicateExpression :=0D - ## The constructor=0D +=0D +=0D +class PredicateExpression:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -57,11 +61,13 @@ class PredicateExpression : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of function definition and start & end position=0D +# The description of function definition and start & end position=0D #=0D #=0D -class FunctionDefinition :=0D - ## The constructor=0D +=0D +=0D +class FunctionDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -77,11 +83,13 @@ class FunctionDefinition : self.LeftBracePos =3D LBPos=0D self.NamePos =3D NamePos=0D =0D -## The description of variable declaration and start & end position=0D +# The description of variable declaration and start & end position=0D #=0D #=0D -class VariableDeclaration :=0D - ## The constructor=0D +=0D +=0D +class VariableDeclaration:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -94,11 +102,13 @@ class VariableDeclaration : self.StartPos =3D Begin=0D self.NameStartPos =3D NamePos=0D =0D -## The description of enum definition and start & end position=0D +# The description of enum definition and start & end position=0D #=0D #=0D -class EnumerationDefinition :=0D - ## The constructor=0D +=0D +=0D +class EnumerationDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -110,11 +120,13 @@ class EnumerationDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of struct/union definition and start & end position=0D +# The description of struct/union definition and start & end position=0D #=0D #=0D -class StructUnionDefinition :=0D - ## The constructor=0D +=0D +=0D +class StructUnionDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -126,11 +138,13 @@ class StructUnionDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of 'Typedef' definition and start & end position=0D +# The description of 'Typedef' definition and start & end position=0D #=0D #=0D -class TypedefDefinition :=0D - ## The constructor=0D +=0D +=0D +class TypedefDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -143,8 +157,9 @@ class TypedefDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D +=0D class FunctionCalling:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -156,4 +171,3 @@ class FunctionCalling: self.ParamList =3D Param=0D self.StartPos =3D Begin=0D self.EndPos =3D End=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py b/BaseToo= ls/Source/Python/Ecc/CodeFragmentCollector.py index d8d6aff08a6e..1f0bae3d6b92 100644 --- a/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py +++ b/BaseTools/Source/Python/Ecc/CodeFragmentCollector.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # preprocess source file=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -32,21 +32,21 @@ from Ecc.CodeFragment import PP_Directive from Ecc.ParserWarning import Warning=0D =0D =0D -##define T_CHAR_SPACE ' '=0D -##define T_CHAR_NULL '\0'=0D -##define T_CHAR_CR '\r'=0D -##define T_CHAR_TAB '\t'=0D -##define T_CHAR_LF '\n'=0D -##define T_CHAR_SLASH '/'=0D -##define T_CHAR_BACKSLASH '\\'=0D -##define T_CHAR_DOUBLE_QUOTE '\"'=0D -##define T_CHAR_SINGLE_QUOTE '\''=0D -##define T_CHAR_STAR '*'=0D -##define T_CHAR_HASH '#'=0D +# define T_CHAR_SPACE ' '=0D +# define T_CHAR_NULL '\0'=0D +# define T_CHAR_CR '\r'=0D +# define T_CHAR_TAB '\t'=0D +# define T_CHAR_LF '\n'=0D +# define T_CHAR_SLASH '/'=0D +# define T_CHAR_BACKSLASH '\\'=0D +# define T_CHAR_DOUBLE_QUOTE '\"'=0D +# define T_CHAR_SINGLE_QUOTE '\''=0D +# define T_CHAR_STAR '*'=0D +# define T_CHAR_HASH '#'=0D =0D -(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH= , \=0D -T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T= _CHAR_HASH) =3D \=0D -(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')=0D +(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH= ,=0D + T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, = T_CHAR_HASH) =3D \=0D + (' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')=0D =0D SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}')=0D =0D @@ -54,15 +54,17 @@ SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}') =0D (T_PP_INCLUDE, T_PP_DEFINE, T_PP_OTHERS) =3D (0, 1, 2)=0D =0D -## The collector for source code fragments.=0D +# The collector for source code fragments.=0D #=0D # PreprocessFile method should be called prior to ParseFile=0D #=0D # GetNext*** procedures mean these procedures will get next token first, t= hen make judgement.=0D # Get*** procedures mean these procedures will make judgement on current t= oken only.=0D #=0D +=0D +=0D class CodeFragmentCollector:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D @@ -77,7 +79,7 @@ class CodeFragmentCollector: self.__Token =3D ""=0D self.__SkippedChars =3D ""=0D =0D - ## __EndOfFile() method=0D + # __EndOfFile() method=0D #=0D # Judge current buffer pos is at file end=0D #=0D @@ -98,7 +100,7 @@ class CodeFragmentCollector: else:=0D return False=0D =0D - ## __EndOfLine() method=0D + # __EndOfLine() method=0D #=0D # Judge current buffer pos is at line end=0D #=0D @@ -107,13 +109,14 @@ class CodeFragmentCollector: # @retval False Current File buffer position is NOT at line en= d=0D #=0D def __EndOfLine(self):=0D - SizeOfCurrentLine =3D len(self.Profile.FileLinesList[self.CurrentL= ineNumber - 1])=0D + SizeOfCurrentLine =3D len(=0D + self.Profile.FileLinesList[self.CurrentLineNumber - 1])=0D if self.CurrentOffsetWithinLine >=3D SizeOfCurrentLine - 1:=0D return True=0D else:=0D return False=0D =0D - ## Rewind() method=0D + # Rewind() method=0D #=0D # Reset file data buffer to the initial state=0D #=0D @@ -123,7 +126,7 @@ class CodeFragmentCollector: self.CurrentLineNumber =3D 1=0D self.CurrentOffsetWithinLine =3D 0=0D =0D - ## __UndoOneChar() method=0D + # __UndoOneChar() method=0D #=0D # Go back one char in the file buffer=0D #=0D @@ -142,7 +145,7 @@ class CodeFragmentCollector: self.CurrentOffsetWithinLine -=3D 1=0D return True=0D =0D - ## __GetOneChar() method=0D + # __GetOneChar() method=0D #=0D # Move forward one char in the file buffer=0D #=0D @@ -150,12 +153,12 @@ class CodeFragmentCollector: #=0D def __GetOneChar(self):=0D if self.CurrentOffsetWithinLine =3D=3D len(self.Profile.FileLinesL= ist[self.CurrentLineNumber - 1]) - 1:=0D - self.CurrentLineNumber +=3D 1=0D - self.CurrentOffsetWithinLine =3D 0=0D + self.CurrentLineNumber +=3D 1=0D + self.CurrentOffsetWithinLine =3D 0=0D else:=0D - self.CurrentOffsetWithinLine +=3D 1=0D + self.CurrentOffsetWithinLine +=3D 1=0D =0D - ## __CurrentChar() method=0D + # __CurrentChar() method=0D #=0D # Get the char pointed to by the file buffer pointer=0D #=0D @@ -163,12 +166,13 @@ class CodeFragmentCollector: # @retval Char Current char=0D #=0D def __CurrentChar(self):=0D - CurrentChar =3D self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine]=0D + CurrentChar =3D self.Profile.FileLinesList[self.CurrentLineNumber = -=0D + 1][self.CurrentOffsetWith= inLine]=0D # if CurrentChar > 255:=0D # raise Warning("Non-Ascii char found At Line %d, offset %d" % = (self.CurrentLineNumber, self.CurrentOffsetWithinLine), self.FileName, self= .CurrentLineNumber)=0D return CurrentChar=0D =0D - ## __NextChar() method=0D + # __NextChar() method=0D #=0D # Get the one char pass the char pointed to by the file buffer point= er=0D #=0D @@ -181,7 +185,7 @@ class CodeFragmentCollector: else:=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1][= self.CurrentOffsetWithinLine + 1]=0D =0D - ## __SetCurrentCharValue() method=0D + # __SetCurrentCharValue() method=0D #=0D # Modify the value of current char=0D #=0D @@ -189,9 +193,10 @@ class CodeFragmentCollector: # @param Value The new value of current char=0D #=0D def __SetCurrentCharValue(self, Value):=0D - self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.Curren= tOffsetWithinLine] =3D Value=0D + self.Profile.FileLinesList[self.CurrentLineNumber -=0D + 1][self.CurrentOffsetWithinLine] =3D Va= lue=0D =0D - ## __SetCharValue() method=0D + # __SetCharValue() method=0D #=0D # Modify the value of current char=0D #=0D @@ -201,7 +206,7 @@ class CodeFragmentCollector: def __SetCharValue(self, Line, Offset, Value):=0D self.Profile.FileLinesList[Line - 1][Offset] =3D Value=0D =0D - ## __CurrentLine() method=0D + # __CurrentLine() method=0D #=0D # Get the list that contains current line contents=0D #=0D @@ -211,7 +216,7 @@ class CodeFragmentCollector: def __CurrentLine(self):=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1]=0D =0D - ## __InsertComma() method=0D + # __InsertComma() method=0D #=0D # Insert ',' to replace PP=0D #=0D @@ -220,9 +225,9 @@ class CodeFragmentCollector: #=0D def __InsertComma(self, Line):=0D =0D -=0D if self.Profile.FileLinesList[Line - 1][0] !=3D T_CHAR_HASH:=0D - BeforeHashPart =3D str(self.Profile.FileLinesList[Line - 1]).s= plit(T_CHAR_HASH)[0]=0D + BeforeHashPart =3D str(=0D + self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0= ]=0D if BeforeHashPart.rstrip().endswith(T_CHAR_COMMA) or BeforeHas= hPart.rstrip().endswith(';'):=0D return=0D =0D @@ -235,9 +240,10 @@ class CodeFragmentCollector: if str(self.Profile.FileLinesList[Line]).lstrip().startswith(',') = or str(self.Profile.FileLinesList[Line]).lstrip().startswith(';'):=0D return=0D =0D - self.Profile.FileLinesList[Line - 1].insert(self.CurrentOffsetWith= inLine, ',')=0D + self.Profile.FileLinesList[Line -=0D + 1].insert(self.CurrentOffsetWithinLine,= ',')=0D =0D - ## PreprocessFile() method=0D + # PreprocessFile() method=0D #=0D # Preprocess file contents, replace comments with spaces.=0D # In the end, rewind the file buffer pointer to the beginning=0D @@ -259,7 +265,8 @@ class CodeFragmentCollector: InString =3D False=0D InCharLiteral =3D False=0D =0D - self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesListFromFile]=0D + self.Profile.FileLinesList =3D [=0D + list(s) for s in self.Profile.FileLinesListFromFile]=0D while not self.__EndOfFile():=0D =0D if not InComment and self.__CurrentChar() =3D=3D T_CHAR_DOUBLE= _QUOTE:=0D @@ -276,7 +283,8 @@ class CodeFragmentCollector: else:=0D PPExtend =3D False=0D =0D - EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffset= WithinLine)=0D + EndLinePos =3D (self.CurrentLineNumber,=0D + self.CurrentOffsetWithinLine)=0D =0D if InComment and DoubleSlashComment:=0D InComment =3D False=0D @@ -297,7 +305,8 @@ class CodeFragmentCollector: CurrentLine =3D "".join(self.__CurrentLine())=0D if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).end= swith(T_CHAR_BACKSLASH):=0D SlashIndex =3D CurrentLine.rindex(T_CHAR_BACKSLASH= )=0D - self.__SetCharValue(self.CurrentLineNumber, SlashI= ndex, T_CHAR_SPACE)=0D + self.__SetCharValue(=0D + self.CurrentLineNumber, SlashIndex, T_CHAR_SPA= CE)=0D =0D if InComment and not DoubleSlashComment and not HashCommen= t:=0D CommentObj.Content +=3D T_CHAR_LF=0D @@ -310,7 +319,8 @@ class CodeFragmentCollector: self.__GetOneChar()=0D CommentObj.Content +=3D self.__CurrentChar()=0D # self.__SetCurrentCharValue(T_CHAR_SPACE)=0D - CommentObj.EndPos =3D (self.CurrentLineNumber, self.Curren= tOffsetWithinLine)=0D + CommentObj.EndPos =3D (self.CurrentLineNumber,=0D + self.CurrentOffsetWithinLine)=0D FileProfile.CommentList.append(CommentObj)=0D CommentObj =3D None=0D self.__GetOneChar()=0D @@ -322,7 +332,8 @@ class CodeFragmentCollector: if self.__CurrentChar() =3D=3D T_CHAR_SLASH and self._= _NextChar() =3D=3D T_CHAR_SLASH:=0D InComment =3D False=0D HashComment =3D False=0D - PPDirectiveObj.EndPos =3D (self.CurrentLineNumber,= self.CurrentOffsetWithinLine - 1)=0D + PPDirectiveObj.EndPos =3D (=0D + self.CurrentLineNumber, self.CurrentOffsetWith= inLine - 1)=0D FileProfile.PPDirectiveList.append(PPDirectiveObj)= =0D PPDirectiveObj =3D None=0D continue=0D @@ -338,15 +349,18 @@ class CodeFragmentCollector: elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_SLASH:=0D InComment =3D True=0D DoubleSlashComment =3D True=0D - CommentObj =3D Comment('', (self.CurrentLineNumber, self.C= urrentOffsetWithinLine), None, T_COMMENT_TWO_SLASH)=0D + CommentObj =3D Comment(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None, T_COMMENT_TWO_SLASH)=0D # check for '#' comment=0D elif self.__CurrentChar() =3D=3D T_CHAR_HASH and not InString = and not InCharLiteral:=0D InComment =3D True=0D HashComment =3D True=0D - PPDirectiveObj =3D PP_Directive('', (self.CurrentLineNumbe= r, self.CurrentOffsetWithinLine), None)=0D + PPDirectiveObj =3D PP_Directive(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None)=0D # check for /* comment start=0D elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_STAR:=0D - CommentObj =3D Comment('', (self.CurrentLineNumber, self.C= urrentOffsetWithinLine), None, T_COMMENT_SLASH_STAR)=0D + CommentObj =3D Comment(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None, T_COMMENT_SLASH_STAR)=0D CommentObj.Content +=3D self.__CurrentChar()=0D # self.__SetCurrentCharValue( T_CHAR_SPACE)=0D self.__GetOneChar()=0D @@ -381,7 +395,8 @@ class CodeFragmentCollector: InString =3D False=0D InCharLiteral =3D False=0D =0D - self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesListFromFile]=0D + self.Profile.FileLinesList =3D [=0D + list(s) for s in self.Profile.FileLinesListFromFile]=0D while not self.__EndOfFile():=0D =0D if not InComment and self.__CurrentChar() =3D=3D T_CHAR_DOUBLE= _QUOTE:=0D @@ -398,7 +413,8 @@ class CodeFragmentCollector: else:=0D PPExtend =3D False=0D =0D - EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffset= WithinLine)=0D + EndLinePos =3D (self.CurrentLineNumber,=0D + self.CurrentOffsetWithinLine)=0D =0D if InComment and DoubleSlashComment:=0D InComment =3D False=0D @@ -419,7 +435,8 @@ class CodeFragmentCollector: CurrentLine =3D "".join(self.__CurrentLine())=0D if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).end= swith(T_CHAR_BACKSLASH):=0D SlashIndex =3D CurrentLine.rindex(T_CHAR_BACKSLASH= )=0D - self.__SetCharValue(self.CurrentLineNumber, SlashI= ndex, T_CHAR_SPACE)=0D + self.__SetCharValue(=0D + self.CurrentLineNumber, SlashIndex, T_CHAR_SPA= CE)=0D =0D if InComment and not DoubleSlashComment and not HashCommen= t:=0D CommentObj.Content +=3D T_CHAR_LF=0D @@ -432,7 +449,8 @@ class CodeFragmentCollector: self.__GetOneChar()=0D CommentObj.Content +=3D self.__CurrentChar()=0D self.__SetCurrentCharValue(T_CHAR_SPACE)=0D - CommentObj.EndPos =3D (self.CurrentLineNumber, self.Curren= tOffsetWithinLine)=0D + CommentObj.EndPos =3D (self.CurrentLineNumber,=0D + self.CurrentOffsetWithinLine)=0D FileProfile.CommentList.append(CommentObj)=0D CommentObj =3D None=0D self.__GetOneChar()=0D @@ -444,7 +462,8 @@ class CodeFragmentCollector: if self.__CurrentChar() =3D=3D T_CHAR_SLASH and self._= _NextChar() =3D=3D T_CHAR_SLASH:=0D InComment =3D False=0D HashComment =3D False=0D - PPDirectiveObj.EndPos =3D (self.CurrentLineNumber,= self.CurrentOffsetWithinLine - 1)=0D + PPDirectiveObj.EndPos =3D (=0D + self.CurrentLineNumber, self.CurrentOffsetWith= inLine - 1)=0D FileProfile.PPDirectiveList.append(PPDirectiveObj)= =0D PPDirectiveObj =3D None=0D continue=0D @@ -460,20 +479,23 @@ class CodeFragmentCollector: elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_SLASH:=0D InComment =3D True=0D DoubleSlashComment =3D True=0D - CommentObj =3D Comment('', (self.CurrentLineNumber, self.C= urrentOffsetWithinLine), None, T_COMMENT_TWO_SLASH)=0D + CommentObj =3D Comment(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None, T_COMMENT_TWO_SLASH)=0D # check for '#' comment=0D elif self.__CurrentChar() =3D=3D T_CHAR_HASH and not InString = and not InCharLiteral:=0D InComment =3D True=0D HashComment =3D True=0D - PPDirectiveObj =3D PP_Directive('', (self.CurrentLineNumbe= r, self.CurrentOffsetWithinLine), None)=0D + PPDirectiveObj =3D PP_Directive(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None)=0D # check for /* comment start=0D elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_STAR:=0D - CommentObj =3D Comment('', (self.CurrentLineNumber, self.C= urrentOffsetWithinLine), None, T_COMMENT_SLASH_STAR)=0D + CommentObj =3D Comment(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None, T_COMMENT_SLASH_STAR)=0D CommentObj.Content +=3D self.__CurrentChar()=0D - self.__SetCurrentCharValue( T_CHAR_SPACE)=0D + self.__SetCurrentCharValue(T_CHAR_SPACE)=0D self.__GetOneChar()=0D CommentObj.Content +=3D self.__CurrentChar()=0D - self.__SetCurrentCharValue( T_CHAR_SPACE)=0D + self.__SetCurrentCharValue(T_CHAR_SPACE)=0D self.__GetOneChar()=0D InComment =3D True=0D else:=0D @@ -489,7 +511,7 @@ class CodeFragmentCollector: FileProfile.PPDirectiveList.append(PPDirectiveObj)=0D self.Rewind()=0D =0D - ## ParseFile() method=0D + # ParseFile() method=0D #=0D # Parse the file profile buffer to extract fd, fv ... information=0D # Exception will be raised if syntax error found=0D @@ -499,13 +521,15 @@ class CodeFragmentCollector: def ParseFile(self):=0D self.PreprocessFile()=0D # restore from ListOfList to ListOfString=0D - self.Profile.FileLinesList =3D ["".join(list) for list in self.Pro= file.FileLinesList]=0D + self.Profile.FileLinesList =3D [=0D + "".join(list) for list in self.Profile.FileLinesList]=0D FileStringContents =3D ''=0D for fileLine in self.Profile.FileLinesList:=0D FileStringContents +=3D fileLine=0D for Token in self.TokenReleaceList:=0D if Token in FileStringContents:=0D - FileStringContents =3D FileStringContents.replace(Token, '= TOKENSTRING')=0D + FileStringContents =3D FileStringContents.replace(=0D + Token, 'TOKENSTRING')=0D cStream =3D antlr.InputStream(FileStringContents)=0D lexer =3D CLexer(cStream)=0D tStream =3D antlr.CommonTokenStream(lexer)=0D @@ -515,7 +539,8 @@ class CodeFragmentCollector: def ParseFileWithClearedPPDirective(self):=0D self.PreprocessFileWithClear()=0D # restore from ListOfList to ListOfString=0D - self.Profile.FileLinesList =3D ["".join(list) for list in self.Pro= file.FileLinesList]=0D + self.Profile.FileLinesList =3D [=0D + "".join(list) for list in self.Profile.FileLinesList]=0D FileStringContents =3D ''=0D for fileLine in self.Profile.FileLinesList:=0D FileStringContents +=3D fileLine=0D @@ -556,13 +581,14 @@ class CodeFragmentCollector: print('/********* VARIABLE DECLARATIONS ********/')=0D print('/****************************************/')=0D for var in FileProfile.VariableDeclarationList:=0D - print(str(var.StartPos) + var.Modifier + ' '+ var.Declarator)= =0D + print(str(var.StartPos) + var.Modifier + ' ' + var.Declarator)= =0D =0D print('/****************************************/')=0D print('/********* FUNCTION DEFINITIONS *********/')=0D print('/****************************************/')=0D for func in FileProfile.FunctionDefinitionList:=0D - print(str(func.StartPos) + func.Modifier + ' '+ func.Declarato= r + ' ' + str(func.NamePos))=0D + print(str(func.StartPos) + func.Modifier + ' ' +=0D + func.Declarator + ' ' + str(func.NamePos))=0D =0D print('/****************************************/')=0D print('/************ ENUMERATIONS **************/')=0D @@ -588,6 +614,7 @@ class CodeFragmentCollector: for typedef in FileProfile.TypedefDefinitionList:=0D print(str(typedef.StartPos) + typedef.ToType)=0D =0D +=0D if __name__ =3D=3D "__main__":=0D =0D collector =3D CodeFragmentCollector(sys.argv[1])=0D diff --git a/BaseTools/Source/Python/Ecc/Configuration.py b/BaseTools/Sourc= e/Python/Ecc/Configuration.py index 9d9feaca5eb6..c5ae3acfb8b0 100644 --- a/BaseTools/Source/Python/Ecc/Configuration.py +++ b/BaseTools/Source/Python/Ecc/Configuration.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class Configuration=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -17,129 +17,131 @@ from Common.LongFilePathSupport import OpenLongFilePa= th as open =0D _ConfigFileToInternalTranslation =3D {=0D # not same=0D - "ModifierList":"ModifierSet",=0D + "ModifierList": "ModifierSet",=0D =0D # same=0D # please keep this in correct alphabetical order.=0D - "AutoCorrect":"AutoCorrect",=0D - "BinaryExtList":"BinaryExtList",=0D - "CFunctionLayoutCheckAll":"CFunctionLayoutCheckAll",=0D - "CFunctionLayoutCheckDataDeclaration":"CFunctionLayoutCheckDataDeclara= tion",=0D - "CFunctionLayoutCheckFunctionBody":"CFunctionLayoutCheckFunctionBody",= =0D - "CFunctionLayoutCheckFunctionName":"CFunctionLayoutCheckFunctionName",= =0D - "CFunctionLayoutCheckFunctionPrototype":"CFunctionLayoutCheckFunctionP= rototype",=0D - "CFunctionLayoutCheckNoInitOfVariable":"CFunctionLayoutCheckNoInitOfVa= riable",=0D - "CFunctionLayoutCheckNoStatic":"CFunctionLayoutCheckNoStatic",=0D - "CFunctionLayoutCheckOptionalFunctionalModifier":"CFunctionLayoutCheck= OptionalFunctionalModifier",=0D - "CFunctionLayoutCheckReturnType":"CFunctionLayoutCheckReturnType",=0D - "CheckAll":"CheckAll",=0D - "Copyright":"Copyright",=0D - "DeclarationDataTypeCheckAll":"DeclarationDataTypeCheckAll",=0D - "DeclarationDataTypeCheckEFIAPIModifier":"DeclarationDataTypeCheckEFIA= PIModifier",=0D - "DeclarationDataTypeCheckEnumeratedType":"DeclarationDataTypeCheckEnum= eratedType",=0D - "DeclarationDataTypeCheckInOutModifier":"DeclarationDataTypeCheckInOut= Modifier",=0D - "DeclarationDataTypeCheckNoUseCType":"DeclarationDataTypeCheckNoUseCTy= pe",=0D - "DeclarationDataTypeCheckSameStructure":"DeclarationDataTypeCheckSameS= tructure",=0D - "DeclarationDataTypeCheckStructureDeclaration":"DeclarationDataTypeChe= ckStructureDeclaration",=0D - "DeclarationDataTypeCheckUnionType":"DeclarationDataTypeCheckUnionType= ",=0D - "DoxygenCheckAll":"DoxygenCheckAll",=0D - "DoxygenCheckCommand":"DoxygenCheckCommand",=0D - "DoxygenCheckCommentDescription":"DoxygenCheckCommentDescription",=0D - "DoxygenCheckCommentFormat":"DoxygenCheckCommentFormat",=0D - "DoxygenCheckFileHeader":"DoxygenCheckFileHeader",=0D - "DoxygenCheckFunctionHeader":"DoxygenCheckFunctionHeader",=0D - "GeneralCheckAll":"GeneralCheckAll",=0D - "GeneralCheckCarriageReturn":"GeneralCheckCarriageReturn",=0D - "GeneralCheckFileExistence":"GeneralCheckFileExistence",=0D - "GeneralCheckIndentation":"GeneralCheckIndentation",=0D - "GeneralCheckIndentationWidth":"GeneralCheckIndentationWidth",=0D - "GeneralCheckLine":"GeneralCheckLine",=0D - "GeneralCheckLineEnding":"GeneralCheckLineEnding",=0D - "GeneralCheckLineWidth":"GeneralCheckLineWidth",=0D - "GeneralCheckNoProgma":"GeneralCheckNoProgma",=0D - "GeneralCheckNoTab":"GeneralCheckNoTab",=0D - "GeneralCheckNo_Asm":"GeneralCheckNo_Asm",=0D - "GeneralCheckNonAcsii":"GeneralCheckNonAcsii",=0D - "GeneralCheckTabWidth":"GeneralCheckTabWidth",=0D - "GeneralCheckTrailingWhiteSpaceLine":"GeneralCheckTrailingWhiteSpaceLi= ne",=0D - "GeneralCheckUni":"GeneralCheckUni",=0D - "HeaderCheckAll":"HeaderCheckAll",=0D - "HeaderCheckCFileCommentLicenseFormat":"HeaderCheckCFileCommentLicense= Format",=0D - "HeaderCheckCFileCommentReferenceFormat":"HeaderCheckCFileCommentRefer= enceFormat",=0D - "HeaderCheckCFileCommentStartSpacesNum":"HeaderCheckCFileCommentStartS= pacesNum",=0D - "HeaderCheckFile":"HeaderCheckFile",=0D - "HeaderCheckFileCommentEnd":"HeaderCheckFileCommentEnd",=0D - "HeaderCheckFunction":"HeaderCheckFunction",=0D - "IncludeFileCheckAll":"IncludeFileCheckAll",=0D - "IncludeFileCheckData":"IncludeFileCheckData",=0D - "IncludeFileCheckIfndefStatement":"IncludeFileCheckIfndefStatement",=0D - "IncludeFileCheckSameName":"IncludeFileCheckSameName",=0D - "MetaDataFileCheckAll":"MetaDataFileCheckAll",=0D - "MetaDataFileCheckBinaryInfInFdf":"MetaDataFileCheckBinaryInfInFdf",=0D - "MetaDataFileCheckGenerateFileList":"MetaDataFileCheckGenerateFileList= ",=0D - "MetaDataFileCheckGuidDuplicate":"MetaDataFileCheckGuidDuplicate",=0D - "MetaDataFileCheckLibraryDefinedInDec":"MetaDataFileCheckLibraryDefine= dInDec",=0D - "MetaDataFileCheckLibraryInstance":"MetaDataFileCheckLibraryInstance",= =0D - "MetaDataFileCheckLibraryInstanceDependent":"MetaDataFileCheckLibraryI= nstanceDependent",=0D - "MetaDataFileCheckLibraryInstanceOrder":"MetaDataFileCheckLibraryInsta= nceOrder",=0D - "MetaDataFileCheckLibraryNoUse":"MetaDataFileCheckLibraryNoUse",=0D - "MetaDataFileCheckModuleFileGuidDuplication":"MetaDataFileCheckModuleF= ileGuidDuplication",=0D - "MetaDataFileCheckModuleFileGuidFormat":"MetaDataFileCheckModuleFileGu= idFormat",=0D - "MetaDataFileCheckModuleFileNoUse":"MetaDataFileCheckModuleFileNoUse",= =0D - "MetaDataFileCheckModuleFilePcdFormat":"MetaDataFileCheckModuleFilePcd= Format",=0D - "MetaDataFileCheckModuleFilePpiFormat":"MetaDataFileCheckModuleFilePpi= Format",=0D - "MetaDataFileCheckModuleFileProtocolFormat":"MetaDataFileCheckModuleFi= leProtocolFormat",=0D - "MetaDataFileCheckPathName":"MetaDataFileCheckPathName",=0D - "MetaDataFileCheckPathOfGenerateFileList":"MetaDataFileCheckPathOfGene= rateFileList",=0D - "MetaDataFileCheckPcdDuplicate":"MetaDataFileCheckPcdDuplicate",=0D - "MetaDataFileCheckPcdFlash":"MetaDataFileCheckPcdFlash",=0D - "MetaDataFileCheckPcdNoUse":"MetaDataFileCheckPcdNoUse",=0D - "MetaDataFileCheckPcdType":"MetaDataFileCheckPcdType",=0D - "NamingConventionCheckAll":"NamingConventionCheckAll",=0D - "NamingConventionCheckDefineStatement":"NamingConventionCheckDefineSta= tement",=0D - "NamingConventionCheckFunctionName":"NamingConventionCheckFunctionName= ",=0D - "NamingConventionCheckIfndefStatement":"NamingConventionCheckIfndefSta= tement",=0D - "NamingConventionCheckPathName":"NamingConventionCheckPathName",=0D - "NamingConventionCheckSingleCharacterVariable":"NamingConventionCheckS= ingleCharacterVariable",=0D - "NamingConventionCheckTypedefStatement":"NamingConventionCheckTypedefS= tatement",=0D - "NamingConventionCheckVariableName":"NamingConventionCheckVariableName= ",=0D - "PredicateExpressionCheckAll":"PredicateExpressionCheckAll",=0D - "PredicateExpressionCheckBooleanValue":"PredicateExpressionCheckBoolea= nValue",=0D - "PredicateExpressionCheckComparisonNullType":"PredicateExpressionCheck= ComparisonNullType",=0D - "PredicateExpressionCheckNonBooleanOperator":"PredicateExpressionCheck= NonBooleanOperator",=0D - "ScanOnlyDirList":"ScanOnlyDirList",=0D - "SkipDirList":"SkipDirList",=0D - "SkipFileList":"SkipFileList",=0D - "SmmCommParaCheckAll":"SmmCommParaCheckAll",=0D - "SmmCommParaCheckBufferType":"SmmCommParaCheckBufferType",=0D - "SpaceCheckAll":"SpaceCheckAll",=0D - "SpellingCheckAll":"SpellingCheckAll",=0D - "TokenReleaceList":"TokenReleaceList",=0D - "UniCheckAll":"UniCheckAll",=0D - "UniCheckHelpInfo":"UniCheckHelpInfo",=0D - "UniCheckPCDInfo":"UniCheckPCDInfo",=0D - "Version":"Version"=0D - }=0D + "AutoCorrect": "AutoCorrect",=0D + "BinaryExtList": "BinaryExtList",=0D + "CFunctionLayoutCheckAll": "CFunctionLayoutCheckAll",=0D + "CFunctionLayoutCheckDataDeclaration": "CFunctionLayoutCheckDataDeclar= ation",=0D + "CFunctionLayoutCheckFunctionBody": "CFunctionLayoutCheckFunctionBody"= ,=0D + "CFunctionLayoutCheckFunctionName": "CFunctionLayoutCheckFunctionName"= ,=0D + "CFunctionLayoutCheckFunctionPrototype": "CFunctionLayoutCheckFunction= Prototype",=0D + "CFunctionLayoutCheckNoInitOfVariable": "CFunctionLayoutCheckNoInitOfV= ariable",=0D + "CFunctionLayoutCheckNoStatic": "CFunctionLayoutCheckNoStatic",=0D + "CFunctionLayoutCheckOptionalFunctionalModifier": "CFunctionLayoutChec= kOptionalFunctionalModifier",=0D + "CFunctionLayoutCheckReturnType": "CFunctionLayoutCheckReturnType",=0D + "CheckAll": "CheckAll",=0D + "Copyright": "Copyright",=0D + "DeclarationDataTypeCheckAll": "DeclarationDataTypeCheckAll",=0D + "DeclarationDataTypeCheckEFIAPIModifier": "DeclarationDataTypeCheckEFI= APIModifier",=0D + "DeclarationDataTypeCheckEnumeratedType": "DeclarationDataTypeCheckEnu= meratedType",=0D + "DeclarationDataTypeCheckInOutModifier": "DeclarationDataTypeCheckInOu= tModifier",=0D + "DeclarationDataTypeCheckNoUseCType": "DeclarationDataTypeCheckNoUseCT= ype",=0D + "DeclarationDataTypeCheckSameStructure": "DeclarationDataTypeCheckSame= Structure",=0D + "DeclarationDataTypeCheckStructureDeclaration": "DeclarationDataTypeCh= eckStructureDeclaration",=0D + "DeclarationDataTypeCheckUnionType": "DeclarationDataTypeCheckUnionTyp= e",=0D + "DoxygenCheckAll": "DoxygenCheckAll",=0D + "DoxygenCheckCommand": "DoxygenCheckCommand",=0D + "DoxygenCheckCommentDescription": "DoxygenCheckCommentDescription",=0D + "DoxygenCheckCommentFormat": "DoxygenCheckCommentFormat",=0D + "DoxygenCheckFileHeader": "DoxygenCheckFileHeader",=0D + "DoxygenCheckFunctionHeader": "DoxygenCheckFunctionHeader",=0D + "GeneralCheckAll": "GeneralCheckAll",=0D + "GeneralCheckCarriageReturn": "GeneralCheckCarriageReturn",=0D + "GeneralCheckFileExistence": "GeneralCheckFileExistence",=0D + "GeneralCheckIndentation": "GeneralCheckIndentation",=0D + "GeneralCheckIndentationWidth": "GeneralCheckIndentationWidth",=0D + "GeneralCheckLine": "GeneralCheckLine",=0D + "GeneralCheckLineEnding": "GeneralCheckLineEnding",=0D + "GeneralCheckLineWidth": "GeneralCheckLineWidth",=0D + "GeneralCheckNoProgma": "GeneralCheckNoProgma",=0D + "GeneralCheckNoTab": "GeneralCheckNoTab",=0D + "GeneralCheckNo_Asm": "GeneralCheckNo_Asm",=0D + "GeneralCheckNonAcsii": "GeneralCheckNonAcsii",=0D + "GeneralCheckTabWidth": "GeneralCheckTabWidth",=0D + "GeneralCheckTrailingWhiteSpaceLine": "GeneralCheckTrailingWhiteSpaceL= ine",=0D + "GeneralCheckUni": "GeneralCheckUni",=0D + "HeaderCheckAll": "HeaderCheckAll",=0D + "HeaderCheckCFileCommentLicenseFormat": "HeaderCheckCFileCommentLicens= eFormat",=0D + "HeaderCheckCFileCommentReferenceFormat": "HeaderCheckCFileCommentRefe= renceFormat",=0D + "HeaderCheckCFileCommentStartSpacesNum": "HeaderCheckCFileCommentStart= SpacesNum",=0D + "HeaderCheckFile": "HeaderCheckFile",=0D + "HeaderCheckFileCommentEnd": "HeaderCheckFileCommentEnd",=0D + "HeaderCheckFunction": "HeaderCheckFunction",=0D + "IncludeFileCheckAll": "IncludeFileCheckAll",=0D + "IncludeFileCheckData": "IncludeFileCheckData",=0D + "IncludeFileCheckIfndefStatement": "IncludeFileCheckIfndefStatement",= =0D + "IncludeFileCheckSameName": "IncludeFileCheckSameName",=0D + "MetaDataFileCheckAll": "MetaDataFileCheckAll",=0D + "MetaDataFileCheckBinaryInfInFdf": "MetaDataFileCheckBinaryInfInFdf",= =0D + "MetaDataFileCheckGenerateFileList": "MetaDataFileCheckGenerateFileLis= t",=0D + "MetaDataFileCheckGuidDuplicate": "MetaDataFileCheckGuidDuplicate",=0D + "MetaDataFileCheckLibraryDefinedInDec": "MetaDataFileCheckLibraryDefin= edInDec",=0D + "MetaDataFileCheckLibraryInstance": "MetaDataFileCheckLibraryInstance"= ,=0D + "MetaDataFileCheckLibraryInstanceDependent": "MetaDataFileCheckLibrary= InstanceDependent",=0D + "MetaDataFileCheckLibraryInstanceOrder": "MetaDataFileCheckLibraryInst= anceOrder",=0D + "MetaDataFileCheckLibraryNoUse": "MetaDataFileCheckLibraryNoUse",=0D + "MetaDataFileCheckModuleFileGuidDuplication": "MetaDataFileCheckModule= FileGuidDuplication",=0D + "MetaDataFileCheckModuleFileGuidFormat": "MetaDataFileCheckModuleFileG= uidFormat",=0D + "MetaDataFileCheckModuleFileNoUse": "MetaDataFileCheckModuleFileNoUse"= ,=0D + "MetaDataFileCheckModuleFilePcdFormat": "MetaDataFileCheckModuleFilePc= dFormat",=0D + "MetaDataFileCheckModuleFilePpiFormat": "MetaDataFileCheckModuleFilePp= iFormat",=0D + "MetaDataFileCheckModuleFileProtocolFormat": "MetaDataFileCheckModuleF= ileProtocolFormat",=0D + "MetaDataFileCheckPathName": "MetaDataFileCheckPathName",=0D + "MetaDataFileCheckPathOfGenerateFileList": "MetaDataFileCheckPathOfGen= erateFileList",=0D + "MetaDataFileCheckPcdDuplicate": "MetaDataFileCheckPcdDuplicate",=0D + "MetaDataFileCheckPcdFlash": "MetaDataFileCheckPcdFlash",=0D + "MetaDataFileCheckPcdNoUse": "MetaDataFileCheckPcdNoUse",=0D + "MetaDataFileCheckPcdType": "MetaDataFileCheckPcdType",=0D + "NamingConventionCheckAll": "NamingConventionCheckAll",=0D + "NamingConventionCheckDefineStatement": "NamingConventionCheckDefineSt= atement",=0D + "NamingConventionCheckFunctionName": "NamingConventionCheckFunctionNam= e",=0D + "NamingConventionCheckIfndefStatement": "NamingConventionCheckIfndefSt= atement",=0D + "NamingConventionCheckPathName": "NamingConventionCheckPathName",=0D + "NamingConventionCheckSingleCharacterVariable": "NamingConventionCheck= SingleCharacterVariable",=0D + "NamingConventionCheckTypedefStatement": "NamingConventionCheckTypedef= Statement",=0D + "NamingConventionCheckVariableName": "NamingConventionCheckVariableNam= e",=0D + "PredicateExpressionCheckAll": "PredicateExpressionCheckAll",=0D + "PredicateExpressionCheckBooleanValue": "PredicateExpressionCheckBoole= anValue",=0D + "PredicateExpressionCheckComparisonNullType": "PredicateExpressionChec= kComparisonNullType",=0D + "PredicateExpressionCheckNonBooleanOperator": "PredicateExpressionChec= kNonBooleanOperator",=0D + "ScanOnlyDirList": "ScanOnlyDirList",=0D + "SkipDirList": "SkipDirList",=0D + "SkipFileList": "SkipFileList",=0D + "SmmCommParaCheckAll": "SmmCommParaCheckAll",=0D + "SmmCommParaCheckBufferType": "SmmCommParaCheckBufferType",=0D + "SpaceCheckAll": "SpaceCheckAll",=0D + "SpellingCheckAll": "SpellingCheckAll",=0D + "TokenReleaceList": "TokenReleaceList",=0D + "UniCheckAll": "UniCheckAll",=0D + "UniCheckHelpInfo": "UniCheckHelpInfo",=0D + "UniCheckPCDInfo": "UniCheckPCDInfo",=0D + "Version": "Version"=0D +}=0D =0D -## Configuration=0D +# Configuration=0D #=0D # This class is used to define all items in configuration file=0D #=0D # @param Filename: The name of configuration file, the default is config.= ini=0D #=0D +=0D +=0D class Configuration(object):=0D def __init__(self, Filename):=0D self.Filename =3D Filename=0D =0D self.Version =3D 0.1=0D =0D - ## Identify to if check all items=0D + # Identify to if check all items=0D # 1 - Check all items and ignore all other detailed items=0D # 0 - Not check all items, the tool will go through all other deta= iled items to decide to check or not=0D #=0D self.CheckAll =3D 0=0D =0D - ## Identify to if automatically correct mistakes=0D + # Identify to if automatically correct mistakes=0D # 1 - Automatically correct=0D # 0 - Not automatically correct=0D # Only the following check points can be automatically corrected, = others not listed below are not supported even it is 1=0D @@ -156,7 +158,7 @@ class Configuration(object): # Defaultly use the definition in class DataType=0D self.ModifierSet =3D MODIFIER_SET=0D =0D - ## General Checking=0D + # General Checking=0D self.GeneralCheckAll =3D 0=0D =0D # Check whether NO Tab is used, replaced with spaces=0D @@ -190,10 +192,10 @@ class Configuration(object): =0D self.CFunctionLayoutCheckNoDeprecated =3D 1=0D =0D - ## Space Checking=0D + # Space Checking=0D self.SpaceCheckAll =3D 1=0D =0D - ## Predicate Expression Checking=0D + # Predicate Expression Checking=0D self.PredicateExpressionCheckAll =3D 0=0D =0D # Check whether Boolean values, variable type BOOLEAN not use expl= icit comparisons to TRUE or FALSE=0D @@ -203,7 +205,7 @@ class Configuration(object): # Check whether a comparison of any pointer to zero must be done v= ia the NULL type=0D self.PredicateExpressionCheckComparisonNullType =3D 1=0D =0D - ## Headers Checking=0D + # Headers Checking=0D self.HeaderCheckAll =3D 0=0D =0D # Check whether File header exists=0D @@ -219,7 +221,7 @@ class Configuration(object): # Check whether C File header Comment have the License immediately= after the ""Copyright"" line=0D self.HeaderCheckCFileCommentLicenseFormat =3D 1=0D =0D - ## C Function Layout Checking=0D + # C Function Layout Checking=0D self.CFunctionLayoutCheckAll =3D 0=0D =0D # Check whether return type exists and in the first line=0D @@ -240,10 +242,10 @@ class Configuration(object): # Check whether no use of STATIC for functions=0D self.CFunctionLayoutCheckNoStatic =3D 1=0D =0D - ## Include Files Checking=0D + # Include Files Checking=0D self.IncludeFileCheckAll =3D 0=0D =0D - #Check whether having include files with same name=0D + # Check whether having include files with same name=0D self.IncludeFileCheckSameName =3D 1=0D # Check whether all include file contents is guarded by a #ifndef = statement.=0D # the #ifndef must be the first line of code following the file he= ader comment=0D @@ -253,7 +255,7 @@ class Configuration(object): # Check whether include files NOT contain code or define data vari= ables=0D self.IncludeFileCheckData =3D 1=0D =0D - ## Declarations and Data Types Checking=0D + # Declarations and Data Types Checking=0D self.DeclarationDataTypeCheckAll =3D 0=0D =0D # Check whether no use of int, unsigned, char, void, long in any .= c, .h or .asl files.=0D @@ -271,7 +273,7 @@ class Configuration(object): # Check whether Union Type has a 'typedef' and the name is capital= =0D self.DeclarationDataTypeCheckUnionType =3D 1=0D =0D - ## Naming Conventions Checking=0D + # Naming Conventions Checking=0D self.NamingConventionCheckAll =3D 0=0D =0D # Check whether only capital letters are used for #define declarat= ions=0D @@ -293,7 +295,7 @@ class Configuration(object): # Check whether NO use short variable name with single character=0D self.NamingConventionCheckSingleCharacterVariable =3D 1=0D =0D - ## Doxygen Checking=0D + # Doxygen Checking=0D self.DoxygenCheckAll =3D 0=0D =0D # Check whether the file headers are followed Doxygen special docu= mentation blocks in section 2.3.5=0D @@ -308,7 +310,7 @@ class Configuration(object): # Check whether only Doxygen commands allowed to mark the code are= @bug and @todo.=0D self.DoxygenCheckCommand =3D 1=0D =0D - ## Meta-Data File Processing Checking=0D + # Meta-Data File Processing Checking=0D self.MetaDataFileCheckAll =3D 0=0D =0D # Check whether each file defined in meta-data exists=0D @@ -398,7 +400,8 @@ class Configuration(object): Filepath =3D os.path.normpath(self.Filename)=0D if not os.path.isfile(Filepath):=0D ErrorMsg =3D "Can't find configuration file '%s'" % Filepath=0D - EdkLogger.error("Ecc", EdkLogger.ECC_ERROR, ErrorMsg, File =3D= Filepath)=0D + EdkLogger.error("Ecc", EdkLogger.ECC_ERROR,=0D + ErrorMsg, File=3DFilepath)=0D =0D LineNo =3D 0=0D for Line in open(Filepath, 'r'):=0D @@ -408,8 +411,10 @@ class Configuration(object): List =3D GetSplitValueList(Line, TAB_EQUAL_SPLIT)=0D if List[0] not in _ConfigFileToInternalTranslation:=0D ErrorMsg =3D "Invalid configuration option '%s' was fo= und" % List[0]=0D - EdkLogger.error("Ecc", EdkLogger.ECC_ERROR, ErrorMsg, = File =3D Filepath, Line =3D LineNo)=0D - assert _ConfigFileToInternalTranslation[List[0]] in self._= _dict__=0D + EdkLogger.error("Ecc", EdkLogger.ECC_ERROR,=0D + ErrorMsg, File=3DFilepath, Line=3DLine= No)=0D + assert _ConfigFileToInternalTranslation[List[0]=0D + ] in self.__dict__= =0D if List[0] =3D=3D 'ModifierList':=0D List[1] =3D GetSplitValueList(List[1], TAB_COMMA_SPLIT= )=0D if List[0] =3D=3D 'MetaDataFileCheckPathOfGenerateFileList= ' and List[1] =3D=3D "":=0D @@ -424,13 +429,15 @@ class Configuration(object): List[1] =3D GetSplitValueList(List[1], TAB_COMMA_SPLIT= )=0D if List[0] =3D=3D 'TokenReleaceList':=0D List[1] =3D GetSplitValueList(List[1], TAB_COMMA_SPLIT= )=0D - self.__dict__[_ConfigFileToInternalTranslation[List[0]]] = =3D List[1]=0D + self.__dict__[=0D + _ConfigFileToInternalTranslation[List[0]]] =3D List[1]= =0D =0D def ShowMe(self):=0D print(self.Filename)=0D for Key in self.__dict__.keys():=0D print(Key, '=3D', self.__dict__[Key])=0D =0D +=0D #=0D # test that our dict and out class still match in contents.=0D #=0D diff --git a/BaseTools/Source/Python/Ecc/Database.py b/BaseTools/Source/Pyt= hon/Ecc/Database.py index a5b70c52029b..c567dfbd04cf 100644 --- a/BaseTools/Source/Python/Ecc/Database.py +++ b/BaseTools/Source/Python/Ecc/Database.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by ECC tool=0D #=0D # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,8 @@ #=0D from __future__ import absolute_import=0D import sqlite3=0D -import Common.LongFilePathOs as os, time=0D +import Common.LongFilePathOs as os=0D +import time=0D =0D import Common.EdkLogger as EdkLogger=0D import CommonDataClass.DataClass as DataClass=0D @@ -31,7 +32,7 @@ from Table.TableFdf import TableFdf #=0D DATABASE_PATH =3D "Ecc.db"=0D =0D -## Database=0D +# Database=0D #=0D # This class defined the ECC database=0D # During the phase of initialization, the database will create all tables = and=0D @@ -44,6 +45,8 @@ DATABASE_PATH =3D "Ecc.db" # @var Cur: Cursor of the connection=0D # @var TblDataModel: Local instance for TableDataModel=0D #=0D +=0D +=0D class Database(object):=0D def __init__(self, DbPath):=0D self.DbPath =3D DbPath=0D @@ -60,13 +63,13 @@ class Database(object): self.TblDsc =3D None=0D self.TblFdf =3D None=0D =0D - ## Initialize ECC database=0D + # Initialize ECC database=0D #=0D # 1. Delete all old existing tables=0D # 2. Create new tables=0D # 3. Initialize table DataModel=0D #=0D - def InitDatabase(self, NewDatabase =3D True):=0D + def InitDatabase(self, NewDatabase=3DTrue):=0D EdkLogger.verbose("\nInitialize ECC database started ...")=0D #=0D # Drop all old existing tables=0D @@ -74,7 +77,7 @@ class Database(object): if NewDatabase:=0D if os.path.exists(self.DbPath):=0D os.remove(self.DbPath)=0D - self.Conn =3D sqlite3.connect(self.DbPath, isolation_level =3D 'DE= FERRED')=0D + self.Conn =3D sqlite3.connect(self.DbPath, isolation_level=3D'DEFE= RRED')=0D self.Conn.execute("PRAGMA page_size=3D4096")=0D self.Conn.execute("PRAGMA synchronous=3DOFF")=0D # to avoid non-ascii character conversion error=0D @@ -127,14 +130,14 @@ class Database(object): =0D EdkLogger.verbose("Initialize ECC database ... DONE!")=0D =0D - ## Query a table=0D + # Query a table=0D #=0D # @param Table: The instance of the table to be queried=0D #=0D def QueryTable(self, Table):=0D Table.Query()=0D =0D - ## Close entire database=0D + # Close entire database=0D #=0D # Commit all first=0D # Close the connection and cursor=0D @@ -151,7 +154,7 @@ class Database(object): self.Cur.close()=0D self.Conn.close()=0D =0D - ## Insert one file information=0D + # Insert one file information=0D #=0D # Insert one file's information to the database=0D # 1. Create a record in TableFile=0D @@ -165,7 +168,8 @@ class Database(object): #=0D # Insert a record for file=0D #=0D - FileID =3D self.TblFile.Insert(File.Name, File.ExtName, File.Path,= File.FullPath, Model =3D File.Model, TimeStamp =3D File.TimeStamp)=0D + FileID =3D self.TblFile.Insert(=0D + File.Name, File.ExtName, File.Path, File.FullPath, Model=3DFil= e.Model, TimeStamp=3DFile.TimeStamp)=0D =0D if File.Model =3D=3D DataClass.MODEL_FILE_C or File.Model =3D=3D D= ataClass.MODEL_FILE_H:=0D IdTable =3D TableIdentifier(self.Cur)=0D @@ -175,47 +179,49 @@ class Database(object): # Insert function of file=0D #=0D for Function in File.FunctionList:=0D - FunctionID =3D self.TblFunction.Insert(Function.Header, Fu= nction.Modifier, Function.Name, Function.ReturnStatement, \=0D - Function.StartLine, Function.Start= Column, Function.EndLine, Function.EndColumn, \=0D - Function.BodyStartLine, Function.B= odyStartColumn, FileID, \=0D - Function.FunNameStartLine, Functio= n.FunNameStartColumn)=0D + FunctionID =3D self.TblFunction.Insert(Function.Header, Fu= nction.Modifier, Function.Name, Function.ReturnStatement,=0D + Function.StartLine, F= unction.StartColumn, Function.EndLine, Function.EndColumn,=0D + Function.BodyStartLin= e, Function.BodyStartColumn, FileID,=0D + Function.FunNameStart= Line, Function.FunNameStartColumn)=0D #=0D # Insert Identifier of function=0D #=0D for Identifier in Function.IdentifierList:=0D - IdentifierID =3D IdTable.Insert(Identifier.Modifier, I= dentifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \=0D - FileID, FunctionID, Identifier= .StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColum= n)=0D + IdentifierID =3D IdTable.Insert(Identifier.Modifier, I= dentifier.Type, Identifier.Name, Identifier.Value, Identifier.Model,=0D + FileID, FunctionID, Iden= tifier.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.En= dColumn)=0D #=0D # Insert Pcd of function=0D #=0D for Pcd in Function.PcdList:=0D - PcdID =3D self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpace= GuidCName, Pcd.Token, Pcd.DatumType, Pcd.Model, \=0D - FileID, FunctionID, Pcd.StartLine, = Pcd.StartColumn, Pcd.EndLine, Pcd.EndColumn)=0D + PcdID =3D self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpace= GuidCName, Pcd.Token, Pcd.DatumType, Pcd.Model,=0D + FileID, FunctionID, Pcd.Sta= rtLine, Pcd.StartColumn, Pcd.EndLine, Pcd.EndColumn)=0D #=0D # Insert Identifier of file=0D #=0D for Identifier in File.IdentifierList:=0D - IdentifierID =3D IdTable.Insert(Identifier.Modifier, Ident= ifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \=0D - FileID, -1, Identifier.StartLine, = Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)=0D + IdentifierID =3D IdTable.Insert(Identifier.Modifier, Ident= ifier.Type, Identifier.Name, Identifier.Value, Identifier.Model,=0D + FileID, -1, Identifier.Start= Line, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)=0D #=0D # Insert Pcd of file=0D #=0D for Pcd in File.PcdList:=0D - PcdID =3D self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpaceGuid= CName, Pcd.Token, Pcd.DatumType, Pcd.Model, \=0D - FileID, -1, Pcd.StartLine, Pcd.StartCol= umn, Pcd.EndLine, Pcd.EndColumn)=0D + PcdID =3D self.TblPcd.Insert(Pcd.CName, Pcd.TokenSpaceGuid= CName, Pcd.Token, Pcd.DatumType, Pcd.Model,=0D + FileID, -1, Pcd.StartLine, Pcd.= StartColumn, Pcd.EndLine, Pcd.EndColumn)=0D =0D - EdkLogger.verbose("Insert information from file %s ... DONE!" % Fi= le.FullPath)=0D + EdkLogger.verbose(=0D + "Insert information from file %s ... DONE!" % File.FullPath)=0D =0D - ## UpdateIdentifierBelongsToFunction=0D + # UpdateIdentifierBelongsToFunction=0D #=0D # Update the field "BelongsToFunction" for each Identifier=0D #=0D #=0D def UpdateIdentifierBelongsToFunction_disabled(self):=0D - EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers star= ted ...")=0D + EdkLogger.verbose(=0D + "Update 'BelongsToFunction' for Identifiers started ...")=0D =0D SqlCommand =3D """select ID, BelongsToFile, StartLine, EndLine, Mo= del from Identifier"""=0D - EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)=0D + EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)=0D self.Cur.execute(SqlCommand)=0D Records =3D self.Cur.fetchall()=0D for Record in Records:=0D @@ -232,12 +238,13 @@ class Database(object): SqlCommand =3D """select ID from Function=0D where StartLine < %s and EndLine > %s=0D and BelongsToFile =3D %s""" % (StartLine, EndLine,= BelongsToFile)=0D - EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)=0D + EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)=0D self.Cur.execute(SqlCommand)=0D IDs =3D self.Cur.fetchall()=0D for ID in IDs:=0D - SqlCommand =3D """Update Identifier set BelongsToFunction = =3D %s where ID =3D %s""" % (ID[0], IdentifierID)=0D - EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)=0D + SqlCommand =3D """Update Identifier set BelongsToFunction = =3D %s where ID =3D %s""" % (=0D + ID[0], IdentifierID)=0D + EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)=0D self.Cur.execute(SqlCommand)=0D =0D #=0D @@ -248,24 +255,27 @@ class Database(object): SqlCommand =3D """select ID from Function=0D where StartLine =3D %s + 1=0D and BelongsToFile =3D %s""" % (EndLine, BelongsToF= ile)=0D - EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)=0D + EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)=0D self.Cur.execute(SqlCommand)=0D IDs =3D self.Cur.fetchall()=0D for ID in IDs:=0D - SqlCommand =3D """Update Identifier set BelongsToFunct= ion =3D %s, Model =3D %s where ID =3D %s""" % (ID[0], DataClass.MODEL_IDENT= IFIER_FUNCTION_HEADER, IdentifierID)=0D - EdkLogger.debug(4, "SqlCommand: %s" %SqlCommand)=0D + SqlCommand =3D """Update Identifier set BelongsToFunct= ion =3D %s, Model =3D %s where ID =3D %s""" % (=0D + ID[0], DataClass.MODEL_IDENTIFIER_FUNCTION_HEADER,= IdentifierID)=0D + EdkLogger.debug(4, "SqlCommand: %s" % SqlCommand)=0D self.Cur.execute(SqlCommand)=0D =0D - EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers ... = DONE")=0D + EdkLogger.verbose(=0D + "Update 'BelongsToFunction' for Identifiers ... DONE")=0D =0D -=0D - ## UpdateIdentifierBelongsToFunction=0D + # UpdateIdentifierBelongsToFunction=0D #=0D # Update the field "BelongsToFunction" for each Identifier=0D #=0D #=0D +=0D def UpdateIdentifierBelongsToFunction(self):=0D - EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers star= ted ...")=0D + EdkLogger.verbose(=0D + "Update 'BelongsToFunction' for Identifiers started ...")=0D =0D SqlCommand =3D """select ID, BelongsToFile, StartLine, EndLine fro= m Function"""=0D Records =3D self.TblFunction.Exec(SqlCommand)=0D @@ -280,11 +290,12 @@ class Database(object): #Data2.append(("'file%s'" % BelongsToFile, FunctionID, DataCla= ss.MODEL_IDENTIFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIF= IER_COMMENT, StartLine - 1))=0D =0D SqlCommand =3D """Update Identifier%s set BelongsToFunction = =3D %s where BelongsToFile =3D %s and StartLine > %s and EndLine < %s""" % = \=0D - (BelongsToFile, FunctionID, BelongsToFile, StartLi= ne, EndLine)=0D + (BelongsToFile, FunctionID, BelongsToFile, StartLine, EndL= ine)=0D self.TblIdentifier.Exec(SqlCommand)=0D =0D SqlCommand =3D """Update Identifier%s set BelongsToFunction = =3D %s, Model =3D %s where BelongsToFile =3D %s and Model =3D %s and EndLin= e =3D %s""" % \=0D - (BelongsToFile, FunctionID, DataClass.MODEL_IDENT= IFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMENT, S= tartLine - 1)=0D + (BelongsToFile, FunctionID, DataClass.MODEL_IDENT= IFIER_FUNCTION_HEADER,=0D + BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMEN= T, StartLine - 1)=0D self.TblIdentifier.Exec(SqlCommand)=0D # #=0D # # Check whether an identifier belongs to a function=0D @@ -313,20 +324,27 @@ class Database(object): #=0D if __name__ =3D=3D '__main__':=0D EdkLogger.Initialize()=0D - #EdkLogger.SetLevel(EdkLogger.VERBOSE)=0D + # EdkLogger.SetLevel(EdkLogger.VERBOSE)=0D EdkLogger.SetLevel(EdkLogger.DEBUG_0)=0D - EdkLogger.verbose("Start at " + time.strftime('%H:%M:%S', time.localti= me()))=0D + EdkLogger.verbose(=0D + "Start at " + time.strftime('%H:%M:%S', time.localtime()))=0D =0D Db =3D Database(DATABASE_PATH)=0D Db.InitDatabase()=0D Db.QueryTable(Db.TblDataModel)=0D =0D - identifier1 =3D DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa', D= ataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 32, 43, 54, 43)=0D - identifier2 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', Dat= aClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 15, 43, 20, 43)=0D - identifier3 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', Dat= aClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 55, 43, 58, 43)=0D - identifier4 =3D DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa', Da= taClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 77, 43, 88, 43)=0D - fun1 =3D DataClass.FunctionClass(-1, '', '', 'fun1', '', 21, 2, 60, 4= 5, 1, 23, 0, [], [])=0D - file =3D DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', Data= Class.MODEL_FILE_C, '2007-12-28', [fun1], [identifier1, identifier2, identi= fier3, identifier4], [])=0D + identifier1 =3D DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 32, 43, 54, 43)=0D + identifier2 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 15, 43, 20, 43)=0D + identifier3 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 55, 43, 58, 43)=0D + identifier4 =3D DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 77, 43, 88, 43)=0D + fun1 =3D DataClass.FunctionClass(-1, '', '',=0D + 'fun1', '', 21, 2, 60, 45, 1, 23, 0, [= ], [])=0D + file =3D DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', Data= Class.MODEL_FILE_C,=0D + '2007-12-28', [fun1], [identifier1, identif= ier2, identifier3, identifier4], [])=0D Db.InsertOneFile(file)=0D Db.UpdateIdentifierBelongsToFunction()=0D =0D @@ -337,4 +355,3 @@ if __name__ =3D=3D '__main__': =0D Db.Close()=0D EdkLogger.verbose("End at " + time.strftime('%H:%M:%S', time.localtime= ()))=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/EccGlobalData.py b/BaseTools/Sourc= e/Python/Ecc/EccGlobalData.py index 89036dba071b..b9093d17664d 100644 --- a/BaseTools/Source/Python/Ecc/EccGlobalData.py +++ b/BaseTools/Source/Python/Ecc/EccGlobalData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to save global datas used by ECC tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Pyth= on/Ecc/EccMain.py index a349cd80147f..c5c715901ad3 100644 --- a/BaseTools/Source/Python/Ecc/EccMain.py +++ b/BaseTools/Source/Python/Ecc/EccMain.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to be the main entrance of ECC tool=0D #=0D # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,10 @@ # Import Modules=0D #=0D from __future__ import absolute_import=0D -import Common.LongFilePathOs as os, time, glob, sys=0D +import Common.LongFilePathOs as os=0D +import time=0D +import glob=0D +import sys=0D import Common.EdkLogger as EdkLogger=0D from Ecc import Database=0D from Ecc import EccGlobalData=0D @@ -31,17 +34,20 @@ from Ecc.MetaFileWorkspace.MetaFileParser import InfPar= ser from Ecc.MetaFileWorkspace.MetaFileParser import Fdf=0D from Ecc.MetaFileWorkspace.MetaFileTable import MetaFileStorage=0D from Ecc import c=0D -import re, string=0D +import re=0D +import string=0D from Ecc.Exception import *=0D from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## Ecc=0D +# Ecc=0D #=0D # This class is used to define Ecc main entrance=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class Ecc(object):=0D def __init__(self):=0D # Version and Copyright=0D @@ -61,9 +67,11 @@ class Ecc(object): =0D # Parse the options and args=0D self.ParseOption()=0D - EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime= ()) + "[00:00]" + "\n")=0D + EdkLogger.info(time.strftime("%H:%M:%S, %b.%d %Y ",=0D + time.localtime()) + "[00:00]" + "\n")=0D =0D - WorkspaceDir =3D os.path.normcase(os.path.normpath(os.environ["WOR= KSPACE"]))=0D + WorkspaceDir =3D os.path.normcase(=0D + os.path.normpath(os.environ["WORKSPACE"]))=0D os.environ["WORKSPACE"] =3D WorkspaceDir=0D =0D # set multiple workspace=0D @@ -72,7 +80,7 @@ class Ecc(object): =0D GlobalData.gWorkspace =3D WorkspaceDir=0D =0D - GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir=0D + GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir=0D =0D EdkLogger.info("Loading ECC configuration ... done")=0D # Generate checkpoints list=0D @@ -112,11 +120,11 @@ class Ecc(object): return=0D self.ConfigFile =3D 'config.ini'=0D =0D -=0D - ## DetectOnlyScan=0D + # DetectOnlyScan=0D #=0D # Detect whether only scanned folders have been enabled=0D #=0D +=0D def DetectOnlyScanDirs(self):=0D if self.OnlyScan =3D=3D True:=0D OnlyScanDirs =3D []=0D @@ -126,16 +134,17 @@ class Ecc(object): if len(OnlyScanDirs) !=3D 0:=0D self.BuildDatabase(OnlyScanDirs)=0D else:=0D - EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID= , ExtraData=3D"Use -f option need to fill specific folders in config.ini fi= le")=0D + EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID= ,=0D + ExtraData=3D"Use -f option need to fill sp= ecific folders in config.ini file")=0D else:=0D self.BuildDatabase()=0D =0D -=0D - ## BuildDatabase=0D + # BuildDatabase=0D #=0D # Build the database for target=0D #=0D - def BuildDatabase(self, SpeciDirs =3D None):=0D +=0D + def BuildDatabase(self, SpeciDirs=3DNone):=0D # Clean report table=0D EccGlobalData.gDb.TblReport.Drop()=0D EccGlobalData.gDb.TblReport.Create()=0D @@ -151,27 +160,32 @@ class Ecc(object): c.CollectSourceCodeDataIntoDB(EccGlobalData.gTarget)=0D else:=0D for specificDir in SpeciDirs:=0D - c.CollectSourceCodeDataIntoDB(os.path.join(EccGlob= alData.gTarget, specificDir))=0D + c.CollectSourceCodeDataIntoDB(=0D + os.path.join(EccGlobalData.gTarget, specificDi= r))=0D =0D - EccGlobalData.gIdentifierTableList =3D GetTableList((MODEL_FILE_C,= MODEL_FILE_H), 'Identifier', EccGlobalData.gDb)=0D + EccGlobalData.gIdentifierTableList =3D GetTableList(=0D + (MODEL_FILE_C, MODEL_FILE_H), 'Identifier', EccGlobalData.gDb)= =0D EccGlobalData.gCFileList =3D GetFileList(MODEL_FILE_C, EccGlobalDa= ta.gDb)=0D EccGlobalData.gHFileList =3D GetFileList(MODEL_FILE_H, EccGlobalDa= ta.gDb)=0D - EccGlobalData.gUFileList =3D GetFileList(MODEL_FILE_UNI, EccGlobal= Data.gDb)=0D + EccGlobalData.gUFileList =3D GetFileList(=0D + MODEL_FILE_UNI, EccGlobalData.gDb)=0D =0D - ## BuildMetaDataFileDatabase=0D + # BuildMetaDataFileDatabase=0D #=0D # Build the database for meta data files=0D #=0D - def BuildMetaDataFileDatabase(self, SpecificDirs =3D None):=0D + def BuildMetaDataFileDatabase(self, SpecificDirs=3DNone):=0D ScanFolders =3D []=0D if SpecificDirs is None:=0D ScanFolders.append(EccGlobalData.gTarget)=0D else:=0D for specificDir in SpecificDirs:=0D - ScanFolders.append(os.path.join(EccGlobalData.gTarget, spe= cificDir))=0D + ScanFolders.append(os.path.join(=0D + EccGlobalData.gTarget, specificDir))=0D EdkLogger.quiet("Building database for meta data files ...")=0D - Op =3D open(EccGlobalData.gConfig.MetaDataFileCheckPathOfGenerateF= ileList, 'w+')=0D - #SkipDirs =3D Read from config file=0D + Op =3D open(=0D + EccGlobalData.gConfig.MetaDataFileCheckPathOfGenerateFileList,= 'w+')=0D + # SkipDirs =3D Read from config file=0D SkipDirs =3D EccGlobalData.gConfig.SkipDirList=0D SkipDirString =3D '|'.join(SkipDirs)=0D # p =3D re.compile(r'.*[\\/](?:%s)[\\/]?.*' % SkipDirString)=0D @@ -195,7 +209,8 @@ class Ecc(object): EdkLogger.quiet("Parsing %s" % Filename)=0D Op.write("%s\r" % Filename)=0D #Dec(Filename, True, True, EccGlobalData.gWorkspac= e, EccGlobalData.gDb)=0D - self.MetaFile =3D DecParser(Filename, MODEL_FILE_D= EC, EccGlobalData.gDb.TblDec)=0D + self.MetaFile =3D DecParser(=0D + Filename, MODEL_FILE_DEC, EccGlobalData.gDb.Tb= lDec)=0D self.MetaFile.Start()=0D continue=0D if len(File) > 4 and File[-4:].upper() =3D=3D ".DSC":= =0D @@ -203,7 +218,8 @@ class Ecc(object): EdkLogger.quiet("Parsing %s" % Filename)=0D Op.write("%s\r" % Filename)=0D #Dsc(Filename, True, True, EccGlobalData.gWorkspac= e, EccGlobalData.gDb)=0D - self.MetaFile =3D DscParser(PathClass(Filename, Ro= ot), MODEL_FILE_DSC, MetaFileStorage(EccGlobalData.gDb.TblDsc.Cur, Filename= , MODEL_FILE_DSC, True))=0D + self.MetaFile =3D DscParser(PathClass(Filename, Ro= ot), MODEL_FILE_DSC, MetaFileStorage(=0D + EccGlobalData.gDb.TblDsc.Cur, Filename, MODEL_= FILE_DSC, True))=0D # always do post-process, in case of macros change= =0D self.MetaFile.DoPostProcess()=0D self.MetaFile.Start()=0D @@ -214,21 +230,25 @@ class Ecc(object): EdkLogger.quiet("Parsing %s" % Filename)=0D Op.write("%s\r" % Filename)=0D #Inf(Filename, True, True, EccGlobalData.gWorkspac= e, EccGlobalData.gDb)=0D - self.MetaFile =3D InfParser(Filename, MODEL_FILE_I= NF, EccGlobalData.gDb.TblInf)=0D + self.MetaFile =3D InfParser(=0D + Filename, MODEL_FILE_INF, EccGlobalData.gDb.Tb= lInf)=0D self.MetaFile.Start()=0D continue=0D if len(File) > 4 and File[-4:].upper() =3D=3D ".FDF":= =0D Filename =3D os.path.normpath(os.path.join(Root, F= ile))=0D EdkLogger.quiet("Parsing %s" % Filename)=0D Op.write("%s\r" % Filename)=0D - Fdf(Filename, True, EccGlobalData.gWorkspace, EccG= lobalData.gDb)=0D + Fdf(Filename, True, EccGlobalData.gWorkspace,=0D + EccGlobalData.gDb)=0D continue=0D if len(File) > 4 and File[-4:].upper() =3D=3D ".UNI":= =0D Filename =3D os.path.normpath(os.path.join(Root, F= ile))=0D EdkLogger.quiet("Parsing %s" % Filename)=0D Op.write("%s\r" % Filename)=0D - FileID =3D EccGlobalData.gDb.TblFile.InsertFile(Fi= lename, MODEL_FILE_UNI)=0D - EccGlobalData.gDb.TblReport.UpdateBelongsToItemByF= ile(FileID, File)=0D + FileID =3D EccGlobalData.gDb.TblFile.InsertFile(=0D + Filename, MODEL_FILE_UNI)=0D + EccGlobalData.gDb.TblReport.UpdateBelongsToItemByF= ile(=0D + FileID, File)=0D continue=0D =0D Op.close()=0D @@ -292,7 +312,7 @@ class Ecc(object): =0D return RealPath=0D =0D - ## ParseOption=0D + # ParseOption=0D #=0D # Parse options=0D #=0D @@ -309,7 +329,8 @@ class Ecc(object): else:=0D EccGlobalData.gWorkspace =3D os.path.normpath(os.getenv("WORKS= PACE"))=0D if not os.path.exists(EccGlobalData.gWorkspace):=0D - EdkLogger.error("ECC", BuildToolError.FILE_NOT_FOUND, Extr= aData=3D"WORKSPACE =3D %s" % EccGlobalData.gWorkspace)=0D + EdkLogger.error("ECC", BuildToolError.FILE_NOT_FOUND,=0D + ExtraData=3D"WORKSPACE =3D %s" % EccGlobal= Data.gWorkspace)=0D os.environ["WORKSPACE"] =3D EccGlobalData.gWorkspace=0D # Set log level=0D self.SetLogLevel(Options)=0D @@ -325,16 +346,20 @@ class Ecc(object): self.ExceptionFile =3D Options.ExceptionFile=0D if Options.Target is not None:=0D if not os.path.isdir(Options.Target):=0D - EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID= , ExtraData=3D"Target [%s] does NOT exist" % Options.Target)=0D + EdkLogger.error("ECC", BuildToolError.OPTION_VALUE_INVALID= ,=0D + ExtraData=3D"Target [%s] does NOT exist" %= Options.Target)=0D else:=0D - EccGlobalData.gTarget =3D self.GetRealPathCase(os.path.nor= mpath(Options.Target))=0D + EccGlobalData.gTarget =3D self.GetRealPathCase(=0D + os.path.normpath(Options.Target))=0D else:=0D - EdkLogger.warn("Ecc", EdkLogger.ECC_ERROR, "The target source = tree was not specified, using current WORKSPACE instead!")=0D + EdkLogger.warn("Ecc", EdkLogger.ECC_ERROR,=0D + "The target source tree was not specified, usin= g current WORKSPACE instead!")=0D EccGlobalData.gTarget =3D os.path.normpath(os.getenv("WORKSPAC= E"))=0D if Options.keepdatabase is not None:=0D self.IsInit =3D False=0D if Options.metadata is not None and Options.sourcecode is not None= :=0D - EdkLogger.error("ECC", BuildToolError.OPTION_CONFLICT, ExtraDa= ta=3D"-m and -s can't be specified at one time")=0D + EdkLogger.error("ECC", BuildToolError.OPTION_CONFLICT,=0D + ExtraData=3D"-m and -s can't be specified at o= ne time")=0D if Options.metadata is not None:=0D self.ScanSourceCode =3D False=0D if Options.sourcecode is not None:=0D @@ -342,7 +367,7 @@ class Ecc(object): if Options.folders is not None:=0D self.OnlyScan =3D True=0D =0D - ## SetLogLevel=0D + # SetLogLevel=0D #=0D # Set current log level of the tool based on args=0D #=0D @@ -358,7 +383,7 @@ class Ecc(object): else:=0D EdkLogger.SetLevel(EdkLogger.INFO)=0D =0D - ## Parse command line options=0D + # Parse command line options=0D #=0D # Using standard Python module optparse to parse command line option o= f this tool.=0D #=0D @@ -366,37 +391,46 @@ class Ecc(object): # @retval Args Target of build command=0D #=0D def EccOptionParser(self):=0D - Parser =3D OptionParser(description =3D self.Copyright, version = =3D self.Version, prog =3D "Ecc.exe", usage =3D "%prog [options]")=0D + Parser =3D OptionParser(description=3Dself.Copyright,=0D + version=3Dself.Version, prog=3D"Ecc.exe", us= age=3D"%prog [options]")=0D Parser.add_option("-t", "--target sourcepath", action=3D"store", t= ype=3D"string", dest=3D'Target',=0D - help=3D"Check all files under the target workspace.")=0D + help=3D"Check all files under the target workspa= ce.")=0D Parser.add_option("-c", "--config filename", action=3D"store", typ= e=3D"string", dest=3D"ConfigFile",=0D - help=3D"Specify a configuration file. Defaultly use config.ini= under ECC tool directory.")=0D + help=3D"Specify a configuration file. Defaultly = use config.ini under ECC tool directory.")=0D Parser.add_option("-o", "--outfile filename", action=3D"store", ty= pe=3D"string", dest=3D"OutputFile",=0D - help=3D"Specify the name of an output file, if and only if one= filename was specified.")=0D + help=3D"Specify the name of an output file, if a= nd only if one filename was specified.")=0D Parser.add_option("-r", "--reportfile filename", action=3D"store",= type=3D"string", dest=3D"ReportFile",=0D - help=3D"Specify the name of an report file, if and only if one= filename was specified.")=0D + help=3D"Specify the name of an report file, if a= nd only if one filename was specified.")=0D Parser.add_option("-e", "--exceptionfile filename", action=3D"stor= e", type=3D"string", dest=3D"ExceptionFile",=0D - help=3D"Specify the name of an exception file, if and only if = one filename was specified.")=0D - Parser.add_option("-m", "--metadata", action=3D"store_true", type= =3DNone, help=3D"Only scan meta-data files information if this option is sp= ecified.")=0D - Parser.add_option("-s", "--sourcecode", action=3D"store_true", typ= e=3DNone, help=3D"Only scan source code files information if this option is= specified.")=0D - Parser.add_option("-k", "--keepdatabase", action=3D"store_true", t= ype=3DNone, help=3D"The existing Ecc database will not be cleaned except re= port information if this option is specified.")=0D + help=3D"Specify the name of an exception file, i= f and only if one filename was specified.")=0D + Parser.add_option("-m", "--metadata", action=3D"store_true", type= =3DNone,=0D + help=3D"Only scan meta-data files information if= this option is specified.")=0D + Parser.add_option("-s", "--sourcecode", action=3D"store_true", typ= e=3DNone,=0D + help=3D"Only scan source code files information = if this option is specified.")=0D + Parser.add_option("-k", "--keepdatabase", action=3D"store_true", t= ype=3DNone,=0D + help=3D"The existing Ecc database will not be cl= eaned except report information if this option is specified.")=0D Parser.add_option("-l", "--log filename", action=3D"store", dest= =3D"LogFile", help=3D"""If specified, the tool should emit the changes that= =0D = were made by the tool after printing the result message.=0D = If filename, the emit to the file, otherwise emit to=0D = standard output. If no modifications were made, then do not= =0D = create a log file, or output a log message.""")=0D - Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DN= one, help=3D"Disable all messages except FATAL ERRORS.")=0D - Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "\=0D - = "including library instances selected, final dependency expression= , "\=0D - = "and warning messages, etc.")=0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= help=3D"Enable debug messages at specified level.")=0D - Parser.add_option("-w", "--workspace", action=3D"store", type=3D"s= tring", dest=3D'Workspace', help=3D"Specify workspace.")=0D - Parser.add_option("-f", "--folders", action=3D"store_true", type= =3DNone, help=3D"Only scanning specified folders which are recorded in conf= ig.ini file.")=0D + Parser.add_option("-q", "--quiet", action=3D"store_true",=0D + type=3DNone, help=3D"Disable all messages except= FATAL ERRORS.")=0D + Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "=0D + "including library instances selected, final dep= endency expression, "=0D + "and warning messages, etc.")=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= =0D + help=3D"Enable debug messages at specified level= .")=0D + Parser.add_option("-w", "--workspace", action=3D"store",=0D + type=3D"string", dest=3D'Workspace', help=3D"Spe= cify workspace.")=0D + Parser.add_option("-f", "--folders", action=3D"store_true", type= =3DNone,=0D + help=3D"Only scanning specified folders which ar= e recorded in config.ini file.")=0D =0D - (Opt, Args)=3DParser.parse_args()=0D + (Opt, Args) =3D Parser.parse_args()=0D =0D return (Opt, Args)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -411,5 +445,7 @@ if __name__ =3D=3D '__main__': Ecc =3D Ecc()=0D FinishTime =3D time.perf_counter()=0D =0D - BuildDuration =3D time.strftime("%M:%S", time.gmtime(int(round(FinishT= ime - StartTime))))=0D - EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", tim= e.localtime()), BuildDuration))=0D + BuildDuration =3D time.strftime(=0D + "%M:%S", time.gmtime(int(round(FinishTime - StartTime))))=0D + EdkLogger.quiet("\n%s [%s]" % (time.strftime(=0D + "%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))=0D diff --git a/BaseTools/Source/Python/Ecc/EccToolError.py b/BaseTools/Source= /Python/Ecc/EccToolError.py index d97bf7948ce8..0d370f49cd4d 100644 --- a/BaseTools/Source/Python/Ecc/EccToolError.py +++ b/BaseTools/Source/Python/Ecc/EccToolError.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Standardized Error Handling infrastructures.=0D #=0D # Copyright (c) 2021, Arm Limited. All rights reserved.
        =0D @@ -105,101 +105,100 @@ ERROR_SPELLING_CHECK_ALL =3D 11000 ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE =3D 12001=0D =0D gEccErrorMessage =3D {=0D - ERROR_GENERAL_CHECK_ALL : "",=0D - ERROR_GENERAL_CHECK_NO_TAB : "'TAB' character is not allowed in source= code, please replace each 'TAB' with two spaces.",=0D - ERROR_GENERAL_CHECK_INDENTATION : "Indentation does not follow coding = style",=0D - ERROR_GENERAL_CHECK_LINE : "The width of each line does not follow cod= ing style",=0D - ERROR_GENERAL_CHECK_NO_ASM : "There should be no use of _asm in the so= urce file",=0D - ERROR_GENERAL_CHECK_NO_PROGMA : """There should be no use of "#progma"= in source file except "#pragma pack(#)\"""",=0D - ERROR_GENERAL_CHECK_CARRIAGE_RETURN : "There should be a carriage retu= rn at the end of the file",=0D - ERROR_GENERAL_CHECK_FILE_EXISTENCE : "File not found",=0D - ERROR_GENERAL_CHECK_NON_ACSII : "File has invalid Non-ACSII char",=0D - ERROR_GENERAL_CHECK_UNI : "File is not a valid UTF-16 UNI file",=0D - ERROR_GENERAL_CHECK_UNI_HELP_INFO : "UNI file that is associated by IN= F or DEC file need define the prompt and help information.",=0D - ERROR_GENERAL_CHECK_INVALID_LINE_ENDING : "Only CRLF (Carriage Return = Line Feed) is allowed to line ending.",=0D - ERROR_GENERAL_CHECK_TRAILING_WHITE_SPACE_LINE : "There should be no tr= ailing white space in one line.",=0D + ERROR_GENERAL_CHECK_ALL: "",=0D + ERROR_GENERAL_CHECK_NO_TAB: "'TAB' character is not allowed in source = code, please replace each 'TAB' with two spaces.",=0D + ERROR_GENERAL_CHECK_INDENTATION: "Indentation does not follow coding s= tyle",=0D + ERROR_GENERAL_CHECK_LINE: "The width of each line does not follow codi= ng style",=0D + ERROR_GENERAL_CHECK_NO_ASM: "There should be no use of _asm in the sou= rce file",=0D + ERROR_GENERAL_CHECK_NO_PROGMA: """There should be no use of "#progma" = in source file except "#pragma pack(#)\"""",=0D + ERROR_GENERAL_CHECK_CARRIAGE_RETURN: "There should be a carriage retur= n at the end of the file",=0D + ERROR_GENERAL_CHECK_FILE_EXISTENCE: "File not found",=0D + ERROR_GENERAL_CHECK_NON_ACSII: "File has invalid Non-ACSII char",=0D + ERROR_GENERAL_CHECK_UNI: "File is not a valid UTF-16 UNI file",=0D + ERROR_GENERAL_CHECK_UNI_HELP_INFO: "UNI file that is associated by INF= or DEC file need define the prompt and help information.",=0D + ERROR_GENERAL_CHECK_INVALID_LINE_ENDING: "Only CRLF (Carriage Return L= ine Feed) is allowed to line ending.",=0D + ERROR_GENERAL_CHECK_TRAILING_WHITE_SPACE_LINE: "There should be no tra= iling white space in one line.",=0D =0D - ERROR_SPACE_CHECK_ALL : "",=0D + ERROR_SPACE_CHECK_ALL: "",=0D =0D - ERROR_PREDICATE_EXPRESSION_CHECK_ALL : "",=0D - ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE : "Boolean values and v= ariable type BOOLEAN should not use explicit comparisons to TRUE or FALSE",= =0D - ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR : "Non-Boolean co= mparisons should use a compare operator (=3D=3D, !=3D, >, < >=3D, <=3D)",=0D - ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE : "A comparison = of any pointer to zero must be done via the NULL type",=0D + ERROR_PREDICATE_EXPRESSION_CHECK_ALL: "",=0D + ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN_VALUE: "Boolean values and va= riable type BOOLEAN should not use explicit comparisons to TRUE or FALSE",= =0D + ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOLEAN_OPERATOR: "Non-Boolean com= parisons should use a compare operator (=3D=3D, !=3D, >, < >=3D, <=3D)",=0D + ERROR_PREDICATE_EXPRESSION_CHECK_COMPARISON_NULL_TYPE: "A comparison o= f any pointer to zero must be done via the NULL type",=0D =0D - ERROR_HEADER_CHECK_ALL : "",=0D - ERROR_HEADER_CHECK_FILE : "File header doesn't exist",=0D - ERROR_HEADER_CHECK_FUNCTION : "Function header doesn't exist",=0D + ERROR_HEADER_CHECK_ALL: "",=0D + ERROR_HEADER_CHECK_FILE: "File header doesn't exist",=0D + ERROR_HEADER_CHECK_FUNCTION: "Function header doesn't exist",=0D =0D - ERROR_C_FUNCTION_LAYOUT_CHECK_ALL : "",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE : "Return type of a function= should exist and in the first line",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER : "Any opti= onal functional modifiers should exist and next to the return type",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME : """Function name should = be left justified, followed by the beginning of the parameter list, with th= e closing parenthesis on its own line, indented two spaces""",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE : "Function prototyp= es in include files have the same form as function definitions",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2 : "Function protot= ypes in include files have different parameter number with function definit= ions",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3 : "Function protot= ypes in include files have different parameter modifier with function defin= itions",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY : "The body of a function = should be contained by open and close braces that must be in the first colu= mn",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_DATA_DECLARATION : "The data declaration= s should be the first code in a module",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE : "There should be n= o initialization of a variable as part of its declaration",=0D - ERROR_C_FUNCTION_LAYOUT_CHECK_NO_STATIC : "There should be no use of S= TATIC for functions",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_ALL: "",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE: "Return type of a function = should exist and in the first line",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER: "Any optio= nal functional modifiers should exist and next to the return type",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME: """Function name should b= e left justified, followed by the beginning of the parameter list, with the= closing parenthesis on its own line, indented two spaces""",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE: "Function prototype= s in include files have the same form as function definitions",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_2: "Function prototy= pes in include files have different parameter number with function definiti= ons",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3: "Function prototy= pes in include files have different parameter modifier with function defini= tions",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY: "The body of a function s= hould be contained by open and close braces that must be in the first colum= n",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_DATA_DECLARATION: "The data declarations= should be the first code in a module",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VARIABLE: "There should be no= initialization of a variable as part of its declaration",=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_NO_STATIC: "There should be no use of ST= ATIC for functions",=0D =0D - ERROR_INCLUDE_FILE_CHECK_ALL : "",=0D - ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1 : "All include file conten= ts should be guarded by a #ifndef statement.",=0D - ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2 : "The #ifndef must be the= first line of code following the file header comment",=0D - ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3 : "The #endif must appear = on the last line in the file",=0D - ERROR_INCLUDE_FILE_CHECK_DATA : "Include files should contain only pub= lic or only private data and cannot contain code or define data variables",= =0D - ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the include file wi= th same names",=0D + ERROR_INCLUDE_FILE_CHECK_ALL: "",=0D + ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1: "All include file content= s should be guarded by a #ifndef statement.",=0D + ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2: "The #ifndef must be the = first line of code following the file header comment",=0D + ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3: "The #endif must appear o= n the last line in the file",=0D + ERROR_INCLUDE_FILE_CHECK_DATA: "Include files should contain only publ= ic or only private data and cannot contain code or define data variables",= =0D + ERROR_INCLUDE_FILE_CHECK_NAME: "No permission for the include file wit= h same names",=0D =0D - ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE : "There should be no = use of int, unsigned, char, void, long in any .c, .h or .asl files",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER : """The modifiers I= N, OUT, OPTIONAL, and UNALIGNED should be used only to qualify arguments to= a function and should not appear in a data type declaration""",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER : "The EFIAPI modif= ier should be used at the entry of drivers, events, and member functions of= protocols",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE : "Enumerated Type s= hould have a 'typedef' and the name must be in capital letters",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_STRUCTURE_DECLARATION : "Structure T= ype should have a 'typedef' and the name must be in capital letters",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE : "No permission for = the structure with same names",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_UNION_TYPE : "Union Type should have= a 'typedef' and the name must be in capital letters",=0D - ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE : "Complex types sh= ould be typedef-ed",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_ALL: "",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE: "There should be no u= se of int, unsigned, char, void, long in any .c, .h or .asl files",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MODIFIER: """The modifiers IN= , OUT, OPTIONAL, and UNALIGNED should be used only to qualify arguments to = a function and should not appear in a data type declaration""",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_EFI_API_MODIFIER: "The EFIAPI modifi= er should be used at the entry of drivers, events, and member functions of = protocols",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_ENUMERATED_TYPE: "Enumerated Type sh= ould have a 'typedef' and the name must be in capital letters",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_STRUCTURE_DECLARATION: "Structure Ty= pe should have a 'typedef' and the name must be in capital letters",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_SAME_STRUCTURE: "No permission for t= he structure with same names",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_UNION_TYPE: "Union Type should have = a 'typedef' and the name must be in capital letters",=0D + ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STRUCTURE: "Complex types sho= uld be typedef-ed",=0D =0D - ERROR_NAMING_CONVENTION_CHECK_ALL : "",=0D - ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT : "Only capital letters= are allowed to be used for #define declarations",=0D - ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT : "Only capital letter= s are allowed to be used for typedef declarations",=0D - ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT : "The #ifndef at the s= tart of an include file should have one postfix underscore, and no prefix u= nderscore character '_'",=0D - ERROR_NAMING_CONVENTION_CHECK_PATH_NAME : """Path name does not follow= the rules: 1. First character should be upper case 2. Must contain lower c= ase characters 3. No white space characters""",=0D - ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME : """Variable name does no= t follow the rules: 1. First character should be upper case 2. Must contain= lower case characters 3. No white space characters 4. Global variable name= must start with a 'g'""",=0D - ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME : """Function name does no= t follow the rules: 1. First character should be upper case 2. Must contain= lower case characters 3. No white space characters""",=0D - ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE : "There shoul= d be no use of short (single character) variable names",=0D + ERROR_NAMING_CONVENTION_CHECK_ALL: "",=0D + ERROR_NAMING_CONVENTION_CHECK_DEFINE_STATEMENT: "Only capital letters = are allowed to be used for #define declarations",=0D + ERROR_NAMING_CONVENTION_CHECK_TYPEDEF_STATEMENT: "Only capital letters= are allowed to be used for typedef declarations",=0D + ERROR_NAMING_CONVENTION_CHECK_IFNDEF_STATEMENT: "The #ifndef at the st= art of an include file should have one postfix underscore, and no prefix un= derscore character '_'",=0D + ERROR_NAMING_CONVENTION_CHECK_PATH_NAME: """Path name does not follow = the rules: 1. First character should be upper case 2. Must contain lower ca= se characters 3. No white space characters""",=0D + ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME: """Variable name does not= follow the rules: 1. First character should be upper case 2. Must contain = lower case characters 3. No white space characters 4. Global variable name = must start with a 'g'""",=0D + ERROR_NAMING_CONVENTION_CHECK_FUNCTION_NAME: """Function name does not= follow the rules: 1. First character should be upper case 2. Must contain = lower case characters 3. No white space characters""",=0D + ERROR_NAMING_CONVENTION_CHECK_SINGLE_CHARACTER_VARIABLE: "There should= be no use of short (single character) variable names",=0D =0D - ERROR_DOXYGEN_CHECK_ALL : "",=0D - ERROR_DOXYGEN_CHECK_FILE_HEADER : "The file headers should follow Doxy= gen special documentation blocks in section 2.3.5",=0D - ERROR_DOXYGEN_CHECK_FUNCTION_HEADER : "The function headers should fol= low Doxygen special documentation blocks in section 2.3.5",=0D - ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION : """The first line of text in= a comment block should be a brief description of the element being documen= ted and the brief description must end with a period.""",=0D - ERROR_DOXYGEN_CHECK_COMMENT_FORMAT : "For comment line with '///< ... = text ...' format, if it is used, it should be after the code section",=0D - ERROR_DOXYGEN_CHECK_COMMAND : "Only Doxygen commands '@bug', '@todo', = '@example', '@file', '@attention', '@param', '@post', '@pre', '@retval', '@= return', '@sa', '@since', '@test', '@note', '@par', '@endcode', '@code', '@= {', '@}' are allowed to mark the code",=0D + ERROR_DOXYGEN_CHECK_ALL: "",=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER: "The file headers should follow Doxyg= en special documentation blocks in section 2.3.5",=0D + ERROR_DOXYGEN_CHECK_FUNCTION_HEADER: "The function headers should foll= ow Doxygen special documentation blocks in section 2.3.5",=0D + ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION: """The first line of text in = a comment block should be a brief description of the element being document= ed and the brief description must end with a period.""",=0D + ERROR_DOXYGEN_CHECK_COMMENT_FORMAT: "For comment line with '///< ... t= ext ...' format, if it is used, it should be after the code section",=0D + ERROR_DOXYGEN_CHECK_COMMAND: "Only Doxygen commands '@bug', '@todo', '= @example', '@file', '@attention', '@param', '@post', '@pre', '@retval', '@r= eturn', '@sa', '@since', '@test', '@note', '@par', '@endcode', '@code', '@{= ', '@}' are allowed to mark the code",=0D =0D - ERROR_META_DATA_FILE_CHECK_ALL : "",=0D - ERROR_META_DATA_FILE_CHECK_PATH_NAME : "The file defined in meta-data = does not exist",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1 : "A library instances d= efined for a given module (or dependent library instance) doesn't match the= module's type.",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2 : "A library instance mu= st specify the Supported Module Types in its INF file",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT : "A library ins= tance must be defined for all dependent library classes",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_ORDER : "The library Insta= nces specified by the LibraryClasses sections should be listed in order of = dependencies",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE : "There should be no unnece= ssary inclusion of library classes in the INF file",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE : "Duplicate Library= Class Name found",=0D - ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF : "An INF file is specifi= ed in the FDF file, but not in the DSC file, therefore the INF file must be= for a Binary module only",=0D - ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE : "Duplicate PCDs found",=0D - ERROR_META_DATA_FILE_CHECK_PCD_FLASH : "PCD settings in the FDF file s= hould only be related to flash",=0D - ERROR_META_DATA_FILE_CHECK_PCD_NO_USE : "There should be no PCDs decla= red in INF files that are not specified in in either a DSC or FDF file",=0D - ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID : "Duplicate GUID found",=0D - ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL : "Duplicate PROTOCOL fo= und",=0D - ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI : "Duplicate PPI found",=0D - ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE : "No used module files = found",=0D - ERROR_META_DATA_FILE_CHECK_PCD_TYPE : "Wrong C code function used for = this kind of PCD",=0D - ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION : "Module file= has FILE_GUID collision with other module file",=0D - ERROR_META_DATA_FILE_CHECK_FORMAT_GUID : "Wrong GUID Format used in Mo= dule file",=0D - ERROR_META_DATA_FILE_CHECK_FORMAT_PROTOCOL : "Wrong Protocol Format us= ed in Module file",=0D - ERROR_META_DATA_FILE_CHECK_FORMAT_PPI : "Wrong Ppi Format used in Modu= le file",=0D - ERROR_META_DATA_FILE_CHECK_FORMAT_PCD : "Wrong Pcd Format used in Modu= le file",=0D - ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED : "Not defined LibraryC= lass used in the Module file.",=0D - ERROR_SPELLING_CHECK_ALL : "",=0D -=0D - ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE : "SMM communication function ma= y use wrong parameter type",=0D - }=0D + ERROR_META_DATA_FILE_CHECK_ALL: "",=0D + ERROR_META_DATA_FILE_CHECK_PATH_NAME: "The file defined in meta-data d= oes not exist",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_1: "A library instances de= fined for a given module (or dependent library instance) doesn't match the = module's type.",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_2: "A library instance mus= t specify the Supported Module Types in its INF file",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_DEPENDENT: "A library inst= ance must be defined for all dependent library classes",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_INSTANCE_ORDER: "The library Instan= ces specified by the LibraryClasses sections should be listed in order of d= ependencies",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_NO_USE: "There should be no unneces= sary inclusion of library classes in the INF file",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE: "Duplicate Library = Class Name found",=0D + ERROR_META_DATA_FILE_CHECK_BINARY_INF_IN_FDF: "An INF file is specifie= d in the FDF file, but not in the DSC file, therefore the INF file must be = for a Binary module only",=0D + ERROR_META_DATA_FILE_CHECK_PCD_DUPLICATE: "Duplicate PCDs found",=0D + ERROR_META_DATA_FILE_CHECK_PCD_FLASH: "PCD settings in the FDF file sh= ould only be related to flash",=0D + ERROR_META_DATA_FILE_CHECK_PCD_NO_USE: "There should be no PCDs declar= ed in INF files that are not specified in in either a DSC or FDF file",=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_GUID: "Duplicate GUID found",=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PROTOCOL: "Duplicate PROTOCOL fou= nd",=0D + ERROR_META_DATA_FILE_CHECK_DUPLICATE_PPI: "Duplicate PPI found",=0D + ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE: "No used module files f= ound",=0D + ERROR_META_DATA_FILE_CHECK_PCD_TYPE: "Wrong C code function used for t= his kind of PCD",=0D + ERROR_META_DATA_FILE_CHECK_MODULE_FILE_GUID_DUPLICATION: "Module file = has FILE_GUID collision with other module file",=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_GUID: "Wrong GUID Format used in Mod= ule file",=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PROTOCOL: "Wrong Protocol Format use= d in Module file",=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PPI: "Wrong Ppi Format used in Modul= e file",=0D + ERROR_META_DATA_FILE_CHECK_FORMAT_PCD: "Wrong Pcd Format used in Modul= e file",=0D + ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED: "Not defined LibraryCl= ass used in the Module file.",=0D + ERROR_SPELLING_CHECK_ALL: "",=0D =0D + ERROR_SMM_COMM_PARA_CHECK_BUFFER_TYPE: "SMM communication function may= use wrong parameter type",=0D +}=0D diff --git a/BaseTools/Source/Python/Ecc/Exception.py b/BaseTools/Source/Py= thon/Ecc/Exception.py index 9251b8d7c47f..f6dfbeb2c95f 100644 --- a/BaseTools/Source/Python/Ecc/Exception.py +++ b/BaseTools/Source/Python/Ecc/Exception.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse exception items found by ECC tool=0D #=0D # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,6 +14,8 @@ from Ecc.Xml.XmlRoutines import * import Common.LongFilePathOs as os=0D =0D # ExceptionXml to parse Exception Node of XML file=0D +=0D +=0D class ExceptionXml(object):=0D def __init__(self):=0D self.KeyWord =3D ''=0D @@ -26,9 +28,11 @@ class ExceptionXml(object): self.FilePath =3D os.path.normpath(XmlElement(Item, '%s/FilePath' = % Key))=0D =0D def __str__(self):=0D - return 'ErrorID =3D %s KeyWord =3D %s FilePath =3D %s' %(self.Erro= rID, self.KeyWord, self.FilePath)=0D + return 'ErrorID =3D %s KeyWord =3D %s FilePath =3D %s' % (self.Err= orID, self.KeyWord, self.FilePath)=0D =0D # ExceptionListXml to parse Exception Node List of XML file=0D +=0D +=0D class ExceptionListXml(object):=0D def __init__(self):=0D self.List =3D []=0D @@ -56,8 +60,10 @@ class ExceptionListXml(object): return RtnStr=0D =0D # A class to check exception=0D +=0D +=0D class ExceptionCheck(object):=0D - def __init__(self, FilePath =3D None):=0D + def __init__(self, FilePath=3DNone):=0D self.ExceptionList =3D []=0D self.ExceptionListXml =3D ExceptionListXml()=0D self.LoadExceptionListXml(FilePath)=0D @@ -73,11 +79,13 @@ class ExceptionCheck(object): else:=0D return False=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D # script.=0D #=0D if __name__ =3D=3D '__main__':=0D - El =3D ExceptionCheck('C:\\Hess\\Project\\BuildTool\\src\\Ecc\\excepti= on.xml')=0D + El =3D ExceptionCheck(=0D + 'C:\\Hess\\Project\\BuildTool\\src\\Ecc\\exception.xml')=0D print(El.ExceptionList)=0D diff --git a/BaseTools/Source/Python/Ecc/FileProfile.py b/BaseTools/Source/= Python/Ecc/FileProfile.py index eedf263b1f9d..ecc33fac2863 100644 --- a/BaseTools/Source/Python/Ecc/FileProfile.py +++ b/BaseTools/Source/Python/Ecc/FileProfile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # fragments of source file=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -26,13 +26,15 @@ StructUnionDefinitionList =3D [] TypedefDefinitionList =3D []=0D FunctionCallingList =3D []=0D =0D -## record file data when parsing source=0D +# record file data when parsing source=0D #=0D # May raise Exception when opening file.=0D #=0D -class FileProfile :=0D =0D - ## The constructor=0D +=0D +class FileProfile:=0D +=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D diff --git a/BaseTools/Source/Python/Ecc/MetaDataParser.py b/BaseTools/Sour= ce/Python/Ecc/MetaDataParser.py index d9f0da1ee0d6..d8d0d2ee408a 100644 --- a/BaseTools/Source/Python/Ecc/MetaDataParser.py +++ b/BaseTools/Source/Python/Ecc/MetaDataParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common parser functions for meta-data=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -12,12 +12,14 @@ from Ecc.EccToolError import * from Common.MultipleWorkspace import MultipleWorkspace as mws=0D from Ecc import EccGlobalData=0D import re=0D -## Get the include path list for a source file=0D +# Get the include path list for a source file=0D #=0D # 1. Find the source file belongs to which inf file=0D # 2. Find the inf's package=0D # 3. Return the include path list of the package=0D #=0D +=0D +=0D def GetIncludeListOfFile(WorkSpace, Filepath, Db):=0D IncludeList =3D []=0D Filepath =3D os.path.normpath(Filepath)=0D @@ -46,26 +48,32 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db): =0D return IncludeList=0D =0D -## Get the file list=0D +# Get the file list=0D #=0D # Search table file and find all specific type files=0D #=0D +=0D +=0D def GetFileList(FileModel, Db):=0D FileList =3D []=0D - SqlCommand =3D """select FullPath from File where Model =3D %s""" % st= r(FileModel)=0D + SqlCommand =3D """select FullPath from File where Model =3D %s""" % st= r(=0D + FileModel)=0D RecordSet =3D Db.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D FileList.append(Record[0])=0D =0D return FileList=0D =0D -## Get the table list=0D +# Get the table list=0D #=0D # Search table file and find all small tables=0D #=0D +=0D +=0D def GetTableList(FileModelList, Table, Db):=0D TableList =3D []=0D - SqlCommand =3D """select ID from File where Model in %s""" % str(FileM= odelList)=0D + SqlCommand =3D """select ID from File where Model in %s""" % str(=0D + FileModelList)=0D RecordSet =3D Db.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D TableName =3D Table + str(Record[0])=0D @@ -73,7 +81,7 @@ def GetTableList(FileModelList, Table, Db): =0D return TableList=0D =0D -## ParseHeaderCommentSection=0D +# ParseHeaderCommentSection=0D #=0D # Parse Header comment section lines, extract Abstract, Description, Copyr= ight=0D # , License lines=0D @@ -81,7 +89,9 @@ def GetTableList(FileModelList, Table, Db): # @param CommentList: List of (Comment, LineNumber)=0D # @param FileName: FileName of the comment=0D #=0D -def ParseHeaderCommentSection(CommentList, FileName =3D None):=0D +=0D +=0D +def ParseHeaderCommentSection(CommentList, FileName=3DNone):=0D =0D Abstract =3D ''=0D Description =3D ''=0D @@ -95,13 +105,13 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): # inf files=0D #=0D HEADER_COMMENT_NOT_STARTED =3D -1=0D - HEADER_COMMENT_STARTED =3D 0=0D - HEADER_COMMENT_FILE =3D 1=0D - HEADER_COMMENT_ABSTRACT =3D 2=0D + HEADER_COMMENT_STARTED =3D 0=0D + HEADER_COMMENT_FILE =3D 1=0D + HEADER_COMMENT_ABSTRACT =3D 2=0D HEADER_COMMENT_DESCRIPTION =3D 3=0D - HEADER_COMMENT_COPYRIGHT =3D 4=0D - HEADER_COMMENT_LICENSE =3D 5=0D - HEADER_COMMENT_END =3D 6=0D + HEADER_COMMENT_COPYRIGHT =3D 4=0D + HEADER_COMMENT_LICENSE =3D 5=0D + HEADER_COMMENT_END =3D 6=0D #=0D # first find the last copyright line=0D #=0D @@ -122,7 +132,8 @@ def ParseHeaderCommentSection(CommentList, FileName =3D= None): ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'Comment must start with #'=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FIL= E_HEADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0= ])=0D Comment =3D CleanString2(Line)[1]=0D Comment =3D Comment.strip()=0D #=0D @@ -130,7 +141,7 @@ def ParseHeaderCommentSection(CommentList, FileName =3D= None): # indication of different block; or in the position that Abstract = should be, also keep it=0D # as it indicates that no abstract=0D #=0D - if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICEN= SE, \=0D + if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICEN= SE,=0D HEADER_COMMENT_DESCR= IPTION, HEADER_COMMENT_ABSTRACT]:=0D continue=0D =0D @@ -185,36 +196,41 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None): ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'Header comment section must have copyright informatio= n'=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HE= ADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D =0D if not License.strip():=0D SqlStatement =3D """ select ID from File where FullPath like '%s'"= "" % FileName=0D ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'Header comment section must have license information'= =0D - EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HE= ADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D =0D if not Abstract.strip() or Abstract.find('Component description file')= > -1:=0D SqlStatement =3D """ select ID from File where FullPath like '%s'"= "" % FileName=0D ResultSet =3D EccGlobalData.gDb.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D Msg =3D 'Header comment section must have Abstract information= .'=0D - EccGlobalData.gDb.TblReport.Insert(ERROR_DOXYGEN_CHECK_FILE_HE= ADER, Msg, "File", Result[0])=0D + EccGlobalData.gDb.TblReport.Insert(=0D + ERROR_DOXYGEN_CHECK_FILE_HEADER, Msg, "File", Result[0])=0D =0D return Abstract.strip(), Description.strip(), Copyright.strip(), Licen= se.strip()=0D =0D -## _IsCopyrightLine=0D +# _IsCopyrightLine=0D # check whether current line is copyright line, the criteria is whether th= ere is case insensitive keyword "Copyright"=0D # followed by zero or more white space characters followed by a "(" charac= ter=0D #=0D # @param LineContent: the line need to be checked=0D # @return: True if current line is copyright line, False else=0D #=0D -def _IsCopyrightLine (LineContent):=0D +=0D +=0D +def _IsCopyrightLine(LineContent):=0D LineContent =3D LineContent.upper()=0D Result =3D False=0D =0D - #Support below Copyright format=0D + # Support below Copyright format=0D # Copyright (C) 2020 Hewlett Packard Enterprise Development LP
        =0D # (C) Copyright 2020 Hewlett Packard Enterprise Development LP
        =0D ReIsCopyrightRe =3D re.compile(r"""(^|\s)COPYRIGHT *\(""", re.DOTALL)= =0D @@ -225,7 +241,7 @@ def _IsCopyrightLine (LineContent): return Result=0D =0D =0D -## CleanString2=0D +# CleanString2=0D #=0D # Split comments in a string=0D # Remove spaces=0D diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py= b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py index 1d7f6eb10434..0b5af17c48b6 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for files=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -15,11 +15,13 @@ import Common.EdkLogger as EdkLogger from CommonDataClass import DataClass=0D from CommonDataClass.DataClass import FileClass=0D =0D -## Convert to SQL required string format=0D +# Convert to SQL required string format=0D +=0D +=0D def ConvertToSqlString(StringList):=0D return map(lambda s: "'" + s.replace("'", "''") + "'", StringList)=0D =0D -## TableFile=0D +# TableFile=0D #=0D # This class defined a common table=0D #=0D @@ -28,6 +30,8 @@ def ConvertToSqlString(StringList): # @param Cursor: Cursor of the database=0D # @param TableName: Name of the table=0D #=0D +=0D +=0D class Table(object):=0D _COLUMN_ =3D ''=0D _ID_STEP_ =3D 1=0D @@ -44,7 +48,7 @@ class Table(object): def __str__(self):=0D return self.Table=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create a table=0D #=0D @@ -53,14 +57,16 @@ class Table(object): self.Drop()=0D =0D if self.Temporary:=0D - SqlCommand =3D """create temp table IF NOT EXISTS %s (%s)""" %= (self.Table, self._COLUMN_)=0D + SqlCommand =3D """create temp table IF NOT EXISTS %s (%s)""" %= (=0D + self.Table, self._COLUMN_)=0D else:=0D - SqlCommand =3D """create table IF NOT EXISTS %s (%s)""" % (sel= f.Table, self._COLUMN_)=0D + SqlCommand =3D """create table IF NOT EXISTS %s (%s)""" % (=0D + self.Table, self._COLUMN_)=0D EdkLogger.debug(EdkLogger.DEBUG_8, SqlCommand)=0D self.Cur.execute(SqlCommand)=0D self.ID =3D self.GetId()=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into a table=0D #=0D @@ -69,12 +75,13 @@ class Table(object): if self.ID >=3D (self.IdBase + self._ID_MAX_):=0D self.ID =3D self.IdBase + self._ID_STEP_=0D Values =3D ", ".join(str(Arg) for Arg in Args)=0D - SqlCommand =3D "insert into %s values(%s, %s)" % (self.Table, self= .ID, Values)=0D + SqlCommand =3D "insert into %s values(%s, %s)" % (=0D + self.Table, self.ID, Values)=0D EdkLogger.debug(EdkLogger.DEBUG_5, SqlCommand)=0D self.Cur.execute(SqlCommand)=0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # Query all records of the table=0D #=0D @@ -85,7 +92,7 @@ class Table(object): EdkLogger.verbose(str(Rs))=0D TotalCount =3D self.GetId()=0D =0D - ## Drop a table=0D + # Drop a table=0D #=0D # Drop the table=0D #=0D @@ -96,7 +103,7 @@ class Table(object): except Exception as e:=0D print("An error occurred when Drop a table:", e.args[0])=0D =0D - ## Get count=0D + # Get count=0D #=0D # Get a count of all records of the table=0D #=0D @@ -115,14 +122,14 @@ class Table(object): Id =3D self.IdBase=0D return Id=0D =0D - ## Init the ID of the table=0D + # Init the ID of the table=0D #=0D # Init the ID of the table=0D #=0D def InitID(self):=0D self.ID =3D self.GetId()=0D =0D - ## Exec=0D + # Exec=0D #=0D # Exec Sql Command, return result=0D #=0D @@ -149,7 +156,7 @@ class Table(object): return self.Exec("select * from %s where ID > 0 order by ID" % (se= lf.Table))=0D =0D =0D -## TableDataModel=0D +# TableDataModel=0D #=0D # This class defined a table used for data model=0D #=0D @@ -163,10 +170,11 @@ class TableDataModel(Table): Name VARCHAR NOT NULL,=0D Description VARCHAR=0D """=0D +=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor, 'DataModel')=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table DataModel=0D #=0D @@ -179,7 +187,7 @@ class TableDataModel(Table): (Name, Description) =3D ConvertToSqlString((Name, Description))=0D return Table.Insert(self, CrossIndex, Name, Description)=0D =0D - ## Init table=0D + # Init table=0D #=0D # Create all default records of table DataModel=0D #=0D @@ -195,7 +203,7 @@ class TableDataModel(Table): self.Insert(CrossIndex, Name, Description)=0D EdkLogger.verbose("Initialize table DataModel ... DONE!")=0D =0D - ## Get CrossIndex=0D + # Get CrossIndex=0D #=0D # Get a model's cross index from its name=0D #=0D @@ -210,4 +218,3 @@ class TableDataModel(Table): CrossIndex =3D Item[0]=0D =0D return CrossIndex=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.p= y b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 2d98ac5eadb2..1cf1815c2fe2 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse meta files=0D #=0D # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
        =0D @@ -31,11 +31,13 @@ from GenFds.FdfParser import FdfParser from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.LongFilePathSupport import CodecOpenLongFilePath=0D =0D -## RegEx for finding file versions=0D +# RegEx for finding file versions=0D hexVersionPattern =3D re.compile(r'0[xX][\da-f-A-F]{5,8}')=0D decVersionPattern =3D re.compile(r'\d+\.\d+')=0D =0D -## A decorator used to parse macro definition=0D +# A decorator used to parse macro definition=0D +=0D +=0D def ParseMacro(Parser):=0D def MacroParser(self):=0D Match =3D GlobalData.gMacroDefPattern.match(self._CurrentLine)=0D @@ -44,7 +46,8 @@ def ParseMacro(Parser): Parser(self)=0D return=0D =0D - TokenList =3D GetSplitValueList(self._CurrentLine[Match.end(1):], = TAB_EQUAL_SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + self._CurrentLine[Match.end(1):], TAB_EQUAL_SPLIT, 1)=0D # Syntax check=0D if not TokenList[0]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given= ",=0D @@ -72,7 +75,8 @@ def ParseMacro(Parser): self._FileLocalMacros[Name] =3D Value=0D else:=0D for Scope in self._Scope:=0D - self._SectionsMacroDict.setdefault((Scope[2], Scop= e[0], Scope[1]), {})[Name] =3D Value=0D + self._SectionsMacroDict.setdefault(=0D + (Scope[2], Scope[0], Scope[1]), {})[Name] =3D = Value=0D elif self._SectionType =3D=3D MODEL_META_DATA_HEADER:=0D self._FileLocalMacros[Name] =3D Value=0D else:=0D @@ -96,7 +100,7 @@ def ParseMacro(Parser): =0D return MacroParser=0D =0D -## Base class of parser=0D +# Base class of parser=0D #=0D # This class is used for derivation purpose. The specific parser for one = kind=0D # type file must derive this class and implement some public interfaces.=0D @@ -108,6 +112,8 @@ def ParseMacro(Parser): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INCLUDE= directive)=0D #=0D +=0D +=0D class MetaFileParser(object):=0D # data type (file content) for specific file type=0D DataType =3D {}=0D @@ -115,7 +121,7 @@ class MetaFileParser(object): # Parser objects used to implement singleton=0D MetaFiles =3D {}=0D =0D - ## Factory method=0D + # Factory method=0D #=0D # One file, one parser object. This factory method makes sure that the= re's=0D # only one object constructed for one meta file.=0D @@ -134,7 +140,7 @@ class MetaFileParser(object): Class.MetaFiles[FilePath] =3D ParserObject=0D return ParserObject=0D =0D - ## Constructor of MetaFileParser=0D + # Constructor of MetaFileParser=0D #=0D # Initialize object of MetaFileParser=0D #=0D @@ -179,37 +185,37 @@ class MetaFileParser(object): self._UniObj =3D None=0D self._UniExtraObj =3D None=0D =0D - ## Store the parsed data in table=0D + # Store the parsed data in table=0D def _Store(self, *Args):=0D return self._Table.Insert(*Args)=0D =0D - ## Virtual method for starting parse=0D + # Virtual method for starting parse=0D def Start(self):=0D raise NotImplementedError=0D =0D - ## Notify a post-process is needed=0D + # Notify a post-process is needed=0D def DoPostProcess(self):=0D self._PostProcessed =3D False=0D =0D - ## Set parsing complete flag in both class and table=0D + # Set parsing complete flag in both class and table=0D def _Done(self):=0D self._Finished =3D True=0D - ## Do not set end flag when processing included files=0D + # Do not set end flag when processing included files=0D if self._From =3D=3D -1:=0D self._Table.SetEndFlag()=0D =0D def _PostProcess(self):=0D self._PostProcessed =3D True=0D =0D - ## Get the parse complete flag=0D + # Get the parse complete flag=0D def _GetFinished(self):=0D return self._Finished=0D =0D - ## Set the complete flag=0D + # Set the complete flag=0D def _SetFinished(self, Value):=0D self._Finished =3D Value=0D =0D - ## Use [] style to query data in table, just for readability=0D + # Use [] style to query data in table, just for readability=0D #=0D # DataInfo =3D [data_type, scope1(arch), scope2(platform/moduletype)= ]=0D #=0D @@ -236,7 +242,7 @@ class MetaFileParser(object): =0D return self._Table.Query(*DataInfo)=0D =0D - ## Data parser for the common format in different type of file=0D + # Data parser for the common format in different type of file=0D #=0D # The common format in the meatfile is like=0D #=0D @@ -247,7 +253,7 @@ class MetaFileParser(object): TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= )=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D - ## Data parser for the format in which there's path=0D + # Data parser for the format in which there's path=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -258,23 +264,26 @@ class MetaFileParser(object): # Don't do macro replacement for dsc file at this point=0D if not isinstance(self, DscParser):=0D Macros =3D self._Macros=0D - self._ValueList =3D [ReplaceMacro(Value, Macros) for Value in = self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, Macros)=0D + for Value in self._ValueList]=0D =0D - ## Skip unsupported data=0D + # Skip unsupported data=0D def _Skip(self):=0D if self._SectionName =3D=3D TAB_USER_EXTENSIONS.upper() and self._= CurrentLine.upper().endswith('.UNI'):=0D if EccGlobalData.gConfig.UniCheckHelpInfo =3D=3D '1' or EccGlo= balData.gConfig.UniCheckAll =3D=3D '1' or EccGlobalData.gConfig.CheckAll = =3D=3D '1':=0D ExtraUni =3D self._CurrentLine.strip()=0D - ExtraUniFile =3D os.path.join(os.path.dirname(self.MetaFil= e), ExtraUni)=0D + ExtraUniFile =3D os.path.join(=0D + os.path.dirname(self.MetaFile), ExtraUni)=0D IsModuleUni =3D self.MetaFile.upper().endswith('.INF')=0D - self._UniExtraObj =3D UniParser(ExtraUniFile, IsExtraUni= =3DTrue, IsModuleUni=3DIsModuleUni)=0D + self._UniExtraObj =3D UniParser(=0D + ExtraUniFile, IsExtraUni=3DTrue, IsModuleUni=3DIsModul= eUni)=0D self._UniExtraObj.Start()=0D else:=0D EdkLogger.warn("Parser", "Unrecognized content", File=3Dself.M= etaFile,=0D - Line=3Dself._LineIndex + 1, ExtraData=3Dself._= CurrentLine);=0D + Line=3Dself._LineIndex + 1, ExtraData=3Dself._C= urrentLine)=0D self._ValueList[0:1] =3D [self._CurrentLine]=0D =0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D @@ -298,7 +307,7 @@ class MetaFileParser(object): else:=0D self._SectionType =3D MODEL_UNKNOWN=0D EdkLogger.warn("Parser", "Unrecognized section", File=3Dse= lf.MetaFile,=0D - Line=3Dself._LineIndex+1, ExtraData=3Dself= ._CurrentLine)=0D + Line=3Dself._LineIndex+1, ExtraData=3Dself.= _CurrentLine)=0D # S1 is always Arch=0D if len(ItemList) > 1:=0D S1 =3D ItemList[1].upper()=0D @@ -319,7 +328,7 @@ class MetaFileParser(object): # If the section information is needed later, it should be stored = in database=0D self._ValueList[0] =3D self._SectionName=0D =0D - ## [defines] section parser=0D + # [defines] section parser=0D @ParseMacro=0D def _DefineParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -331,7 +340,8 @@ class MetaFileParser(object): EdkLogger.error('Parser', FORMAT_INVALID, "No value specified"= ,=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex+1)=0D =0D - self._ValueList =3D [ReplaceMacro(Value, self._Macros) for Value i= n self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, self._Macros)=0D + for Value in self._ValueList]=0D Name, Value =3D self._ValueList[1], self._ValueList[2]=0D # Sometimes, we need to make differences between EDK and EDK2 modu= les=0D if Name =3D=3D 'INF_VERSION':=0D @@ -351,7 +361,8 @@ class MetaFileParser(object): elif Name =3D=3D 'MODULE_UNI_FILE':=0D UniFile =3D os.path.join(os.path.dirname(self.MetaFile), Value= )=0D if os.path.exists(UniFile):=0D - self._UniObj =3D UniParser(UniFile, IsExtraUni=3DFalse, Is= ModuleUni=3DTrue)=0D + self._UniObj =3D UniParser(=0D + UniFile, IsExtraUni=3DFalse, IsModuleUni=3DTrue)=0D self._UniObj.Start()=0D else:=0D EdkLogger.error('Parser', FILE_NOT_FOUND, "Module UNI file= %s is missing." % Value,=0D @@ -360,14 +371,15 @@ class MetaFileParser(object): elif Name =3D=3D 'PACKAGE_UNI_FILE':=0D UniFile =3D os.path.join(os.path.dirname(self.MetaFile), Value= )=0D if os.path.exists(UniFile):=0D - self._UniObj =3D UniParser(UniFile, IsExtraUni=3DFalse, Is= ModuleUni=3DFalse)=0D + self._UniObj =3D UniParser(=0D + UniFile, IsExtraUni=3DFalse, IsModuleUni=3DFalse)=0D =0D if isinstance(self, InfParser) and self._Version < 0x00010005:=0D # EDK module allows using defines as macros=0D self._FileLocalMacros[Name] =3D Value=0D self._Defines[Name] =3D Value=0D =0D - ## [BuildOptions] section parser=0D + # [BuildOptions] section parser=0D @ParseMacro=0D def _BuildOptionParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -377,18 +389,19 @@ class MetaFileParser(object): self._ValueList[1] =3D TokenList2[1] # keys=0D else:=0D self._ValueList[1] =3D TokenList[0]=0D - if len(TokenList) =3D=3D 2 and not isinstance(self, DscParser): # = value=0D + if len(TokenList) =3D=3D 2 and not isinstance(self, DscParser): #= value=0D self._ValueList[2] =3D ReplaceMacro(TokenList[1], self._Macros= )=0D =0D if self._ValueList[1].count('_') !=3D 4:=0D EdkLogger.error(=0D 'Parser',=0D FORMAT_INVALID,=0D - "'%s' must be in format of ____FLAGS" % self._ValueList[1],=0D + "'%s' must be in format of ____FLAGS" % self._ValueList[=0D + 1],=0D ExtraData=3Dself._CurrentLine,=0D File=3Dself.MetaFile,=0D Line=3Dself._LineIndex+1=0D - )=0D + )=0D =0D def _GetMacros(self):=0D Macros =3D {}=0D @@ -396,23 +409,24 @@ class MetaFileParser(object): Macros.update(self._GetApplicableSectionMacro())=0D return Macros=0D =0D + # Get section Macros that are applicable to current line, which may co= me from other sections=0D + # that share the same name while scope is wider=0D =0D - ## Get section Macros that are applicable to current line, which may c= ome from other sections=0D - ## that share the same name while scope is wider=0D def _GetApplicableSectionMacro(self):=0D Macros =3D {}=0D for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", self._Scop= e[0][1]),=0D (self._Scope[0][0], "COMMON"), (self._Scope= [0][0], self._Scope[0][1])]:=0D if (self._SectionType, Scope1, Scope2) in self._SectionsMacroD= ict:=0D - Macros.update(self._SectionsMacroDict[(self._SectionType, = Scope1, Scope2)])=0D + Macros.update(self._SectionsMacroDict[(=0D + self._SectionType, Scope1, Scope2)])=0D return Macros=0D =0D - _SectionParser =3D {}=0D - Finished =3D property(_GetFinished, _SetFinished)=0D - _Macros =3D property(_GetMacros)=0D + _SectionParser =3D {}=0D + Finished =3D property(_GetFinished, _SetFinished)=0D + _Macros =3D property(_GetMacros)=0D =0D =0D -## INF file parser class=0D +# INF file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D @@ -422,30 +436,30 @@ class MetaFileParser(object): class InfParser(MetaFileParser):=0D # INF file supported data types (one type per section)=0D DataType =3D {=0D - TAB_UNKNOWN.upper() : MODEL_UNKNOWN,=0D - TAB_INF_DEFINES.upper() : MODEL_META_DATA_HEADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,=0D - TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,=0D - TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,=0D - TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,=0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,=0D - TAB_PACKAGES.upper() : MODEL_META_DATA_PACKAGE,=0D - TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE,=0D - TAB_INF_FIXED_PCD.upper() : MODEL_PCD_FIXED_AT_BUILD,=0D - TAB_INF_PATCH_PCD.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,=0D - TAB_INF_FEATURE_PCD.upper() : MODEL_PCD_FEATURE_FLAG,=0D - TAB_INF_PCD_EX.upper() : MODEL_PCD_DYNAMIC_EX,=0D - TAB_INF_PCD.upper() : MODEL_PCD_DYNAMIC,=0D - TAB_SOURCES.upper() : MODEL_EFI_SOURCE_FILE,=0D - TAB_GUIDS.upper() : MODEL_EFI_GUID,=0D - TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,=0D - TAB_PPIS.upper() : MODEL_EFI_PPI,=0D - TAB_DEPEX.upper() : MODEL_EFI_DEPEX,=0D - TAB_BINARIES.upper() : MODEL_EFI_BINARY_FILE,=0D - TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION=0D + TAB_UNKNOWN.upper(): MODEL_UNKNOWN,=0D + TAB_INF_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_BUILD_OPTIONS.upper(): MODEL_META_DATA_BUILD_OPTION,=0D + TAB_INCLUDES.upper(): MODEL_EFI_INCLUDE,=0D + TAB_LIBRARIES.upper(): MODEL_EFI_LIBRARY_INSTANCE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_PACKAGES.upper(): MODEL_META_DATA_PACKAGE,=0D + TAB_NMAKE.upper(): MODEL_META_DATA_NMAKE,=0D + TAB_INF_FIXED_PCD.upper(): MODEL_PCD_FIXED_AT_BUILD,=0D + TAB_INF_PATCH_PCD.upper(): MODEL_PCD_PATCHABLE_IN_MODULE,=0D + TAB_INF_FEATURE_PCD.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_INF_PCD_EX.upper(): MODEL_PCD_DYNAMIC_EX,=0D + TAB_INF_PCD.upper(): MODEL_PCD_DYNAMIC,=0D + TAB_SOURCES.upper(): MODEL_EFI_SOURCE_FILE,=0D + TAB_GUIDS.upper(): MODEL_EFI_GUID,=0D + TAB_PROTOCOLS.upper(): MODEL_EFI_PROTOCOL,=0D + TAB_PPIS.upper(): MODEL_EFI_PPI,=0D + TAB_DEPEX.upper(): MODEL_EFI_DEPEX,=0D + TAB_BINARIES.upper(): MODEL_EFI_BINARY_FILE,=0D + TAB_USER_EXTENSIONS.upper(): MODEL_META_DATA_USER_EXTENSION=0D }=0D =0D - ## Constructor of InfParser=0D + # Constructor of InfParser=0D #=0D # Initialize object of InfParser=0D #=0D @@ -462,7 +476,7 @@ class InfParser(MetaFileParser): self.TblFile =3D EccGlobalData.gDb.TblFile=0D self.FileID =3D -1=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D NmakeLine =3D ''=0D Content =3D ''=0D @@ -470,7 +484,8 @@ class InfParser(MetaFileParser): try:=0D Content =3D open(str(self.MetaFile), 'r').readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D #=0D # Insert a record for file=0D #=0D @@ -503,7 +518,7 @@ class InfParser(MetaFileParser): Usage +=3D ' ' + Line[Line.find(TAB_COMMENT_SPLIT):]=0D Line =3D Line[:Line.find(TAB_COMMENT_SPLIT)]=0D else:=0D - # skip empty, commented, block commented lines=0D + # skip empty, commented, block commented lines=0D Line =3D CleanString(Content[Index], AllowCppStyleComment= =3DTrue)=0D Usage =3D ''=0D NextLine =3D ''=0D @@ -541,13 +556,15 @@ class InfParser(MetaFileParser): MODEL_EFI_PPI,=0D MODEL_META_DATA_USER_EXTENSIO= N]:=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D - "Section [%s] is not allowed in in= f file without version" % (self._SectionName),=0D + "Section [%s] is not allowed in in= f file without version" % (=0D + self._SectionName),=0D ExtraData=3Dself._CurrentLine, Fil= e=3Dself.MetaFile, Line=3Dself._LineIndex+1)=0D elif self._SectionType in [MODEL_EFI_INCLUDE,=0D MODEL_EFI_LIBRARY_INSTANCE,=0D MODEL_META_DATA_NMAKE]:=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D - "Section [%s] is not allowed in inf fi= le with version 0x%08x" % (self._SectionName, self._Version),=0D + "Section [%s] is not allowed in inf fi= le with version 0x%08x" % (=0D + self._SectionName, self._Version),= =0D ExtraData=3Dself._CurrentLine, File=3D= self.MetaFile, Line=3Dself._LineIndex+1)=0D continue=0D # merge two lines specified by '\' in section NMAKE=0D @@ -602,7 +619,7 @@ class InfParser(MetaFileParser): File=3Dself.MetaFile)=0D self._Done()=0D =0D - ## Data parser for the format in which there's path=0D + # Data parser for the format in which there's path=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -618,7 +635,7 @@ class InfParser(MetaFileParser): =0D self._ValueList[Index] =3D ReplaceMacro(Value, Macros)=0D =0D - ## Parse [Sources] section=0D + # Parse [Sources] section=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -630,12 +647,14 @@ class InfParser(MetaFileParser): # For Acpi tables, remove macro like ' TABLE_NAME=3DSata1'=0D if 'COMPONENT_TYPE' in Macros:=0D if self._Defines['COMPONENT_TYPE'].upper() =3D=3D 'ACPITABLE':= =0D - self._ValueList[0] =3D GetSplitValueList(self._ValueList[0= ], ' ', 1)[0]=0D + self._ValueList[0] =3D GetSplitValueList(=0D + self._ValueList[0], ' ', 1)[0]=0D if self._Defines['BASE_NAME'] =3D=3D 'Microcode':=0D pass=0D - self._ValueList =3D [ReplaceMacro(Value, Macros) for Value in self= ._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, Macros)=0D + for Value in self._ValueList]=0D =0D - ## Parse [Binaries] section=0D + # Parse [Binaries] section=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -644,20 +663,23 @@ class InfParser(MetaFileParser): TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= , 2)=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file type or pat= h specified",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if not TokenList[0]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file type specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if not TokenList[1]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file path specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], self._Macr= os)=0D =0D - ## [nmake] section parser (Edk.x style only)=0D + # [nmake] section parser (Edk.x style only)=0D def _NmakeParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D @@ -666,60 +688,65 @@ class InfParser(MetaFileParser): # remove self-reference in macro setting=0D #self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], {self._Va= lueList[0]:''})=0D =0D - ## [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections pa= rser=0D + # [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections par= ser=0D @ParseMacro=0D def _PcdParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= , 1)=0D ValueList =3D GetSplitValueList(TokenList[0], TAB_SPLIT)=0D if len(ValueList) !=3D 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space= GUID and PCD name format",=0D - ExtraData=3Dself._CurrentLine + " (.)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D self._ValueList[0:1] =3D ValueList=0D if len(TokenList) > 1:=0D self._ValueList[2] =3D TokenList[1]=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID= or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + " (.)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D =0D # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE'= , replace with integer 1 or 0.=0D if self._ValueList[2] !=3D '':=0D - InfPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_= SPLIT, 1)=0D + InfPcdValueList =3D GetSplitValueList(=0D + TokenList[1], TAB_VALUE_SPLIT, 1)=0D if InfPcdValueList[0] in ['True', 'true', 'TRUE']:=0D - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '1', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + InfPcdValueList[0], '1', 1)=0D elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:=0D - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '0', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + InfPcdValueList[0], '0', 1)=0D =0D - ## [depex] section parser=0D + # [depex] section parser=0D @ParseMacro=0D def _DepexParser(self):=0D self._ValueList[0:1] =3D [self._CurrentLine]=0D =0D _SectionParser =3D {=0D - MODEL_UNKNOWN : MetaFileParser._Skip,=0D - MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,= =0D - MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionPar= ser,=0D - MODEL_EFI_INCLUDE : _IncludeParser, = # for Edk.x modules=0D - MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, = # for Edk.x modules=0D - MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,=0D - MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,=0D - MODEL_META_DATA_NMAKE : _NmakeParser, = # for Edk.x modules=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX : _PcdParser,=0D - MODEL_PCD_DYNAMIC : _PcdParser,=0D - MODEL_EFI_SOURCE_FILE : _SourceFileParser,=0D - MODEL_EFI_GUID : MetaFileParser._CommonParser,= =0D - MODEL_EFI_PROTOCOL : MetaFileParser._CommonParser,= =0D - MODEL_EFI_PPI : MetaFileParser._CommonParser,= =0D - MODEL_EFI_DEPEX : _DepexParser,=0D - MODEL_EFI_BINARY_FILE : _BinaryFileParser,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_HEADER: MetaFileParser._DefineParser,=0D + MODEL_META_DATA_BUILD_OPTION: MetaFileParser._BuildOptionParser,= =0D + MODEL_EFI_INCLUDE: _IncludeParser, # for Edk.x m= odules=0D + MODEL_EFI_LIBRARY_INSTANCE: MetaFileParser._CommonParser, # fo= r Edk.x modules=0D + MODEL_EFI_LIBRARY_CLASS: MetaFileParser._PathParser,=0D + MODEL_META_DATA_PACKAGE: MetaFileParser._PathParser,=0D + MODEL_META_DATA_NMAKE: _NmakeParser, # for Edk= .x modules=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX: _PcdParser,=0D + MODEL_PCD_DYNAMIC: _PcdParser,=0D + MODEL_EFI_SOURCE_FILE: _SourceFileParser,=0D + MODEL_EFI_GUID: MetaFileParser._CommonParser,=0D + MODEL_EFI_PROTOCOL: MetaFileParser._CommonParser,=0D + MODEL_EFI_PPI: MetaFileParser._CommonParser,=0D + MODEL_EFI_DEPEX: _DepexParser,=0D + MODEL_EFI_BINARY_FILE: _BinaryFileParser,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._Skip,=0D }=0D =0D -## DSC file parser class=0D +# DSC file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D @@ -728,34 +755,36 @@ class InfParser(MetaFileParser): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INCLUDE= directive)=0D #=0D +=0D +=0D class DscParser(MetaFileParser):=0D # DSC file supported data types (one type per section)=0D DataType =3D {=0D - TAB_SKUIDS.upper() : MODEL_EFI_SKU_ID,= =0D - TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_= INSTANCE,=0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_= CLASS,=0D - TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BU= ILD_OPTION,=0D - TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT= _BUILD,=0D - TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABL= E_IN_MODULE,=0D - TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_= FLAG,=0D - TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_= DEFAULT,=0D - TAB_PCDS_DYNAMIC_HII_NULL.upper() : MODEL_PCD_DYNAMIC_= HII,=0D - TAB_PCDS_DYNAMIC_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_= VPD,=0D - TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_DEFAULT,=0D - TAB_PCDS_DYNAMIC_EX_HII_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_HII,=0D - TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_VPD,=0D - TAB_COMPONENTS.upper() : MODEL_META_DATA_CO= MPONENT,=0D - TAB_DSC_DEFINES.upper() : MODEL_META_DATA_HE= ADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DE= FINE,=0D - TAB_DSC_DEFINES_EDKGLOBAL : MODEL_META_DATA_GL= OBAL_DEFINE,=0D - TAB_INCLUDE.upper() : MODEL_META_DATA_IN= CLUDE,=0D - TAB_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IF,=0D - TAB_IF_DEF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IFDEF,=0D - TAB_IF_N_DEF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IFNDEF,=0D - TAB_ELSE_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ELSEIF,=0D - TAB_ELSE.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ELSE,=0D - TAB_END_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ENDIF,=0D - TAB_ERROR.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ERROR,=0D + TAB_SKUIDS.upper(): MODEL_EFI_SKU_ID,=0D + TAB_LIBRARIES.upper(): MODEL_EFI_LIBRARY_INSTANCE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_BUILD_OPTIONS.upper(): MODEL_META_DATA_BUILD_OPTION,=0D + TAB_PCDS_FIXED_AT_BUILD_NULL.upper(): MODEL_PCD_FIXED_AT_BUILD,= =0D + TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(): MODEL_PCD_PATCHABLE_I= N_MODULE,=0D + TAB_PCDS_FEATURE_FLAG_NULL.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper(): MODEL_PCD_DYNAMIC_DEFAULT= ,=0D + TAB_PCDS_DYNAMIC_HII_NULL.upper(): MODEL_PCD_DYNAMIC_HII,=0D + TAB_PCDS_DYNAMIC_VPD_NULL.upper(): MODEL_PCD_DYNAMIC_VPD,=0D + TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper(): MODEL_PCD_DYNAMIC_EX_D= EFAULT,=0D + TAB_PCDS_DYNAMIC_EX_HII_NULL.upper(): MODEL_PCD_DYNAMIC_EX_HII,= =0D + TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper(): MODEL_PCD_DYNAMIC_EX_VPD,= =0D + TAB_COMPONENTS.upper(): MODEL_META_DATA_COMPONENT,=0D + TAB_DSC_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_DSC_DEFINES_EDKGLOBAL: MODEL_META_DATA_GLOBAL_DEFINE,=0D + TAB_INCLUDE.upper(): MODEL_META_DATA_INCLUDE,=0D + TAB_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,=0D + TAB_IF_DEF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,= =0D + TAB_IF_N_DEF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IFND= EF,=0D + TAB_ELSE_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEI= F,=0D + TAB_ELSE.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE,=0D + TAB_END_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF,= =0D + TAB_ERROR.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR,= =0D }=0D =0D # Valid names in define section=0D @@ -784,7 +813,7 @@ class DscParser(MetaFileParser): =0D SymbolPattern =3D ValueExpression.SymbolPattern=0D =0D - ## Constructor of DscParser=0D + # Constructor of DscParser=0D #=0D # Initialize object of DscParser=0D #=0D @@ -812,18 +841,19 @@ class DscParser(MetaFileParser): # Map the ID between the original table and new table to track=0D # the owner item=0D #=0D - self._IdMapping =3D {-1:-1}=0D + self._IdMapping =3D {-1: -1}=0D =0D self.TblFile =3D EccGlobalData.gDb.TblFile=0D self.FileID =3D -1=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D Content =3D ''=0D try:=0D Content =3D open(str(self.MetaFile.Path), 'r').readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D #=0D # Insert a record for file=0D #=0D @@ -834,7 +864,6 @@ class DscParser(MetaFileParser): else:=0D self.FileID =3D self.TblFile.InsertFile(Filename, MODEL_FILE_D= SC)=0D =0D -=0D for Index in range(0, len(Content)):=0D Line =3D CleanString(Content[Index])=0D # skip empty line=0D @@ -880,21 +909,21 @@ class DscParser(MetaFileParser): #=0D for Arch, ModuleType in self._Scope:=0D self._LastItem =3D self._Store(=0D - self._ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - Arch,=0D - ModuleType,=0D - self._Owner[-1],=0D - self.FileID,=0D - self._From,=0D - self._LineIndex+1,=0D - -1,=0D - self._LineIndex+1,=0D - -1,=0D - self._Enabled=0D - )=0D + self._ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + Arch,=0D + ModuleType,=0D + self._Owner[-1],=0D + self.FileID,=0D + self._From,=0D + self._LineIndex+1,=0D + -1,=0D + self._LineIndex+1,=0D + -1,=0D + self._Enabled=0D + )=0D =0D if self._DirectiveStack:=0D Type, Line, Text =3D self._DirectiveStack[-1]=0D @@ -902,7 +931,7 @@ class DscParser(MetaFileParser): ExtraData=3DText, File=3Dself.MetaFile, Line= =3DLine)=0D self._Done()=0D =0D - ## parser=0D + # parser=0D def _SubsectionHeaderParser(self):=0D self._SubsectionName =3D self._CurrentLine[1:-1].upper()=0D if self._SubsectionName in self.DataType:=0D @@ -913,7 +942,7 @@ class DscParser(MetaFileParser): Line=3Dself._LineIndex+1, ExtraData=3Dself._Cur= rentLine)=0D self._ValueList[0] =3D self._SubsectionName=0D =0D - ## Directive statement parser=0D + # Directive statement parser=0D def _DirectiveParser(self):=0D self._ValueList =3D ['', '', '']=0D TokenList =3D GetSplitValueList(self._CurrentLine, ' ', 1)=0D @@ -951,7 +980,8 @@ class DscParser(MetaFileParser): EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after= '!else'",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex+1,=0D ExtraData=3Dself._CurrentLine)=0D - self._DirectiveStack.append((ItemType, self._LineIndex+1, self= ._CurrentLine))=0D + self._DirectiveStack.append(=0D + (ItemType, self._LineIndex+1, self._CurrentLine))=0D elif self._From > 0:=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D "No '!include' allowed in included file",=0D @@ -963,23 +993,23 @@ class DscParser(MetaFileParser): # LineBegin=3D-1, ColumnBegin=3D-1, LineEnd=3D-1, ColumnEnd=3D-1, = Enabled=3D-1=0D #=0D self._LastItem =3D self._Store(=0D - ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - 'COMMON',=0D - 'COMMON',=0D - self._Owner[-1],=0D - self.FileID,=0D - self._From,=0D - self._LineIndex+1,=0D - -1,=0D - self._LineIndex+1,=0D - -1,=0D - 0=0D - )=0D + ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + 'COMMON',=0D + 'COMMON',=0D + self._Owner[-1],=0D + self.FileID,=0D + self._From,=0D + self._LineIndex+1,=0D + -1,=0D + self._LineIndex+1,=0D + -1,=0D + 0=0D + )=0D =0D - ## [defines] section parser=0D + # [defines] section parser=0D @ParseMacro=0D def _DefineParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -993,7 +1023,7 @@ class DscParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "No value specified"= ,=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex+1)=0D if (not self._ValueList[1] in self.DefineKeywords and=0D - (self._InSubsection and self._ValueList[1] not in self.SubSect= ionDefineKeywords)):=0D + (self._InSubsection and self._ValueList[1] not in self.Sub= SectionDefineKeywords)):=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D "Unknown keyword found: %s. "=0D "If this is a macro you must "=0D @@ -1010,11 +1040,11 @@ class DscParser(MetaFileParser): ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex+1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D - ## Parse Edk style of library modules=0D + # Parse Edk style of library modules=0D def _LibraryInstanceParser(self):=0D self._ValueList[0] =3D self._CurrentLine=0D =0D - ## PCD sections parser=0D + # PCD sections parser=0D #=0D # [PcdsFixedAtBuild]=0D # [PcdsPatchableInModule]=0D @@ -1036,20 +1066,24 @@ class DscParser(MetaFileParser): self._ValueList[2] =3D TokenList[1]=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID= or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + " (.|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if self._ValueList[2] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given"= ,=0D - ExtraData=3Dself._CurrentLine + " (.|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE'= , replace with integer 1 or 0.=0D DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_SPLI= T, 1)=0D if DscPcdValueList[0] in ['True', 'true', 'TRUE']:=0D - self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0]= , '1', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + DscPcdValueList[0], '1', 1)=0D elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:=0D - self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0]= , '0', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + DscPcdValueList[0], '0', 1)=0D =0D - ## [components] section parser=0D + # [components] section parser=0D @ParseMacro=0D def _ComponentParser(self):=0D if self._CurrentLine[-1] =3D=3D '{':=0D @@ -1058,27 +1092,30 @@ class DscParser(MetaFileParser): else:=0D self._ValueList[0] =3D self._CurrentLine=0D =0D - ## [LibraryClasses] section=0D + # [LibraryClasses] section=0D @ParseMacro=0D def _LibraryClassParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= )=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library class or= instance specified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if TokenList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library class sp= ecified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library instance= specified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D =0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D + # [BuildOptions] section parser=0D =0D - ## [BuildOptions] section parser=0D @ParseMacro=0D def _BuildOptionParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -1095,15 +1132,17 @@ class DscParser(MetaFileParser): EdkLogger.error(=0D 'Parser',=0D FORMAT_INVALID,=0D - "'%s' must be in format of ____FLAGS" % self._ValueList[1],=0D + "'%s' must be in format of ____FLAGS" % self._ValueList[=0D + 1],=0D ExtraData=3Dself._CurrentLine,=0D File=3Dself.MetaFile,=0D Line=3Dself._LineIndex+1=0D - )=0D + )=0D =0D - ## Override parent's method since we'll do all macro replacements in p= arser=0D + # Override parent's method since we'll do all macro replacements in pa= rser=0D def _GetMacros(self):=0D - Macros =3D dict( [('ARCH', 'IA32'), ('FAMILY', TAB_COMPILER_MSFT),= ('TOOL_CHAIN_TAG', 'VS2008x86'), ('TARGET', 'DEBUG')])=0D + Macros =3D dict([('ARCH', 'IA32'), ('FAMILY', TAB_COMPILER_MSFT),= =0D + ('TOOL_CHAIN_TAG', 'VS2008x86'), ('TARGET', 'DEBUG')= ])=0D Macros.update(self._FileLocalMacros)=0D Macros.update(self._GetApplicableSectionMacro())=0D Macros.update(GlobalData.gEdkGlobal)=0D @@ -1116,39 +1155,40 @@ class DscParser(MetaFileParser): =0D def _PostProcess(self):=0D Processer =3D {=0D - MODEL_META_DATA_SECTION_HEADER : self.__Pro= cessSectionHeader,=0D - MODEL_META_DATA_SUBSECTION_HEADER : self.__Pro= cessSubsectionHeader,=0D - MODEL_META_DATA_HEADER : self.__Pro= cessDefine,=0D - MODEL_META_DATA_DEFINE : self.__Pro= cessDefine,=0D - MODEL_META_DATA_GLOBAL_DEFINE : self.__Pro= cessDefine,=0D - MODEL_META_DATA_INCLUDE : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF : self.__Pro= cessDirective,=0D - MODEL_EFI_SKU_ID : self.__Pro= cessSkuId,=0D - MODEL_EFI_LIBRARY_INSTANCE : self.__Pro= cessLibraryInstance,=0D - MODEL_EFI_LIBRARY_CLASS : self.__Pro= cessLibraryClass,=0D - MODEL_PCD_FIXED_AT_BUILD : self.__Pro= cessPcd,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : self.__Pro= cessPcd,=0D - MODEL_PCD_FEATURE_FLAG : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_DEFAULT : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_HII : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_VPD : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_HII : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_VPD : self.__Pro= cessPcd,=0D - MODEL_META_DATA_COMPONENT : self.__Pro= cessComponent,=0D - MODEL_META_DATA_BUILD_OPTION : self.__Pro= cessBuildOption,=0D - MODEL_UNKNOWN : self._Skip= ,=0D - MODEL_META_DATA_USER_EXTENSION : self._Skip= ,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR : self._Skip= ,=0D + MODEL_META_DATA_SECTION_HEADER: self.__ProcessSectionHeader,= =0D + MODEL_META_DATA_SUBSECTION_HEADER: self.__ProcessSubsectionH= eader,=0D + MODEL_META_DATA_HEADER: self.__ProcessDefine,=0D + MODEL_META_DATA_DEFINE: self.__ProcessDefine,=0D + MODEL_META_DATA_GLOBAL_DEFINE: self.__ProcessDefine,=0D + MODEL_META_DATA_INCLUDE: self.__ProcessDirective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IF: self.__ProcessDire= ctive,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE: self.__ProcessDi= rective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF: self.__ProcessD= irective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF: self.__Process= Directive,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF: self.__ProcessD= irective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF: self.__Process= Directive,=0D + MODEL_EFI_SKU_ID: self.__ProcessSkuId,=0D + MODEL_EFI_LIBRARY_INSTANCE: self.__ProcessLibraryInstance,=0D + MODEL_EFI_LIBRARY_CLASS: self.__ProcessLibraryClass,=0D + MODEL_PCD_FIXED_AT_BUILD: self.__ProcessPcd,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: self.__ProcessPcd,=0D + MODEL_PCD_FEATURE_FLAG: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_DEFAULT: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_HII: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_VPD: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_HII: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_VPD: self.__ProcessPcd,=0D + MODEL_META_DATA_COMPONENT: self.__ProcessComponent,=0D + MODEL_META_DATA_BUILD_OPTION: self.__ProcessBuildOption,=0D + MODEL_UNKNOWN: self._Skip,=0D + MODEL_META_DATA_USER_EXTENSION: self._Skip,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR: self._Skip,=0D }=0D =0D self._RawTable =3D self._Table=0D - self._Table =3D MetaFileStorage(self._RawTable.Cur, self.MetaFile,= MODEL_FILE_DSC, True)=0D + self._Table =3D MetaFileStorage(=0D + self._RawTable.Cur, self.MetaFile, MODEL_FILE_DSC, True)=0D self._DirectiveStack =3D []=0D self._DirectiveEvalStack =3D []=0D self._FileWithError =3D self.MetaFile=0D @@ -1160,7 +1200,7 @@ class DscParser(MetaFileParser): self.__RetrievePcdValue()=0D self._Content =3D self._RawTable.GetAll()=0D self._ContentIndex =3D 0=0D - while self._ContentIndex < len(self._Content) :=0D + while self._ContentIndex < len(self._Content):=0D Id, self._ItemType, V1, V2, V3, S1, S2, Owner, BelongsToFile, = self._From, \=0D LineStart, ColStart, LineEnd, ColEnd, Enabled =3D self._Co= ntent[self._ContentIndex]=0D =0D @@ -1186,30 +1226,32 @@ class DscParser(MetaFileParser): # Line=3Dself._LineIndex+1)=0D except MacroException as Excpt:=0D EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),=0D - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=0D + File=3Dself._FileWithError, ExtraData=3D' = '.join(=0D + self._ValueList),=0D Line=3Dself._LineIndex+1)=0D =0D if self._ValueList is None:=0D continue=0D =0D NewOwner =3D self._IdMapping.get(Owner, -1)=0D - self._Enabled =3D int((not self._DirectiveEvalStack) or (False= not in self._DirectiveEvalStack))=0D + self._Enabled =3D int((not self._DirectiveEvalStack) or (=0D + False not in self._DirectiveEvalStack))=0D self._LastItem =3D self._Store(=0D - self._ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - S1,=0D - S2,=0D - NewOwner,=0D - BelongsToFile,=0D - self._From,=0D - self._LineIndex+1,=0D - -1,=0D - self._LineIndex+1,=0D - -1,=0D - self._Enabled=0D - )=0D + self._ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + S1,=0D + S2,=0D + NewOwner,=0D + BelongsToFile,=0D + self._From,=0D + self._LineIndex+1,=0D + -1,=0D + self._LineIndex+1,=0D + -1,=0D + self._Enabled=0D + )=0D self._IdMapping[Id] =3D self._LastItem=0D =0D RecordList =3D self._Table.GetAll()=0D @@ -1217,7 +1259,8 @@ class DscParser(MetaFileParser): self._RawTable.Drop()=0D self._Table.Drop()=0D for Record in RecordList:=0D - EccGlobalData.gDb.TblDsc.Insert(Record[1], Record[2], Record[3= ], Record[4], Record[5], Record[6], Record[7], Record[8], Record[9], Record= [10], Record[11], Record[12], Record[13], Record[14])=0D + EccGlobalData.gDb.TblDsc.Insert(Record[1], Record[2], Record[3= ], Record[4], Record[5], Record[6],=0D + Record[7], Record[8], Record[9= ], Record[10], Record[11], Record[12], Record[13], Record[14])=0D GlobalData.gPlatformDefines.update(self._FileLocalMacros)=0D self._PostProcessed =3D True=0D self._Content =3D None=0D @@ -1237,7 +1280,8 @@ class DscParser(MetaFileParser): self._SubsectionType =3D MODEL_UNKNOWN=0D =0D def __RetrievePcdValue(self):=0D - Records =3D self._RawTable.Query(MODEL_PCD_FEATURE_FLAG, BelongsTo= Item=3D-1.0)=0D + Records =3D self._RawTable.Query(=0D + MODEL_PCD_FEATURE_FLAG, BelongsToItem=3D-1.0)=0D for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Re= cords:=0D Value, DatumType, MaxDatumSize =3D AnalyzePcdData(Value)=0D # Only use PCD whose value is straitforward (no macro and PCD)= =0D @@ -1250,7 +1294,8 @@ class DscParser(MetaFileParser): continue=0D self._Symbols[Name] =3D Value=0D =0D - Records =3D self._RawTable.Query(MODEL_PCD_FIXED_AT_BUILD, Belongs= ToItem=3D-1.0)=0D + Records =3D self._RawTable.Query(=0D + MODEL_PCD_FIXED_AT_BUILD, BelongsToItem=3D-1.0)=0D for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, ID, Line in Re= cords:=0D Value, DatumType, MaxDatumSize =3D AnalyzePcdData(Value)=0D # Only use PCD whose value is straitforward (no macro and PCD)= =0D @@ -1298,7 +1343,8 @@ class DscParser(MetaFileParser): try:=0D Result =3D ValueExpression(self._ValueList[1], Macros)()=0D except SymbolNotFound as Exc:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueLi= st[1])=0D + EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc),=0D + self._ValueList[1])=0D Result =3D False=0D except WrnExpression as Excpt:=0D #=0D @@ -1306,11 +1352,13 @@ class DscParser(MetaFileParser): # the precise number of line and return the evaluation res= ult=0D #=0D EdkLogger.warn('Parser', "Suspicious expression: %s" % str= (Excpt),=0D - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=0D - Line=3Dself._LineIndex+1)=0D + File=3Dself._FileWithError, ExtraData=3D' '= .join(=0D + self._ValueList),=0D + Line=3Dself._LineIndex+1)=0D Result =3D Excpt.result=0D except BadExpression as Exc:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueLi= st[1])=0D + EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc),=0D + self._ValueList[1])=0D Result =3D False=0D =0D if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,=0D @@ -1321,7 +1369,8 @@ class DscParser(MetaFileParser): Result =3D bool(Result)=0D else:=0D Macro =3D self._ValueList[1]=0D - Macro =3D Macro[2:-1] if (Macro.startswith("$(") and Macro= .endswith(")")) else Macro=0D + Macro =3D Macro[2:-1] if (Macro.startswith("$(")=0D + and Macro.endswith(")")) else Macr= o=0D Result =3D Macro in self._Macros=0D if self._ItemType =3D=3D MODEL_META_DATA_CONDITIONAL_STATE= MENT_IFNDEF:=0D Result =3D not Result=0D @@ -1356,7 +1405,8 @@ class DscParser(MetaFileParser): #=0D __IncludeMacros.update(self._Macros)=0D =0D - IncludedFile =3D NormPath(ReplaceMacro(self._ValueList[1], __I= ncludeMacros, RaiseError=3DTrue))=0D + IncludedFile =3D NormPath(ReplaceMacro(=0D + self._ValueList[1], __IncludeMacros, RaiseError=3DTrue))=0D #=0D # First search the include file under the same directory as DS= C file=0D #=0D @@ -1370,11 +1420,12 @@ class DscParser(MetaFileParser): ErrorCode, ErrorInfo2 =3D IncludedFile1.Validate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error('parser', ErrorCode, File=3Dself._File= WithError,=0D - Line=3Dself._LineIndex+1, ExtraData=3D= ErrorInfo1 + "\n"+ ErrorInfo2)=0D + Line=3Dself._LineIndex+1, ExtraData=3D= ErrorInfo1 + "\n" + ErrorInfo2)=0D =0D self._FileWithError =3D IncludedFile1=0D =0D - IncludedFileTable =3D MetaFileStorage(self._Table.Cur, Include= dFile1, MODEL_FILE_DSC, True)=0D + IncludedFileTable =3D MetaFileStorage(=0D + self._Table.Cur, IncludedFile1, MODEL_FILE_DSC, True)=0D Owner =3D self._Content[self._ContentIndex-1][0]=0D Parser =3D DscParser(IncludedFile1, self._FileType, IncludedFi= leTable,=0D Owner=3DOwner, From=3DOwner)=0D @@ -1390,8 +1441,8 @@ class DscParser(MetaFileParser): # update current status with sub-parser's status=0D self._SectionName =3D Parser._SectionName=0D self._SectionType =3D Parser._SectionType=0D - self._Scope =3D Parser._Scope=0D - self._Enabled =3D Parser._Enabled=0D + self._Scope =3D Parser._Scope=0D + self._Enabled =3D Parser._Enabled=0D =0D # Insert all records in the table for the included file into d= sc file table=0D Records =3D IncludedFileTable.GetAll()=0D @@ -1406,10 +1457,12 @@ class DscParser(MetaFileParser): for Value in self._ValueList]=0D =0D def __ProcessLibraryInstance(self):=0D - self._ValueList =3D [ReplaceMacro(Value, self._Macros) for Value i= n self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, self._Macros)=0D + for Value in self._ValueList]=0D =0D def __ProcessLibraryClass(self):=0D - self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], self._Macr= os, RaiseError=3DTrue)=0D + self._ValueList[1] =3D ReplaceMacro(=0D + self._ValueList[1], self._Macros, RaiseError=3DTrue)=0D =0D def __ProcessPcd(self):=0D ValueList =3D GetSplitValueList(self._ValueList[2])=0D @@ -1444,54 +1497,56 @@ class DscParser(MetaFileParser): for Value in self._ValueList]=0D =0D _SectionParser =3D {=0D - MODEL_META_DATA_HEADER : _DefineParser,= =0D - MODEL_EFI_SKU_ID : _SkuIdParser,= =0D - MODEL_EFI_LIBRARY_INSTANCE : _LibraryInstan= ceParser,=0D - MODEL_EFI_LIBRARY_CLASS : _LibraryClassP= arser,=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC_DEFAULT : _PcdParser,=0D - MODEL_PCD_DYNAMIC_HII : _PcdParser,=0D - MODEL_PCD_DYNAMIC_VPD : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_HII : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_VPD : _PcdParser,=0D - MODEL_META_DATA_COMPONENT : _ComponentPars= er,=0D - MODEL_META_DATA_BUILD_OPTION : _BuildOptionPa= rser,=0D - MODEL_UNKNOWN : MetaFileParser= ._Skip,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser= ._Skip,=0D - MODEL_META_DATA_SECTION_HEADER : MetaFileParser= ._SectionHeaderParser,=0D - MODEL_META_DATA_SUBSECTION_HEADER : _SubsectionHea= derParser,=0D + MODEL_META_DATA_HEADER: _DefineParser,=0D + MODEL_EFI_SKU_ID: _SkuIdParser,=0D + MODEL_EFI_LIBRARY_INSTANCE: _LibraryInstanceParser,=0D + MODEL_EFI_LIBRARY_CLASS: _LibraryClassParser,=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC_DEFAULT: _PcdParser,=0D + MODEL_PCD_DYNAMIC_HII: _PcdParser,=0D + MODEL_PCD_DYNAMIC_VPD: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_HII: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_VPD: _PcdParser,=0D + MODEL_META_DATA_COMPONENT: _ComponentParser,=0D + MODEL_META_DATA_BUILD_OPTION: _BuildOptionParser,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._Skip,=0D + MODEL_META_DATA_SECTION_HEADER: MetaFileParser._SectionHeaderPar= ser,=0D + MODEL_META_DATA_SUBSECTION_HEADER: _SubsectionHeaderParser,=0D }=0D =0D - _Macros =3D property(_GetMacros)=0D + _Macros =3D property(_GetMacros)=0D =0D -## DEC file parser class=0D +# DEC file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D # @param Table Database used to retrieve module/package i= nformation=0D # @param Macros Macros used for replacement in file=0D #=0D +=0D +=0D class DecParser(MetaFileParser):=0D # DEC file supported data types (one type per section)=0D DataType =3D {=0D - TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HE= ADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DE= FINE,=0D - TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,= =0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_= CLASS,=0D - TAB_GUIDS.upper() : MODEL_EFI_GUID,=0D - TAB_PPIS.upper() : MODEL_EFI_PPI,=0D - TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL= ,=0D - TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT= _BUILD,=0D - TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABL= E_IN_MODULE,=0D - TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_= FLAG,=0D - TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,= =0D - TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_= EX,=0D + TAB_DEC_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_INCLUDES.upper(): MODEL_EFI_INCLUDE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_GUIDS.upper(): MODEL_EFI_GUID,=0D + TAB_PPIS.upper(): MODEL_EFI_PPI,=0D + TAB_PROTOCOLS.upper(): MODEL_EFI_PROTOCOL,=0D + TAB_PCDS_FIXED_AT_BUILD_NULL.upper(): MODEL_PCD_FIXED_AT_BUILD,= =0D + TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(): MODEL_PCD_PATCHABLE_I= N_MODULE,=0D + TAB_PCDS_FEATURE_FLAG_NULL.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_PCDS_DYNAMIC_NULL.upper(): MODEL_PCD_DYNAMIC,=0D + TAB_PCDS_DYNAMIC_EX_NULL.upper(): MODEL_PCD_DYNAMIC_EX,=0D }=0D =0D - ## Constructor of DecParser=0D + # Constructor of DecParser=0D #=0D # Initialize object of DecParser=0D #=0D @@ -1514,13 +1569,14 @@ class DecParser(MetaFileParser): self._include_flag =3D False=0D self._package_flag =3D False=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D Content =3D ''=0D try:=0D Content =3D open(str(self.MetaFile), 'r').readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D =0D #=0D # Insert a record for file=0D @@ -1580,7 +1636,7 @@ class DecParser(MetaFileParser): self._LineIndex+1,=0D -1,=0D 0=0D - )=0D + )=0D for Comment, LineNo in self._Comments:=0D self._Store(=0D MODEL_META_DATA_COMMENT,=0D @@ -1596,7 +1652,7 @@ class DecParser(MetaFileParser): LineNo,=0D -1,=0D 0=0D - )=0D + )=0D self._Comments =3D []=0D self._Done()=0D =0D @@ -1605,10 +1661,11 @@ class DecParser(MetaFileParser): for S1, S2, SectionType in self._Scope:=0D for Scope1, Scope2 in [("COMMON", "COMMON"), ("COMMON", S2), (= S1, "COMMON"), (S1, S2)]:=0D if (SectionType, Scope1, Scope2) in self._SectionsMacroDic= t:=0D - Macros.update(self._SectionsMacroDict[(SectionType, Sc= ope1, Scope2)])=0D + Macros.update(=0D + self._SectionsMacroDict[(SectionType, Scope1, Scop= e2)])=0D return Macros=0D =0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D @@ -1631,18 +1688,18 @@ class DecParser(MetaFileParser): self._SectionType.append(self.DataType[self._SectionNa= me])=0D else:=0D EdkLogger.warn("Parser", "Unrecognized section", File=3Dse= lf.MetaFile,=0D - Line=3Dself._LineIndex+1, ExtraData=3Dself= ._CurrentLine)=0D + Line=3Dself._LineIndex+1, ExtraData=3Dself.= _CurrentLine)=0D continue=0D =0D if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._S= ectionType) > 1:=0D EdkLogger.error(=0D - 'Parser',=0D - FORMAT_INVALID,=0D - "%s must not be in the same section of other t= ypes of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,=0D - File=3Dself.MetaFile,=0D - Line=3Dself._LineIndex+1,=0D - ExtraData=3Dself._CurrentLine=0D - )=0D + 'Parser',=0D + FORMAT_INVALID,=0D + "%s must not be in the same section of other types of = PCD" % TAB_PCDS_FEATURE_FLAG_NULL,=0D + File=3Dself.MetaFile,=0D + Line=3Dself._LineIndex+1,=0D + ExtraData=3Dself._CurrentLine=0D + )=0D # S1 is always Arch=0D if len(ItemList) > 1:=0D S1 =3D ItemList[1].upper()=0D @@ -1662,29 +1719,32 @@ class DecParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "'common' ARCH must = not be used with specific ARCHs",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= , ExtraData=3Dself._CurrentLine)=0D =0D - ## [guids], [ppis] and [protocols] section parser=0D + # [guids], [ppis] and [protocols] section parser=0D @ParseMacro=0D def _GuidParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or val= ue specified",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if TokenList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value speci= fied",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if TokenList[1][0] !=3D '{' or TokenList[1][-1] !=3D '}' or GuidSt= ructureStringToGuidString(TokenList[1]) =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value = format",=0D - ExtraData=3Dself._CurrentLine + \=0D - " ( =3D )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D self._ValueList[0] =3D TokenList[0]=0D - #Parse the Guid value format=0D + # Parse the Guid value format=0D GuidValueList =3D TokenList[1].strip(' {}').split(',')=0D Index =3D 0=0D HexList =3D []=0D @@ -1700,15 +1760,16 @@ class DecParser(MetaFileParser): GuidValue =3D GuidValue.lstrip(' {')=0D HexList.append('0x' + str(GuidValue[2:]))=0D Index +=3D 1=0D - self._ValueList[1] =3D "{ %s, %s, %s, { %s, %s, %s, %s, %s, %s= , %s, %s }}" % (HexList[0], HexList[1], HexList[2], HexList[3], HexList[4],= HexList[5], HexList[6], HexList[7], HexList[8], HexList[9], HexList[10])=0D + self._ValueList[1] =3D "{ %s, %s, %s, { %s, %s, %s, %s, %s, %s= , %s, %s }}" % (=0D + HexList[0], HexList[1], HexList[2], HexList[3], HexList[4]= , HexList[5], HexList[6], HexList[7], HexList[8], HexList[9], HexList[10])= =0D else:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value = format",=0D - ExtraData=3Dself._CurrentLine + \=0D - " ( =3D )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D self._ValueList[0] =3D ''=0D =0D - def ParsePcdName(self,namelist):=0D + def ParsePcdName(self, namelist):=0D if "[" in namelist[1]:=0D pcdname =3D namelist[1][:namelist[1].index("[")]=0D arrayindex =3D namelist[1][namelist[1].index("["):]=0D @@ -1716,7 +1777,7 @@ class DecParser(MetaFileParser): if len(namelist) =3D=3D 2:=0D namelist.append(arrayindex)=0D else:=0D - namelist[2] =3D ".".join((arrayindex,namelist[2]))=0D + namelist[2] =3D ".".join((arrayindex, namelist[2]))=0D return namelist=0D =0D def StructPcdParser(self):=0D @@ -1735,10 +1796,12 @@ class DecParser(MetaFileParser): return=0D =0D if self._include_flag:=0D - self._ValueList[1] =3D "_" + md5(self._Curren= tLine.encode('utf-8')).hexdigest()=0D + self._ValueList[1] =3D "_" + \=0D + md5(self._CurrentLine.encode('utf-8')).hexdigest()=0D self._ValueList[2] =3D self._CurrentLine=0D if self._package_flag and "}" !=3D self._CurrentLine:=0D - self._ValueList[1] =3D "_" + md5(self._CurrentLi= ne.encode('utf-8')).hexdigest()=0D + self._ValueList[1] =3D "_" + \=0D + md5(self._CurrentLine.encode('utf-8')).hexdigest()=0D self._ValueList[2] =3D self._CurrentLine=0D if self._CurrentLine =3D=3D "}":=0D self._package_flag =3D False=0D @@ -1759,12 +1822,12 @@ class DecParser(MetaFileParser): else:=0D if self._CurrentStructurePcdName !=3D TAB_SPLIT.join(PcdNa= mes[:2]):=0D EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Name do= es not match: %s and %s " % (=0D - self._CurrentStructurePcdName, TAB_SPLIT.join(PcdNames= [:2])),=0D - File=3Dself.MetaFile, Line=3Dself._Lin= eIndex + 1)=0D + self._CurrentStructurePcdName, TAB_SPLIT.join(PcdN= ames[:2])),=0D + File=3Dself.MetaFile, Line=3Dself._LineIndex + 1)= =0D self._ValueList[1] =3D TAB_SPLIT.join(PcdNames[2:])=0D self._ValueList[2] =3D PcdTockens[1]=0D =0D - ## PCD sections parser=0D + # PCD sections parser=0D #=0D # [PcdsFixedAtBuild]=0D # [PcdsPatchableInModule]=0D @@ -1782,52 +1845,50 @@ class DecParser(MetaFileParser): # check PCD information=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID= or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # check PCD datum information=0D if len(TokenList) < 2 or TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum inform= ation given",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D =0D -=0D - ValueRe =3D re.compile(r'^\s*L?\".*\|.*\"')=0D + ValueRe =3D re.compile(r'^\s*L?\".*\|.*\"')=0D PtrValue =3D ValueRe.findall(TokenList[1])=0D =0D # Has VOID* type string, may contain "|" character in the string.= =0D if len(PtrValue) !=3D 0:=0D ptrValueList =3D re.sub(ValueRe, '', TokenList[1])=0D - ValueList =3D GetSplitValueList(ptrValueList)=0D + ValueList =3D GetSplitValueList(ptrValueList)=0D ValueList[0] =3D PtrValue[0]=0D else:=0D ValueList =3D GetSplitValueList(TokenList[1])=0D =0D -=0D # check if there's enough datum information given=0D if len(ValueList) !=3D 3:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Datum i= nformation given",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # check default value=0D if ValueList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing DefaultValu= e in PCD Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # check datum type=0D if ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumType i= n PCD Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # check token of the PCD=0D if ValueList[2] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token in PC= D Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|= ||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D # check format of default value against the datum type=0D IsValid, Cause =3D CheckPcdDatum(ValueList[1], ValueList[0])=0D @@ -1835,7 +1896,8 @@ class DecParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, Cause, ExtraData=3Ds= elf._CurrentLine,=0D File=3Dself.MetaFile, Line=3Dself._LineIndex+1= )=0D if Cause =3D=3D "StructurePcd":=0D - self._CurrentStructurePcdName =3D TAB_SPLIT.join(self._ValueLi= st[0:2])=0D + self._CurrentStructurePcdName =3D TAB_SPLIT.join(=0D + self._ValueList[0:2])=0D self._ValueList[0] =3D self._CurrentStructurePcdName=0D self._ValueList[1] =3D ValueList[1].strip()=0D =0D @@ -1848,7 +1910,8 @@ class DecParser(MetaFileParser): # check @ValidRange, @ValidList and @Expression format valid=0D ErrorCodeValid =3D '0x0 <=3D %s <=3D 0xFFFFFFFF'=0D PatternValidRangeIn =3D '(NOT)?\s*(\d+\s*-\s*\d+|0[xX][a-fA-F0= -9]+\s*-\s*0[xX][a-fA-F0-9]+|LT\s*\d+|LT\s*0[xX][a-fA-F0-9]+|GT\s*\d+|GT\s*= 0[xX][a-fA-F0-9]+|LE\s*\d+|LE\s*0[xX][a-fA-F0-9]+|GE\s*\d+|GE\s*0[xX][a-fA-= F0-9]+|XOR\s*\d+|XOR\s*0[xX][a-fA-F0-9]+|EQ\s*\d+|EQ\s*0[xX][a-fA-F0-9]+)'= =0D - PatternValidRng =3D re.compile('^' + '(NOT)?\s*' + PatternVali= dRangeIn + '$')=0D + PatternValidRng =3D re.compile(=0D + '^' + '(NOT)?\s*' + PatternValidRangeIn + '$')=0D for Comment in self._Comments:=0D Comm =3D Comment[0].strip()=0D if not Comm:=0D @@ -1871,11 +1934,14 @@ class DecParser(MetaFileParser): ErrorCode, Expression =3D ErrorCode.strip(), Expre= ssion.strip()=0D try:=0D if not eval(ErrorCodeValid % ErrorCode):=0D - EdkLogger.warn('Parser', '@ValidRange Erro= rCode(%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0])= )=0D + EdkLogger.warn(=0D + 'Parser', '@ValidRange ErrorCode(%s) o= f PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D except:=0D - EdkLogger.warn('Parser', '@ValidRange ErrorCod= e(%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D + EdkLogger.warn(=0D + 'Parser', '@ValidRange ErrorCode(%s) of PC= D %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D if not PatternValidRng.search(Expression):=0D - EdkLogger.warn('Parser', '@ValidRange Expressi= on(%s) of PCD %s is incorrect format.' % (Expression, TokenList[0]))=0D + EdkLogger.warn(=0D + 'Parser', '@ValidRange Expression(%s) of P= CD %s is incorrect format.' % (Expression, TokenList[0]))=0D if ValidFormt[0:10] =3D=3D '@ValidList':=0D ValidFormt =3D ValidFormt[10:]=0D ValidFormt =3D ValidFormt.lstrip()=0D @@ -1887,16 +1953,19 @@ class DecParser(MetaFileParser): ErrorCode, Expression =3D ErrorCode.strip(), Expre= ssion.strip()=0D try:=0D if not eval(ErrorCodeValid % ErrorCode):=0D - EdkLogger.warn('Parser', '@ValidList Error= Code(%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))= =0D + EdkLogger.warn(=0D + 'Parser', '@ValidList ErrorCode(%s) of= PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D except:=0D - EdkLogger.warn('Parser', '@ValidList ErrorCode= (%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D + EdkLogger.warn(=0D + 'Parser', '@ValidList ErrorCode(%s) of PCD= %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D Values =3D Expression.split(',')=0D for Value in Values:=0D Value =3D Value.strip()=0D try:=0D eval(Value)=0D except:=0D - EdkLogger.warn('Parser', '@ValidList Expre= ssion of PCD %s include a invalid value(%s).' % (TokenList[0], Value))=0D + EdkLogger.warn(=0D + 'Parser', '@ValidList Expression of PC= D %s include a invalid value(%s).' % (TokenList[0], Value))=0D break=0D if ValidFormt[0:11] =3D=3D '@Expression':=0D ValidFormt =3D ValidFormt[11:]=0D @@ -1909,15 +1978,20 @@ class DecParser(MetaFileParser): ErrorCode, Expression =3D ErrorCode.strip(), Expre= ssion.strip()=0D try:=0D if not eval(ErrorCodeValid % ErrorCode):=0D - EdkLogger.warn('Parser', '@Expression Erro= rCode(%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0])= )=0D + EdkLogger.warn(=0D + 'Parser', '@Expression ErrorCode(%s) o= f PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D except:=0D - EdkLogger.warn('Parser', '@Expression ErrorCod= e(%s) of PCD %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D + EdkLogger.warn(=0D + 'Parser', '@Expression ErrorCode(%s) of PC= D %s is not valid UINT32 value.' % (ErrorCode, TokenList[0]))=0D if not Expression:=0D - EdkLogger.warn('Parser', '@Expression Expressi= on of PCD %s is incorrect format.' % TokenList[0])=0D + EdkLogger.warn(=0D + 'Parser', '@Expression Expression of PCD %= s is incorrect format.' % TokenList[0])=0D if not Description:=0D - EdkLogger.warn('Parser', 'PCD %s Description information i= s not provided.' % TokenList[0])=0D + EdkLogger.warn(=0D + 'Parser', 'PCD %s Description information is not provi= ded.' % TokenList[0])=0D if not Prompt:=0D - EdkLogger.warn('Parser', 'PCD %s Prompt information is not= provided.' % TokenList[0])=0D + EdkLogger.warn(=0D + 'Parser', 'PCD %s Prompt information is not provided.'= % TokenList[0])=0D # check Description, Prompt localization information=0D if self._UniObj:=0D self._UniObj.CheckPcdInfo(TokenList[0])=0D @@ -1927,26 +2001,27 @@ class DecParser(MetaFileParser): elif ValueList[0] in ['False', 'false', 'FALSE']:=0D ValueList[0] =3D '0'=0D =0D - self._ValueList[2] =3D ValueList[0].strip() + '|' + ValueList[1].s= trip() + '|' + ValueList[2].strip()=0D + self._ValueList[2] =3D ValueList[0].strip(=0D + ) + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()=0D =0D _SectionParser =3D {=0D - MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,= =0D - MODEL_EFI_INCLUDE : MetaFileParser._PathParser,=0D - MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,=0D - MODEL_EFI_GUID : _GuidParser,=0D - MODEL_EFI_PPI : _GuidParser,=0D - MODEL_EFI_PROTOCOL : _GuidParser,=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX : _PcdParser,=0D - MODEL_UNKNOWN : MetaFileParser._Skip,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser._Skip,=0D + MODEL_META_DATA_HEADER: MetaFileParser._DefineParser,=0D + MODEL_EFI_INCLUDE: MetaFileParser._PathParser,=0D + MODEL_EFI_LIBRARY_CLASS: MetaFileParser._PathParser,=0D + MODEL_EFI_GUID: _GuidParser,=0D + MODEL_EFI_PPI: _GuidParser,=0D + MODEL_EFI_PROTOCOL: _GuidParser,=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX: _PcdParser,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._Skip,=0D }=0D =0D =0D -## Fdf=0D +# Fdf=0D #=0D # This class defined the structure used in Fdf object=0D #=0D @@ -1954,7 +2029,7 @@ class DecParser(MetaFileParser): # @param WorkspaceDir: Input value for current workspace directory, defau= lt is None=0D #=0D class Fdf(object):=0D - def __init__(self, Filename =3D None, IsToDatabase =3D False, Workspac= eDir =3D None, Database =3D None):=0D + def __init__(self, Filename=3DNone, IsToDatabase=3DFalse, WorkspaceDir= =3DNone, Database=3DNone):=0D self.WorkspaceDir =3D WorkspaceDir=0D self.IsToDatabase =3D IsToDatabase=0D =0D @@ -1985,13 +2060,13 @@ class Fdf(object): =0D return self.FileList[Filename]=0D =0D -=0D - ## Load Fdf file=0D + # Load Fdf file=0D #=0D # Load the file if it exists=0D #=0D # @param Filename: Input value for filename of Fdf file=0D #=0D +=0D def LoadFdfFile(self, Filename):=0D FileList =3D []=0D #=0D @@ -2006,7 +2081,7 @@ class Fdf(object): #=0D if self.IsToDatabase:=0D (Model, Value1, Value2, Value3, Scope1, Scope2, BelongsToItem,= BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled) =3D \= =0D - (0, '', '', '', 'COMMON', 'COMMON', -1, -1, -1, -1, -1, -1, 0)= =0D + (0, '', '', '', 'COMMON', 'COMMON', -1, -1, -1, -1, -1, -1= , 0)=0D for Index in range(0, len(Fdf.Profile.PcdDict)):=0D pass=0D for Key in Fdf.Profile.PcdDict.keys():=0D @@ -2016,7 +2091,8 @@ class Fdf(object): FileName =3D Fdf.Profile.PcdFileLineDict[Key][0]=0D StartLine =3D Fdf.Profile.PcdFileLineDict[Key][1]=0D BelongsToFile =3D self.InsertFile(FileName)=0D - self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, = Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled)=0D + self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, = Scope2, BelongsToItem,=0D + BelongsToFile, StartLine, StartColumn, = EndLine, EndColumn, Enabled)=0D for Index in range(0, len(Fdf.Profile.InfList)):=0D Model =3D MODEL_META_DATA_COMPONENT=0D Value1 =3D Fdf.Profile.InfList[Index]=0D @@ -2024,7 +2100,9 @@ class Fdf(object): FileName =3D Fdf.Profile.InfFileLineList[Index][0]=0D StartLine =3D Fdf.Profile.InfFileLineList[Index][1]=0D BelongsToFile =3D self.InsertFile(FileName)=0D - self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, = Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled)=0D + self.TblFdf.Insert(Model, Value1, Value2, Value3, Scope1, = Scope2, BelongsToItem,=0D + BelongsToFile, StartLine, StartColumn, = EndLine, EndColumn, Enabled)=0D +=0D =0D class UniParser(object):=0D # IsExtraUni defined the UNI file is Module UNI or extra Module UNI=0D @@ -2040,11 +2118,14 @@ class UniParser(object): =0D def __read(self):=0D try:=0D - self.FileIn =3D CodecOpenLongFilePath(self.FilePath, Mode=3D'r= b', Encoding=3D'utf_8').read()=0D + self.FileIn =3D CodecOpenLongFilePath(=0D + self.FilePath, Mode=3D'rb', Encoding=3D'utf_8').read()=0D except UnicodeError:=0D - self.FileIn =3D CodecOpenLongFilePath(self.FilePath, Mode=3D'r= b', Encoding=3D'utf_16').read()=0D + self.FileIn =3D CodecOpenLongFilePath(=0D + self.FilePath, Mode=3D'rb', Encoding=3D'utf_16').read()=0D except UnicodeError:=0D - self.FileIn =3D CodecOpenLongFilePath(self.FilePath, Mode=3D'r= b', Encoding=3D'utf_16_le').read()=0D + self.FileIn =3D CodecOpenLongFilePath(=0D + self.FilePath, Mode=3D'rb', Encoding=3D'utf_16_le').read()= =0D except IOError:=0D self.FileIn =3D ""=0D =0D @@ -2056,7 +2137,8 @@ class UniParser(object): else:=0D ModuleAbstract =3D self.CheckKeyValid('STR_MODULE_ABSTRACT= ')=0D self.PrintLog('STR_MODULE_ABSTRACT', ModuleAbstract)=0D - ModuleDescription =3D self.CheckKeyValid('STR_MODULE_DESCR= IPTION')=0D + ModuleDescription =3D self.CheckKeyValid(=0D + 'STR_MODULE_DESCRIPTION')=0D self.PrintLog('STR_MODULE_DESCRIPTION', ModuleDescription)= =0D else:=0D if self.IsExtraUni:=0D @@ -2065,13 +2147,15 @@ class UniParser(object): else:=0D PackageAbstract =3D self.CheckKeyValid('STR_PACKAGE_ABSTRA= CT')=0D self.PrintLog('STR_PACKAGE_ABSTRACT', PackageAbstract)=0D - PackageDescription =3D self.CheckKeyValid('STR_PACKAGE_DES= CRIPTION')=0D + PackageDescription =3D self.CheckKeyValid(=0D + 'STR_PACKAGE_DESCRIPTION')=0D self.PrintLog('STR_PACKAGE_DESCRIPTION', PackageDescriptio= n)=0D =0D def CheckKeyValid(self, Key, Contents=3DNone):=0D if not Contents:=0D Contents =3D self.FileIn=0D - KeyPattern =3D re.compile('#string\s+%s\s+.*?#language.*?".*?"' % = Key, re.S)=0D + KeyPattern =3D re.compile(=0D + '#string\s+%s\s+.*?#language.*?".*?"' % Key, re.S)=0D if KeyPattern.search(Contents):=0D return True=0D return False=0D @@ -2088,9 +2172,11 @@ class UniParser(object): if not Value and Key not in self.Missing:=0D Msg =3D '%s is missing in the %s file.' % (Key, self.FileName)= =0D EdkLogger.warn('Parser', Msg)=0D - EccGlobalData.gDb.TblReport.Insert(EccToolError.ERROR_GENERAL_= CHECK_UNI_HELP_INFO, OtherMsg=3DMsg, BelongsToTable=3D'File', BelongsToItem= =3D-2)=0D + EccGlobalData.gDb.TblReport.Insert(=0D + EccToolError.ERROR_GENERAL_CHECK_UNI_HELP_INFO, OtherMsg= =3DMsg, BelongsToTable=3D'File', BelongsToItem=3D-2)=0D self.Missing.append(Key)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -2098,4 +2184,3 @@ class UniParser(object): #=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py= b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py index 0914aec460f5..9f7f8b5fc7c7 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase a meta file table=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -17,11 +17,12 @@ import Ecc.EccGlobalData as EccGlobalData from Ecc.MetaFileWorkspace.MetaDataTable import Table=0D from Ecc.MetaFileWorkspace.MetaDataTable import ConvertToSqlString=0D from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODE= L_FILE_INF, \=0D - MODEL_FILE_OTHERS=0D + MODEL_FILE_OTHERS=0D +=0D =0D class MetaFileTable(Table):=0D - ## Constructor=0D - def __init__(self, Cursor, MetaFile, FileType, TableName, Temporary = =3D False):=0D + # Constructor=0D + def __init__(self, Cursor, MetaFile, FileType, TableName, Temporary=3D= False):=0D self.MetaFile =3D MetaFile=0D self.TblFile =3D EccGlobalData.gDb.TblFile=0D if (FileType =3D=3D MODEL_FILE_INF):=0D @@ -38,7 +39,7 @@ class MetaFileTable(Table): self.Create(False)=0D =0D =0D -## Python class representation of table storing module data=0D +# Python class representation of table storing module data=0D class ModuleTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -60,11 +61,11 @@ class ModuleTable(MetaFileTable): # used as table end flag, in case the changes to database is not commi= tted to db file=0D _DUMMY_ =3D "-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1, -1"=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Cursor):=0D MetaFileTable.__init__(self, Cursor, '', MODEL_FILE_INF, "Inf", Fa= lse)=0D =0D - ## Insert a record into table Inf=0D + # Insert a record into table Inf=0D #=0D # @param Model: Model of a Inf item=0D # @param Value1: Value1 of a Inf item=0D @@ -80,27 +81,28 @@ class ModuleTable(MetaFileTable): # @param Enabled: If this item enabled=0D #=0D def Insert(self, Model, Value1, Value2, Value3, Scope1=3D'COMMON', Sco= pe2=3D'COMMON',=0D - BelongsToItem=3D-1, BelongsToFile =3D -1, StartLine=3D-1, S= tartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0, Usage=3D''):=0D - (Value1, Value2, Value3, Usage, Scope1, Scope2) =3D ConvertToSqlSt= ring((Value1, Value2, Value3, Usage, Scope1, Scope2))=0D + BelongsToItem=3D-1, BelongsToFile=3D-1, StartLine=3D-1, Sta= rtColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0, Usage=3D''):=0D + (Value1, Value2, Value3, Usage, Scope1, Scope2) =3D ConvertToSqlSt= ring(=0D + (Value1, Value2, Value3, Usage, Scope1, Scope2))=0D return Table.Insert(=0D - self,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Usage,=0D - Scope1,=0D - Scope2,=0D - BelongsToItem,=0D - BelongsToFile,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - )=0D + self,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Usage,=0D + Scope1,=0D + Scope2,=0D + BelongsToItem,=0D + BelongsToFile,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + )=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Arch: The Arch attribute of Record=0D @@ -117,10 +119,13 @@ class ModuleTable(MetaFileTable): if Platform is not None and Platform !=3D 'COMMON':=0D ConditionString +=3D " AND (Scope2=3D'%s' OR Scope2=3D'COMMON'= OR Scope2=3D'DEFAULT')" % Platform=0D =0D - SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (ValueString, self.T= able, ConditionString)=0D + SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (=0D + ValueString, self.Table, ConditionString)=0D return self.Exec(SqlCommand)=0D =0D -## Python class representation of table storing package data=0D +# Python class representation of table storing package data=0D +=0D +=0D class PackageTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -141,11 +146,11 @@ class PackageTable(MetaFileTable): # used as table end flag, in case the changes to database is not commi= tted to db file=0D _DUMMY_ =3D "-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1, -1"=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Cursor):=0D MetaFileTable.__init__(self, Cursor, '', MODEL_FILE_DEC, "Dec", Fa= lse)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dec=0D #=0D @@ -163,26 +168,27 @@ class PackageTable(MetaFileTable): # @param Enabled: If this item enabled=0D #=0D def Insert(self, Model, Value1, Value2, Value3, Scope1=3D'COMMON', Sco= pe2=3D'COMMON',=0D - BelongsToItem=3D-1, BelongsToFile =3D -1, StartLine=3D-1, S= tartColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0):=0D - (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2))=0D + BelongsToItem=3D-1, BelongsToFile=3D-1, StartLine=3D-1, Sta= rtColumn=3D-1, EndLine=3D-1, EndColumn=3D-1, Enabled=3D0):=0D + (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString(=0D + (Value1, Value2, Value3, Scope1, Scope2))=0D return Table.Insert(=0D - self,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Scope1,=0D - Scope2,=0D - BelongsToItem,=0D - BelongsToFile,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - )=0D + self,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Scope1,=0D + Scope2,=0D + BelongsToItem,=0D + BelongsToFile,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + )=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Arch: The Arch attribute of Record=0D @@ -196,10 +202,13 @@ class PackageTable(MetaFileTable): if Arch is not None and Arch !=3D 'COMMON':=0D ConditionString +=3D " AND (Scope1=3D'%s' OR Scope1=3D'COMMON'= )" % Arch=0D =0D - SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (ValueString, self.T= able, ConditionString)=0D + SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (=0D + ValueString, self.Table, ConditionString)=0D return self.Exec(SqlCommand)=0D =0D -## Python class representation of table storing platform data=0D +# Python class representation of table storing platform data=0D +=0D +=0D class PlatformTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -221,11 +230,12 @@ class PlatformTable(MetaFileTable): # used as table end flag, in case the changes to database is not commi= tted to db file=0D _DUMMY_ =3D "-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1, -1, -1"=0D =0D - ## Constructor=0D - def __init__(self, Cursor, MetaFile =3D '', FileType =3D MODEL_FILE_DS= C, Temporary =3D False):=0D - MetaFileTable.__init__(self, Cursor, MetaFile, FileType, "Dsc", Te= mporary)=0D + # Constructor=0D + def __init__(self, Cursor, MetaFile=3D'', FileType=3DMODEL_FILE_DSC, T= emporary=3DFalse):=0D + MetaFileTable.__init__(self, Cursor, MetaFile,=0D + FileType, "Dsc", Temporary)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dsc=0D #=0D @@ -243,28 +253,29 @@ class PlatformTable(MetaFileTable): # @param EndColumn: EndColumn of a Dsc item=0D # @param Enabled: If this item enabled=0D #=0D - def Insert(self, Model, Value1, Value2, Value3, Scope1=3D'COMMON', Sco= pe2=3D'COMMON', BelongsToItem=3D-1, BelongsToFile =3D -1,=0D + def Insert(self, Model, Value1, Value2, Value3, Scope1=3D'COMMON', Sco= pe2=3D'COMMON', BelongsToItem=3D-1, BelongsToFile=3D-1,=0D FromItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLine=3D= -1, EndColumn=3D-1, Enabled=3D1):=0D - (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2))=0D + (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString(=0D + (Value1, Value2, Value3, Scope1, Scope2))=0D return Table.Insert(=0D - self,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Scope1,=0D - Scope2,=0D - BelongsToItem,=0D - BelongsToFile,=0D - FromItem,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - )=0D + self,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Scope1,=0D + Scope2,=0D + BelongsToItem,=0D + BelongsToFile,=0D + FromItem,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + )=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Scope1: Arch of a Dsc item=0D @@ -291,25 +302,28 @@ class PlatformTable(MetaFileTable): if FromItem is not None:=0D ConditionString +=3D " AND FromItem=3D%s" % FromItem=0D =0D - SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (ValueString, self.T= able, ConditionString)=0D + SqlCommand =3D "SELECT %s FROM %s WHERE %s" % (=0D + ValueString, self.Table, ConditionString)=0D return self.Exec(SqlCommand)=0D =0D -## Factory class to produce different storage for different type of meta-f= ile=0D +# Factory class to produce different storage for different type of meta-fi= le=0D +=0D +=0D class MetaFileStorage(object):=0D _FILE_TABLE_ =3D {=0D - MODEL_FILE_INF : ModuleTable,=0D - MODEL_FILE_DEC : PackageTable,=0D - MODEL_FILE_DSC : PlatformTable,=0D - MODEL_FILE_OTHERS : MetaFileTable,=0D + MODEL_FILE_INF: ModuleTable,=0D + MODEL_FILE_DEC: PackageTable,=0D + MODEL_FILE_DSC: PlatformTable,=0D + MODEL_FILE_OTHERS: MetaFileTable,=0D }=0D =0D _FILE_TYPE_ =3D {=0D - ".inf" : MODEL_FILE_INF,=0D - ".dec" : MODEL_FILE_DEC,=0D - ".dsc" : MODEL_FILE_DSC,=0D + ".inf": MODEL_FILE_INF,=0D + ".dec": MODEL_FILE_DEC,=0D + ".dsc": MODEL_FILE_DSC,=0D }=0D =0D - ## Constructor=0D + # Constructor=0D def __new__(Class, Cursor, MetaFile, FileType=3DNone, Temporary=3DFals= e):=0D # no type given, try to find one=0D if not FileType:=0D @@ -326,4 +340,3 @@ class MetaFileStorage(object): =0D # create the storage object and return it to caller=0D return Class._FILE_TABLE_[FileType](*Args)=0D -=0D diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py b/Ba= seTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py index 85ae9937c43f..400adb76a0aa 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Workspace' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Ecc/ParserWarning.py b/BaseTools/Sourc= e/Python/Ecc/ParserWarning.py index 2ae66d48487e..bf192b9a593c 100644 --- a/BaseTools/Source/Python/Ecc/ParserWarning.py +++ b/BaseTools/Source/Python/Ecc/ParserWarning.py @@ -1,23 +1,23 @@ -## @file=0D +# @file=0D # This file is used to be the warning class of ECC tool=0D #=0D # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## The exception class that used to report error messages when preprocessi= ng=0D +# The exception class that used to report error messages when preprocessin= g=0D #=0D # Currently the "ToolName" is set to be "ECC PP".=0D #=0D class Warning (Exception):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D # @param File The FDF name=0D # @param Line The Line number that error occurs=0D #=0D - def __init__(self, Str, File =3D None, Line =3D None):=0D + def __init__(self, Str, File=3DNone, Line=3DNone):=0D self.message =3D Str=0D self.FileName =3D File=0D self.LineNumber =3D Line=0D diff --git a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py b/BaseTools/Sou= rce/Python/Ecc/Xml/XmlRoutines.py index b02f663b15a5..123cf66f7303 100644 --- a/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py +++ b/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This is an XML API that uses a syntax similar to XPath, but it is writte= n in=0D # standard python so that no extra python packages are required to use it.= =0D #=0D @@ -14,7 +14,7 @@ import xml.dom.minidom import codecs=0D from Common.LongFilePathSupport import OpenLongFilePath as open=0D =0D -## Create a element of XML=0D +# Create a element of XML=0D #=0D # @param Name=0D # @param String=0D @@ -23,6 +23,8 @@ from Common.LongFilePathSupport import OpenLongFilePath a= s open #=0D # @revel Element=0D #=0D +=0D +=0D def CreateXmlElement(Name, String, NodeList, AttributeList):=0D Doc =3D xml.dom.minidom.Document()=0D Element =3D Doc.createElement(Name)=0D @@ -47,7 +49,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): =0D return Element=0D =0D -## Get a list of XML nodes using XPath style syntax.=0D +# Get a list of XML nodes using XPath style syntax.=0D #=0D # Return a list of XML DOM nodes from the root Dom specified by XPath Stri= ng.=0D # If the input Dom or String is not valid, then an empty list is returned.= =0D @@ -57,6 +59,8 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): #=0D # @revel Nodes A list of XML nodes matching XPath style Stin= g.=0D #=0D +=0D +=0D def XmlList(Dom, String):=0D if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D "":= =0D return []=0D @@ -83,7 +87,7 @@ def XmlList(Dom, String): return Nodes=0D =0D =0D -## Get a single XML node using XPath style syntax.=0D +# Get a single XML node using XPath style syntax.=0D #=0D # Return a single XML DOM node from the root Dom specified by XPath String= .=0D # If the input Dom or String is not valid, then an empty string is returne= d.=0D @@ -94,7 +98,7 @@ def XmlList(Dom, String): # @revel Node A single XML node matching XPath style Sting.= =0D #=0D def XmlNode(Dom, String):=0D - if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D ""= :=0D + if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D "":= =0D return ""=0D if Dom.nodeType =3D=3D Dom.DOCUMENT_NODE:=0D Dom =3D Dom.documentElement=0D @@ -116,7 +120,7 @@ def XmlNode(Dom, String): return ""=0D =0D =0D -## Get a single XML element using XPath style syntax.=0D +# Get a single XML element using XPath style syntax.=0D #=0D # Return a single XML element from the root Dom specified by XPath String.= =0D # If the input Dom or String is not valid, then an empty string is returne= d.=0D @@ -133,7 +137,7 @@ def XmlElement(Dom, String): return ""=0D =0D =0D -## Get a single XML element of the current node.=0D +# Get a single XML element of the current node.=0D #=0D # Return a single XML element specified by the current root Dom.=0D # If the input Dom is not valid, then an empty string is returned.=0D @@ -149,7 +153,7 @@ def XmlElementData(Dom): return ""=0D =0D =0D -## Get a list of XML elements using XPath style syntax.=0D +# Get a list of XML elements using XPath style syntax.=0D #=0D # Return a list of XML elements from the root Dom specified by XPath Strin= g.=0D # If the input Dom or String is not valid, then an empty list is returned.= =0D @@ -163,7 +167,7 @@ def XmlElementList(Dom, String): return map(XmlElementData, XmlList(Dom, String))=0D =0D =0D -## Get the XML attribute of the current node.=0D +# Get the XML attribute of the current node.=0D #=0D # Return a single XML attribute named Attribute from the current root Dom.= =0D # If the input Dom or Attribute is not valid, then an empty string is retu= rned.=0D @@ -180,7 +184,7 @@ def XmlAttribute(Dom, Attribute): return ''=0D =0D =0D -## Get the XML node name of the current node.=0D +# Get the XML node name of the current node.=0D #=0D # Return a single XML node name from the current root Dom.=0D # If the input Dom is not valid, then an empty string is returned.=0D @@ -195,7 +199,7 @@ def XmlNodeName(Dom): except:=0D return ''=0D =0D -## Parse an XML file.=0D +# Parse an XML file.=0D #=0D # Parse the input XML file named FileName and return a XML DOM it stands f= or.=0D # If the input File is not a valid XML file, then an empty string is retur= ned.=0D @@ -204,9 +208,11 @@ def XmlNodeName(Dom): #=0D # @revel Dom The Dom object achieved from the XML file.=0D #=0D +=0D +=0D def XmlParseFile(FileName):=0D try:=0D - XmlFile =3D codecs.open(FileName,encoding=3D'utf_8_sig')=0D + XmlFile =3D codecs.open(FileName, encoding=3D'utf_8_sig')=0D Dom =3D xml.dom.minidom.parse(XmlFile)=0D XmlFile.close()=0D return Dom=0D @@ -214,12 +220,15 @@ def XmlParseFile(FileName): print(X)=0D return ""=0D =0D +=0D # This acts like the main() function for the script, unless it is 'import'= ed=0D # into another script.=0D if __name__ =3D=3D '__main__':=0D # Nothing to do here. Could do some unit tests.=0D - A =3D CreateXmlElement('AAA', 'CCC', [['AAA', '111'], ['BBB', '222']]= , [['A', '1'], ['B', '2']])=0D - B =3D CreateXmlElement('ZZZ', 'CCC', [['XXX', '111'], ['YYY', '222']]= , [['A', '1'], ['B', '2']])=0D + A =3D CreateXmlElement('AAA', 'CCC', [['AAA', '111'], ['BBB', '222']]= , [=0D + ['A', '1'], ['B', '2']])=0D + B =3D CreateXmlElement('ZZZ', 'CCC', [['XXX', '111'], ['YYY', '222']]= , [=0D + ['A', '1'], ['B', '2']])=0D C =3D CreateXmlList('DDD', 'EEE', [A, B], ['FFF', 'GGG'])=0D - print(C.toprettyxml(indent =3D " "))=0D + print(C.toprettyxml(indent=3D" "))=0D pass=0D diff --git a/BaseTools/Source/Python/Ecc/Xml/__init__.py b/BaseTools/Source= /Python/Ecc/Xml/__init__.py index 172e498451b8..03dedeed636e 100644 --- a/BaseTools/Source/Python/Ecc/Xml/__init__.py +++ b/BaseTools/Source/Python/Ecc/Xml/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Ecc/__init__.py b/BaseTools/Source/Pyt= hon/Ecc/__init__.py index a1cac674d619..a8fa5404c7bb 100644 --- a/BaseTools/Source/Python/Ecc/__init__.py +++ b/BaseTools/Source/Python/Ecc/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Ecc' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc= /c.py index 61ad084fcc5b..e569cd3b408c 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to be the c coding style checking of ECC tool=0D #=0D # Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
        =0D @@ -28,30 +28,38 @@ ComplexTypeDict =3D {} SUDict =3D {}=0D IgnoredKeywordList =3D ['EFI_ERROR']=0D =0D +=0D def GetIgnoredDirListPattern():=0D skipList =3D list(EccGlobalData.gConfig.SkipDirList) + ['.svn']=0D DirString =3D '|'.join(skipList)=0D p =3D re.compile(r'.*[\\/](?:%s)[\\/]?.*' % DirString)=0D return p=0D =0D +=0D def GetFuncDeclPattern():=0D - p =3D re.compile(r'(?:EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*= [_\w]+\s*\(.*\)$', re.DOTALL)=0D + p =3D re.compile(=0D + r'(?:EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*[_\w]+\s*\(.*= \)$', re.DOTALL)=0D return p=0D =0D +=0D def GetArrayPattern():=0D p =3D re.compile(r'[_\w]*\s*[\[.*\]]+')=0D return p=0D =0D +=0D def GetTypedefFuncPointerPattern():=0D p =3D re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOT= ALL)=0D return p=0D =0D +=0D def GetDB():=0D return EccGlobalData.gDb=0D =0D +=0D def GetConfig():=0D return EccGlobalData.gConfig=0D =0D +=0D def PrintErrorMsg(ErrorType, Msg, TableName, ItemId):=0D Msg =3D Msg.replace('\n', '').replace('\r', '')=0D MsgPartList =3D Msg.split()=0D @@ -59,7 +67,9 @@ def PrintErrorMsg(ErrorType, Msg, TableName, ItemId): for Part in MsgPartList:=0D Msg +=3D Part=0D Msg +=3D ' '=0D - GetDB().TblReport.Insert(ErrorType, OtherMsg=3DMsg, BelongsToTable=3DT= ableName, BelongsToItem=3DItemId)=0D + GetDB().TblReport.Insert(ErrorType, OtherMsg=3DMsg,=0D + BelongsToTable=3DTableName, BelongsToItem=3DI= temId)=0D +=0D =0D def GetIdType(Str):=0D Type =3D DataClass.MODEL_UNKNOWN=0D @@ -83,25 +93,30 @@ def GetIdType(Str): Type =3D DataClass.MODEL_UNKNOWN=0D return Type=0D =0D -def SuOccurInTypedef (Su, TdList):=0D +=0D +def SuOccurInTypedef(Su, TdList):=0D for Td in TdList:=0D if Su.StartPos[0] =3D=3D Td.StartPos[0] and Su.EndPos[0] =3D=3D Td= .EndPos[0]:=0D return True=0D return False=0D =0D +=0D def GetIdentifierList():=0D IdList =3D []=0D for comment in FileProfile.CommentList:=0D - IdComment =3D DataClass.IdentifierClass(-1, '', '', '', comment.Co= ntent, DataClass.MODEL_IDENTIFIER_COMMENT, -1, -1, comment.StartPos[0], com= ment.StartPos[1], comment.EndPos[0], comment.EndPos[1])=0D + IdComment =3D DataClass.IdentifierClass(-1, '', '', '', comment.Co= ntent, DataClass.MODEL_IDENTIFIER_COMMENT, -=0D + 1, -1, comment.StartPos[0], = comment.StartPos[1], comment.EndPos[0], comment.EndPos[1])=0D IdList.append(IdComment)=0D =0D for pp in FileProfile.PPDirectiveList:=0D Type =3D GetIdType(pp.Content)=0D - IdPP =3D DataClass.IdentifierClass(-1, '', '', '', pp.Content, Typ= e, -1, -1, pp.StartPos[0], pp.StartPos[1], pp.EndPos[0], pp.EndPos[1])=0D + IdPP =3D DataClass.IdentifierClass(-1, '', '', '', pp.Content, Typ= e, -=0D + 1, -1, pp.StartPos[0], pp.StartPo= s[1], pp.EndPos[0], pp.EndPos[1])=0D IdList.append(IdPP)=0D =0D for pe in FileProfile.PredicateExpressionList:=0D - IdPE =3D DataClass.IdentifierClass(-1, '', '', '', pe.Content, Dat= aClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -1, -1, pe.StartPos[0], pe.St= artPos[1], pe.EndPos[0], pe.EndPos[1])=0D + IdPE =3D DataClass.IdentifierClass(-1, '', '', '', pe.Content, Dat= aClass.MODEL_IDENTIFIER_PREDICATE_EXPRESSION, -=0D + 1, -1, pe.StartPos[0], pe.StartPo= s[1], pe.EndPos[0], pe.EndPos[1])=0D IdList.append(IdPE)=0D =0D FuncDeclPattern =3D GetFuncDeclPattern()=0D @@ -177,7 +192,8 @@ def GetIdentifierList(): Index +=3D 1=0D VarNameStartColumn +=3D 1=0D PreChar =3D FirstChar=0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', var.= Declarator, FuncName, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -1, = -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, VarNameStartColumn)= =0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', var.= Declarator, FuncName, DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -=0D + 1, -1, var.StartPos[0], var.= StartPos[1], VarNameStartLine, VarNameStartColumn)=0D IdList.append(IdVar)=0D continue=0D =0D @@ -190,7 +206,8 @@ def GetIdentifierList(): var.Modifier +=3D ' ' + Name[LSBPos:]=0D Name =3D Name[0:LSBPos]=0D =0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', = Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDEN= TIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine= , VarNameStartColumn)=0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', = Name, (len(DeclList) > 1 and [DeclList[1]] or [''])[=0D + 0], DataClass.MODEL_IDEN= TIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine= , VarNameStartColumn)=0D IdList.append(IdVar)=0D else:=0D DeclList =3D var.Declarator.split('=3D')=0D @@ -199,7 +216,8 @@ def GetIdentifierList(): LSBPos =3D var.Declarator.find('[')=0D var.Modifier +=3D ' ' + Name[LSBPos:]=0D Name =3D Name[0:LSBPos]=0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', Name= , (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFI= ER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, Va= rNameStartColumn)=0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', Name= , (len(DeclList) > 1 and [DeclList[1]] or [''])[=0D + 0], DataClass.MODEL_IDENTIFI= ER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], VarNameStartLine, Va= rNameStartColumn)=0D IdList.append(IdVar)=0D =0D for enum in FileProfile.EnumerationDefinitionList:=0D @@ -207,7 +225,8 @@ def GetIdentifierList(): RBPos =3D enum.Content.find('}')=0D Name =3D enum.Content[4:LBPos].strip()=0D Value =3D enum.Content[LBPos + 1:RBPos]=0D - IdEnum =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Data= Class.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0], enum.StartPos[1= ], enum.EndPos[0], enum.EndPos[1])=0D + IdEnum =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Data= Class.MODEL_IDENTIFIER_ENUMERATE, -=0D + 1, -1, enum.StartPos[0], enum.S= tartPos[1], enum.EndPos[0], enum.EndPos[1])=0D IdList.append(IdEnum)=0D =0D for su in FileProfile.StructUnionDefinitionList:=0D @@ -226,7 +245,8 @@ def GetIdentifierList(): else:=0D Name =3D su.Content[SkipLen:LBPos].strip()=0D Value =3D su.Content[LBPos:RBPos + 1]=0D - IdPE =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Type, = -1, -1, su.StartPos[0], su.StartPos[1], su.EndPos[0], su.EndPos[1])=0D + IdPE =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Type, = -=0D + 1, -1, su.StartPos[0], su.StartPo= s[1], su.EndPos[0], su.EndPos[1])=0D IdList.append(IdPE)=0D =0D TdFuncPointerPattern =3D GetTypedefFuncPointerPattern()=0D @@ -242,7 +262,7 @@ def GetIdentifierList(): if StarPos !=3D -1:=0D Modifier +=3D ' ' + TmpStr[0:StarPos]=0D while TmpStr[StarPos] =3D=3D '*':=0D -# Modifier +=3D ' ' + '*'=0D + # Modifier +=3D ' ' + '*'=0D StarPos +=3D 1=0D TmpStr =3D TmpStr[StarPos:].strip()=0D RBPos =3D TmpStr.find(')')=0D @@ -256,17 +276,20 @@ def GetIdentifierList(): if Name.find('[') !=3D -1:=0D LBPos =3D Name.find('[')=0D RBPos =3D Name.rfind(']')=0D - Value +=3D Name[LBPos : RBPos + 1]=0D - Name =3D Name[0 : LBPos]=0D + Value +=3D Name[LBPos: RBPos + 1]=0D + Name =3D Name[0: LBPos]=0D =0D - IdTd =3D DataClass.IdentifierClass(-1, Modifier, '', Name, Value, = DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0], td.StartPos[1],= td.EndPos[0], td.EndPos[1])=0D + IdTd =3D DataClass.IdentifierClass(-1, Modifier, '', Name, Value, = DataClass.MODEL_IDENTIFIER_TYPEDEF, -=0D + 1, -1, td.StartPos[0], td.StartPo= s[1], td.EndPos[0], td.EndPos[1])=0D IdList.append(IdTd)=0D =0D for funcCall in FileProfile.FunctionCallingList:=0D - IdFC =3D DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, = funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, fu= ncCall.StartPos[0], funcCall.StartPos[1], funcCall.EndPos[0], funcCall.EndP= os[1])=0D + IdFC =3D DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, = funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -=0D + 1, -1, funcCall.StartPos[0], func= Call.StartPos[1], funcCall.EndPos[0], funcCall.EndPos[1])=0D IdList.append(IdFC)=0D return IdList=0D =0D +=0D def StripNonAlnumChars(Str):=0D StrippedStr =3D ''=0D for Char in Str:=0D @@ -274,12 +297,13 @@ def StripNonAlnumChars(Str): StrippedStr +=3D Char=0D return StrippedStr=0D =0D +=0D def GetParamList(FuncDeclarator, FuncNameLine=3D0, FuncNameOffset=3D0):=0D FuncDeclarator =3D StripComments(FuncDeclarator)=0D ParamIdList =3D []=0D #DeclSplitList =3D FuncDeclarator.split('(')=0D LBPos =3D FuncDeclarator.find('(')=0D - #if len(DeclSplitList) < 2:=0D + # if len(DeclSplitList) < 2:=0D if LBPos =3D=3D -1:=0D return ParamIdList=0D #FuncName =3D DeclSplitList[0]=0D @@ -309,7 +333,7 @@ def GetParamList(FuncDeclarator, FuncNameLine=3D0, Func= NameOffset=3D0): FuncName =3D FuncName[:-1]=0D TailChar =3D FuncName[-1]=0D =0D - OffsetSkipped +=3D 1 #skip '('=0D + OffsetSkipped +=3D 1 # skip '('=0D =0D for p in ParamStr.split(','):=0D ListP =3D p.split()=0D @@ -396,13 +420,15 @@ def GetParamList(FuncDeclarator, FuncNameLine=3D0, Fu= ncNameOffset=3D0): ParamEndOffset =3D FuncNameOffset + OffsetSkipped=0D if ParamName !=3D '...':=0D ParamName =3D StripNonAlnumChars(ParamName)=0D - IdParam =3D DataClass.IdentifierClass(-1, ParamModifier, '', Param= Name, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -1, -1, ParamBeginLine, Par= amBeginOffset, ParamEndLine, ParamEndOffset)=0D + IdParam =3D DataClass.IdentifierClass(-1, ParamModifier, '', Param= Name, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -=0D + 1, -1, ParamBeginLine, ParamBe= ginOffset, ParamEndLine, ParamEndOffset)=0D ParamIdList.append(IdParam)=0D =0D - OffsetSkipped +=3D 1 #skip ','=0D + OffsetSkipped +=3D 1 # skip ','=0D =0D return ParamIdList=0D =0D +=0D def GetFunctionList():=0D FuncObjList =3D []=0D for FuncDef in FileProfile.FunctionDefinitionList:=0D @@ -476,11 +502,13 @@ def GetFunctionList(): FuncNameStartColumn +=3D 1=0D PreChar =3D FirstChar=0D =0D - FuncObj =3D DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDe= f.Modifier, FuncName.strip(), '', FuncDef.StartPos[0], FuncDef.StartPos[1],= FuncDef.EndPos[0], FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.Lef= tBracePos[1], -1, ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)= =0D + FuncObj =3D DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDe= f.Modifier, FuncName.strip(=0D + ), '', FuncDef.StartPos[0], FuncDef.StartPos[1], FuncDef.EndPos[0]= , FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, = ParamIdList, [], FuncNameStartLine, FuncNameStartColumn)=0D FuncObjList.append(FuncObj)=0D =0D return FuncObjList=0D =0D +=0D def GetFileModificationTimeFromDB(FullFileName):=0D TimeValue =3D 0.0=0D Db =3D GetDB()=0D @@ -493,6 +521,7 @@ def GetFileModificationTimeFromDB(FullFileName): TimeValue =3D Result[0]=0D return TimeValue=0D =0D +=0D def CollectSourceCodeDataIntoDB(RootDir):=0D FileObjList =3D []=0D tuple =3D os.walk(RootDir)=0D @@ -522,8 +551,10 @@ def CollectSourceCodeDataIntoDB(RootDir): model =3D DataClass.MODEL_FILE_OTHERS=0D if os.path.splitext(f)[1] in ('.h', '.c'):=0D EdkLogger.info("Parsing " + FullName)=0D - model =3D f.endswith('c') and DataClass.MODEL_FILE_C or Da= taClass.MODEL_FILE_H=0D - collector =3D CodeFragmentCollector.CodeFragmentCollector(= FullName)=0D + model =3D f.endswith(=0D + 'c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FIL= E_H=0D + collector =3D CodeFragmentCollector.CodeFragmentCollector(= =0D + FullName)=0D collector.TokenReleaceList =3D TokenReleaceList=0D try:=0D collector.ParseFile()=0D @@ -536,13 +567,15 @@ def CollectSourceCodeDataIntoDB(RootDir): DirName =3D os.path.dirname(FullName)=0D Ext =3D os.path.splitext(f)[1].lstrip('.')=0D ModifiedTime =3D os.path.getmtime(FullName)=0D - FileObj =3D DataClass.FileClass(-1, BaseName, Ext, DirName, Fu= llName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])=0D + FileObj =3D DataClass.FileClass(-1, BaseName, Ext, DirName, Fu= llName,=0D + model, ModifiedTime, GetFunction= List(), GetIdentifierList(), [])=0D FileObjList.append(FileObj)=0D if collector:=0D collector.CleanFileProfileBuffer()=0D =0D if len(ParseErrorFileList) > 0:=0D - EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n"= % "\n\t".join(ParseErrorFileList))=0D + EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n"= %=0D + "\n\t".join(ParseErrorFileList))=0D =0D Db =3D GetDB()=0D for file in FileObjList:=0D @@ -551,6 +584,7 @@ def CollectSourceCodeDataIntoDB(RootDir): =0D Db.UpdateIdentifierBelongsToFunction()=0D =0D +=0D def GetTableID(FullFileName, ErrorMsgList=3DNone):=0D if ErrorMsgList is None:=0D ErrorMsgList =3D []=0D @@ -565,14 +599,17 @@ def GetTableID(FullFileName, ErrorMsgList=3DNone): FileID =3D -1=0D for Result in ResultSet:=0D if FileID !=3D -1:=0D - ErrorMsgList.append('Duplicate file ID found in DB for file %s= ' % FullFileName)=0D + ErrorMsgList.append(=0D + 'Duplicate file ID found in DB for file %s' % FullFileName= )=0D return - 2=0D FileID =3D Result[0]=0D if FileID =3D=3D -1:=0D - ErrorMsgList.append('NO file ID found in DB for file %s' % FullFil= eName)=0D + ErrorMsgList.append(=0D + 'NO file ID found in DB for file %s' % FullFileName)=0D return - 1=0D return FileID=0D =0D +=0D def GetIncludeFileList(FullFileName):=0D if os.path.splitext(FullFileName)[1].upper() not in ('.H'):=0D return []=0D @@ -594,6 +631,7 @@ def GetIncludeFileList(FullFileName): IncludeFileListDict[FullFileName] =3D ResultSet=0D return ResultSet=0D =0D +=0D def GetFullPathOfIncludeFile(Str, IncludePathList):=0D for IncludePath in IncludePathList:=0D FullPath =3D os.path.join(IncludePath, Str)=0D @@ -602,6 +640,7 @@ def GetFullPathOfIncludeFile(Str, IncludePathList): return FullPath=0D return None=0D =0D +=0D def GetAllIncludeFiles(FullFileName):=0D if AllIncludeFileListDict.get(FullFileName) is not None:=0D return AllIncludeFileListDict.get(FullFileName)=0D @@ -609,7 +648,8 @@ def GetAllIncludeFiles(FullFileName): FileDirName =3D os.path.dirname(FullFileName)=0D IncludePathList =3D IncludePathListDict.get(FileDirName)=0D if IncludePathList is None:=0D - IncludePathList =3D MetaDataParser.GetIncludeListOfFile(EccGlobalD= ata.gWorkspace, FullFileName, GetDB())=0D + IncludePathList =3D MetaDataParser.GetIncludeListOfFile(=0D + EccGlobalData.gWorkspace, FullFileName, GetDB())=0D if FileDirName not in IncludePathList:=0D IncludePathList.insert(0, FileDirName)=0D IncludePathListDict[FileDirName] =3D IncludePathList=0D @@ -638,6 +678,7 @@ def GetAllIncludeFiles(FullFileName): AllIncludeFileListDict[FullFileName] =3D IncludeFileQueue=0D return IncludeFileQueue=0D =0D +=0D def GetPredicateListFromPredicateExpStr(PES):=0D =0D PredicateList =3D []=0D @@ -674,6 +715,7 @@ def GetPredicateListFromPredicateExpStr(PES): PredicateList.append(Exp.rstrip(';').rstrip(')').strip())=0D return PredicateList=0D =0D +=0D def GetCNameList(Lvalue, StarList=3D[]):=0D Lvalue +=3D ' '=0D i =3D 0=0D @@ -700,7 +742,6 @@ def GetCNameList(Lvalue, StarList=3D[]): if VarEnd =3D=3D -1:=0D break=0D =0D -=0D DotIndex =3D Lvalue[VarEnd:].find('.')=0D ArrowIndex =3D Lvalue[VarEnd:].find('->')=0D if DotIndex =3D=3D -1 and ArrowIndex =3D=3D -1:=0D @@ -710,7 +751,8 @@ def GetCNameList(Lvalue, StarList=3D[]): elif ArrowIndex =3D=3D -1 and DotIndex !=3D -1:=0D SearchBegin =3D VarEnd + DotIndex=0D else:=0D - SearchBegin =3D VarEnd + ((DotIndex < ArrowIndex) and DotIndex= or ArrowIndex)=0D + SearchBegin =3D VarEnd + \=0D + ((DotIndex < ArrowIndex) and DotIndex or ArrowIndex)=0D =0D i =3D SearchBegin=0D VarStart =3D -1=0D @@ -718,6 +760,7 @@ def GetCNameList(Lvalue, StarList=3D[]): =0D return VarList=0D =0D +=0D def SplitPredicateByOp(Str, Op, IsFuncCalling=3DFalse):=0D =0D Name =3D Str.strip()=0D @@ -780,6 +823,7 @@ def SplitPredicateByOp(Str, Op, IsFuncCalling=3DFalse): =0D TmpStr =3D Str[0:Index - 1]=0D =0D +=0D def SplitPredicateStr(Str):=0D =0D Str =3D Str.lstrip('(')=0D @@ -815,12 +859,14 @@ def SplitPredicateStr(Str): =0D return [[Str, None], None]=0D =0D +=0D def GetFuncContainsPE(ExpLine, ResultSet):=0D for Result in ResultSet:=0D if Result[0] < ExpLine and Result[1] > ExpLine:=0D return Result=0D return None=0D =0D +=0D def PatternInModifier(Modifier, SubStr):=0D PartList =3D Modifier.split()=0D for Part in PartList:=0D @@ -828,6 +874,7 @@ def PatternInModifier(Modifier, SubStr): return True=0D return False=0D =0D +=0D def GetDataTypeFromModifier(ModifierStr):=0D MList =3D ModifierStr.split()=0D ReturnType =3D ''=0D @@ -844,6 +891,7 @@ def GetDataTypeFromModifier(ModifierStr): ReturnType =3D 'VOID'=0D return ReturnType=0D =0D +=0D def DiffModifier(Str1, Str2):=0D PartList1 =3D Str1.split()=0D PartList2 =3D Str2.split()=0D @@ -852,6 +900,7 @@ def DiffModifier(Str1, Str2): else:=0D return True=0D =0D +=0D def GetTypedefDict(FullFileName):=0D =0D Dict =3D ComplexTypeDict.get(FullFileName)=0D @@ -897,6 +946,7 @@ def GetTypedefDict(FullFileName): ComplexTypeDict[FullFileName] =3D Dict=0D return Dict=0D =0D +=0D def GetSUDict(FullFileName):=0D =0D Dict =3D SUDict.get(FullFileName)=0D @@ -937,6 +987,7 @@ def GetSUDict(FullFileName): SUDict[FullFileName] =3D Dict=0D return Dict=0D =0D +=0D def StripComments(Str):=0D Str +=3D ' '=0D ListFromStr =3D list(Str)=0D @@ -983,6 +1034,7 @@ def StripComments(Str): =0D return Str=0D =0D +=0D def GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict):=0D Value =3D TypedefDict.get(Type)=0D if Value is None:=0D @@ -1019,22 +1071,24 @@ def GetFinalTypeValue(Type, FieldName, TypedefDict,= SUDict): Type =3D GetDataTypeFromModifier(Field[0:Index])=0D return Type.strip()=0D else:=0D - # For the condition that the field in struct is an array with = [] suffixes...=0D + # For the condition that the field in struct is an array w= ith [] suffixes...=0D if not Field[Index + len(FieldName)].isalnum():=0D Type =3D GetDataTypeFromModifier(Field[0:Index])=0D return Type.strip()=0D =0D return None=0D =0D +=0D def GetRealType(Type, TypedefDict, TargetType=3DNone):=0D if TargetType is not None and Type =3D=3D TargetType:=0D - return Type=0D + return Type=0D while TypedefDict.get(Type):=0D Type =3D TypedefDict.get(Type)=0D if TargetType is not None and Type =3D=3D TargetType:=0D return Type=0D return Type=0D =0D +=0D def GetTypeInfo(RefList, Modifier, FullFileName, TargetType=3DNone):=0D TypedefDict =3D GetTypedefDict(FullFileName)=0D SUDict =3D GetSUDict(FullFileName)=0D @@ -1063,6 +1117,7 @@ def GetTypeInfo(RefList, Modifier, FullFileName, Targ= etType=3DNone): =0D return Type=0D =0D +=0D def GetVarInfo(PredVarList, FuncRecord, FullFileName, IsFuncCall=3DFalse, = TargetType=3DNone, StarList=3DNone):=0D =0D PredVar =3D PredVarList[0]=0D @@ -1147,10 +1202,11 @@ def GetVarInfo(PredVarList, FuncRecord, FullFileNam= e, IsFuncCall=3DFalse, TargetTy VarFound =3D False=0D for Result in ResultSet:=0D if len(PredVarList) > 1:=0D - Type =3D GetTypeInfo(PredVarList[1:], Result[0], FullFileName,= TargetType)=0D + Type =3D GetTypeInfo(=0D + PredVarList[1:], Result[0], FullFileName, TargetType)=0D return Type=0D else:=0D -# Type =3D GetDataTypeFromModifier(Result[0]).split()[-1]=0D + # Type =3D GetDataTypeFromModifier(Result[0]).split= ()[-1]=0D TypeList =3D GetDataTypeFromModifier(Result[0]).split()=0D Type =3D TypeList[-1]=0D if len(TypeList) > 1 and StarList is not None:=0D @@ -1169,7 +1225,8 @@ def GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall=3DFalse, TargetTy for Param in ParamList:=0D if Param.Name.strip() =3D=3D PredVar:=0D if len(PredVarList) > 1:=0D - Type =3D GetTypeInfo(PredVarList[1:], Param.Modifier, Full= FileName, TargetType)=0D + Type =3D GetTypeInfo(=0D + PredVarList[1:], Param.Modifier, FullFileName, TargetT= ype)=0D return Type=0D else:=0D TypeList =3D GetDataTypeFromModifier(Param.Modifier).split= ()=0D @@ -1196,7 +1253,8 @@ def GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall=3DFalse, TargetTy =0D for Result in ResultSet:=0D if len(PredVarList) > 1:=0D - Type =3D GetTypeInfo(PredVarList[1:], Result[0], FullFileName,= TargetType)=0D + Type =3D GetTypeInfo(=0D + PredVarList[1:], Result[0], FullFileName, TargetType)=0D return Type=0D else:=0D TypeList =3D GetDataTypeFromModifier(Result[0]).split()=0D @@ -1227,7 +1285,8 @@ def GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall=3DFalse, TargetTy =0D for Result in ResultSet:=0D if len(PredVarList) > 1:=0D - Type =3D GetTypeInfo(PredVarList[1:], Result[0], FullFileN= ame, TargetType)=0D + Type =3D GetTypeInfo(=0D + PredVarList[1:], Result[0], FullFileName, TargetType)= =0D return Type=0D else:=0D TypeList =3D GetDataTypeFromModifier(Result[0]).split()=0D @@ -1243,6 +1302,7 @@ def GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall=3DFalse, TargetTy Type =3D GetRealType(Type, TypedefDict, TargetType)=0D return Type=0D =0D +=0D def GetTypeFromArray(Type, Var):=0D Count =3D Var.count('[')=0D =0D @@ -1253,6 +1313,7 @@ def GetTypeFromArray(Type, Var): =0D return Type=0D =0D +=0D def CheckFuncLayoutReturnType(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -1278,10 +1339,12 @@ def CheckFuncLayoutReturnType(FullFileName): Result0 =3D Result0[6:].strip()=0D Index =3D Result0.find(TypeStart)=0D if Index !=3D 0 or Result[3] !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s]= Return Type should appear at the start of line' % FuncName, FileTable, Res= ult[1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE,=0D + '[%s] Return Type should appear at the start of = line' % FuncName, FileTable, Result[1])=0D =0D if Result[2] =3D=3D Result[4]:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s]= Return Type should appear on its own line' % FuncName, FileTable, Result[1= ])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE,=0D + '[%s] Return Type should appear on its own line'= % FuncName, FileTable, Result[1])=0D =0D SqlStatement =3D """ select Modifier, ID, StartLine, StartColumn, FunN= ameStartLine, Name=0D from Function=0D @@ -1299,7 +1362,9 @@ def CheckFuncLayoutReturnType(FullFileName): Result0 =3D Result0[6:].strip()=0D Index =3D Result0.find(TypeStart)=0D if Index !=3D 0 or Result[3] !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s]= Return Type should appear at the start of line' % FuncName, 'Function', Re= sult[1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE,=0D + '[%s] Return Type should appear at the start of = line' % FuncName, 'Function', Result[1])=0D +=0D =0D def CheckFuncLayoutModifier(FullFileName):=0D ErrorMsgList =3D []=0D @@ -1323,7 +1388,8 @@ def CheckFuncLayoutModifier(FullFileName): Result0 =3D Result0[6:].strip()=0D Index =3D Result0.find(TypeStart)=0D if Index !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONA= L_MODIFIER, '', FileTable, Result[1])=0D + PrintErrorMsg(=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER= , '', FileTable, Result[1])=0D =0D SqlStatement =3D """ select Modifier, ID=0D from Function=0D @@ -1338,7 +1404,9 @@ def CheckFuncLayoutModifier(FullFileName): Result0 =3D Result0[6:].strip()=0D Index =3D Result0.find(TypeStart)=0D if Index !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONA= L_MODIFIER, '', 'Function', Result[1])=0D + PrintErrorMsg(=0D + ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER= , '', 'Function', Result[1])=0D +=0D =0D def CheckFuncLayoutName(FullFileName):=0D ErrorMsgList =3D []=0D @@ -1361,22 +1429,27 @@ def CheckFuncLayoutName(FullFileName): if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CH= ECK_FUNCTION_NAME, FuncName):=0D continue=0D if Result[2] !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Fu= nction name [%s] should appear at the start of a line' % FuncName, FileTabl= e, Result[1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,=0D + 'Function name [%s] should appear at the start o= f a line' % FuncName, FileTable, Result[1])=0D ParamList =3D GetParamList(Result[0])=0D if len(ParamList) =3D=3D 0:=0D continue=0D StartLine =3D 0=0D for Param in ParamList:=0D if Param.StartLine <=3D StartLine:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= 'Parameter %s should be in its own line.' % Param.Name, FileTable, Result[= 1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= =0D + 'Parameter %s should be in its own line.' % = Param.Name, FileTable, Result[1])=0D if Param.StartLine - StartLine > 1:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= 'Empty line appears before Parameter %s.' % Param.Name, FileTable, Result[= 1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= =0D + 'Empty line appears before Parameter %s.' % = Param.Name, FileTable, Result[1])=0D if not Pattern.match(Param.Name) and not Param.Name in ParamIg= noreList and not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTI= ON_CHECK_VARIABLE_NAME, Param.Name):=0D - PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME,= 'Parameter [%s] NOT follow naming convention.' % Param.Name, FileTable, Re= sult[1])=0D + PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME,= =0D + 'Parameter [%s] NOT follow naming convention= .' % Param.Name, FileTable, Result[1])=0D StartLine =3D Param.StartLine=0D =0D if not Result[0].endswith('\n )') and not Result[0].endswith('\r = )'):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, '\'= )\' should be on a new line and indented two spaces', FileTable, Result[1])= =0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,=0D + '\')\' should be on a new line and indented two = spaces', FileTable, Result[1])=0D =0D SqlStatement =3D """ select Modifier, ID, FunNameStartColumn, Name=0D from Function=0D @@ -1388,21 +1461,27 @@ def CheckFuncLayoutName(FullFileName): if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CH= ECK_FUNCTION_NAME, FuncName):=0D continue=0D if Result[2] !=3D 0:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, 'Fu= nction name [%s] should appear at the start of a line' % FuncName, 'Functio= n', Result[1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,=0D + 'Function name [%s] should appear at the start o= f a line' % FuncName, 'Function', Result[1])=0D ParamList =3D GetParamList(Result[0])=0D if len(ParamList) =3D=3D 0:=0D continue=0D StartLine =3D 0=0D for Param in ParamList:=0D if Param.StartLine <=3D StartLine:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= 'Parameter %s should be in its own line.' % Param.Name, 'Function', Result= [1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= =0D + 'Parameter %s should be in its own line.' % = Param.Name, 'Function', Result[1])=0D if Param.StartLine - StartLine > 1:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= 'Empty line appears before Parameter %s.' % Param.Name, 'Function', Result= [1])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,= =0D + 'Empty line appears before Parameter %s.' % = Param.Name, 'Function', Result[1])=0D if not Pattern.match(Param.Name) and not Param.Name in ParamIg= noreList and not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTI= ON_CHECK_VARIABLE_NAME, Param.Name):=0D - PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME,= 'Parameter [%s] NOT follow naming convention.' % Param.Name, FileTable, Re= sult[1])=0D + PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME,= =0D + 'Parameter [%s] NOT follow naming convention= .' % Param.Name, FileTable, Result[1])=0D StartLine =3D Param.StartLine=0D if not Result[0].endswith('\n )') and not Result[0].endswith('\r = )'):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME, '\'= )\' should be on a new line and indented two spaces', 'Function', Result[1]= )=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_NAME,=0D + '\')\' should be on a new line and indented two = spaces', 'Function', Result[1])=0D +=0D =0D def CheckFuncLayoutPrototype(FullFileName):=0D ErrorMsgList =3D []=0D @@ -1445,17 +1524,20 @@ def CheckFuncLayoutPrototype(FullFileName): DeclModifier =3D FuncDecl[0]=0D if DeclName =3D=3D FuncName:=0D if DiffModifier(FuncModifier, DeclModifier) and not EccGlo= balData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO= _TYPE, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE, 'Function [%s] modifier different with prototype.' % FuncName, '= Function', FuncDef[3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE,=0D + 'Function [%s] modifier different with p= rototype.' % FuncName, 'Function', FuncDef[3])=0D ParamListOfDef =3D GetParamList(FuncDefHeader)=0D ParamListOfDecl =3D GetParamList(FuncDecl[1])=0D if len(ParamListOfDef) !=3D len(ParamListOfDecl) and not E= ccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_= PROTO_TYPE_2, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE_2, 'Parameter number different in function [%s].' % FuncName, 'Fu= nction', FuncDef[3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE_2,=0D + 'Parameter number different in function = [%s].' % FuncName, 'Function', FuncDef[3])=0D break=0D =0D Index =3D 0=0D while Index < len(ParamListOfDef):=0D if DiffModifier(ParamListOfDef[Index].Modifier, ParamL= istOfDecl[Index].Modifier) and not EccGlobalData.gException.IsException(ERR= OR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTI= ON_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in fun= ction [%s].' % (ParamListOfDef[Index].Name, FuncName), 'Function', FuncDef[= 3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTI= ON_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in fun= ction [%s].' % (=0D + ParamListOfDef[Index].Name, FuncName), 'Functi= on', FuncDef[3])=0D Index +=3D 1=0D break=0D else:=0D @@ -1488,20 +1570,24 @@ def CheckFuncLayoutPrototype(FullFileName): DeclModifier =3D FuncDecl[0]=0D if DeclName =3D=3D FuncName:=0D if DiffModifier(FuncModifier, DeclModifier) and not EccGlo= balData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO= _TYPE, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE, 'Function [%s] modifier different with prototype.' % FuncName, '= Function', FuncDef[3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE,=0D + 'Function [%s] modifier different with p= rototype.' % FuncName, 'Function', FuncDef[3])=0D ParamListOfDef =3D GetParamList(FuncDefHeader)=0D ParamListOfDecl =3D GetParamList(FuncDecl[1])=0D if len(ParamListOfDef) !=3D len(ParamListOfDecl) and not E= ccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_= PROTO_TYPE_2, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE_2, 'Parameter number different in function [%s].' % FuncName, 'Fu= nction', FuncDef[3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_P= ROTO_TYPE_2,=0D + 'Parameter number different in function = [%s].' % FuncName, 'Function', FuncDef[3])=0D break=0D =0D Index =3D 0=0D while Index < len(ParamListOfDef):=0D if DiffModifier(ParamListOfDef[Index].Modifier, ParamL= istOfDecl[Index].Modifier) and not EccGlobalData.gException.IsException(ERR= OR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_PROTO_TYPE_3, FuncName):=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTI= ON_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in fun= ction [%s].' % (ParamListOfDef[Index].Name, FuncName), 'Function', FuncDef[= 3])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTI= ON_PROTO_TYPE_3, 'Parameter %s has different modifier with prototype in fun= ction [%s].' % (=0D + ParamListOfDef[Index].Name, FuncName), 'Functi= on', FuncDef[3])=0D Index +=3D 1=0D break=0D =0D +=0D def CheckFuncLayoutBody(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -1522,14 +1608,17 @@ def CheckFuncLayoutBody(FullFileName): if Result[0] !=3D 0:=0D if not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_L= AYOUT_CHECK_FUNCTION_BODY, Result[3]):=0D PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY,= =0D - 'The open brace should be at the very beginn= ing of a line for the function [%s].' % Result[3],=0D + 'The open brace should be at the very beginn= ing of a line for the function [%s].' % Result[=0D + 3],=0D 'Function', Result[2])=0D if Result[1] !=3D 0:=0D if not EccGlobalData.gException.IsException(ERROR_C_FUNCTION_L= AYOUT_CHECK_FUNCTION_BODY, Result[3]):=0D PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_FUNCTION_BODY,= =0D - 'The close brace should be at the very begin= ning of a line for the function [%s].' % Result[3],=0D + 'The close brace should be at the very begin= ning of a line for the function [%s].' % Result[=0D + 3],=0D 'Function', Result[2])=0D =0D +=0D def CheckFuncLayoutLocalVariable(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -1561,7 +1650,9 @@ def CheckFuncLayoutLocalVariable(FullFileName): =0D for Result in ResultSet:=0D if len(Result[1]) > 0 and 'CONST' not in Result[3] and 'STATIC= ' not in Result[3]:=0D - PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VAR= IABLE, 'Variable Name: %s' % Result[0], FileTable, Result[2])=0D + PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_NO_INIT_OF_VAR= IABLE,=0D + 'Variable Name: %s' % Result[0], FileTable, = Result[2])=0D +=0D =0D def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):=0D ErrMsgList =3D []=0D @@ -1573,25 +1664,28 @@ def CheckMemberVariableFormat(Name, Value, FileTabl= e, TdId, ModelId): if LBPos =3D=3D -1 or RBPos =3D=3D -1:=0D return ErrMsgList=0D =0D - Fields =3D Value[LBPos + 1 : RBPos]=0D + Fields =3D Value[LBPos + 1: RBPos]=0D Fields =3D StripComments(Fields).strip()=0D - NestPos =3D Fields.find ('struct')=0D + NestPos =3D Fields.find('struct')=0D if NestPos !=3D -1 and (NestPos + len('struct') < len(Fields)) and Mod= elId !=3D DataClass.MODEL_IDENTIFIER_UNION:=0D if not Fields[NestPos + len('struct') + 1].isalnum():=0D if not EccGlobalData.gException.IsException(ERROR_DECLARATION_= DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE, 'Nested struct in [%s].' % (Name), FileTable, TdId)=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE,=0D + 'Nested struct in [%s].' % (Name), FileTable= , TdId)=0D return ErrMsgList=0D - NestPos =3D Fields.find ('union')=0D + NestPos =3D Fields.find('union')=0D if NestPos !=3D -1 and (NestPos + len('union') < len(Fields)):=0D if not Fields[NestPos + len('union') + 1].isalnum():=0D if not EccGlobalData.gException.IsException(ERROR_DECLARATION_= DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE, 'Nested union in [%s].' % (Name), FileTable, TdId)=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE,=0D + 'Nested union in [%s].' % (Name), FileTable,= TdId)=0D return ErrMsgList=0D - NestPos =3D Fields.find ('enum')=0D + NestPos =3D Fields.find('enum')=0D if NestPos !=3D -1 and (NestPos + len('enum') < len(Fields)):=0D if not Fields[NestPos + len('enum') + 1].isalnum():=0D if not EccGlobalData.gException.IsException(ERROR_DECLARATION_= DATA_TYPE_CHECK_NESTED_STRUCTURE, Name):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE, 'Nested enum in [%s].' % (Name), FileTable, TdId)=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NESTED_STR= UCTURE,=0D + 'Nested enum in [%s].' % (Name), FileTable, = TdId)=0D return ErrMsgList=0D =0D if ModelId =3D=3D DataClass.MODEL_IDENTIFIER_ENUMERATE:=0D @@ -1655,6 +1749,7 @@ def CheckMemberVariableFormat(Name, Value, FileTable,= TdId, ModelId): =0D return ErrMsgList=0D =0D +=0D def CheckDeclTypedefFormat(FullFileName, ModelId):=0D ErrorMsgList =3D []=0D =0D @@ -1705,11 +1800,13 @@ def CheckDeclTypedefFormat(FullFileName, ModelId): if ValueModelId !=3D ModelId:=0D continue=0D # Check member variable format.=0D - ErrMsgList =3D CheckMemberVariableFormat(Name, Value, FileTable, T= d[5], ModelId)=0D + ErrMsgList =3D CheckMemberVariableFormat(=0D + Name, Value, FileTable, Td[5], ModelId)=0D for ErrMsg in ErrMsgList:=0D if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTIO= N_CHECK_VARIABLE_NAME, Name + '.' + ErrMsg):=0D continue=0D - PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Me= mber variable [%s] NOT follow naming convention.' % (Name + '.' + ErrMsg), = FileTable, Td[5])=0D + PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Me= mber variable [%s] NOT follow naming convention.' % (=0D + Name + '.' + ErrMsg), FileTable, Td[5])=0D =0D # First check in current file to see whether struct/union/enum is type= def-ed.=0D UntypedefedList =3D []=0D @@ -1728,11 +1825,13 @@ def CheckDeclTypedefFormat(FullFileName, ModelId): =0D if ValueModelId !=3D ModelId:=0D continue=0D - ErrMsgList =3D CheckMemberVariableFormat(Name, Value, FileTable, R= esult[3], ModelId)=0D + ErrMsgList =3D CheckMemberVariableFormat(=0D + Name, Value, FileTable, Result[3], ModelId)=0D for ErrMsg in ErrMsgList:=0D if EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTIO= N_CHECK_VARIABLE_NAME, Result[0] + '.' + ErrMsg):=0D continue=0D - PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Me= mber variable [%s] NOT follow naming convention.' % (Result[0] + '.' + ErrM= sg), FileTable, Result[3])=0D + PrintErrorMsg(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, 'Me= mber variable [%s] NOT follow naming convention.' % (=0D + Result[0] + '.' + ErrMsg), FileTable, Result[3])=0D # Check whether it is typedefed.=0D Found =3D False=0D for Td in TdList:=0D @@ -1742,11 +1841,13 @@ def CheckDeclTypedefFormat(FullFileName, ModelId): if Result[1] >=3D Td[3] and Td[4] >=3D Result[2]:=0D Found =3D True=0D if not Td[1].isupper():=0D - PrintErrorMsg(ErrorType, 'Typedef should be UPPER case= ', FileTable, Td[5])=0D + PrintErrorMsg(=0D + ErrorType, 'Typedef should be UPPER case', FileTab= le, Td[5])=0D if Result[0] in Td[2].split():=0D Found =3D True=0D if not Td[1].isupper():=0D - PrintErrorMsg(ErrorType, 'Typedef should be UPPER case= ', FileTable, Td[5])=0D + PrintErrorMsg(=0D + ErrorType, 'Typedef should be UPPER case', FileTab= le, Td[5])=0D if Found:=0D break=0D =0D @@ -1783,27 +1884,34 @@ def CheckDeclTypedefFormat(FullFileName, ModelId): if Result[1] >=3D Td[3] and Td[4] >=3D Result[2]:=0D Found =3D True=0D if not Td[1].isupper():=0D - PrintErrorMsg(ErrorType, 'Typedef should be UPPER case= ', FileTable, Td[5])=0D + PrintErrorMsg(=0D + ErrorType, 'Typedef should be UPPER case', FileTab= le, Td[5])=0D if Result[0] in Td[2].split():=0D Found =3D True=0D if not Td[1].isupper():=0D - PrintErrorMsg(ErrorType, 'Typedef should be UPPER case= ', FileTable, Td[5])=0D + PrintErrorMsg(=0D + ErrorType, 'Typedef should be UPPER case', FileTab= le, Td[5])=0D if Found:=0D break=0D =0D if not Found:=0D - PrintErrorMsg(ErrorType, 'No Typedef for %s' % Result[0], File= Table, Result[3])=0D + PrintErrorMsg(ErrorType, 'No Typedef for %s' %=0D + Result[0], FileTable, Result[3])=0D continue=0D =0D +=0D def CheckDeclStructTypedef(FullFileName):=0D CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_STRUCT= URE)=0D =0D +=0D def CheckDeclEnumTypedef(FullFileName):=0D CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_ENUMER= ATE)=0D =0D +=0D def CheckDeclUnionTypedef(FullFileName):=0D CheckDeclTypedefFormat(FullFileName, DataClass.MODEL_IDENTIFIER_UNION)= =0D =0D +=0D def CheckDeclArgModifier(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -1823,7 +1931,8 @@ def CheckDeclArgModifier(FullFileName): for Result in ResultSet:=0D for Modifier in ModifierTuple:=0D if PatternInModifier(Result[0], Modifier) and len(Result[0]) <= MAX_MODIFIER_LENGTH:=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER, 'Variable Modifier %s' % Result[0], FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER,=0D + 'Variable Modifier %s' % Result[0], FileTabl= e, Result[2])=0D break=0D =0D SqlStatement =3D """ select Modifier, Name, ID=0D @@ -1834,7 +1943,8 @@ def CheckDeclArgModifier(FullFileName): for Result in ResultSet:=0D for Modifier in ModifierTuple:=0D if PatternInModifier(Result[0], Modifier):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER, 'Return Type Modifier %s' % Result[0], FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER,=0D + 'Return Type Modifier %s' % Result[0], FileT= able, Result[2])=0D break=0D =0D SqlStatement =3D """ select Modifier, Header, ID=0D @@ -1845,9 +1955,11 @@ def CheckDeclArgModifier(FullFileName): for Result in ResultSet:=0D for Modifier in ModifierTuple:=0D if PatternInModifier(Result[0], Modifier):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER, 'Return Type Modifier %s' % Result[0], FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_IN_OUT_MOD= IFIER,=0D + 'Return Type Modifier %s' % Result[0], FileT= able, Result[2])=0D break=0D =0D +=0D def CheckDeclNoUseCType(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -1870,7 +1982,8 @@ def CheckDeclNoUseCType(FullFileName): Result[0] + ' ' + = Result[1]):=0D continue=0D PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_T= YPE,=0D - 'Invalid variable type (%s) in definition [%= s]' % (Type, Result[0] + ' ' + Result[1]),=0D + 'Invalid variable type (%s) in definition [%= s]' % (=0D + Type, Result[0] + ' ' + Result[1]),=0D FileTable,=0D Result[2])=0D break=0D @@ -1887,11 +2000,13 @@ def CheckDeclNoUseCType(FullFileName): continue=0D for Type in CTypeTuple:=0D if PatternInModifier(Result[0], Type):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_T= YPE, '%s Return type %s' % (FuncName, Result[0]), FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_T= YPE, '%s Return type %s' % (=0D + FuncName, Result[0]), FileTable, Result[2])=0D =0D for Param in ParamList:=0D if PatternInModifier(Param.Modifier, Type):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE= _C_TYPE, 'Parameter %s' % Param.Name, FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE= _C_TYPE,=0D + 'Parameter %s' % Param.Name, FileTable, = Result[2])=0D =0D SqlStatement =3D """ select Modifier, Header, ID, Name=0D from Function=0D @@ -1905,11 +2020,13 @@ def CheckDeclNoUseCType(FullFileName): continue=0D for Type in CTypeTuple:=0D if PatternInModifier(Result[0], Type):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_T= YPE, '[%s] Return type %s' % (FuncName, Result[0]), FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_T= YPE, '[%s] Return type %s' % (=0D + FuncName, Result[0]), FileTable, Result[2])=0D =0D for Param in ParamList:=0D if PatternInModifier(Param.Modifier, Type):=0D - PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE= _C_TYPE, 'Parameter %s' % Param.Name, FileTable, Result[2])=0D + PrintErrorMsg(ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE= _C_TYPE,=0D + 'Parameter %s' % Param.Name, FileTable, = Result[2])=0D =0D =0D def CheckPointerNullComparison(FullFileName):=0D @@ -1976,20 +2093,24 @@ def CheckPointerNullComparison(FullFileName): Type =3D FuncReturnTypeDict.get(PredVarStr)=0D if Type is not None:=0D if Type.find('*') !=3D -1 and Type !=3D 'BOOLEAN*'= :=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _COMPARISON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])= =0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _COMPARISON_NULL_TYPE,=0D + 'Predicate Expression: %s' % Exp= , FileTable, Str[2])=0D continue=0D =0D if PredVarStr in FuncReturnTypeDict:=0D continue=0D =0D - Type =3D GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall, None, StarList)=0D + Type =3D GetVarInfo(PredVarList, FuncRecord,=0D + FullFileName, IsFuncCall, None, StarList= )=0D if SearchInCache:=0D FuncReturnTypeDict[PredVarStr] =3D Type=0D if Type is None:=0D continue=0D Type =3D GetTypeFromArray(Type, PredVarStr)=0D if Type.find('*') !=3D -1 and Type !=3D 'BOOLEAN*':=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARI= SON_NULL_TYPE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])=0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_COMPARI= SON_NULL_TYPE,=0D + 'Predicate Expression: %s' % Exp, FileTa= ble, Str[2])=0D +=0D =0D def CheckNonBooleanValueComparison(FullFileName):=0D ErrorMsgList =3D []=0D @@ -2056,18 +2177,21 @@ def CheckNonBooleanValueComparison(FullFileName): Type =3D FuncReturnTypeDict.get(PredVarStr)=0D if Type is not None:=0D if Type.find('BOOLEAN') =3D=3D -1:=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _NO_BOOLEAN_OPERATOR, 'Predicate Expression: %s' % Exp, FileTable, Str[2])= =0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _NO_BOOLEAN_OPERATOR,=0D + 'Predicate Expression: %s' % Exp= , FileTable, Str[2])=0D continue=0D =0D if PredVarStr in FuncReturnTypeDict:=0D continue=0D - Type =3D GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall, 'BOOLEAN', StarList)=0D + Type =3D GetVarInfo(PredVarList, FuncRecord,=0D + FullFileName, IsFuncCall, 'BOOLEAN', Sta= rList)=0D if SearchInCache:=0D FuncReturnTypeDict[PredVarStr] =3D Type=0D if Type is None:=0D continue=0D if Type.find('BOOLEAN') =3D=3D -1:=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOL= EAN_OPERATOR, 'Predicate Expression: %s' % Exp, FileTable, Str[2])=0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_NO_BOOL= EAN_OPERATOR,=0D + 'Predicate Expression: %s' % Exp, FileTa= ble, Str[2])=0D =0D =0D def CheckBooleanValueComparison(FullFileName):=0D @@ -2135,19 +2259,22 @@ def CheckBooleanValueComparison(FullFileName): Type =3D FuncReturnTypeDict.get(PredVarStr)=0D if Type is not None:=0D if Type.find('BOOLEAN') !=3D -1:=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _BOOLEAN_VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])=0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK= _BOOLEAN_VALUE,=0D + 'Predicate Expression: %s' % Exp= , FileTable, Str[2])=0D continue=0D =0D if PredVarStr in FuncReturnTypeDict:=0D continue=0D =0D - Type =3D GetVarInfo(PredVarList, FuncRecord, FullFileName,= IsFuncCall, 'BOOLEAN', StarList)=0D + Type =3D GetVarInfo(PredVarList, FuncRecord,=0D + FullFileName, IsFuncCall, 'BOOLEAN', Sta= rList)=0D if SearchInCache:=0D FuncReturnTypeDict[PredVarStr] =3D Type=0D if Type is None:=0D continue=0D if Type.find('BOOLEAN') !=3D -1:=0D - PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN= _VALUE, 'Predicate Expression: %s' % Exp, FileTable, Str[2])=0D + PrintErrorMsg(ERROR_PREDICATE_EXPRESSION_CHECK_BOOLEAN= _VALUE,=0D + 'Predicate Expression: %s' % Exp, FileTa= ble, Str[2])=0D =0D =0D def CheckHeaderFileData(FullFileName, AllTypedefFun=3D[]):=0D @@ -2170,7 +2297,8 @@ def CheckHeaderFileData(FullFileName, AllTypedefFun= =3D[]): if '(%s)' % Result[1] in Item:=0D break=0D else:=0D - PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Variable def= inition appears in header file', FileTable, Result[0])=0D + PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA,=0D + 'Variable definition appears in header file'= , FileTable, Result[0])=0D =0D SqlStatement =3D """ select ID=0D from Function=0D @@ -2178,10 +2306,12 @@ def CheckHeaderFileData(FullFileName, AllTypedefFun= =3D[]): """ % FileID=0D ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D - PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA, 'Function definition = appears in header file', 'Function', Result[0])=0D + PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_DATA,=0D + 'Function definition appears in header file', 'Funct= ion', Result[0])=0D =0D return ErrorMsgList=0D =0D +=0D def CheckHeaderFileIfndef(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -2197,7 +2327,8 @@ def CheckHeaderFileIfndef(FullFileName): """ % (FileTable, DataClass.MODEL_IDENTIFIER_MACRO_IFND= EF)=0D ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D if len(ResultSet) =3D=3D 0:=0D - PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1, '', 'Fi= le', FileID)=0D + PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_1,=0D + '', 'File', FileID)=0D return ErrorMsgList=0D for Result in ResultSet:=0D SqlStatement =3D """ select Value, EndLine=0D @@ -2207,7 +2338,8 @@ def CheckHeaderFileIfndef(FullFileName): ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D if not Result[0].startswith('/*') and not Result[0].startswith= ('//'):=0D - PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2,= '', 'File', FileID)=0D + PrintErrorMsg(=0D + ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2, '', 'File= ', FileID)=0D break=0D =0D SqlStatement =3D """ select Value=0D @@ -2217,9 +2349,11 @@ def CheckHeaderFileIfndef(FullFileName): ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D if not Result[0].startswith('/*') and not Result[0].startswith('//= '):=0D - PrintErrorMsg(ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3, '',= 'File', FileID)=0D + PrintErrorMsg(=0D + ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3, '', 'File', F= ileID)=0D return ErrorMsgList=0D =0D +=0D def CheckDoxygenCommand(FullFileName):=0D ErrorMsgList =3D []=0D =0D @@ -2241,9 +2375,11 @@ def CheckDoxygenCommand(FullFileName): CommentPartList =3D CommentStr.split()=0D for Part in CommentPartList:=0D if Part.upper() =3D=3D 'BUGBUG':=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Bug should be = marked with doxygen tag @bug', FileTable, Result[1])=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND,=0D + 'Bug should be marked with doxygen tag @bug'= , FileTable, Result[1])=0D if Part.upper() =3D=3D 'TODO':=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'ToDo should be= marked with doxygen tag @todo', FileTable, Result[1])=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND,=0D + 'ToDo should be marked with doxygen tag @tod= o', FileTable, Result[1])=0D if Part.startswith('@'):=0D if EccGlobalData.gException.IsException(ERROR_DOXYGEN_CHEC= K_COMMAND, Part):=0D continue=0D @@ -2253,14 +2389,17 @@ def CheckDoxygenCommand(FullFileName): continue=0D if Part.lstrip('@').isalpha():=0D if Part.lstrip('@') not in DoxygenCommandList:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknow= n doxygen command %s' % Part, FileTable, Result[1])=0D + PrintErrorMsg(=0D + ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen = command %s' % Part, FileTable, Result[1])=0D else:=0D Index =3D Part.find('[')=0D if Index =3D=3D -1:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknow= n doxygen command %s' % Part, FileTable, Result[1])=0D + PrintErrorMsg(=0D + ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen = command %s' % Part, FileTable, Result[1])=0D RealCmd =3D Part[1:Index]=0D if RealCmd not in DoxygenCommandList:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMAND, 'Unknow= n doxygen command %s' % Part, FileTable, Result[1])=0D + PrintErrorMsg(=0D + ERROR_DOXYGEN_CHECK_COMMAND, 'Unknown doxygen = command %s' % Part, FileTable, Result[1])=0D =0D =0D def CheckDoxygenTripleForwardSlash(FullFileName):=0D @@ -2284,7 +2423,6 @@ def CheckDoxygenTripleForwardSlash(FullFileName): for Result in ResultSet:=0D FuncDefSet.append(Result)=0D =0D -=0D FileTable =3D 'Identifier' + str(FileID)=0D SqlStatement =3D """ select Value, ID, StartLine, StartColumn, EndLine= , EndColumn=0D from %s=0D @@ -2299,7 +2437,6 @@ def CheckDoxygenTripleForwardSlash(FullFileName): except:=0D print('Unrecognized chars in comment of file %s', FullFileName)=0D =0D -=0D for Result in CommentSet:=0D CommentStr =3D Result[0]=0D StartLine =3D Result[2]=0D @@ -2324,7 +2461,8 @@ def CheckDoxygenTripleForwardSlash(FullFileName): Found =3D True=0D break=0D if Found:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_FORMAT, '', FileTabl= e, Result[1])=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_FORMAT,=0D + '', FileTable, Result[1])=0D =0D =0D def CheckFileHeaderDoxygenComments(FullFileName):=0D @@ -2342,7 +2480,8 @@ def CheckFileHeaderDoxygenComments(FullFileName): """ % (FileTable, DataClass.MODEL_IDENTIFIER_COMMENT)=0D ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D if len(ResultSet) =3D=3D 0:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'No File License header app= ear at the very beginning of file.', 'File', FileID)=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FILE,=0D + 'No File License header appear at the very beginning= of file.', 'File', FileID)=0D return ErrorMsgList=0D =0D NoHeaderCommentStartFlag =3D True=0D @@ -2364,7 +2503,7 @@ def CheckFileHeaderDoxygenComments(FullFileName): for CommentLine in CommentStrListTemp:=0D if CommentLine.strip().startswith('/** @file'):=0D FileStartFlag =3D True=0D - if FileStartFlag =3D=3D True:=0D + if FileStartFlag =3D=3D True:=0D CommentStrList.append(CommentLine)=0D =0D ID =3D Result[1]=0D @@ -2388,7 +2527,8 @@ def CheckFileHeaderDoxygenComments(FullFileName): # Check whether C File header Comment content start with two s= paces.=0D if EccGlobalData.gConfig.HeaderCheckCFileCommentStartSpacesNum= =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or EccGlobal= Data.gConfig.CheckAll =3D=3D '1':=0D if CommentLine.startswith('/** @file') =3D=3D False and Co= mmentLine.startswith('**/') =3D=3D False and CommentLine.strip() and Commen= tLine.startswith(' ') =3D=3D False:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header co= mment content should start with two spaces at each line', FileTable, ID)=0D + PrintErrorMsg(=0D + ERROR_HEADER_CHECK_FILE, 'File header comment cont= ent should start with two spaces at each line', FileTable, ID)=0D =0D CommentLine =3D CommentLine.strip()=0D if CommentLine.startswith('Copyright') or ('Copyright' in Comm= entLine and CommentLine.lower().startswith('(c)')):=0D @@ -2396,10 +2536,12 @@ def CheckFileHeaderDoxygenComments(FullFileName): if CommentLine.find('All rights reserved') =3D=3D -1:=0D for Copyright in EccGlobalData.gConfig.Copyright:=0D if CommentLine.find(Copyright) > -1:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All = rights reserved"" announcement should be following the ""Copyright"" at the= same line', FileTable, ID)=0D + PrintErrorMsg(=0D + ERROR_HEADER_CHECK_FILE, '""All rights res= erved"" announcement should be following the ""Copyright"" at the same line= ', FileTable, ID)=0D break=0D if CommentLine.endswith('
        ') =3D=3D -1:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'The ""
        "" a= t the end of the Copyright line is required', FileTable, ID)=0D + PrintErrorMsg(=0D + ERROR_HEADER_CHECK_FILE, 'The ""
        "" at the end = of the Copyright line is required', FileTable, ID)=0D if NextLineIndex < len(CommentStrList) and CommentStrList[= NextLineIndex].strip().startswith('Copyright') =3D=3D False and CommentStrL= ist[NextLineIndex].strip():=0D NoLicenseFlag =3D False=0D if CommentLine.startswith('@par Revision Reference:'):=0D @@ -2415,20 +2557,26 @@ def CheckFileHeaderDoxygenComments(FullFileName): if EccGlobalData.gConfig.HeaderCheckCFileCommentRefere= nceFormat =3D=3D '1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or = EccGlobalData.gConfig.CheckAll =3D=3D '1':=0D if RefListFlag =3D=3D True:=0D if RefLine.strip() and RefLine.strip().startsw= ith('**/') =3D=3D False and RefLine.startswith(' -') =3D=3D False:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'Ea= ch reference on a separate line should begin with a bullet character ""-"" = ', FileTable, ID)=0D + PrintErrorMsg(=0D + ERROR_HEADER_CHECK_FILE, 'Each referen= ce on a separate line should begin with a bullet character ""-"" ', FileTab= le, ID)=0D =0D if NoHeaderCommentStartFlag:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER, 'File header commen= t should begin with ""/** @file""', FileTable, ID)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FILE_HEADER,=0D + 'File header comment should begin with ""/** @file""= ', FileTable, ID)=0D return=0D if NoHeaderCommentEndFlag:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment should= end with ""**/""', FileTable, ID)=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FILE,=0D + 'File header comment should end with ""**/""', FileT= able, ID)=0D return=0D if NoCopyrightFlag:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment missin= g the ""Copyright""', FileTable, ID)=0D - #Check whether C File header Comment have the License immediately afte= r the ""Copyright"" line.=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FILE,=0D + 'File header comment missing the ""Copyright""', Fil= eTable, ID)=0D + # Check whether C File header Comment have the License immediately aft= er the ""Copyright"" line.=0D if EccGlobalData.gConfig.HeaderCheckCFileCommentLicenseFormat =3D=3D '= 1' or EccGlobalData.gConfig.HeaderCheckAll =3D=3D '1' or EccGlobalData.gCon= fig.CheckAll =3D=3D '1':=0D if NoLicenseFlag:=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'File header comment sh= ould have the License immediately after the ""Copyright"" line', FileTable,= ID)=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FILE,=0D + 'File header comment should have the License imm= ediately after the ""Copyright"" line', FileTable, ID)=0D +=0D =0D def CheckFuncHeaderDoxygenComments(FullFileName):=0D ErrorMsgList =3D []=0D @@ -2460,14 +2608,18 @@ def CheckFuncHeaderDoxygenComments(FullFileName): ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D FuncName =3D Result[4]=0D - FunctionHeaderComment =3D CheckCommentImmediatelyPrecedeFunctionHe= ader(Result[1], Result[2], CommentSet)=0D + FunctionHeaderComment =3D CheckCommentImmediatelyPrecedeFunctionHe= ader(=0D + Result[1], Result[2], CommentSet)=0D if FunctionHeaderComment:=0D - CheckFunctionHeaderConsistentWithDoxygenComment(Result[0], Res= ult[1], Result[2], FunctionHeaderComment[0], FunctionHeaderComment[1], Erro= rMsgList, FunctionHeaderComment[3], FileTable)=0D + CheckFunctionHeaderConsistentWithDoxygenComment(=0D + Result[0], Result[1], Result[2], FunctionHeaderComment[0],= FunctionHeaderComment[1], ErrorMsgList, FunctionHeaderComment[3], FileTabl= e)=0D else:=0D if EccGlobalData.gException.IsException(ERROR_HEADER_CHECK_FUN= CTION, FuncName):=0D continue=0D - ErrorMsgList.append('Line %d :Function %s has NO comment immed= iately preceding it.' % (Result[2], Result[1]))=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has = NO comment immediately preceding it.' % (FuncName), FileTable, Result[3])=0D + ErrorMsgList.append(=0D + 'Line %d :Function %s has NO comment immediately preceding= it.' % (Result[2], Result[1]))=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has = NO comment immediately preceding it.' % (=0D + FuncName), FileTable, Result[3])=0D =0D # Func Def check=0D SqlStatement =3D """ select Value, StartLine, EndLine, ID=0D @@ -2490,16 +2642,21 @@ def CheckFuncHeaderDoxygenComments(FullFileName): ResultSet =3D Db.TblFile.Exec(SqlStatement)=0D for Result in ResultSet:=0D FuncName =3D Result[4]=0D - FunctionHeaderComment =3D CheckCommentImmediatelyPrecedeFunctionHe= ader(Result[1], Result[2], CommentSet)=0D + FunctionHeaderComment =3D CheckCommentImmediatelyPrecedeFunctionHe= ader(=0D + Result[1], Result[2], CommentSet)=0D if FunctionHeaderComment:=0D - CheckFunctionHeaderConsistentWithDoxygenComment(Result[0], Res= ult[1], Result[2], FunctionHeaderComment[0], FunctionHeaderComment[1], Erro= rMsgList, FunctionHeaderComment[3], FileTable)=0D + CheckFunctionHeaderConsistentWithDoxygenComment(=0D + Result[0], Result[1], Result[2], FunctionHeaderComment[0],= FunctionHeaderComment[1], ErrorMsgList, FunctionHeaderComment[3], FileTabl= e)=0D else:=0D if EccGlobalData.gException.IsException(ERROR_HEADER_CHECK_FUN= CTION, FuncName):=0D continue=0D - ErrorMsgList.append('Line %d :Function [%s] has NO comment imm= ediately preceding it.' % (Result[2], Result[1]))=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has = NO comment immediately preceding it.' % (FuncName), 'Function', Result[3])= =0D + ErrorMsgList.append(=0D + 'Line %d :Function [%s] has NO comment immediately precedi= ng it.' % (Result[2], Result[1]))=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'Function [%s] has = NO comment immediately preceding it.' % (=0D + FuncName), 'Function', Result[3])=0D return ErrorMsgList=0D =0D +=0D def CheckCommentImmediatelyPrecedeFunctionHeader(FuncName, FuncStartLine, = CommentSet):=0D =0D for Comment in CommentSet:=0D @@ -2507,6 +2664,7 @@ def CheckCommentImmediatelyPrecedeFunctionHeader(Func= Name, FuncStartLine, Commen return Comment=0D return None=0D =0D +=0D def GetDoxygenStrFromComment(Str):=0D DoxygenStrList =3D []=0D ParamTagList =3D Str.split('@param')=0D @@ -2543,28 +2701,38 @@ def GetDoxygenStrFromComment(Str): =0D return DoxygenStrList=0D =0D -def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, Comment= Id=3D -1, TableName=3D''):=0D - #/** --*/ @retval after @param=0D +=0D +def CheckGeneralDoxygenCommentLayout(Str, StartLine, ErrorMsgList, Comment= Id=3D-1, TableName=3D''):=0D + # /** --*/ @retval after @param=0D if not Str.startswith('/**'):=0D - ErrorMsgList.append('Line %d : Comment does NOT have prefix /** ' = % StartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Comment does N= OT have prefix /** ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : Comment does NOT have prefix /** ' % StartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'Comment does NOT have prefix /** ', TableName, Comm= entId)=0D if not Str.endswith('**/'):=0D - ErrorMsgList.append('Line %d : Comment does NOT have tail **/ ' % = StartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Comment does N= OT have tail **/ ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : Comment does NOT have tail **/ ' % StartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'Comment does NOT have tail **/ ', TableName, Commen= tId)=0D FirstRetvalIndex =3D Str.find('@retval')=0D LastParamIndex =3D Str.rfind('@param')=0D if (FirstRetvalIndex > 0) and (LastParamIndex > 0) and (FirstRetvalInd= ex < LastParamIndex):=0D - ErrorMsgList.append('Line %d : @retval appear before @param ' % St= artLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Comment, @r= etval appear before @param ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : @retval appear before @param ' % StartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'in Comment, @retval appear before @param ', TableN= ame, CommentId)=0D =0D -def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHead= er, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId=3D= -1, TableName=3D''):=0D +=0D +def CheckFunctionHeaderConsistentWithDoxygenComment(FuncModifier, FuncHead= er, FuncStartLine, CommentStr, CommentStartLine, ErrorMsgList, CommentId=3D= -1, TableName=3D''):=0D =0D ParamList =3D GetParamList(FuncHeader)=0D - CheckGeneralDoxygenCommentLayout(CommentStr, CommentStartLine, ErrorMs= gList, CommentId, TableName)=0D + CheckGeneralDoxygenCommentLayout(=0D + CommentStr, CommentStartLine, ErrorMsgList, CommentId, TableName)= =0D DescriptionStr =3D CommentStr=0D DoxygenStrList =3D GetDoxygenStrFromComment(DescriptionStr)=0D if DescriptionStr.find('.') =3D=3D -1:=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION, 'Comment de= scription should end with period \'.\'', TableName, CommentId)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_COMMENT_DESCRIPTION,=0D + 'Comment description should end with period \'.\'', = TableName, CommentId)=0D DoxygenTagNumber =3D len(DoxygenStrList)=0D ParamNumber =3D len(ParamList)=0D for Param in ParamList:=0D @@ -2577,12 +2745,16 @@ def CheckFunctionHeaderConsistentWithDoxygenComment= (FuncModifier, FuncHeader, Fu ParamName =3D ParamList[Index].Name.strip()=0D Tag =3D DoxygenStrList[Index].strip(' ')=0D if (not Tag[-1] =3D=3D ('\n')) and (not Tag[-1] =3D=3D ('\r'))= :=0D - ErrorMsgList.append('Line %d : in Comment, <%s> does NOT e= nd with new line ' % (CommentStartLine, Tag.replace('\n', '').replace('\r',= '')))=0D - PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, <%= s> does NOT end with new line ' % (Tag.replace('\n', '').replace('\r', ''))= , TableName, CommentId)=0D + ErrorMsgList.append('Line %d : in Comment, <%s> does NOT e= nd with new line ' % (=0D + CommentStartLine, Tag.replace('\n', '').replace('\r', = '')))=0D + PrintErrorMsg(ERROR_HEADER_CHECK_FUNCTION, 'in Comment, <%= s> does NOT end with new line ' % (=0D + Tag.replace('\n', '').replace('\r', '')), TableName, C= ommentId)=0D TagPartList =3D Tag.split()=0D if len(TagPartList) < 2:=0D - ErrorMsgList.append('Line %d : in Comment, <%s> does NOT c= ontain doxygen contents ' % (CommentStartLine, Tag.replace('\n', '').replac= e('\r', '')))=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Com= ment, <%s> does NOT contain doxygen contents ' % (Tag.replace('\n', '').rep= lace('\r', '')), TableName, CommentId)=0D + ErrorMsgList.append('Line %d : in Comment, <%s> does NOT c= ontain doxygen contents ' % (=0D + CommentStartLine, Tag.replace('\n', '').replace('\r', = '')))=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Com= ment, <%s> does NOT contain doxygen contents ' % (=0D + Tag.replace('\n', '').replace('\r', '')), TableName, C= ommentId)=0D Index +=3D 1=0D continue=0D LBPos =3D Tag.find('[')=0D @@ -2603,46 +2775,62 @@ def CheckFunctionHeaderConsistentWithDoxygenComment= (FuncModifier, FuncHeader, Fu if InOutStr !=3D '':=0D if Tag.find('[' + InOutStr + ']') =3D=3D -1:=0D if InOutStr !=3D 'in, out':=0D - ErrorMsgList.append('Line %d : in Comment, <%s= > does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPartLi= st[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEA= DER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + TagPar= tList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), Table= Name, CommentId)=0D + ErrorMsgList.append('Line %d : in Comment, <%s= > does NOT have %s ' % (=0D + CommentStartLine, (TagPartList[0] + ' ' + = TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))= =0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEA= DER, 'in Comment, <%s> does NOT have %s ' % (=0D + (TagPartList[0] + ' ' + TagPartList[1]).re= place('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, Commen= tId)=0D else:=0D if Tag.find('[in,out]') =3D=3D -1:=0D - ErrorMsgList.append('Line %d : in Comment,= <%s> does NOT have %s ' % (CommentStartLine, (TagPartList[0] + ' ' + TagPa= rtList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'))=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION= _HEADER, 'in Comment, <%s> does NOT have %s ' % ((TagPartList[0] + ' ' + Ta= gPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), T= ableName, CommentId)=0D -=0D + ErrorMsgList.append('Line %d : in Comment,= <%s> does NOT have %s ' % (=0D + CommentStartLine, (TagPartList[0] + ' = ' + TagPartList[1]).replace('\n', '').replace('\r', ''), '[' + InOutStr + '= ]'))=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION= _HEADER, 'in Comment, <%s> does NOT have %s ' % (=0D + (TagPartList[0] + ' ' + TagPartList[1]= ).replace('\n', '').replace('\r', ''), '[' + InOutStr + ']'), TableName, Co= mmentId)=0D =0D if Tag.find(ParamName) =3D=3D -1 and ParamName !=3D 'VOID' and= ParamName !=3D 'void':=0D - ErrorMsgList.append('Line %d : in Comment, <%s> is NOT con= sistent with parameter name %s ' % (CommentStartLine, (TagPartList[0] + ' '= + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName))=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Com= ment, <%s> is NOT consistent with parameter name %s ' % ((TagPartList[0] + = ' ' + TagPartList[1]).replace('\n', '').replace('\r', ''), ParamName), Tabl= eName, CommentId)=0D + ErrorMsgList.append('Line %d : in Comment, <%s> is NOT con= sistent with parameter name %s ' % (=0D + CommentStartLine, (TagPartList[0] + ' ' + TagPartList[= 1]).replace('\n', '').replace('\r', ''), ParamName))=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'in Com= ment, <%s> is NOT consistent with parameter name %s ' % (=0D + (TagPartList[0] + ' ' + TagPartList[1]).replace('\n', = '').replace('\r', ''), ParamName), TableName, CommentId)=0D Index +=3D 1=0D =0D if Index < ParamNumber:=0D - ErrorMsgList.append('Line %d : Number of doxygen tags in comme= nt less than number of function parameters' % CommentStartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Number of = doxygen tags in comment less than number of function parameters ', TableNam= e, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : Number of doxygen tags in comment less than num= ber of function parameters' % CommentStartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'Number of doxygen tags in comment less than num= ber of function parameters ', TableName, CommentId)=0D # VOID return type, NOT VOID*. VOID* should be matched with a doxy= gen tag.=0D if (FuncModifier.find('VOID') !=3D -1 or FuncModifier.find('void')= !=3D -1) and FuncModifier.find('*') =3D=3D -1:=0D =0D # assume we allow a return description tag for void func. retu= rn. that's why 'DoxygenTagNumber - 1' is used instead of 'DoxygenTagNumber'= =0D if Index < DoxygenTagNumber - 1 or (Index < DoxygenTagNumber a= nd DoxygenStrList[Index].startswith('@retval')):=0D - ErrorMsgList.append('Line %d : VOID return type need NO do= xygen tags in comment' % CommentStartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'VOID r= eturn type need no doxygen tags in comment ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : VOID return type need NO doxygen tags in co= mment' % CommentStartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'VOID return type need no doxygen tags in co= mment ', TableName, CommentId)=0D else:=0D if Index < DoxygenTagNumber and not DoxygenStrList[Index].star= tswith('@retval') and not DoxygenStrList[Index].startswith('@return'):=0D - ErrorMsgList.append('Line %d : Number of @param doxygen ta= gs in comment does NOT match number of function parameters' % CommentStartL= ine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'Number= of @param doxygen tags in comment does NOT match number of function parame= ters ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : Number of @param doxygen tags in comment do= es NOT match number of function parameters' % CommentStartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'Number of @param doxygen tags in comment do= es NOT match number of function parameters ', TableName, CommentId)=0D else:=0D if ParamNumber =3D=3D 0 and DoxygenTagNumber !=3D 0 and ((FuncModi= fier.find('VOID') !=3D -1 or FuncModifier.find('void') !=3D -1) and FuncMod= ifier.find('*') =3D=3D -1):=0D - ErrorMsgList.append('Line %d : VOID return type need NO doxyge= n tags in comment' % CommentStartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'VOID retur= n type need NO doxygen tags in comment ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : VOID return type need NO doxygen tags in commen= t' % CommentStartLine)=0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'VOID return type need NO doxygen tags in commen= t ', TableName, CommentId)=0D if ParamNumber !=3D 0 and DoxygenTagNumber =3D=3D 0:=0D - ErrorMsgList.append('Line %d : No doxygen tags in comment' % C= ommentStartLine)=0D - PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER, 'No doxygen= tags in comment ', TableName, CommentId)=0D + ErrorMsgList.append(=0D + 'Line %d : No doxygen tags in comment' % CommentStartLine)= =0D + PrintErrorMsg(ERROR_DOXYGEN_CHECK_FUNCTION_HEADER,=0D + 'No doxygen tags in comment ', TableName, Commen= tId)=0D +=0D =0D if __name__ =3D=3D '__main__':=0D =0D -# EdkLogger.Initialize()=0D -# EdkLogger.SetLevel(EdkLogger.QUIET)=0D -# CollectSourceCodeDataIntoDB(sys.argv[1])=0D + # EdkLogger.Initialize()=0D + # EdkLogger.SetLevel(EdkLogger.QUIET)=0D + # CollectSourceCodeDataIntoDB(sys.argv[1])=0D try:=0D test_file =3D sys.argv[1]=0D except IndexError as v:=0D diff --git a/BaseTools/Source/Python/Eot/CParser3/CLexer.py b/BaseTools/Sou= rce/Python/Eot/CParser3/CLexer.py index ca03adea7a65..c48cb2404bf0 100644 --- a/BaseTools/Source/Python/Eot/CParser3/CLexer.py +++ b/BaseTools/Source/Python/Eot/CParser3/CLexer.py @@ -3,7 +3,7 @@ from antlr3 import *=0D from antlr3.compat import set, frozenset=0D =0D -## @file=0D +# @file=0D # The file defines the Lexer for C source files.=0D #=0D # THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.=0D @@ -17,127 +17,127 @@ from antlr3.compat import set, frozenset ##=0D =0D =0D -=0D # for convenience in actions=0D HIDDEN =3D BaseRecognizer.HIDDEN=0D =0D # token types=0D -T114=3D114=0D -T115=3D115=0D -T116=3D116=0D -T117=3D117=0D -FloatTypeSuffix=3D16=0D -LETTER=3D11=0D -T29=3D29=0D -T28=3D28=0D -T27=3D27=0D -T26=3D26=0D -T25=3D25=0D -EOF=3D-1=0D -STRING_LITERAL=3D9=0D -FLOATING_POINT_LITERAL=3D10=0D -T38=3D38=0D -T37=3D37=0D -T39=3D39=0D -T34=3D34=0D -COMMENT=3D22=0D -T33=3D33=0D -T36=3D36=0D -T35=3D35=0D -T30=3D30=0D -T32=3D32=0D -T31=3D31=0D -LINE_COMMENT=3D23=0D -IntegerTypeSuffix=3D14=0D -CHARACTER_LITERAL=3D8=0D -T49=3D49=0D -T48=3D48=0D -T100=3D100=0D -T43=3D43=0D -T42=3D42=0D -T102=3D102=0D -T41=3D41=0D -T101=3D101=0D -T40=3D40=0D -T47=3D47=0D -T46=3D46=0D -T45=3D45=0D -T44=3D44=0D -T109=3D109=0D -T107=3D107=0D -T108=3D108=0D -T105=3D105=0D -WS=3D19=0D -T106=3D106=0D -T103=3D103=0D -T104=3D104=0D -T50=3D50=0D -LINE_COMMAND=3D24=0D -T59=3D59=0D -T113=3D113=0D -T52=3D52=0D -T112=3D112=0D -T51=3D51=0D -T111=3D111=0D -T54=3D54=0D -T110=3D110=0D -EscapeSequence=3D12=0D -DECIMAL_LITERAL=3D7=0D -T53=3D53=0D -T56=3D56=0D -T55=3D55=0D -T58=3D58=0D -T57=3D57=0D -T75=3D75=0D -T76=3D76=0D -T73=3D73=0D -T74=3D74=0D -T79=3D79=0D -T77=3D77=0D -T78=3D78=0D -Exponent=3D15=0D -HexDigit=3D13=0D -T72=3D72=0D -T71=3D71=0D -T70=3D70=0D -T62=3D62=0D -T63=3D63=0D -T64=3D64=0D -T65=3D65=0D -T66=3D66=0D -T67=3D67=0D -T68=3D68=0D -T69=3D69=0D -IDENTIFIER=3D4=0D -UnicodeVocabulary=3D21=0D -HEX_LITERAL=3D5=0D -T61=3D61=0D -T60=3D60=0D -T99=3D99=0D -T97=3D97=0D -BS=3D20=0D -T98=3D98=0D -T95=3D95=0D -T96=3D96=0D -OCTAL_LITERAL=3D6=0D -T94=3D94=0D -Tokens=3D118=0D -T93=3D93=0D -T92=3D92=0D -T91=3D91=0D -T90=3D90=0D -T88=3D88=0D -T89=3D89=0D -T84=3D84=0D -T85=3D85=0D -T86=3D86=0D -T87=3D87=0D -UnicodeEscape=3D18=0D -T81=3D81=0D -T80=3D80=0D -T83=3D83=0D -OctalEscape=3D17=0D -T82=3D82=0D +T114 =3D 114=0D +T115 =3D 115=0D +T116 =3D 116=0D +T117 =3D 117=0D +FloatTypeSuffix =3D 16=0D +LETTER =3D 11=0D +T29 =3D 29=0D +T28 =3D 28=0D +T27 =3D 27=0D +T26 =3D 26=0D +T25 =3D 25=0D +EOF =3D -1=0D +STRING_LITERAL =3D 9=0D +FLOATING_POINT_LITERAL =3D 10=0D +T38 =3D 38=0D +T37 =3D 37=0D +T39 =3D 39=0D +T34 =3D 34=0D +COMMENT =3D 22=0D +T33 =3D 33=0D +T36 =3D 36=0D +T35 =3D 35=0D +T30 =3D 30=0D +T32 =3D 32=0D +T31 =3D 31=0D +LINE_COMMENT =3D 23=0D +IntegerTypeSuffix =3D 14=0D +CHARACTER_LITERAL =3D 8=0D +T49 =3D 49=0D +T48 =3D 48=0D +T100 =3D 100=0D +T43 =3D 43=0D +T42 =3D 42=0D +T102 =3D 102=0D +T41 =3D 41=0D +T101 =3D 101=0D +T40 =3D 40=0D +T47 =3D 47=0D +T46 =3D 46=0D +T45 =3D 45=0D +T44 =3D 44=0D +T109 =3D 109=0D +T107 =3D 107=0D +T108 =3D 108=0D +T105 =3D 105=0D +WS =3D 19=0D +T106 =3D 106=0D +T103 =3D 103=0D +T104 =3D 104=0D +T50 =3D 50=0D +LINE_COMMAND =3D 24=0D +T59 =3D 59=0D +T113 =3D 113=0D +T52 =3D 52=0D +T112 =3D 112=0D +T51 =3D 51=0D +T111 =3D 111=0D +T54 =3D 54=0D +T110 =3D 110=0D +EscapeSequence =3D 12=0D +DECIMAL_LITERAL =3D 7=0D +T53 =3D 53=0D +T56 =3D 56=0D +T55 =3D 55=0D +T58 =3D 58=0D +T57 =3D 57=0D +T75 =3D 75=0D +T76 =3D 76=0D +T73 =3D 73=0D +T74 =3D 74=0D +T79 =3D 79=0D +T77 =3D 77=0D +T78 =3D 78=0D +Exponent =3D 15=0D +HexDigit =3D 13=0D +T72 =3D 72=0D +T71 =3D 71=0D +T70 =3D 70=0D +T62 =3D 62=0D +T63 =3D 63=0D +T64 =3D 64=0D +T65 =3D 65=0D +T66 =3D 66=0D +T67 =3D 67=0D +T68 =3D 68=0D +T69 =3D 69=0D +IDENTIFIER =3D 4=0D +UnicodeVocabulary =3D 21=0D +HEX_LITERAL =3D 5=0D +T61 =3D 61=0D +T60 =3D 60=0D +T99 =3D 99=0D +T97 =3D 97=0D +BS =3D 20=0D +T98 =3D 98=0D +T95 =3D 95=0D +T96 =3D 96=0D +OCTAL_LITERAL =3D 6=0D +T94 =3D 94=0D +Tokens =3D 118=0D +T93 =3D 93=0D +T92 =3D 92=0D +T91 =3D 91=0D +T90 =3D 90=0D +T88 =3D 88=0D +T89 =3D 89=0D +T84 =3D 84=0D +T85 =3D 85=0D +T86 =3D 86=0D +T87 =3D 87=0D +UnicodeEscape =3D 18=0D +T81 =3D 81=0D +T80 =3D 80=0D +T83 =3D 83=0D +OctalEscape =3D 17=0D +T82 =3D 82=0D +=0D =0D class CLexer(Lexer):=0D =0D @@ -147,31 +147,27 @@ class CLexer(Lexer): Lexer.__init__(self, input)=0D self.dfa25 =3D self.DFA25(=0D self, 25,=0D - eot =3D self.DFA25_eot,=0D - eof =3D self.DFA25_eof,=0D - min =3D self.DFA25_min,=0D - max =3D self.DFA25_max,=0D - accept =3D self.DFA25_accept,=0D - special =3D self.DFA25_special,=0D - transition =3D self.DFA25_transition=0D - )=0D + eot=3Dself.DFA25_eot,=0D + eof=3Dself.DFA25_eof,=0D + min=3Dself.DFA25_min,=0D + max=3Dself.DFA25_max,=0D + accept=3Dself.DFA25_accept,=0D + special=3Dself.DFA25_special,=0D + transition=3Dself.DFA25_transition=0D + )=0D self.dfa35 =3D self.DFA35(=0D self, 35,=0D - eot =3D self.DFA35_eot,=0D - eof =3D self.DFA35_eof,=0D - min =3D self.DFA35_min,=0D - max =3D self.DFA35_max,=0D - accept =3D self.DFA35_accept,=0D - special =3D self.DFA35_special,=0D - transition =3D self.DFA35_transition=0D - )=0D -=0D -=0D -=0D -=0D -=0D + eot=3Dself.DFA35_eot,=0D + eof=3Dself.DFA35_eof,=0D + min=3Dself.DFA35_min,=0D + max=3Dself.DFA35_max,=0D + accept=3Dself.DFA35_accept,=0D + special=3Dself.DFA35_special,=0D + transition=3Dself.DFA35_transition=0D + )=0D =0D # $ANTLR start T25=0D +=0D def mT25(self, ):=0D =0D try:=0D @@ -181,19 +177,14 @@ class CLexer(Lexer): # C.g:27:7: ';'=0D self.match(u';')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T25=0D =0D -=0D -=0D # $ANTLR start T26=0D +=0D def mT26(self, ):=0D =0D try:=0D @@ -203,20 +194,14 @@ class CLexer(Lexer): # C.g:28:7: 'typedef'=0D self.match("typedef")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T26=0D =0D -=0D -=0D # $ANTLR start T27=0D +=0D def mT27(self, ):=0D =0D try:=0D @@ -226,19 +211,14 @@ class CLexer(Lexer): # C.g:29:7: ','=0D self.match(u',')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T27=0D =0D -=0D -=0D # $ANTLR start T28=0D +=0D def mT28(self, ):=0D =0D try:=0D @@ -248,19 +228,14 @@ class CLexer(Lexer): # C.g:30:7: '=3D'=0D self.match(u'=3D')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T28=0D =0D -=0D -=0D # $ANTLR start T29=0D +=0D def mT29(self, ):=0D =0D try:=0D @@ -270,20 +245,14 @@ class CLexer(Lexer): # C.g:31:7: 'extern'=0D self.match("extern")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T29=0D =0D -=0D -=0D # $ANTLR start T30=0D +=0D def mT30(self, ):=0D =0D try:=0D @@ -293,20 +262,14 @@ class CLexer(Lexer): # C.g:32:7: 'static'=0D self.match("static")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T30=0D =0D -=0D -=0D # $ANTLR start T31=0D +=0D def mT31(self, ):=0D =0D try:=0D @@ -316,20 +279,14 @@ class CLexer(Lexer): # C.g:33:7: 'auto'=0D self.match("auto")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T31=0D =0D -=0D -=0D # $ANTLR start T32=0D +=0D def mT32(self, ):=0D =0D try:=0D @@ -339,20 +296,14 @@ class CLexer(Lexer): # C.g:34:7: 'register'=0D self.match("register")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T32=0D =0D -=0D -=0D # $ANTLR start T33=0D +=0D def mT33(self, ):=0D =0D try:=0D @@ -362,20 +313,14 @@ class CLexer(Lexer): # C.g:35:7: 'STATIC'=0D self.match("STATIC")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T33=0D =0D -=0D -=0D # $ANTLR start T34=0D +=0D def mT34(self, ):=0D =0D try:=0D @@ -385,20 +330,14 @@ class CLexer(Lexer): # C.g:36:7: 'void'=0D self.match("void")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T34=0D =0D -=0D -=0D # $ANTLR start T35=0D +=0D def mT35(self, ):=0D =0D try:=0D @@ -408,20 +347,14 @@ class CLexer(Lexer): # C.g:37:7: 'char'=0D self.match("char")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T35=0D =0D -=0D -=0D # $ANTLR start T36=0D +=0D def mT36(self, ):=0D =0D try:=0D @@ -431,20 +364,14 @@ class CLexer(Lexer): # C.g:38:7: 'short'=0D self.match("short")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T36=0D =0D -=0D -=0D # $ANTLR start T37=0D +=0D def mT37(self, ):=0D =0D try:=0D @@ -454,20 +381,14 @@ class CLexer(Lexer): # C.g:39:7: 'int'=0D self.match("int")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T37=0D =0D -=0D -=0D # $ANTLR start T38=0D +=0D def mT38(self, ):=0D =0D try:=0D @@ -477,20 +398,14 @@ class CLexer(Lexer): # C.g:40:7: 'long'=0D self.match("long")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T38=0D =0D -=0D -=0D # $ANTLR start T39=0D +=0D def mT39(self, ):=0D =0D try:=0D @@ -500,20 +415,14 @@ class CLexer(Lexer): # C.g:41:7: 'float'=0D self.match("float")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T39=0D =0D -=0D -=0D # $ANTLR start T40=0D +=0D def mT40(self, ):=0D =0D try:=0D @@ -523,20 +432,14 @@ class CLexer(Lexer): # C.g:42:7: 'double'=0D self.match("double")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T40=0D =0D -=0D -=0D # $ANTLR start T41=0D +=0D def mT41(self, ):=0D =0D try:=0D @@ -546,20 +449,14 @@ class CLexer(Lexer): # C.g:43:7: 'signed'=0D self.match("signed")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T41=0D =0D -=0D -=0D # $ANTLR start T42=0D +=0D def mT42(self, ):=0D =0D try:=0D @@ -569,20 +466,14 @@ class CLexer(Lexer): # C.g:44:7: 'unsigned'=0D self.match("unsigned")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T42=0D =0D -=0D -=0D # $ANTLR start T43=0D +=0D def mT43(self, ):=0D =0D try:=0D @@ -592,19 +483,14 @@ class CLexer(Lexer): # C.g:45:7: '{'=0D self.match(u'{')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T43=0D =0D -=0D -=0D # $ANTLR start T44=0D +=0D def mT44(self, ):=0D =0D try:=0D @@ -614,19 +500,14 @@ class CLexer(Lexer): # C.g:46:7: '}'=0D self.match(u'}')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T44=0D =0D -=0D -=0D # $ANTLR start T45=0D +=0D def mT45(self, ):=0D =0D try:=0D @@ -636,20 +517,14 @@ class CLexer(Lexer): # C.g:47:7: 'struct'=0D self.match("struct")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T45=0D =0D -=0D -=0D # $ANTLR start T46=0D +=0D def mT46(self, ):=0D =0D try:=0D @@ -659,20 +534,14 @@ class CLexer(Lexer): # C.g:48:7: 'union'=0D self.match("union")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T46=0D =0D -=0D -=0D # $ANTLR start T47=0D +=0D def mT47(self, ):=0D =0D try:=0D @@ -682,19 +551,14 @@ class CLexer(Lexer): # C.g:49:7: ':'=0D self.match(u':')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T47=0D =0D -=0D -=0D # $ANTLR start T48=0D +=0D def mT48(self, ):=0D =0D try:=0D @@ -704,20 +568,14 @@ class CLexer(Lexer): # C.g:50:7: 'enum'=0D self.match("enum")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T48=0D =0D -=0D -=0D # $ANTLR start T49=0D +=0D def mT49(self, ):=0D =0D try:=0D @@ -727,20 +585,14 @@ class CLexer(Lexer): # C.g:51:7: 'const'=0D self.match("const")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T49=0D =0D -=0D -=0D # $ANTLR start T50=0D +=0D def mT50(self, ):=0D =0D try:=0D @@ -750,20 +602,14 @@ class CLexer(Lexer): # C.g:52:7: 'volatile'=0D self.match("volatile")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T50=0D =0D -=0D -=0D # $ANTLR start T51=0D +=0D def mT51(self, ):=0D =0D try:=0D @@ -773,20 +619,14 @@ class CLexer(Lexer): # C.g:53:7: 'IN'=0D self.match("IN")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T51=0D =0D -=0D -=0D # $ANTLR start T52=0D +=0D def mT52(self, ):=0D =0D try:=0D @@ -796,20 +636,14 @@ class CLexer(Lexer): # C.g:54:7: 'OUT'=0D self.match("OUT")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T52=0D =0D -=0D -=0D # $ANTLR start T53=0D +=0D def mT53(self, ):=0D =0D try:=0D @@ -819,20 +653,14 @@ class CLexer(Lexer): # C.g:55:7: 'OPTIONAL'=0D self.match("OPTIONAL")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T53=0D =0D -=0D -=0D # $ANTLR start T54=0D +=0D def mT54(self, ):=0D =0D try:=0D @@ -842,20 +670,14 @@ class CLexer(Lexer): # C.g:56:7: 'CONST'=0D self.match("CONST")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T54=0D =0D -=0D -=0D # $ANTLR start T55=0D +=0D def mT55(self, ):=0D =0D try:=0D @@ -865,20 +687,14 @@ class CLexer(Lexer): # C.g:57:7: 'UNALIGNED'=0D self.match("UNALIGNED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T55=0D =0D -=0D -=0D # $ANTLR start T56=0D +=0D def mT56(self, ):=0D =0D try:=0D @@ -888,20 +704,14 @@ class CLexer(Lexer): # C.g:58:7: 'VOLATILE'=0D self.match("VOLATILE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T56=0D =0D -=0D -=0D # $ANTLR start T57=0D +=0D def mT57(self, ):=0D =0D try:=0D @@ -911,20 +721,14 @@ class CLexer(Lexer): # C.g:59:7: 'GLOBAL_REMOVE_IF_UNREFERENCED'=0D self.match("GLOBAL_REMOVE_IF_UNREFERENCED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T57=0D =0D -=0D -=0D # $ANTLR start T58=0D +=0D def mT58(self, ):=0D =0D try:=0D @@ -934,20 +738,14 @@ class CLexer(Lexer): # C.g:60:7: 'EFIAPI'=0D self.match("EFIAPI")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T58=0D =0D -=0D -=0D # $ANTLR start T59=0D +=0D def mT59(self, ):=0D =0D try:=0D @@ -957,20 +755,14 @@ class CLexer(Lexer): # C.g:61:7: 'EFI_BOOTSERVICE'=0D self.match("EFI_BOOTSERVICE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T59=0D =0D -=0D -=0D # $ANTLR start T60=0D +=0D def mT60(self, ):=0D =0D try:=0D @@ -980,20 +772,14 @@ class CLexer(Lexer): # C.g:62:7: 'EFI_RUNTIMESERVICE'=0D self.match("EFI_RUNTIMESERVICE")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T60=0D =0D -=0D -=0D # $ANTLR start T61=0D +=0D def mT61(self, ):=0D =0D try:=0D @@ -1003,20 +789,14 @@ class CLexer(Lexer): # C.g:63:7: 'PACKED'=0D self.match("PACKED")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T61=0D =0D -=0D -=0D # $ANTLR start T62=0D +=0D def mT62(self, ):=0D =0D try:=0D @@ -1026,19 +806,14 @@ class CLexer(Lexer): # C.g:64:7: '('=0D self.match(u'(')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T62=0D =0D -=0D -=0D # $ANTLR start T63=0D +=0D def mT63(self, ):=0D =0D try:=0D @@ -1048,19 +823,14 @@ class CLexer(Lexer): # C.g:65:7: ')'=0D self.match(u')')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T63=0D =0D -=0D -=0D # $ANTLR start T64=0D +=0D def mT64(self, ):=0D =0D try:=0D @@ -1070,19 +840,14 @@ class CLexer(Lexer): # C.g:66:7: '['=0D self.match(u'[')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T64=0D =0D -=0D -=0D # $ANTLR start T65=0D +=0D def mT65(self, ):=0D =0D try:=0D @@ -1092,19 +857,14 @@ class CLexer(Lexer): # C.g:67:7: ']'=0D self.match(u']')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T65=0D =0D -=0D -=0D # $ANTLR start T66=0D +=0D def mT66(self, ):=0D =0D try:=0D @@ -1114,19 +874,14 @@ class CLexer(Lexer): # C.g:68:7: '*'=0D self.match(u'*')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T66=0D =0D -=0D -=0D # $ANTLR start T67=0D +=0D def mT67(self, ):=0D =0D try:=0D @@ -1136,20 +891,14 @@ class CLexer(Lexer): # C.g:69:7: '...'=0D self.match("...")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T67=0D =0D -=0D -=0D # $ANTLR start T68=0D +=0D def mT68(self, ):=0D =0D try:=0D @@ -1159,19 +908,14 @@ class CLexer(Lexer): # C.g:70:7: '+'=0D self.match(u'+')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T68=0D =0D -=0D -=0D # $ANTLR start T69=0D +=0D def mT69(self, ):=0D =0D try:=0D @@ -1181,19 +925,14 @@ class CLexer(Lexer): # C.g:71:7: '-'=0D self.match(u'-')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T69=0D =0D -=0D -=0D # $ANTLR start T70=0D +=0D def mT70(self, ):=0D =0D try:=0D @@ -1203,19 +942,14 @@ class CLexer(Lexer): # C.g:72:7: '/'=0D self.match(u'/')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T70=0D =0D -=0D -=0D # $ANTLR start T71=0D +=0D def mT71(self, ):=0D =0D try:=0D @@ -1225,19 +959,14 @@ class CLexer(Lexer): # C.g:73:7: '%'=0D self.match(u'%')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T71=0D =0D -=0D -=0D # $ANTLR start T72=0D +=0D def mT72(self, ):=0D =0D try:=0D @@ -1247,20 +976,14 @@ class CLexer(Lexer): # C.g:74:7: '++'=0D self.match("++")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T72=0D =0D -=0D -=0D # $ANTLR start T73=0D +=0D def mT73(self, ):=0D =0D try:=0D @@ -1270,20 +993,14 @@ class CLexer(Lexer): # C.g:75:7: '--'=0D self.match("--")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T73=0D =0D -=0D -=0D # $ANTLR start T74=0D +=0D def mT74(self, ):=0D =0D try:=0D @@ -1293,20 +1010,14 @@ class CLexer(Lexer): # C.g:76:7: 'sizeof'=0D self.match("sizeof")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T74=0D =0D -=0D -=0D # $ANTLR start T75=0D +=0D def mT75(self, ):=0D =0D try:=0D @@ -1316,19 +1027,14 @@ class CLexer(Lexer): # C.g:77:7: '.'=0D self.match(u'.')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T75=0D =0D -=0D -=0D # $ANTLR start T76=0D +=0D def mT76(self, ):=0D =0D try:=0D @@ -1338,20 +1044,14 @@ class CLexer(Lexer): # C.g:78:7: '->'=0D self.match("->")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T76=0D =0D -=0D -=0D # $ANTLR start T77=0D +=0D def mT77(self, ):=0D =0D try:=0D @@ -1361,19 +1061,14 @@ class CLexer(Lexer): # C.g:79:7: '&'=0D self.match(u'&')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T77=0D =0D -=0D -=0D # $ANTLR start T78=0D +=0D def mT78(self, ):=0D =0D try:=0D @@ -1383,19 +1078,14 @@ class CLexer(Lexer): # C.g:80:7: '~'=0D self.match(u'~')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T78=0D =0D -=0D -=0D # $ANTLR start T79=0D +=0D def mT79(self, ):=0D =0D try:=0D @@ -1405,19 +1095,14 @@ class CLexer(Lexer): # C.g:81:7: '!'=0D self.match(u'!')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T79=0D =0D -=0D -=0D # $ANTLR start T80=0D +=0D def mT80(self, ):=0D =0D try:=0D @@ -1427,20 +1112,14 @@ class CLexer(Lexer): # C.g:82:7: '*=3D'=0D self.match("*=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T80=0D =0D -=0D -=0D # $ANTLR start T81=0D +=0D def mT81(self, ):=0D =0D try:=0D @@ -1450,20 +1129,14 @@ class CLexer(Lexer): # C.g:83:7: '/=3D'=0D self.match("/=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T81=0D =0D -=0D -=0D # $ANTLR start T82=0D +=0D def mT82(self, ):=0D =0D try:=0D @@ -1473,20 +1146,14 @@ class CLexer(Lexer): # C.g:84:7: '%=3D'=0D self.match("%=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T82=0D =0D -=0D -=0D # $ANTLR start T83=0D +=0D def mT83(self, ):=0D =0D try:=0D @@ -1496,20 +1163,14 @@ class CLexer(Lexer): # C.g:85:7: '+=3D'=0D self.match("+=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T83=0D =0D -=0D -=0D # $ANTLR start T84=0D +=0D def mT84(self, ):=0D =0D try:=0D @@ -1519,20 +1180,14 @@ class CLexer(Lexer): # C.g:86:7: '-=3D'=0D self.match("-=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T84=0D =0D -=0D -=0D # $ANTLR start T85=0D +=0D def mT85(self, ):=0D =0D try:=0D @@ -1542,20 +1197,14 @@ class CLexer(Lexer): # C.g:87:7: '<<=3D'=0D self.match("<<=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T85=0D =0D -=0D -=0D # $ANTLR start T86=0D +=0D def mT86(self, ):=0D =0D try:=0D @@ -1565,20 +1214,14 @@ class CLexer(Lexer): # C.g:88:7: '>>=3D'=0D self.match(">>=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T86=0D =0D -=0D -=0D # $ANTLR start T87=0D +=0D def mT87(self, ):=0D =0D try:=0D @@ -1588,20 +1231,14 @@ class CLexer(Lexer): # C.g:89:7: '&=3D'=0D self.match("&=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T87=0D =0D -=0D -=0D # $ANTLR start T88=0D +=0D def mT88(self, ):=0D =0D try:=0D @@ -1611,20 +1248,14 @@ class CLexer(Lexer): # C.g:90:7: '^=3D'=0D self.match("^=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T88=0D =0D -=0D -=0D # $ANTLR start T89=0D +=0D def mT89(self, ):=0D =0D try:=0D @@ -1634,20 +1265,14 @@ class CLexer(Lexer): # C.g:91:7: '|=3D'=0D self.match("|=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T89=0D =0D -=0D -=0D # $ANTLR start T90=0D +=0D def mT90(self, ):=0D =0D try:=0D @@ -1657,19 +1282,14 @@ class CLexer(Lexer): # C.g:92:7: '?'=0D self.match(u'?')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T90=0D =0D -=0D -=0D # $ANTLR start T91=0D +=0D def mT91(self, ):=0D =0D try:=0D @@ -1679,20 +1299,14 @@ class CLexer(Lexer): # C.g:93:7: '||'=0D self.match("||")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T91=0D =0D -=0D -=0D # $ANTLR start T92=0D +=0D def mT92(self, ):=0D =0D try:=0D @@ -1702,20 +1316,14 @@ class CLexer(Lexer): # C.g:94:7: '&&'=0D self.match("&&")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T92=0D =0D -=0D -=0D # $ANTLR start T93=0D +=0D def mT93(self, ):=0D =0D try:=0D @@ -1725,19 +1333,14 @@ class CLexer(Lexer): # C.g:95:7: '|'=0D self.match(u'|')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T93=0D =0D -=0D -=0D # $ANTLR start T94=0D +=0D def mT94(self, ):=0D =0D try:=0D @@ -1747,19 +1350,14 @@ class CLexer(Lexer): # C.g:96:7: '^'=0D self.match(u'^')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T94=0D =0D -=0D -=0D # $ANTLR start T95=0D +=0D def mT95(self, ):=0D =0D try:=0D @@ -1769,20 +1367,14 @@ class CLexer(Lexer): # C.g:97:7: '=3D=3D'=0D self.match("=3D=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T95=0D =0D -=0D -=0D # $ANTLR start T96=0D +=0D def mT96(self, ):=0D =0D try:=0D @@ -1792,20 +1384,14 @@ class CLexer(Lexer): # C.g:98:7: '!=3D'=0D self.match("!=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T96=0D =0D -=0D -=0D # $ANTLR start T97=0D +=0D def mT97(self, ):=0D =0D try:=0D @@ -1815,19 +1401,14 @@ class CLexer(Lexer): # C.g:99:7: '<'=0D self.match(u'<')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T97=0D =0D -=0D -=0D # $ANTLR start T98=0D +=0D def mT98(self, ):=0D =0D try:=0D @@ -1837,19 +1418,14 @@ class CLexer(Lexer): # C.g:100:7: '>'=0D self.match(u'>')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T98=0D =0D -=0D -=0D # $ANTLR start T99=0D +=0D def mT99(self, ):=0D =0D try:=0D @@ -1859,20 +1435,14 @@ class CLexer(Lexer): # C.g:101:7: '<=3D'=0D self.match("<=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T99=0D =0D -=0D -=0D # $ANTLR start T100=0D +=0D def mT100(self, ):=0D =0D try:=0D @@ -1882,20 +1452,14 @@ class CLexer(Lexer): # C.g:102:8: '>=3D'=0D self.match(">=3D")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T100=0D =0D -=0D -=0D # $ANTLR start T101=0D +=0D def mT101(self, ):=0D =0D try:=0D @@ -1905,20 +1469,14 @@ class CLexer(Lexer): # C.g:103:8: '<<'=0D self.match("<<")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T101=0D =0D -=0D -=0D # $ANTLR start T102=0D +=0D def mT102(self, ):=0D =0D try:=0D @@ -1928,20 +1486,14 @@ class CLexer(Lexer): # C.g:104:8: '>>'=0D self.match(">>")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T102=0D =0D -=0D -=0D # $ANTLR start T103=0D +=0D def mT103(self, ):=0D =0D try:=0D @@ -1951,20 +1503,14 @@ class CLexer(Lexer): # C.g:105:8: '__asm__'=0D self.match("__asm__")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T103=0D =0D -=0D -=0D # $ANTLR start T104=0D +=0D def mT104(self, ):=0D =0D try:=0D @@ -1974,20 +1520,14 @@ class CLexer(Lexer): # C.g:106:8: '_asm'=0D self.match("_asm")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T104=0D =0D -=0D -=0D # $ANTLR start T105=0D +=0D def mT105(self, ):=0D =0D try:=0D @@ -1997,20 +1537,14 @@ class CLexer(Lexer): # C.g:107:8: '__asm'=0D self.match("__asm")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T105=0D =0D -=0D -=0D # $ANTLR start T106=0D +=0D def mT106(self, ):=0D =0D try:=0D @@ -2020,20 +1554,14 @@ class CLexer(Lexer): # C.g:108:8: 'case'=0D self.match("case")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T106=0D =0D -=0D -=0D # $ANTLR start T107=0D +=0D def mT107(self, ):=0D =0D try:=0D @@ -2043,20 +1571,14 @@ class CLexer(Lexer): # C.g:109:8: 'default'=0D self.match("default")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T107=0D =0D -=0D -=0D # $ANTLR start T108=0D +=0D def mT108(self, ):=0D =0D try:=0D @@ -2066,20 +1588,14 @@ class CLexer(Lexer): # C.g:110:8: 'if'=0D self.match("if")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T108=0D =0D -=0D -=0D # $ANTLR start T109=0D +=0D def mT109(self, ):=0D =0D try:=0D @@ -2089,20 +1605,14 @@ class CLexer(Lexer): # C.g:111:8: 'else'=0D self.match("else")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T109=0D =0D -=0D -=0D # $ANTLR start T110=0D +=0D def mT110(self, ):=0D =0D try:=0D @@ -2112,20 +1622,14 @@ class CLexer(Lexer): # C.g:112:8: 'switch'=0D self.match("switch")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T110=0D =0D -=0D -=0D # $ANTLR start T111=0D +=0D def mT111(self, ):=0D =0D try:=0D @@ -2135,20 +1639,14 @@ class CLexer(Lexer): # C.g:113:8: 'while'=0D self.match("while")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T111=0D =0D -=0D -=0D # $ANTLR start T112=0D +=0D def mT112(self, ):=0D =0D try:=0D @@ -2158,20 +1656,14 @@ class CLexer(Lexer): # C.g:114:8: 'do'=0D self.match("do")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T112=0D =0D -=0D -=0D # $ANTLR start T113=0D +=0D def mT113(self, ):=0D =0D try:=0D @@ -2181,20 +1673,14 @@ class CLexer(Lexer): # C.g:115:8: 'for'=0D self.match("for")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T113=0D =0D -=0D -=0D # $ANTLR start T114=0D +=0D def mT114(self, ):=0D =0D try:=0D @@ -2204,20 +1690,14 @@ class CLexer(Lexer): # C.g:116:8: 'goto'=0D self.match("goto")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T114=0D =0D -=0D -=0D # $ANTLR start T115=0D +=0D def mT115(self, ):=0D =0D try:=0D @@ -2227,20 +1707,14 @@ class CLexer(Lexer): # C.g:117:8: 'continue'=0D self.match("continue")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T115=0D =0D -=0D -=0D # $ANTLR start T116=0D +=0D def mT116(self, ):=0D =0D try:=0D @@ -2250,20 +1724,14 @@ class CLexer(Lexer): # C.g:118:8: 'break'=0D self.match("break")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T116=0D =0D -=0D -=0D # $ANTLR start T117=0D +=0D def mT117(self, ):=0D =0D try:=0D @@ -2273,20 +1741,14 @@ class CLexer(Lexer): # C.g:119:8: 'return'=0D self.match("return")=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end T117=0D =0D -=0D -=0D # $ANTLR start IDENTIFIER=0D +=0D def mIDENTIFIER(self, ):=0D =0D try:=0D @@ -2297,34 +1759,25 @@ class CLexer(Lexer): self.mLETTER()=0D =0D # C.g:586:11: ( LETTER | '0' .. '9' )*=0D - while True: #loop1=0D + while True: # loop1=0D alt1 =3D 2=0D LA1_0 =3D self.input.LA(1)=0D =0D - if (LA1_0 =3D=3D u'$' or (u'0' <=3D LA1_0 <=3D u'9') or (u= 'A' <=3D LA1_0 <=3D u'Z') or LA1_0 =3D=3D u'_' or (u'a' <=3D LA1_0 <=3D u'z= ')) :=0D + if (LA1_0 =3D=3D u'$' or (u'0' <=3D LA1_0 <=3D u'9') or (u= 'A' <=3D LA1_0 <=3D u'Z') or LA1_0 =3D=3D u'_' or (u'a' <=3D LA1_0 <=3D u'z= ')):=0D alt1 =3D 1=0D =0D -=0D if alt1 =3D=3D 1:=0D # C.g:=0D if self.input.LA(1) =3D=3D u'$' or (u'0' <=3D self.inp= ut.LA(1) <=3D u'9') or (u'A' <=3D self.input.LA(1) <=3D u'Z') or self.input= .LA(1) =3D=3D u'_' or (u'a' <=3D self.input.LA(1) <=3D u'z'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop1=0D -=0D -=0D -=0D -=0D -=0D + break # loop1=0D =0D finally:=0D =0D @@ -2332,36 +1785,29 @@ class CLexer(Lexer): =0D # $ANTLR end IDENTIFIER=0D =0D -=0D -=0D # $ANTLR start LETTER=0D +=0D def mLETTER(self, ):=0D =0D try:=0D # C.g:591:2: ( '$' | 'A' .. 'Z' | 'a' .. 'z' | '_' )=0D # C.g:=0D if self.input.LA(1) =3D=3D u'$' or (u'A' <=3D self.input.LA(1)= <=3D u'Z') or self.input.LA(1) =3D=3D u'_' or (u'a' <=3D self.input.LA(1) = <=3D u'z'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end LETTER=0D =0D -=0D -=0D # $ANTLR start CHARACTER_LITERAL=0D +=0D def mCHARACTER_LITERAL(self, ):=0D =0D try:=0D @@ -2373,27 +1819,25 @@ class CLexer(Lexer): alt2 =3D 2=0D LA2_0 =3D self.input.LA(1)=0D =0D - if (LA2_0 =3D=3D u'L') :=0D + if (LA2_0 =3D=3D u'L'):=0D alt2 =3D 1=0D if alt2 =3D=3D 1:=0D # C.g:598:10: 'L'=0D self.match(u'L')=0D =0D -=0D -=0D -=0D self.match(u'\'')=0D =0D # C.g:598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )=0D alt3 =3D 2=0D LA3_0 =3D self.input.LA(1)=0D =0D - if (LA3_0 =3D=3D u'\\') :=0D + if (LA3_0 =3D=3D u'\\'):=0D alt3 =3D 1=0D - elif ((u'\u0000' <=3D LA3_0 <=3D u'&') or (u'(' <=3D LA3_0 <= =3D u'[') or (u']' <=3D LA3_0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA3_0 <=3D u'&') or (u'(' <=3D LA3_0 <= =3D u'[') or (u']' <=3D LA3_0 <=3D u'\uFFFE')):=0D alt3 =3D 2=0D else:=0D - nvae =3D NoViableAltException("598:21: ( EscapeSequence | = ~ ( '\\'' | '\\\\' ) )", 3, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "598:21: ( EscapeSequence | ~ ( '\\'' | '\\\\' ) )", 3= , 0, self.input)=0D =0D raise nvae=0D =0D @@ -2401,37 +1845,26 @@ class CLexer(Lexer): # C.g:598:23: EscapeSequence=0D self.mEscapeSequence()=0D =0D -=0D -=0D elif alt3 =3D=3D 2:=0D # C.g:598:40: ~ ( '\\'' | '\\\\' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'&') or (u'(' <= =3D self.input.LA(1) <=3D u'[') or (u']' <=3D self.input.LA(1) <=3D u'\uFFF= E'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D self.match(u'\'')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end CHARACTER_LITERAL=0D =0D -=0D -=0D # $ANTLR start STRING_LITERAL=0D +=0D def mSTRING_LITERAL(self, ):=0D =0D try:=0D @@ -2443,66 +1876,51 @@ class CLexer(Lexer): alt4 =3D 2=0D LA4_0 =3D self.input.LA(1)=0D =0D - if (LA4_0 =3D=3D u'L') :=0D + if (LA4_0 =3D=3D u'L'):=0D alt4 =3D 1=0D if alt4 =3D=3D 1:=0D # C.g:602:9: 'L'=0D self.match(u'L')=0D =0D -=0D -=0D -=0D self.match(u'"')=0D =0D # C.g:602:19: ( EscapeSequence | ~ ( '\\\\' | '\"' ) )*=0D - while True: #loop5=0D + while True: # loop5=0D alt5 =3D 3=0D LA5_0 =3D self.input.LA(1)=0D =0D - if (LA5_0 =3D=3D u'\\') :=0D + if (LA5_0 =3D=3D u'\\'):=0D alt5 =3D 1=0D - elif ((u'\u0000' <=3D LA5_0 <=3D u'!') or (u'#' <=3D LA5_0= <=3D u'[') or (u']' <=3D LA5_0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA5_0 <=3D u'!') or (u'#' <=3D LA5_0= <=3D u'[') or (u']' <=3D LA5_0 <=3D u'\uFFFE')):=0D alt5 =3D 2=0D =0D -=0D if alt5 =3D=3D 1:=0D # C.g:602:21: EscapeSequence=0D self.mEscapeSequence()=0D =0D -=0D -=0D elif alt5 =3D=3D 2:=0D # C.g:602:38: ~ ( '\\\\' | '\"' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'!') or (u'#= ' <=3D self.input.LA(1) <=3D u'[') or (u']' <=3D self.input.LA(1) <=3D u'\u= FFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop5=0D -=0D + break # loop5=0D =0D self.match(u'"')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end STRING_LITERAL=0D =0D -=0D -=0D # $ANTLR start HEX_LITERAL=0D +=0D def mHEX_LITERAL(self, ):=0D =0D try:=0D @@ -2513,66 +1931,53 @@ class CLexer(Lexer): self.match(u'0')=0D =0D if self.input.LA(1) =3D=3D u'X' or self.input.LA(1) =3D=3D u'x= ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D # C.g:605:29: ( HexDigit )+=0D cnt6 =3D 0=0D - while True: #loop6=0D + while True: # loop6=0D alt6 =3D 2=0D LA6_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA6_0 <=3D u'9') or (u'A' <=3D LA6_0 <=3D u= 'F') or (u'a' <=3D LA6_0 <=3D u'f')) :=0D + if ((u'0' <=3D LA6_0 <=3D u'9') or (u'A' <=3D LA6_0 <=3D u= 'F') or (u'a' <=3D LA6_0 <=3D u'f')):=0D alt6 =3D 1=0D =0D -=0D if alt6 =3D=3D 1:=0D # C.g:605:29: HexDigit=0D self.mHexDigit()=0D =0D -=0D -=0D else:=0D if cnt6 >=3D 1:=0D - break #loop6=0D + break # loop6=0D =0D eee =3D EarlyExitException(6, self.input)=0D raise eee=0D =0D cnt6 +=3D 1=0D =0D -=0D # C.g:605:39: ( IntegerTypeSuffix )?=0D alt7 =3D 2=0D LA7_0 =3D self.input.LA(1)=0D =0D - if (LA7_0 =3D=3D u'L' or LA7_0 =3D=3D u'U' or LA7_0 =3D=3D u'l= ' or LA7_0 =3D=3D u'u') :=0D + if (LA7_0 =3D=3D u'L' or LA7_0 =3D=3D u'U' or LA7_0 =3D=3D u'l= ' or LA7_0 =3D=3D u'u'):=0D alt7 =3D 1=0D if alt7 =3D=3D 1:=0D # C.g:605:39: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end HEX_LITERAL=0D =0D -=0D -=0D # $ANTLR start DECIMAL_LITERAL=0D +=0D def mDECIMAL_LITERAL(self, ):=0D =0D try:=0D @@ -2584,12 +1989,13 @@ class CLexer(Lexer): alt9 =3D 2=0D LA9_0 =3D self.input.LA(1)=0D =0D - if (LA9_0 =3D=3D u'0') :=0D + if (LA9_0 =3D=3D u'0'):=0D alt9 =3D 1=0D - elif ((u'1' <=3D LA9_0 <=3D u'9')) :=0D + elif ((u'1' <=3D LA9_0 <=3D u'9')):=0D alt9 =3D 2=0D else:=0D - nvae =3D NoViableAltException("607:19: ( '0' | '1' .. '9' = ( '0' .. '9' )* )", 9, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "607:19: ( '0' | '1' .. '9' ( '0' .. '9' )* )", 9, 0, = self.input)=0D =0D raise nvae=0D =0D @@ -2597,60 +2003,43 @@ class CLexer(Lexer): # C.g:607:20: '0'=0D self.match(u'0')=0D =0D -=0D -=0D elif alt9 =3D=3D 2:=0D # C.g:607:26: '1' .. '9' ( '0' .. '9' )*=0D self.matchRange(u'1', u'9')=0D =0D # C.g:607:35: ( '0' .. '9' )*=0D - while True: #loop8=0D + while True: # loop8=0D alt8 =3D 2=0D LA8_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA8_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA8_0 <=3D u'9')):=0D alt8 =3D 1=0D =0D -=0D if alt8 =3D=3D 1:=0D # C.g:607:35: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D - break #loop8=0D -=0D -=0D -=0D -=0D + break # loop8=0D =0D # C.g:607:46: ( IntegerTypeSuffix )?=0D alt10 =3D 2=0D LA10_0 =3D self.input.LA(1)=0D =0D - if (LA10_0 =3D=3D u'L' or LA10_0 =3D=3D u'U' or LA10_0 =3D=3D = u'l' or LA10_0 =3D=3D u'u') :=0D + if (LA10_0 =3D=3D u'L' or LA10_0 =3D=3D u'U' or LA10_0 =3D=3D = u'l' or LA10_0 =3D=3D u'u'):=0D alt10 =3D 1=0D if alt10 =3D=3D 1:=0D # C.g:607:46: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end DECIMAL_LITERAL=0D =0D -=0D -=0D # $ANTLR start OCTAL_LITERAL=0D +=0D def mOCTAL_LITERAL(self, ):=0D =0D try:=0D @@ -2662,83 +2051,65 @@ class CLexer(Lexer): =0D # C.g:609:21: ( '0' .. '7' )+=0D cnt11 =3D 0=0D - while True: #loop11=0D + while True: # loop11=0D alt11 =3D 2=0D LA11_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA11_0 <=3D u'7')) :=0D + if ((u'0' <=3D LA11_0 <=3D u'7')):=0D alt11 =3D 1=0D =0D -=0D if alt11 =3D=3D 1:=0D # C.g:609:22: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D else:=0D if cnt11 >=3D 1:=0D - break #loop11=0D + break # loop11=0D =0D eee =3D EarlyExitException(11, self.input)=0D raise eee=0D =0D cnt11 +=3D 1=0D =0D -=0D # C.g:609:33: ( IntegerTypeSuffix )?=0D alt12 =3D 2=0D LA12_0 =3D self.input.LA(1)=0D =0D - if (LA12_0 =3D=3D u'L' or LA12_0 =3D=3D u'U' or LA12_0 =3D=3D = u'l' or LA12_0 =3D=3D u'u') :=0D + if (LA12_0 =3D=3D u'L' or LA12_0 =3D=3D u'U' or LA12_0 =3D=3D = u'l' or LA12_0 =3D=3D u'u'):=0D alt12 =3D 1=0D if alt12 =3D=3D 1:=0D # C.g:609:33: IntegerTypeSuffix=0D self.mIntegerTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end OCTAL_LITERAL=0D =0D -=0D -=0D # $ANTLR start HexDigit=0D +=0D def mHexDigit(self, ):=0D =0D try:=0D # C.g:612:10: ( ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' ) )=0D # C.g:612:12: ( '0' .. '9' | 'a' .. 'f' | 'A' .. 'F' )=0D if (u'0' <=3D self.input.LA(1) <=3D u'9') or (u'A' <=3D self.i= nput.LA(1) <=3D u'F') or (u'a' <=3D self.input.LA(1) <=3D u'f'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end HexDigit=0D =0D -=0D -=0D # $ANTLR start IntegerTypeSuffix=0D +=0D def mIntegerTypeSuffix(self, ):=0D =0D try:=0D @@ -2746,114 +2117,98 @@ class CLexer(Lexer): alt13 =3D 4=0D LA13_0 =3D self.input.LA(1)=0D =0D - if (LA13_0 =3D=3D u'U' or LA13_0 =3D=3D u'u') :=0D + if (LA13_0 =3D=3D u'U' or LA13_0 =3D=3D u'u'):=0D LA13_1 =3D self.input.LA(2)=0D =0D - if (LA13_1 =3D=3D u'L' or LA13_1 =3D=3D u'l') :=0D + if (LA13_1 =3D=3D u'L' or LA13_1 =3D=3D u'l'):=0D LA13_3 =3D self.input.LA(3)=0D =0D - if (LA13_3 =3D=3D u'L' or LA13_3 =3D=3D u'l') :=0D + if (LA13_3 =3D=3D u'L' or LA13_3 =3D=3D u'l'):=0D alt13 =3D 4=0D else:=0D alt13 =3D 3=0D else:=0D alt13 =3D 1=0D - elif (LA13_0 =3D=3D u'L' or LA13_0 =3D=3D u'l') :=0D + elif (LA13_0 =3D=3D u'L' or LA13_0 =3D=3D u'l'):=0D alt13 =3D 2=0D else:=0D - nvae =3D NoViableAltException("614:1: fragment IntegerType= Suffix : ( ( 'u' | 'U' ) | ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( = 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' ) );", 13, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "614:1: fragment IntegerTypeSuffix : ( ( 'u' | 'U' ) |= ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) | ( 'u' | 'U' ) ( 'l' | 'L' ) = ( 'l' | 'L' ) );", 13, 0, self.input)=0D =0D raise nvae=0D =0D if alt13 =3D=3D 1:=0D # C.g:616:4: ( 'u' | 'U' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 2:=0D # C.g:617:4: ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 3:=0D # C.g:618:4: ( 'u' | 'U' ) ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt13 =3D=3D 4:=0D # C.g:619:4: ( 'u' | 'U' ) ( 'l' | 'L' ) ( 'l' | 'L' )=0D if self.input.LA(1) =3D=3D u'U' or self.input.LA(1) =3D=3D= u'u':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D if self.input.LA(1) =3D=3D u'L' or self.input.LA(1) =3D=3D= u'l':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end IntegerTypeSuffix=0D =0D -=0D -=0D # $ANTLR start FLOATING_POINT_LITERAL=0D +=0D def mFLOATING_POINT_LITERAL(self, ):=0D =0D try:=0D @@ -2866,337 +2221,269 @@ class CLexer(Lexer): # C.g:623:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( Exponen= t )? ( FloatTypeSuffix )?=0D # C.g:623:9: ( '0' .. '9' )+=0D cnt14 =3D 0=0D - while True: #loop14=0D + while True: # loop14=0D alt14 =3D 2=0D LA14_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA14_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA14_0 <=3D u'9')):=0D alt14 =3D 1=0D =0D -=0D if alt14 =3D=3D 1:=0D # C.g:623:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt14 >=3D 1:=0D - break #loop14=0D + break # loop14=0D =0D eee =3D EarlyExitException(14, self.input)=0D raise eee=0D =0D cnt14 +=3D 1=0D =0D -=0D self.match(u'.')=0D =0D # C.g:623:25: ( '0' .. '9' )*=0D - while True: #loop15=0D + while True: # loop15=0D alt15 =3D 2=0D LA15_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA15_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA15_0 <=3D u'9')):=0D alt15 =3D 1=0D =0D -=0D if alt15 =3D=3D 1:=0D # C.g:623:26: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D - break #loop15=0D -=0D + break # loop15=0D =0D # C.g:623:37: ( Exponent )?=0D alt16 =3D 2=0D LA16_0 =3D self.input.LA(1)=0D =0D - if (LA16_0 =3D=3D u'E' or LA16_0 =3D=3D u'e') :=0D + if (LA16_0 =3D=3D u'E' or LA16_0 =3D=3D u'e'):=0D alt16 =3D 1=0D if alt16 =3D=3D 1:=0D # C.g:623:37: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D # C.g:623:47: ( FloatTypeSuffix )?=0D alt17 =3D 2=0D LA17_0 =3D self.input.LA(1)=0D =0D - if (LA17_0 =3D=3D u'D' or LA17_0 =3D=3D u'F' or LA17_0 =3D= =3D u'd' or LA17_0 =3D=3D u'f') :=0D + if (LA17_0 =3D=3D u'D' or LA17_0 =3D=3D u'F' or LA17_0 =3D= =3D u'd' or LA17_0 =3D=3D u'f'):=0D alt17 =3D 1=0D if alt17 =3D=3D 1:=0D # C.g:623:47: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 2:=0D # C.g:624:9: '.' ( '0' .. '9' )+ ( Exponent )? ( FloatType= Suffix )?=0D self.match(u'.')=0D =0D # C.g:624:13: ( '0' .. '9' )+=0D cnt18 =3D 0=0D - while True: #loop18=0D + while True: # loop18=0D alt18 =3D 2=0D LA18_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA18_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA18_0 <=3D u'9')):=0D alt18 =3D 1=0D =0D -=0D if alt18 =3D=3D 1:=0D # C.g:624:14: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt18 >=3D 1:=0D - break #loop18=0D + break # loop18=0D =0D eee =3D EarlyExitException(18, self.input)=0D raise eee=0D =0D cnt18 +=3D 1=0D =0D -=0D # C.g:624:25: ( Exponent )?=0D alt19 =3D 2=0D LA19_0 =3D self.input.LA(1)=0D =0D - if (LA19_0 =3D=3D u'E' or LA19_0 =3D=3D u'e') :=0D + if (LA19_0 =3D=3D u'E' or LA19_0 =3D=3D u'e'):=0D alt19 =3D 1=0D if alt19 =3D=3D 1:=0D # C.g:624:25: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D # C.g:624:35: ( FloatTypeSuffix )?=0D alt20 =3D 2=0D LA20_0 =3D self.input.LA(1)=0D =0D - if (LA20_0 =3D=3D u'D' or LA20_0 =3D=3D u'F' or LA20_0 =3D= =3D u'd' or LA20_0 =3D=3D u'f') :=0D + if (LA20_0 =3D=3D u'D' or LA20_0 =3D=3D u'F' or LA20_0 =3D= =3D u'd' or LA20_0 =3D=3D u'f'):=0D alt20 =3D 1=0D if alt20 =3D=3D 1:=0D # C.g:624:35: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 3:=0D # C.g:625:9: ( '0' .. '9' )+ Exponent ( FloatTypeSuffix )?= =0D # C.g:625:9: ( '0' .. '9' )+=0D cnt21 =3D 0=0D - while True: #loop21=0D + while True: # loop21=0D alt21 =3D 2=0D LA21_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA21_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA21_0 <=3D u'9')):=0D alt21 =3D 1=0D =0D -=0D if alt21 =3D=3D 1:=0D # C.g:625:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt21 >=3D 1:=0D - break #loop21=0D + break # loop21=0D =0D eee =3D EarlyExitException(21, self.input)=0D raise eee=0D =0D cnt21 +=3D 1=0D =0D -=0D self.mExponent()=0D =0D # C.g:625:30: ( FloatTypeSuffix )?=0D alt22 =3D 2=0D LA22_0 =3D self.input.LA(1)=0D =0D - if (LA22_0 =3D=3D u'D' or LA22_0 =3D=3D u'F' or LA22_0 =3D= =3D u'd' or LA22_0 =3D=3D u'f') :=0D + if (LA22_0 =3D=3D u'D' or LA22_0 =3D=3D u'F' or LA22_0 =3D= =3D u'd' or LA22_0 =3D=3D u'f'):=0D alt22 =3D 1=0D if alt22 =3D=3D 1:=0D # C.g:625:30: FloatTypeSuffix=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt25 =3D=3D 4:=0D # C.g:626:9: ( '0' .. '9' )+ ( Exponent )? FloatTypeSuffix= =0D # C.g:626:9: ( '0' .. '9' )+=0D cnt23 =3D 0=0D - while True: #loop23=0D + while True: # loop23=0D alt23 =3D 2=0D LA23_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA23_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA23_0 <=3D u'9')):=0D alt23 =3D 1=0D =0D -=0D if alt23 =3D=3D 1:=0D # C.g:626:10: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt23 >=3D 1:=0D - break #loop23=0D + break # loop23=0D =0D eee =3D EarlyExitException(23, self.input)=0D raise eee=0D =0D cnt23 +=3D 1=0D =0D -=0D # C.g:626:21: ( Exponent )?=0D alt24 =3D 2=0D LA24_0 =3D self.input.LA(1)=0D =0D - if (LA24_0 =3D=3D u'E' or LA24_0 =3D=3D u'e') :=0D + if (LA24_0 =3D=3D u'E' or LA24_0 =3D=3D u'e'):=0D alt24 =3D 1=0D if alt24 =3D=3D 1:=0D # C.g:626:21: Exponent=0D self.mExponent()=0D =0D -=0D -=0D -=0D self.mFloatTypeSuffix()=0D =0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end FLOATING_POINT_LITERAL=0D =0D -=0D -=0D # $ANTLR start Exponent=0D +=0D def mExponent(self, ):=0D =0D try:=0D # C.g:630:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )= =0D # C.g:630:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+=0D if self.input.LA(1) =3D=3D u'E' or self.input.LA(1) =3D=3D u'e= ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D # C.g:630:22: ( '+' | '-' )?=0D alt26 =3D 2=0D LA26_0 =3D self.input.LA(1)=0D =0D - if (LA26_0 =3D=3D u'+' or LA26_0 =3D=3D u'-') :=0D + if (LA26_0 =3D=3D u'+' or LA26_0 =3D=3D u'-'):=0D alt26 =3D 1=0D if alt26 =3D=3D 1:=0D # C.g:=0D if self.input.LA(1) =3D=3D u'+' or self.input.LA(1) =3D=3D= u'-':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D # C.g:630:33: ( '0' .. '9' )+=0D cnt27 =3D 0=0D - while True: #loop27=0D + while True: # loop27=0D alt27 =3D 2=0D LA27_0 =3D self.input.LA(1)=0D =0D - if ((u'0' <=3D LA27_0 <=3D u'9')) :=0D + if ((u'0' <=3D LA27_0 <=3D u'9')):=0D alt27 =3D 1=0D =0D -=0D if alt27 =3D=3D 1:=0D # C.g:630:34: '0' .. '9'=0D self.matchRange(u'0', u'9')=0D =0D -=0D -=0D else:=0D if cnt27 >=3D 1:=0D - break #loop27=0D + break # loop27=0D =0D eee =3D EarlyExitException(27, self.input)=0D raise eee=0D =0D cnt27 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end Exponent=0D =0D -=0D -=0D # $ANTLR start FloatTypeSuffix=0D +=0D def mFloatTypeSuffix(self, ):=0D =0D try:=0D # C.g:633:17: ( ( 'f' | 'F' | 'd' | 'D' ) )=0D # C.g:633:19: ( 'f' | 'F' | 'd' | 'D' )=0D if self.input.LA(1) =3D=3D u'D' or self.input.LA(1) =3D=3D u'F= ' or self.input.LA(1) =3D=3D u'd' or self.input.LA(1) =3D=3D u'f':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end FloatTypeSuffix=0D =0D -=0D -=0D # $ANTLR start EscapeSequence=0D +=0D def mEscapeSequence(self, ):=0D =0D try:=0D @@ -3204,20 +2491,22 @@ class CLexer(Lexer): alt28 =3D 2=0D LA28_0 =3D self.input.LA(1)=0D =0D - if (LA28_0 =3D=3D u'\\') :=0D + if (LA28_0 =3D=3D u'\\'):=0D LA28_1 =3D self.input.LA(2)=0D =0D - if (LA28_1 =3D=3D u'"' or LA28_1 =3D=3D u'\'' or LA28_1 = =3D=3D u'\\' or LA28_1 =3D=3D u'b' or LA28_1 =3D=3D u'f' or LA28_1 =3D=3D u= 'n' or LA28_1 =3D=3D u'r' or LA28_1 =3D=3D u't') :=0D + if (LA28_1 =3D=3D u'"' or LA28_1 =3D=3D u'\'' or LA28_1 = =3D=3D u'\\' or LA28_1 =3D=3D u'b' or LA28_1 =3D=3D u'f' or LA28_1 =3D=3D u= 'n' or LA28_1 =3D=3D u'r' or LA28_1 =3D=3D u't'):=0D alt28 =3D 1=0D - elif ((u'0' <=3D LA28_1 <=3D u'7')) :=0D + elif ((u'0' <=3D LA28_1 <=3D u'7')):=0D alt28 =3D 2=0D else:=0D - nvae =3D NoViableAltException("635:1: fragment EscapeS= equence : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' = ) | OctalEscape );", 28, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "635:1: fragment EscapeSequence : ( '\\\\' ( 'b' |= 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 1= , self.input)=0D =0D raise nvae=0D =0D else:=0D - nvae =3D NoViableAltException("635:1: fragment EscapeSeque= nce : ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | = OctalEscape );", 28, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "635:1: fragment EscapeSequence : ( '\\\\' ( 'b' | 't'= | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' ) | OctalEscape );", 28, 0, se= lf.input)=0D =0D raise nvae=0D =0D @@ -3226,32 +2515,25 @@ class CLexer(Lexer): self.match(u'\\')=0D =0D if self.input.LA(1) =3D=3D u'"' or self.input.LA(1) =3D=3D= u'\'' or self.input.LA(1) =3D=3D u'\\' or self.input.LA(1) =3D=3D u'b' or = self.input.LA(1) =3D=3D u'f' or self.input.LA(1) =3D=3D u'n' or self.input.= LA(1) =3D=3D u'r' or self.input.LA(1) =3D=3D u't':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D elif alt28 =3D=3D 2:=0D # C.g:638:9: OctalEscape=0D self.mOctalEscape()=0D =0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end EscapeSequence=0D =0D -=0D -=0D # $ANTLR start OctalEscape=0D +=0D def mOctalEscape(self, ):=0D =0D try:=0D @@ -3259,35 +2541,37 @@ class CLexer(Lexer): alt29 =3D 3=0D LA29_0 =3D self.input.LA(1)=0D =0D - if (LA29_0 =3D=3D u'\\') :=0D + if (LA29_0 =3D=3D u'\\'):=0D LA29_1 =3D self.input.LA(2)=0D =0D - if ((u'0' <=3D LA29_1 <=3D u'3')) :=0D + if ((u'0' <=3D LA29_1 <=3D u'3')):=0D LA29_2 =3D self.input.LA(3)=0D =0D - if ((u'0' <=3D LA29_2 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_2 <=3D u'7')):=0D LA29_4 =3D self.input.LA(4)=0D =0D - if ((u'0' <=3D LA29_4 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_4 <=3D u'7')):=0D alt29 =3D 1=0D else:=0D alt29 =3D 2=0D else:=0D alt29 =3D 3=0D - elif ((u'4' <=3D LA29_1 <=3D u'7')) :=0D + elif ((u'4' <=3D LA29_1 <=3D u'7')):=0D LA29_3 =3D self.input.LA(3)=0D =0D - if ((u'0' <=3D LA29_3 <=3D u'7')) :=0D + if ((u'0' <=3D LA29_3 <=3D u'7')):=0D alt29 =3D 2=0D else:=0D alt29 =3D 3=0D else:=0D - nvae =3D NoViableAltException("641:1: fragment OctalEs= cape : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0'= .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '= 3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) |= '\\\\' ( '0' .. '7' ) );", 29, 1, self.input)=0D =0D raise nvae=0D =0D else:=0D - nvae =3D NoViableAltException("641:1: fragment OctalEscape= : ( '\\\\' ( '0' .. '3' ) ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. = '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) );", 29, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "641:1: fragment OctalEscape : ( '\\\\' ( '0' .. '3' )= ( '0' .. '7' ) ( '0' .. '7' ) | '\\\\' ( '0' .. '7' ) ( '0' .. '7' ) | '\\= \\' ( '0' .. '7' ) );", 29, 0, self.input)=0D =0D raise nvae=0D =0D @@ -3299,25 +2583,14 @@ class CLexer(Lexer): # C.g:643:15: '0' .. '3'=0D self.matchRange(u'0', u'3')=0D =0D -=0D -=0D -=0D # C.g:643:25: ( '0' .. '7' )=0D # C.g:643:26: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D # C.g:643:36: ( '0' .. '7' )=0D # C.g:643:37: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt29 =3D=3D 2:=0D # C.g:644:9: '\\\\' ( '0' .. '7' ) ( '0' .. '7' )=0D self.match(u'\\')=0D @@ -3326,18 +2599,10 @@ class CLexer(Lexer): # C.g:644:15: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D # C.g:644:25: ( '0' .. '7' )=0D # C.g:644:26: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D elif alt29 =3D=3D 3:=0D # C.g:645:9: '\\\\' ( '0' .. '7' )=0D self.match(u'\\')=0D @@ -3346,21 +2611,14 @@ class CLexer(Lexer): # C.g:645:15: '0' .. '7'=0D self.matchRange(u'0', u'7')=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end OctalEscape=0D =0D -=0D -=0D # $ANTLR start UnicodeEscape=0D +=0D def mUnicodeEscape(self, ):=0D =0D try:=0D @@ -3378,19 +2636,14 @@ class CLexer(Lexer): =0D self.mHexDigit()=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end UnicodeEscape=0D =0D -=0D -=0D # $ANTLR start WS=0D +=0D def mWS(self, ):=0D =0D try:=0D @@ -3399,20 +2652,16 @@ class CLexer(Lexer): # C.g:653:5: ( ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' ) )=0D # C.g:653:8: ( ' ' | '\\r' | '\\t' | '\\u000C' | '\\n' )=0D if (u'\t' <=3D self.input.LA(1) <=3D u'\n') or (u'\f' <=3D sel= f.input.LA(1) <=3D u'\r') or self.input.LA(1) =3D=3D u' ':=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3420,9 +2669,8 @@ class CLexer(Lexer): =0D # $ANTLR end WS=0D =0D -=0D -=0D # $ANTLR start BS=0D +=0D def mBS(self, ):=0D =0D try:=0D @@ -3434,15 +2682,9 @@ class CLexer(Lexer): # C.g:657:8: '\\\\'=0D self.match(u'\\')=0D =0D -=0D -=0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3450,9 +2692,8 @@ class CLexer(Lexer): =0D # $ANTLR end BS=0D =0D -=0D -=0D # $ANTLR start UnicodeVocabulary=0D +=0D def mUnicodeVocabulary(self, ):=0D =0D try:=0D @@ -3462,19 +2703,14 @@ class CLexer(Lexer): # C.g:665:7: '\\u0003' .. '\\uFFFE'=0D self.matchRange(u'\u0003', u'\uFFFE')=0D =0D -=0D -=0D -=0D -=0D finally:=0D =0D pass=0D =0D # $ANTLR end UnicodeVocabulary=0D =0D -=0D -=0D # $ANTLR start COMMENT=0D +=0D def mCOMMENT(self, ):=0D =0D try:=0D @@ -3484,44 +2720,34 @@ class CLexer(Lexer): # C.g:668:9: '/*' ( options {greedy=3Dfalse; } : . )* '*/'=0D self.match("/*")=0D =0D -=0D # C.g:668:14: ( options {greedy=3Dfalse; } : . )*=0D - while True: #loop30=0D + while True: # loop30=0D alt30 =3D 2=0D LA30_0 =3D self.input.LA(1)=0D =0D - if (LA30_0 =3D=3D u'*') :=0D + if (LA30_0 =3D=3D u'*'):=0D LA30_1 =3D self.input.LA(2)=0D =0D - if (LA30_1 =3D=3D u'/') :=0D + if (LA30_1 =3D=3D u'/'):=0D alt30 =3D 2=0D - elif ((u'\u0000' <=3D LA30_1 <=3D u'.') or (u'0' <=3D = LA30_1 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA30_1 <=3D u'.') or (u'0' <=3D = LA30_1 <=3D u'\uFFFE')):=0D alt30 =3D 1=0D =0D -=0D - elif ((u'\u0000' <=3D LA30_0 <=3D u')') or (u'+' <=3D LA30= _0 <=3D u'\uFFFE')) :=0D + elif ((u'\u0000' <=3D LA30_0 <=3D u')') or (u'+' <=3D LA30= _0 <=3D u'\uFFFE')):=0D alt30 =3D 1=0D =0D -=0D if alt30 =3D=3D 1:=0D # C.g:668:42: .=0D self.matchAny()=0D =0D -=0D -=0D else:=0D - break #loop30=0D -=0D + break # loop30=0D =0D self.match("*/")=0D =0D -=0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3529,9 +2755,8 @@ class CLexer(Lexer): =0D # $ANTLR end COMMENT=0D =0D -=0D -=0D # $ANTLR start LINE_COMMENT=0D +=0D def mLINE_COMMENT(self, ):=0D =0D try:=0D @@ -3541,54 +2766,42 @@ class CLexer(Lexer): # C.g:673:7: '//' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'=0D self.match("//")=0D =0D -=0D # C.g:673:12: (~ ( '\\n' | '\\r' ) )*=0D - while True: #loop31=0D + while True: # loop31=0D alt31 =3D 2=0D LA31_0 =3D self.input.LA(1)=0D =0D - if ((u'\u0000' <=3D LA31_0 <=3D u'\t') or (u'\u000B' <=3D = LA31_0 <=3D u'\f') or (u'\u000E' <=3D LA31_0 <=3D u'\uFFFE')) :=0D + if ((u'\u0000' <=3D LA31_0 <=3D u'\t') or (u'\u000B' <=3D = LA31_0 <=3D u'\f') or (u'\u000E' <=3D LA31_0 <=3D u'\uFFFE')):=0D alt31 =3D 1=0D =0D -=0D if alt31 =3D=3D 1:=0D # C.g:673:12: ~ ( '\\n' | '\\r' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'\t') or (u'= \u000B' <=3D self.input.LA(1) <=3D u'\f') or (u'\u000E' <=3D self.input.LA(= 1) <=3D u'\uFFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop31=0D -=0D + break # loop31=0D =0D # C.g:673:26: ( '\\r' )?=0D alt32 =3D 2=0D LA32_0 =3D self.input.LA(1)=0D =0D - if (LA32_0 =3D=3D u'\r') :=0D + if (LA32_0 =3D=3D u'\r'):=0D alt32 =3D 1=0D if alt32 =3D=3D 1:=0D # C.g:673:26: '\\r'=0D self.match(u'\r')=0D =0D -=0D -=0D -=0D self.match(u'\n')=0D =0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3596,9 +2809,8 @@ class CLexer(Lexer): =0D # $ANTLR end LINE_COMMENT=0D =0D -=0D -=0D # $ANTLR start LINE_COMMAND=0D +=0D def mLINE_COMMAND(self, ):=0D =0D try:=0D @@ -3609,52 +2821,41 @@ class CLexer(Lexer): self.match(u'#')=0D =0D # C.g:678:11: (~ ( '\\n' | '\\r' ) )*=0D - while True: #loop33=0D + while True: # loop33=0D alt33 =3D 2=0D LA33_0 =3D self.input.LA(1)=0D =0D - if ((u'\u0000' <=3D LA33_0 <=3D u'\t') or (u'\u000B' <=3D = LA33_0 <=3D u'\f') or (u'\u000E' <=3D LA33_0 <=3D u'\uFFFE')) :=0D + if ((u'\u0000' <=3D LA33_0 <=3D u'\t') or (u'\u000B' <=3D = LA33_0 <=3D u'\f') or (u'\u000E' <=3D LA33_0 <=3D u'\uFFFE')):=0D alt33 =3D 1=0D =0D -=0D if alt33 =3D=3D 1:=0D # C.g:678:11: ~ ( '\\n' | '\\r' )=0D if (u'\u0000' <=3D self.input.LA(1) <=3D u'\t') or (u'= \u000B' <=3D self.input.LA(1) <=3D u'\f') or (u'\u000E' <=3D self.input.LA(= 1) <=3D u'\uFFFE'):=0D - self.input.consume();=0D + self.input.consume()=0D =0D else:=0D mse =3D MismatchedSetException(None, self.input)=0D self.recover(mse)=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop33=0D -=0D + break # loop33=0D =0D # C.g:678:25: ( '\\r' )?=0D alt34 =3D 2=0D LA34_0 =3D self.input.LA(1)=0D =0D - if (LA34_0 =3D=3D u'\r') :=0D + if (LA34_0 =3D=3D u'\r'):=0D alt34 =3D 1=0D if alt34 =3D=3D 1:=0D # C.g:678:25: '\\r'=0D self.match(u'\r')=0D =0D -=0D -=0D -=0D self.match(u'\n')=0D =0D - #action start=0D - self.channel=3DHIDDEN;=0D - #action end=0D -=0D -=0D -=0D + # action start=0D + self.channel =3D HIDDEN=0D + # action end=0D =0D finally:=0D =0D @@ -3662,8 +2863,6 @@ class CLexer(Lexer): =0D # $ANTLR end LINE_COMMAND=0D =0D -=0D -=0D def mTokens(self):=0D # C.g:1:8: ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 |= T34 | T35 | T36 | T37 | T38 | T39 | T40 | T41 | T42 | T43 | T44 | T45 | T4= 6 | T47 | T48 | T49 | T50 | T51 | T52 | T53 | T54 | T55 | T56 | T57 | T58 |= T59 | T60 | T61 | T62 | T63 | T64 | T65 | T66 | T67 | T68 | T69 | T70 | T7= 1 | T72 | T73 | T74 | T75 | T76 | T77 | T78 | T79 | T80 | T81 | T82 | T83 |= T84 | T85 | T86 | T87 | T88 | T89 | T90 | T91 | T92 | T93 | T94 | T95 | T9= 6 | T97 | T98 | T99 | T100 | T101 | T102 | T103 | T104 | T105 | T106 | T107= | T108 | T109 | T110 | T111 | T112 | T113 | T114 | T115 | T116 | T117 | ID= ENTIFIER | CHARACTER_LITERAL | STRING_LITERAL | HEX_LITERAL | DECIMAL_LITER= AL | OCTAL_LITERAL | FLOATING_POINT_LITERAL | WS | BS | UnicodeVocabulary |= COMMENT | LINE_COMMENT | LINE_COMMAND )=0D alt35 =3D 106=0D @@ -3672,681 +2871,463 @@ class CLexer(Lexer): # C.g:1:10: T25=0D self.mT25()=0D =0D -=0D -=0D elif alt35 =3D=3D 2:=0D # C.g:1:14: T26=0D self.mT26()=0D =0D -=0D -=0D elif alt35 =3D=3D 3:=0D # C.g:1:18: T27=0D self.mT27()=0D =0D -=0D -=0D elif alt35 =3D=3D 4:=0D # C.g:1:22: T28=0D self.mT28()=0D =0D -=0D -=0D elif alt35 =3D=3D 5:=0D # C.g:1:26: T29=0D self.mT29()=0D =0D -=0D -=0D elif alt35 =3D=3D 6:=0D # C.g:1:30: T30=0D self.mT30()=0D =0D -=0D -=0D elif alt35 =3D=3D 7:=0D # C.g:1:34: T31=0D self.mT31()=0D =0D -=0D -=0D elif alt35 =3D=3D 8:=0D # C.g:1:38: T32=0D self.mT32()=0D =0D -=0D -=0D elif alt35 =3D=3D 9:=0D # C.g:1:42: T33=0D self.mT33()=0D =0D -=0D -=0D elif alt35 =3D=3D 10:=0D # C.g:1:46: T34=0D self.mT34()=0D =0D -=0D -=0D elif alt35 =3D=3D 11:=0D # C.g:1:50: T35=0D self.mT35()=0D =0D -=0D -=0D elif alt35 =3D=3D 12:=0D # C.g:1:54: T36=0D self.mT36()=0D =0D -=0D -=0D elif alt35 =3D=3D 13:=0D # C.g:1:58: T37=0D self.mT37()=0D =0D -=0D -=0D elif alt35 =3D=3D 14:=0D # C.g:1:62: T38=0D self.mT38()=0D =0D -=0D -=0D elif alt35 =3D=3D 15:=0D # C.g:1:66: T39=0D self.mT39()=0D =0D -=0D -=0D elif alt35 =3D=3D 16:=0D # C.g:1:70: T40=0D self.mT40()=0D =0D -=0D -=0D elif alt35 =3D=3D 17:=0D # C.g:1:74: T41=0D self.mT41()=0D =0D -=0D -=0D elif alt35 =3D=3D 18:=0D # C.g:1:78: T42=0D self.mT42()=0D =0D -=0D -=0D elif alt35 =3D=3D 19:=0D # C.g:1:82: T43=0D self.mT43()=0D =0D -=0D -=0D elif alt35 =3D=3D 20:=0D # C.g:1:86: T44=0D self.mT44()=0D =0D -=0D -=0D elif alt35 =3D=3D 21:=0D # C.g:1:90: T45=0D self.mT45()=0D =0D -=0D -=0D elif alt35 =3D=3D 22:=0D # C.g:1:94: T46=0D self.mT46()=0D =0D -=0D -=0D elif alt35 =3D=3D 23:=0D # C.g:1:98: T47=0D self.mT47()=0D =0D -=0D -=0D elif alt35 =3D=3D 24:=0D # C.g:1:102: T48=0D self.mT48()=0D =0D -=0D -=0D elif alt35 =3D=3D 25:=0D # C.g:1:106: T49=0D self.mT49()=0D =0D -=0D -=0D elif alt35 =3D=3D 26:=0D # C.g:1:110: T50=0D self.mT50()=0D =0D -=0D -=0D elif alt35 =3D=3D 27:=0D # C.g:1:114: T51=0D self.mT51()=0D =0D -=0D -=0D elif alt35 =3D=3D 28:=0D # C.g:1:118: T52=0D self.mT52()=0D =0D -=0D -=0D elif alt35 =3D=3D 29:=0D # C.g:1:122: T53=0D self.mT53()=0D =0D -=0D -=0D elif alt35 =3D=3D 30:=0D # C.g:1:126: T54=0D self.mT54()=0D =0D -=0D -=0D elif alt35 =3D=3D 31:=0D # C.g:1:130: T55=0D self.mT55()=0D =0D -=0D -=0D elif alt35 =3D=3D 32:=0D # C.g:1:134: T56=0D self.mT56()=0D =0D -=0D -=0D elif alt35 =3D=3D 33:=0D # C.g:1:138: T57=0D self.mT57()=0D =0D -=0D -=0D elif alt35 =3D=3D 34:=0D # C.g:1:142: T58=0D self.mT58()=0D =0D -=0D -=0D elif alt35 =3D=3D 35:=0D # C.g:1:146: T59=0D self.mT59()=0D =0D -=0D -=0D elif alt35 =3D=3D 36:=0D # C.g:1:150: T60=0D self.mT60()=0D =0D -=0D -=0D elif alt35 =3D=3D 37:=0D # C.g:1:154: T61=0D self.mT61()=0D =0D -=0D -=0D elif alt35 =3D=3D 38:=0D # C.g:1:158: T62=0D self.mT62()=0D =0D -=0D -=0D elif alt35 =3D=3D 39:=0D # C.g:1:162: T63=0D self.mT63()=0D =0D -=0D -=0D elif alt35 =3D=3D 40:=0D # C.g:1:166: T64=0D self.mT64()=0D =0D -=0D -=0D elif alt35 =3D=3D 41:=0D # C.g:1:170: T65=0D self.mT65()=0D =0D -=0D -=0D elif alt35 =3D=3D 42:=0D # C.g:1:174: T66=0D self.mT66()=0D =0D -=0D -=0D elif alt35 =3D=3D 43:=0D # C.g:1:178: T67=0D self.mT67()=0D =0D -=0D -=0D elif alt35 =3D=3D 44:=0D # C.g:1:182: T68=0D self.mT68()=0D =0D -=0D -=0D elif alt35 =3D=3D 45:=0D # C.g:1:186: T69=0D self.mT69()=0D =0D -=0D -=0D elif alt35 =3D=3D 46:=0D # C.g:1:190: T70=0D self.mT70()=0D =0D -=0D -=0D elif alt35 =3D=3D 47:=0D # C.g:1:194: T71=0D self.mT71()=0D =0D -=0D -=0D elif alt35 =3D=3D 48:=0D # C.g:1:198: T72=0D self.mT72()=0D =0D -=0D -=0D elif alt35 =3D=3D 49:=0D # C.g:1:202: T73=0D self.mT73()=0D =0D -=0D -=0D elif alt35 =3D=3D 50:=0D # C.g:1:206: T74=0D self.mT74()=0D =0D -=0D -=0D elif alt35 =3D=3D 51:=0D # C.g:1:210: T75=0D self.mT75()=0D =0D -=0D -=0D elif alt35 =3D=3D 52:=0D # C.g:1:214: T76=0D self.mT76()=0D =0D -=0D -=0D elif alt35 =3D=3D 53:=0D # C.g:1:218: T77=0D self.mT77()=0D =0D -=0D -=0D elif alt35 =3D=3D 54:=0D # C.g:1:222: T78=0D self.mT78()=0D =0D -=0D -=0D elif alt35 =3D=3D 55:=0D # C.g:1:226: T79=0D self.mT79()=0D =0D -=0D -=0D elif alt35 =3D=3D 56:=0D # C.g:1:230: T80=0D self.mT80()=0D =0D -=0D -=0D elif alt35 =3D=3D 57:=0D # C.g:1:234: T81=0D self.mT81()=0D =0D -=0D -=0D elif alt35 =3D=3D 58:=0D # C.g:1:238: T82=0D self.mT82()=0D =0D -=0D -=0D elif alt35 =3D=3D 59:=0D # C.g:1:242: T83=0D self.mT83()=0D =0D -=0D -=0D elif alt35 =3D=3D 60:=0D # C.g:1:246: T84=0D self.mT84()=0D =0D -=0D -=0D elif alt35 =3D=3D 61:=0D # C.g:1:250: T85=0D self.mT85()=0D =0D -=0D -=0D elif alt35 =3D=3D 62:=0D # C.g:1:254: T86=0D self.mT86()=0D =0D -=0D -=0D elif alt35 =3D=3D 63:=0D # C.g:1:258: T87=0D self.mT87()=0D =0D -=0D -=0D elif alt35 =3D=3D 64:=0D # C.g:1:262: T88=0D self.mT88()=0D =0D -=0D -=0D elif alt35 =3D=3D 65:=0D # C.g:1:266: T89=0D self.mT89()=0D =0D -=0D -=0D elif alt35 =3D=3D 66:=0D # C.g:1:270: T90=0D self.mT90()=0D =0D -=0D -=0D elif alt35 =3D=3D 67:=0D # C.g:1:274: T91=0D self.mT91()=0D =0D -=0D -=0D elif alt35 =3D=3D 68:=0D # C.g:1:278: T92=0D self.mT92()=0D =0D -=0D -=0D elif alt35 =3D=3D 69:=0D # C.g:1:282: T93=0D self.mT93()=0D =0D -=0D -=0D elif alt35 =3D=3D 70:=0D # C.g:1:286: T94=0D self.mT94()=0D =0D -=0D -=0D elif alt35 =3D=3D 71:=0D # C.g:1:290: T95=0D self.mT95()=0D =0D -=0D -=0D elif alt35 =3D=3D 72:=0D # C.g:1:294: T96=0D self.mT96()=0D =0D -=0D -=0D elif alt35 =3D=3D 73:=0D # C.g:1:298: T97=0D self.mT97()=0D =0D -=0D -=0D elif alt35 =3D=3D 74:=0D # C.g:1:302: T98=0D self.mT98()=0D =0D -=0D -=0D elif alt35 =3D=3D 75:=0D # C.g:1:306: T99=0D self.mT99()=0D =0D -=0D -=0D elif alt35 =3D=3D 76:=0D # C.g:1:310: T100=0D self.mT100()=0D =0D -=0D -=0D elif alt35 =3D=3D 77:=0D # C.g:1:315: T101=0D self.mT101()=0D =0D -=0D -=0D elif alt35 =3D=3D 78:=0D # C.g:1:320: T102=0D self.mT102()=0D =0D -=0D -=0D elif alt35 =3D=3D 79:=0D # C.g:1:325: T103=0D self.mT103()=0D =0D -=0D -=0D elif alt35 =3D=3D 80:=0D # C.g:1:330: T104=0D self.mT104()=0D =0D -=0D -=0D elif alt35 =3D=3D 81:=0D # C.g:1:335: T105=0D self.mT105()=0D =0D -=0D -=0D elif alt35 =3D=3D 82:=0D # C.g:1:340: T106=0D self.mT106()=0D =0D -=0D -=0D elif alt35 =3D=3D 83:=0D # C.g:1:345: T107=0D self.mT107()=0D =0D -=0D -=0D elif alt35 =3D=3D 84:=0D # C.g:1:350: T108=0D self.mT108()=0D =0D -=0D -=0D elif alt35 =3D=3D 85:=0D # C.g:1:355: T109=0D self.mT109()=0D =0D -=0D -=0D elif alt35 =3D=3D 86:=0D # C.g:1:360: T110=0D self.mT110()=0D =0D -=0D -=0D elif alt35 =3D=3D 87:=0D # C.g:1:365: T111=0D self.mT111()=0D =0D -=0D -=0D elif alt35 =3D=3D 88:=0D # C.g:1:370: T112=0D self.mT112()=0D =0D -=0D -=0D elif alt35 =3D=3D 89:=0D # C.g:1:375: T113=0D self.mT113()=0D =0D -=0D -=0D elif alt35 =3D=3D 90:=0D # C.g:1:380: T114=0D self.mT114()=0D =0D -=0D -=0D elif alt35 =3D=3D 91:=0D # C.g:1:385: T115=0D self.mT115()=0D =0D -=0D -=0D elif alt35 =3D=3D 92:=0D # C.g:1:390: T116=0D self.mT116()=0D =0D -=0D -=0D elif alt35 =3D=3D 93:=0D # C.g:1:395: T117=0D self.mT117()=0D =0D -=0D -=0D elif alt35 =3D=3D 94:=0D # C.g:1:400: IDENTIFIER=0D self.mIDENTIFIER()=0D =0D -=0D -=0D elif alt35 =3D=3D 95:=0D # C.g:1:411: CHARACTER_LITERAL=0D self.mCHARACTER_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 96:=0D # C.g:1:429: STRING_LITERAL=0D self.mSTRING_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 97:=0D # C.g:1:444: HEX_LITERAL=0D self.mHEX_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 98:=0D # C.g:1:456: DECIMAL_LITERAL=0D self.mDECIMAL_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 99:=0D # C.g:1:472: OCTAL_LITERAL=0D self.mOCTAL_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 100:=0D # C.g:1:486: FLOATING_POINT_LITERAL=0D self.mFLOATING_POINT_LITERAL()=0D =0D -=0D -=0D elif alt35 =3D=3D 101:=0D # C.g:1:509: WS=0D self.mWS()=0D =0D -=0D -=0D elif alt35 =3D=3D 102:=0D # C.g:1:512: BS=0D self.mBS()=0D =0D -=0D -=0D elif alt35 =3D=3D 103:=0D # C.g:1:515: UnicodeVocabulary=0D self.mUnicodeVocabulary()=0D =0D -=0D -=0D elif alt35 =3D=3D 104:=0D # C.g:1:533: COMMENT=0D self.mCOMMENT()=0D =0D -=0D -=0D elif alt35 =3D=3D 105:=0D # C.g:1:541: LINE_COMMENT=0D self.mLINE_COMMENT()=0D =0D -=0D -=0D elif alt35 =3D=3D 106:=0D # C.g:1:554: LINE_COMMAND=0D self.mLINE_COMMAND()=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D # lookup tables for DFA #25=0D =0D DFA25_eot =3D DFA.unpack(=0D u"\7\uffff\1\10\2\uffff"=0D - )=0D + )=0D =0D DFA25_eof =3D DFA.unpack(=0D u"\12\uffff"=0D - )=0D + )=0D =0D DFA25_min =3D DFA.unpack(=0D u"\2\56\2\uffff\1\53\1\uffff\2\60\2\uffff"=0D - )=0D + )=0D =0D DFA25_max =3D DFA.unpack(=0D u"\1\71\1\146\2\uffff\1\71\1\uffff\1\71\1\146\2\uffff"=0D - )=0D + )=0D =0D DFA25_accept =3D DFA.unpack(=0D u"\2\uffff\1\2\1\1\1\uffff\1\4\2\uffff\2\3"=0D - )=0D + )=0D =0D DFA25_special =3D DFA.unpack(=0D u"\12\uffff"=0D - )=0D -=0D + )=0D =0D DFA25_transition =3D [=0D DFA.unpack(u"\1\2\1\uffff\12\1"),=0D DFA.unpack(u"\1\3\1\uffff\12\1\12\uffff\1\5\1\4\1\5\35\uffff\1\5"= =0D - u"\1\4\1\5"),=0D + u"\1\4\1\5"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\6\1\uffff\1\6\2\uffff\12\7"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\12\7"),=0D DFA.unpack(u"\12\7\12\uffff\1\11\1\uffff\1\11\35\uffff\1\11\1\ufff= f"=0D - u"\1\11"),=0D + u"\1\11"),=0D DFA.unpack(u""),=0D DFA.unpack(u"")=0D ]=0D @@ -4376,11 +3357,11 @@ class CLexer(Lexer): u"\uffff\1\u0164\1\u0165\1\76\1\u0167\3\76\6\uffff\1\u016b\1\uffff= "=0D u"\3\76\1\uffff\21\76\1\u0180\2\76\1\uffff\3\76\1\u0186\1\76\1\uff= ff"=0D u"\11\76\1\u0191\1\uffff"=0D - )=0D + )=0D =0D DFA35_eof =3D DFA.unpack(=0D u"\u0192\uffff"=0D - )=0D + )=0D =0D DFA35_min =3D DFA.unpack(=0D u"\1\3\1\uffff\1\171\1\uffff\1\75\1\154\1\150\1\165\1\145\1\124\1"= =0D @@ -4413,7 +3394,7 @@ class CLexer(Lexer): u"\1\111\1\137\1\122\1\103\1\111\1\126\1\105\1\106\1\111\1\44\1\13= 7"=0D u"\1\103\1\uffff\1\125\1\105\1\116\1\44\1\122\1\uffff\1\105\1\106"= =0D u"\1\105\1\122\1\105\1\116\1\103\1\105\1\104\1\44\1\uffff"=0D - )=0D + )=0D =0D DFA35_max =3D DFA.unpack(=0D u"\1\ufffe\1\uffff\1\171\1\uffff\1\75\1\170\1\167\1\165\1\145\1\12= 4"=0D @@ -4447,7 +3428,7 @@ class CLexer(Lexer): u"\1\106\1\111\1\172\1\137\1\103\1\uffff\1\125\1\105\1\116\1\172"= =0D u"\1\122\1\uffff\1\105\1\106\1\105\1\122\1\105\1\116\1\103\1\105"= =0D u"\1\104\1\172\1\uffff"=0D - )=0D + )=0D =0D DFA35_accept =3D DFA.unpack(=0D u"\1\uffff\1\1\1\uffff\1\3\15\uffff\1\23\1\24\1\27\10\uffff\1\46"= =0D @@ -4467,21 +3448,20 @@ class CLexer(Lexer): u"\uffff\1\42\1\45\1\uffff\1\2\3\uffff\1\123\7\uffff\1\117\1\10\1"= =0D u"\32\1\133\1\22\1\35\1\uffff\1\40\3\uffff\1\37\24\uffff\1\43\5\uf= fff"=0D u"\1\44\12\uffff\1\41"=0D - )=0D + )=0D =0D DFA35_special =3D DFA.unpack(=0D u"\u0192\uffff"=0D - )=0D -=0D + )=0D =0D DFA35_transition =3D [=0D DFA.unpack(u"\6\73\2\70\1\73\2\70\22\73\1\70\1\50\1\65\1\72\1\63"= =0D - 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"= =0D - u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1\32\1\63\1"= =0D - u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63\1\27\1\30"= =0D - u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\17\1\5\1\16"= =0D - u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12\1\57\3\63"= =0D - u"\1\21\1\54\1\22\1\47\uff80\73"),=0D + u"\1\45\1\46\1\64\1\34\1\35\1\40\1\42\1\3\1\43\1\41\1\4= 4\1\66\11"=0D + u"\67\1\23\1\1\1\51\1\4\1\52\1\55\1\73\2\63\1\26\1\63\1= \32\1\63\1"=0D + u"\31\1\63\1\24\2\63\1\62\2\63\1\25\1\33\2\63\1\11\1\63= \1\27\1\30"=0D + u"\4\63\1\36\1\71\1\37\1\53\1\56\1\73\1\7\1\61\1\13\1\1= 7\1\5\1\16"=0D + u"\1\60\1\63\1\14\2\63\1\15\5\63\1\10\1\6\1\2\1\20\1\12= \1\57\3\63"=0D + u"\1\21\1\54\1\22\1\47\uff80\73"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\75"),=0D DFA.unpack(u""),=0D @@ -4536,7 +3516,7 @@ class CLexer(Lexer): DFA.unpack(u"\47\u0092\1\uffff\uffd7\u0092"),=0D DFA.unpack(u"\uffff\u0091"),=0D DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\21\uffff= "=0D - u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),=0D + u"\1\u0093\13\uffff\3\154\21\uffff\1\u0093"),=0D DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154= "),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D @@ -4563,20 +3543,20 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00ab"),=0D DFA.unpack(u"\1\u00ac"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00ae"),=0D DFA.unpack(u"\1\u00af"),=0D DFA.unpack(u"\1\u00b0"),=0D DFA.unpack(u"\1\u00b1"),=0D DFA.unpack(u"\1\u00b2"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\24\76\1\u00b3\5\76"),=0D + u"\24\76\1\u00b3\5\76"),=0D DFA.unpack(u"\1\u00b6\11\uffff\1\u00b5"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00b8"),=0D DFA.unpack(u"\1\u00b9"),=0D DFA.unpack(u"\1\u00ba"),=0D @@ -4634,7 +3614,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\154\1\uffff\10\u0094\2\154\12\uffff\3\154\35\uffff= "=0D - u"\3\154"),=0D + u"\3\154"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\154\1\uffff\12\u0096\12\uffff\3\154\35\uffff\3\154= "),=0D DFA.unpack(u""),=0D @@ -4661,10 +3641,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00dd"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00df"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00e1"),=0D DFA.unpack(u"\1\u00e2"),=0D DFA.unpack(u"\1\u00e3"),=0D @@ -4674,7 +3654,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u00e6"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00e8"),=0D DFA.unpack(u"\1\u00e9"),=0D DFA.unpack(u"\1\u00ea"),=0D @@ -4693,10 +3673,10 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u00f4"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00f6"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00f8"),=0D DFA.unpack(u"\1\u00f9"),=0D DFA.unpack(u"\1\u00fa"),=0D @@ -4704,22 +3684,22 @@ class CLexer(Lexer): DFA.unpack(u"\1\u00fc"),=0D DFA.unpack(u"\1\u00fd"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u00ff"),=0D DFA.unpack(u"\1\u0100"),=0D DFA.unpack(u"\1\u0101"),=0D DFA.unpack(u"\1\u0102"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0105"),=0D DFA.unpack(u"\1\u0106"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0109"),=0D DFA.unpack(u"\1\u010a"),=0D @@ -4737,10 +3717,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0116"),=0D DFA.unpack(u"\1\u0117"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0119"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u011b"),=0D DFA.unpack(u"\1\u011c"),=0D DFA.unpack(u""),=0D @@ -4752,7 +3732,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0121"),=0D DFA.unpack(u"\1\u0122"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0124"),=0D DFA.unpack(u"\1\u0125"),=0D @@ -4762,19 +3742,19 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u"\1\u0128"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u012b"),=0D DFA.unpack(u"\1\u012c"),=0D DFA.unpack(u"\1\u012d"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u012f"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0131"),=0D DFA.unpack(u"\1\u0132"),=0D DFA.unpack(u"\1\u0133"),=0D @@ -4783,39 +3763,39 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0136"),=0D DFA.unpack(u"\1\u0137"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\u0138\1"= =0D - u"\uffff\32\76"),=0D + u"\uffff\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u013c"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0143"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0146"),=0D DFA.unpack(u"\1\u0147"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0148"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u014a"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u014b"),=0D @@ -4826,15 +3806,15 @@ class CLexer(Lexer): DFA.unpack(u"\1\u014f"),=0D DFA.unpack(u"\1\u0150"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0153"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u""),=0D @@ -4847,7 +3827,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0156"),=0D DFA.unpack(u"\1\u0157"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0159"),=0D DFA.unpack(u"\1\u015a"),=0D @@ -4859,22 +3839,22 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0166"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0168"),=0D DFA.unpack(u"\1\u0169"),=0D DFA.unpack(u"\1\u016a"),=0D @@ -4885,7 +3865,7 @@ class CLexer(Lexer): DFA.unpack(u""),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u016c"),=0D DFA.unpack(u"\1\u016d"),=0D @@ -4909,7 +3889,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u017e"),=0D DFA.unpack(u"\1\u017f"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0181"),=0D DFA.unpack(u"\1\u0182"),=0D DFA.unpack(u""),=0D @@ -4917,7 +3897,7 @@ class CLexer(Lexer): DFA.unpack(u"\1\u0184"),=0D DFA.unpack(u"\1\u0185"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"\1\u0187"),=0D DFA.unpack(u""),=0D DFA.unpack(u"\1\u0188"),=0D @@ -4930,12 +3910,10 @@ class CLexer(Lexer): DFA.unpack(u"\1\u018f"),=0D DFA.unpack(u"\1\u0190"),=0D DFA.unpack(u"\1\76\13\uffff\12\76\7\uffff\32\76\4\uffff\1\76\1\uff= ff"=0D - u"\32\76"),=0D + u"\32\76"),=0D DFA.unpack(u"")=0D ]=0D =0D # class definition for DFA #35=0D =0D DFA35 =3D DFA=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Eot/CParser3/CParser.py b/BaseTools/So= urce/Python/Eot/CParser3/CParser.py index 42bb4d2a1fef..aaaa9f9b585e 100644 --- a/BaseTools/Source/Python/Eot/CParser3/CParser.py +++ b/BaseTools/Source/Python/Eot/CParser3/CParser.py @@ -5,7 +5,7 @@ from __future__ import absolute_import from antlr3 import *=0D from antlr3.compat import set, frozenset=0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.=0D @@ -22,33 +22,32 @@ from . import CodeFragment from . import FileProfile=0D =0D =0D -=0D # for convenience in actions=0D HIDDEN =3D BaseRecognizer.HIDDEN=0D =0D # token types=0D -BS=3D20=0D -LINE_COMMENT=3D23=0D -FloatTypeSuffix=3D16=0D -IntegerTypeSuffix=3D14=0D -LETTER=3D11=0D -OCTAL_LITERAL=3D6=0D -CHARACTER_LITERAL=3D8=0D -Exponent=3D15=0D -EOF=3D-1=0D -HexDigit=3D13=0D -STRING_LITERAL=3D9=0D -WS=3D19=0D -FLOATING_POINT_LITERAL=3D10=0D -IDENTIFIER=3D4=0D -UnicodeEscape=3D18=0D -LINE_COMMAND=3D24=0D -UnicodeVocabulary=3D21=0D -HEX_LITERAL=3D5=0D -COMMENT=3D22=0D -DECIMAL_LITERAL=3D7=0D -EscapeSequence=3D12=0D -OctalEscape=3D17=0D +BS =3D 20=0D +LINE_COMMENT =3D 23=0D +FloatTypeSuffix =3D 16=0D +IntegerTypeSuffix =3D 14=0D +LETTER =3D 11=0D +OCTAL_LITERAL =3D 6=0D +CHARACTER_LITERAL =3D 8=0D +Exponent =3D 15=0D +EOF =3D -1=0D +HexDigit =3D 13=0D +STRING_LITERAL =3D 9=0D +WS =3D 19=0D +FLOATING_POINT_LITERAL =3D 10=0D +IDENTIFIER =3D 4=0D +UnicodeEscape =3D 18=0D +LINE_COMMAND =3D 24=0D +UnicodeVocabulary =3D 21=0D +HEX_LITERAL =3D 5=0D +COMMENT =3D 22=0D +DECIMAL_LITERAL =3D 7=0D +EscapeSequence =3D 12=0D +OctalEscape =3D 17=0D =0D # token names=0D tokenNames =3D [=0D @@ -81,6 +80,8 @@ class function_definition_scope(object): self.LBOffset =3D None=0D self.DeclLine =3D None=0D self.DeclOffset =3D None=0D +=0D +=0D class postfix_expression_scope(object):=0D def __init__(self):=0D self.FuncCallText =3D None=0D @@ -98,41 +99,46 @@ class CParser(Parser): self.postfix_expression_stack =3D []=0D =0D def printTokenInfo(self, line, offset, tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Start= Offset), (EndLine, EndOffset))=0D - FileProfile.PredicateExpressionList.append(PredExp)=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.PredicateExpressionList.append(PredExp)=0D =0D def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D - FileProfile.EnumerationDefinitionList.append(EnumDef)=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Start= Offset), (EndLine, EndOffset))=0D - FileProfile.StructUnionDefinitionList.append(SUDef)=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D + FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLine= , StartOffset), (EndLine, EndOffset))=0D - FileProfile.TypedefDefinitionList.append(Tdef)=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D + FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText, = (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBraceOf= fset), (DeclLine, DeclOffset))=0D - FileProfile.FunctionDefinitionList.append(FuncDef)=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D + FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclText,= (StartLine, StartOffset), (EndLine, EndOffset))=0D - FileProfile.VariableDeclarationList.append(VarDecl)=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D + FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (Star= tLine, StartOffset), (EndLine, EndOffset))=0D - FileProfile.FunctionCallingList.append(FuncCall)=0D -=0D -=0D -=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D + FileProfile.FunctionCallingList.append(FuncCall)=0D =0D # $ANTLR start translation_unit=0D # C.g:102:1: translation_unit : ( external_declaration )* ;=0D +=0D def translation_unit(self, ):=0D =0D translation_unit_StartIndex =3D self.input.index()=0D @@ -144,30 +150,24 @@ class CParser(Parser): # C.g:103:2: ( ( external_declaration )* )=0D # C.g:103:4: ( external_declaration )*=0D # C.g:103:4: ( external_declaration )*=0D - while True: #loop1=0D + while True: # loop1=0D alt1 =3D 2=0D LA1_0 =3D self.input.LA(1)=0D =0D - if (LA1_0 =3D=3D IDENTIFIER or LA1_0 =3D=3D 26 or (29 = <=3D LA1_0 <=3D 42) or (45 <=3D LA1_0 <=3D 46) or (48 <=3D LA1_0 <=3D 62) o= r LA1_0 =3D=3D 66) :=0D + if (LA1_0 =3D=3D IDENTIFIER or LA1_0 =3D=3D 26 or (29 = <=3D LA1_0 <=3D 42) or (45 <=3D LA1_0 <=3D 46) or (48 <=3D LA1_0 <=3D 62) o= r LA1_0 =3D=3D 66):=0D alt1 =3D 1=0D =0D -=0D if alt1 =3D=3D 1:=0D # C.g:0:0: external_declaration=0D - self.following.append(self.FOLLOW_external_declara= tion_in_translation_unit74)=0D + self.following.append(=0D + self.FOLLOW_external_declaration_in_translatio= n_unit74)=0D self.external_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop1=0D -=0D -=0D -=0D -=0D -=0D + break # loop1=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -182,9 +182,9 @@ class CParser(Parser): =0D # $ANTLR end translation_unit=0D =0D -=0D # $ANTLR start external_declaration=0D # C.g:114:1: external_declaration options {k=3D1; } : ( ( ( declaratio= n_specifiers )? declarator ( declaration )* '{' )=3D> function_definition |= declaration | macro_statement ( ';' )? );=0D +=0D def external_declaration(self, ):=0D =0D external_declaration_StartIndex =3D self.input.index()=0D @@ -197,316 +197,335 @@ class CParser(Parser): alt3 =3D 3=0D LA3_0 =3D self.input.LA(1)=0D =0D - if ((29 <=3D LA3_0 <=3D 33)) :=0D + if ((29 <=3D LA3_0 <=3D 33)):=0D LA3_1 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 1, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 34) :=0D + elif (LA3_0 =3D=3D 34):=0D LA3_2 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 2, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 35) :=0D + elif (LA3_0 =3D=3D 35):=0D LA3_3 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 3, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 36) :=0D + elif (LA3_0 =3D=3D 36):=0D LA3_4 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 4, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 37) :=0D + elif (LA3_0 =3D=3D 37):=0D LA3_5 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 5, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 38) :=0D + elif (LA3_0 =3D=3D 38):=0D LA3_6 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 6, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 39) :=0D + elif (LA3_0 =3D=3D 39):=0D LA3_7 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 7, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 40) :=0D + elif (LA3_0 =3D=3D 40):=0D LA3_8 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 8, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 41) :=0D + elif (LA3_0 =3D=3D 41):=0D LA3_9 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 9, self.= input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 42) :=0D + elif (LA3_0 =3D=3D 42):=0D LA3_10 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 10, self= .input)=0D =0D raise nvae=0D =0D - elif ((45 <=3D LA3_0 <=3D 46)) :=0D + elif ((45 <=3D LA3_0 <=3D 46)):=0D LA3_11 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 11, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 48) :=0D + elif (LA3_0 =3D=3D 48):=0D LA3_12 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 12, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D IDENTIFIER) :=0D + elif (LA3_0 =3D=3D IDENTIFIER):=0D LA3_13 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D - elif (True) :=0D + elif (True):=0D alt3 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 13, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 58) :=0D + elif (LA3_0 =3D=3D 58):=0D LA3_14 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 14, self= .input)=0D =0D raise nvae=0D =0D elif (LA3_0 =3D=3D 66) and (self.synpred4()):=0D alt3 =3D 1=0D - elif (LA3_0 =3D=3D 59) :=0D + elif (LA3_0 =3D=3D 59):=0D LA3_16 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 16, self= .input)=0D =0D raise nvae=0D =0D - elif (LA3_0 =3D=3D 60) :=0D + elif (LA3_0 =3D=3D 60):=0D LA3_17 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 17, self= .input)=0D =0D raise nvae=0D =0D - elif ((49 <=3D LA3_0 <=3D 57) or LA3_0 =3D=3D 61) :=0D + elif ((49 <=3D LA3_0 <=3D 57) or LA3_0 =3D=3D 61):=0D LA3_18 =3D self.input.LA(2)=0D =0D - if (self.synpred4()) :=0D + if (self.synpred4()):=0D alt3 =3D 1=0D - elif (self.synpred5()) :=0D + elif (self.synpred5()):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; }= : ( ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> fu= nction_definition | declaration | macro_statement ( ';' )? );", 3, 18, self= .input)=0D =0D raise nvae=0D =0D elif (LA3_0 =3D=3D 62) and (self.synpred4()):=0D alt3 =3D 1=0D - elif (LA3_0 =3D=3D 26) :=0D + elif (LA3_0 =3D=3D 26):=0D alt3 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "114:1: external_declaration options {k=3D1; } : (= ( ( declaration_specifiers )? declarator ( declaration )* '{' )=3D> functi= on_definition | declaration | macro_statement ( ';' )? );", 3, 0, self.inpu= t)=0D =0D raise nvae=0D =0D if alt3 =3D=3D 1:=0D # C.g:119:4: ( ( declaration_specifiers )? declarator = ( declaration )* '{' )=3D> function_definition=0D - self.following.append(self.FOLLOW_function_definition_= in_external_declaration113)=0D + self.following.append(=0D + self.FOLLOW_function_definition_in_external_declar= ation113)=0D self.function_definition()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt3 =3D=3D 2:=0D # C.g:120:4: declaration=0D - self.following.append(self.FOLLOW_declaration_in_exter= nal_declaration118)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_external_declaration118= )=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt3 =3D=3D 3:=0D # C.g:121:4: macro_statement ( ';' )?=0D - self.following.append(self.FOLLOW_macro_statement_in_e= xternal_declaration123)=0D + self.following.append(=0D + self.FOLLOW_macro_statement_in_external_declaratio= n123)=0D self.macro_statement()=0D self.following.pop()=0D if self.failed:=0D @@ -515,19 +534,15 @@ class CParser(Parser): alt2 =3D 2=0D LA2_0 =3D self.input.LA(1)=0D =0D - if (LA2_0 =3D=3D 25) :=0D + if (LA2_0 =3D=3D 25):=0D alt2 =3D 1=0D if alt2 =3D=3D 1:=0D # C.g:121:21: ';'=0D - self.match(self.input, 25, self.FOLLOW_25_in_exter= nal_declaration126)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_external_declaration1= 26)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -546,10 +561,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start function_definition=0D # C.g:126:1: function_definition : (d=3D declaration_specifiers )? dec= larator ( ( declaration )+ a=3D compound_statement | b=3D compound_statemen= t ) ;=0D +=0D def function_definition(self, ):=0D self.function_definition_stack.append(function_definition_scope())= =0D retval =3D self.function_definition_return()=0D @@ -563,14 +577,12 @@ class CParser(Parser): =0D declarator1 =3D None=0D =0D -=0D -=0D - self.function_definition_stack[-1].ModifierText =3D ''=0D - self.function_definition_stack[-1].DeclText =3D ''=0D - self.function_definition_stack[-1].LBLine =3D 0=0D - self.function_definition_stack[-1].LBOffset =3D 0=0D - self.function_definition_stack[-1].DeclLine =3D 0=0D - self.function_definition_stack[-1].DeclOffset =3D 0=0D + self.function_definition_stack[-1].ModifierText =3D ''=0D + self.function_definition_stack[-1].DeclText =3D ''=0D + self.function_definition_stack[-1].LBLine =3D 0=0D + self.function_definition_stack[-1].LBOffset =3D 0=0D + self.function_definition_stack[-1].DeclLine =3D 0=0D + self.function_definition_stack[-1].DeclOffset =3D 0=0D =0D try:=0D try:=0D @@ -591,119 +603,119 @@ class CParser(Parser): elif LA4 =3D=3D 58:=0D LA4_21 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 59:=0D LA4_22 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 60:=0D LA4_23 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D IDENTIFIER:=0D LA4_24 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 62:=0D LA4_25 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 29 or LA4 =3D=3D 30 or LA4 =3D=3D 31 o= r LA4 =3D=3D 32 or LA4 =3D=3D 33:=0D LA4_26 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 34:=0D LA4_27 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 35:=0D LA4_28 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 36:=0D LA4_29 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 37:=0D LA4_30 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 38:=0D LA4_31 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 39:=0D LA4_32 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 40:=0D LA4_33 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 41:=0D LA4_34 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 42:=0D LA4_35 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 45 or LA4 =3D=3D 46:=0D LA4_36 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 48:=0D LA4_37 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 49 or LA4 =3D=3D 50 or LA4 =3D=3D 51 o= r LA4 =3D=3D 52 or LA4 =3D=3D 53 or LA4 =3D=3D 54 or LA4 =3D=3D 55 or LA4 = =3D=3D 56 or LA4 =3D=3D 57 or LA4 =3D=3D 61:=0D LA4_38 =3D self.input.LA(3)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 58:=0D LA4_14 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 59:=0D LA4_16 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D elif LA4 =3D=3D 60:=0D LA4_17 =3D self.input.LA(2)=0D =0D - if (self.synpred7()) :=0D + if (self.synpred7()):=0D alt4 =3D 1=0D if alt4 =3D=3D 1:=0D # C.g:0:0: d=3D declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_function_definition157)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_function_def= inition157)=0D d =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_declarator_in_function_d= efinition160)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_function_definition160)=0D declarator1 =3D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -712,16 +724,17 @@ class CParser(Parser): alt6 =3D 2=0D LA6_0 =3D self.input.LA(1)=0D =0D - if (LA6_0 =3D=3D IDENTIFIER or LA6_0 =3D=3D 26 or (29 <=3D= LA6_0 <=3D 42) or (45 <=3D LA6_0 <=3D 46) or (48 <=3D LA6_0 <=3D 61)) :=0D + if (LA6_0 =3D=3D IDENTIFIER or LA6_0 =3D=3D 26 or (29 <=3D= LA6_0 <=3D 42) or (45 <=3D LA6_0 <=3D 46) or (48 <=3D LA6_0 <=3D 61)):=0D alt6 =3D 1=0D - elif (LA6_0 =3D=3D 43) :=0D + elif (LA6_0 =3D=3D 43):=0D alt6 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("147:3: ( ( declaration = )+ a=3D compound_statement | b=3D compound_statement )", 6, 0, self.input)= =0D + nvae =3D NoViableAltException(=0D + "147:3: ( ( declaration )+ a=3D compound_statement= | b=3D compound_statement )", 6, 0, self.input)=0D =0D raise nvae=0D =0D @@ -729,26 +742,25 @@ class CParser(Parser): # C.g:147:5: ( declaration )+ a=3D compound_statement= =0D # C.g:147:5: ( declaration )+=0D cnt5 =3D 0=0D - while True: #loop5=0D + while True: # loop5=0D alt5 =3D 2=0D LA5_0 =3D self.input.LA(1)=0D =0D - if (LA5_0 =3D=3D IDENTIFIER or LA5_0 =3D=3D 26 or = (29 <=3D LA5_0 <=3D 42) or (45 <=3D LA5_0 <=3D 46) or (48 <=3D LA5_0 <=3D 6= 1)) :=0D + if (LA5_0 =3D=3D IDENTIFIER or LA5_0 =3D=3D 26 or = (29 <=3D LA5_0 <=3D 42) or (45 <=3D LA5_0 <=3D 46) or (48 <=3D LA5_0 <=3D 6= 1)):=0D alt5 =3D 1=0D =0D -=0D if alt5 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_= in_function_definition166)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_function_defini= tion166)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D if cnt5 >=3D 1:=0D - break #loop5=0D + break # loop5=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -759,51 +771,46 @@ class CParser(Parser): =0D cnt5 +=3D 1=0D =0D -=0D - self.following.append(self.FOLLOW_compound_statement_i= n_function_definition171)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_function_definit= ion171)=0D a =3D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt6 =3D=3D 2:=0D # C.g:148:5: b=3D compound_statement=0D - self.following.append(self.FOLLOW_compound_statement_i= n_function_definition180)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_function_definit= ion180)=0D b =3D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D if self.backtracking =3D=3D 0:=0D =0D if d is not None:=0D - self.function_definition_stack[-1].ModifierText =3D = self.input.toString(d.start, d.stop)=0D + self.function_definition_stack[-1].ModifierText = =3D self.input.toString(=0D + d.start, d.stop)=0D else:=0D - self.function_definition_stack[-1].ModifierText =3D = ''=0D - self.function_definition_stack[-1].DeclText =3D self.i= nput.toString(declarator1.start, declarator1.stop)=0D + self.function_definition_stack[-1].ModifierText = =3D ''=0D + self.function_definition_stack[-1].DeclText =3D self.i= nput.toString(=0D + declarator1.start, declarator1.stop)=0D self.function_definition_stack[-1].DeclLine =3D declar= ator1.start.line=0D self.function_definition_stack[-1].DeclOffset =3D decl= arator1.start.charPositionInLine=0D if a is not None:=0D - self.function_definition_stack[-1].LBLine =3D a.star= t.line=0D - self.function_definition_stack[-1].LBOffset =3D a.st= art.charPositionInLine=0D + self.function_definition_stack[-1].LBLine =3D a.st= art.line=0D + self.function_definition_stack[-1].LBOffset =3D a.= start.charPositionInLine=0D else:=0D - self.function_definition_stack[-1].LBLine =3D b.star= t.line=0D - self.function_definition_stack[-1].LBOffset =3D b.st= art.charPositionInLine=0D -=0D -=0D -=0D -=0D + self.function_definition_stack[-1].LBLine =3D b.st= art.line=0D + self.function_definition_stack[-1].LBOffset =3D b.= start.charPositionInLine=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D if self.backtracking =3D=3D 0:=0D =0D - 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)=0D -=0D -=0D + self.StoreFunctionDefinition(retval.start.line, retval= .start.charPositionInLine, retval.stop.line, retval.stop.charPositionInLine= , self.function_definition_stack[-1].ModifierText, self.function_definition= _stack[=0D + -1].DeclText, self.functi= on_definition_stack[-1].LBLine, self.function_definition_stack[-1].LBOffset= , self.function_definition_stack[-1].DeclLine, self.function_definition_sta= ck[-1].DeclOffset)=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -819,9 +826,9 @@ class CParser(Parser): =0D # $ANTLR end function_definition=0D =0D -=0D # $ANTLR start declaration=0D # C.g:166:1: declaration : (a=3D 'typedef' (b=3D declaration_specifier= s )? c=3D init_declarator_list d=3D ';' | s=3D declaration_specifiers (t=3D= init_declarator_list )? e=3D ';' );=0D +=0D def declaration(self, ):=0D =0D declaration_StartIndex =3D self.input.index()=0D @@ -836,7 +843,6 @@ class CParser(Parser): =0D t =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 4):=0D @@ -846,23 +852,25 @@ class CParser(Parser): alt9 =3D 2=0D LA9_0 =3D self.input.LA(1)=0D =0D - if (LA9_0 =3D=3D 26) :=0D + if (LA9_0 =3D=3D 26):=0D alt9 =3D 1=0D - elif (LA9_0 =3D=3D IDENTIFIER or (29 <=3D LA9_0 <=3D 42) o= r (45 <=3D LA9_0 <=3D 46) or (48 <=3D LA9_0 <=3D 61)) :=0D + elif (LA9_0 =3D=3D IDENTIFIER or (29 <=3D LA9_0 <=3D 42) o= r (45 <=3D LA9_0 <=3D 46) or (48 <=3D LA9_0 <=3D 61)):=0D alt9 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "166:1: declaration : (a=3D 'typedef' (b=3D declar= ation_specifiers )? c=3D init_declarator_list d=3D ';' | s=3D declaration_s= pecifiers (t=3D init_declarator_list )? e=3D ';' );", 9, 0, self.input)=0D =0D raise nvae=0D =0D if alt9 =3D=3D 1:=0D # C.g:167:4: a=3D 'typedef' (b=3D declaration_specifie= rs )? c=3D init_declarator_list d=3D ';'=0D a =3D self.input.LT(1)=0D - self.match(self.input, 26, self.FOLLOW_26_in_declarati= on203)=0D + self.match(self.input, 26,=0D + self.FOLLOW_26_in_declaration203)=0D if self.failed:=0D return=0D # C.g:167:17: (b=3D declaration_specifiers )?=0D @@ -873,60 +881,61 @@ class CParser(Parser): elif LA7 =3D=3D IDENTIFIER:=0D LA7_13 =3D self.input.LA(2)=0D =0D - if (LA7_13 =3D=3D 62) :=0D + if (LA7_13 =3D=3D 62):=0D LA7_21 =3D self.input.LA(3)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D - elif (LA7_13 =3D=3D IDENTIFIER or (29 <=3D LA7_13 = <=3D 42) or (45 <=3D LA7_13 <=3D 46) or (48 <=3D LA7_13 <=3D 61) or LA7_13 = =3D=3D 66) :=0D + elif (LA7_13 =3D=3D IDENTIFIER or (29 <=3D LA7_13 = <=3D 42) or (45 <=3D LA7_13 <=3D 46) or (48 <=3D LA7_13 <=3D 61) or LA7_13 = =3D=3D 66):=0D alt7 =3D 1=0D elif LA7 =3D=3D 58:=0D LA7_14 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D elif LA7 =3D=3D 59:=0D LA7_16 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D elif LA7 =3D=3D 60:=0D LA7_17 =3D self.input.LA(2)=0D =0D - if (self.synpred10()) :=0D + if (self.synpred10()):=0D alt7 =3D 1=0D if alt7 =3D=3D 1:=0D # C.g:0:0: b=3D declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_spec= ifiers_in_declaration207)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_declarat= ion207)=0D b =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_init_declarator_list= _in_declaration216)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_list_in_declaration216= )=0D c =3D self.init_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D d =3D self.input.LT(1)=0D - self.match(self.input, 25, self.FOLLOW_25_in_declarati= on220)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_declaration220)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D =0D if b is not None:=0D - 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))=0D + self.StoreTypedefDefinition(a.line, a.charPosi= tionInLine, d.line, d.charPositionInLine, self.input.toString(=0D + b.start, b.stop), self.input.toString(c.st= art, c.stop))=0D else:=0D - self.StoreTypedefDefinition(a.line, a.charPositi= onInLine, d.line, d.charPositionInLine, '', self.input.toString(c.start, c.= stop))=0D -=0D -=0D -=0D + self.StoreTypedefDefinition(=0D + a.line, a.charPositionInLine, d.line, d.ch= arPositionInLine, '', self.input.toString(c.start, c.stop))=0D =0D elif alt9 =3D=3D 2:=0D # C.g:175:4: s=3D declaration_specifiers (t=3D init_de= clarator_list )? e=3D ';'=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_declaration234)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_declaration2= 34)=0D s =3D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D @@ -935,30 +944,27 @@ class CParser(Parser): alt8 =3D 2=0D LA8_0 =3D self.input.LA(1)=0D =0D - if (LA8_0 =3D=3D IDENTIFIER or (58 <=3D LA8_0 <=3D 60)= or LA8_0 =3D=3D 62 or LA8_0 =3D=3D 66) :=0D + if (LA8_0 =3D=3D IDENTIFIER or (58 <=3D LA8_0 <=3D 60)= or LA8_0 =3D=3D 62 or LA8_0 =3D=3D 66):=0D alt8 =3D 1=0D if alt8 =3D=3D 1:=0D # C.g:0:0: t=3D init_declarator_list=0D - self.following.append(self.FOLLOW_init_declarator_= list_in_declaration238)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_list_in_declaratio= n238)=0D t =3D self.init_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D e =3D self.input.LT(1)=0D - self.match(self.input, 25, self.FOLLOW_25_in_declarati= on243)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_declaration243)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D =0D if t is not None:=0D - 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))=0D -=0D -=0D -=0D -=0D + self.StoreVariableDeclaration(s.start.line, s.= start.charPositionInLine, t.start.line, t.start.charPositionInLine, self.in= put.toString(=0D + s.start, s.stop), self.input.toString(t.st= art, t.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -978,10 +984,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start declaration_specifiers=0D # C.g:182:1: declaration_specifiers : ( storage_class_specifier | type= _specifier | type_qualifier )+ ;=0D +=0D def declaration_specifiers(self, ):=0D =0D retval =3D self.declaration_specifiers_return()=0D @@ -996,44 +1001,39 @@ class CParser(Parser): # C.g:183:6: ( storage_class_specifier | type_specifier | = type_qualifier )+=0D # C.g:183:6: ( storage_class_specifier | type_specifier | = type_qualifier )+=0D cnt10 =3D 0=0D - while True: #loop10=0D + while True: # loop10=0D alt10 =3D 4=0D LA10 =3D self.input.LA(1)=0D if LA10 =3D=3D 58:=0D LA10_2 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 59:=0D LA10_3 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 60:=0D LA10_4 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D IDENTIFIER:=0D LA10_5 =3D self.input.LA(2)=0D =0D - if (self.synpred14()) :=0D + if (self.synpred14()):=0D alt10 =3D 2=0D =0D -=0D elif LA10 =3D=3D 53:=0D LA10_9 =3D self.input.LA(2)=0D =0D - if (self.synpred15()) :=0D + if (self.synpred15()):=0D alt10 =3D 3=0D =0D -=0D elif LA10 =3D=3D 29 or LA10 =3D=3D 30 or LA10 =3D=3D 3= 1 or LA10 =3D=3D 32 or LA10 =3D=3D 33:=0D alt10 =3D 1=0D elif LA10 =3D=3D 34 or LA10 =3D=3D 35 or LA10 =3D=3D 3= 6 or LA10 =3D=3D 37 or LA10 =3D=3D 38 or LA10 =3D=3D 39 or LA10 =3D=3D 40 o= r LA10 =3D=3D 41 or LA10 =3D=3D 42 or LA10 =3D=3D 45 or LA10 =3D=3D 46 or L= A10 =3D=3D 48:=0D @@ -1043,34 +1043,34 @@ class CParser(Parser): =0D if alt10 =3D=3D 1:=0D # C.g:183:10: storage_class_specifier=0D - self.following.append(self.FOLLOW_storage_class_sp= ecifier_in_declaration_specifiers264)=0D + self.following.append(=0D + self.FOLLOW_storage_class_specifier_in_declara= tion_specifiers264)=0D self.storage_class_specifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt10 =3D=3D 2:=0D # C.g:184:7: type_specifier=0D - self.following.append(self.FOLLOW_type_specifier_i= n_declaration_specifiers272)=0D + self.following.append(=0D + self.FOLLOW_type_specifier_in_declaration_spec= ifiers272)=0D self.type_specifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt10 =3D=3D 3:=0D # C.g:185:13: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_i= n_declaration_specifiers286)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_declaration_spec= ifiers286)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D if cnt10 >=3D 1:=0D - break #loop10=0D + break # loop10=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1081,13 +1081,8 @@ class CParser(Parser): =0D cnt10 +=3D 1=0D =0D -=0D -=0D -=0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1106,10 +1101,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start init_declarator_list=0D # C.g:189:1: init_declarator_list : init_declarator ( ',' init_declara= tor )* ;=0D +=0D def init_declarator_list(self, ):=0D =0D retval =3D self.init_declarator_list_return()=0D @@ -1122,42 +1116,38 @@ class CParser(Parser): =0D # C.g:190:2: ( init_declarator ( ',' init_declarator )* )= =0D # C.g:190:4: init_declarator ( ',' init_declarator )*=0D - self.following.append(self.FOLLOW_init_declarator_in_init_= declarator_list308)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_in_init_declarator_list308= )=0D self.init_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:190:20: ( ',' init_declarator )*=0D - while True: #loop11=0D + while True: # loop11=0D alt11 =3D 2=0D LA11_0 =3D self.input.LA(1)=0D =0D - if (LA11_0 =3D=3D 27) :=0D + if (LA11_0 =3D=3D 27):=0D alt11 =3D 1=0D =0D -=0D if alt11 =3D=3D 1:=0D # C.g:190:21: ',' init_declarator=0D - self.match(self.input, 27, self.FOLLOW_27_in_init_= declarator_list311)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_init_declarator_list3= 11)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_init_declarator_= in_init_declarator_list313)=0D + self.following.append(=0D + self.FOLLOW_init_declarator_in_init_declarator= _list313)=0D self.init_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop11=0D -=0D -=0D -=0D -=0D + break # loop11=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1171,9 +1161,9 @@ class CParser(Parser): =0D # $ANTLR end init_declarator_list=0D =0D -=0D # $ANTLR start init_declarator=0D # C.g:193:1: init_declarator : declarator ( '=3D' initializer )? ;=0D +=0D def init_declarator(self, ):=0D =0D init_declarator_StartIndex =3D self.input.index()=0D @@ -1184,7 +1174,8 @@ class CParser(Parser): =0D # C.g:194:2: ( declarator ( '=3D' initializer )? )=0D # C.g:194:4: declarator ( '=3D' initializer )?=0D - self.following.append(self.FOLLOW_declarator_in_init_decla= rator326)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_init_declarator326)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -1193,25 +1184,21 @@ class CParser(Parser): alt12 =3D 2=0D LA12_0 =3D self.input.LA(1)=0D =0D - if (LA12_0 =3D=3D 28) :=0D + if (LA12_0 =3D=3D 28):=0D alt12 =3D 1=0D if alt12 =3D=3D 1:=0D # C.g:194:16: '=3D' initializer=0D - self.match(self.input, 28, self.FOLLOW_28_in_init_decl= arator329)=0D + self.match(self.input, 28,=0D + self.FOLLOW_28_in_init_declarator329)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_in_init_= declarator331)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_init_declarator331)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1225,9 +1212,9 @@ class CParser(Parser): =0D # $ANTLR end init_declarator=0D =0D -=0D # $ANTLR start storage_class_specifier=0D # C.g:197:1: storage_class_specifier : ( 'extern' | 'static' | 'auto' = | 'register' | 'STATIC' );=0D +=0D def storage_class_specifier(self, ):=0D =0D storage_class_specifier_StartIndex =3D self.input.index()=0D @@ -1239,7 +1226,7 @@ class CParser(Parser): # C.g:198:2: ( 'extern' | 'static' | 'auto' | 'register' |= 'STATIC' )=0D # C.g:=0D if (29 <=3D self.input.LA(1) <=3D 33):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -1251,14 +1238,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_storage_class_= specifier0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1272,9 +1254,9 @@ class CParser(Parser): =0D # $ANTLR end storage_class_specifier=0D =0D -=0D # $ANTLR start type_specifier=0D # C.g:205:1: type_specifier : ( 'void' | 'char' | 'short' | 'int' | 'l= ong' | 'float' | 'double' | 'signed' | 'unsigned' | s=3D struct_or_union_sp= ecifier | e=3D enum_specifier | ( IDENTIFIER ( type_qualifier )* declarator= )=3D> type_id );=0D +=0D def type_specifier(self, ):=0D =0D type_specifier_StartIndex =3D self.input.index()=0D @@ -1282,7 +1264,6 @@ class CParser(Parser): =0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 9):=0D @@ -1292,27 +1273,27 @@ class CParser(Parser): alt13 =3D 12=0D LA13_0 =3D self.input.LA(1)=0D =0D - if (LA13_0 =3D=3D 34) :=0D + if (LA13_0 =3D=3D 34):=0D alt13 =3D 1=0D - elif (LA13_0 =3D=3D 35) :=0D + elif (LA13_0 =3D=3D 35):=0D alt13 =3D 2=0D - elif (LA13_0 =3D=3D 36) :=0D + elif (LA13_0 =3D=3D 36):=0D alt13 =3D 3=0D - elif (LA13_0 =3D=3D 37) :=0D + elif (LA13_0 =3D=3D 37):=0D alt13 =3D 4=0D - elif (LA13_0 =3D=3D 38) :=0D + elif (LA13_0 =3D=3D 38):=0D alt13 =3D 5=0D - elif (LA13_0 =3D=3D 39) :=0D + elif (LA13_0 =3D=3D 39):=0D alt13 =3D 6=0D - elif (LA13_0 =3D=3D 40) :=0D + elif (LA13_0 =3D=3D 40):=0D alt13 =3D 7=0D - elif (LA13_0 =3D=3D 41) :=0D + elif (LA13_0 =3D=3D 41):=0D alt13 =3D 8=0D - elif (LA13_0 =3D=3D 42) :=0D + elif (LA13_0 =3D=3D 42):=0D alt13 =3D 9=0D - elif ((45 <=3D LA13_0 <=3D 46)) :=0D + elif ((45 <=3D LA13_0 <=3D 46)):=0D alt13 =3D 10=0D - elif (LA13_0 =3D=3D 48) :=0D + elif (LA13_0 =3D=3D 48):=0D alt13 =3D 11=0D elif (LA13_0 =3D=3D IDENTIFIER) and (self.synpred34()):=0D alt13 =3D 12=0D @@ -1321,76 +1302,78 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "205:1: type_specifier : ( 'void' | 'char' | 'shor= t' | 'int' | 'long' | 'float' | 'double' | 'signed' | 'unsigned' | s=3D str= uct_or_union_specifier | e=3D enum_specifier | ( IDENTIFIER ( type_qualifie= r )* declarator )=3D> type_id );", 13, 0, self.input)=0D =0D raise nvae=0D =0D if alt13 =3D=3D 1:=0D # C.g:206:4: 'void'=0D - self.match(self.input, 34, self.FOLLOW_34_in_type_spec= ifier376)=0D + self.match(self.input, 34,=0D + self.FOLLOW_34_in_type_specifier376)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 2:=0D # C.g:207:4: 'char'=0D - self.match(self.input, 35, self.FOLLOW_35_in_type_spec= ifier381)=0D + self.match(self.input, 35,=0D + self.FOLLOW_35_in_type_specifier381)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 3:=0D # C.g:208:4: 'short'=0D - self.match(self.input, 36, self.FOLLOW_36_in_type_spec= ifier386)=0D + self.match(self.input, 36,=0D + self.FOLLOW_36_in_type_specifier386)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 4:=0D # C.g:209:4: 'int'=0D - self.match(self.input, 37, self.FOLLOW_37_in_type_spec= ifier391)=0D + self.match(self.input, 37,=0D + self.FOLLOW_37_in_type_specifier391)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 5:=0D # C.g:210:4: 'long'=0D - self.match(self.input, 38, self.FOLLOW_38_in_type_spec= ifier396)=0D + self.match(self.input, 38,=0D + self.FOLLOW_38_in_type_specifier396)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 6:=0D # C.g:211:4: 'float'=0D - self.match(self.input, 39, self.FOLLOW_39_in_type_spec= ifier401)=0D + self.match(self.input, 39,=0D + self.FOLLOW_39_in_type_specifier401)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 7:=0D # C.g:212:4: 'double'=0D - self.match(self.input, 40, self.FOLLOW_40_in_type_spec= ifier406)=0D + self.match(self.input, 40,=0D + self.FOLLOW_40_in_type_specifier406)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 8:=0D # C.g:213:4: 'signed'=0D - self.match(self.input, 41, self.FOLLOW_41_in_type_spec= ifier411)=0D + self.match(self.input, 41,=0D + self.FOLLOW_41_in_type_specifier411)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 9:=0D # C.g:214:4: 'unsigned'=0D - self.match(self.input, 42, self.FOLLOW_42_in_type_spec= ifier416)=0D + self.match(self.input, 42,=0D + self.FOLLOW_42_in_type_specifier416)=0D if self.failed:=0D return=0D =0D -=0D elif alt13 =3D=3D 10:=0D # C.g:215:4: s=3D struct_or_union_specifier=0D - self.following.append(self.FOLLOW_struct_or_union_spec= ifier_in_type_specifier423)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_specifier_in_type_spec= ifier423)=0D s =3D self.struct_or_union_specifier()=0D self.following.pop()=0D if self.failed:=0D @@ -1398,14 +1381,13 @@ class CParser(Parser): if self.backtracking =3D=3D 0:=0D =0D if s.stop is not None:=0D - self.StoreStructUnionDefinition(s.start.line, s.= start.charPositionInLine, s.stop.line, s.stop.charPositionInLine, self.inpu= t.toString(s.start, s.stop))=0D -=0D -=0D -=0D + self.StoreStructUnionDefinition(=0D + s.start.line, s.start.charPositionInLine, = s.stop.line, s.stop.charPositionInLine, self.input.toString(s.start, s.stop= ))=0D =0D elif alt13 =3D=3D 11:=0D # C.g:220:4: e=3D enum_specifier=0D - self.following.append(self.FOLLOW_enum_specifier_in_ty= pe_specifier433)=0D + self.following.append(=0D + self.FOLLOW_enum_specifier_in_type_specifier433)=0D e =3D self.enum_specifier()=0D self.following.pop()=0D if self.failed:=0D @@ -1413,21 +1395,18 @@ class CParser(Parser): if self.backtracking =3D=3D 0:=0D =0D if e.stop is not None:=0D - self.StoreEnumerationDefinition(e.start.line, e.= start.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.inpu= t.toString(e.start, e.stop))=0D -=0D -=0D -=0D + self.StoreEnumerationDefinition(=0D + e.start.line, e.start.charPositionInLine, = e.stop.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop= ))=0D =0D elif alt13 =3D=3D 12:=0D # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarat= or )=3D> type_id=0D - self.following.append(self.FOLLOW_type_id_in_type_spec= ifier451)=0D + self.following.append(=0D + self.FOLLOW_type_id_in_type_specifier451)=0D self.type_id()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1441,9 +1420,9 @@ class CParser(Parser): =0D # $ANTLR end type_specifier=0D =0D -=0D # $ANTLR start type_id=0D # C.g:228:1: type_id : IDENTIFIER ;=0D +=0D def type_id(self, ):=0D =0D type_id_StartIndex =3D self.input.index()=0D @@ -1454,13 +1433,11 @@ class CParser(Parser): =0D # C.g:229:5: ( IDENTIFIER )=0D # C.g:229:9: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_type_id467)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_type_id467)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1479,10 +1456,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start struct_or_union_specifier=0D # C.g:233:1: struct_or_union_specifier options {k=3D3; } : ( struct_or= _union ( IDENTIFIER )? '{' struct_declaration_list '}' | struct_or_union ID= ENTIFIER );=0D +=0D def struct_or_union_specifier(self, ):=0D =0D retval =3D self.struct_or_union_specifier_return()=0D @@ -1497,33 +1473,35 @@ class CParser(Parser): alt15 =3D 2=0D LA15_0 =3D self.input.LA(1)=0D =0D - if ((45 <=3D LA15_0 <=3D 46)) :=0D + if ((45 <=3D LA15_0 <=3D 46)):=0D LA15_1 =3D self.input.LA(2)=0D =0D - if (LA15_1 =3D=3D IDENTIFIER) :=0D + if (LA15_1 =3D=3D IDENTIFIER):=0D LA15_2 =3D self.input.LA(3)=0D =0D - if (LA15_2 =3D=3D 43) :=0D + if (LA15_2 =3D=3D 43):=0D alt15 =3D 1=0D - elif (LA15_2 =3D=3D EOF or LA15_2 =3D=3D IDENTIFIE= R or LA15_2 =3D=3D 25 or LA15_2 =3D=3D 27 or (29 <=3D LA15_2 <=3D 42) or (4= 5 <=3D LA15_2 <=3D 64) or LA15_2 =3D=3D 66) :=0D + elif (LA15_2 =3D=3D EOF or LA15_2 =3D=3D IDENTIFIE= R or LA15_2 =3D=3D 25 or LA15_2 =3D=3D 27 or (29 <=3D LA15_2 <=3D 42) or (4= 5 <=3D LA15_2 <=3D 64) or LA15_2 =3D=3D 66):=0D alt15 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_o= r_union_specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{'= struct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 2, self.= input)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options = {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '= }' | struct_or_union IDENTIFIER );", 15, 2, self.input)=0D =0D raise nvae=0D =0D - elif (LA15_1 =3D=3D 43) :=0D + elif (LA15_1 =3D=3D 43):=0D alt15 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_or_un= ion_specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' str= uct_declaration_list '}' | struct_or_union IDENTIFIER );", 15, 1, self.inpu= t)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options {k= =3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}'= | struct_or_union IDENTIFIER );", 15, 1, self.input)=0D =0D raise nvae=0D =0D @@ -1532,13 +1510,15 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("233:1: struct_or_union_= specifier options {k=3D3; } : ( struct_or_union ( IDENTIFIER )? '{' struct_= declaration_list '}' | struct_or_union IDENTIFIER );", 15, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "233:1: struct_or_union_specifier options {k=3D3; = } : ( struct_or_union ( IDENTIFIER )? '{' struct_declaration_list '}' | str= uct_or_union IDENTIFIER );", 15, 0, self.input)=0D =0D raise nvae=0D =0D if alt15 =3D=3D 1:=0D # C.g:235:4: struct_or_union ( IDENTIFIER )? '{' struc= t_declaration_list '}'=0D - self.following.append(self.FOLLOW_struct_or_union_in_s= truct_or_union_specifier494)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_in_struct_or_union_spe= cifier494)=0D self.struct_or_union()=0D self.following.pop()=0D if self.failed:=0D @@ -1547,50 +1527,52 @@ class CParser(Parser): alt14 =3D 2=0D LA14_0 =3D self.input.LA(1)=0D =0D - if (LA14_0 =3D=3D IDENTIFIER) :=0D + if (LA14_0 =3D=3D IDENTIFIER):=0D alt14 =3D 1=0D if alt14 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_struct_or_union_specifier496)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_struct_or_union_specifier496)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 43, self.FOLLOW_43_in_struct_or= _union_specifier499)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_struct_or_union_specifier= 499)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_struct_declaration_l= ist_in_struct_or_union_specifier501)=0D + self.following.append(=0D + self.FOLLOW_struct_declaration_list_in_struct_or_u= nion_specifier501)=0D self.struct_declaration_list()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 44, self.FOLLOW_44_in_struct_or= _union_specifier503)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_struct_or_union_specifier= 503)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt15 =3D=3D 2:=0D # C.g:236:4: struct_or_union IDENTIFIER=0D - self.following.append(self.FOLLOW_struct_or_union_in_s= truct_or_union_specifier508)=0D + self.following.append(=0D + self.FOLLOW_struct_or_union_in_struct_or_union_spe= cifier508)=0D self.struct_or_union()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_struct_or_union_specifier510)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_= struct_or_union_specifier510)=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 11, struct_or_union_specifier_Sta= rtIndex)=0D + self.memoize(self.input, 11,=0D + struct_or_union_specifier_StartIndex)=0D =0D pass=0D =0D @@ -1598,9 +1580,9 @@ class CParser(Parser): =0D # $ANTLR end struct_or_union_specifier=0D =0D -=0D # $ANTLR start struct_or_union=0D # C.g:239:1: struct_or_union : ( 'struct' | 'union' );=0D +=0D def struct_or_union(self, ):=0D =0D struct_or_union_StartIndex =3D self.input.index()=0D @@ -1612,7 +1594,7 @@ class CParser(Parser): # C.g:240:2: ( 'struct' | 'union' )=0D # C.g:=0D if (45 <=3D self.input.LA(1) <=3D 46):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -1624,14 +1606,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_struct_or_unio= n0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1645,9 +1622,9 @@ class CParser(Parser): =0D # $ANTLR end struct_or_union=0D =0D -=0D # $ANTLR start struct_declaration_list=0D # C.g:244:1: struct_declaration_list : ( struct_declaration )+ ;=0D +=0D def struct_declaration_list(self, ):=0D =0D struct_declaration_list_StartIndex =3D self.input.index()=0D @@ -1660,26 +1637,25 @@ class CParser(Parser): # C.g:245:4: ( struct_declaration )+=0D # C.g:245:4: ( struct_declaration )+=0D cnt16 =3D 0=0D - while True: #loop16=0D + while True: # loop16=0D alt16 =3D 2=0D LA16_0 =3D self.input.LA(1)=0D =0D - if (LA16_0 =3D=3D IDENTIFIER or (34 <=3D LA16_0 <=3D 4= 2) or (45 <=3D LA16_0 <=3D 46) or (48 <=3D LA16_0 <=3D 61)) :=0D + if (LA16_0 =3D=3D IDENTIFIER or (34 <=3D LA16_0 <=3D 4= 2) or (45 <=3D LA16_0 <=3D 46) or (48 <=3D LA16_0 <=3D 61)):=0D alt16 =3D 1=0D =0D -=0D if alt16 =3D=3D 1:=0D # C.g:0:0: struct_declaration=0D - self.following.append(self.FOLLOW_struct_declarati= on_in_struct_declaration_list537)=0D + self.following.append(=0D + self.FOLLOW_struct_declaration_in_struct_decla= ration_list537)=0D self.struct_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt16 >=3D 1:=0D - break #loop16=0D + break # loop16=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1690,17 +1666,13 @@ class CParser(Parser): =0D cnt16 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 13, struct_declaration_list_Start= Index)=0D + self.memoize(self.input, 13,=0D + struct_declaration_list_StartIndex)=0D =0D pass=0D =0D @@ -1708,9 +1680,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declaration_list=0D =0D -=0D # $ANTLR start struct_declaration=0D # C.g:248:1: struct_declaration : specifier_qualifier_list struct_decl= arator_list ';' ;=0D +=0D def struct_declaration(self, ):=0D =0D struct_declaration_StartIndex =3D self.input.index()=0D @@ -1721,23 +1693,23 @@ class CParser(Parser): =0D # C.g:249:2: ( specifier_qualifier_list struct_declarator_= list ';' )=0D # C.g:249:4: specifier_qualifier_list struct_declarator_li= st ';'=0D - self.following.append(self.FOLLOW_specifier_qualifier_list= _in_struct_declaration549)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_struct_declara= tion549)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_struct_declarator_list_i= n_struct_declaration551)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_list_in_struct_declarati= on551)=0D self.struct_declarator_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_struct_declar= ation553)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_struct_declaration553)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -1751,9 +1723,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declaration=0D =0D -=0D # $ANTLR start specifier_qualifier_list=0D # C.g:252:1: specifier_qualifier_list : ( type_qualifier | type_specif= ier )+ ;=0D +=0D def specifier_qualifier_list(self, ):=0D =0D specifier_qualifier_list_StartIndex =3D self.input.index()=0D @@ -1766,30 +1738,27 @@ class CParser(Parser): # C.g:253:4: ( type_qualifier | type_specifier )+=0D # C.g:253:4: ( type_qualifier | type_specifier )+=0D cnt17 =3D 0=0D - while True: #loop17=0D + while True: # loop17=0D alt17 =3D 3=0D LA17 =3D self.input.LA(1)=0D if LA17 =3D=3D 58:=0D LA17_2 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D 59:=0D LA17_3 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D 60:=0D LA17_4 =3D self.input.LA(2)=0D =0D - if (self.synpred39()) :=0D + if (self.synpred39()):=0D alt17 =3D 1=0D =0D -=0D elif LA17 =3D=3D IDENTIFIER:=0D LA17 =3D self.input.LA(2)=0D if LA17 =3D=3D EOF or LA17 =3D=3D IDENTIFIER or LA= 17 =3D=3D 34 or LA17 =3D=3D 35 or LA17 =3D=3D 36 or LA17 =3D=3D 37 or LA17 = =3D=3D 38 or LA17 =3D=3D 39 or LA17 =3D=3D 40 or LA17 =3D=3D 41 or LA17 =3D= =3D 42 or LA17 =3D=3D 45 or LA17 =3D=3D 46 or LA17 =3D=3D 48 or LA17 =3D=3D= 49 or LA17 =3D=3D 50 or LA17 =3D=3D 51 or LA17 =3D=3D 52 or LA17 =3D=3D 53= or LA17 =3D=3D 54 or LA17 =3D=3D 55 or LA17 =3D=3D 56 or LA17 =3D=3D 57 or= LA17 =3D=3D 58 or LA17 =3D=3D 59 or LA17 =3D=3D 60 or LA17 =3D=3D 61 or LA= 17 =3D=3D 63 or LA17 =3D=3D 66:=0D @@ -1797,25 +1766,21 @@ class CParser(Parser): elif LA17 =3D=3D 62:=0D LA17_94 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D elif LA17 =3D=3D 47:=0D LA17_95 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D elif LA17 =3D=3D 64:=0D LA17_96 =3D self.input.LA(3)=0D =0D - if (self.synpred40()) :=0D + if (self.synpred40()):=0D alt17 =3D 2=0D =0D -=0D -=0D elif LA17 =3D=3D 49 or LA17 =3D=3D 50 or LA17 =3D=3D 5= 1 or LA17 =3D=3D 52 or LA17 =3D=3D 53 or LA17 =3D=3D 54 or LA17 =3D=3D 55 o= r LA17 =3D=3D 56 or LA17 =3D=3D 57 or LA17 =3D=3D 61:=0D alt17 =3D 1=0D elif LA17 =3D=3D 34 or LA17 =3D=3D 35 or LA17 =3D=3D 3= 6 or LA17 =3D=3D 37 or LA17 =3D=3D 38 or LA17 =3D=3D 39 or LA17 =3D=3D 40 o= r LA17 =3D=3D 41 or LA17 =3D=3D 42 or LA17 =3D=3D 45 or LA17 =3D=3D 46 or L= A17 =3D=3D 48:=0D @@ -1823,25 +1788,25 @@ class CParser(Parser): =0D if alt17 =3D=3D 1:=0D # C.g:253:6: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_i= n_specifier_qualifier_list566)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_specifier_qualif= ier_list566)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt17 =3D=3D 2:=0D # C.g:253:23: type_specifier=0D - self.following.append(self.FOLLOW_type_specifier_i= n_specifier_qualifier_list570)=0D + self.following.append(=0D + self.FOLLOW_type_specifier_in_specifier_qualif= ier_list570)=0D self.type_specifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt17 >=3D 1:=0D - break #loop17=0D + break # loop17=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -1852,17 +1817,13 @@ class CParser(Parser): =0D cnt17 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 15, specifier_qualifier_list_Star= tIndex)=0D + self.memoize(self.input, 15,=0D + specifier_qualifier_list_StartIndex)=0D =0D pass=0D =0D @@ -1870,9 +1831,9 @@ class CParser(Parser): =0D # $ANTLR end specifier_qualifier_list=0D =0D -=0D # $ANTLR start struct_declarator_list=0D # C.g:256:1: struct_declarator_list : struct_declarator ( ',' struct_d= eclarator )* ;=0D +=0D def struct_declarator_list(self, ):=0D =0D struct_declarator_list_StartIndex =3D self.input.index()=0D @@ -1883,39 +1844,35 @@ class CParser(Parser): =0D # C.g:257:2: ( struct_declarator ( ',' struct_declarator )= * )=0D # C.g:257:4: struct_declarator ( ',' struct_declarator )*= =0D - self.following.append(self.FOLLOW_struct_declarator_in_str= uct_declarator_list584)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_in_struct_declarator_lis= t584)=0D self.struct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:257:22: ( ',' struct_declarator )*=0D - while True: #loop18=0D + while True: # loop18=0D alt18 =3D 2=0D LA18_0 =3D self.input.LA(1)=0D =0D - if (LA18_0 =3D=3D 27) :=0D + if (LA18_0 =3D=3D 27):=0D alt18 =3D 1=0D =0D -=0D if alt18 =3D=3D 1:=0D # C.g:257:23: ',' struct_declarator=0D - self.match(self.input, 27, self.FOLLOW_27_in_struc= t_declarator_list587)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_struct_declarator_lis= t587)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_struct_declarato= r_in_struct_declarator_list589)=0D + self.following.append(=0D + self.FOLLOW_struct_declarator_in_struct_declar= ator_list589)=0D self.struct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop18=0D -=0D -=0D -=0D -=0D -=0D + break # loop18=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -1930,9 +1887,9 @@ class CParser(Parser): =0D # $ANTLR end struct_declarator_list=0D =0D -=0D # $ANTLR start struct_declarator=0D # C.g:260:1: struct_declarator : ( declarator ( ':' constant_expressio= n )? | ':' constant_expression );=0D +=0D def struct_declarator(self, ):=0D =0D struct_declarator_StartIndex =3D self.input.index()=0D @@ -1945,22 +1902,24 @@ class CParser(Parser): alt20 =3D 2=0D LA20_0 =3D self.input.LA(1)=0D =0D - if (LA20_0 =3D=3D IDENTIFIER or (58 <=3D LA20_0 <=3D 60) o= r LA20_0 =3D=3D 62 or LA20_0 =3D=3D 66) :=0D + if (LA20_0 =3D=3D IDENTIFIER or (58 <=3D LA20_0 <=3D 60) o= r LA20_0 =3D=3D 62 or LA20_0 =3D=3D 66):=0D alt20 =3D 1=0D - elif (LA20_0 =3D=3D 47) :=0D + elif (LA20_0 =3D=3D 47):=0D alt20 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("260:1: struct_declarato= r : ( declarator ( ':' constant_expression )? | ':' constant_expression );"= , 20, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "260:1: struct_declarator : ( declarator ( ':' con= stant_expression )? | ':' constant_expression );", 20, 0, self.input)=0D =0D raise nvae=0D =0D if alt20 =3D=3D 1:=0D # C.g:261:4: declarator ( ':' constant_expression )?=0D - self.following.append(self.FOLLOW_declarator_in_struct= _declarator602)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_struct_declarator602)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D @@ -1969,36 +1928,34 @@ class CParser(Parser): alt19 =3D 2=0D LA19_0 =3D self.input.LA(1)=0D =0D - if (LA19_0 =3D=3D 47) :=0D + if (LA19_0 =3D=3D 47):=0D alt19 =3D 1=0D if alt19 =3D=3D 1:=0D # C.g:261:16: ':' constant_expression=0D - self.match(self.input, 47, self.FOLLOW_47_in_struc= t_declarator605)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_struct_declarator605)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_express= ion_in_struct_declarator607)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_struct_decl= arator607)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt20 =3D=3D 2:=0D # C.g:262:4: ':' constant_expression=0D - self.match(self.input, 47, self.FOLLOW_47_in_struct_de= clarator614)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_struct_declarator614)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_struct_declarator616)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_struct_declarat= or616)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2017,10 +1974,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start enum_specifier=0D # C.g:265:1: enum_specifier options {k=3D3; } : ( 'enum' '{' enumerato= r_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list ( ',' )? '}' | = 'enum' IDENTIFIER );=0D +=0D def enum_specifier(self, ):=0D =0D retval =3D self.enum_specifier_return()=0D @@ -2035,33 +1991,35 @@ class CParser(Parser): alt23 =3D 3=0D LA23_0 =3D self.input.LA(1)=0D =0D - if (LA23_0 =3D=3D 48) :=0D + if (LA23_0 =3D=3D 48):=0D LA23_1 =3D self.input.LA(2)=0D =0D - if (LA23_1 =3D=3D IDENTIFIER) :=0D + if (LA23_1 =3D=3D IDENTIFIER):=0D LA23_2 =3D self.input.LA(3)=0D =0D - if (LA23_2 =3D=3D 43) :=0D + if (LA23_2 =3D=3D 43):=0D alt23 =3D 2=0D - elif (LA23_2 =3D=3D EOF or LA23_2 =3D=3D IDENTIFIE= R or LA23_2 =3D=3D 25 or LA23_2 =3D=3D 27 or (29 <=3D LA23_2 <=3D 42) or (4= 5 <=3D LA23_2 <=3D 64) or LA23_2 =3D=3D 66) :=0D + elif (LA23_2 =3D=3D EOF or LA23_2 =3D=3D IDENTIFIE= R or LA23_2 =3D=3D 25 or LA23_2 =3D=3D 27 or (29 <=3D LA23_2 <=3D 42) or (4= 5 <=3D LA23_2 <=3D 64) or LA23_2 =3D=3D 66):=0D alt23 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_spe= cifier options {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enu= m' IDENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23,= 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } := ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerat= or_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 2, self.input)=0D =0D raise nvae=0D =0D - elif (LA23_1 =3D=3D 43) :=0D + elif (LA23_1 =3D=3D 43):=0D alt23 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_specifi= er options {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' I= DENTIFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, = self.input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } : ( '= enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_l= ist ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 1, self.input)=0D =0D raise nvae=0D =0D @@ -2070,19 +2028,23 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("265:1: enum_specifier o= ptions {k=3D3; } : ( 'enum' '{' enumerator_list ( ',' )? '}' | 'enum' IDENT= IFIER '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self= .input)=0D + nvae =3D NoViableAltException(=0D + "265:1: enum_specifier options {k=3D3; } : ( 'enum= ' '{' enumerator_list ( ',' )? '}' | 'enum' IDENTIFIER '{' enumerator_list = ( ',' )? '}' | 'enum' IDENTIFIER );", 23, 0, self.input)=0D =0D raise nvae=0D =0D if alt23 =3D=3D 1:=0D # C.g:267:4: 'enum' '{' enumerator_list ( ',' )? '}'=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier634)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier634)=0D if self.failed:=0D return retval=0D - self.match(self.input, 43, self.FOLLOW_43_in_enum_spec= ifier636)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_enum_specifier636)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_enumerator_list_in_e= num_specifier638)=0D + self.following.append(=0D + self.FOLLOW_enumerator_list_in_enum_specifier638)= =0D self.enumerator_list()=0D self.following.pop()=0D if self.failed:=0D @@ -2091,33 +2053,36 @@ class CParser(Parser): alt21 =3D 2=0D LA21_0 =3D self.input.LA(1)=0D =0D - if (LA21_0 =3D=3D 27) :=0D + if (LA21_0 =3D=3D 27):=0D alt21 =3D 1=0D if alt21 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_enum_= specifier640)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enum_specifier640)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_enum_spec= ifier643)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_enum_specifier643)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt23 =3D=3D 2:=0D # C.g:268:4: 'enum' IDENTIFIER '{' enumerator_list ( '= ,' )? '}'=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier648)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier648)=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_enum_specifier650)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enum_specifier650= )=0D if self.failed:=0D return retval=0D - self.match(self.input, 43, self.FOLLOW_43_in_enum_spec= ifier652)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_enum_specifier652)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_enumerator_list_in_e= num_specifier654)=0D + self.following.append(=0D + self.FOLLOW_enumerator_list_in_enum_specifier654)= =0D self.enumerator_list()=0D self.following.pop()=0D if self.failed:=0D @@ -2126,34 +2091,33 @@ class CParser(Parser): alt22 =3D 2=0D LA22_0 =3D self.input.LA(1)=0D =0D - if (LA22_0 =3D=3D 27) :=0D + if (LA22_0 =3D=3D 27):=0D alt22 =3D 1=0D if alt22 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_enum_= specifier656)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enum_specifier656)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_enum_spec= ifier659)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_enum_specifier659)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt23 =3D=3D 3:=0D # C.g:269:4: 'enum' IDENTIFIER=0D - self.match(self.input, 48, self.FOLLOW_48_in_enum_spec= ifier664)=0D + self.match(self.input, 48,=0D + self.FOLLOW_48_in_enum_specifier664)=0D if self.failed:=0D return retval=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_enum_specifier666)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enum_specifier666= )=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2167,9 +2131,9 @@ class CParser(Parser): =0D # $ANTLR end enum_specifier=0D =0D -=0D # $ANTLR start enumerator_list=0D # C.g:272:1: enumerator_list : enumerator ( ',' enumerator )* ;=0D +=0D def enumerator_list(self, ):=0D =0D enumerator_list_StartIndex =3D self.input.index()=0D @@ -2180,44 +2144,38 @@ class CParser(Parser): =0D # C.g:273:2: ( enumerator ( ',' enumerator )* )=0D # C.g:273:4: enumerator ( ',' enumerator )*=0D - self.following.append(self.FOLLOW_enumerator_in_enumerator= _list677)=0D + self.following.append(=0D + self.FOLLOW_enumerator_in_enumerator_list677)=0D self.enumerator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:273:15: ( ',' enumerator )*=0D - while True: #loop24=0D + while True: # loop24=0D alt24 =3D 2=0D LA24_0 =3D self.input.LA(1)=0D =0D - if (LA24_0 =3D=3D 27) :=0D + if (LA24_0 =3D=3D 27):=0D LA24_1 =3D self.input.LA(2)=0D =0D - if (LA24_1 =3D=3D IDENTIFIER) :=0D + if (LA24_1 =3D=3D IDENTIFIER):=0D alt24 =3D 1=0D =0D -=0D -=0D -=0D if alt24 =3D=3D 1:=0D # C.g:273:16: ',' enumerator=0D - self.match(self.input, 27, self.FOLLOW_27_in_enume= rator_list680)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_enumerator_list680)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_enumerator_in_en= umerator_list682)=0D + self.following.append(=0D + self.FOLLOW_enumerator_in_enumerator_list682)= =0D self.enumerator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop24=0D -=0D -=0D -=0D -=0D -=0D + break # loop24=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -2232,9 +2190,9 @@ class CParser(Parser): =0D # $ANTLR end enumerator_list=0D =0D -=0D # $ANTLR start enumerator=0D # C.g:276:1: enumerator : IDENTIFIER ( '=3D' constant_expression )? ;= =0D +=0D def enumerator(self, ):=0D =0D enumerator_StartIndex =3D self.input.index()=0D @@ -2245,32 +2203,28 @@ class CParser(Parser): =0D # C.g:277:2: ( IDENTIFIER ( '=3D' constant_expression )? )= =0D # C.g:277:4: IDENTIFIER ( '=3D' constant_expression )?=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_enumerator695)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_enumerator695)=0D if self.failed:=0D return=0D # C.g:277:15: ( '=3D' constant_expression )?=0D alt25 =3D 2=0D LA25_0 =3D self.input.LA(1)=0D =0D - if (LA25_0 =3D=3D 28) :=0D + if (LA25_0 =3D=3D 28):=0D alt25 =3D 1=0D if alt25 =3D=3D 1:=0D # C.g:277:16: '=3D' constant_expression=0D self.match(self.input, 28, self.FOLLOW_28_in_enumerato= r698)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_enumerator700)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_enumerator700)= =0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2284,9 +2238,9 @@ class CParser(Parser): =0D # $ANTLR end enumerator=0D =0D -=0D # $ANTLR start type_qualifier=0D # C.g:280:1: type_qualifier : ( 'const' | 'volatile' | 'IN' | 'OUT' | = 'OPTIONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFER= ENCED' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' );= =0D +=0D def type_qualifier(self, ):=0D =0D type_qualifier_StartIndex =3D self.input.index()=0D @@ -2298,7 +2252,7 @@ class CParser(Parser): # C.g:281:2: ( 'const' | 'volatile' | 'IN' | 'OUT' | 'OPTI= ONAL' | 'CONST' | 'UNALIGNED' | 'VOLATILE' | 'GLOBAL_REMOVE_IF_UNREFERENCED= ' | 'EFIAPI' | 'EFI_BOOTSERVICE' | 'EFI_RUNTIMESERVICE' | 'PACKED' )=0D # C.g:=0D if (49 <=3D self.input.LA(1) <=3D 61):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -2310,14 +2264,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_type_qualifier= 0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2336,10 +2285,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start declarator=0D # C.g:296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERV= ICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointer );=0D +=0D def declarator(self, ):=0D =0D retval =3D self.declarator_return()=0D @@ -2354,30 +2302,32 @@ class CParser(Parser): alt30 =3D 2=0D LA30_0 =3D self.input.LA(1)=0D =0D - if (LA30_0 =3D=3D 66) :=0D + if (LA30_0 =3D=3D 66):=0D LA30_1 =3D self.input.LA(2)=0D =0D - if (self.synpred66()) :=0D + if (self.synpred66()):=0D alt30 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt30 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("296:1: declarator := ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE'= )? direct_declarator | pointer );", 30, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "296:1: declarator : ( ( pointer )? ( 'EFIAPI'= )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | po= inter );", 30, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA30_0 =3D=3D IDENTIFIER or (58 <=3D LA30_0 <=3D 60)= or LA30_0 =3D=3D 62) :=0D + elif (LA30_0 =3D=3D IDENTIFIER or (58 <=3D LA30_0 <=3D 60)= or LA30_0 =3D=3D 62):=0D alt30 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("296:1: declarator : ( (= pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? = direct_declarator | pointer );", 30, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "296:1: declarator : ( ( pointer )? ( 'EFIAPI' )? = ( 'EFI_BOOTSERVICE' )? ( 'EFI_RUNTIMESERVICE' )? direct_declarator | pointe= r );", 30, 0, self.input)=0D =0D raise nvae=0D =0D @@ -2387,67 +2337,63 @@ class CParser(Parser): alt26 =3D 2=0D LA26_0 =3D self.input.LA(1)=0D =0D - if (LA26_0 =3D=3D 66) :=0D + if (LA26_0 =3D=3D 66):=0D alt26 =3D 1=0D if alt26 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_decla= rator784)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_declarator784)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:13: ( 'EFIAPI' )?=0D alt27 =3D 2=0D LA27_0 =3D self.input.LA(1)=0D =0D - if (LA27_0 =3D=3D 58) :=0D + if (LA27_0 =3D=3D 58):=0D alt27 =3D 1=0D if alt27 =3D=3D 1:=0D # C.g:297:14: 'EFIAPI'=0D - self.match(self.input, 58, self.FOLLOW_58_in_decla= rator788)=0D + self.match(self.input, 58,=0D + self.FOLLOW_58_in_declarator788)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:25: ( 'EFI_BOOTSERVICE' )?=0D alt28 =3D 2=0D LA28_0 =3D self.input.LA(1)=0D =0D - if (LA28_0 =3D=3D 59) :=0D + if (LA28_0 =3D=3D 59):=0D alt28 =3D 1=0D if alt28 =3D=3D 1:=0D # C.g:297:26: 'EFI_BOOTSERVICE'=0D - self.match(self.input, 59, self.FOLLOW_59_in_decla= rator793)=0D + self.match(self.input, 59,=0D + self.FOLLOW_59_in_declarator793)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?=0D alt29 =3D 2=0D LA29_0 =3D self.input.LA(1)=0D =0D - if (LA29_0 =3D=3D 60) :=0D + if (LA29_0 =3D=3D 60):=0D alt29 =3D 1=0D if alt29 =3D=3D 1:=0D # C.g:297:47: 'EFI_RUNTIMESERVICE'=0D - self.match(self.input, 60, self.FOLLOW_60_in_decla= rator798)=0D + self.match(self.input, 60,=0D + self.FOLLOW_60_in_declarator798)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_direct_declarator_in= _declarator802)=0D + self.following.append(=0D + self.FOLLOW_direct_declarator_in_declarator802)=0D self.direct_declarator()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt30 =3D=3D 2:=0D # C.g:299:4: pointer=0D self.following.append(self.FOLLOW_pointer_in_declarato= r808)=0D @@ -2456,10 +2402,8 @@ class CParser(Parser): if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -2473,9 +2417,9 @@ class CParser(Parser): =0D # $ANTLR end declarator=0D =0D -=0D # $ANTLR start direct_declarator=0D # C.g:302:1: direct_declarator : ( IDENTIFIER ( declarator_suffix )* |= '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );=0D +=0D def direct_declarator(self, ):=0D =0D direct_declarator_StartIndex =3D self.input.index()=0D @@ -2488,556 +2432,485 @@ class CParser(Parser): alt34 =3D 2=0D LA34_0 =3D self.input.LA(1)=0D =0D - if (LA34_0 =3D=3D IDENTIFIER) :=0D + if (LA34_0 =3D=3D IDENTIFIER):=0D alt34 =3D 1=0D - elif (LA34_0 =3D=3D 62) :=0D + elif (LA34_0 =3D=3D 62):=0D alt34 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("302:1: direct_declarato= r : ( IDENTIFIER ( declarator_suffix )* | '(' ( 'EFIAPI' )? declarator ')' = ( declarator_suffix )+ );", 34, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "302:1: direct_declarator : ( IDENTIFIER ( declara= tor_suffix )* | '(' ( 'EFIAPI' )? declarator ')' ( declarator_suffix )+ );"= , 34, 0, self.input)=0D =0D raise nvae=0D =0D if alt34 =3D=3D 1:=0D # C.g:303:4: IDENTIFIER ( declarator_suffix )*=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_direct_declarator819)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_direct_declarator= 819)=0D if self.failed:=0D return=0D # C.g:303:15: ( declarator_suffix )*=0D - while True: #loop31=0D + while True: # loop31=0D alt31 =3D 2=0D LA31_0 =3D self.input.LA(1)=0D =0D - if (LA31_0 =3D=3D 62) :=0D + if (LA31_0 =3D=3D 62):=0D LA31 =3D self.input.LA(2)=0D if LA31 =3D=3D 63:=0D LA31_30 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 58:=0D LA31_31 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 66:=0D LA31_32 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 59:=0D LA31_33 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 60:=0D LA31_34 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D IDENTIFIER:=0D LA31_35 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 29 or LA31 =3D=3D 30 or LA31 = =3D=3D 31 or LA31 =3D=3D 32 or LA31 =3D=3D 33:=0D LA31_37 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 34:=0D LA31_38 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 35:=0D LA31_39 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 36:=0D LA31_40 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 37:=0D LA31_41 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 38:=0D LA31_42 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 39:=0D LA31_43 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 40:=0D LA31_44 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 41:=0D LA31_45 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 42:=0D LA31_46 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 45 or LA31 =3D=3D 46:=0D LA31_47 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 48:=0D LA31_48 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 49 or LA31 =3D=3D 50 or LA31 = =3D=3D 51 or LA31 =3D=3D 52 or LA31 =3D=3D 53 or LA31 =3D=3D 54 or LA31 =3D= =3D 55 or LA31 =3D=3D 56 or LA31 =3D=3D 57 or LA31 =3D=3D 61:=0D LA31_49 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D -=0D - elif (LA31_0 =3D=3D 64) :=0D + elif (LA31_0 =3D=3D 64):=0D LA31 =3D self.input.LA(2)=0D if LA31 =3D=3D 65:=0D LA31_51 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 62:=0D LA31_52 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D IDENTIFIER:=0D LA31_53 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D HEX_LITERAL:=0D LA31_54 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D OCTAL_LITERAL:=0D LA31_55 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D DECIMAL_LITERAL:=0D LA31_56 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D CHARACTER_LITERAL:=0D LA31_57 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D STRING_LITERAL:=0D LA31_58 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D FLOATING_POINT_LITERAL:=0D LA31_59 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 72:=0D LA31_60 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 73:=0D LA31_61 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 66 or LA31 =3D=3D 68 or LA31 = =3D=3D 69 or LA31 =3D=3D 77 or LA31 =3D=3D 78 or LA31 =3D=3D 79:=0D LA31_62 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D elif LA31 =3D=3D 74:=0D LA31_63 =3D self.input.LA(3)=0D =0D - if (self.synpred67()) :=0D + if (self.synpred67()):=0D alt31 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt31 =3D=3D 1:=0D # C.g:0:0: declarator_suffix=0D - self.following.append(self.FOLLOW_declarator_s= uffix_in_direct_declarator821)=0D + self.following.append(=0D + self.FOLLOW_declarator_suffix_in_direct_de= clarator821)=0D self.declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop31=0D -=0D -=0D -=0D + break # loop31=0D =0D elif alt34 =3D=3D 2:=0D # C.g:304:4: '(' ( 'EFIAPI' )? declarator ')' ( declar= ator_suffix )+=0D - self.match(self.input, 62, self.FOLLOW_62_in_direct_de= clarator827)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_direct_declarator827)=0D if self.failed:=0D return=0D # C.g:304:8: ( 'EFIAPI' )?=0D alt32 =3D 2=0D LA32_0 =3D self.input.LA(1)=0D =0D - if (LA32_0 =3D=3D 58) :=0D + if (LA32_0 =3D=3D 58):=0D LA32_1 =3D self.input.LA(2)=0D =0D - if (self.synpred69()) :=0D + if (self.synpred69()):=0D alt32 =3D 1=0D if alt32 =3D=3D 1:=0D # C.g:304:9: 'EFIAPI'=0D - self.match(self.input, 58, self.FOLLOW_58_in_direc= t_declarator830)=0D + self.match(self.input, 58,=0D + self.FOLLOW_58_in_direct_declarator830)= =0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_declarator_in_direct= _declarator834)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_direct_declarator834)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_direct_de= clarator836)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_direct_declarator836)=0D if self.failed:=0D return=0D # C.g:304:35: ( declarator_suffix )+=0D cnt33 =3D 0=0D - while True: #loop33=0D + while True: # loop33=0D alt33 =3D 2=0D LA33_0 =3D self.input.LA(1)=0D =0D - if (LA33_0 =3D=3D 62) :=0D + if (LA33_0 =3D=3D 62):=0D LA33 =3D self.input.LA(2)=0D if LA33 =3D=3D 63:=0D LA33_30 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 58:=0D LA33_31 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 66:=0D LA33_32 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 59:=0D LA33_33 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 60:=0D LA33_34 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D IDENTIFIER:=0D LA33_35 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 29 or LA33 =3D=3D 30 or LA33 = =3D=3D 31 or LA33 =3D=3D 32 or LA33 =3D=3D 33:=0D LA33_37 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 34:=0D LA33_38 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 35:=0D LA33_39 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 36:=0D LA33_40 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 37:=0D LA33_41 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 38:=0D LA33_42 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 39:=0D LA33_43 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 40:=0D LA33_44 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 41:=0D LA33_45 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 42:=0D LA33_46 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 45 or LA33 =3D=3D 46:=0D LA33_47 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 48:=0D LA33_48 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 49 or LA33 =3D=3D 50 or LA33 = =3D=3D 51 or LA33 =3D=3D 52 or LA33 =3D=3D 53 or LA33 =3D=3D 54 or LA33 =3D= =3D 55 or LA33 =3D=3D 56 or LA33 =3D=3D 57 or LA33 =3D=3D 61:=0D LA33_49 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D -=0D - elif (LA33_0 =3D=3D 64) :=0D + elif (LA33_0 =3D=3D 64):=0D LA33 =3D self.input.LA(2)=0D if LA33 =3D=3D 65:=0D LA33_51 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 62:=0D LA33_52 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D IDENTIFIER:=0D LA33_53 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D HEX_LITERAL:=0D LA33_54 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D OCTAL_LITERAL:=0D LA33_55 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D DECIMAL_LITERAL:=0D LA33_56 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D CHARACTER_LITERAL:=0D LA33_57 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D STRING_LITERAL:=0D LA33_58 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D FLOATING_POINT_LITERAL:=0D LA33_59 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 72:=0D LA33_60 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 73:=0D LA33_61 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 66 or LA33 =3D=3D 68 or LA33 = =3D=3D 69 or LA33 =3D=3D 77 or LA33 =3D=3D 78 or LA33 =3D=3D 79:=0D LA33_62 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D elif LA33 =3D=3D 74:=0D LA33_63 =3D self.input.LA(3)=0D =0D - if (self.synpred70()) :=0D + if (self.synpred70()):=0D alt33 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt33 =3D=3D 1:=0D # C.g:0:0: declarator_suffix=0D - self.following.append(self.FOLLOW_declarator_s= uffix_in_direct_declarator838)=0D + self.following.append(=0D + self.FOLLOW_declarator_suffix_in_direct_de= clarator838)=0D self.declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt33 >=3D 1:=0D - break #loop33=0D + break # loop33=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -3048,10 +2921,6 @@ class CParser(Parser): =0D cnt33 +=3D 1=0D =0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3065,9 +2934,9 @@ class CParser(Parser): =0D # $ANTLR end direct_declarator=0D =0D -=0D # $ANTLR start declarator_suffix=0D # C.g:307:1: declarator_suffix : ( '[' constant_expression ']' | '[' '= ]' | '(' parameter_type_list ')' | '(' identifier_list ')' | '(' ')' );=0D +=0D def declarator_suffix(self, ):=0D =0D declarator_suffix_StartIndex =3D self.input.index()=0D @@ -3080,23 +2949,24 @@ class CParser(Parser): alt35 =3D 5=0D LA35_0 =3D self.input.LA(1)=0D =0D - if (LA35_0 =3D=3D 64) :=0D + if (LA35_0 =3D=3D 64):=0D LA35_1 =3D self.input.LA(2)=0D =0D - if (LA35_1 =3D=3D 65) :=0D + if (LA35_1 =3D=3D 65):=0D alt35 =3D 2=0D - elif ((IDENTIFIER <=3D LA35_1 <=3D FLOATING_POINT_LITE= RAL) or LA35_1 =3D=3D 62 or LA35_1 =3D=3D 66 or (68 <=3D LA35_1 <=3D 69) or= (72 <=3D LA35_1 <=3D 74) or (77 <=3D LA35_1 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA35_1 <=3D FLOATING_POINT_LITE= RAL) or LA35_1 =3D=3D 62 or LA35_1 =3D=3D 66 or (68 <=3D LA35_1 <=3D 69) or= (72 <=3D LA35_1 <=3D 74) or (77 <=3D LA35_1 <=3D 79)):=0D alt35 =3D 1=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_exp= ression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list '= )' | '(' ')' );", 35, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA35_0 =3D=3D 62) :=0D + elif (LA35_0 =3D=3D 62):=0D LA35 =3D self.input.LA(2)=0D if LA35 =3D=3D 63:=0D alt35 =3D 5=0D @@ -3105,16 +2975,17 @@ class CParser(Parser): elif LA35 =3D=3D IDENTIFIER:=0D LA35_29 =3D self.input.LA(3)=0D =0D - if (self.synpred73()) :=0D + if (self.synpred73()):=0D alt35 =3D 3=0D - elif (self.synpred74()) :=0D + elif (self.synpred74()):=0D alt35 =3D 4=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarat= or_suffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_li= st ')' | '(' identifier_list ')' | '(' ')' );", 35, 29, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant= _expression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_li= st ')' | '(' ')' );", 35, 29, self.input)=0D =0D raise nvae=0D =0D @@ -3123,7 +2994,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_s= uffix : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list '= )' | '(' identifier_list ')' | '(' ')' );", 35, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_exp= ression ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list '= )' | '(' ')' );", 35, 2, self.input)=0D =0D raise nvae=0D =0D @@ -3132,76 +3004,84 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("307:1: declarator_suffi= x : ( '[' constant_expression ']' | '[' ']' | '(' parameter_type_list ')' |= '(' identifier_list ')' | '(' ')' );", 35, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "307:1: declarator_suffix : ( '[' constant_express= ion ']' | '[' ']' | '(' parameter_type_list ')' | '(' identifier_list ')' |= '(' ')' );", 35, 0, self.input)=0D =0D raise nvae=0D =0D if alt35 =3D=3D 1:=0D # C.g:308:6: '[' constant_expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix852)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_declarator_suffix852)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_declarator_suffix854)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_declarator_suff= ix854)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix856)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_declarator_suffix856)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 2:=0D # C.g:309:9: '[' ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_declarato= r_suffix866)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_declarator_suffix866)=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_declarato= r_suffix868)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_declarator_suffix868)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 3:=0D # C.g:310:9: '(' parameter_type_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix878)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix878)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_type_list_= in_declarator_suffix880)=0D + self.following.append(=0D + self.FOLLOW_parameter_type_list_in_declarator_suff= ix880)=0D self.parameter_type_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix882)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix882)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 4:=0D # C.g:311:9: '(' identifier_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix892)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix892)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_identifier_list_in_d= eclarator_suffix894)=0D + self.following.append(=0D + self.FOLLOW_identifier_list_in_declarator_suffix89= 4)=0D self.identifier_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix896)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix896)=0D if self.failed:=0D return=0D =0D -=0D elif alt35 =3D=3D 5:=0D # C.g:312:9: '(' ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_declarato= r_suffix906)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_declarator_suffix906)=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_declarato= r_suffix908)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_declarator_suffix908)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3215,9 +3095,9 @@ class CParser(Parser): =0D # $ANTLR end declarator_suffix=0D =0D -=0D # $ANTLR start pointer=0D # C.g:315:1: pointer : ( '*' ( type_qualifier )+ ( pointer )? | '*' po= inter | '*' );=0D +=0D def pointer(self, ):=0D =0D pointer_StartIndex =3D self.input.index()=0D @@ -3230,69 +3110,73 @@ class CParser(Parser): alt38 =3D 3=0D LA38_0 =3D self.input.LA(1)=0D =0D - if (LA38_0 =3D=3D 66) :=0D + if (LA38_0 =3D=3D 66):=0D LA38 =3D self.input.LA(2)=0D if LA38 =3D=3D 66:=0D LA38_2 =3D self.input.LA(3)=0D =0D - if (self.synpred78()) :=0D + if (self.synpred78()):=0D alt38 =3D 2=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 2, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 2, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 58:=0D LA38_3 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 3, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 3, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 59:=0D LA38_4 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 4, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 4, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 60:=0D LA38_5 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 5, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 5, self.input)=0D =0D raise nvae=0D =0D @@ -3301,32 +3185,34 @@ class CParser(Parser): elif LA38 =3D=3D 53:=0D LA38_21 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 21, s= elf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 21, self.input)=0D =0D raise nvae=0D =0D elif LA38 =3D=3D 49 or LA38 =3D=3D 50 or LA38 =3D=3D 5= 1 or LA38 =3D=3D 52 or LA38 =3D=3D 54 or LA38 =3D=3D 55 or LA38 =3D=3D 56 o= r LA38 =3D=3D 57 or LA38 =3D=3D 61:=0D LA38_29 =3D self.input.LA(3)=0D =0D - if (self.synpred77()) :=0D + if (self.synpred77()):=0D alt38 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt38 =3D 3=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer = : ( '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 29, s= elf.input)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )= + ( pointer )? | '*' pointer | '*' );", 38, 29, self.input)=0D =0D raise nvae=0D =0D @@ -3335,7 +3221,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer : ( = '*' ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 1, self.i= nput)=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )+ ( = pointer )? | '*' pointer | '*' );", 38, 1, self.input)=0D =0D raise nvae=0D =0D @@ -3344,7 +3231,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("315:1: pointer : ( '*' = ( type_qualifier )+ ( pointer )? | '*' pointer | '*' );", 38, 0, self.input= )=0D + nvae =3D NoViableAltException(=0D + "315:1: pointer : ( '*' ( type_qualifier )+ ( poin= ter )? | '*' pointer | '*' );", 38, 0, self.input)=0D =0D raise nvae=0D =0D @@ -3355,57 +3243,51 @@ class CParser(Parser): return=0D # C.g:316:8: ( type_qualifier )+=0D cnt36 =3D 0=0D - while True: #loop36=0D + while True: # loop36=0D alt36 =3D 2=0D LA36 =3D self.input.LA(1)=0D if LA36 =3D=3D 58:=0D LA36_2 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 59:=0D LA36_3 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 60:=0D LA36_4 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 53:=0D LA36_20 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D elif LA36 =3D=3D 49 or LA36 =3D=3D 50 or LA36 =3D= =3D 51 or LA36 =3D=3D 52 or LA36 =3D=3D 54 or LA36 =3D=3D 55 or LA36 =3D=3D= 56 or LA36 =3D=3D 57 or LA36 =3D=3D 61:=0D LA36_28 =3D self.input.LA(2)=0D =0D - if (self.synpred75()) :=0D + if (self.synpred75()):=0D alt36 =3D 1=0D =0D -=0D -=0D if alt36 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifi= er_in_pointer921)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_pointer921)= =0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt36 >=3D 1:=0D - break #loop36=0D + break # loop36=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -3416,28 +3298,24 @@ class CParser(Parser): =0D cnt36 +=3D 1=0D =0D -=0D # C.g:316:24: ( pointer )?=0D alt37 =3D 2=0D LA37_0 =3D self.input.LA(1)=0D =0D - if (LA37_0 =3D=3D 66) :=0D + if (LA37_0 =3D=3D 66):=0D LA37_1 =3D self.input.LA(2)=0D =0D - if (self.synpred76()) :=0D + if (self.synpred76()):=0D alt37 =3D 1=0D if alt37 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_point= er924)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_pointer924)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt38 =3D=3D 2:=0D # C.g:317:4: '*' pointer=0D self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 0)=0D @@ -3449,15 +3327,12 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D elif alt38 =3D=3D 3:=0D # C.g:318:4: '*'=0D self.match(self.input, 66, self.FOLLOW_66_in_pointer93= 7)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3471,9 +3346,9 @@ class CParser(Parser): =0D # $ANTLR end pointer=0D =0D -=0D # $ANTLR start parameter_type_list=0D # C.g:321:1: parameter_type_list : parameter_list ( ',' ( 'OPTIONAL' )= ? '...' )? ;=0D +=0D def parameter_type_list(self, ):=0D =0D parameter_type_list_StartIndex =3D self.input.index()=0D @@ -3484,7 +3359,8 @@ class CParser(Parser): =0D # C.g:322:2: ( parameter_list ( ',' ( 'OPTIONAL' )? '...' = )? )=0D # C.g:322:4: parameter_list ( ',' ( 'OPTIONAL' )? '...' )?= =0D - self.following.append(self.FOLLOW_parameter_list_in_parame= ter_type_list948)=0D + self.following.append(=0D + self.FOLLOW_parameter_list_in_parameter_type_list948)= =0D self.parameter_list()=0D self.following.pop()=0D if self.failed:=0D @@ -3493,37 +3369,32 @@ class CParser(Parser): alt40 =3D 2=0D LA40_0 =3D self.input.LA(1)=0D =0D - if (LA40_0 =3D=3D 27) :=0D + if (LA40_0 =3D=3D 27):=0D alt40 =3D 1=0D if alt40 =3D=3D 1:=0D # C.g:322:20: ',' ( 'OPTIONAL' )? '...'=0D - self.match(self.input, 27, self.FOLLOW_27_in_parameter= _type_list951)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_parameter_type_list951)=0D if self.failed:=0D return=0D # C.g:322:24: ( 'OPTIONAL' )?=0D alt39 =3D 2=0D LA39_0 =3D self.input.LA(1)=0D =0D - if (LA39_0 =3D=3D 53) :=0D + if (LA39_0 =3D=3D 53):=0D alt39 =3D 1=0D if alt39 =3D=3D 1:=0D # C.g:322:25: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_param= eter_type_list954)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_type_list95= 4)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 67, self.FOLLOW_67_in_parameter= _type_list958)=0D + self.match(self.input, 67,=0D + self.FOLLOW_67_in_parameter_type_list958)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3537,9 +3408,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_type_list=0D =0D -=0D # $ANTLR start parameter_list=0D # C.g:325:1: parameter_list : parameter_declaration ( ',' ( 'OPTIONAL'= )? parameter_declaration )* ;=0D +=0D def parameter_list(self, ):=0D =0D parameter_list_StartIndex =3D self.input.index()=0D @@ -3550,68 +3421,60 @@ class CParser(Parser): =0D # C.g:326:2: ( parameter_declaration ( ',' ( 'OPTIONAL' )?= parameter_declaration )* )=0D # C.g:326:4: parameter_declaration ( ',' ( 'OPTIONAL' )? p= arameter_declaration )*=0D - self.following.append(self.FOLLOW_parameter_declaration_in= _parameter_list971)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_parameter_list971= )=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:326:26: ( ',' ( 'OPTIONAL' )? parameter_declaration = )*=0D - while True: #loop42=0D + while True: # loop42=0D alt42 =3D 2=0D LA42_0 =3D self.input.LA(1)=0D =0D - if (LA42_0 =3D=3D 27) :=0D + if (LA42_0 =3D=3D 27):=0D LA42_1 =3D self.input.LA(2)=0D =0D - if (LA42_1 =3D=3D 53) :=0D + if (LA42_1 =3D=3D 53):=0D LA42_3 =3D self.input.LA(3)=0D =0D - if (self.synpred82()) :=0D + if (self.synpred82()):=0D alt42 =3D 1=0D =0D -=0D - elif (LA42_1 =3D=3D IDENTIFIER or (29 <=3D LA42_1 = <=3D 42) or (45 <=3D LA42_1 <=3D 46) or (48 <=3D LA42_1 <=3D 52) or (54 <= =3D LA42_1 <=3D 61) or LA42_1 =3D=3D 66) :=0D + elif (LA42_1 =3D=3D IDENTIFIER or (29 <=3D LA42_1 = <=3D 42) or (45 <=3D LA42_1 <=3D 46) or (48 <=3D LA42_1 <=3D 52) or (54 <= =3D LA42_1 <=3D 61) or LA42_1 =3D=3D 66):=0D alt42 =3D 1=0D =0D -=0D -=0D -=0D if alt42 =3D=3D 1:=0D # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declar= ation=0D - self.match(self.input, 27, self.FOLLOW_27_in_param= eter_list974)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_parameter_list974)=0D if self.failed:=0D return=0D # C.g:326:31: ( 'OPTIONAL' )?=0D alt41 =3D 2=0D LA41_0 =3D self.input.LA(1)=0D =0D - if (LA41_0 =3D=3D 53) :=0D + if (LA41_0 =3D=3D 53):=0D LA41_1 =3D self.input.LA(2)=0D =0D - if (self.synpred81()) :=0D + if (self.synpred81()):=0D alt41 =3D 1=0D if alt41 =3D=3D 1:=0D # C.g:326:32: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_p= arameter_list977)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_list977= )=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_parameter_declar= ation_in_parameter_list981)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_parameter= _list981)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop42=0D -=0D -=0D -=0D -=0D -=0D + break # loop42=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -3626,9 +3489,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_list=0D =0D -=0D # $ANTLR start parameter_declaration=0D # C.g:329:1: parameter_declaration : ( declaration_specifiers ( declar= ator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );= =0D +=0D def parameter_declaration(self, ):=0D =0D parameter_declaration_StartIndex =3D self.input.index()=0D @@ -3645,16 +3508,17 @@ class CParser(Parser): elif LA46 =3D=3D IDENTIFIER:=0D LA46_13 =3D self.input.LA(2)=0D =0D - if (self.synpred86()) :=0D + if (self.synpred86()):=0D alt46 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt46 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("329:1: parameter_de= claration : ( declaration_specifiers ( declarator | abstract_declarator )* = ( 'OPTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 13, self.input)=0D + nvae =3D NoViableAltException(=0D + "329:1: parameter_declaration : ( declaration_= specifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointe= r )* IDENTIFIER );", 46, 13, self.input)=0D =0D raise nvae=0D =0D @@ -3665,30 +3529,31 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("329:1: parameter_declar= ation : ( declaration_specifiers ( declarator | abstract_declarator )* ( 'O= PTIONAL' )? | ( pointer )* IDENTIFIER );", 46, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "329:1: parameter_declaration : ( declaration_spec= ifiers ( declarator | abstract_declarator )* ( 'OPTIONAL' )? | ( pointer )*= IDENTIFIER );", 46, 0, self.input)=0D =0D raise nvae=0D =0D if alt46 =3D=3D 1:=0D # C.g:330:4: declaration_specifiers ( declarator | abs= tract_declarator )* ( 'OPTIONAL' )?=0D - self.following.append(self.FOLLOW_declaration_specifie= rs_in_parameter_declaration994)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_parameter_de= claration994)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:330:27: ( declarator | abstract_declarator )*=0D - while True: #loop43=0D + while True: # loop43=0D alt43 =3D 3=0D LA43 =3D self.input.LA(1)=0D if LA43 =3D=3D 66:=0D LA43_5 =3D self.input.LA(2)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D IDENTIFIER or LA43 =3D=3D 58 or L= A43 =3D=3D 59 or LA43 =3D=3D 60:=0D alt43 =3D 1=0D elif LA43 =3D=3D 62:=0D @@ -3698,129 +3563,115 @@ class CParser(Parser): elif LA43 =3D=3D IDENTIFIER:=0D LA43_37 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 58:=0D LA43_38 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 66:=0D LA43_39 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 59:=0D LA43_40 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 60:=0D LA43_41 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D elif LA43 =3D=3D 62:=0D LA43_43 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt43 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt43 =3D 2=0D =0D -=0D -=0D elif LA43 =3D=3D 64:=0D alt43 =3D 2=0D =0D if alt43 =3D=3D 1:=0D # C.g:330:28: declarator=0D - self.following.append(self.FOLLOW_declarator_i= n_parameter_declaration997)=0D + self.following.append(=0D + self.FOLLOW_declarator_in_parameter_declar= ation997)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt43 =3D=3D 2:=0D # C.g:330:39: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_dec= larator_in_parameter_declaration999)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_paramet= er_declaration999)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop43=0D -=0D + break # loop43=0D =0D # C.g:330:61: ( 'OPTIONAL' )?=0D alt44 =3D 2=0D LA44_0 =3D self.input.LA(1)=0D =0D - if (LA44_0 =3D=3D 53) :=0D + if (LA44_0 =3D=3D 53):=0D alt44 =3D 1=0D if alt44 =3D=3D 1:=0D # C.g:330:62: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_param= eter_declaration1004)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_parameter_declaration= 1004)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt46 =3D=3D 2:=0D # C.g:332:4: ( pointer )* IDENTIFIER=0D # C.g:332:4: ( pointer )*=0D - while True: #loop45=0D + while True: # loop45=0D alt45 =3D 2=0D LA45_0 =3D self.input.LA(1)=0D =0D - if (LA45_0 =3D=3D 66) :=0D + if (LA45_0 =3D=3D 66):=0D alt45 =3D 1=0D =0D -=0D if alt45 =3D=3D 1:=0D # C.g:0:0: pointer=0D - self.following.append(self.FOLLOW_pointer_in_p= arameter_declaration1013)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_parameter_declarati= on1013)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop45=0D + break # loop45=0D =0D -=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_parameter_declaration1016)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_parameter_declara= tion1016)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3834,9 +3685,9 @@ class CParser(Parser): =0D # $ANTLR end parameter_declaration=0D =0D -=0D # $ANTLR start identifier_list=0D # C.g:335:1: identifier_list : IDENTIFIER ( ',' IDENTIFIER )* ;=0D +=0D def identifier_list(self, ):=0D =0D identifier_list_StartIndex =3D self.input.index()=0D @@ -3847,35 +3698,31 @@ class CParser(Parser): =0D # C.g:336:2: ( IDENTIFIER ( ',' IDENTIFIER )* )=0D # C.g:336:4: IDENTIFIER ( ',' IDENTIFIER )*=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_identifier_list1027)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_identifier_list1027)= =0D if self.failed:=0D return=0D # C.g:337:2: ( ',' IDENTIFIER )*=0D - while True: #loop47=0D + while True: # loop47=0D alt47 =3D 2=0D LA47_0 =3D self.input.LA(1)=0D =0D - if (LA47_0 =3D=3D 27) :=0D + if (LA47_0 =3D=3D 27):=0D alt47 =3D 1=0D =0D -=0D if alt47 =3D=3D 1:=0D # C.g:337:3: ',' IDENTIFIER=0D - self.match(self.input, 27, self.FOLLOW_27_in_ident= ifier_list1031)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_identifier_list1031)= =0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_identifier_list1033)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_identifier_li= st1033)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop47=0D -=0D -=0D -=0D -=0D -=0D + break # loop47=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -3890,9 +3737,9 @@ class CParser(Parser): =0D # $ANTLR end identifier_list=0D =0D -=0D # $ANTLR start type_name=0D # C.g:340:1: type_name : ( specifier_qualifier_list ( abstract_declara= tor )? | type_id );=0D +=0D def type_name(self, ):=0D =0D type_name_StartIndex =3D self.input.index()=0D @@ -3905,21 +3752,22 @@ class CParser(Parser): alt49 =3D 2=0D LA49_0 =3D self.input.LA(1)=0D =0D - if ((34 <=3D LA49_0 <=3D 42) or (45 <=3D LA49_0 <=3D 46) o= r (48 <=3D LA49_0 <=3D 61)) :=0D + if ((34 <=3D LA49_0 <=3D 42) or (45 <=3D LA49_0 <=3D 46) o= r (48 <=3D LA49_0 <=3D 61)):=0D alt49 =3D 1=0D - elif (LA49_0 =3D=3D IDENTIFIER) :=0D + elif (LA49_0 =3D=3D IDENTIFIER):=0D LA49_13 =3D self.input.LA(2)=0D =0D - if (self.synpred90()) :=0D + if (self.synpred90()):=0D alt49 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt49 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("340:1: type_name : = ( specifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 13, = self.input)=0D + nvae =3D NoViableAltException(=0D + "340:1: type_name : ( specifier_qualifier_list= ( abstract_declarator )? | type_id );", 49, 13, self.input)=0D =0D raise nvae=0D =0D @@ -3928,13 +3776,15 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("340:1: type_name : ( sp= ecifier_qualifier_list ( abstract_declarator )? | type_id );", 49, 0, self.= input)=0D + nvae =3D NoViableAltException(=0D + "340:1: type_name : ( specifier_qualifier_list ( a= bstract_declarator )? | type_id );", 49, 0, self.input)=0D =0D raise nvae=0D =0D if alt49 =3D=3D 1:=0D # C.g:341:4: specifier_qualifier_list ( abstract_decla= rator )?=0D - self.following.append(self.FOLLOW_specifier_qualifier_= list_in_type_name1046)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_type_name1= 046)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D @@ -3943,20 +3793,17 @@ class CParser(Parser): alt48 =3D 2=0D LA48_0 =3D self.input.LA(1)=0D =0D - if (LA48_0 =3D=3D 62 or LA48_0 =3D=3D 64 or LA48_0 =3D= =3D 66) :=0D + if (LA48_0 =3D=3D 62 or LA48_0 =3D=3D 64 or LA48_0 =3D= =3D 66):=0D alt48 =3D 1=0D if alt48 =3D=3D 1:=0D # C.g:0:0: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declara= tor_in_type_name1048)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_type_name10= 48)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt49 =3D=3D 2:=0D # C.g:342:4: type_id=0D self.following.append(self.FOLLOW_type_id_in_type_name= 1054)=0D @@ -3965,8 +3812,6 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -3980,9 +3825,9 @@ class CParser(Parser): =0D # $ANTLR end type_name=0D =0D -=0D # $ANTLR start abstract_declarator=0D # C.g:345:1: abstract_declarator : ( pointer ( direct_abstract_declara= tor )? | direct_abstract_declarator );=0D +=0D def abstract_declarator(self, ):=0D =0D abstract_declarator_StartIndex =3D self.input.index()=0D @@ -3995,22 +3840,24 @@ class CParser(Parser): alt51 =3D 2=0D LA51_0 =3D self.input.LA(1)=0D =0D - if (LA51_0 =3D=3D 66) :=0D + if (LA51_0 =3D=3D 66):=0D alt51 =3D 1=0D - elif (LA51_0 =3D=3D 62 or LA51_0 =3D=3D 64) :=0D + elif (LA51_0 =3D=3D 62 or LA51_0 =3D=3D 64):=0D alt51 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("345:1: abstract_declara= tor : ( pointer ( direct_abstract_declarator )? | direct_abstract_declarato= r );", 51, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "345:1: abstract_declarator : ( pointer ( direct_a= bstract_declarator )? | direct_abstract_declarator );", 51, 0, self.input)= =0D =0D raise nvae=0D =0D if alt51 =3D=3D 1:=0D # C.g:346:4: pointer ( direct_abstract_declarator )?=0D - self.following.append(self.FOLLOW_pointer_in_abstract_= declarator1065)=0D + self.following.append(=0D + self.FOLLOW_pointer_in_abstract_declarator1065)=0D self.pointer()=0D self.following.pop()=0D if self.failed:=0D @@ -4019,202 +3866,198 @@ class CParser(Parser): alt50 =3D 2=0D LA50_0 =3D self.input.LA(1)=0D =0D - if (LA50_0 =3D=3D 62) :=0D + if (LA50_0 =3D=3D 62):=0D LA50 =3D self.input.LA(2)=0D if LA50 =3D=3D 63:=0D LA50_12 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 58:=0D LA50_13 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 66:=0D LA50_14 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 59:=0D LA50_15 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 60:=0D LA50_16 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D IDENTIFIER:=0D LA50_17 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 62:=0D LA50_18 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 64:=0D LA50_19 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 29 or LA50 =3D=3D 30 or LA50 =3D= =3D 31 or LA50 =3D=3D 32 or LA50 =3D=3D 33:=0D LA50_20 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 34:=0D LA50_21 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 35:=0D LA50_22 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 36:=0D LA50_23 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 37:=0D LA50_24 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 38:=0D LA50_25 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 39:=0D LA50_26 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 40:=0D LA50_27 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 41:=0D LA50_28 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 42:=0D LA50_29 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 45 or LA50 =3D=3D 46:=0D LA50_30 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 48:=0D LA50_31 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 49 or LA50 =3D=3D 50 or LA50 =3D= =3D 51 or LA50 =3D=3D 52 or LA50 =3D=3D 53 or LA50 =3D=3D 54 or LA50 =3D=3D= 55 or LA50 =3D=3D 56 or LA50 =3D=3D 57 or LA50 =3D=3D 61:=0D LA50_32 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D - elif (LA50_0 =3D=3D 64) :=0D + elif (LA50_0 =3D=3D 64):=0D LA50 =3D self.input.LA(2)=0D if LA50 =3D=3D 65:=0D LA50_33 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 62:=0D LA50_34 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D IDENTIFIER:=0D LA50_35 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D HEX_LITERAL:=0D LA50_36 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D OCTAL_LITERAL:=0D LA50_37 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D DECIMAL_LITERAL:=0D LA50_38 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D CHARACTER_LITERAL:=0D LA50_39 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D STRING_LITERAL:=0D LA50_40 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D FLOATING_POINT_LITERAL:=0D LA50_41 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 72:=0D LA50_42 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 73:=0D LA50_43 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 66 or LA50 =3D=3D 68 or LA50 =3D= =3D 69 or LA50 =3D=3D 77 or LA50 =3D=3D 78 or LA50 =3D=3D 79:=0D LA50_44 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D elif LA50 =3D=3D 74:=0D LA50_45 =3D self.input.LA(3)=0D =0D - if (self.synpred91()) :=0D + if (self.synpred91()):=0D alt50 =3D 1=0D if alt50 =3D=3D 1:=0D # C.g:0:0: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_= declarator_in_abstract_declarator1067)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_abst= ract_declarator1067)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt51 =3D=3D 2:=0D # C.g:347:4: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_decl= arator_in_abstract_declarator1073)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_abstract= _declarator1073)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -4228,9 +4071,9 @@ class CParser(Parser): =0D # $ANTLR end abstract_declarator=0D =0D -=0D # $ANTLR start direct_abstract_declarator=0D # C.g:350:1: direct_abstract_declarator : ( '(' abstract_declarator ')= ' | abstract_declarator_suffix ) ( abstract_declarator_suffix )* ;=0D +=0D def direct_abstract_declarator(self, ):=0D =0D direct_abstract_declarator_StartIndex =3D self.input.index()=0D @@ -4245,23 +4088,24 @@ class CParser(Parser): alt52 =3D 2=0D LA52_0 =3D self.input.LA(1)=0D =0D - if (LA52_0 =3D=3D 62) :=0D + if (LA52_0 =3D=3D 62):=0D LA52 =3D self.input.LA(2)=0D if LA52 =3D=3D IDENTIFIER or LA52 =3D=3D 29 or LA52 = =3D=3D 30 or LA52 =3D=3D 31 or LA52 =3D=3D 32 or LA52 =3D=3D 33 or LA52 =3D= =3D 34 or LA52 =3D=3D 35 or LA52 =3D=3D 36 or LA52 =3D=3D 37 or LA52 =3D=3D= 38 or LA52 =3D=3D 39 or LA52 =3D=3D 40 or LA52 =3D=3D 41 or LA52 =3D=3D 42= or LA52 =3D=3D 45 or LA52 =3D=3D 46 or LA52 =3D=3D 48 or LA52 =3D=3D 49 or= LA52 =3D=3D 50 or LA52 =3D=3D 51 or LA52 =3D=3D 52 or LA52 =3D=3D 53 or LA= 52 =3D=3D 54 or LA52 =3D=3D 55 or LA52 =3D=3D 56 or LA52 =3D=3D 57 or LA52 = =3D=3D 58 or LA52 =3D=3D 59 or LA52 =3D=3D 60 or LA52 =3D=3D 61 or LA52 =3D= =3D 63:=0D alt52 =3D 2=0D elif LA52 =3D=3D 66:=0D LA52_18 =3D self.input.LA(3)=0D =0D - if (self.synpred93()) :=0D + if (self.synpred93()):=0D alt52 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt52 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' ab= stract_declarator ')' | abstract_declarator_suffix )", 52, 18, self.input)= =0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | ab= stract_declarator_suffix )", 52, 18, self.input)=0D =0D raise nvae=0D =0D @@ -4272,306 +4116,269 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' abstra= ct_declarator ')' | abstract_declarator_suffix )", 52, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | abstra= ct_declarator_suffix )", 52, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA52_0 =3D=3D 64) :=0D + elif (LA52_0 =3D=3D 64):=0D alt52 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("351:4: ( '(' abstract_d= eclarator ')' | abstract_declarator_suffix )", 52, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "351:4: ( '(' abstract_declarator ')' | abstract_d= eclarator_suffix )", 52, 0, self.input)=0D =0D raise nvae=0D =0D if alt52 =3D=3D 1:=0D # C.g:351:6: '(' abstract_declarator ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_direct_ab= stract_declarator1086)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_direct_abstract_= declarator1086)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_abstract_declarator_= in_direct_abstract_declarator1088)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_direct_abstract= _declarator1088)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_direct_ab= stract_declarator1090)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_direct_abstract_= declarator1090)=0D if self.failed:=0D return=0D =0D -=0D elif alt52 =3D=3D 2:=0D # C.g:351:36: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declarator_= suffix_in_direct_abstract_declarator1094)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_direct_a= bstract_declarator1094)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:351:65: ( abstract_declarator_suffix )*=0D - while True: #loop53=0D + while True: # loop53=0D alt53 =3D 2=0D LA53_0 =3D self.input.LA(1)=0D =0D - if (LA53_0 =3D=3D 62) :=0D + if (LA53_0 =3D=3D 62):=0D LA53 =3D self.input.LA(2)=0D if LA53 =3D=3D 63:=0D LA53_12 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 58:=0D LA53_13 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 66:=0D LA53_14 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 59:=0D LA53_15 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 60:=0D LA53_16 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D IDENTIFIER:=0D LA53_17 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 29 or LA53 =3D=3D 30 or LA53 =3D= =3D 31 or LA53 =3D=3D 32 or LA53 =3D=3D 33:=0D LA53_19 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 34:=0D LA53_20 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 35:=0D LA53_21 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 36:=0D LA53_22 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 37:=0D LA53_23 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 38:=0D LA53_24 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 39:=0D LA53_25 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 40:=0D LA53_26 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 41:=0D LA53_27 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 42:=0D LA53_28 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 45 or LA53 =3D=3D 46:=0D LA53_29 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 48:=0D LA53_30 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 49 or LA53 =3D=3D 50 or LA53 =3D= =3D 51 or LA53 =3D=3D 52 or LA53 =3D=3D 53 or LA53 =3D=3D 54 or LA53 =3D=3D= 55 or LA53 =3D=3D 56 or LA53 =3D=3D 57 or LA53 =3D=3D 61:=0D LA53_31 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D -=0D - elif (LA53_0 =3D=3D 64) :=0D + elif (LA53_0 =3D=3D 64):=0D LA53 =3D self.input.LA(2)=0D if LA53 =3D=3D 65:=0D LA53_33 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 62:=0D LA53_34 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D IDENTIFIER:=0D LA53_35 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D HEX_LITERAL:=0D LA53_36 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D OCTAL_LITERAL:=0D LA53_37 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D DECIMAL_LITERAL:=0D LA53_38 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D CHARACTER_LITERAL:=0D LA53_39 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D STRING_LITERAL:=0D LA53_40 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D FLOATING_POINT_LITERAL:=0D LA53_41 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 72:=0D LA53_42 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 73:=0D LA53_43 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 66 or LA53 =3D=3D 68 or LA53 =3D= =3D 69 or LA53 =3D=3D 77 or LA53 =3D=3D 78 or LA53 =3D=3D 79:=0D LA53_44 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D elif LA53 =3D=3D 74:=0D LA53_45 =3D self.input.LA(3)=0D =0D - if (self.synpred94()) :=0D + if (self.synpred94()):=0D alt53 =3D 1=0D =0D -=0D -=0D -=0D -=0D if alt53 =3D=3D 1:=0D # C.g:0:0: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declara= tor_suffix_in_direct_abstract_declarator1098)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_dire= ct_abstract_declarator1098)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop53=0D -=0D -=0D -=0D -=0D -=0D + break # loop53=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 32, direct_abstract_declarator_St= artIndex)=0D + self.memoize(self.input, 32,=0D + direct_abstract_declarator_StartIndex)=0D =0D pass=0D =0D @@ -4579,9 +4386,9 @@ class CParser(Parser): =0D # $ANTLR end direct_abstract_declarator=0D =0D -=0D # $ANTLR start abstract_declarator_suffix=0D # C.g:354:1: abstract_declarator_suffix : ( '[' ']' | '[' constant_exp= ression ']' | '(' ')' | '(' parameter_type_list ')' );=0D +=0D def abstract_declarator_suffix(self, ):=0D =0D abstract_declarator_suffix_StartIndex =3D self.input.index()=0D @@ -4594,35 +4401,37 @@ class CParser(Parser): alt54 =3D 4=0D LA54_0 =3D self.input.LA(1)=0D =0D - if (LA54_0 =3D=3D 64) :=0D + if (LA54_0 =3D=3D 64):=0D LA54_1 =3D self.input.LA(2)=0D =0D - if (LA54_1 =3D=3D 65) :=0D + if (LA54_1 =3D=3D 65):=0D alt54 =3D 1=0D - elif ((IDENTIFIER <=3D LA54_1 <=3D FLOATING_POINT_LITE= RAL) or LA54_1 =3D=3D 62 or LA54_1 =3D=3D 66 or (68 <=3D LA54_1 <=3D 69) or= (72 <=3D LA54_1 <=3D 74) or (77 <=3D LA54_1 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA54_1 <=3D FLOATING_POINT_LITE= RAL) or LA54_1 =3D=3D 62 or LA54_1 =3D=3D 66 or (68 <=3D LA54_1 <=3D 69) or= (72 <=3D LA54_1 <=3D 74) or (77 <=3D LA54_1 <=3D 79)):=0D alt54 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']'= | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );",= 54, 1, self.input)=0D =0D raise nvae=0D =0D - elif (LA54_0 =3D=3D 62) :=0D + elif (LA54_0 =3D=3D 62):=0D LA54_2 =3D self.input.LA(2)=0D =0D - if (LA54_2 =3D=3D 63) :=0D + if (LA54_2 =3D=3D 63):=0D alt54 =3D 3=0D - elif (LA54_2 =3D=3D IDENTIFIER or (29 <=3D LA54_2 <=3D= 42) or (45 <=3D LA54_2 <=3D 46) or (48 <=3D LA54_2 <=3D 61) or LA54_2 =3D= =3D 66) :=0D + elif (LA54_2 =3D=3D IDENTIFIER or (29 <=3D LA54_2 <=3D= 42) or (45 <=3D LA54_2 <=3D 46) or (48 <=3D LA54_2 <=3D 61) or LA54_2 =3D= =3D 66):=0D alt54 =3D 4=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_dec= larator_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' pa= rameter_type_list ')' );", 54, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']'= | '[' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );",= 54, 2, self.input)=0D =0D raise nvae=0D =0D @@ -4631,67 +4440,74 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("354:1: abstract_declara= tor_suffix : ( '[' ']' | '[' constant_expression ']' | '(' ')' | '(' parame= ter_type_list ')' );", 54, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "354:1: abstract_declarator_suffix : ( '[' ']' | '= [' constant_expression ']' | '(' ')' | '(' parameter_type_list ')' );", 54,= 0, self.input)=0D =0D raise nvae=0D =0D if alt54 =3D=3D 1:=0D # C.g:355:4: '[' ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1110)=0D + self.match(=0D + self.input, 64, self.FOLLOW_64_in_abstract_declara= tor_suffix1110)=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1112)=0D + self.match(=0D + self.input, 65, self.FOLLOW_65_in_abstract_declara= tor_suffix1112)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 2:=0D # C.g:356:4: '[' constant_expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_abstract_= declarator_suffix1117)=0D + self.match(=0D + self.input, 64, self.FOLLOW_64_in_abstract_declara= tor_suffix1117)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_abstract_declarator_suffix1119)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_abstract_declar= ator_suffix1119)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_abstract_= declarator_suffix1121)=0D + self.match(=0D + self.input, 65, self.FOLLOW_65_in_abstract_declara= tor_suffix1121)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 3:=0D # C.g:357:4: '(' ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1126)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_abstract_declara= tor_suffix1126)=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1128)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_abstract_declara= tor_suffix1128)=0D if self.failed:=0D return=0D =0D -=0D elif alt54 =3D=3D 4:=0D # C.g:358:4: '(' parameter_type_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_abstract_= declarator_suffix1133)=0D + self.match(=0D + self.input, 62, self.FOLLOW_62_in_abstract_declara= tor_suffix1133)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_type_list_= in_abstract_declarator_suffix1135)=0D + self.following.append(=0D + self.FOLLOW_parameter_type_list_in_abstract_declar= ator_suffix1135)=0D self.parameter_type_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_abstract_= declarator_suffix1137)=0D + self.match(=0D + self.input, 63, self.FOLLOW_63_in_abstract_declara= tor_suffix1137)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 33, abstract_declarator_suffix_St= artIndex)=0D + self.memoize(self.input, 33,=0D + abstract_declarator_suffix_StartIndex)=0D =0D pass=0D =0D @@ -4699,9 +4515,9 @@ class CParser(Parser): =0D # $ANTLR end abstract_declarator_suffix=0D =0D -=0D # $ANTLR start initializer=0D # C.g:361:1: initializer : ( assignment_expression | '{' initializer_l= ist ( ',' )? '}' );=0D +=0D def initializer(self, ):=0D =0D initializer_StartIndex =3D self.input.index()=0D @@ -4714,34 +4530,37 @@ class CParser(Parser): alt56 =3D 2=0D LA56_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA56_0 <=3D FLOATING_POINT_LITERAL) o= r LA56_0 =3D=3D 62 or LA56_0 =3D=3D 66 or (68 <=3D LA56_0 <=3D 69) or (72 <= =3D LA56_0 <=3D 74) or (77 <=3D LA56_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA56_0 <=3D FLOATING_POINT_LITERAL) o= r LA56_0 =3D=3D 62 or LA56_0 =3D=3D 66 or (68 <=3D LA56_0 <=3D 69) or (72 <= =3D LA56_0 <=3D 74) or (77 <=3D LA56_0 <=3D 79)):=0D alt56 =3D 1=0D - elif (LA56_0 =3D=3D 43) :=0D + elif (LA56_0 =3D=3D 43):=0D alt56 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("361:1: initializer : ( = assignment_expression | '{' initializer_list ( ',' )? '}' );", 56, 0, self.= input)=0D + nvae =3D NoViableAltException(=0D + "361:1: initializer : ( assignment_expression | '{= ' initializer_list ( ',' )? '}' );", 56, 0, self.input)=0D =0D raise nvae=0D =0D if alt56 =3D=3D 1:=0D # C.g:363:4: assignment_expression=0D - self.following.append(self.FOLLOW_assignment_expressio= n_in_initializer1150)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_initializer11= 50)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt56 =3D=3D 2:=0D # C.g:364:4: '{' initializer_list ( ',' )? '}'=0D - self.match(self.input, 43, self.FOLLOW_43_in_initializ= er1155)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_initializer1155)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_list_in_= initializer1157)=0D + self.following.append(=0D + self.FOLLOW_initializer_list_in_initializer1157)=0D self.initializer_list()=0D self.following.pop()=0D if self.failed:=0D @@ -4750,22 +4569,20 @@ class CParser(Parser): alt55 =3D 2=0D LA55_0 =3D self.input.LA(1)=0D =0D - if (LA55_0 =3D=3D 27) :=0D + if (LA55_0 =3D=3D 27):=0D alt55 =3D 1=0D if alt55 =3D=3D 1:=0D # C.g:0:0: ','=0D - self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer1159)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_initializer1159)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_initializ= er1162)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_initializer1162)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -4779,9 +4596,9 @@ class CParser(Parser): =0D # $ANTLR end initializer=0D =0D -=0D # $ANTLR start initializer_list=0D # C.g:367:1: initializer_list : initializer ( ',' initializer )* ;=0D +=0D def initializer_list(self, ):=0D =0D initializer_list_StartIndex =3D self.input.index()=0D @@ -4792,44 +4609,38 @@ class CParser(Parser): =0D # C.g:368:2: ( initializer ( ',' initializer )* )=0D # C.g:368:4: initializer ( ',' initializer )*=0D - self.following.append(self.FOLLOW_initializer_in_initializ= er_list1173)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_initializer_list1173)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:368:16: ( ',' initializer )*=0D - while True: #loop57=0D + while True: # loop57=0D alt57 =3D 2=0D LA57_0 =3D self.input.LA(1)=0D =0D - if (LA57_0 =3D=3D 27) :=0D + if (LA57_0 =3D=3D 27):=0D LA57_1 =3D self.input.LA(2)=0D =0D - if ((IDENTIFIER <=3D LA57_1 <=3D FLOATING_POINT_LI= TERAL) or LA57_1 =3D=3D 43 or LA57_1 =3D=3D 62 or LA57_1 =3D=3D 66 or (68 <= =3D LA57_1 <=3D 69) or (72 <=3D LA57_1 <=3D 74) or (77 <=3D LA57_1 <=3D 79)= ) :=0D + if ((IDENTIFIER <=3D LA57_1 <=3D FLOATING_POINT_LI= TERAL) or LA57_1 =3D=3D 43 or LA57_1 =3D=3D 62 or LA57_1 =3D=3D 66 or (68 <= =3D LA57_1 <=3D 69) or (72 <=3D LA57_1 <=3D 74) or (77 <=3D LA57_1 <=3D 79)= ):=0D alt57 =3D 1=0D =0D -=0D -=0D -=0D if alt57 =3D=3D 1:=0D # C.g:368:17: ',' initializer=0D - self.match(self.input, 27, self.FOLLOW_27_in_initi= alizer_list1176)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_initializer_list1176)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_initializer_in_i= nitializer_list1178)=0D + self.following.append(=0D + self.FOLLOW_initializer_in_initializer_list117= 8)=0D self.initializer()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop57=0D -=0D -=0D -=0D -=0D -=0D + break # loop57=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -4849,10 +4660,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start argument_expression_list=0D # C.g:373:1: argument_expression_list : assignment_expression ( 'OPTIO= NAL' )? ( ',' assignment_expression ( 'OPTIONAL' )? )* ;=0D +=0D def argument_expression_list(self, ):=0D =0D retval =3D self.argument_expression_list_return()=0D @@ -4865,7 +4675,8 @@ class CParser(Parser): =0D # C.g:374:2: ( assignment_expression ( 'OPTIONAL' )? ( ','= assignment_expression ( 'OPTIONAL' )? )* )=0D # C.g:374:6: assignment_expression ( 'OPTIONAL' )? ( ',' a= ssignment_expression ( 'OPTIONAL' )? )*=0D - self.following.append(self.FOLLOW_assignment_expression_in= _argument_expression_list1196)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_argument_expressi= on_list1196)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -4874,31 +4685,31 @@ class CParser(Parser): alt58 =3D 2=0D LA58_0 =3D self.input.LA(1)=0D =0D - if (LA58_0 =3D=3D 53) :=0D + if (LA58_0 =3D=3D 53):=0D alt58 =3D 1=0D if alt58 =3D=3D 1:=0D # C.g:374:29: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_argument_= expression_list1199)=0D + self.match(self.input, 53,=0D + self.FOLLOW_53_in_argument_expression_list1= 199)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D # C.g:374:42: ( ',' assignment_expression ( 'OPTIONAL' )? = )*=0D - while True: #loop60=0D + while True: # loop60=0D alt60 =3D 2=0D LA60_0 =3D self.input.LA(1)=0D =0D - if (LA60_0 =3D=3D 27) :=0D + if (LA60_0 =3D=3D 27):=0D alt60 =3D 1=0D =0D -=0D if alt60 =3D=3D 1:=0D # C.g:374:43: ',' assignment_expression ( 'OPTIONA= L' )?=0D - self.match(self.input, 27, self.FOLLOW_27_in_argum= ent_expression_list1204)=0D + self.match(=0D + self.input, 27, self.FOLLOW_27_in_argument_exp= ression_list1204)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_assignment_expre= ssion_in_argument_expression_list1206)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_argument_= expression_list1206)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -4907,34 +4718,27 @@ class CParser(Parser): alt59 =3D 2=0D LA59_0 =3D self.input.LA(1)=0D =0D - if (LA59_0 =3D=3D 53) :=0D + if (LA59_0 =3D=3D 53):=0D alt59 =3D 1=0D if alt59 =3D=3D 1:=0D # C.g:374:70: 'OPTIONAL'=0D - self.match(self.input, 53, self.FOLLOW_53_in_a= rgument_expression_list1209)=0D + self.match(=0D + self.input, 53, self.FOLLOW_53_in_argument= _expression_list1209)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D -=0D -=0D else:=0D - break #loop60=0D -=0D -=0D -=0D -=0D + break # loop60=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 36, argument_expression_list_Star= tIndex)=0D + self.memoize(self.input, 36,=0D + argument_expression_list_StartIndex)=0D =0D pass=0D =0D @@ -4942,9 +4746,9 @@ class CParser(Parser): =0D # $ANTLR end argument_expression_list=0D =0D -=0D # $ANTLR start additive_expression=0D # C.g:377:1: additive_expression : ( multiplicative_expression ) ( '+'= multiplicative_expression | '-' multiplicative_expression )* ;=0D +=0D def additive_expression(self, ):=0D =0D additive_expression_StartIndex =3D self.input.index()=0D @@ -4957,56 +4761,51 @@ class CParser(Parser): # C.g:378:4: ( multiplicative_expression ) ( '+' multiplic= ative_expression | '-' multiplicative_expression )*=0D # C.g:378:4: ( multiplicative_expression )=0D # C.g:378:5: multiplicative_expression=0D - self.following.append(self.FOLLOW_multiplicative_expressio= n_in_additive_expression1225)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_additive_expr= ession1225)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:378:32: ( '+' multiplicative_expression | '-' multip= licative_expression )*=0D - while True: #loop61=0D + while True: # loop61=0D alt61 =3D 3=0D LA61_0 =3D self.input.LA(1)=0D =0D - if (LA61_0 =3D=3D 68) :=0D + if (LA61_0 =3D=3D 68):=0D alt61 =3D 1=0D - elif (LA61_0 =3D=3D 69) :=0D + elif (LA61_0 =3D=3D 69):=0D alt61 =3D 2=0D =0D -=0D if alt61 =3D=3D 1:=0D # C.g:378:33: '+' multiplicative_expression=0D - self.match(self.input, 68, self.FOLLOW_68_in_addit= ive_expression1229)=0D + self.match(self.input, 68,=0D + self.FOLLOW_68_in_additive_expression12= 29)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1231)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_addit= ive_expression1231)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt61 =3D=3D 2:=0D # C.g:378:65: '-' multiplicative_expression=0D - self.match(self.input, 69, self.FOLLOW_69_in_addit= ive_expression1235)=0D + self.match(self.input, 69,=0D + self.FOLLOW_69_in_additive_expression12= 35)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_multiplicative_e= xpression_in_additive_expression1237)=0D + self.following.append(=0D + self.FOLLOW_multiplicative_expression_in_addit= ive_expression1237)=0D self.multiplicative_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop61=0D -=0D -=0D -=0D -=0D -=0D + break # loop61=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5021,9 +4820,9 @@ class CParser(Parser): =0D # $ANTLR end additive_expression=0D =0D -=0D # $ANTLR start multiplicative_expression=0D # C.g:381:1: multiplicative_expression : ( cast_expression ) ( '*' cas= t_expression | '/' cast_expression | '%' cast_expression )* ;=0D +=0D def multiplicative_expression(self, ):=0D =0D multiplicative_expression_StartIndex =3D self.input.index()=0D @@ -5036,16 +4835,15 @@ class CParser(Parser): # C.g:382:4: ( cast_expression ) ( '*' cast_expression | '= /' cast_expression | '%' cast_expression )*=0D # C.g:382:4: ( cast_expression )=0D # C.g:382:5: cast_expression=0D - self.following.append(self.FOLLOW_cast_expression_in_multi= plicative_expression1251)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_expressi= on1251)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:382:22: ( '*' cast_expression | '/' cast_expression = | '%' cast_expression )*=0D - while True: #loop62=0D + while True: # loop62=0D alt62 =3D 4=0D LA62 =3D self.input.LA(1)=0D if LA62 =3D=3D 66:=0D @@ -5057,54 +4855,53 @@ class CParser(Parser): =0D if alt62 =3D=3D 1:=0D # C.g:382:23: '*' cast_expression=0D - self.match(self.input, 66, self.FOLLOW_66_in_multi= plicative_expression1255)=0D + self.match(=0D + self.input, 66, self.FOLLOW_66_in_multiplicati= ve_expression1255)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1257)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1257)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt62 =3D=3D 2:=0D # C.g:382:45: '/' cast_expression=0D - self.match(self.input, 70, self.FOLLOW_70_in_multi= plicative_expression1261)=0D + self.match(=0D + self.input, 70, self.FOLLOW_70_in_multiplicati= ve_expression1261)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1263)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1263)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt62 =3D=3D 3:=0D # C.g:382:67: '%' cast_expression=0D - self.match(self.input, 71, self.FOLLOW_71_in_multi= plicative_expression1267)=0D + self.match(=0D + self.input, 71, self.FOLLOW_71_in_multiplicati= ve_expression1267)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_= in_multiplicative_expression1269)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_multiplicative_= expression1269)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop62=0D -=0D -=0D -=0D -=0D -=0D + break # loop62=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 38, multiplicative_expression_Sta= rtIndex)=0D + self.memoize(self.input, 38,=0D + multiplicative_expression_StartIndex)=0D =0D pass=0D =0D @@ -5112,9 +4909,9 @@ class CParser(Parser): =0D # $ANTLR end multiplicative_expression=0D =0D -=0D # $ANTLR start cast_expression=0D # C.g:385:1: cast_expression : ( '(' type_name ')' cast_expression | u= nary_expression );=0D +=0D def cast_expression(self, ):=0D =0D cast_expression_StartIndex =3D self.input.index()=0D @@ -5127,23 +4924,24 @@ class CParser(Parser): alt63 =3D 2=0D LA63_0 =3D self.input.LA(1)=0D =0D - if (LA63_0 =3D=3D 62) :=0D + if (LA63_0 =3D=3D 62):=0D LA63 =3D self.input.LA(2)=0D if LA63 =3D=3D 34 or LA63 =3D=3D 35 or LA63 =3D=3D 36 = or LA63 =3D=3D 37 or LA63 =3D=3D 38 or LA63 =3D=3D 39 or LA63 =3D=3D 40 or = LA63 =3D=3D 41 or LA63 =3D=3D 42 or LA63 =3D=3D 45 or LA63 =3D=3D 46 or LA6= 3 =3D=3D 48 or LA63 =3D=3D 49 or LA63 =3D=3D 50 or LA63 =3D=3D 51 or LA63 = =3D=3D 52 or LA63 =3D=3D 53 or LA63 =3D=3D 54 or LA63 =3D=3D 55 or LA63 =3D= =3D 56 or LA63 =3D=3D 57 or LA63 =3D=3D 58 or LA63 =3D=3D 59 or LA63 =3D=3D= 60 or LA63 =3D=3D 61:=0D alt63 =3D 1=0D elif LA63 =3D=3D IDENTIFIER:=0D LA63_25 =3D self.input.LA(3)=0D =0D - if (self.synpred109()) :=0D + if (self.synpred109()):=0D alt63 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt63 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_exp= ression : ( '(' type_name ')' cast_expression | unary_expression );", 63, 2= 5, self.input)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name = ')' cast_expression | unary_expression );", 63, 25, self.input)=0D =0D raise nvae=0D =0D @@ -5154,51 +4952,55 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_express= ion : ( '(' type_name ')' cast_expression | unary_expression );", 63, 1, se= lf.input)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name ')' = cast_expression | unary_expression );", 63, 1, self.input)=0D =0D raise nvae=0D =0D - elif ((IDENTIFIER <=3D LA63_0 <=3D FLOATING_POINT_LITERAL)= or LA63_0 =3D=3D 66 or (68 <=3D LA63_0 <=3D 69) or (72 <=3D LA63_0 <=3D 74= ) or (77 <=3D LA63_0 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA63_0 <=3D FLOATING_POINT_LITERAL)= or LA63_0 =3D=3D 66 or (68 <=3D LA63_0 <=3D 69) or (72 <=3D LA63_0 <=3D 74= ) or (77 <=3D LA63_0 <=3D 79)):=0D alt63 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("385:1: cast_expression = : ( '(' type_name ')' cast_expression | unary_expression );", 63, 0, self.i= nput)=0D + nvae =3D NoViableAltException(=0D + "385:1: cast_expression : ( '(' type_name ')' cast= _expression | unary_expression );", 63, 0, self.input)=0D =0D raise nvae=0D =0D if alt63 =3D=3D 1:=0D # C.g:386:4: '(' type_name ')' cast_expression=0D - self.match(self.input, 62, self.FOLLOW_62_in_cast_expr= ession1282)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_cast_expression1282)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_type_name_in_cast_ex= pression1284)=0D + self.following.append(=0D + self.FOLLOW_type_name_in_cast_expression1284)=0D self.type_name()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_cast_expr= ession1286)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_cast_expression1286)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_in_c= ast_expression1288)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_cast_expression1288= )=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt63 =3D=3D 2:=0D # C.g:387:4: unary_expression=0D - self.following.append(self.FOLLOW_unary_expression_in_= cast_expression1293)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_cast_expression129= 3)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5212,9 +5014,9 @@ class CParser(Parser): =0D # $ANTLR end cast_expression=0D =0D -=0D # $ANTLR start unary_expression=0D # C.g:390:1: unary_expression : ( postfix_expression | '++' unary_expr= ession | '--' unary_expression | unary_operator cast_expression | 'sizeof' = unary_expression | 'sizeof' '(' type_name ')' );=0D +=0D def unary_expression(self, ):=0D =0D unary_expression_StartIndex =3D self.input.index()=0D @@ -5237,30 +5039,32 @@ class CParser(Parser): elif LA64 =3D=3D 74:=0D LA64_12 =3D self.input.LA(2)=0D =0D - if (LA64_12 =3D=3D 62) :=0D + if (LA64_12 =3D=3D 62):=0D LA64_13 =3D self.input.LA(3)=0D =0D - if (self.synpred114()) :=0D + if (self.synpred114()):=0D alt64 =3D 5=0D - elif (True) :=0D + elif (True):=0D alt64 =3D 6=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expre= ssion | '++' unary_expression | '--' unary_expression | unary_operator cast= _expression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 6= 4, 13, self.input)=0D =0D raise nvae=0D =0D - elif ((IDENTIFIER <=3D LA64_12 <=3D FLOATING_POINT_LIT= ERAL) or LA64_12 =3D=3D 66 or (68 <=3D LA64_12 <=3D 69) or (72 <=3D LA64_12= <=3D 74) or (77 <=3D LA64_12 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA64_12 <=3D FLOATING_POINT_LIT= ERAL) or LA64_12 =3D=3D 66 or (68 <=3D LA64_12 <=3D 69) or (72 <=3D LA64_12= <=3D 74) or (77 <=3D LA64_12 <=3D 79)):=0D alt64 =3D 5=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expressio= n | '++' unary_expression | '--' unary_expression | unary_operator cast_exp= ression | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 1= 2, self.input)=0D =0D raise nvae=0D =0D @@ -5269,88 +5073,95 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "390:1: unary_expression : ( postfix_expression | = '++' unary_expression | '--' unary_expression | unary_operator cast_express= ion | 'sizeof' unary_expression | 'sizeof' '(' type_name ')' );", 64, 0, se= lf.input)=0D =0D raise nvae=0D =0D if alt64 =3D=3D 1:=0D # C.g:391:4: postfix_expression=0D - self.following.append(self.FOLLOW_postfix_expression_i= n_unary_expression1304)=0D + self.following.append(=0D + self.FOLLOW_postfix_expression_in_unary_expression= 1304)=0D self.postfix_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 2:=0D # C.g:392:4: '++' unary_expression=0D - self.match(self.input, 72, self.FOLLOW_72_in_unary_exp= ression1309)=0D + self.match(self.input, 72,=0D + self.FOLLOW_72_in_unary_expression1309)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1311)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 11)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 3:=0D # C.g:393:4: '--' unary_expression=0D - self.match(self.input, 73, self.FOLLOW_73_in_unary_exp= ression1316)=0D + self.match(self.input, 73,=0D + self.FOLLOW_73_in_unary_expression1316)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1318)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 18)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 4:=0D # C.g:394:4: unary_operator cast_expression=0D - self.following.append(self.FOLLOW_unary_operator_in_un= ary_expression1323)=0D + self.following.append(=0D + self.FOLLOW_unary_operator_in_unary_expression1323= )=0D self.unary_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_cast_expression_in_u= nary_expression1325)=0D + self.following.append(=0D + self.FOLLOW_cast_expression_in_unary_expression132= 5)=0D self.cast_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 5:=0D # C.g:395:4: 'sizeof' unary_expression=0D - self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1330)=0D + self.match(self.input, 74,=0D + self.FOLLOW_74_in_unary_expression1330)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_unary_expression_in_= unary_expression1332)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_unary_expression13= 32)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt64 =3D=3D 6:=0D # C.g:396:4: 'sizeof' '(' type_name ')'=0D - self.match(self.input, 74, self.FOLLOW_74_in_unary_exp= ression1337)=0D + self.match(self.input, 74,=0D + self.FOLLOW_74_in_unary_expression1337)=0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_unary_exp= ression1339)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_unary_expression1339)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_type_name_in_unary_e= xpression1341)=0D + self.following.append(=0D + self.FOLLOW_type_name_in_unary_expression1341)=0D self.type_name()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_unary_exp= ression1343)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_unary_expression1343)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5364,9 +5175,9 @@ class CParser(Parser): =0D # $ANTLR end unary_expression=0D =0D -=0D # $ANTLR start postfix_expression=0D # C.g:399:1: postfix_expression : p=3D primary_expression ( '[' expres= sion ']' | '(' a=3D ')' | '(' c=3D argument_expression_list b=3D ')' | '(' = macro_parameter_list ')' | '.' x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->'= z=3D IDENTIFIER | '++' | '--' )* ;=0D +=0D def postfix_expression(self, ):=0D self.postfix_expression_stack.append(postfix_expression_scope())=0D postfix_expression_StartIndex =3D self.input.index()=0D @@ -5379,9 +5190,7 @@ class CParser(Parser): =0D c =3D None=0D =0D -=0D -=0D - self.postfix_expression_stack[-1].FuncCallText =3D ''=0D + self.postfix_expression_stack[-1].FuncCallText =3D ''=0D =0D try:=0D try:=0D @@ -5390,30 +5199,29 @@ class CParser(Parser): =0D # 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 | '++' | '--' )* )=0D # 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 | '++' | '--' )*=0D - self.following.append(self.FOLLOW_primary_expression_in_po= stfix_expression1367)=0D + self.following.append(=0D + self.FOLLOW_primary_expression_in_postfix_expression13= 67)=0D p =3D self.primary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(p.start, p.stop)=0D + self.postfix_expression_stack[-1].FuncCallText +=3D se= lf.input.toString(=0D + p.start, p.stop)=0D =0D # C.g:407:9: ( '[' expression ']' | '(' a=3D ')' | '(' c= =3D argument_expression_list b=3D ')' | '(' macro_parameter_list ')' | '.' = x=3D IDENTIFIER | '*' y=3D IDENTIFIER | '->' z=3D IDENTIFIER | '++' | '--' = )*=0D - while True: #loop65=0D + while True: # loop65=0D alt65 =3D 10=0D LA65 =3D self.input.LA(1)=0D if LA65 =3D=3D 66:=0D LA65_1 =3D self.input.LA(2)=0D =0D - if (LA65_1 =3D=3D IDENTIFIER) :=0D + if (LA65_1 =3D=3D IDENTIFIER):=0D LA65_30 =3D self.input.LA(3)=0D =0D - if (self.synpred120()) :=0D + if (self.synpred120()):=0D alt65 =3D 6=0D =0D -=0D -=0D -=0D elif LA65 =3D=3D 64:=0D alt65 =3D 1=0D elif LA65 =3D=3D 62:=0D @@ -5425,21 +5233,19 @@ class CParser(Parser): elif LA65 =3D=3D IDENTIFIER:=0D LA65_55 =3D self.input.LA(3)=0D =0D - if (self.synpred117()) :=0D + if (self.synpred117()):=0D alt65 =3D 3=0D - elif (self.synpred118()) :=0D + elif (self.synpred118()):=0D alt65 =3D 4=0D =0D -=0D elif LA65 =3D=3D 66:=0D LA65_57 =3D self.input.LA(3)=0D =0D - if (self.synpred117()) :=0D + if (self.synpred117()):=0D alt65 =3D 3=0D - elif (self.synpred118()) :=0D + elif (self.synpred118()):=0D alt65 =3D 4=0D =0D -=0D elif LA65 =3D=3D HEX_LITERAL or LA65 =3D=3D OCTAL_= LITERAL or LA65 =3D=3D DECIMAL_LITERAL or LA65 =3D=3D CHARACTER_LITERAL or = LA65 =3D=3D STRING_LITERAL or LA65 =3D=3D FLOATING_POINT_LITERAL or LA65 = =3D=3D 62 or LA65 =3D=3D 68 or LA65 =3D=3D 69 or LA65 =3D=3D 72 or LA65 =3D= =3D 73 or LA65 =3D=3D 74 or LA65 =3D=3D 77 or LA65 =3D=3D 78 or LA65 =3D=3D= 79:=0D alt65 =3D 3=0D =0D @@ -5454,130 +5260,132 @@ class CParser(Parser): =0D if alt65 =3D=3D 1:=0D # C.g:407:13: '[' expression ']'=0D - self.match(self.input, 64, self.FOLLOW_64_in_postf= ix_expression1383)=0D + self.match(self.input, 64,=0D + self.FOLLOW_64_in_postfix_expression138= 3)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_po= stfix_expression1385)=0D + self.following.append(=0D + self.FOLLOW_expression_in_postfix_expression13= 85)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 65, self.FOLLOW_65_in_postf= ix_expression1387)=0D + self.match(self.input, 65,=0D + self.FOLLOW_65_in_postfix_expression138= 7)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 2:=0D # C.g:408:13: '(' a=3D ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1401)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression140= 1)=0D if self.failed:=0D return=0D a =3D self.input.LT(1)=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1405)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression140= 5)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line, a.charPositionInLine, self.postfix_expression= _stack[-1].FuncCallText, '')=0D -=0D -=0D + self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, a.line,=0D + a.charPositionInLine= , self.postfix_expression_stack[-1].FuncCallText, '')=0D =0D elif alt65 =3D=3D 3:=0D # C.g:409:13: '(' c=3D argument_expression_list b= =3D ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1420)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression142= 0)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_argument_express= ion_list_in_postfix_expression1424)=0D + self.following.append(=0D + self.FOLLOW_argument_expression_list_in_postfi= x_expression1424)=0D c =3D self.argument_expression_list()=0D self.following.pop()=0D if self.failed:=0D return=0D b =3D self.input.LT(1)=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1428)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression142= 8)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - 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))=0D -=0D -=0D + self.StoreFunctionCalling(p.start.line, p.star= t.charPositionInLine, b.line, b.charPositionInLine,=0D + self.postfix_express= ion_stack[-1].FuncCallText, self.input.toString(c.start, c.stop))=0D =0D elif alt65 =3D=3D 4:=0D # C.g:410:13: '(' macro_parameter_list ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_postf= ix_expression1444)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_postfix_expression144= 4)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_macro_parameter_= list_in_postfix_expression1446)=0D + self.following.append(=0D + self.FOLLOW_macro_parameter_list_in_postfix_ex= pression1446)=0D self.macro_parameter_list()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_postf= ix_expression1448)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_postfix_expression144= 8)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 5:=0D # C.g:411:13: '.' x=3D IDENTIFIER=0D - self.match(self.input, 75, self.FOLLOW_75_in_postf= ix_expression1462)=0D + self.match(self.input, 75,=0D + self.FOLLOW_75_in_postfix_expression146= 2)=0D if self.failed:=0D return=0D x =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1466)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1466)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= +=3D '.' + x.text=0D =0D -=0D -=0D elif alt65 =3D=3D 6:=0D # C.g:412:13: '*' y=3D IDENTIFIER=0D - self.match(self.input, 66, self.FOLLOW_66_in_postf= ix_expression1482)=0D + self.match(self.input, 66,=0D + self.FOLLOW_66_in_postfix_expression148= 2)=0D if self.failed:=0D return=0D y =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1486)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1486)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= =3D y.text=0D =0D -=0D -=0D elif alt65 =3D=3D 7:=0D # C.g:413:13: '->' z=3D IDENTIFIER=0D - self.match(self.input, 76, self.FOLLOW_76_in_postf= ix_expression1502)=0D + self.match(self.input, 76,=0D + self.FOLLOW_76_in_postfix_expression150= 2)=0D if self.failed:=0D return=0D z =3D self.input.LT(1)=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDE= NTIFIER_in_postfix_expression1506)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER= _in_postfix_expression1506)=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D self.postfix_expression_stack[-1].FuncCallText= +=3D '->' + z.text=0D =0D -=0D -=0D elif alt65 =3D=3D 8:=0D # C.g:414:13: '++'=0D - self.match(self.input, 72, self.FOLLOW_72_in_postf= ix_expression1522)=0D + self.match(self.input, 72,=0D + self.FOLLOW_72_in_postfix_expression152= 2)=0D if self.failed:=0D return=0D =0D -=0D elif alt65 =3D=3D 9:=0D # C.g:415:13: '--'=0D - self.match(self.input, 73, self.FOLLOW_73_in_postf= ix_expression1536)=0D + self.match(self.input, 73,=0D + self.FOLLOW_73_in_postfix_expression153= 6)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop65=0D -=0D -=0D -=0D -=0D -=0D + break # loop65=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5593,9 +5401,9 @@ class CParser(Parser): =0D # $ANTLR end postfix_expression=0D =0D -=0D # $ANTLR start macro_parameter_list=0D # C.g:419:1: macro_parameter_list : parameter_declaration ( ',' parame= ter_declaration )* ;=0D +=0D def macro_parameter_list(self, ):=0D =0D macro_parameter_list_StartIndex =3D self.input.index()=0D @@ -5606,39 +5414,35 @@ class CParser(Parser): =0D # C.g:420:2: ( parameter_declaration ( ',' parameter_decla= ration )* )=0D # C.g:420:4: parameter_declaration ( ',' parameter_declara= tion )*=0D - self.following.append(self.FOLLOW_parameter_declaration_in= _macro_parameter_list1559)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_macro_parameter_l= ist1559)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:420:26: ( ',' parameter_declaration )*=0D - while True: #loop66=0D + while True: # loop66=0D alt66 =3D 2=0D LA66_0 =3D self.input.LA(1)=0D =0D - if (LA66_0 =3D=3D 27) :=0D + if (LA66_0 =3D=3D 27):=0D alt66 =3D 1=0D =0D -=0D if alt66 =3D=3D 1:=0D # C.g:420:27: ',' parameter_declaration=0D - self.match(self.input, 27, self.FOLLOW_27_in_macro= _parameter_list1562)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_macro_parameter_list1= 562)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_parameter_declar= ation_in_macro_parameter_list1564)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_macro_par= ameter_list1564)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop66=0D -=0D -=0D -=0D -=0D -=0D + break # loop66=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -5653,9 +5457,9 @@ class CParser(Parser): =0D # $ANTLR end macro_parameter_list=0D =0D -=0D # $ANTLR start unary_operator=0D # C.g:423:1: unary_operator : ( '&' | '*' | '+' | '-' | '~' | '!' );=0D +=0D def unary_operator(self, ):=0D =0D unary_operator_StartIndex =3D self.input.index()=0D @@ -5667,7 +5471,7 @@ class CParser(Parser): # C.g:424:2: ( '&' | '*' | '+' | '-' | '~' | '!' )=0D # C.g:=0D if self.input.LA(1) =3D=3D 66 or (68 <=3D self.input.LA(1)= <=3D 69) or (77 <=3D self.input.LA(1) <=3D 79):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -5679,14 +5483,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_unary_operator= 0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5705,10 +5504,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start primary_expression=0D # C.g:432:1: primary_expression : ( IDENTIFIER | constant | '(' expres= sion ')' );=0D +=0D def primary_expression(self, ):=0D =0D retval =3D self.primary_expression_return()=0D @@ -5725,16 +5523,17 @@ class CParser(Parser): if LA67 =3D=3D IDENTIFIER:=0D LA67_1 =3D self.input.LA(2)=0D =0D - if (LA67_1 =3D=3D EOF or LA67_1 =3D=3D 25 or (27 <=3D = LA67_1 <=3D 28) or LA67_1 =3D=3D 44 or LA67_1 =3D=3D 47 or LA67_1 =3D=3D 53= or (62 <=3D LA67_1 <=3D 66) or (68 <=3D LA67_1 <=3D 73) or (75 <=3D LA67_1= <=3D 77) or (80 <=3D LA67_1 <=3D 102)) :=0D + if (LA67_1 =3D=3D EOF or LA67_1 =3D=3D 25 or (27 <=3D = LA67_1 <=3D 28) or LA67_1 =3D=3D 44 or LA67_1 =3D=3D 47 or LA67_1 =3D=3D 53= or (62 <=3D LA67_1 <=3D 66) or (68 <=3D LA67_1 <=3D 73) or (75 <=3D LA67_1= <=3D 77) or (80 <=3D LA67_1 <=3D 102)):=0D alt67 =3D 1=0D - elif (LA67_1 =3D=3D IDENTIFIER or LA67_1 =3D=3D STRING= _LITERAL) :=0D + elif (LA67_1 =3D=3D IDENTIFIER or LA67_1 =3D=3D STRING= _LITERAL):=0D alt67 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("432:1: primary_expr= ession : ( IDENTIFIER | constant | '(' expression ')' );", 67, 1, self.inpu= t)=0D + nvae =3D NoViableAltException(=0D + "432:1: primary_expression : ( IDENTIFIER | co= nstant | '(' expression ')' );", 67, 1, self.input)=0D =0D raise nvae=0D =0D @@ -5747,44 +5546,46 @@ class CParser(Parser): self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("432:1: primary_expressi= on : ( IDENTIFIER | constant | '(' expression ')' );", 67, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "432:1: primary_expression : ( IDENTIFIER | consta= nt | '(' expression ')' );", 67, 0, self.input)=0D =0D raise nvae=0D =0D if alt67 =3D=3D 1:=0D # C.g:433:4: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_primary_expression1613)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_primary_expressio= n1613)=0D if self.failed:=0D return retval=0D =0D -=0D elif alt67 =3D=3D 2:=0D # C.g:434:4: constant=0D - self.following.append(self.FOLLOW_constant_in_primary_= expression1618)=0D + self.following.append(=0D + self.FOLLOW_constant_in_primary_expression1618)=0D self.constant()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D elif alt67 =3D=3D 3:=0D # C.g:435:4: '(' expression ')'=0D - self.match(self.input, 62, self.FOLLOW_62_in_primary_e= xpression1623)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_primary_expression1623)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_expression_in_primar= y_expression1625)=0D + self.following.append(=0D + self.FOLLOW_expression_in_primary_expression1625)= =0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 63, self.FOLLOW_63_in_primary_e= xpression1627)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_primary_expression1627)=0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -5798,9 +5599,9 @@ class CParser(Parser): =0D # $ANTLR end primary_expression=0D =0D -=0D # $ANTLR start constant=0D # C.g:438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERA= L | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ ( IDENTIFI= ER )* | FLOATING_POINT_LITERAL );=0D +=0D def constant(self, ):=0D =0D constant_StartIndex =3D self.input.index()=0D @@ -5829,111 +5630,103 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "438:1: constant : ( HEX_LITERAL | OCTAL_LITERAL |= DECIMAL_LITERAL | CHARACTER_LITERAL | ( ( IDENTIFIER )* ( STRING_LITERAL )= + )+ ( IDENTIFIER )* | FLOATING_POINT_LITERAL );", 72, 0, self.input)=0D =0D raise nvae=0D =0D if alt72 =3D=3D 1:=0D # C.g:439:9: HEX_LITERAL=0D - self.match(self.input, HEX_LITERAL, self.FOLLOW_HEX_LI= TERAL_in_constant1643)=0D + self.match(self.input, HEX_LITERAL,=0D + self.FOLLOW_HEX_LITERAL_in_constant1643)=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 2:=0D # C.g:440:9: OCTAL_LITERAL=0D - self.match(self.input, OCTAL_LITERAL, self.FOLLOW_OCTA= L_LITERAL_in_constant1653)=0D + self.match(self.input, OCTAL_LITERAL,=0D + self.FOLLOW_OCTAL_LITERAL_in_constant1653)= =0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 3:=0D # C.g:441:9: DECIMAL_LITERAL=0D - self.match(self.input, DECIMAL_LITERAL, self.FOLLOW_DE= CIMAL_LITERAL_in_constant1663)=0D + self.match(self.input, DECIMAL_LITERAL,=0D + self.FOLLOW_DECIMAL_LITERAL_in_constant1663= )=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 4:=0D # C.g:442:7: CHARACTER_LITERAL=0D - self.match(self.input, CHARACTER_LITERAL, self.FOLLOW_= CHARACTER_LITERAL_in_constant1671)=0D + self.match(self.input, CHARACTER_LITERAL,=0D + self.FOLLOW_CHARACTER_LITERAL_in_constant16= 71)=0D if self.failed:=0D return=0D =0D -=0D elif alt72 =3D=3D 5:=0D # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+ = ( IDENTIFIER )*=0D # C.g:443:7: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )+= =0D cnt70 =3D 0=0D - while True: #loop70=0D + while True: # loop70=0D alt70 =3D 2=0D LA70_0 =3D self.input.LA(1)=0D =0D - if (LA70_0 =3D=3D IDENTIFIER) :=0D + if (LA70_0 =3D=3D IDENTIFIER):=0D LA70_1 =3D self.input.LA(2)=0D =0D - if (LA70_1 =3D=3D STRING_LITERAL) :=0D + if (LA70_1 =3D=3D STRING_LITERAL):=0D alt70 =3D 1=0D - elif (LA70_1 =3D=3D IDENTIFIER) :=0D + elif (LA70_1 =3D=3D IDENTIFIER):=0D LA70_33 =3D self.input.LA(3)=0D =0D - if (self.synpred138()) :=0D + if (self.synpred138()):=0D alt70 =3D 1=0D =0D -=0D -=0D -=0D - elif (LA70_0 =3D=3D STRING_LITERAL) :=0D + elif (LA70_0 =3D=3D STRING_LITERAL):=0D alt70 =3D 1=0D =0D -=0D if alt70 =3D=3D 1:=0D # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL = )+=0D # C.g:443:8: ( IDENTIFIER )*=0D - while True: #loop68=0D + while True: # loop68=0D alt68 =3D 2=0D LA68_0 =3D self.input.LA(1)=0D =0D - if (LA68_0 =3D=3D IDENTIFIER) :=0D + if (LA68_0 =3D=3D IDENTIFIER):=0D alt68 =3D 1=0D =0D -=0D if alt68 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, sel= f.FOLLOW_IDENTIFIER_in_constant1680)=0D + self.match(=0D + self.input, IDENTIFIER, self.FOLLO= W_IDENTIFIER_in_constant1680)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop68=0D -=0D + break # loop68=0D =0D # C.g:443:20: ( STRING_LITERAL )+=0D cnt69 =3D 0=0D - while True: #loop69=0D + while True: # loop69=0D alt69 =3D 2=0D LA69_0 =3D self.input.LA(1)=0D =0D - if (LA69_0 =3D=3D STRING_LITERAL) :=0D + if (LA69_0 =3D=3D STRING_LITERAL):=0D LA69_31 =3D self.input.LA(2)=0D =0D - if (self.synpred137()) :=0D + if (self.synpred137()):=0D alt69 =3D 1=0D =0D -=0D -=0D -=0D if alt69 =3D=3D 1:=0D # C.g:0:0: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL,= self.FOLLOW_STRING_LITERAL_in_constant1683)=0D + self.match(=0D + self.input, STRING_LITERAL, self.F= OLLOW_STRING_LITERAL_in_constant1683)=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt69 >=3D 1:=0D - break #loop69=0D + break # loop69=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -5944,12 +5737,9 @@ class CParser(Parser): =0D cnt69 +=3D 1=0D =0D -=0D -=0D -=0D else:=0D if cnt70 >=3D 1:=0D - break #loop70=0D + break # loop70=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -5960,37 +5750,31 @@ class CParser(Parser): =0D cnt70 +=3D 1=0D =0D -=0D # C.g:443:38: ( IDENTIFIER )*=0D - while True: #loop71=0D + while True: # loop71=0D alt71 =3D 2=0D LA71_0 =3D self.input.LA(1)=0D =0D - if (LA71_0 =3D=3D IDENTIFIER) :=0D + if (LA71_0 =3D=3D IDENTIFIER):=0D alt71 =3D 1=0D =0D -=0D if alt71 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW= _IDENTIFIER_in_constant1688)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_constant1= 688)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop71=0D -=0D -=0D -=0D + break # loop71=0D =0D elif alt72 =3D=3D 6:=0D # C.g:444:9: FLOATING_POINT_LITERAL=0D - self.match(self.input, FLOATING_POINT_LITERAL, self.FO= LLOW_FLOATING_POINT_LITERAL_in_constant1699)=0D + self.match(self.input, FLOATING_POINT_LITERAL,=0D + self.FOLLOW_FLOATING_POINT_LITERAL_in_const= ant1699)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6009,10 +5793,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start expression=0D # C.g:449:1: expression : assignment_expression ( ',' assignment_expre= ssion )* ;=0D +=0D def expression(self, ):=0D =0D retval =3D self.expression_return()=0D @@ -6025,42 +5808,38 @@ class CParser(Parser): =0D # C.g:450:2: ( assignment_expression ( ',' assignment_expr= ession )* )=0D # C.g:450:4: assignment_expression ( ',' assignment_expres= sion )*=0D - self.following.append(self.FOLLOW_assignment_expression_in= _expression1715)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_expression1715)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:450:26: ( ',' assignment_expression )*=0D - while True: #loop73=0D + while True: # loop73=0D alt73 =3D 2=0D LA73_0 =3D self.input.LA(1)=0D =0D - if (LA73_0 =3D=3D 27) :=0D + if (LA73_0 =3D=3D 27):=0D alt73 =3D 1=0D =0D -=0D if alt73 =3D=3D 1:=0D # C.g:450:27: ',' assignment_expression=0D - self.match(self.input, 27, self.FOLLOW_27_in_expre= ssion1718)=0D + self.match(self.input, 27,=0D + self.FOLLOW_27_in_expression1718)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_assignment_expre= ssion_in_expression1720)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_expressio= n1720)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop73=0D -=0D -=0D -=0D -=0D + break # loop73=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6074,9 +5853,9 @@ class CParser(Parser): =0D # $ANTLR end expression=0D =0D -=0D # $ANTLR start constant_expression=0D # C.g:453:1: constant_expression : conditional_expression ;=0D +=0D def constant_expression(self, ):=0D =0D constant_expression_StartIndex =3D self.input.index()=0D @@ -6087,15 +5866,13 @@ class CParser(Parser): =0D # C.g:454:2: ( conditional_expression )=0D # C.g:454:4: conditional_expression=0D - self.following.append(self.FOLLOW_conditional_expression_i= n_constant_expression1733)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_constant_express= ion1733)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -6109,9 +5886,9 @@ class CParser(Parser): =0D # $ANTLR end constant_expression=0D =0D -=0D # $ANTLR start assignment_expression=0D # C.g:457:1: assignment_expression : ( lvalue assignment_operator assi= gnment_expression | conditional_expression );=0D +=0D def assignment_expression(self, ):=0D =0D assignment_expression_StartIndex =3D self.input.index()=0D @@ -6128,112 +5905,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_13 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 13, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 13, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_14 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 14, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 14, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_15 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 15, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 15, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_16 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 16, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 16, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_17 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 17, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 17, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_18 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 18, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 18, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_19 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 19, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 19, self.input)=0D =0D raise nvae=0D =0D @@ -6242,32 +6026,34 @@ class CParser(Parser): elif LA74 =3D=3D STRING_LITERAL:=0D LA74_21 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 21, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 21, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_22 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 22, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 22, self.input)=0D =0D raise nvae=0D =0D @@ -6278,7 +6064,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 1, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 1, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6287,112 +6074,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_44 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 44, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 44, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_45 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 45, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 45, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_46 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 46, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 46, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_47 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 47, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 47, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_48 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 48, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 48, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_49 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 49, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 49, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_50 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 50, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 50, self.input)=0D =0D raise nvae=0D =0D @@ -6405,7 +6199,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 2, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 2, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6414,112 +6209,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_73 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 73, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 73, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_74 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 74, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 74, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_75 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 75, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 75, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_76 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 76, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 76, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_77 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 77, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 77, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_78 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 78, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 78, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_79 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 79, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 79, self.input)=0D =0D raise nvae=0D =0D @@ -6532,7 +6334,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 3, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 3, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6541,112 +6344,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_102 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 102, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 102, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_103 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 103, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 103, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_104 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 104, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 104, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_105 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 105, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 105, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_106 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 106, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 106, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_107 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 107, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 107, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_108 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 108, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 108, self.input)=0D =0D raise nvae=0D =0D @@ -6659,7 +6469,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 4, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 4, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6668,112 +6479,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_131 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 131, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 131, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_132 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 132, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 132, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_133 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 133, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 133, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_134 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 134, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 134, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_135 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 135, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 135, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_136 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 136, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 136, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_137 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 137, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 137, self.input)=0D =0D raise nvae=0D =0D @@ -6786,7 +6604,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 5, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 5, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6795,128 +6614,136 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_160 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 160, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 160, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 64:=0D LA74_161 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 161, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 161, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_162 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 162, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 162, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_163 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 163, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 163, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_164 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 164, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 164, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_165 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 165, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 165, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_166 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 166, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 166, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_167 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 167, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 167, self.input)=0D =0D raise nvae=0D =0D @@ -6925,16 +6752,17 @@ class CParser(Parser): elif LA74 =3D=3D STRING_LITERAL:=0D LA74_189 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 189, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 189, self.input)=0D =0D raise nvae=0D =0D @@ -6945,7 +6773,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 6, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 6, s= elf.input)=0D =0D raise nvae=0D =0D @@ -6954,112 +6783,119 @@ class CParser(Parser): if LA74 =3D=3D 64:=0D LA74_191 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 191, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 191, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_192 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 192, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 192, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 75:=0D LA74_193 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 193, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 193, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66:=0D LA74_194 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 194, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 194, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 76:=0D LA74_195 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 195, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 195, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_196 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 196, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 196, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_197 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 197, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 197, self.input)=0D =0D raise nvae=0D =0D @@ -7072,7 +6908,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 7, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 7, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7081,192 +6918,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_220 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 220, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 220, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_221 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 221, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 221, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_222 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 222, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 222, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_223 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 223, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 223, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_224 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 224, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 224, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_225 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 225, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 225, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_226 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 226, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 226, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_227 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 227, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 227, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_228 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 228, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 228, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_229 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 229, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 229, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_230 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 230, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 230, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_231 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 231, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 231, self.input)=0D =0D raise nvae=0D =0D @@ -7277,7 +7126,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 8, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 8, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7286,192 +7136,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_244 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 244, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 244, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_245 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 245, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 245, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_246 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 246, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 246, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_247 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 247, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 247, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_248 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 248, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 248, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_249 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 249, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 249, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_250 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 250, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 250, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_251 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 251, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 251, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_252 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 252, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 252, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_253 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 253, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 253, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_254 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 254, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 254, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_255 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 255, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 255, self.input)=0D =0D raise nvae=0D =0D @@ -7480,7 +7342,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 9, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 9, s= elf.input)=0D =0D raise nvae=0D =0D @@ -7489,192 +7352,204 @@ class CParser(Parser): if LA74 =3D=3D IDENTIFIER:=0D LA74_256 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 256, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 256, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_257 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 257, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 257, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_258 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 258, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 258, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_259 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 259, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 259, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_260 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 260, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 260, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_261 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 261, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 261, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_262 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 262, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 262, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 62:=0D LA74_263 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 263, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 263, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_264 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 264, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 264, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_265 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 265, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 265, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_266 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 266, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 266, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_267 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 267, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 267, self.input)=0D =0D raise nvae=0D =0D @@ -7683,7 +7558,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 10, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 10, = self.input)=0D =0D raise nvae=0D =0D @@ -7692,192 +7568,204 @@ class CParser(Parser): if LA74 =3D=3D 62:=0D LA74_268 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 268, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 268, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_269 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 269, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 269, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_270 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 270, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 270, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_271 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 271, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 271, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_272 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 272, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 272, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_273 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 273, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 273, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_274 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 274, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 274, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_275 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 275, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 275, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_276 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 276, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 276, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_277 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 277, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 277, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_278 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 278, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 278, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_279 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 279, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 279, self.input)=0D =0D raise nvae=0D =0D @@ -7886,7 +7774,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 11, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 11, = self.input)=0D =0D raise nvae=0D =0D @@ -7895,192 +7784,204 @@ class CParser(Parser): if LA74 =3D=3D 62:=0D LA74_280 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 280, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 280, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D IDENTIFIER:=0D LA74_281 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 281, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 281, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D HEX_LITERAL:=0D LA74_282 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 282, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 282, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D OCTAL_LITERAL:=0D LA74_283 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 283, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 283, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D DECIMAL_LITERAL:=0D LA74_284 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 284, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 284, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D CHARACTER_LITERAL:=0D LA74_285 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 285, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 285, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D STRING_LITERAL:=0D LA74_286 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 286, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 286, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D FLOATING_POINT_LITERAL:=0D LA74_287 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 287, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 287, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 72:=0D LA74_288 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 288, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 288, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 73:=0D LA74_289 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 289, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 289, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 66 or LA74 =3D=3D 68 or LA74 =3D=3D 6= 9 or LA74 =3D=3D 77 or LA74 =3D=3D 78 or LA74 =3D=3D 79:=0D LA74_290 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 290, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 290, self.input)=0D =0D raise nvae=0D =0D elif LA74 =3D=3D 74:=0D LA74_291 =3D self.input.LA(3)=0D =0D - if (self.synpred142()) :=0D + if (self.synpred142()):=0D alt74 =3D 1=0D - elif (True) :=0D + elif (True):=0D alt74 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignme= nt_expression : ( lvalue assignment_operator assignment_expression | condit= ional_expression );", 74, 291, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue a= ssignment_operator assignment_expression | conditional_expression );", 74, = 291, self.input)=0D =0D raise nvae=0D =0D @@ -8089,7 +7990,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_e= xpression : ( lvalue assignment_operator assignment_expression | conditiona= l_expression );", 74, 12, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assig= nment_operator assignment_expression | conditional_expression );", 74, 12, = self.input)=0D =0D raise nvae=0D =0D @@ -8098,39 +8000,41 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("457:1: assignment_expre= ssion : ( lvalue assignment_operator assignment_expression | conditional_ex= pression );", 74, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "457:1: assignment_expression : ( lvalue assignmen= t_operator assignment_expression | conditional_expression );", 74, 0, self.= input)=0D =0D raise nvae=0D =0D if alt74 =3D=3D 1:=0D # C.g:458:4: lvalue assignment_operator assignment_exp= ression=0D - self.following.append(self.FOLLOW_lvalue_in_assignment= _expression1744)=0D + self.following.append(=0D + self.FOLLOW_lvalue_in_assignment_expression1744)=0D self.lvalue()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_operator_= in_assignment_expression1746)=0D + self.following.append(=0D + self.FOLLOW_assignment_operator_in_assignment_expr= ession1746)=0D self.assignment_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_expressio= n_in_assignment_expression1748)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_assignment_ex= pression1748)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt74 =3D=3D 2:=0D # C.g:459:4: conditional_expression=0D - self.following.append(self.FOLLOW_conditional_expressi= on_in_assignment_expression1753)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_assignment_e= xpression1753)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8144,9 +8048,9 @@ class CParser(Parser): =0D # $ANTLR end assignment_expression=0D =0D -=0D # $ANTLR start lvalue=0D # C.g:462:1: lvalue : unary_expression ;=0D +=0D def lvalue(self, ):=0D =0D lvalue_StartIndex =3D self.input.index()=0D @@ -8157,15 +8061,13 @@ class CParser(Parser): =0D # C.g:463:2: ( unary_expression )=0D # C.g:463:4: unary_expression=0D - self.following.append(self.FOLLOW_unary_expression_in_lval= ue1765)=0D + self.following.append(=0D + self.FOLLOW_unary_expression_in_lvalue1765)=0D self.unary_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8179,9 +8081,9 @@ class CParser(Parser): =0D # $ANTLR end lvalue=0D =0D -=0D # $ANTLR start assignment_operator=0D # C.g:466:1: assignment_operator : ( '=3D' | '*=3D' | '/=3D' | '%=3D' = | '+=3D' | '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' );=0D +=0D def assignment_operator(self, ):=0D =0D assignment_operator_StartIndex =3D self.input.index()=0D @@ -8193,7 +8095,7 @@ class CParser(Parser): # C.g:467:2: ( '=3D' | '*=3D' | '/=3D' | '%=3D' | '+=3D' |= '-=3D' | '<<=3D' | '>>=3D' | '&=3D' | '^=3D' | '|=3D' )=0D # C.g:=0D if self.input.LA(1) =3D=3D 28 or (80 <=3D self.input.LA(1)= <=3D 89):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8205,14 +8107,9 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.input)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_assignment_ope= rator0=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8226,15 +8123,14 @@ class CParser(Parser): =0D # $ANTLR end assignment_operator=0D =0D -=0D # $ANTLR start conditional_expression=0D # C.g:480:1: conditional_expression : e=3D logical_or_expression ( '?'= expression ':' conditional_expression )? ;=0D +=0D def conditional_expression(self, ):=0D =0D conditional_expression_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 51):=0D @@ -8242,7 +8138,8 @@ class CParser(Parser): =0D # C.g:481:2: (e=3D logical_or_expression ( '?' expression = ':' conditional_expression )? )=0D # C.g:481:4: e=3D logical_or_expression ( '?' expression '= :' conditional_expression )?=0D - self.following.append(self.FOLLOW_logical_or_expression_in= _conditional_expression1839)=0D + self.following.append(=0D + self.FOLLOW_logical_or_expression_in_conditional_expre= ssion1839)=0D e =3D self.logical_or_expression()=0D self.following.pop()=0D if self.failed:=0D @@ -8251,35 +8148,33 @@ class CParser(Parser): alt75 =3D 2=0D LA75_0 =3D self.input.LA(1)=0D =0D - if (LA75_0 =3D=3D 90) :=0D + if (LA75_0 =3D=3D 90):=0D alt75 =3D 1=0D if alt75 =3D=3D 1:=0D # C.g:481:29: '?' expression ':' conditional_expressio= n=0D - self.match(self.input, 90, self.FOLLOW_90_in_condition= al_expression1842)=0D + self.match(self.input, 90,=0D + self.FOLLOW_90_in_conditional_expression184= 2)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_condit= ional_expression1844)=0D + self.following.append(=0D + self.FOLLOW_expression_in_conditional_expression18= 44)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_condition= al_expression1846)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_conditional_expression184= 6)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_conditional_expressi= on_in_conditional_expression1848)=0D + self.following.append(=0D + self.FOLLOW_conditional_expression_in_conditional_= expression1848)=0D self.conditional_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8299,10 +8194,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start logical_or_expression=0D # C.g:484:1: logical_or_expression : logical_and_expression ( '||' log= ical_and_expression )* ;=0D +=0D def logical_or_expression(self, ):=0D =0D retval =3D self.logical_or_expression_return()=0D @@ -8315,42 +8209,38 @@ class CParser(Parser): =0D # C.g:485:2: ( logical_and_expression ( '||' logical_and_e= xpression )* )=0D # C.g:485:4: logical_and_expression ( '||' logical_and_exp= ression )*=0D - self.following.append(self.FOLLOW_logical_and_expression_i= n_logical_or_expression1863)=0D + self.following.append(=0D + self.FOLLOW_logical_and_expression_in_logical_or_expre= ssion1863)=0D self.logical_and_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D # C.g:485:27: ( '||' logical_and_expression )*=0D - while True: #loop76=0D + while True: # loop76=0D alt76 =3D 2=0D LA76_0 =3D self.input.LA(1)=0D =0D - if (LA76_0 =3D=3D 91) :=0D + if (LA76_0 =3D=3D 91):=0D alt76 =3D 1=0D =0D -=0D if alt76 =3D=3D 1:=0D # C.g:485:28: '||' logical_and_expression=0D - self.match(self.input, 91, self.FOLLOW_91_in_logic= al_or_expression1866)=0D + self.match(self.input, 91,=0D + self.FOLLOW_91_in_logical_or_expression= 1866)=0D if self.failed:=0D return retval=0D - self.following.append(self.FOLLOW_logical_and_expr= ession_in_logical_or_expression1868)=0D + self.following.append(=0D + self.FOLLOW_logical_and_expression_in_logical_= or_expression1868)=0D self.logical_and_expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop76=0D -=0D -=0D -=0D -=0D + break # loop76=0D =0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -8364,9 +8254,9 @@ class CParser(Parser): =0D # $ANTLR end logical_or_expression=0D =0D -=0D # $ANTLR start logical_and_expression=0D # C.g:488:1: logical_and_expression : inclusive_or_expression ( '&&' i= nclusive_or_expression )* ;=0D +=0D def logical_and_expression(self, ):=0D =0D logical_and_expression_StartIndex =3D self.input.index()=0D @@ -8377,39 +8267,35 @@ class CParser(Parser): =0D # C.g:489:2: ( inclusive_or_expression ( '&&' inclusive_or= _expression )* )=0D # C.g:489:4: inclusive_or_expression ( '&&' inclusive_or_e= xpression )*=0D - self.following.append(self.FOLLOW_inclusive_or_expression_= in_logical_and_expression1881)=0D + self.following.append(=0D + self.FOLLOW_inclusive_or_expression_in_logical_and_exp= ression1881)=0D self.inclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:489:28: ( '&&' inclusive_or_expression )*=0D - while True: #loop77=0D + while True: # loop77=0D alt77 =3D 2=0D LA77_0 =3D self.input.LA(1)=0D =0D - if (LA77_0 =3D=3D 92) :=0D + if (LA77_0 =3D=3D 92):=0D alt77 =3D 1=0D =0D -=0D if alt77 =3D=3D 1:=0D # C.g:489:29: '&&' inclusive_or_expression=0D - self.match(self.input, 92, self.FOLLOW_92_in_logic= al_and_expression1884)=0D + self.match(=0D + self.input, 92, self.FOLLOW_92_in_logical_and_= expression1884)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_inclusive_or_exp= ression_in_logical_and_expression1886)=0D + self.following.append(=0D + self.FOLLOW_inclusive_or_expression_in_logical= _and_expression1886)=0D self.inclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop77=0D -=0D -=0D -=0D -=0D -=0D + break # loop77=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8424,9 +8310,9 @@ class CParser(Parser): =0D # $ANTLR end logical_and_expression=0D =0D -=0D # $ANTLR start inclusive_or_expression=0D # C.g:492:1: inclusive_or_expression : exclusive_or_expression ( '|' e= xclusive_or_expression )* ;=0D +=0D def inclusive_or_expression(self, ):=0D =0D inclusive_or_expression_StartIndex =3D self.input.index()=0D @@ -8437,46 +8323,43 @@ class CParser(Parser): =0D # C.g:493:2: ( exclusive_or_expression ( '|' exclusive_or_= expression )* )=0D # C.g:493:4: exclusive_or_expression ( '|' exclusive_or_ex= pression )*=0D - self.following.append(self.FOLLOW_exclusive_or_expression_= in_inclusive_or_expression1899)=0D + self.following.append(=0D + self.FOLLOW_exclusive_or_expression_in_inclusive_or_ex= pression1899)=0D self.exclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:493:28: ( '|' exclusive_or_expression )*=0D - while True: #loop78=0D + while True: # loop78=0D alt78 =3D 2=0D LA78_0 =3D self.input.LA(1)=0D =0D - if (LA78_0 =3D=3D 93) :=0D + if (LA78_0 =3D=3D 93):=0D alt78 =3D 1=0D =0D -=0D if alt78 =3D=3D 1:=0D # C.g:493:29: '|' exclusive_or_expression=0D - self.match(self.input, 93, self.FOLLOW_93_in_inclu= sive_or_expression1902)=0D + self.match(=0D + self.input, 93, self.FOLLOW_93_in_inclusive_or= _expression1902)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_exclusive_or_exp= ression_in_inclusive_or_expression1904)=0D + self.following.append(=0D + self.FOLLOW_exclusive_or_expression_in_inclusi= ve_or_expression1904)=0D self.exclusive_or_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop78=0D -=0D -=0D -=0D -=0D -=0D + break # loop78=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 54, inclusive_or_expression_Start= Index)=0D + self.memoize(self.input, 54,=0D + inclusive_or_expression_StartIndex)=0D =0D pass=0D =0D @@ -8484,9 +8367,9 @@ class CParser(Parser): =0D # $ANTLR end inclusive_or_expression=0D =0D -=0D # $ANTLR start exclusive_or_expression=0D # C.g:496:1: exclusive_or_expression : and_expression ( '^' and_expres= sion )* ;=0D +=0D def exclusive_or_expression(self, ):=0D =0D exclusive_or_expression_StartIndex =3D self.input.index()=0D @@ -8497,46 +8380,43 @@ class CParser(Parser): =0D # C.g:497:2: ( and_expression ( '^' and_expression )* )=0D # C.g:497:4: and_expression ( '^' and_expression )*=0D - self.following.append(self.FOLLOW_and_expression_in_exclus= ive_or_expression1917)=0D + self.following.append(=0D + self.FOLLOW_and_expression_in_exclusive_or_expression1= 917)=0D self.and_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:497:19: ( '^' and_expression )*=0D - while True: #loop79=0D + while True: # loop79=0D alt79 =3D 2=0D LA79_0 =3D self.input.LA(1)=0D =0D - if (LA79_0 =3D=3D 94) :=0D + if (LA79_0 =3D=3D 94):=0D alt79 =3D 1=0D =0D -=0D if alt79 =3D=3D 1:=0D # C.g:497:20: '^' and_expression=0D - self.match(self.input, 94, self.FOLLOW_94_in_exclu= sive_or_expression1920)=0D + self.match(=0D + self.input, 94, self.FOLLOW_94_in_exclusive_or= _expression1920)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_and_expression_i= n_exclusive_or_expression1922)=0D + self.following.append(=0D + self.FOLLOW_and_expression_in_exclusive_or_exp= ression1922)=0D self.and_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop79=0D -=0D -=0D -=0D -=0D -=0D + break # loop79=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D finally:=0D if self.backtracking > 0:=0D - self.memoize(self.input, 55, exclusive_or_expression_Start= Index)=0D + self.memoize(self.input, 55,=0D + exclusive_or_expression_StartIndex)=0D =0D pass=0D =0D @@ -8544,9 +8424,9 @@ class CParser(Parser): =0D # $ANTLR end exclusive_or_expression=0D =0D -=0D # $ANTLR start and_expression=0D # C.g:500:1: and_expression : equality_expression ( '&' equality_expre= ssion )* ;=0D +=0D def and_expression(self, ):=0D =0D and_expression_StartIndex =3D self.input.index()=0D @@ -8557,39 +8437,35 @@ class CParser(Parser): =0D # C.g:501:2: ( equality_expression ( '&' equality_expressi= on )* )=0D # C.g:501:4: equality_expression ( '&' equality_expression= )*=0D - self.following.append(self.FOLLOW_equality_expression_in_a= nd_expression1935)=0D + self.following.append(=0D + self.FOLLOW_equality_expression_in_and_expression1935)= =0D self.equality_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:501:24: ( '&' equality_expression )*=0D - while True: #loop80=0D + while True: # loop80=0D alt80 =3D 2=0D LA80_0 =3D self.input.LA(1)=0D =0D - if (LA80_0 =3D=3D 77) :=0D + if (LA80_0 =3D=3D 77):=0D alt80 =3D 1=0D =0D -=0D if alt80 =3D=3D 1:=0D # C.g:501:25: '&' equality_expression=0D - self.match(self.input, 77, self.FOLLOW_77_in_and_e= xpression1938)=0D + self.match(self.input, 77,=0D + self.FOLLOW_77_in_and_expression1938)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_equality_express= ion_in_and_expression1940)=0D + self.following.append(=0D + self.FOLLOW_equality_expression_in_and_express= ion1940)=0D self.equality_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop80=0D -=0D -=0D -=0D -=0D -=0D + break # loop80=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8604,9 +8480,9 @@ class CParser(Parser): =0D # $ANTLR end and_expression=0D =0D -=0D # $ANTLR start equality_expression=0D # C.g:503:1: equality_expression : relational_expression ( ( '=3D=3D' = | '!=3D' ) relational_expression )* ;=0D +=0D def equality_expression(self, ):=0D =0D equality_expression_StartIndex =3D self.input.index()=0D @@ -8617,24 +8493,24 @@ class CParser(Parser): =0D # C.g:504:2: ( relational_expression ( ( '=3D=3D' | '!=3D'= ) relational_expression )* )=0D # C.g:504:4: relational_expression ( ( '=3D=3D' | '!=3D' )= relational_expression )*=0D - self.following.append(self.FOLLOW_relational_expression_in= _equality_expression1952)=0D + self.following.append(=0D + self.FOLLOW_relational_expression_in_equality_expressi= on1952)=0D self.relational_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:504:26: ( ( '=3D=3D' | '!=3D' ) relational_expressio= n )*=0D - while True: #loop81=0D + while True: # loop81=0D alt81 =3D 2=0D LA81_0 =3D self.input.LA(1)=0D =0D - if ((95 <=3D LA81_0 <=3D 96)) :=0D + if ((95 <=3D LA81_0 <=3D 96)):=0D alt81 =3D 1=0D =0D -=0D if alt81 =3D=3D 1:=0D # C.g:504:27: ( '=3D=3D' | '!=3D' ) relational_exp= ression=0D if (95 <=3D self.input.LA(1) <=3D 96):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8646,24 +8522,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_equali= ty_expression1955=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_relational_expre= ssion_in_equality_expression1961)=0D + self.following.append(=0D + self.FOLLOW_relational_expression_in_equality_= expression1961)=0D self.relational_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop81=0D -=0D -=0D -=0D -=0D -=0D + break # loop81=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8678,9 +8548,9 @@ class CParser(Parser): =0D # $ANTLR end equality_expression=0D =0D -=0D # $ANTLR start relational_expression=0D # C.g:507:1: relational_expression : shift_expression ( ( '<' | '>' | = '<=3D' | '>=3D' ) shift_expression )* ;=0D +=0D def relational_expression(self, ):=0D =0D relational_expression_StartIndex =3D self.input.index()=0D @@ -8691,24 +8561,24 @@ class CParser(Parser): =0D # C.g:508:2: ( shift_expression ( ( '<' | '>' | '<=3D' | '= >=3D' ) shift_expression )* )=0D # C.g:508:4: shift_expression ( ( '<' | '>' | '<=3D' | '>= =3D' ) shift_expression )*=0D - self.following.append(self.FOLLOW_shift_expression_in_rela= tional_expression1975)=0D + self.following.append(=0D + self.FOLLOW_shift_expression_in_relational_expression1= 975)=0D self.shift_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:508:21: ( ( '<' | '>' | '<=3D' | '>=3D' ) shift_expr= ession )*=0D - while True: #loop82=0D + while True: # loop82=0D alt82 =3D 2=0D LA82_0 =3D self.input.LA(1)=0D =0D - if ((97 <=3D LA82_0 <=3D 100)) :=0D + if ((97 <=3D LA82_0 <=3D 100)):=0D alt82 =3D 1=0D =0D -=0D if alt82 =3D=3D 1:=0D # C.g:508:22: ( '<' | '>' | '<=3D' | '>=3D' ) shif= t_expression=0D if (97 <=3D self.input.LA(1) <=3D 100):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8720,24 +8590,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_relati= onal_expression1978=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_shift_expression= _in_relational_expression1988)=0D + self.following.append(=0D + self.FOLLOW_shift_expression_in_relational_exp= ression1988)=0D self.shift_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop82=0D -=0D -=0D -=0D -=0D -=0D + break # loop82=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8752,9 +8616,9 @@ class CParser(Parser): =0D # $ANTLR end relational_expression=0D =0D -=0D # $ANTLR start shift_expression=0D # C.g:511:1: shift_expression : additive_expression ( ( '<<' | '>>' ) = additive_expression )* ;=0D +=0D def shift_expression(self, ):=0D =0D shift_expression_StartIndex =3D self.input.index()=0D @@ -8765,24 +8629,24 @@ class CParser(Parser): =0D # C.g:512:2: ( additive_expression ( ( '<<' | '>>' ) addit= ive_expression )* )=0D # C.g:512:4: additive_expression ( ( '<<' | '>>' ) additiv= e_expression )*=0D - self.following.append(self.FOLLOW_additive_expression_in_s= hift_expression2001)=0D + self.following.append(=0D + self.FOLLOW_additive_expression_in_shift_expression200= 1)=0D self.additive_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:512:24: ( ( '<<' | '>>' ) additive_expression )*=0D - while True: #loop83=0D + while True: # loop83=0D alt83 =3D 2=0D LA83_0 =3D self.input.LA(1)=0D =0D - if ((101 <=3D LA83_0 <=3D 102)) :=0D + if ((101 <=3D LA83_0 <=3D 102)):=0D alt83 =3D 1=0D =0D -=0D if alt83 =3D=3D 1:=0D # C.g:512:25: ( '<<' | '>>' ) additive_expression= =0D if (101 <=3D self.input.LA(1) <=3D 102):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -8794,24 +8658,18 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_shift_= expression2004=0D - )=0D + )=0D raise mse=0D =0D -=0D - self.following.append(self.FOLLOW_additive_express= ion_in_shift_expression2010)=0D + self.following.append(=0D + self.FOLLOW_additive_expression_in_shift_expre= ssion2010)=0D self.additive_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop83=0D -=0D -=0D -=0D -=0D -=0D + break # loop83=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -8826,9 +8684,9 @@ class CParser(Parser): =0D # $ANTLR end shift_expression=0D =0D -=0D # $ANTLR start statement=0D # C.g:517:1: statement : ( labeled_statement | compound_statement | ex= pression_statement | selection_statement | iteration_statement | jump_state= ment | macro_statement | asm2_statement | asm1_statement | asm_statement | = declaration );=0D +=0D def statement(self, ):=0D =0D statement_StartIndex =3D self.input.index()=0D @@ -8845,20 +8703,21 @@ class CParser(Parser): if LA84 =3D=3D 62:=0D LA84_43 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (self.synpred173()) :=0D + elif (self.synpred173()):=0D alt84 =3D 7=0D - elif (self.synpred174()) :=0D + elif (self.synpred174()):=0D alt84 =3D 8=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 43, self.input)=0D =0D raise nvae=0D =0D @@ -8869,48 +8728,51 @@ class CParser(Parser): elif LA84 =3D=3D 66:=0D LA84_47 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 47, self.input)=0D =0D raise nvae=0D =0D elif LA84 =3D=3D IDENTIFIER:=0D LA84_53 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 53, self.input)=0D =0D raise nvae=0D =0D elif LA84 =3D=3D 25:=0D LA84_68 =3D self.input.LA(3)=0D =0D - if (self.synpred169()) :=0D + if (self.synpred169()):=0D alt84 =3D 3=0D - elif (True) :=0D + elif (True):=0D alt84 =3D 11=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | = compound_statement | expression_statement | selection_statement | iteration= _statement | jump_statement | macro_statement | asm2_statement | asm1_state= ment | asm_statement | declaration );", 84, 68, self.input)=0D =0D raise nvae=0D =0D @@ -8921,7 +8783,8 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | comp= ound_statement | expression_statement | selection_statement | iteration_sta= tement | jump_statement | macro_statement | asm2_statement | asm1_statement= | asm_statement | declaration );", 84, 1, self.input)=0D =0D raise nvae=0D =0D @@ -8950,110 +8813,110 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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= )=0D + nvae =3D NoViableAltException(=0D + "517:1: statement : ( labeled_statement | compound= _statement | expression_statement | selection_statement | iteration_stateme= nt | jump_statement | macro_statement | asm2_statement | asm1_statement | a= sm_statement | declaration );", 84, 0, self.input)=0D =0D raise nvae=0D =0D if alt84 =3D=3D 1:=0D # C.g:518:4: labeled_statement=0D - self.following.append(self.FOLLOW_labeled_statement_in= _statement2025)=0D + self.following.append(=0D + self.FOLLOW_labeled_statement_in_statement2025)=0D self.labeled_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 2:=0D # C.g:519:4: compound_statement=0D - self.following.append(self.FOLLOW_compound_statement_i= n_statement2030)=0D + self.following.append(=0D + self.FOLLOW_compound_statement_in_statement2030)=0D self.compound_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 3:=0D # C.g:520:4: expression_statement=0D - self.following.append(self.FOLLOW_expression_statement= _in_statement2035)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_statement2035)= =0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 4:=0D # C.g:521:4: selection_statement=0D - self.following.append(self.FOLLOW_selection_statement_= in_statement2040)=0D + self.following.append(=0D + self.FOLLOW_selection_statement_in_statement2040)= =0D self.selection_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 5:=0D # C.g:522:4: iteration_statement=0D - self.following.append(self.FOLLOW_iteration_statement_= in_statement2045)=0D + self.following.append(=0D + self.FOLLOW_iteration_statement_in_statement2045)= =0D self.iteration_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 6:=0D # C.g:523:4: jump_statement=0D - self.following.append(self.FOLLOW_jump_statement_in_st= atement2050)=0D + self.following.append(=0D + self.FOLLOW_jump_statement_in_statement2050)=0D self.jump_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 7:=0D # C.g:524:4: macro_statement=0D - self.following.append(self.FOLLOW_macro_statement_in_s= tatement2055)=0D + self.following.append(=0D + self.FOLLOW_macro_statement_in_statement2055)=0D self.macro_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 8:=0D # C.g:525:4: asm2_statement=0D - self.following.append(self.FOLLOW_asm2_statement_in_st= atement2060)=0D + self.following.append(=0D + self.FOLLOW_asm2_statement_in_statement2060)=0D self.asm2_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 9:=0D # C.g:526:4: asm1_statement=0D - self.following.append(self.FOLLOW_asm1_statement_in_st= atement2065)=0D + self.following.append(=0D + self.FOLLOW_asm1_statement_in_statement2065)=0D self.asm1_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 10:=0D # C.g:527:4: asm_statement=0D - self.following.append(self.FOLLOW_asm_statement_in_sta= tement2070)=0D + self.following.append(=0D + self.FOLLOW_asm_statement_in_statement2070)=0D self.asm_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt84 =3D=3D 11:=0D # C.g:528:4: declaration=0D - self.following.append(self.FOLLOW_declaration_in_state= ment2075)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_statement2075)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9067,9 +8930,9 @@ class CParser(Parser): =0D # $ANTLR end statement=0D =0D -=0D # $ANTLR start asm2_statement=0D # C.g:531:1: asm2_statement : ( '__asm__' )? IDENTIFIER '(' (~ ( ';' )= )* ')' ';' ;=0D +=0D def asm2_statement(self, ):=0D =0D asm2_statement_StartIndex =3D self.input.index()=0D @@ -9084,42 +8947,41 @@ class CParser(Parser): alt85 =3D 2=0D LA85_0 =3D self.input.LA(1)=0D =0D - if (LA85_0 =3D=3D 103) :=0D + if (LA85_0 =3D=3D 103):=0D alt85 =3D 1=0D if alt85 =3D=3D 1:=0D # C.g:0:0: '__asm__'=0D - self.match(self.input, 103, self.FOLLOW_103_in_asm2_st= atement2086)=0D + self.match(self.input, 103,=0D + self.FOLLOW_103_in_asm2_statement2086)=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_asm2_statement2089)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_asm2_statement2089)=0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_asm2_statemen= t2091)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_asm2_statement2091)=0D if self.failed:=0D return=0D # C.g:532:30: (~ ( ';' ) )*=0D - while True: #loop86=0D + while True: # loop86=0D alt86 =3D 2=0D LA86_0 =3D self.input.LA(1)=0D =0D - if (LA86_0 =3D=3D 63) :=0D + if (LA86_0 =3D=3D 63):=0D LA86_1 =3D self.input.LA(2)=0D =0D - if ((IDENTIFIER <=3D LA86_1 <=3D LINE_COMMAND) or = (26 <=3D LA86_1 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA86_1 <=3D LINE_COMMAND) or = (26 <=3D LA86_1 <=3D 117)):=0D alt86 =3D 1=0D =0D -=0D - elif ((IDENTIFIER <=3D LA86_0 <=3D LINE_COMMAND) or (2= 6 <=3D LA86_0 <=3D 62) or (64 <=3D LA86_0 <=3D 117)) :=0D + elif ((IDENTIFIER <=3D LA86_0 <=3D LINE_COMMAND) or (2= 6 <=3D LA86_0 <=3D 62) or (64 <=3D LA86_0 <=3D 117)):=0D alt86 =3D 1=0D =0D -=0D if alt86 =3D=3D 1:=0D # C.g:532:31: ~ ( ';' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D LINE_COM= MAND) or (26 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9131,26 +8993,21 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm2_s= tatement2094=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop86=0D + break # loop86=0D =0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_asm2_statemen= t2101)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_asm2_statement2101)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_asm2_statemen= t2103)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_asm2_statement2103)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9164,9 +9021,9 @@ class CParser(Parser): =0D # $ANTLR end asm2_statement=0D =0D -=0D # $ANTLR start asm1_statement=0D # C.g:535:1: asm1_statement : '_asm' '{' (~ ( '}' ) )* '}' ;=0D +=0D def asm1_statement(self, ):=0D =0D asm1_statement_StartIndex =3D self.input.index()=0D @@ -9177,25 +9034,26 @@ class CParser(Parser): =0D # C.g:536:2: ( '_asm' '{' (~ ( '}' ) )* '}' )=0D # C.g:536:4: '_asm' '{' (~ ( '}' ) )* '}'=0D - self.match(self.input, 104, self.FOLLOW_104_in_asm1_statem= ent2115)=0D + self.match(self.input, 104,=0D + self.FOLLOW_104_in_asm1_statement2115)=0D if self.failed:=0D return=0D - self.match(self.input, 43, self.FOLLOW_43_in_asm1_statemen= t2117)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_asm1_statement2117)=0D if self.failed:=0D return=0D # C.g:536:15: (~ ( '}' ) )*=0D - while True: #loop87=0D + while True: # loop87=0D alt87 =3D 2=0D LA87_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA87_0 <=3D 43) or (45 <=3D LA87_= 0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA87_0 <=3D 43) or (45 <=3D LA87_= 0 <=3D 117)):=0D alt87 =3D 1=0D =0D -=0D if alt87 =3D=3D 1:=0D # C.g:536:16: ~ ( '}' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D 43) or (= 45 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9207,23 +9065,17 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm1_s= tatement2120=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop87=0D + break # loop87=0D =0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_asm1_statemen= t2127)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_asm1_statement2127)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9237,9 +9089,9 @@ class CParser(Parser): =0D # $ANTLR end asm1_statement=0D =0D -=0D # $ANTLR start asm_statement=0D # C.g:539:1: asm_statement : '__asm' '{' (~ ( '}' ) )* '}' ;=0D +=0D def asm_statement(self, ):=0D =0D asm_statement_StartIndex =3D self.input.index()=0D @@ -9250,25 +9102,25 @@ class CParser(Parser): =0D # C.g:540:2: ( '__asm' '{' (~ ( '}' ) )* '}' )=0D # C.g:540:4: '__asm' '{' (~ ( '}' ) )* '}'=0D - self.match(self.input, 105, self.FOLLOW_105_in_asm_stateme= nt2138)=0D + self.match(self.input, 105,=0D + self.FOLLOW_105_in_asm_statement2138)=0D if self.failed:=0D return=0D self.match(self.input, 43, self.FOLLOW_43_in_asm_statement= 2140)=0D if self.failed:=0D return=0D # C.g:540:16: (~ ( '}' ) )*=0D - while True: #loop88=0D + while True: # loop88=0D alt88 =3D 2=0D LA88_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA88_0 <=3D 43) or (45 <=3D LA88_= 0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA88_0 <=3D 43) or (45 <=3D LA88_= 0 <=3D 117)):=0D alt88 =3D 1=0D =0D -=0D if alt88 =3D=3D 1:=0D # C.g:540:17: ~ ( '}' )=0D if (IDENTIFIER <=3D self.input.LA(1) <=3D 43) or (= 45 <=3D self.input.LA(1) <=3D 117):=0D - self.input.consume();=0D + self.input.consume()=0D self.errorRecovery =3D False=0D self.failed =3D False=0D =0D @@ -9280,23 +9132,16 @@ class CParser(Parser): mse =3D MismatchedSetException(None, self.inpu= t)=0D self.recoverFromMismatchedSet(=0D self.input, mse, self.FOLLOW_set_in_asm_st= atement2143=0D - )=0D + )=0D raise mse=0D =0D -=0D -=0D -=0D else:=0D - break #loop88=0D -=0D + break # loop88=0D =0D self.match(self.input, 44, self.FOLLOW_44_in_asm_statement= 2150)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -9310,9 +9155,9 @@ class CParser(Parser): =0D # $ANTLR end asm_statement=0D =0D -=0D # $ANTLR start macro_statement=0D # C.g:543:1: macro_statement : IDENTIFIER '(' ( declaration )* ( state= ment_list )? ( expression )? ')' ;=0D +=0D def macro_statement(self, ):=0D =0D macro_statement_StartIndex =3D self.input.index()=0D @@ -9323,14 +9168,16 @@ class CParser(Parser): =0D # C.g:544:2: ( IDENTIFIER '(' ( declaration )* ( statement= _list )? ( expression )? ')' )=0D # C.g:544:4: IDENTIFIER '(' ( declaration )* ( statement_l= ist )? ( expression )? ')'=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_macro_statement2162)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_macro_statement2162)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_macro_stateme= nt2164)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_macro_statement2164)=0D if self.failed:=0D return=0D # C.g:544:19: ( declaration )*=0D - while True: #loop89=0D + while True: # loop89=0D alt89 =3D 2=0D LA89 =3D self.input.LA(1)=0D if LA89 =3D=3D IDENTIFIER:=0D @@ -9338,1904 +9185,1622 @@ class CParser(Parser): if LA89 =3D=3D 62:=0D LA89_45 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_47 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 66:=0D LA89_50 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_68 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_71 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_72 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_73 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_74 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_75 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_76 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_77 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_78 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_79 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_80 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_81 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_82 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_83 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_84 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_85 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_86 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 26:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D=3D= 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_87 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_88 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_89 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_90 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_91 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_92 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_93 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_94 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_95 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_96 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_97 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_98 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_99 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_100 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 66:=0D LA89_101 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_102 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_103 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_104 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_105 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D=3D 3= 1 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_106 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_107 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_108 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_109 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_110 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_111 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_112 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_113 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_114 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_115 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_116 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_117 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_118 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_119 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_120 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_121 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_122 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_123 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_124 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_125 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 34:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_126 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_127 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_128 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_129 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_130 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_131 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_132 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_133 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_134 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_135 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_136 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_137 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_138 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_139 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_140 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_141 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_142 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_143 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_144 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_145 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 35:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_146 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_147 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_148 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_149 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_150 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_151 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_152 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_153 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_154 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_155 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_156 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_157 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_158 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_159 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_160 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_161 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_162 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_163 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_164 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_165 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 36:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_166 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_167 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_168 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_169 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_170 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_171 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_172 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_173 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_174 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_175 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_176 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_177 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_178 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_179 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_180 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_181 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_182 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_183 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_184 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_185 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 37:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_186 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_187 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_188 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_189 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_190 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_191 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_192 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_193 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_194 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_195 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_196 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_197 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_198 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_199 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_200 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_201 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_202 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_203 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_204 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_205 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 38:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_206 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_207 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_208 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_209 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_210 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_211 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_212 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_213 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_214 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_215 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_216 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_217 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_218 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_219 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_220 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_221 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_222 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_223 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_224 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_225 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 39:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_226 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_227 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_228 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_229 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_230 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_231 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_232 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_233 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_234 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_235 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_236 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_237 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_238 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_239 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_240 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_241 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_242 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_243 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_244 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_245 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 40:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_246 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_247 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_248 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_249 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_250 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_251 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_252 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_253 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_254 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_255 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_256 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_257 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_258 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_259 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_260 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_261 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_262 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_263 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_264 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_265 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 41:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_266 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_267 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_268 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_269 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_270 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_271 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_272 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_273 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_274 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_275 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_276 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_277 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_278 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_279 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_280 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_281 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_282 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_283 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_284 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_285 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 42:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_286 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_287 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_288 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_289 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_290 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_291 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_292 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_293 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_294 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_295 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_296 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_297 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_298 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_299 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_300 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_301 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_302 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_303 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_304 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_305 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_40 =3D self.input.LA(2)=0D =0D - if (LA89_40 =3D=3D IDENTIFIER) :=0D + if (LA89_40 =3D=3D IDENTIFIER):=0D LA89_306 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D - elif (LA89_40 =3D=3D 43) :=0D + elif (LA89_40 =3D=3D 43):=0D LA89_307 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D elif LA89 =3D=3D 48:=0D LA89_41 =3D self.input.LA(2)=0D =0D - if (LA89_41 =3D=3D 43) :=0D + if (LA89_41 =3D=3D 43):=0D LA89_308 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D - elif (LA89_41 =3D=3D IDENTIFIER) :=0D + elif (LA89_41 =3D=3D IDENTIFIER):=0D LA89_309 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D=3D 5= 1 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D 55 o= r LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 58 or LA89 =3D=3D 59 or L= A89 =3D=3D 60 or LA89 =3D=3D 61:=0D LA89 =3D self.input.LA(2)=0D if LA89 =3D=3D 66:=0D LA89_310 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 58:=0D LA89_311 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 59:=0D LA89_312 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 60:=0D LA89_313 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D IDENTIFIER:=0D LA89_314 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 62:=0D LA89_315 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 25:=0D LA89_316 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 29 or LA89 =3D=3D 30 or LA89 =3D= =3D 31 or LA89 =3D=3D 32 or LA89 =3D=3D 33:=0D LA89_317 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 34:=0D LA89_318 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 35:=0D LA89_319 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 36:=0D LA89_320 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 37:=0D LA89_321 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 38:=0D LA89_322 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 39:=0D LA89_323 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 40:=0D LA89_324 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 41:=0D LA89_325 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 42:=0D LA89_326 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 45 or LA89 =3D=3D 46:=0D LA89_327 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 48:=0D LA89_328 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D elif LA89 =3D=3D 49 or LA89 =3D=3D 50 or LA89 =3D= =3D 51 or LA89 =3D=3D 52 or LA89 =3D=3D 53 or LA89 =3D=3D 54 or LA89 =3D=3D= 55 or LA89 =3D=3D 56 or LA89 =3D=3D 57 or LA89 =3D=3D 61:=0D LA89_329 =3D self.input.LA(3)=0D =0D - if (self.synpred181()) :=0D + if (self.synpred181()):=0D alt89 =3D 1=0D =0D -=0D -=0D -=0D if alt89 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_in_m= acro_statement2166)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_macro_statement2166= )=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop89=0D -=0D + break # loop89=0D =0D # C.g:544:33: ( statement_list )?=0D alt90 =3D 2=0D @@ -11247,122 +10812,122 @@ class CParser(Parser): elif LA90 =3D=3D 62:=0D LA90_45 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_46 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_47 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 64:=0D LA90_48 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_49 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_50 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_51 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_52 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_53 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_54 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_55 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_56 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_57 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_58 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_59 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_60 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_61 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_62 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_63 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_64 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_65 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_66 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_67 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_70 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25 or LA90 =3D=3D 26 or LA90 =3D=3D 29 or= LA90 =3D=3D 30 or LA90 =3D=3D 31 or LA90 =3D=3D 32 or LA90 =3D=3D 33 or LA= 90 =3D=3D 34 or LA90 =3D=3D 35 or LA90 =3D=3D 36 or LA90 =3D=3D 37 or LA90 = =3D=3D 38 or LA90 =3D=3D 39 or LA90 =3D=3D 40 or LA90 =3D=3D 41 or LA90 =3D= =3D 42 or LA90 =3D=3D 43 or LA90 =3D=3D 45 or LA90 =3D=3D 46 or LA90 =3D=3D= 48 or LA90 =3D=3D 49 or LA90 =3D=3D 50 or LA90 =3D=3D 51 or LA90 =3D=3D 52= or LA90 =3D=3D 53 or LA90 =3D=3D 54 or LA90 =3D=3D 55 or LA90 =3D=3D 56 or= LA90 =3D=3D 57 or LA90 =3D=3D 58 or LA90 =3D=3D 59 or LA90 =3D=3D 60 or LA= 90 =3D=3D 61 or LA90 =3D=3D 103 or LA90 =3D=3D 104 or LA90 =3D=3D 105 or LA= 90 =3D=3D 106 or LA90 =3D=3D 107 or LA90 =3D=3D 108 or LA90 =3D=3D 110 or L= A90 =3D=3D 111 or LA90 =3D=3D 112 or LA90 =3D=3D 113 or LA90 =3D=3D 114 or = LA90 =3D=3D 115 or LA90 =3D=3D 116 or LA90 =3D=3D 117:=0D alt90 =3D 1=0D @@ -11371,112 +10936,112 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_87 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_88 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_89 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_90 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_91 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_92 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_93 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_94 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_95 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_96 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_97 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_98 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_99 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_100 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_101 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_102 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_103 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_104 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_105 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_106 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_107 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_108 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11485,226 +11050,226 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_111 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_112 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_113 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_114 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_115 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_116 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_117 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_118 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_119 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_120 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_121 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_122 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_123 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_124 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_125 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_126 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_127 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_128 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_129 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_130 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_131 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_134 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 64:=0D LA90_135 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_136 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_137 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_138 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_139 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_140 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_141 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_142 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_143 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_144 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_145 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_146 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_147 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_148 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_149 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_150 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_151 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_152 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_153 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_154 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_155 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_156 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11713,236 +11278,236 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_159 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_160 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_161 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_162 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_163 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_164 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_165 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_166 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_167 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_168 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_169 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_170 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_171 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_172 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_173 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_174 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_175 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_176 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_177 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_178 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_179 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_181 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_183 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 64:=0D LA90_184 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_185 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_186 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_187 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_188 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_189 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_190 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_191 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_192 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_193 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_194 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_195 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_196 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_197 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_198 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_199 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_200 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_201 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_202 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_203 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_204 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_205 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_206 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -11951,112 +11516,112 @@ class CParser(Parser): if LA90 =3D=3D 64:=0D LA90_209 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_210 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 75:=0D LA90_211 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66:=0D LA90_212 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 76:=0D LA90_213 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_214 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_215 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 28 or LA90 =3D=3D 80 or LA90 =3D=3D 8= 1 or LA90 =3D=3D 82 or LA90 =3D=3D 83 or LA90 =3D=3D 84 or LA90 =3D=3D 85 o= r LA90 =3D=3D 86 or LA90 =3D=3D 87 or LA90 =3D=3D 88 or LA90 =3D=3D 89:=0D LA90_216 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 70:=0D LA90_217 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 71:=0D LA90_218 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 68:=0D LA90_219 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 69:=0D LA90_220 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 101 or LA90 =3D=3D 102:=0D LA90_221 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 97 or LA90 =3D=3D 98 or LA90 =3D=3D 9= 9 or LA90 =3D=3D 100:=0D LA90_222 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 95 or LA90 =3D=3D 96:=0D LA90_223 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 77:=0D LA90_224 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 94:=0D LA90_225 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 93:=0D LA90_226 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 92:=0D LA90_227 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 91:=0D LA90_228 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 90:=0D LA90_229 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 27:=0D LA90_230 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 25:=0D alt90 =3D 1=0D @@ -12065,404 +11630,400 @@ class CParser(Parser): if LA90 =3D=3D IDENTIFIER:=0D LA90_233 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_234 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_235 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_236 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_237 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_238 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_239 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_240 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_241 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_242 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_243 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_244 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 49 or LA90 =3D=3D 50 or LA90 =3D=3D 5= 1 or LA90 =3D=3D 52 or LA90 =3D=3D 53 or LA90 =3D=3D 54 or LA90 =3D=3D 55 o= r LA90 =3D=3D 56 or LA90 =3D=3D 57 or LA90 =3D=3D 58 or LA90 =3D=3D 59 or L= A90 =3D=3D 60 or LA90 =3D=3D 61:=0D LA90_245 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 34:=0D LA90_246 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 35:=0D LA90_247 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 36:=0D LA90_248 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 37:=0D LA90_249 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 38:=0D LA90_250 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 39:=0D LA90_251 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 40:=0D LA90_252 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 41:=0D LA90_253 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 42:=0D LA90_254 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 45 or LA90 =3D=3D 46:=0D LA90_255 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 48:=0D LA90_256 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_257 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_258 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_259 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_260 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_261 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_262 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_263 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_264 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_265 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_266 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_267 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_268 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D IDENTIFIER:=0D LA90_269 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_270 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_271 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_272 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_273 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_274 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_275 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 62:=0D LA90_276 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_277 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_278 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_279 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_280 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 69 or= LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 62:=0D LA90_281 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_282 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_283 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_284 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_285 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_286 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_287 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_288 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_289 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_290 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_291 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_292 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90 =3D self.input.LA(2)=0D if LA90 =3D=3D 62:=0D LA90_293 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D IDENTIFIER:=0D LA90_294 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D HEX_LITERAL:=0D LA90_295 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D OCTAL_LITERAL:=0D LA90_296 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D DECIMAL_LITERAL:=0D LA90_297 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D CHARACTER_LITERAL:=0D LA90_298 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D STRING_LITERAL:=0D LA90_299 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D FLOATING_POINT_LITERAL:=0D LA90_300 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 72:=0D LA90_301 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 73:=0D LA90_302 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 66 or LA90 =3D=3D 68 or LA90 =3D=3D 6= 9 or LA90 =3D=3D 77 or LA90 =3D=3D 78 or LA90 =3D=3D 79:=0D LA90_303 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D elif LA90 =3D=3D 74:=0D LA90_304 =3D self.input.LA(3)=0D =0D - if (self.synpred182()) :=0D + if (self.synpred182()):=0D alt90 =3D 1=0D if alt90 =3D=3D 1:=0D # C.g:0:0: statement_list=0D - self.following.append(self.FOLLOW_statement_list_in_ma= cro_statement2170)=0D + self.following.append(=0D + self.FOLLOW_statement_list_in_macro_statement2170)= =0D self.statement_list()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D # C.g:544:49: ( expression )?=0D alt91 =3D 2=0D LA91_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA91_0 <=3D FLOATING_POINT_LITERAL) o= r LA91_0 =3D=3D 62 or LA91_0 =3D=3D 66 or (68 <=3D LA91_0 <=3D 69) or (72 <= =3D LA91_0 <=3D 74) or (77 <=3D LA91_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA91_0 <=3D FLOATING_POINT_LITERAL) o= r LA91_0 =3D=3D 62 or LA91_0 =3D=3D 66 or (68 <=3D LA91_0 <=3D 69) or (72 <= =3D LA91_0 <=3D 74) or (77 <=3D LA91_0 <=3D 79)):=0D alt91 =3D 1=0D if alt91 =3D=3D 1:=0D # C.g:0:0: expression=0D - self.following.append(self.FOLLOW_expression_in_macro_= statement2173)=0D + self.following.append(=0D + self.FOLLOW_expression_in_macro_statement2173)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_macro_stateme= nt2176)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_macro_statement2176)=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -12476,9 +12037,9 @@ class CParser(Parser): =0D # $ANTLR end macro_statement=0D =0D -=0D # $ANTLR start labeled_statement=0D # C.g:547:1: labeled_statement : ( IDENTIFIER ':' statement | 'case' c= onstant_expression ':' statement | 'default' ':' statement );=0D +=0D def labeled_statement(self, ):=0D =0D labeled_statement_StartIndex =3D self.input.index()=0D @@ -12501,61 +12062,68 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("547:1: labeled_statemen= t : ( IDENTIFIER ':' statement | 'case' constant_expression ':' statement |= 'default' ':' statement );", 92, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "547:1: labeled_statement : ( IDENTIFIER ':' state= ment | 'case' constant_expression ':' statement | 'default' ':' statement )= ;", 92, 0, self.input)=0D =0D raise nvae=0D =0D if alt92 =3D=3D 1:=0D # C.g:548:4: IDENTIFIER ':' statement=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_labeled_statement2188)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_labeled_statement= 2188)=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2190)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2190)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2192)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2192)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt92 =3D=3D 2:=0D # C.g:549:4: 'case' constant_expression ':' statement= =0D - self.match(self.input, 106, self.FOLLOW_106_in_labeled= _statement2197)=0D + self.match(self.input, 106,=0D + self.FOLLOW_106_in_labeled_statement2197)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_constant_expression_= in_labeled_statement2199)=0D + self.following.append(=0D + self.FOLLOW_constant_expression_in_labeled_stateme= nt2199)=0D self.constant_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2201)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2201)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2203)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2203)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D elif alt92 =3D=3D 3:=0D # C.g:550:4: 'default' ':' statement=0D - self.match(self.input, 107, self.FOLLOW_107_in_labeled= _statement2208)=0D + self.match(self.input, 107,=0D + self.FOLLOW_107_in_labeled_statement2208)=0D if self.failed:=0D return=0D - self.match(self.input, 47, self.FOLLOW_47_in_labeled_s= tatement2210)=0D + self.match(self.input, 47,=0D + self.FOLLOW_47_in_labeled_statement2210)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_labeled= _statement2212)=0D + self.following.append(=0D + self.FOLLOW_statement_in_labeled_statement2212)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -12574,10 +12142,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start compound_statement=0D # C.g:553:1: compound_statement : '{' ( declaration )* ( statement_lis= t )? '}' ;=0D +=0D def compound_statement(self, ):=0D =0D retval =3D self.compound_statement_return()=0D @@ -12590,11 +12157,12 @@ class CParser(Parser): =0D # C.g:554:2: ( '{' ( declaration )* ( statement_list )? '}= ' )=0D # C.g:554:4: '{' ( declaration )* ( statement_list )? '}'= =0D - self.match(self.input, 43, self.FOLLOW_43_in_compound_stat= ement2223)=0D + self.match(self.input, 43,=0D + self.FOLLOW_43_in_compound_statement2223)=0D if self.failed:=0D return retval=0D # C.g:554:8: ( declaration )*=0D - while True: #loop93=0D + while True: # loop93=0D alt93 =3D 2=0D LA93 =3D self.input.LA(1)=0D if LA93 =3D=3D IDENTIFIER:=0D @@ -12602,1930 +12170,1645 @@ class CParser(Parser): if LA93 =3D=3D 62:=0D LA93_44 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_47 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 66:=0D LA93_48 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_49 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_50 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_51 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_52 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_53 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_54 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_55 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_56 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_57 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_58 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_59 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_60 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_61 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_62 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_63 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_64 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_65 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 26:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D=3D= 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_86 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_87 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_88 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_89 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_90 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_91 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_92 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_93 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_94 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_95 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_96 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_97 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_98 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_99 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 66:=0D LA93_100 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_101 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_102 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_103 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_104 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D=3D 3= 1 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_105 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_106 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_107 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_108 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_109 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_110 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_111 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_112 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_113 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_114 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_115 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_116 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_117 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_118 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_119 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_120 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_121 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_122 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_123 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_124 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 34:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_125 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_126 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_127 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_128 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_129 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_130 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_131 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_132 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_133 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_134 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_135 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_136 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_137 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_138 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_139 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_140 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_141 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_142 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_143 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_144 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 35:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_145 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_146 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_147 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_148 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_149 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_150 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_151 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_152 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_153 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_154 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_155 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_156 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_157 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_158 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_159 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_160 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_161 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_162 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_163 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_164 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 36:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_165 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_166 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_167 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_168 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_169 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_170 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_171 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_172 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_173 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_174 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_175 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_176 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_177 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_178 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_179 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_180 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_181 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_182 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_183 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_184 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 37:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_185 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_186 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_187 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_188 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_189 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_190 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_191 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_192 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_193 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_194 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_195 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_196 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_197 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_198 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_199 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_200 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_201 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_202 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_203 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_204 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 38:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_205 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_206 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_207 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_208 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_209 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_210 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_211 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_212 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_213 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_214 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_215 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_216 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_217 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_218 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_219 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_220 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_221 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_222 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_223 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_224 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 39:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_225 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_226 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_227 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_228 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_229 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_230 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_231 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_232 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_233 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_234 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_235 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_236 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_237 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_238 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_239 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_240 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_241 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_242 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_243 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_244 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 40:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_245 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_246 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_247 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_248 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_249 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_250 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_251 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_252 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_253 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_254 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_255 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_256 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_257 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_258 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_259 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_260 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_261 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_262 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_263 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_264 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 41:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_265 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_266 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_267 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_268 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_269 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_270 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_271 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_272 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_273 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_274 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_275 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_276 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_277 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_278 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_279 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_280 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_281 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_282 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_283 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_284 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 42:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_285 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_286 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_287 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_288 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_289 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_290 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_291 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_292 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_293 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_294 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_295 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_296 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_297 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_298 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_299 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_300 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_301 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_302 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_303 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_304 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_40 =3D self.input.LA(2)=0D =0D - if (LA93_40 =3D=3D IDENTIFIER) :=0D + if (LA93_40 =3D=3D IDENTIFIER):=0D LA93_305 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D - elif (LA93_40 =3D=3D 43) :=0D + elif (LA93_40 =3D=3D 43):=0D LA93_306 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D elif LA93 =3D=3D 48:=0D LA93_41 =3D self.input.LA(2)=0D =0D - if (LA93_41 =3D=3D 43) :=0D + if (LA93_41 =3D=3D 43):=0D LA93_307 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D - elif (LA93_41 =3D=3D IDENTIFIER) :=0D + elif (LA93_41 =3D=3D IDENTIFIER):=0D LA93_308 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D=3D 5= 1 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D 55 o= r LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 58 or LA93 =3D=3D 59 or L= A93 =3D=3D 60 or LA93 =3D=3D 61:=0D LA93 =3D self.input.LA(2)=0D if LA93 =3D=3D 66:=0D LA93_309 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 58:=0D LA93_310 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 59:=0D LA93_311 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 60:=0D LA93_312 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D IDENTIFIER:=0D LA93_313 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 62:=0D LA93_314 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 25:=0D LA93_315 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 29 or LA93 =3D=3D 30 or LA93 =3D= =3D 31 or LA93 =3D=3D 32 or LA93 =3D=3D 33:=0D LA93_316 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 34:=0D LA93_317 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 35:=0D LA93_318 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 36:=0D LA93_319 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 37:=0D LA93_320 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 38:=0D LA93_321 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 39:=0D LA93_322 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 40:=0D LA93_323 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 41:=0D LA93_324 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 42:=0D LA93_325 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 45 or LA93 =3D=3D 46:=0D LA93_326 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 48:=0D LA93_327 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D elif LA93 =3D=3D 49 or LA93 =3D=3D 50 or LA93 =3D= =3D 51 or LA93 =3D=3D 52 or LA93 =3D=3D 53 or LA93 =3D=3D 54 or LA93 =3D=3D= 55 or LA93 =3D=3D 56 or LA93 =3D=3D 57 or LA93 =3D=3D 61:=0D LA93_328 =3D self.input.LA(3)=0D =0D - if (self.synpred186()) :=0D + if (self.synpred186()):=0D alt93 =3D 1=0D =0D -=0D -=0D -=0D if alt93 =3D=3D 1:=0D # C.g:0:0: declaration=0D - self.following.append(self.FOLLOW_declaration_in_c= ompound_statement2225)=0D + self.following.append(=0D + self.FOLLOW_declaration_in_compound_statement2= 225)=0D self.declaration()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D else:=0D - break #loop93=0D -=0D + break # loop93=0D =0D # C.g:554:21: ( statement_list )?=0D alt94 =3D 2=0D LA94_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA94_0 <=3D FLOATING_POINT_LITERAL) o= r (25 <=3D LA94_0 <=3D 26) or (29 <=3D LA94_0 <=3D 43) or (45 <=3D LA94_0 <= =3D 46) or (48 <=3D LA94_0 <=3D 62) or LA94_0 =3D=3D 66 or (68 <=3D LA94_0 = <=3D 69) or (72 <=3D LA94_0 <=3D 74) or (77 <=3D LA94_0 <=3D 79) or (103 <= =3D LA94_0 <=3D 108) or (110 <=3D LA94_0 <=3D 117)) :=0D + if ((IDENTIFIER <=3D LA94_0 <=3D FLOATING_POINT_LITERAL) o= r (25 <=3D LA94_0 <=3D 26) or (29 <=3D LA94_0 <=3D 43) or (45 <=3D LA94_0 <= =3D 46) or (48 <=3D LA94_0 <=3D 62) or LA94_0 =3D=3D 66 or (68 <=3D LA94_0 = <=3D 69) or (72 <=3D LA94_0 <=3D 74) or (77 <=3D LA94_0 <=3D 79) or (103 <= =3D LA94_0 <=3D 108) or (110 <=3D LA94_0 <=3D 117)):=0D alt94 =3D 1=0D if alt94 =3D=3D 1:=0D # C.g:0:0: statement_list=0D - self.following.append(self.FOLLOW_statement_list_in_co= mpound_statement2228)=0D + self.following.append(=0D + self.FOLLOW_statement_list_in_compound_statement22= 28)=0D self.statement_list()=0D self.following.pop()=0D if self.failed:=0D return retval=0D =0D -=0D -=0D - self.match(self.input, 44, self.FOLLOW_44_in_compound_stat= ement2231)=0D + self.match(self.input, 44,=0D + self.FOLLOW_44_in_compound_statement2231)=0D if self.failed:=0D return retval=0D =0D -=0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -14539,9 +13822,9 @@ class CParser(Parser): =0D # $ANTLR end compound_statement=0D =0D -=0D # $ANTLR start statement_list=0D # C.g:557:1: statement_list : ( statement )+ ;=0D +=0D def statement_list(self, ):=0D =0D statement_list_StartIndex =3D self.input.index()=0D @@ -14554,7 +13837,7 @@ class CParser(Parser): # C.g:558:4: ( statement )+=0D # C.g:558:4: ( statement )+=0D cnt95 =3D 0=0D - while True: #loop95=0D + while True: # loop95=0D alt95 =3D 2=0D LA95 =3D self.input.LA(1)=0D if LA95 =3D=3D IDENTIFIER:=0D @@ -14562,330 +13845,283 @@ class CParser(Parser): if LA95 =3D=3D 62:=0D LA95_46 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25 or LA95 =3D=3D 29 or LA95 =3D= =3D 30 or LA95 =3D=3D 31 or LA95 =3D=3D 32 or LA95 =3D=3D 33 or LA95 =3D=3D= 34 or LA95 =3D=3D 35 or LA95 =3D=3D 36 or LA95 =3D=3D 37 or LA95 =3D=3D 38= or LA95 =3D=3D 39 or LA95 =3D=3D 40 or LA95 =3D=3D 41 or LA95 =3D=3D 42 or= LA95 =3D=3D 45 or LA95 =3D=3D 46 or LA95 =3D=3D 47 or LA95 =3D=3D 48 or LA= 95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D=3D 51 or LA95 =3D=3D 52 or LA95 = =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D 55 or LA95 =3D=3D 56 or LA95 =3D= =3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59 or LA95 =3D=3D 60 or LA95 =3D=3D= 61:=0D alt95 =3D 1=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_48 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_49 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 64:=0D LA95_50 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_51 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_52 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_53 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_54 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_55 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_56 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_57 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_58 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_59 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_60 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_61 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_62 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_63 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_64 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_65 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_66 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_67 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_68 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_69 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_88 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 64:=0D LA95_89 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_90 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_91 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_92 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_93 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_94 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_95 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_96 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_97 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_98 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_99 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_100 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_101 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_102 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_103 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_104 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_105 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_106 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_107 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_108 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_109 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_110 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -14894,157 +14130,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_113 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_114 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_115 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_116 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_117 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_118 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_119 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_120 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_121 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_122 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_123 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_124 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_125 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_126 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_127 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_128 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_129 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_130 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_131 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_132 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_133 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_135 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15053,157 +14267,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_137 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_138 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_139 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_140 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_141 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_142 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_143 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_144 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_145 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_146 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_147 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_148 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_149 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_150 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_151 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_152 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_153 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_154 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_155 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_156 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_157 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_158 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15212,157 +14404,135 @@ class CParser(Parser): if LA95 =3D=3D 64:=0D LA95_161 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_162 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_163 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_164 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_165 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_166 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_167 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_168 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_169 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_170 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_171 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_172 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_173 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_174 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_175 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_176 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_177 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_178 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_179 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_180 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_181 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_182 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D =0D @@ -15371,867 +14541,742 @@ class CParser(Parser): if LA95 =3D=3D IDENTIFIER:=0D LA95_185 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 64:=0D LA95_186 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_187 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_188 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_189 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_190 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_191 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_192 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_193 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_194 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_195 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_196 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_197 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_198 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_199 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_200 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_201 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_202 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_203 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_204 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_205 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_206 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_208 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_209 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 64:=0D LA95_211 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_212 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 75:=0D LA95_213 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66:=0D LA95_214 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 76:=0D LA95_215 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_216 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_217 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 70:=0D LA95_218 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 71:=0D LA95_219 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 68:=0D LA95_220 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 69:=0D LA95_221 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 101 or LA95 =3D=3D 102:=0D LA95_222 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 97 or LA95 =3D=3D 98 or LA95 =3D= =3D 99 or LA95 =3D=3D 100:=0D LA95_223 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 95 or LA95 =3D=3D 96:=0D LA95_224 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 77:=0D LA95_225 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 94:=0D LA95_226 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 93:=0D LA95_227 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 92:=0D LA95_228 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 91:=0D LA95_229 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 90:=0D LA95_230 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 27:=0D LA95_231 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 25:=0D alt95 =3D 1=0D elif LA95 =3D=3D 28 or LA95 =3D=3D 80 or LA95 =3D= =3D 81 or LA95 =3D=3D 82 or LA95 =3D=3D 83 or LA95 =3D=3D 84 or LA95 =3D=3D= 85 or LA95 =3D=3D 86 or LA95 =3D=3D 87 or LA95 =3D=3D 88 or LA95 =3D=3D 89= :=0D LA95_234 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 62:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_235 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_236 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_237 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_238 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_239 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_240 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_241 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_242 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_243 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_244 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_245 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_246 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D= =3D 51 or LA95 =3D=3D 52 or LA95 =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D= 55 or LA95 =3D=3D 56 or LA95 =3D=3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59= or LA95 =3D=3D 60 or LA95 =3D=3D 61:=0D LA95_247 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 34:=0D LA95_248 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 35:=0D LA95_249 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 36:=0D LA95_250 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 37:=0D LA95_251 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 38:=0D LA95_252 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 39:=0D LA95_253 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 40:=0D LA95_254 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 41:=0D LA95_255 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 42:=0D LA95_256 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 45 or LA95 =3D=3D 46:=0D LA95_257 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 48:=0D LA95_258 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 72:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_259 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_260 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_261 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_262 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_263 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_264 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_265 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_266 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_267 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_268 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_269 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_270 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 73:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D IDENTIFIER:=0D LA95_271 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_272 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_273 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_274 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_275 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_276 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_277 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 62:=0D LA95_278 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_279 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_280 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_281 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_282 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D=3D 6= 9 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 62:=0D LA95_283 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_284 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_285 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_286 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_287 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_288 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_289 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_290 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_291 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_292 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_293 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_294 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 74:=0D LA95 =3D self.input.LA(2)=0D if LA95 =3D=3D 62:=0D LA95_295 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D IDENTIFIER:=0D LA95_296 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D HEX_LITERAL:=0D LA95_297 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D OCTAL_LITERAL:=0D LA95_298 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D DECIMAL_LITERAL:=0D LA95_299 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D CHARACTER_LITERAL:=0D LA95_300 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D STRING_LITERAL:=0D LA95_301 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D FLOATING_POINT_LITERAL:=0D LA95_302 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 72:=0D LA95_303 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 73:=0D LA95_304 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 66 or LA95 =3D=3D 68 or LA95 =3D= =3D 69 or LA95 =3D=3D 77 or LA95 =3D=3D 78 or LA95 =3D=3D 79:=0D LA95_305 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D elif LA95 =3D=3D 74:=0D LA95_306 =3D self.input.LA(3)=0D =0D - if (self.synpred188()) :=0D + if (self.synpred188()):=0D alt95 =3D 1=0D =0D -=0D -=0D elif LA95 =3D=3D 25 or LA95 =3D=3D 26 or LA95 =3D=3D 2= 9 or LA95 =3D=3D 30 or LA95 =3D=3D 31 or LA95 =3D=3D 32 or LA95 =3D=3D 33 o= r LA95 =3D=3D 34 or LA95 =3D=3D 35 or LA95 =3D=3D 36 or LA95 =3D=3D 37 or L= A95 =3D=3D 38 or LA95 =3D=3D 39 or LA95 =3D=3D 40 or LA95 =3D=3D 41 or LA95= =3D=3D 42 or LA95 =3D=3D 43 or LA95 =3D=3D 45 or LA95 =3D=3D 46 or LA95 = =3D=3D 48 or LA95 =3D=3D 49 or LA95 =3D=3D 50 or LA95 =3D=3D 51 or LA95 =3D= =3D 52 or LA95 =3D=3D 53 or LA95 =3D=3D 54 or LA95 =3D=3D 55 or LA95 =3D=3D= 56 or LA95 =3D=3D 57 or LA95 =3D=3D 58 or LA95 =3D=3D 59 or LA95 =3D=3D 60= or LA95 =3D=3D 61 or LA95 =3D=3D 103 or LA95 =3D=3D 104 or LA95 =3D=3D 105= or LA95 =3D=3D 106 or LA95 =3D=3D 107 or LA95 =3D=3D 108 or LA95 =3D=3D 11= 0 or LA95 =3D=3D 111 or LA95 =3D=3D 112 or LA95 =3D=3D 113 or LA95 =3D=3D 1= 14 or LA95 =3D=3D 115 or LA95 =3D=3D 116 or LA95 =3D=3D 117:=0D alt95 =3D 1=0D =0D if alt95 =3D=3D 1:=0D # C.g:0:0: statement=0D - self.following.append(self.FOLLOW_statement_in_sta= tement_list2242)=0D + self.following.append(=0D + self.FOLLOW_statement_in_statement_list2242)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt95 >=3D 1:=0D - break #loop95=0D + break # loop95=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -16242,11 +15287,6 @@ class CParser(Parser): =0D cnt95 +=3D 1=0D =0D -=0D -=0D -=0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16265,10 +15305,9 @@ class CParser(Parser): self.start =3D None=0D self.stop =3D None=0D =0D -=0D -=0D # $ANTLR start expression_statement=0D # C.g:561:1: expression_statement : ( ';' | expression ';' );=0D +=0D def expression_statement(self, ):=0D =0D retval =3D self.expression_statement_return()=0D @@ -16283,41 +15322,42 @@ class CParser(Parser): alt96 =3D 2=0D LA96_0 =3D self.input.LA(1)=0D =0D - if (LA96_0 =3D=3D 25) :=0D + if (LA96_0 =3D=3D 25):=0D alt96 =3D 1=0D - elif ((IDENTIFIER <=3D LA96_0 <=3D FLOATING_POINT_LITERAL)= or LA96_0 =3D=3D 62 or LA96_0 =3D=3D 66 or (68 <=3D LA96_0 <=3D 69) or (72= <=3D LA96_0 <=3D 74) or (77 <=3D LA96_0 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA96_0 <=3D FLOATING_POINT_LITERAL)= or LA96_0 =3D=3D 62 or LA96_0 =3D=3D 66 or (68 <=3D LA96_0 <=3D 69) or (72= <=3D LA96_0 <=3D 74) or (77 <=3D LA96_0 <=3D 79)):=0D alt96 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return retval=0D =0D - nvae =3D NoViableAltException("561:1: expression_state= ment : ( ';' | expression ';' );", 96, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "561:1: expression_statement : ( ';' | expression = ';' );", 96, 0, self.input)=0D =0D raise nvae=0D =0D if alt96 =3D=3D 1:=0D # C.g:562:4: ';'=0D - self.match(self.input, 25, self.FOLLOW_25_in_expressio= n_statement2254)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_expression_statement2254)= =0D if self.failed:=0D return retval=0D =0D -=0D elif alt96 =3D=3D 2:=0D # C.g:563:4: expression ';'=0D - self.following.append(self.FOLLOW_expression_in_expres= sion_statement2259)=0D + self.following.append(=0D + self.FOLLOW_expression_in_expression_statement2259= )=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return retval=0D - self.match(self.input, 25, self.FOLLOW_25_in_expressio= n_statement2261)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_expression_statement2261)= =0D if self.failed:=0D return retval=0D =0D -=0D retval.stop =3D self.input.LT(-1)=0D =0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16331,15 +15371,14 @@ class CParser(Parser): =0D # $ANTLR end expression_statement=0D =0D -=0D # $ANTLR start selection_statement=0D # C.g:566:1: selection_statement : ( 'if' '(' e=3D expression ')' stat= ement ( options {k=3D1; backtrack=3Dfalse; } : 'else' statement )? | 'switc= h' '(' expression ')' statement );=0D +=0D def selection_statement(self, ):=0D =0D selection_statement_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 69):=0D @@ -16349,39 +15388,46 @@ class CParser(Parser): alt98 =3D 2=0D LA98_0 =3D self.input.LA(1)=0D =0D - if (LA98_0 =3D=3D 108) :=0D + if (LA98_0 =3D=3D 108):=0D alt98 =3D 1=0D - elif (LA98_0 =3D=3D 110) :=0D + elif (LA98_0 =3D=3D 110):=0D alt98 =3D 2=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "566:1: selection_statement : ( 'if' '(' e=3D expr= ession ')' statement ( options {k=3D1; backtrack=3Dfalse; } : 'else' statem= ent )? | 'switch' '(' expression ')' statement );", 98, 0, self.input)=0D =0D raise nvae=0D =0D if alt98 =3D=3D 1:=0D # C.g:567:4: 'if' '(' e=3D expression ')' statement ( = options {k=3D1; backtrack=3Dfalse; } : 'else' statement )?=0D - self.match(self.input, 108, self.FOLLOW_108_in_selecti= on_statement2272)=0D + self.match(self.input, 108,=0D + self.FOLLOW_108_in_selection_statement2272)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2274)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_selection_statement2274)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_select= ion_statement2278)=0D + self.following.append(=0D + self.FOLLOW_expression_in_selection_statement2278)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2280)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_selection_statement2280)= =0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D - self.following.append(self.FOLLOW_statement_in_selecti= on_statement2284)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement2284)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D @@ -16390,47 +15436,48 @@ class CParser(Parser): alt97 =3D 2=0D LA97_0 =3D self.input.LA(1)=0D =0D - if (LA97_0 =3D=3D 109) :=0D + if (LA97_0 =3D=3D 109):=0D alt97 =3D 1=0D if alt97 =3D=3D 1:=0D # C.g:567:200: 'else' statement=0D - self.match(self.input, 109, self.FOLLOW_109_in_sel= ection_statement2299)=0D + self.match(self.input, 109,=0D + self.FOLLOW_109_in_selection_statement2= 299)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_sel= ection_statement2301)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement23= 01)=0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D elif alt98 =3D=3D 2:=0D # C.g:568:4: 'switch' '(' expression ')' statement=0D - self.match(self.input, 110, self.FOLLOW_110_in_selecti= on_statement2308)=0D + self.match(self.input, 110,=0D + self.FOLLOW_110_in_selection_statement2308)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_selection= _statement2310)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_selection_statement2310)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_select= ion_statement2312)=0D + self.following.append(=0D + self.FOLLOW_expression_in_selection_statement2312)= =0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_selection= _statement2314)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_selection_statement2314)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_selecti= on_statement2316)=0D + self.following.append(=0D + self.FOLLOW_statement_in_selection_statement2316)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16444,15 +15491,14 @@ class CParser(Parser): =0D # $ANTLR end selection_statement=0D =0D -=0D # $ANTLR start iteration_statement=0D # C.g:571:1: iteration_statement : ( 'while' '(' e=3D expression ')' s= tatement | 'do' statement 'while' '(' e=3D expression ')' ';' | 'for' '(' e= xpression_statement e=3D expression_statement ( expression )? ')' statement= );=0D +=0D def iteration_statement(self, ):=0D =0D iteration_statement_StartIndex =3D self.input.index()=0D e =3D None=0D =0D -=0D try:=0D try:=0D if self.backtracking > 0 and self.alreadyParsedRule(self.i= nput, 70):=0D @@ -16472,82 +15518,97 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - 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)=0D + nvae =3D NoViableAltException(=0D + "571:1: iteration_statement : ( 'while' '(' e=3D e= xpression ')' statement | 'do' statement 'while' '(' e=3D expression ')' ';= ' | 'for' '(' expression_statement e=3D expression_statement ( expression )= ? ')' statement );", 100, 0, self.input)=0D =0D raise nvae=0D =0D if alt100 =3D=3D 1:=0D # C.g:572:4: 'while' '(' e=3D expression ')' statement= =0D - self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2327)=0D + self.match(self.input, 111,=0D + self.FOLLOW_111_in_iteration_statement2327)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2329)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2329)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2333)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2333)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2335)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2335)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2337)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2337)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D elif alt100 =3D=3D 2:=0D # C.g:573:4: 'do' statement 'while' '(' e=3D expressio= n ')' ';'=0D - self.match(self.input, 112, self.FOLLOW_112_in_iterati= on_statement2344)=0D + self.match(self.input, 112,=0D + self.FOLLOW_112_in_iteration_statement2344)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2346)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2346)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 111, self.FOLLOW_111_in_iterati= on_statement2348)=0D + self.match(self.input, 111,=0D + self.FOLLOW_111_in_iteration_statement2348)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2350)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2350)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_iterat= ion_statement2354)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2354)= =0D e =3D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2356)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2356)= =0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_iteration= _statement2358)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_iteration_statement2358)= =0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D elif alt100 =3D=3D 3:=0D # C.g:574:4: 'for' '(' expression_statement e=3D expre= ssion_statement ( expression )? ')' statement=0D - self.match(self.input, 113, self.FOLLOW_113_in_iterati= on_statement2365)=0D + self.match(self.input, 113,=0D + self.FOLLOW_113_in_iteration_statement2365)= =0D if self.failed:=0D return=0D - self.match(self.input, 62, self.FOLLOW_62_in_iteration= _statement2367)=0D + self.match(self.input, 62,=0D + self.FOLLOW_62_in_iteration_statement2367)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2369)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_iteration_stat= ement2369)=0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_statement= _in_iteration_statement2373)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_iteration_stat= ement2373)=0D e =3D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D @@ -16556,31 +15617,30 @@ class CParser(Parser): alt99 =3D 2=0D LA99_0 =3D self.input.LA(1)=0D =0D - if ((IDENTIFIER <=3D LA99_0 <=3D FLOATING_POINT_LITERA= L) or LA99_0 =3D=3D 62 or LA99_0 =3D=3D 66 or (68 <=3D LA99_0 <=3D 69) or (= 72 <=3D LA99_0 <=3D 74) or (77 <=3D LA99_0 <=3D 79)) :=0D + if ((IDENTIFIER <=3D LA99_0 <=3D FLOATING_POINT_LITERA= L) or LA99_0 =3D=3D 62 or LA99_0 =3D=3D 66 or (68 <=3D LA99_0 <=3D 69) or (= 72 <=3D LA99_0 <=3D 74) or (77 <=3D LA99_0 <=3D 79)):=0D alt99 =3D 1=0D if alt99 =3D=3D 1:=0D # C.g:0:0: expression=0D - self.following.append(self.FOLLOW_expression_in_it= eration_statement2375)=0D + self.following.append(=0D + self.FOLLOW_expression_in_iteration_statement2= 375)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D - self.match(self.input, 63, self.FOLLOW_63_in_iteration= _statement2378)=0D + self.match(self.input, 63,=0D + self.FOLLOW_63_in_iteration_statement2378)= =0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_statement_in_iterati= on_statement2380)=0D + self.following.append(=0D + self.FOLLOW_statement_in_iteration_statement2380)= =0D self.statement()=0D self.following.pop()=0D if self.failed:=0D return=0D if self.backtracking =3D=3D 0:=0D - self.StorePredicateExpression(e.start.line, e.star= t.charPositionInLine, e.stop.line, e.stop.charPositionInLine, self.input.to= String(e.start, e.stop))=0D -=0D -=0D -=0D + self.StorePredicateExpression(=0D + e.start.line, e.start.charPositionInLine, e.st= op.line, e.stop.charPositionInLine, self.input.toString(e.start, e.stop))=0D =0D except RecognitionException as re:=0D self.reportError(re)=0D @@ -16595,9 +15655,9 @@ class CParser(Parser): =0D # $ANTLR end iteration_statement=0D =0D -=0D # $ANTLR start jump_statement=0D # C.g:577:1: jump_statement : ( 'goto' IDENTIFIER ';' | 'continue' ';'= | 'break' ';' | 'return' ';' | 'return' expression ';' );=0D +=0D def jump_statement(self, ):=0D =0D jump_statement_StartIndex =3D self.input.index()=0D @@ -16618,16 +15678,17 @@ class CParser(Parser): elif LA101 =3D=3D 117:=0D LA101_4 =3D self.input.LA(2)=0D =0D - if (LA101_4 =3D=3D 25) :=0D + if (LA101_4 =3D=3D 25):=0D alt101 =3D 4=0D - elif ((IDENTIFIER <=3D LA101_4 <=3D FLOATING_POINT_LIT= ERAL) or LA101_4 =3D=3D 62 or LA101_4 =3D=3D 66 or (68 <=3D LA101_4 <=3D 69= ) or (72 <=3D LA101_4 <=3D 74) or (77 <=3D LA101_4 <=3D 79)) :=0D + elif ((IDENTIFIER <=3D LA101_4 <=3D FLOATING_POINT_LIT= ERAL) or LA101_4 =3D=3D 62 or LA101_4 =3D=3D 66 or (68 <=3D LA101_4 <=3D 69= ) or (72 <=3D LA101_4 <=3D 74) or (77 <=3D LA101_4 <=3D 79)):=0D alt101 =3D 5=0D else:=0D if self.backtracking > 0:=0D self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("577:1: jump_stateme= nt : ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' = | 'return' expression ';' );", 101, 4, self.input)=0D + nvae =3D NoViableAltException(=0D + "577:1: jump_statement : ( 'goto' IDENTIFIER '= ;' | 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' = );", 101, 4, self.input)=0D =0D raise nvae=0D =0D @@ -16636,69 +15697,76 @@ class CParser(Parser): self.failed =3D True=0D return=0D =0D - nvae =3D NoViableAltException("577:1: jump_statement := ( 'goto' IDENTIFIER ';' | 'continue' ';' | 'break' ';' | 'return' ';' | 'r= eturn' expression ';' );", 101, 0, self.input)=0D + nvae =3D NoViableAltException(=0D + "577:1: jump_statement : ( 'goto' IDENTIFIER ';' |= 'continue' ';' | 'break' ';' | 'return' ';' | 'return' expression ';' );",= 101, 0, self.input)=0D =0D raise nvae=0D =0D if alt101 =3D=3D 1:=0D # C.g:578:4: 'goto' IDENTIFIER ';'=0D - self.match(self.input, 114, self.FOLLOW_114_in_jump_st= atement2393)=0D + self.match(self.input, 114,=0D + self.FOLLOW_114_in_jump_statement2393)=0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIF= IER_in_jump_statement2395)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_jump_statement239= 5)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2397)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2397)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 2:=0D # C.g:579:4: 'continue' ';'=0D - self.match(self.input, 115, self.FOLLOW_115_in_jump_st= atement2402)=0D + self.match(self.input, 115,=0D + self.FOLLOW_115_in_jump_statement2402)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2404)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2404)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 3:=0D # C.g:580:4: 'break' ';'=0D - self.match(self.input, 116, self.FOLLOW_116_in_jump_st= atement2409)=0D + self.match(self.input, 116,=0D + self.FOLLOW_116_in_jump_statement2409)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2411)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2411)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 4:=0D # C.g:581:4: 'return' ';'=0D - self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2416)=0D + self.match(self.input, 117,=0D + self.FOLLOW_117_in_jump_statement2416)=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2418)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2418)=0D if self.failed:=0D return=0D =0D -=0D elif alt101 =3D=3D 5:=0D # C.g:582:4: 'return' expression ';'=0D - self.match(self.input, 117, self.FOLLOW_117_in_jump_st= atement2423)=0D + self.match(self.input, 117,=0D + self.FOLLOW_117_in_jump_statement2423)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_expression_in_jump_s= tatement2425)=0D + self.following.append(=0D + self.FOLLOW_expression_in_jump_statement2425)=0D self.expression()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.match(self.input, 25, self.FOLLOW_25_in_jump_stat= ement2427)=0D + self.match(self.input, 25,=0D + self.FOLLOW_25_in_jump_statement2427)=0D if self.failed:=0D return=0D =0D -=0D -=0D except RecognitionException as re:=0D self.reportError(re)=0D self.recover(self.input, re)=0D @@ -16716,18 +15784,17 @@ class CParser(Parser): def synpred2_fragment(self, ):=0D # C.g:119:6: ( declaration_specifiers )=0D # C.g:119:6: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d2100)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred2100)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred2=0D =0D -=0D -=0D # $ANTLR start synpred4=0D +=0D def synpred4_fragment(self, ):=0D # C.g:119:4: ( ( declaration_specifiers )? declarator ( declaratio= n )* '{' )=0D # C.g:119:6: ( declaration_specifiers )? declarator ( declaration = )* '{'=0D @@ -16741,134 +15808,132 @@ class CParser(Parser): if LA102 =3D=3D 62:=0D LA102_21 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 29 or LA102 =3D=3D 30 or LA102 =3D=3D 31 or = LA102 =3D=3D 32 or LA102 =3D=3D 33:=0D LA102_23 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 34:=0D LA102_24 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 35:=0D LA102_25 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 36:=0D LA102_26 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 37:=0D LA102_27 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 38:=0D LA102_28 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 39:=0D LA102_29 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 40:=0D LA102_30 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 41:=0D LA102_31 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 42:=0D LA102_32 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 45 or LA102 =3D=3D 46:=0D LA102_33 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 48:=0D LA102_34 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D IDENTIFIER:=0D LA102_35 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 58:=0D LA102_36 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 66:=0D alt102 =3D 1=0D elif LA102 =3D=3D 59:=0D LA102_39 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 60:=0D LA102_40 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 49 or LA102 =3D=3D 50 or LA102 =3D=3D 51 or = LA102 =3D=3D 52 or LA102 =3D=3D 53 or LA102 =3D=3D 54 or LA102 =3D=3D 55 or= LA102 =3D=3D 56 or LA102 =3D=3D 57 or LA102 =3D=3D 61:=0D LA102_41 =3D self.input.LA(3)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 58:=0D LA102_14 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 59:=0D LA102_16 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D elif LA102 =3D=3D 60:=0D LA102_17 =3D self.input.LA(2)=0D =0D - if (self.synpred2()) :=0D + if (self.synpred2()):=0D alt102 =3D 1=0D if alt102 =3D=3D 1:=0D # C.g:0:0: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_sy= npred4100)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred4100)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D self.following.append(self.FOLLOW_declarator_in_synpred4103)=0D self.declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:119:41: ( declaration )*=0D - while True: #loop103=0D + while True: # loop103=0D alt103 =3D 2=0D LA103_0 =3D self.input.LA(1)=0D =0D - if (LA103_0 =3D=3D IDENTIFIER or LA103_0 =3D=3D 26 or (29 <=3D= LA103_0 <=3D 42) or (45 <=3D LA103_0 <=3D 46) or (48 <=3D LA103_0 <=3D 61)= ) :=0D + if (LA103_0 =3D=3D IDENTIFIER or LA103_0 =3D=3D 26 or (29 <=3D= LA103_0 <=3D 42) or (45 <=3D LA103_0 <=3D 46) or (48 <=3D LA103_0 <=3D 61)= ):=0D alt103 =3D 1=0D =0D -=0D if alt103 =3D=3D 1:=0D # C.g:0:0: declaration=0D self.following.append(self.FOLLOW_declaration_in_synpred41= 05)=0D @@ -16877,21 +15942,17 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop103=0D -=0D + break # loop103=0D =0D self.match(self.input, 43, self.FOLLOW_43_in_synpred4108)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred4=0D =0D -=0D -=0D # $ANTLR start synpred5=0D +=0D def synpred5_fragment(self, ):=0D # C.g:120:4: ( declaration )=0D # C.g:120:4: declaration=0D @@ -16901,42 +15962,38 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred5=0D =0D -=0D -=0D # $ANTLR start synpred7=0D +=0D def synpred7_fragment(self, ):=0D # C.g:146:6: ( declaration_specifiers )=0D # C.g:146:6: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d7157)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred7157)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred7=0D =0D -=0D -=0D # $ANTLR start synpred10=0D +=0D def synpred10_fragment(self, ):=0D # C.g:167:18: ( declaration_specifiers )=0D # C.g:167:18: declaration_specifiers=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d10207)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred10207)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred10=0D =0D -=0D -=0D # $ANTLR start synpred14=0D +=0D def synpred14_fragment(self, ):=0D # C.g:184:7: ( type_specifier )=0D # C.g:184:7: type_specifier=0D @@ -16946,12 +16003,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred14=0D =0D -=0D -=0D # $ANTLR start synpred15=0D +=0D def synpred15_fragment(self, ):=0D # C.g:185:13: ( type_qualifier )=0D # C.g:185:13: type_qualifier=0D @@ -16961,12 +16016,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred15=0D =0D -=0D -=0D # $ANTLR start synpred33=0D +=0D def synpred33_fragment(self, ):=0D # C.g:225:16: ( type_qualifier )=0D # C.g:225:16: type_qualifier=0D @@ -16976,58 +16029,53 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred33=0D =0D -=0D -=0D # $ANTLR start synpred34=0D +=0D def synpred34_fragment(self, ):=0D # C.g:225:4: ( IDENTIFIER ( type_qualifier )* declarator )=0D # C.g:225:5: IDENTIFIER ( type_qualifier )* declarator=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed34442)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred34442)=0D if self.failed:=0D return=0D # C.g:225:16: ( type_qualifier )*=0D - while True: #loop106=0D + while True: # loop106=0D alt106 =3D 2=0D LA106 =3D self.input.LA(1)=0D if LA106 =3D=3D 58:=0D LA106_2 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 59:=0D LA106_3 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 60:=0D LA106_4 =3D self.input.LA(2)=0D =0D - if (self.synpred33()) :=0D + if (self.synpred33()):=0D alt106 =3D 1=0D =0D -=0D elif LA106 =3D=3D 49 or LA106 =3D=3D 50 or LA106 =3D=3D 51 or = LA106 =3D=3D 52 or LA106 =3D=3D 53 or LA106 =3D=3D 54 or LA106 =3D=3D 55 or= LA106 =3D=3D 56 or LA106 =3D=3D 57 or LA106 =3D=3D 61:=0D alt106 =3D 1=0D =0D if alt106 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_in_synpre= d34444)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_synpred34444)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop106=0D -=0D + break # loop106=0D =0D self.following.append(self.FOLLOW_declarator_in_synpred34447)=0D self.declarator()=0D @@ -17035,12 +16083,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred34=0D =0D -=0D -=0D # $ANTLR start synpred39=0D +=0D def synpred39_fragment(self, ):=0D # C.g:253:6: ( type_qualifier )=0D # C.g:253:6: type_qualifier=0D @@ -17050,12 +16096,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred39=0D =0D -=0D -=0D # $ANTLR start synpred40=0D +=0D def synpred40_fragment(self, ):=0D # C.g:253:23: ( type_specifier )=0D # C.g:253:23: type_specifier=0D @@ -17065,12 +16109,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred40=0D =0D -=0D -=0D # $ANTLR start synpred66=0D +=0D def synpred66_fragment(self, ):=0D # C.g:297:4: ( ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? (= 'EFI_RUNTIMESERVICE' )? direct_declarator )=0D # C.g:297:4: ( pointer )? ( 'EFIAPI' )? ( 'EFI_BOOTSERVICE' )? ( '= EFI_RUNTIMESERVICE' )? direct_declarator=0D @@ -17078,7 +16120,7 @@ class CParser(Parser): alt111 =3D 2=0D LA111_0 =3D self.input.LA(1)=0D =0D - if (LA111_0 =3D=3D 66) :=0D + if (LA111_0 =3D=3D 66):=0D alt111 =3D 1=0D if alt111 =3D=3D 1:=0D # C.g:0:0: pointer=0D @@ -17088,13 +16130,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:13: ( 'EFIAPI' )?=0D alt112 =3D 2=0D LA112_0 =3D self.input.LA(1)=0D =0D - if (LA112_0 =3D=3D 58) :=0D + if (LA112_0 =3D=3D 58):=0D alt112 =3D 1=0D if alt112 =3D=3D 1:=0D # C.g:297:14: 'EFIAPI'=0D @@ -17102,13 +16142,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:25: ( 'EFI_BOOTSERVICE' )?=0D alt113 =3D 2=0D LA113_0 =3D self.input.LA(1)=0D =0D - if (LA113_0 =3D=3D 59) :=0D + if (LA113_0 =3D=3D 59):=0D alt113 =3D 1=0D if alt113 =3D=3D 1:=0D # C.g:297:26: 'EFI_BOOTSERVICE'=0D @@ -17116,13 +16154,11 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D # C.g:297:46: ( 'EFI_RUNTIMESERVICE' )?=0D alt114 =3D 2=0D LA114_0 =3D self.input.LA(1)=0D =0D - if (LA114_0 =3D=3D 60) :=0D + if (LA114_0 =3D=3D 60):=0D alt114 =3D 1=0D if alt114 =3D=3D 1:=0D # C.g:297:47: 'EFI_RUNTIMESERVICE'=0D @@ -17130,20 +16166,16 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D self.following.append(self.FOLLOW_direct_declarator_in_synpred6680= 2)=0D self.direct_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred66=0D =0D -=0D -=0D # $ANTLR start synpred67=0D +=0D def synpred67_fragment(self, ):=0D # C.g:303:15: ( declarator_suffix )=0D # C.g:303:15: declarator_suffix=0D @@ -17153,12 +16185,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred67=0D =0D -=0D -=0D # $ANTLR start synpred69=0D +=0D def synpred69_fragment(self, ):=0D # C.g:304:9: ( 'EFIAPI' )=0D # C.g:304:9: 'EFIAPI'=0D @@ -17166,12 +16196,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred69=0D =0D -=0D -=0D # $ANTLR start synpred70=0D +=0D def synpred70_fragment(self, ):=0D # C.g:304:35: ( declarator_suffix )=0D # C.g:304:35: declarator_suffix=0D @@ -17181,12 +16209,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred70=0D =0D -=0D -=0D # $ANTLR start synpred73=0D +=0D def synpred73_fragment(self, ):=0D # C.g:310:9: ( '(' parameter_type_list ')' )=0D # C.g:310:9: '(' parameter_type_list ')'=0D @@ -17202,12 +16228,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred73=0D =0D -=0D -=0D # $ANTLR start synpred74=0D +=0D def synpred74_fragment(self, ):=0D # C.g:311:9: ( '(' identifier_list ')' )=0D # C.g:311:9: '(' identifier_list ')'=0D @@ -17223,12 +16247,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred74=0D =0D -=0D -=0D # $ANTLR start synpred75=0D +=0D def synpred75_fragment(self, ):=0D # C.g:316:8: ( type_qualifier )=0D # C.g:316:8: type_qualifier=0D @@ -17238,12 +16260,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred75=0D =0D -=0D -=0D # $ANTLR start synpred76=0D +=0D def synpred76_fragment(self, ):=0D # C.g:316:24: ( pointer )=0D # C.g:316:24: pointer=0D @@ -17253,12 +16273,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred76=0D =0D -=0D -=0D # $ANTLR start synpred77=0D +=0D def synpred77_fragment(self, ):=0D # C.g:316:4: ( '*' ( type_qualifier )+ ( pointer )? )=0D # C.g:316:4: '*' ( type_qualifier )+ ( pointer )?=0D @@ -17267,26 +16285,25 @@ class CParser(Parser): return=0D # C.g:316:8: ( type_qualifier )+=0D cnt116 =3D 0=0D - while True: #loop116=0D + while True: # loop116=0D alt116 =3D 2=0D LA116_0 =3D self.input.LA(1)=0D =0D - if ((49 <=3D LA116_0 <=3D 61)) :=0D + if ((49 <=3D LA116_0 <=3D 61)):=0D alt116 =3D 1=0D =0D -=0D if alt116 =3D=3D 1:=0D # C.g:0:0: type_qualifier=0D - self.following.append(self.FOLLOW_type_qualifier_in_synpre= d77921)=0D + self.following.append(=0D + self.FOLLOW_type_qualifier_in_synpred77921)=0D self.type_qualifier()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt116 >=3D 1:=0D - break #loop116=0D + break # loop116=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -17297,12 +16314,11 @@ class CParser(Parser): =0D cnt116 +=3D 1=0D =0D -=0D # C.g:316:24: ( pointer )?=0D alt117 =3D 2=0D LA117_0 =3D self.input.LA(1)=0D =0D - if (LA117_0 =3D=3D 66) :=0D + if (LA117_0 =3D=3D 66):=0D alt117 =3D 1=0D if alt117 =3D=3D 1:=0D # C.g:0:0: pointer=0D @@ -17312,15 +16328,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred77=0D =0D -=0D -=0D # $ANTLR start synpred78=0D +=0D def synpred78_fragment(self, ):=0D # C.g:317:4: ( '*' pointer )=0D # C.g:317:4: '*' pointer=0D @@ -17333,12 +16344,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred78=0D =0D -=0D -=0D # $ANTLR start synpred81=0D +=0D def synpred81_fragment(self, ):=0D # C.g:326:32: ( 'OPTIONAL' )=0D # C.g:326:32: 'OPTIONAL'=0D @@ -17346,12 +16355,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred81=0D =0D -=0D -=0D # $ANTLR start synpred82=0D +=0D def synpred82_fragment(self, ):=0D # C.g:326:27: ( ',' ( 'OPTIONAL' )? parameter_declaration )=0D # C.g:326:27: ',' ( 'OPTIONAL' )? parameter_declaration=0D @@ -17362,10 +16369,10 @@ class CParser(Parser): alt119 =3D 2=0D LA119_0 =3D self.input.LA(1)=0D =0D - if (LA119_0 =3D=3D 53) :=0D + if (LA119_0 =3D=3D 53):=0D LA119_1 =3D self.input.LA(2)=0D =0D - if (self.synpred81()) :=0D + if (self.synpred81()):=0D alt119 =3D 1=0D if alt119 =3D=3D 1:=0D # C.g:326:32: 'OPTIONAL'=0D @@ -17373,20 +16380,17 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D - self.following.append(self.FOLLOW_parameter_declaration_in_synpred= 82981)=0D + self.following.append(=0D + self.FOLLOW_parameter_declaration_in_synpred82981)=0D self.parameter_declaration()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred82=0D =0D -=0D -=0D # $ANTLR start synpred83=0D +=0D def synpred83_fragment(self, ):=0D # C.g:330:28: ( declarator )=0D # C.g:330:28: declarator=0D @@ -17396,12 +16400,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred83=0D =0D -=0D -=0D # $ANTLR start synpred84=0D +=0D def synpred84_fragment(self, ):=0D # C.g:330:39: ( abstract_declarator )=0D # C.g:330:39: abstract_declarator=0D @@ -17411,33 +16413,31 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred84=0D =0D -=0D -=0D # $ANTLR start synpred86=0D +=0D def synpred86_fragment(self, ):=0D # C.g:330:4: ( declaration_specifiers ( declarator | abstract_decl= arator )* ( 'OPTIONAL' )? )=0D # C.g:330:4: declaration_specifiers ( declarator | abstract_declar= ator )* ( 'OPTIONAL' )?=0D - self.following.append(self.FOLLOW_declaration_specifiers_in_synpre= d86994)=0D + self.following.append(=0D + self.FOLLOW_declaration_specifiers_in_synpred86994)=0D self.declaration_specifiers()=0D self.following.pop()=0D if self.failed:=0D return=0D # C.g:330:27: ( declarator | abstract_declarator )*=0D - while True: #loop120=0D + while True: # loop120=0D alt120 =3D 3=0D LA120 =3D self.input.LA(1)=0D if LA120 =3D=3D 66:=0D LA120_3 =3D self.input.LA(2)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D IDENTIFIER or LA120 =3D=3D 58 or LA120 =3D= =3D 59 or LA120 =3D=3D 60:=0D alt120 =3D 1=0D elif LA120 =3D=3D 62:=0D @@ -17447,58 +16447,51 @@ class CParser(Parser): elif LA120 =3D=3D 58:=0D LA120_21 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 66:=0D LA120_22 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 59:=0D LA120_23 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 60:=0D LA120_24 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D IDENTIFIER:=0D LA120_25 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D elif LA120 =3D=3D 62:=0D LA120_26 =3D self.input.LA(3)=0D =0D - if (self.synpred83()) :=0D + if (self.synpred83()):=0D alt120 =3D 1=0D - elif (self.synpred84()) :=0D + elif (self.synpred84()):=0D alt120 =3D 2=0D =0D -=0D -=0D elif LA120 =3D=3D 64:=0D alt120 =3D 2=0D =0D @@ -17510,25 +16503,23 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D elif alt120 =3D=3D 2:=0D # C.g:330:39: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declarator_in_s= ynpred86999)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_synpred86999)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop120=0D -=0D + break # loop120=0D =0D # C.g:330:61: ( 'OPTIONAL' )?=0D alt121 =3D 2=0D LA121_0 =3D self.input.LA(1)=0D =0D - if (LA121_0 =3D=3D 53) :=0D + if (LA121_0 =3D=3D 53):=0D alt121 =3D 1=0D if alt121 =3D=3D 1:=0D # C.g:330:62: 'OPTIONAL'=0D @@ -17536,19 +16527,15 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred86=0D =0D -=0D -=0D # $ANTLR start synpred90=0D +=0D def synpred90_fragment(self, ):=0D # C.g:341:4: ( specifier_qualifier_list ( abstract_declarator )? )= =0D # C.g:341:4: specifier_qualifier_list ( abstract_declarator )?=0D - self.following.append(self.FOLLOW_specifier_qualifier_list_in_synp= red901046)=0D + self.following.append(=0D + self.FOLLOW_specifier_qualifier_list_in_synpred901046)=0D self.specifier_qualifier_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17557,40 +16544,35 @@ class CParser(Parser): alt122 =3D 2=0D LA122_0 =3D self.input.LA(1)=0D =0D - if (LA122_0 =3D=3D 62 or LA122_0 =3D=3D 64 or LA122_0 =3D=3D 66) := =0D + if (LA122_0 =3D=3D 62 or LA122_0 =3D=3D 64 or LA122_0 =3D=3D 66):= =0D alt122 =3D 1=0D if alt122 =3D=3D 1:=0D # C.g:0:0: abstract_declarator=0D - self.following.append(self.FOLLOW_abstract_declarator_in_synpr= ed901048)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_in_synpred901048)=0D self.abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D -=0D -=0D -=0D # $ANTLR end synpred90=0D =0D -=0D -=0D # $ANTLR start synpred91=0D +=0D def synpred91_fragment(self, ):=0D # C.g:346:12: ( direct_abstract_declarator )=0D # C.g:346:12: direct_abstract_declarator=0D - self.following.append(self.FOLLOW_direct_abstract_declarator_in_sy= npred911067)=0D + self.following.append(=0D + self.FOLLOW_direct_abstract_declarator_in_synpred911067)=0D self.direct_abstract_declarator()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred91=0D =0D -=0D -=0D # $ANTLR start synpred93=0D +=0D def synpred93_fragment(self, ):=0D # C.g:351:6: ( '(' abstract_declarator ')' )=0D # C.g:351:6: '(' abstract_declarator ')'=0D @@ -17606,27 +16588,24 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred93=0D =0D -=0D -=0D # $ANTLR start synpred94=0D +=0D def synpred94_fragment(self, ):=0D # C.g:351:65: ( abstract_declarator_suffix )=0D # C.g:351:65: abstract_declarator_suffix=0D - self.following.append(self.FOLLOW_abstract_declarator_suffix_in_sy= npred941098)=0D + self.following.append(=0D + self.FOLLOW_abstract_declarator_suffix_in_synpred941098)=0D self.abstract_declarator_suffix()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred94=0D =0D -=0D -=0D # $ANTLR start synpred109=0D +=0D def synpred109_fragment(self, ):=0D # C.g:386:4: ( '(' type_name ')' cast_expression )=0D # C.g:386:4: '(' type_name ')' cast_expression=0D @@ -17647,12 +16626,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred109=0D =0D -=0D -=0D # $ANTLR start synpred114=0D +=0D def synpred114_fragment(self, ):=0D # C.g:395:4: ( 'sizeof' unary_expression )=0D # C.g:395:4: 'sizeof' unary_expression=0D @@ -17665,19 +16642,18 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred114=0D =0D -=0D -=0D # $ANTLR start synpred117=0D +=0D def synpred117_fragment(self, ):=0D # C.g:409:13: ( '(' argument_expression_list ')' )=0D # C.g:409:13: '(' argument_expression_list ')'=0D self.match(self.input, 62, self.FOLLOW_62_in_synpred1171420)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_argument_expression_list_in_synp= red1171424)=0D + self.following.append(=0D + self.FOLLOW_argument_expression_list_in_synpred1171424)=0D self.argument_expression_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17686,19 +16662,18 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred117=0D =0D -=0D -=0D # $ANTLR start synpred118=0D +=0D def synpred118_fragment(self, ):=0D # C.g:410:13: ( '(' macro_parameter_list ')' )=0D # C.g:410:13: '(' macro_parameter_list ')'=0D self.match(self.input, 62, self.FOLLOW_62_in_synpred1181444)=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_macro_parameter_list_in_synpred1= 181446)=0D + self.following.append(=0D + self.FOLLOW_macro_parameter_list_in_synpred1181446)=0D self.macro_parameter_list()=0D self.following.pop()=0D if self.failed:=0D @@ -17707,84 +16682,77 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred118=0D =0D -=0D -=0D # $ANTLR start synpred120=0D +=0D def synpred120_fragment(self, ):=0D # C.g:412:13: ( '*' IDENTIFIER )=0D # C.g:412:13: '*' IDENTIFIER=0D self.match(self.input, 66, self.FOLLOW_66_in_synpred1201482)=0D if self.failed:=0D return=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_in_synpr= ed1201486)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred1201486)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred120=0D =0D -=0D -=0D # $ANTLR start synpred137=0D +=0D def synpred137_fragment(self, ):=0D # C.g:443:20: ( STRING_LITERAL )=0D # C.g:443:20: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_LITERAL_= in_synpred1371683)=0D + self.match(self.input, STRING_LITERAL,=0D + self.FOLLOW_STRING_LITERAL_in_synpred1371683)=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred137=0D =0D -=0D -=0D # $ANTLR start synpred138=0D +=0D def synpred138_fragment(self, ):=0D # C.g:443:8: ( ( IDENTIFIER )* ( STRING_LITERAL )+ )=0D # C.g:443:8: ( IDENTIFIER )* ( STRING_LITERAL )+=0D # C.g:443:8: ( IDENTIFIER )*=0D - while True: #loop125=0D + while True: # loop125=0D alt125 =3D 2=0D LA125_0 =3D self.input.LA(1)=0D =0D - if (LA125_0 =3D=3D IDENTIFIER) :=0D + if (LA125_0 =3D=3D IDENTIFIER):=0D alt125 =3D 1=0D =0D -=0D if alt125 =3D=3D 1:=0D # C.g:0:0: IDENTIFIER=0D - self.match(self.input, IDENTIFIER, self.FOLLOW_IDENTIFIER_= in_synpred1381680)=0D + self.match(self.input, IDENTIFIER,=0D + self.FOLLOW_IDENTIFIER_in_synpred1381680)=0D if self.failed:=0D return=0D =0D -=0D else:=0D - break #loop125=0D -=0D + break # loop125=0D =0D # C.g:443:20: ( STRING_LITERAL )+=0D cnt126 =3D 0=0D - while True: #loop126=0D + while True: # loop126=0D alt126 =3D 2=0D LA126_0 =3D self.input.LA(1)=0D =0D - if (LA126_0 =3D=3D STRING_LITERAL) :=0D + if (LA126_0 =3D=3D STRING_LITERAL):=0D alt126 =3D 1=0D =0D -=0D if alt126 =3D=3D 1:=0D # C.g:0:0: STRING_LITERAL=0D - self.match(self.input, STRING_LITERAL, self.FOLLOW_STRING_= LITERAL_in_synpred1381683)=0D + self.match(self.input, STRING_LITERAL,=0D + self.FOLLOW_STRING_LITERAL_in_synpred1381683)=0D if self.failed:=0D return=0D =0D -=0D else:=0D if cnt126 >=3D 1:=0D - break #loop126=0D + break # loop126=0D =0D if self.backtracking > 0:=0D self.failed =3D True=0D @@ -17795,14 +16763,10 @@ class CParser(Parser): =0D cnt126 +=3D 1=0D =0D -=0D -=0D -=0D # $ANTLR end synpred138=0D =0D -=0D -=0D # $ANTLR start synpred142=0D +=0D def synpred142_fragment(self, ):=0D # C.g:458:4: ( lvalue assignment_operator assignment_expression )= =0D # C.g:458:4: lvalue assignment_operator assignment_expression=0D @@ -17811,38 +16775,37 @@ class CParser(Parser): self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_operator_in_synpred14= 21746)=0D + self.following.append(=0D + self.FOLLOW_assignment_operator_in_synpred1421746)=0D self.assignment_operator()=0D self.following.pop()=0D if self.failed:=0D return=0D - self.following.append(self.FOLLOW_assignment_expression_in_synpred= 1421748)=0D + self.following.append(=0D + self.FOLLOW_assignment_expression_in_synpred1421748)=0D self.assignment_expression()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred142=0D =0D -=0D -=0D # $ANTLR start synpred169=0D +=0D def synpred169_fragment(self, ):=0D # C.g:520:4: ( expression_statement )=0D # C.g:520:4: expression_statement=0D - self.following.append(self.FOLLOW_expression_statement_in_synpred1= 692035)=0D + self.following.append(=0D + self.FOLLOW_expression_statement_in_synpred1692035)=0D self.expression_statement()=0D self.following.pop()=0D if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred169=0D =0D -=0D -=0D # $ANTLR start synpred173=0D +=0D def synpred173_fragment(self, ):=0D # C.g:524:4: ( macro_statement )=0D # C.g:524:4: macro_statement=0D @@ -17852,12 +16815,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred173=0D =0D -=0D -=0D # $ANTLR start synpred174=0D +=0D def synpred174_fragment(self, ):=0D # C.g:525:4: ( asm2_statement )=0D # C.g:525:4: asm2_statement=0D @@ -17867,12 +16828,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred174=0D =0D -=0D -=0D # $ANTLR start synpred181=0D +=0D def synpred181_fragment(self, ):=0D # C.g:544:19: ( declaration )=0D # C.g:544:19: declaration=0D @@ -17882,12 +16841,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred181=0D =0D -=0D -=0D # $ANTLR start synpred182=0D +=0D def synpred182_fragment(self, ):=0D # C.g:544:33: ( statement_list )=0D # C.g:544:33: statement_list=0D @@ -17897,12 +16854,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred182=0D =0D -=0D -=0D # $ANTLR start synpred186=0D +=0D def synpred186_fragment(self, ):=0D # C.g:554:8: ( declaration )=0D # C.g:554:8: declaration=0D @@ -17912,12 +16867,10 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred186=0D =0D -=0D -=0D # $ANTLR start synpred188=0D +=0D def synpred188_fragment(self, ):=0D # C.g:558:4: ( statement )=0D # C.g:558:4: statement=0D @@ -17927,11 +16880,8 @@ class CParser(Parser): if self.failed:=0D return=0D =0D -=0D # $ANTLR end synpred188=0D =0D -=0D -=0D def synpred69(self):=0D self.backtracking +=3D 1=0D start =3D self.input.mark()=0D @@ -18382,35 +17332,42 @@ class CParser(Parser): self.failed =3D False=0D return success=0D =0D -=0D -=0D -=0D -=0D - 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])=0D + FOLLOW_external_declaration_in_translation_unit74 =3D frozenset(=0D + [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])=0D FOLLOW_function_definition_in_external_declaration113 =3D frozenset([1= ])=0D FOLLOW_declaration_in_external_declaration118 =3D frozenset([1])=0D FOLLOW_macro_statement_in_external_declaration123 =3D frozenset([1, 25= ])=0D FOLLOW_25_in_external_declaration126 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_function_definition157 =3D frozenset(= [4, 58, 59, 60, 62, 66])=0D - FOLLOW_declarator_in_function_definition160 =3D frozenset([4, 26, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50,= 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_declaration_in_function_definition166 =3D frozenset([4, 26, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50= , 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_specifiers_in_function_definition157 =3D frozenset(= =0D + [4, 58, 59, 60, 62, 66])=0D + FOLLOW_declarator_in_function_definition160 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_in_function_definition166 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D FOLLOW_compound_statement_in_function_definition171 =3D frozenset([1])= =0D FOLLOW_compound_statement_in_function_definition180 =3D frozenset([1])= =0D - FOLLOW_26_in_declaration203 =3D frozenset([4, 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])=0D - FOLLOW_declaration_specifiers_in_declaration207 =3D frozenset([4, 58, = 59, 60, 62, 66])=0D + FOLLOW_26_in_declaration203 =3D frozenset([4, 29, 30, 31, 32, 33, 34, = 35, 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50= , 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_declaration_specifiers_in_declaration207 =3D frozenset(=0D + [4, 58, 59, 60, 62, 66])=0D FOLLOW_init_declarator_list_in_declaration216 =3D frozenset([25])=0D FOLLOW_25_in_declaration220 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_declaration234 =3D frozenset([4, 25, = 58, 59, 60, 62, 66])=0D + FOLLOW_declaration_specifiers_in_declaration234 =3D frozenset(=0D + [4, 25, 58, 59, 60, 62, 66])=0D FOLLOW_init_declarator_list_in_declaration238 =3D frozenset([25])=0D FOLLOW_25_in_declaration243 =3D frozenset([1])=0D - FOLLOW_storage_class_specifier_in_declaration_specifiers264 =3D frozen= set([1, 4, 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])=0D - FOLLOW_type_specifier_in_declaration_specifiers272 =3D frozenset([1, 4= , 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 5= 0, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_declaration_specifiers286 =3D frozenset([1, 4= , 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 5= 0, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_storage_class_specifier_in_declaration_specifiers264 =3D frozen= set(=0D + [1, 4, 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])=0D + FOLLOW_type_specifier_in_declaration_specifiers272 =3D frozenset(=0D + [1, 4, 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])=0D + FOLLOW_type_qualifier_in_declaration_specifiers286 =3D frozenset(=0D + [1, 4, 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])=0D FOLLOW_init_declarator_in_init_declarator_list308 =3D frozenset([1, 27= ])=0D FOLLOW_27_in_init_declarator_list311 =3D frozenset([4, 58, 59, 60, 62,= 66])=0D FOLLOW_init_declarator_in_init_declarator_list313 =3D frozenset([1, 27= ])=0D FOLLOW_declarator_in_init_declarator326 =3D frozenset([1, 28])=0D - FOLLOW_28_in_init_declarator329 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 4= 3, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_28_in_init_declarator329 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_in_init_declarator331 =3D frozenset([1])=0D FOLLOW_set_in_storage_class_specifier0 =3D frozenset([1])=0D FOLLOW_34_in_type_specifier376 =3D frozenset([1])=0D @@ -18428,25 +17385,34 @@ class CParser(Parser): FOLLOW_IDENTIFIER_in_type_id467 =3D frozenset([1])=0D FOLLOW_struct_or_union_in_struct_or_union_specifier494 =3D frozenset([= 4, 43])=0D FOLLOW_IDENTIFIER_in_struct_or_union_specifier496 =3D frozenset([43])= =0D - FOLLOW_43_in_struct_or_union_specifier499 =3D frozenset([4, 34, 35, 36= , 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 5= 8, 59, 60, 61])=0D - FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 =3D fro= zenset([44])=0D + FOLLOW_43_in_struct_or_union_specifier499 =3D frozenset(=0D + [4, 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])=0D + FOLLOW_struct_declaration_list_in_struct_or_union_specifier501 =3D fro= zenset([=0D + = 44])=0D FOLLOW_44_in_struct_or_union_specifier503 =3D frozenset([1])=0D FOLLOW_struct_or_union_in_struct_or_union_specifier508 =3D frozenset([= 4])=0D FOLLOW_IDENTIFIER_in_struct_or_union_specifier510 =3D frozenset([1])=0D FOLLOW_set_in_struct_or_union0 =3D frozenset([1])=0D - FOLLOW_struct_declaration_in_struct_declaration_list537 =3D frozenset(= [1, 4, 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])=0D - FOLLOW_specifier_qualifier_list_in_struct_declaration549 =3D frozenset= ([4, 47, 58, 59, 60, 62, 66])=0D + FOLLOW_struct_declaration_in_struct_declaration_list537 =3D frozenset(= =0D + [1, 4, 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])=0D + FOLLOW_specifier_qualifier_list_in_struct_declaration549 =3D frozenset= (=0D + [4, 47, 58, 59, 60, 62, 66])=0D FOLLOW_struct_declarator_list_in_struct_declaration551 =3D frozenset([= 25])=0D FOLLOW_25_in_struct_declaration553 =3D frozenset([1])=0D - FOLLOW_type_qualifier_in_specifier_qualifier_list566 =3D frozenset([1,= 4, 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])=0D - FOLLOW_type_specifier_in_specifier_qualifier_list570 =3D frozenset([1,= 4, 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])=0D + FOLLOW_type_qualifier_in_specifier_qualifier_list566 =3D frozenset(=0D + [1, 4, 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])=0D + FOLLOW_type_specifier_in_specifier_qualifier_list570 =3D frozenset(=0D + [1, 4, 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])=0D FOLLOW_struct_declarator_in_struct_declarator_list584 =3D frozenset([1= , 27])=0D - FOLLOW_27_in_struct_declarator_list587 =3D frozenset([4, 47, 58, 59, 6= 0, 62, 66])=0D + FOLLOW_27_in_struct_declarator_list587 =3D frozenset(=0D + [4, 47, 58, 59, 60, 62, 66])=0D FOLLOW_struct_declarator_in_struct_declarator_list589 =3D frozenset([1= , 27])=0D FOLLOW_declarator_in_struct_declarator602 =3D frozenset([1, 47])=0D - FOLLOW_47_in_struct_declarator605 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_47_in_struct_declarator605 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_struct_declarator607 =3D frozenset([1])= =0D - FOLLOW_47_in_struct_declarator614 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_47_in_struct_declarator614 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_struct_declarator616 =3D frozenset([1])= =0D FOLLOW_48_in_enum_specifier634 =3D frozenset([43])=0D FOLLOW_43_in_enum_specifier636 =3D frozenset([4])=0D @@ -18465,7 +17431,8 @@ class CParser(Parser): FOLLOW_27_in_enumerator_list680 =3D frozenset([4])=0D FOLLOW_enumerator_in_enumerator_list682 =3D frozenset([1, 27])=0D FOLLOW_IDENTIFIER_in_enumerator695 =3D frozenset([1, 28])=0D - FOLLOW_28_in_enumerator698 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 66= , 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_28_in_enumerator698 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_enumerator700 =3D frozenset([1])=0D FOLLOW_set_in_type_qualifier0 =3D frozenset([1])=0D FOLLOW_pointer_in_declarator784 =3D frozenset([4, 58, 59, 60, 62])=0D @@ -18481,12 +17448,14 @@ class CParser(Parser): FOLLOW_declarator_in_direct_declarator834 =3D frozenset([63])=0D FOLLOW_63_in_direct_declarator836 =3D frozenset([62, 64])=0D FOLLOW_declarator_suffix_in_direct_declarator838 =3D frozenset([1, 62,= 64])=0D - FOLLOW_64_in_declarator_suffix852 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_64_in_declarator_suffix852 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_declarator_suffix854 =3D frozenset([65])= =0D FOLLOW_65_in_declarator_suffix856 =3D frozenset([1])=0D FOLLOW_64_in_declarator_suffix866 =3D frozenset([65])=0D FOLLOW_65_in_declarator_suffix868 =3D frozenset([1])=0D - FOLLOW_62_in_declarator_suffix878 =3D frozenset([4, 29, 30, 31, 32, 33= , 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 5= 5, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_62_in_declarator_suffix878 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_parameter_type_list_in_declarator_suffix880 =3D frozenset([63])= =0D FOLLOW_63_in_declarator_suffix882 =3D frozenset([1])=0D FOLLOW_62_in_declarator_suffix892 =3D frozenset([4])=0D @@ -18494,8 +17463,10 @@ class CParser(Parser): FOLLOW_63_in_declarator_suffix896 =3D frozenset([1])=0D FOLLOW_62_in_declarator_suffix906 =3D frozenset([63])=0D FOLLOW_63_in_declarator_suffix908 =3D frozenset([1])=0D - FOLLOW_66_in_pointer919 =3D frozenset([49, 50, 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_pointer921 =3D frozenset([1, 49, 50, 51, 52, = 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_66_in_pointer919 =3D frozenset(=0D + [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_type_qualifier_in_pointer921 =3D frozenset(=0D + [1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_pointer_in_pointer924 =3D frozenset([1])=0D FOLLOW_66_in_pointer930 =3D frozenset([66])=0D FOLLOW_pointer_in_pointer932 =3D frozenset([1])=0D @@ -18505,109 +17476,165 @@ class CParser(Parser): FOLLOW_53_in_parameter_type_list954 =3D frozenset([67])=0D FOLLOW_67_in_parameter_type_list958 =3D frozenset([1])=0D FOLLOW_parameter_declaration_in_parameter_list971 =3D frozenset([1, 27= ])=0D - FOLLOW_27_in_parameter_list974 =3D frozenset([4, 29, 30, 31, 32, 33, 3= 4, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, = 56, 57, 58, 59, 60, 61, 66])=0D - FOLLOW_53_in_parameter_list977 =3D frozenset([4, 29, 30, 31, 32, 33, 3= 4, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, = 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_27_in_parameter_list974 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_53_in_parameter_list977 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_parameter_declaration_in_parameter_list981 =3D frozenset([1, 27= ])=0D - FOLLOW_declaration_specifiers_in_parameter_declaration994 =3D frozense= t([1, 4, 53, 58, 59, 60, 62, 64, 66])=0D - FOLLOW_declarator_in_parameter_declaration997 =3D frozenset([1, 4, 53,= 58, 59, 60, 62, 64, 66])=0D - FOLLOW_abstract_declarator_in_parameter_declaration999 =3D frozenset([= 1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declaration_specifiers_in_parameter_declaration994 =3D frozense= t(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declarator_in_parameter_declaration997 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_abstract_declarator_in_parameter_declaration999 =3D frozenset(= =0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D FOLLOW_53_in_parameter_declaration1004 =3D frozenset([1])=0D FOLLOW_pointer_in_parameter_declaration1013 =3D frozenset([4, 66])=0D FOLLOW_IDENTIFIER_in_parameter_declaration1016 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_identifier_list1027 =3D frozenset([1, 27])=0D FOLLOW_27_in_identifier_list1031 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_identifier_list1033 =3D frozenset([1, 27])=0D - FOLLOW_specifier_qualifier_list_in_type_name1046 =3D frozenset([1, 62,= 64, 66])=0D + FOLLOW_specifier_qualifier_list_in_type_name1046 =3D frozenset([=0D + 1, 62, 64= , 66])=0D FOLLOW_abstract_declarator_in_type_name1048 =3D frozenset([1])=0D FOLLOW_type_id_in_type_name1054 =3D frozenset([1])=0D FOLLOW_pointer_in_abstract_declarator1065 =3D frozenset([1, 62, 64])=0D - FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 =3D froze= nset([1])=0D - FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 =3D froze= nset([1])=0D + FOLLOW_direct_abstract_declarator_in_abstract_declarator1067 =3D froze= nset([=0D + = 1])=0D + FOLLOW_direct_abstract_declarator_in_abstract_declarator1073 =3D froze= nset([=0D + = 1])=0D FOLLOW_62_in_direct_abstract_declarator1086 =3D frozenset([62, 64, 66]= )=0D - FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 =3D froze= nset([63])=0D + FOLLOW_abstract_declarator_in_direct_abstract_declarator1088 =3D froze= nset([=0D + = 63])=0D FOLLOW_63_in_direct_abstract_declarator1090 =3D frozenset([1, 62, 64])= =0D - FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = =3D frozenset([1, 62, 64])=0D - FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = =3D frozenset([1, 62, 64])=0D + FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1094 = =3D frozenset([=0D + = 1, 62, 64])=0D + FOLLOW_abstract_declarator_suffix_in_direct_abstract_declarator1098 = =3D frozenset([=0D + = 1, 62, 64])=0D FOLLOW_64_in_abstract_declarator_suffix1110 =3D frozenset([65])=0D FOLLOW_65_in_abstract_declarator_suffix1112 =3D frozenset([1])=0D - FOLLOW_64_in_abstract_declarator_suffix1117 =3D frozenset([4, 5, 6, 7,= 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_constant_expression_in_abstract_declarator_suffix1119 =3D froze= nset([65])=0D + FOLLOW_64_in_abstract_declarator_suffix1117 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_constant_expression_in_abstract_declarator_suffix1119 =3D froze= nset([=0D + = 65])=0D FOLLOW_65_in_abstract_declarator_suffix1121 =3D frozenset([1])=0D FOLLOW_62_in_abstract_declarator_suffix1126 =3D frozenset([63])=0D FOLLOW_63_in_abstract_declarator_suffix1128 =3D frozenset([1])=0D - FOLLOW_62_in_abstract_declarator_suffix1133 =3D frozenset([4, 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, 66])=0D - FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 =3D froze= nset([63])=0D + FOLLOW_62_in_abstract_declarator_suffix1133 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_parameter_type_list_in_abstract_declarator_suffix1135 =3D froze= nset([=0D + = 63])=0D FOLLOW_63_in_abstract_declarator_suffix1137 =3D frozenset([1])=0D FOLLOW_assignment_expression_in_initializer1150 =3D frozenset([1])=0D - FOLLOW_43_in_initializer1155 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 43, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_43_in_initializer1155 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_list_in_initializer1157 =3D frozenset([27, 44])=0D FOLLOW_27_in_initializer1159 =3D frozenset([44])=0D FOLLOW_44_in_initializer1162 =3D frozenset([1])=0D FOLLOW_initializer_in_initializer_list1173 =3D frozenset([1, 27])=0D - FOLLOW_27_in_initializer_list1176 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_27_in_initializer_list1176 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 43, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_initializer_in_initializer_list1178 =3D frozenset([1, 27])=0D - FOLLOW_assignment_expression_in_argument_expression_list1196 =3D froze= nset([1, 27, 53])=0D + FOLLOW_assignment_expression_in_argument_expression_list1196 =3D froze= nset([=0D + = 1, 27, 53])=0D FOLLOW_53_in_argument_expression_list1199 =3D frozenset([1, 27])=0D - FOLLOW_27_in_argument_expression_list1204 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_assignment_expression_in_argument_expression_list1206 =3D froze= nset([1, 27, 53])=0D + FOLLOW_27_in_argument_expression_list1204 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_assignment_expression_in_argument_expression_list1206 =3D froze= nset([=0D + = 1, 27, 53])=0D FOLLOW_53_in_argument_expression_list1209 =3D frozenset([1, 27])=0D - FOLLOW_multiplicative_expression_in_additive_expression1225 =3D frozen= set([1, 68, 69])=0D - FOLLOW_68_in_additive_expression1229 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_multiplicative_expression_in_additive_expression1231 =3D frozen= set([1, 68, 69])=0D - FOLLOW_69_in_additive_expression1235 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_multiplicative_expression_in_additive_expression1237 =3D frozen= set([1, 68, 69])=0D - FOLLOW_cast_expression_in_multiplicative_expression1251 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_66_in_multiplicative_expression1255 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1257 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_70_in_multiplicative_expression1261 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1263 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_71_in_multiplicative_expression1267 =3D frozenset([4, 5, 6, 7, = 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_cast_expression_in_multiplicative_expression1269 =3D frozenset(= [1, 66, 70, 71])=0D - FOLLOW_62_in_cast_expression1282 =3D frozenset([4, 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])=0D + FOLLOW_multiplicative_expression_in_additive_expression1225 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_68_in_additive_expression1229 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_multiplicative_expression_in_additive_expression1231 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_69_in_additive_expression1235 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_multiplicative_expression_in_additive_expression1237 =3D frozen= set([=0D + = 1, 68, 69])=0D + FOLLOW_cast_expression_in_multiplicative_expression1251 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_66_in_multiplicative_expression1255 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1257 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_70_in_multiplicative_expression1261 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1263 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_71_in_multiplicative_expression1267 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_cast_expression_in_multiplicative_expression1269 =3D frozenset(= [=0D + 1,= 66, 70, 71])=0D + FOLLOW_62_in_cast_expression1282 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_cast_expression1284 =3D frozenset([63])=0D - FOLLOW_63_in_cast_expression1286 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_cast_expression1286 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_cast_expression1288 =3D frozenset([1])=0D FOLLOW_unary_expression_in_cast_expression1293 =3D frozenset([1])=0D FOLLOW_postfix_expression_in_unary_expression1304 =3D frozenset([1])=0D - FOLLOW_72_in_unary_expression1309 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_72_in_unary_expression1309 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1311 =3D frozenset([1])=0D - FOLLOW_73_in_unary_expression1316 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_73_in_unary_expression1316 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1318 =3D frozenset([1])=0D - FOLLOW_unary_operator_in_unary_expression1323 =3D frozenset([4, 5, 6, = 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_unary_operator_in_unary_expression1323 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_unary_expression1325 =3D frozenset([1])=0D - FOLLOW_74_in_unary_expression1330 =3D frozenset([4, 5, 6, 7, 8, 9, 10,= 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_74_in_unary_expression1330 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_unary_expression1332 =3D frozenset([1])=0D FOLLOW_74_in_unary_expression1337 =3D frozenset([62])=0D - FOLLOW_62_in_unary_expression1339 =3D frozenset([4, 34, 35, 36, 37, 38= , 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6= 0, 61])=0D + FOLLOW_62_in_unary_expression1339 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_unary_expression1341 =3D frozenset([63])=0D FOLLOW_63_in_unary_expression1343 =3D frozenset([1])=0D - FOLLOW_primary_expression_in_postfix_expression1367 =3D frozenset([1, = 62, 64, 66, 72, 73, 75, 76])=0D - FOLLOW_64_in_postfix_expression1383 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_primary_expression_in_postfix_expression1367 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_64_in_postfix_expression1383 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_postfix_expression1385 =3D frozenset([65])=0D - FOLLOW_65_in_postfix_expression1387 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D + FOLLOW_65_in_postfix_expression1387 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_62_in_postfix_expression1401 =3D frozenset([63])=0D - FOLLOW_63_in_postfix_expression1405 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_62_in_postfix_expression1420 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_postfix_expression1405 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_62_in_postfix_expression1420 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_argument_expression_list_in_postfix_expression1424 =3D frozense= t([63])=0D - FOLLOW_63_in_postfix_expression1428 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_62_in_postfix_expression1444 =3D frozenset([4, 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, 66])=0D + FOLLOW_63_in_postfix_expression1428 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_62_in_postfix_expression1444 =3D frozenset(=0D + [4, 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, 66])=0D FOLLOW_macro_parameter_list_in_postfix_expression1446 =3D frozenset([6= 3])=0D - FOLLOW_63_in_postfix_expression1448 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D + FOLLOW_63_in_postfix_expression1448 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_75_in_postfix_expression1462 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1466 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1466 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_66_in_postfix_expression1482 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1486 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1486 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D FOLLOW_76_in_postfix_expression1502 =3D frozenset([4])=0D - FOLLOW_IDENTIFIER_in_postfix_expression1506 =3D frozenset([1, 62, 64, = 66, 72, 73, 75, 76])=0D - FOLLOW_72_in_postfix_expression1522 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_73_in_postfix_expression1536 =3D frozenset([1, 62, 64, 66, 72, = 73, 75, 76])=0D - FOLLOW_parameter_declaration_in_macro_parameter_list1559 =3D frozenset= ([1, 27])=0D - FOLLOW_27_in_macro_parameter_list1562 =3D frozenset([4, 29, 30, 31, 32= , 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 48, 49, 50, 51, 52, 53, 5= 4, 55, 56, 57, 58, 59, 60, 61, 66])=0D - FOLLOW_parameter_declaration_in_macro_parameter_list1564 =3D frozenset= ([1, 27])=0D + FOLLOW_IDENTIFIER_in_postfix_expression1506 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_72_in_postfix_expression1522 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_73_in_postfix_expression1536 =3D frozenset(=0D + [1, 62, 64, 66, 72, 73, 75, 76])=0D + FOLLOW_parameter_declaration_in_macro_parameter_list1559 =3D frozenset= ([=0D + 1= , 27])=0D + FOLLOW_27_in_macro_parameter_list1562 =3D frozenset(=0D + [4, 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, 66])=0D + FOLLOW_parameter_declaration_in_macro_parameter_list1564 =3D frozenset= ([=0D + 1= , 27])=0D FOLLOW_set_in_unary_operator0 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_primary_expression1613 =3D frozenset([1])=0D FOLLOW_constant_in_primary_expression1618 =3D frozenset([1])=0D - FOLLOW_62_in_primary_expression1623 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_primary_expression1623 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_primary_expression1625 =3D frozenset([63])=0D FOLLOW_63_in_primary_expression1627 =3D frozenset([1])=0D FOLLOW_HEX_LITERAL_in_constant1643 =3D frozenset([1])=0D @@ -18619,44 +17646,71 @@ class CParser(Parser): FOLLOW_IDENTIFIER_in_constant1688 =3D frozenset([1, 4])=0D FOLLOW_FLOATING_POINT_LITERAL_in_constant1699 =3D frozenset([1])=0D FOLLOW_assignment_expression_in_expression1715 =3D frozenset([1, 27])= =0D - FOLLOW_27_in_expression1718 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_27_in_expression1718 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_expression1720 =3D frozenset([1, 27])= =0D FOLLOW_conditional_expression_in_constant_expression1733 =3D frozenset= ([1])=0D - FOLLOW_lvalue_in_assignment_expression1744 =3D frozenset([28, 80, 81, = 82, 83, 84, 85, 86, 87, 88, 89])=0D - FOLLOW_assignment_operator_in_assignment_expression1746 =3D frozenset(= [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_lvalue_in_assignment_expression1744 =3D frozenset(=0D + [28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])=0D + FOLLOW_assignment_operator_in_assignment_expression1746 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_assignment_expression1748 =3D frozense= t([1])=0D FOLLOW_conditional_expression_in_assignment_expression1753 =3D frozens= et([1])=0D FOLLOW_unary_expression_in_lvalue1765 =3D frozenset([1])=0D FOLLOW_set_in_assignment_operator0 =3D frozenset([1])=0D - FOLLOW_logical_or_expression_in_conditional_expression1839 =3D frozens= et([1, 90])=0D - FOLLOW_90_in_conditional_expression1842 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_logical_or_expression_in_conditional_expression1839 =3D frozens= et([=0D + = 1, 90])=0D + FOLLOW_90_in_conditional_expression1842 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_conditional_expression1844 =3D frozenset([47])=0D - FOLLOW_47_in_conditional_expression1846 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_conditional_expression_in_conditional_expression1848 =3D frozen= set([1])=0D - FOLLOW_logical_and_expression_in_logical_or_expression1863 =3D frozens= et([1, 91])=0D - FOLLOW_91_in_logical_or_expression1866 =3D frozenset([4, 5, 6, 7, 8, 9= , 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_logical_and_expression_in_logical_or_expression1868 =3D frozens= et([1, 91])=0D - FOLLOW_inclusive_or_expression_in_logical_and_expression1881 =3D froze= nset([1, 92])=0D - FOLLOW_92_in_logical_and_expression1884 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_inclusive_or_expression_in_logical_and_expression1886 =3D froze= nset([1, 92])=0D - FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 =3D froz= enset([1, 93])=0D - FOLLOW_93_in_inclusive_or_expression1902 =3D frozenset([4, 5, 6, 7, 8,= 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 =3D froz= enset([1, 93])=0D + FOLLOW_47_in_conditional_expression1846 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_conditional_expression_in_conditional_expression1848 =3D frozen= set([=0D + = 1])=0D + FOLLOW_logical_and_expression_in_logical_or_expression1863 =3D frozens= et([=0D + = 1, 91])=0D + FOLLOW_91_in_logical_or_expression1866 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_logical_and_expression_in_logical_or_expression1868 =3D frozens= et([=0D + = 1, 91])=0D + FOLLOW_inclusive_or_expression_in_logical_and_expression1881 =3D froze= nset([=0D + = 1, 92])=0D + FOLLOW_92_in_logical_and_expression1884 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_inclusive_or_expression_in_logical_and_expression1886 =3D froze= nset([=0D + = 1, 92])=0D + FOLLOW_exclusive_or_expression_in_inclusive_or_expression1899 =3D froz= enset([=0D + = 1, 93])=0D + FOLLOW_93_in_inclusive_or_expression1902 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_exclusive_or_expression_in_inclusive_or_expression1904 =3D froz= enset([=0D + = 1, 93])=0D FOLLOW_and_expression_in_exclusive_or_expression1917 =3D frozenset([1,= 94])=0D - FOLLOW_94_in_exclusive_or_expression1920 =3D frozenset([4, 5, 6, 7, 8,= 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_94_in_exclusive_or_expression1920 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_and_expression_in_exclusive_or_expression1922 =3D frozenset([1,= 94])=0D FOLLOW_equality_expression_in_and_expression1935 =3D frozenset([1, 77]= )=0D - FOLLOW_77_in_and_expression1938 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 6= 2, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_77_in_and_expression1938 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_equality_expression_in_and_expression1940 =3D frozenset([1, 77]= )=0D - FOLLOW_relational_expression_in_equality_expression1952 =3D frozenset(= [1, 95, 96])=0D - FOLLOW_set_in_equality_expression1955 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_relational_expression_in_equality_expression1961 =3D frozenset(= [1, 95, 96])=0D - FOLLOW_shift_expression_in_relational_expression1975 =3D frozenset([1,= 97, 98, 99, 100])=0D - FOLLOW_set_in_relational_expression1978 =3D frozenset([4, 5, 6, 7, 8, = 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_shift_expression_in_relational_expression1988 =3D frozenset([1,= 97, 98, 99, 100])=0D - FOLLOW_additive_expression_in_shift_expression2001 =3D frozenset([1, 1= 01, 102])=0D - FOLLOW_set_in_shift_expression2004 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_additive_expression_in_shift_expression2010 =3D frozenset([1, 1= 01, 102])=0D + FOLLOW_relational_expression_in_equality_expression1952 =3D frozenset(= [=0D + 1,= 95, 96])=0D + FOLLOW_set_in_equality_expression1955 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_relational_expression_in_equality_expression1961 =3D frozenset(= [=0D + 1,= 95, 96])=0D + FOLLOW_shift_expression_in_relational_expression1975 =3D frozenset([=0D + 1, 97= , 98, 99, 100])=0D + FOLLOW_set_in_relational_expression1978 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_shift_expression_in_relational_expression1988 =3D frozenset([=0D + 1, 97= , 98, 99, 100])=0D + FOLLOW_additive_expression_in_shift_expression2001 =3D frozenset([=0D + 1, 101,= 102])=0D + FOLLOW_set_in_shift_expression2004 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_additive_expression_in_shift_expression2010 =3D frozenset([=0D + 1, 101,= 102])=0D FOLLOW_labeled_statement_in_statement2025 =3D frozenset([1])=0D FOLLOW_compound_statement_in_statement2030 =3D frozenset([1])=0D FOLLOW_expression_statement_in_statement2035 =3D frozenset([1])=0D @@ -18670,72 +17724,101 @@ class CParser(Parser): FOLLOW_declaration_in_statement2075 =3D frozenset([1])=0D FOLLOW_103_in_asm2_statement2086 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_asm2_statement2089 =3D frozenset([62])=0D - FOLLOW_62_in_asm2_statement2091 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, = 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,= 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68= , 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 8= 7, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,= 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm2_statement2094 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30,= 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 6= 8, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, = 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104= , 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_62_in_asm2_statement2091 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, = 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,= 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D + FOLLOW_set_in_asm2_statement2094 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30,= 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 6= 5, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, = 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1= 02, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 1= 17])=0D FOLLOW_63_in_asm2_statement2101 =3D frozenset([25])=0D FOLLOW_25_in_asm2_statement2103 =3D frozenset([1])=0D FOLLOW_104_in_asm1_statement2115 =3D frozenset([43])=0D - FOLLOW_43_in_asm1_statement2117 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67= , 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 8= 6, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, = 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm1_statement2120 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48= , 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 6= 7, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, = 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,= 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_asm1_statement2117 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D + FOLLOW_set_in_asm1_statement2120 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,= 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48= , 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 6= 5, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, = 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 1= 02, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 1= 17])=0D FOLLOW_44_in_asm1_statement2127 =3D frozenset([1])=0D FOLLOW_105_in_asm_statement2138 =3D frozenset([43])=0D - FOLLOW_43_in_asm_statement2140 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 11= , 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3= 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, = 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,= 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86= , 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 1= 04, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D - FOLLOW_set_in_asm_statement2143 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67= , 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 8= 6, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, = 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_asm_statement2140 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 11= , 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3= 0, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, = 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65,= 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84= , 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102= , 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117= ])=0D + FOLLOW_set_in_asm_statement2143 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 1= 1, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, = 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,= 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,=0D + 59, 60, 61, 62, 63, 64, 65= , 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 8= 4, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 10= 2, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 11= 7])=0D FOLLOW_44_in_asm_statement2150 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_macro_statement2162 =3D frozenset([62])=0D - FOLLOW_62_in_macro_statement2164 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46,= 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D - FOLLOW_declaration_in_macro_statement2166 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, = 112, 113, 114, 115, 116, 117])=0D - FOLLOW_statement_list_in_macro_statement2170 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_macro_statement2164 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46,= 48, 49, 50, 51,=0D + 52, 53, 54, 55, 56, 57, 5= 8, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 1= 06, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_declaration_in_macro_statement2166 =3D frozenset([4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49,=0D + 50, 51, 52, 53, = 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79,= 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_statement_list_in_macro_statement2170 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_expression_in_macro_statement2173 =3D frozenset([63])=0D FOLLOW_63_in_macro_statement2176 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_labeled_statement2188 =3D frozenset([47])=0D - FOLLOW_47_in_labeled_statement2190 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2190 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2192 =3D frozenset([1])=0D - FOLLOW_106_in_labeled_statement2197 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_106_in_labeled_statement2197 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_constant_expression_in_labeled_statement2199 =3D frozenset([47]= )=0D - FOLLOW_47_in_labeled_statement2201 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2201 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2203 =3D frozenset([1])=0D FOLLOW_107_in_labeled_statement2208 =3D frozenset([47])=0D - FOLLOW_47_in_labeled_statement2210 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, = 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 1= 14, 115, 116, 117])=0D + FOLLOW_47_in_labeled_statement2210 =3D frozenset([4, 5, 6, 7, 8, 9, 10= , 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 4= 6, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 56,= 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105,= 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_labeled_statement2212 =3D frozenset([1])=0D - FOLLOW_43_in_compound_statement2223 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, = 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68,= 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 1= 13, 114, 115, 116, 117])=0D - FOLLOW_declaration_in_compound_statement2225 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,= 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62= , 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 11= 1, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_43_in_compound_statement2223 =3D frozenset([4, 5, 6, 7, 8, 9, 1= 0, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, = 45, 46, 48, 49,=0D + 50, 51, 52, 53, 54, 55= , 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104,= 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D + FOLLOW_declaration_in_compound_statement2225 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,= 43, 44, 45, 46, 48,=0D + 49, 50, 51, 5= 2, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, = 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])= =0D FOLLOW_statement_list_in_compound_statement2228 =3D frozenset([44])=0D FOLLOW_44_in_compound_statement2231 =3D frozenset([1])=0D - FOLLOW_statement_in_statement_list2242 =3D frozenset([1, 4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 6= 8, 69, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112,= 113, 114, 115, 116, 117])=0D + FOLLOW_statement_in_statement_list2242 =3D frozenset([1, 4, 5, 6, 7, 8= , 9, 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49,=0D + 50, 51, 52, 53, 54,= 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 1= 04, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_25_in_expression_statement2254 =3D frozenset([1])=0D FOLLOW_expression_in_expression_statement2259 =3D frozenset([25])=0D FOLLOW_25_in_expression_statement2261 =3D frozenset([1])=0D FOLLOW_108_in_selection_statement2272 =3D frozenset([62])=0D - FOLLOW_62_in_selection_statement2274 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_selection_statement2274 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_selection_statement2278 =3D frozenset([63])=0D - FOLLOW_63_in_selection_statement2280 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_selection_statement2280 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2284 =3D frozenset([1, 109])=0D - FOLLOW_109_in_selection_statement2299 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 6= 9, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113= , 114, 115, 116, 117])=0D + FOLLOW_109_in_selection_statement2299 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49,=0D + 50, 51, 52, 53, 54, = 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 10= 4, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2301 =3D frozenset([1])=0D FOLLOW_110_in_selection_statement2308 =3D frozenset([62])=0D - FOLLOW_62_in_selection_statement2310 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_selection_statement2310 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_selection_statement2312 =3D frozenset([63])=0D - FOLLOW_63_in_selection_statement2314 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_selection_statement2314 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_selection_statement2316 =3D frozenset([1])=0D FOLLOW_111_in_iteration_statement2327 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2329 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2329 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_iteration_statement2333 =3D frozenset([63])=0D - FOLLOW_63_in_iteration_statement2335 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_iteration_statement2335 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2337 =3D frozenset([1])=0D - FOLLOW_112_in_iteration_statement2344 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 6= 9, 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113= , 114, 115, 116, 117])=0D + FOLLOW_112_in_iteration_statement2344 =3D frozenset([4, 5, 6, 7, 8, 9,= 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45= , 46, 48, 49,=0D + 50, 51, 52, 53, 54, = 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 10= 4, 105, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2346 =3D frozenset([111])=0D FOLLOW_111_in_iteration_statement2348 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2350 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2350 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_iteration_statement2354 =3D frozenset([63])=0D FOLLOW_63_in_iteration_statement2356 =3D frozenset([25])=0D FOLLOW_25_in_iteration_statement2358 =3D frozenset([1])=0D FOLLOW_113_in_iteration_statement2365 =3D frozenset([62])=0D - FOLLOW_62_in_iteration_statement2367 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_expression_statement_in_iteration_statement2369 =3D frozenset([= 4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D - FOLLOW_expression_statement_in_iteration_statement2373 =3D frozenset([= 4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_iteration_statement2367 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D + FOLLOW_expression_statement_in_iteration_statement2369 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 25, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D + FOLLOW_expression_statement_in_iteration_statement2373 =3D frozenset(= =0D + [4, 5, 6, 7, 8, 9, 10, 62, 63, 66, 68, 69, 72, 73, 74, 77, 78, 79]= )=0D FOLLOW_expression_in_iteration_statement2375 =3D frozenset([63])=0D - FOLLOW_63_in_iteration_statement2378 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66, 68, 69= , 72, 73, 74, 77, 78, 79, 103, 104, 105, 106, 107, 108, 110, 111, 112, 113,= 114, 115, 116, 117])=0D + FOLLOW_63_in_iteration_statement2378 =3D frozenset([4, 5, 6, 7, 8, 9, = 10, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45,= 46, 48, 49, 50,=0D + 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79, 103, 104, 10= 5, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117])=0D FOLLOW_statement_in_iteration_statement2380 =3D frozenset([1])=0D FOLLOW_114_in_jump_statement2393 =3D frozenset([4])=0D FOLLOW_IDENTIFIER_in_jump_statement2395 =3D frozenset([25])=0D @@ -18746,13 +17829,17 @@ class CParser(Parser): FOLLOW_25_in_jump_statement2411 =3D frozenset([1])=0D FOLLOW_117_in_jump_statement2416 =3D frozenset([25])=0D FOLLOW_25_in_jump_statement2418 =3D frozenset([1])=0D - FOLLOW_117_in_jump_statement2423 =3D frozenset([4, 5, 6, 7, 8, 9, 10, = 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_117_in_jump_statement2423 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_expression_in_jump_statement2425 =3D frozenset([25])=0D FOLLOW_25_in_jump_statement2427 =3D frozenset([1])=0D FOLLOW_declaration_specifiers_in_synpred2100 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_synpred4100 =3D frozenset([4, 58, 59,= 60, 62, 66])=0D - FOLLOW_declarator_in_synpred4103 =3D frozenset([4, 26, 29, 30, 31, 32,= 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 53= , 54, 55, 56, 57, 58, 59, 60, 61])=0D - FOLLOW_declaration_in_synpred4105 =3D frozenset([4, 26, 29, 30, 31, 32= , 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 48, 49, 50, 51, 52, 5= 3, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_specifiers_in_synpred4100 =3D frozenset(=0D + [4, 58, 59, 60, 62, 66])=0D + FOLLOW_declarator_in_synpred4103 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_declaration_in_synpred4105 =3D frozenset(=0D + [4, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43= , 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D FOLLOW_43_in_synpred4108 =3D frozenset([1])=0D FOLLOW_declaration_in_synpred5118 =3D frozenset([1])=0D FOLLOW_declaration_specifiers_in_synpred7157 =3D frozenset([1])=0D @@ -18760,8 +17847,10 @@ class CParser(Parser): FOLLOW_type_specifier_in_synpred14272 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred15286 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred33444 =3D frozenset([1])=0D - FOLLOW_IDENTIFIER_in_synpred34442 =3D frozenset([4, 49, 50, 51, 52, 53= , 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D - FOLLOW_type_qualifier_in_synpred34444 =3D frozenset([4, 49, 50, 51, 52= , 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_IDENTIFIER_in_synpred34442 =3D frozenset(=0D + [4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D + FOLLOW_type_qualifier_in_synpred34444 =3D frozenset(=0D + [4, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 66])=0D FOLLOW_declarator_in_synpred34447 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred39566 =3D frozenset([1])=0D FOLLOW_type_specifier_in_synpred40570 =3D frozenset([1])=0D @@ -18773,7 +17862,8 @@ class CParser(Parser): FOLLOW_declarator_suffix_in_synpred67821 =3D frozenset([1])=0D FOLLOW_58_in_synpred69830 =3D frozenset([1])=0D FOLLOW_declarator_suffix_in_synpred70838 =3D frozenset([1])=0D - FOLLOW_62_in_synpred73878 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D + FOLLOW_62_in_synpred73878 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_parameter_type_list_in_synpred73880 =3D frozenset([63])=0D FOLLOW_63_in_synpred73882 =3D frozenset([1])=0D FOLLOW_62_in_synpred74892 =3D frozenset([4])=0D @@ -18781,38 +17871,51 @@ class CParser(Parser): FOLLOW_63_in_synpred74896 =3D frozenset([1])=0D FOLLOW_type_qualifier_in_synpred75921 =3D frozenset([1])=0D FOLLOW_pointer_in_synpred76924 =3D frozenset([1])=0D - FOLLOW_66_in_synpred77919 =3D frozenset([49, 50, 51, 52, 53, 54, 55, 5= 6, 57, 58, 59, 60, 61])=0D - FOLLOW_type_qualifier_in_synpred77921 =3D frozenset([1, 49, 50, 51, 52= , 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_66_in_synpred77919 =3D frozenset(=0D + [49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61])=0D + FOLLOW_type_qualifier_in_synpred77921 =3D frozenset(=0D + [1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_pointer_in_synpred77924 =3D frozenset([1])=0D FOLLOW_66_in_synpred78930 =3D frozenset([66])=0D FOLLOW_pointer_in_synpred78932 =3D frozenset([1])=0D FOLLOW_53_in_synpred81977 =3D frozenset([1])=0D - FOLLOW_27_in_synpred82974 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D - FOLLOW_53_in_synpred82977 =3D frozenset([4, 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, 5= 7, 58, 59, 60, 61, 66])=0D + FOLLOW_27_in_synpred82974 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D + FOLLOW_53_in_synpred82977 =3D frozenset([4, 29, 30, 31, 32, 33, 34, 35= , 36, 37, 38, 39,=0D + 40, 41, 42, 45, 46, 48, 49, 50, = 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_parameter_declaration_in_synpred82981 =3D frozenset([1])=0D FOLLOW_declarator_in_synpred83997 =3D frozenset([1])=0D FOLLOW_abstract_declarator_in_synpred84999 =3D frozenset([1])=0D - FOLLOW_declaration_specifiers_in_synpred86994 =3D frozenset([1, 4, 53,= 58, 59, 60, 62, 64, 66])=0D - FOLLOW_declarator_in_synpred86997 =3D frozenset([1, 4, 53, 58, 59, 60,= 62, 64, 66])=0D - FOLLOW_abstract_declarator_in_synpred86999 =3D frozenset([1, 4, 53, 58= , 59, 60, 62, 64, 66])=0D + FOLLOW_declaration_specifiers_in_synpred86994 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_declarator_in_synpred86997 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D + FOLLOW_abstract_declarator_in_synpred86999 =3D frozenset(=0D + [1, 4, 53, 58, 59, 60, 62, 64, 66])=0D FOLLOW_53_in_synpred861004 =3D frozenset([1])=0D - FOLLOW_specifier_qualifier_list_in_synpred901046 =3D frozenset([1, 62,= 64, 66])=0D + FOLLOW_specifier_qualifier_list_in_synpred901046 =3D frozenset([=0D + 1, 62, 64= , 66])=0D FOLLOW_abstract_declarator_in_synpred901048 =3D frozenset([1])=0D FOLLOW_direct_abstract_declarator_in_synpred911067 =3D frozenset([1])= =0D FOLLOW_62_in_synpred931086 =3D frozenset([62, 64, 66])=0D FOLLOW_abstract_declarator_in_synpred931088 =3D frozenset([63])=0D FOLLOW_63_in_synpred931090 =3D frozenset([1])=0D FOLLOW_abstract_declarator_suffix_in_synpred941098 =3D frozenset([1])= =0D - FOLLOW_62_in_synpred1091282 =3D frozenset([4, 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]= )=0D + FOLLOW_62_in_synpred1091282 =3D frozenset(=0D + [4, 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])=0D FOLLOW_type_name_in_synpred1091284 =3D frozenset([63])=0D - FOLLOW_63_in_synpred1091286 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_63_in_synpred1091286 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_cast_expression_in_synpred1091288 =3D frozenset([1])=0D - FOLLOW_74_in_synpred1141330 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_74_in_synpred1141330 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_unary_expression_in_synpred1141332 =3D frozenset([1])=0D - FOLLOW_62_in_synpred1171420 =3D frozenset([4, 5, 6, 7, 8, 9, 10, 62, 6= 6, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_62_in_synpred1171420 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_argument_expression_list_in_synpred1171424 =3D frozenset([63])= =0D FOLLOW_63_in_synpred1171428 =3D frozenset([1])=0D - FOLLOW_62_in_synpred1181444 =3D frozenset([4, 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, 66])=0D + FOLLOW_62_in_synpred1181444 =3D frozenset([4, 29, 30, 31, 32, 33, 34, = 35, 36, 37, 38,=0D + 39, 40, 41, 42, 45, 46, 48, 49= , 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 66])=0D FOLLOW_macro_parameter_list_in_synpred1181446 =3D frozenset([63])=0D FOLLOW_63_in_synpred1181448 =3D frozenset([1])=0D FOLLOW_66_in_synpred1201482 =3D frozenset([4])=0D @@ -18820,8 +17923,10 @@ class CParser(Parser): FOLLOW_STRING_LITERAL_in_synpred1371683 =3D frozenset([1])=0D FOLLOW_IDENTIFIER_in_synpred1381680 =3D frozenset([4, 9])=0D FOLLOW_STRING_LITERAL_in_synpred1381683 =3D frozenset([1, 9])=0D - FOLLOW_lvalue_in_synpred1421744 =3D frozenset([28, 80, 81, 82, 83, 84,= 85, 86, 87, 88, 89])=0D - FOLLOW_assignment_operator_in_synpred1421746 =3D frozenset([4, 5, 6, 7= , 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D + FOLLOW_lvalue_in_synpred1421744 =3D frozenset(=0D + [28, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89])=0D + FOLLOW_assignment_operator_in_synpred1421746 =3D frozenset(=0D + [4, 5, 6, 7, 8, 9, 10, 62, 66, 68, 69, 72, 73, 74, 77, 78, 79])=0D FOLLOW_assignment_expression_in_synpred1421748 =3D frozenset([1])=0D FOLLOW_expression_statement_in_synpred1692035 =3D frozenset([1])=0D FOLLOW_macro_statement_in_synpred1732055 =3D frozenset([1])=0D @@ -18830,4 +17935,3 @@ class CParser(Parser): FOLLOW_statement_list_in_synpred1822170 =3D frozenset([1])=0D FOLLOW_declaration_in_synpred1862225 =3D frozenset([1])=0D FOLLOW_statement_in_synpred1882242 =3D frozenset([1])=0D -=0D diff --git a/BaseTools/Source/Python/Eot/CParser4/CLexer.py b/BaseTools/Sou= rce/Python/Eot/CParser4/CLexer.py index 54374fd6e82d..739152edf0f5 100644 --- a/BaseTools/Source/Python/Eot/CParser4/CLexer.py +++ b/BaseTools/Source/Python/Eot/CParser4/CLexer.py @@ -5,7 +5,7 @@ from typing.io import TextIO import sys=0D =0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -424,7 +424,7 @@ class CLexer(Lexer): =0D atn =3D ATNDeserializer().deserialize(serializedATN())=0D =0D - decisionsToDFA =3D [ DFA(ds, i) for i, ds in enumerate(atn.decisionToS= tate) ]=0D + decisionsToDFA =3D [DFA(ds, i) for i, ds in enumerate(atn.decisionToSt= ate)]=0D =0D T__0 =3D 1=0D T__1 =3D 2=0D @@ -532,96 +532,99 @@ class CLexer(Lexer): LINE_COMMENT =3D 104=0D LINE_COMMAND =3D 105=0D =0D - channelNames =3D [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]=0D + channelNames =3D [u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN"]=0D =0D - modeNames =3D [ "DEFAULT_MODE" ]=0D + modeNames =3D ["DEFAULT_MODE"]=0D =0D - literalNames =3D [ "",=0D - "'{'", "';'", "'typedef'", "','", "'=3D'", "'extern'", "'stati= c'",=0D - "'auto'", "'register'", "'STATIC'", "'void'", "'char'", "'shor= t'",=0D - "'int'", "'long'", "'float'", "'double'", "'signed'", "'unsign= ed'",=0D - "'}'", "'struct'", "'union'", "':'", "'enum'", "'const'", "'vo= latile'",=0D - "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'", "'VOL= ATILE'",=0D - "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFIAPI'", "'EFI_BOOTSERVI= CE'",=0D - "'EFI_RUNTIMESERVICE'", "'PACKED'", "'('", "')'", "'['", "']'"= ,=0D - "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", "'++'", "'--'",=0D - "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/= =3D'",=0D - "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", = "'^=3D'", "'|=3D'",=0D - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!=3D'", "'<= '",=0D - "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__asm__'", "'_asm= '",=0D - "'__asm'", "'case'", "'default'", "'if'", "'else'", "'switch'"= ,=0D - "'while'", "'do'", "'goto'", "'continue'", "'break'", "'return= '" ]=0D + literalNames =3D ["",=0D + "'{'", "';'", "'typedef'", "','", "'=3D'", "'extern'",= "'static'",=0D + "'auto'", "'register'", "'STATIC'", "'void'", "'char'"= , "'short'",=0D + "'int'", "'long'", "'float'", "'double'", "'signed'", = "'unsigned'",=0D + "'}'", "'struct'", "'union'", "':'", "'enum'", "'const= '", "'volatile'",=0D + "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'= ", "'VOLATILE'",=0D + "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFIAPI'", "'EFI_B= OOTSERVICE'",=0D + "'EFI_RUNTIMESERVICE'", "'PACKED'", "'('", "')'", "'['= ", "']'",=0D + "'*'", "'...'", "'+'", "'-'", "'/'", "'%'", "'++'", "'= --'",=0D + "'sizeof'", "'.'", "'->'", "'&'", "'~'", "'!'", "'*=3D= '", "'/=3D'",=0D + "'%=3D'", "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'= &=3D'", "'^=3D'", "'|=3D'",=0D + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'", "'<'",=0D + "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__asm__'"= , "'_asm'",=0D + "'__asm'", "'case'", "'default'", "'if'", "'else'", "'= switch'",=0D + "'while'", "'do'", "'goto'", "'continue'", "'break'", = "'return'"]=0D =0D - symbolicNames =3D [ "",=0D - "IDENTIFIER", "CHARACTER_LITERAL", "STRING_LITERAL", "HEX_LITE= RAL",=0D - "DECIMAL_LITERAL", "OCTAL_LITERAL", "FLOATING_POINT_LITERAL",= =0D - "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT",=0D - "LINE_COMMAND" ]=0D + symbolicNames =3D ["",=0D + "IDENTIFIER", "CHARACTER_LITERAL", "STRING_LITERAL", = "HEX_LITERAL",=0D + "DECIMAL_LITERAL", "OCTAL_LITERAL", "FLOATING_POINT_L= ITERAL",=0D + "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COM= MENT",=0D + "LINE_COMMAND"]=0D =0D - ruleNames =3D [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6"= ,=0D - "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__1= 3",=0D - "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",=0D - "T__20", "T__21", "T__22", "T__23", "T__24", "T__25",=0D - "T__26", "T__27", "T__28", "T__29", "T__30", "T__31",=0D - "T__32", "T__33", "T__34", "T__35", "T__36", "T__37",=0D - "T__38", "T__39", "T__40", "T__41", "T__42", "T__43",=0D - "T__44", "T__45", "T__46", "T__47", "T__48", "T__49",=0D - "T__50", "T__51", "T__52", "T__53", "T__54", "T__55",=0D - "T__56", "T__57", "T__58", "T__59", "T__60", "T__61",=0D - "T__62", "T__63", "T__64", "T__65", "T__66", "T__67",=0D - "T__68", "T__69", "T__70", "T__71", "T__72", "T__73",=0D - "T__74", "T__75", "T__76", "T__77", "T__78", "T__79",=0D - "T__80", "T__81", "T__82", "T__83", "T__84", "T__85",=0D - "T__86", "T__87", "T__88", "T__89", "T__90", "T__91",=0D - "IDENTIFIER", "LETTER", "CHARACTER_LITERAL", "STRING_LIT= ERAL",=0D - "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL", "HexD= igit",=0D - "IntegerTypeSuffix", "FLOATING_POINT_LITERAL", "Exponent= ",=0D - "FloatTypeSuffix", "EscapeSequence", "OctalEscape", "Uni= codeEscape",=0D - "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMEN= T",=0D - "LINE_COMMAND" ]=0D + ruleNames =3D ["T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",= =0D + "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13= ",=0D + "T__14", "T__15", "T__16", "T__17", "T__18", "T__19",=0D + "T__20", "T__21", "T__22", "T__23", "T__24", "T__25",=0D + "T__26", "T__27", "T__28", "T__29", "T__30", "T__31",=0D + "T__32", "T__33", "T__34", "T__35", "T__36", "T__37",=0D + "T__38", "T__39", "T__40", "T__41", "T__42", "T__43",=0D + "T__44", "T__45", "T__46", "T__47", "T__48", "T__49",=0D + "T__50", "T__51", "T__52", "T__53", "T__54", "T__55",=0D + "T__56", "T__57", "T__58", "T__59", "T__60", "T__61",=0D + "T__62", "T__63", "T__64", "T__65", "T__66", "T__67",=0D + "T__68", "T__69", "T__70", "T__71", "T__72", "T__73",=0D + "T__74", "T__75", "T__76", "T__77", "T__78", "T__79",=0D + "T__80", "T__81", "T__82", "T__83", "T__84", "T__85",=0D + "T__86", "T__87", "T__88", "T__89", "T__90", "T__91",=0D + "IDENTIFIER", "LETTER", "CHARACTER_LITERAL", "STRING_LITE= RAL",=0D + "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL", "HexDi= git",=0D + "IntegerTypeSuffix", "FLOATING_POINT_LITERAL", "Exponent"= ,=0D + "FloatTypeSuffix", "EscapeSequence", "OctalEscape", "Unic= odeEscape",=0D + "WS", "BS", "UnicodeVocabulary", "COMMENT", "LINE_COMMENT= ",=0D + "LINE_COMMAND"]=0D =0D grammarFileName =3D "C.g4"=0D =0D # @param output=3D sys.stdout Type: TextIO=0D - def __init__(self,input=3DNone,output=3D sys.stdout):=0D + def __init__(self, input=3DNone, output=3Dsys.stdout):=0D super().__init__(input, output)=0D self.checkVersion("4.7.1")=0D - self._interp =3D LexerATNSimulator(self, self.atn, self.decisionsT= oDFA, PredictionContextCache())=0D + self._interp =3D LexerATNSimulator(=0D + self, self.atn, self.decisionsToDFA, PredictionContextCache())= =0D self._actions =3D None=0D self._predicates =3D None=0D =0D + def printTokenInfo(self, line, offset, tokenText):=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D -=0D - def printTokenInfo(self,line,offset,tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D -=0D - def StorePredicateExpression(self,StartLine,StartOffset,EndLine,EndOff= set,Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.PredicateExpressionList.append(PredExp)=0D =0D - def StoreEnumerationDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, S= tartOffset), (EndLine, EndOffset))=0D + def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D - def StoreStructUnionDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D - def StoreTypedefDefinition(self,StartLine,StartOffset,EndLine,EndOffse= t,FromText,ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLi= ne, StartOffset), (EndLine, EndOffset))=0D + def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D - def StoreFunctionDefinition(self,StartLine,StartOffset,EndLine,EndOffs= et,ModifierText,DeclText,LeftBraceLine,LeftBraceOffset,DeclLine,DeclOffset)= :=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBrace= Offset), (DeclLine, DeclOffset))=0D + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D - def StoreVariableDeclaration(self,StartLine,StartOffset,EndLine,EndOff= set,ModifierText,DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclTex= t, (StartLine, StartOffset), (EndLine, EndOffset))=0D + def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D - def StoreFunctionCalling(self,StartLine,StartOffset,EndLine,EndOffset,= FuncName,ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (St= artLine, StartOffset), (EndLine, EndOffset))=0D + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D FileProfile.FunctionCallingList.append(FuncCall)=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Eot/CParser4/CListener.py b/BaseTools/= Source/Python/Eot/CParser4/CListener.py index 46f7f1b3d1ca..866d5717d42b 100644 --- a/BaseTools/Source/Python/Eot/CParser4/CListener.py +++ b/BaseTools/Source/Python/Eot/CParser4/CListener.py @@ -5,7 +5,7 @@ if __name__ is not None and "." in __name__: else:=0D from CParser import CParser=0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -27,782 +27,710 @@ class CListener(ParseTreeListener): =0D # Enter a parse tree produced by CParser#translation_unit.=0D # @param ctx Type: CParser.Translation_unitContext=0D - def enterTranslation_unit(self,ctx):=0D + def enterTranslation_unit(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#translation_unit.=0D # @param ctx Type: CParser.Translation_unitContext=0D - def exitTranslation_unit(self,ctx):=0D + def exitTranslation_unit(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#external_declaration.=0D # @param ctx Type: CParser.External_declarationContext=0D - def enterExternal_declaration(self,ctx):=0D + def enterExternal_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#external_declaration.=0D # @param ctx Type: CParser.External_declarationContext=0D - def exitExternal_declaration(self,ctx):=0D + def exitExternal_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#function_definition.=0D # @param ctx Type: CParser.Function_definitionContext=0D - def enterFunction_definition(self,ctx):=0D + def enterFunction_definition(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#function_definition.=0D # @param ctx Type: CParser.Function_definitionContext=0D - def exitFunction_definition(self,ctx):=0D + def exitFunction_definition(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declaration_specifiers.=0D # @param ctx Type: CParser.Declaration_specifiersContext=0D - def enterDeclaration_specifiers(self,ctx):=0D + def enterDeclaration_specifiers(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declaration_specifiers.=0D # @param ctx Type: CParser.Declaration_specifiersContext=0D - def exitDeclaration_specifiers(self,ctx):=0D + def exitDeclaration_specifiers(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declaration.=0D # @param ctx Type: CParser.DeclarationContext=0D - def enterDeclaration(self,ctx):=0D + def enterDeclaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declaration.=0D # @param ctx Type: CParser.DeclarationContext=0D - def exitDeclaration(self,ctx):=0D + def exitDeclaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#init_declarator_list.=0D # @param ctx Type: CParser.Init_declarator_listContext=0D - def enterInit_declarator_list(self,ctx):=0D + def enterInit_declarator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#init_declarator_list.=0D # @param ctx Type: CParser.Init_declarator_listContext=0D - def exitInit_declarator_list(self,ctx):=0D + def exitInit_declarator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#init_declarator.=0D # @param ctx Type: CParser.Init_declaratorContext=0D - def enterInit_declarator(self,ctx):=0D + def enterInit_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#init_declarator.=0D # @param ctx Type: CParser.Init_declaratorContext=0D - def exitInit_declarator(self,ctx):=0D + def exitInit_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#storage_class_specifier.=0D # @param ctx Type: CParser.Storage_class_specifierContext=0D - def enterStorage_class_specifier(self,ctx):=0D + def enterStorage_class_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#storage_class_specifier.=0D # @param ctx Type: CParser.Storage_class_specifierContext=0D - def exitStorage_class_specifier(self,ctx):=0D + def exitStorage_class_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_specifier.=0D # @param ctx Type: CParser.Type_specifierContext=0D - def enterType_specifier(self,ctx):=0D + def enterType_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_specifier.=0D # @param ctx Type: CParser.Type_specifierContext=0D - def exitType_specifier(self,ctx):=0D + def exitType_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_id.=0D # @param ctx Type: CParser.Type_idContext=0D - def enterType_id(self,ctx):=0D + def enterType_id(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_id.=0D # @param ctx Type: CParser.Type_idContext=0D - def exitType_id(self,ctx):=0D + def exitType_id(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_or_union_specifier.=0D # @param ctx Type: CParser.Struct_or_union_specifierContext=0D - def enterStruct_or_union_specifier(self,ctx):=0D + def enterStruct_or_union_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_or_union_specifier.=0D # @param ctx Type: CParser.Struct_or_union_specifierContext=0D - def exitStruct_or_union_specifier(self,ctx):=0D + def exitStruct_or_union_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_or_union.=0D # @param ctx Type: CParser.Struct_or_unionContext=0D - def enterStruct_or_union(self,ctx):=0D + def enterStruct_or_union(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_or_union.=0D # @param ctx Type: CParser.Struct_or_unionContext=0D - def exitStruct_or_union(self,ctx):=0D + def exitStruct_or_union(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declaration_list.=0D # @param ctx Type: CParser.Struct_declaration_listContext=0D - def enterStruct_declaration_list(self,ctx):=0D + def enterStruct_declaration_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declaration_list.=0D # @param ctx Type: CParser.Struct_declaration_listContext=0D - def exitStruct_declaration_list(self,ctx):=0D + def exitStruct_declaration_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declaration.=0D # @param ctx Type: CParser.Struct_declarationContext=0D - def enterStruct_declaration(self,ctx):=0D + def enterStruct_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declaration.=0D # @param ctx Type: CParser.Struct_declarationContext=0D - def exitStruct_declaration(self,ctx):=0D + def exitStruct_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#specifier_qualifier_list.=0D # @param ctx Type: CParser.Specifier_qualifier_listContext=0D - def enterSpecifier_qualifier_list(self,ctx):=0D + def enterSpecifier_qualifier_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#specifier_qualifier_list.=0D # @param ctx Type: CParser.Specifier_qualifier_listContext=0D - def exitSpecifier_qualifier_list(self,ctx):=0D + def exitSpecifier_qualifier_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declarator_list.=0D # @param ctx Type: CParser.Struct_declarator_listContext=0D - def enterStruct_declarator_list(self,ctx):=0D + def enterStruct_declarator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declarator_list.=0D # @param ctx Type: CParser.Struct_declarator_listContext=0D - def exitStruct_declarator_list(self,ctx):=0D + def exitStruct_declarator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#struct_declarator.=0D # @param ctx Type: CParser.Struct_declaratorContext=0D - def enterStruct_declarator(self,ctx):=0D + def enterStruct_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#struct_declarator.=0D # @param ctx Type: CParser.Struct_declaratorContext=0D - def exitStruct_declarator(self,ctx):=0D + def exitStruct_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enum_specifier.=0D # @param ctx Type: CParser.Enum_specifierContext=0D - def enterEnum_specifier(self,ctx):=0D + def enterEnum_specifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enum_specifier.=0D # @param ctx Type: CParser.Enum_specifierContext=0D - def exitEnum_specifier(self,ctx):=0D + def exitEnum_specifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enumerator_list.=0D # @param ctx Type: CParser.Enumerator_listContext=0D - def enterEnumerator_list(self,ctx):=0D + def enterEnumerator_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enumerator_list.=0D # @param ctx Type: CParser.Enumerator_listContext=0D - def exitEnumerator_list(self,ctx):=0D + def exitEnumerator_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#enumerator.=0D # @param ctx Type: CParser.EnumeratorContext=0D - def enterEnumerator(self,ctx):=0D + def enterEnumerator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#enumerator.=0D # @param ctx Type: CParser.EnumeratorContext=0D - def exitEnumerator(self,ctx):=0D + def exitEnumerator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_qualifier.=0D # @param ctx Type: CParser.Type_qualifierContext=0D - def enterType_qualifier(self,ctx):=0D + def enterType_qualifier(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_qualifier.=0D # @param ctx Type: CParser.Type_qualifierContext=0D - def exitType_qualifier(self,ctx):=0D + def exitType_qualifier(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declarator.=0D # @param ctx Type: CParser.DeclaratorContext=0D - def enterDeclarator(self,ctx):=0D + def enterDeclarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declarator.=0D # @param ctx Type: CParser.DeclaratorContext=0D - def exitDeclarator(self,ctx):=0D + def exitDeclarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#direct_declarator.=0D # @param ctx Type: CParser.Direct_declaratorContext=0D - def enterDirect_declarator(self,ctx):=0D + def enterDirect_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#direct_declarator.=0D # @param ctx Type: CParser.Direct_declaratorContext=0D - def exitDirect_declarator(self,ctx):=0D + def exitDirect_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#declarator_suffix.=0D # @param ctx Type: CParser.Declarator_suffixContext=0D - def enterDeclarator_suffix(self,ctx):=0D + def enterDeclarator_suffix(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#declarator_suffix.=0D # @param ctx Type: CParser.Declarator_suffixContext=0D - def exitDeclarator_suffix(self,ctx):=0D + def exitDeclarator_suffix(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#pointer.=0D # @param ctx Type: CParser.PointerContext=0D - def enterPointer(self,ctx):=0D + def enterPointer(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#pointer.=0D # @param ctx Type: CParser.PointerContext=0D - def exitPointer(self,ctx):=0D + def exitPointer(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_type_list.=0D # @param ctx Type: CParser.Parameter_type_listContext=0D - def enterParameter_type_list(self,ctx):=0D + def enterParameter_type_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_type_list.=0D # @param ctx Type: CParser.Parameter_type_listContext=0D - def exitParameter_type_list(self,ctx):=0D + def exitParameter_type_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_list.=0D # @param ctx Type: CParser.Parameter_listContext=0D - def enterParameter_list(self,ctx):=0D + def enterParameter_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_list.=0D # @param ctx Type: CParser.Parameter_listContext=0D - def exitParameter_list(self,ctx):=0D + def exitParameter_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#parameter_declaration.=0D # @param ctx Type: CParser.Parameter_declarationContext=0D - def enterParameter_declaration(self,ctx):=0D + def enterParameter_declaration(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#parameter_declaration.=0D # @param ctx Type: CParser.Parameter_declarationContext=0D - def exitParameter_declaration(self,ctx):=0D + def exitParameter_declaration(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#identifier_list.=0D # @param ctx Type: CParser.Identifier_listContext=0D - def enterIdentifier_list(self,ctx):=0D + def enterIdentifier_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#identifier_list.=0D # @param ctx Type: CParser.Identifier_listContext=0D - def exitIdentifier_list(self,ctx):=0D + def exitIdentifier_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#type_name.=0D # @param ctx Type: CParser.Type_nameContext=0D - def enterType_name(self,ctx):=0D + def enterType_name(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#type_name.=0D # @param ctx Type: CParser.Type_nameContext=0D - def exitType_name(self,ctx):=0D + def exitType_name(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#abstract_declarator.=0D # @param ctx Type: CParser.Abstract_declaratorContext=0D - def enterAbstract_declarator(self,ctx):=0D + def enterAbstract_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#abstract_declarator.=0D # @param ctx Type: CParser.Abstract_declaratorContext=0D - def exitAbstract_declarator(self,ctx):=0D + def exitAbstract_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#direct_abstract_declarator.=0D # @param ctx Type: CParser.Direct_abstract_declaratorContext=0D - def enterDirect_abstract_declarator(self,ctx):=0D + def enterDirect_abstract_declarator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#direct_abstract_declarator.=0D # @param ctx Type: CParser.Direct_abstract_declaratorContext=0D - def exitDirect_abstract_declarator(self,ctx):=0D + def exitDirect_abstract_declarator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#abstract_declarator_suffix.=0D # @param ctx Type: CParser.Abstract_declarator_suffixContext=0D - def enterAbstract_declarator_suffix(self,ctx):=0D + def enterAbstract_declarator_suffix(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#abstract_declarator_suffix.=0D # @param ctx Type: CParser.Abstract_declarator_suffixContext=0D - def exitAbstract_declarator_suffix(self,ctx):=0D + def exitAbstract_declarator_suffix(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#initializer.=0D # @param ctx Type: CParser.InitializerContext=0D - def enterInitializer(self,ctx):=0D + def enterInitializer(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#initializer.=0D # @param ctx Type: CParser.InitializerContext=0D - def exitInitializer(self,ctx):=0D + def exitInitializer(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#initializer_list.=0D # @param ctx Type: CParser.Initializer_listContext=0D - def enterInitializer_list(self,ctx):=0D + def enterInitializer_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#initializer_list.=0D # @param ctx Type: CParser.Initializer_listContext=0D - def exitInitializer_list(self,ctx):=0D + def exitInitializer_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#argument_expression_list.=0D # @param ctx Type: CParser.Argument_expression_listContext=0D - def enterArgument_expression_list(self,ctx):=0D + def enterArgument_expression_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#argument_expression_list.=0D # @param ctx Type: CParser.Argument_expression_listContext=0D - def exitArgument_expression_list(self,ctx):=0D + def exitArgument_expression_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#additive_expression.=0D # @param ctx Type: CParser.Additive_expressionContext=0D - def enterAdditive_expression(self,ctx):=0D + def enterAdditive_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#additive_expression.=0D # @param ctx Type: CParser.Additive_expressionContext=0D - def exitAdditive_expression(self,ctx):=0D + def exitAdditive_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#multiplicative_expression.=0D # @param ctx Type: CParser.Multiplicative_expressionContext=0D - def enterMultiplicative_expression(self,ctx):=0D + def enterMultiplicative_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#multiplicative_expression.=0D # @param ctx Type: CParser.Multiplicative_expressionContext=0D - def exitMultiplicative_expression(self,ctx):=0D + def exitMultiplicative_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#cast_expression.=0D # @param ctx Type: CParser.Cast_expressionContext=0D - def enterCast_expression(self,ctx):=0D + def enterCast_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#cast_expression.=0D # @param ctx Type: CParser.Cast_expressionContext=0D - def exitCast_expression(self,ctx):=0D + def exitCast_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#unary_expression.=0D # @param ctx Type: CParser.Unary_expressionContext=0D - def enterUnary_expression(self,ctx):=0D + def enterUnary_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#unary_expression.=0D # @param ctx Type: CParser.Unary_expressionContext=0D - def exitUnary_expression(self,ctx):=0D + def exitUnary_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#postfix_expression.=0D # @param ctx Type: CParser.Postfix_expressionContext=0D - def enterPostfix_expression(self,ctx):=0D + def enterPostfix_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#postfix_expression.=0D # @param ctx Type: CParser.Postfix_expressionContext=0D - def exitPostfix_expression(self,ctx):=0D + def exitPostfix_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#macro_parameter_list.=0D # @param ctx Type: CParser.Macro_parameter_listContext=0D - def enterMacro_parameter_list(self,ctx):=0D + def enterMacro_parameter_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#macro_parameter_list.=0D # @param ctx Type: CParser.Macro_parameter_listContext=0D - def exitMacro_parameter_list(self,ctx):=0D + def exitMacro_parameter_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#unary_operator.=0D # @param ctx Type: CParser.Unary_operatorContext=0D - def enterUnary_operator(self,ctx):=0D + def enterUnary_operator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#unary_operator.=0D # @param ctx Type: CParser.Unary_operatorContext=0D - def exitUnary_operator(self,ctx):=0D + def exitUnary_operator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#primary_expression.=0D # @param ctx Type: CParser.Primary_expressionContext=0D - def enterPrimary_expression(self,ctx):=0D + def enterPrimary_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#primary_expression.=0D # @param ctx Type: CParser.Primary_expressionContext=0D - def exitPrimary_expression(self,ctx):=0D + def exitPrimary_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#constant.=0D # @param ctx Type: CParser.ConstantContext=0D - def enterConstant(self,ctx):=0D + def enterConstant(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#constant.=0D # @param ctx Type: CParser.ConstantContext=0D - def exitConstant(self,ctx):=0D + def exitConstant(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#expression.=0D # @param ctx Type: CParser.ExpressionContext=0D - def enterExpression(self,ctx):=0D + def enterExpression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#expression.=0D # @param ctx Type: CParser.ExpressionContext=0D - def exitExpression(self,ctx):=0D + def exitExpression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#constant_expression.=0D # @param ctx Type: CParser.Constant_expressionContext=0D - def enterConstant_expression(self,ctx):=0D + def enterConstant_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#constant_expression.=0D # @param ctx Type: CParser.Constant_expressionContext=0D - def exitConstant_expression(self,ctx):=0D + def exitConstant_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#assignment_expression.=0D # @param ctx Type: CParser.Assignment_expressionContext=0D - def enterAssignment_expression(self,ctx):=0D + def enterAssignment_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#assignment_expression.=0D # @param ctx Type: CParser.Assignment_expressionContext=0D - def exitAssignment_expression(self,ctx):=0D + def exitAssignment_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#lvalue.=0D # @param ctx Type: CParser.LvalueContext=0D - def enterLvalue(self,ctx):=0D + def enterLvalue(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#lvalue.=0D # @param ctx Type: CParser.LvalueContext=0D - def exitLvalue(self,ctx):=0D + def exitLvalue(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#assignment_operator.=0D # @param ctx Type: CParser.Assignment_operatorContext=0D - def enterAssignment_operator(self,ctx):=0D + def enterAssignment_operator(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#assignment_operator.=0D # @param ctx Type: CParser.Assignment_operatorContext=0D - def exitAssignment_operator(self,ctx):=0D + def exitAssignment_operator(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#conditional_expression.=0D # @param ctx Type: CParser.Conditional_expressionContext=0D - def enterConditional_expression(self,ctx):=0D + def enterConditional_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#conditional_expression.=0D # @param ctx Type: CParser.Conditional_expressionContext=0D - def exitConditional_expression(self,ctx):=0D + def exitConditional_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#logical_or_expression.=0D # @param ctx Type: CParser.Logical_or_expressionContext=0D - def enterLogical_or_expression(self,ctx):=0D + def enterLogical_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#logical_or_expression.=0D # @param ctx Type: CParser.Logical_or_expressionContext=0D - def exitLogical_or_expression(self,ctx):=0D + def exitLogical_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#logical_and_expression.=0D # @param ctx Type: CParser.Logical_and_expressionContext=0D - def enterLogical_and_expression(self,ctx):=0D + def enterLogical_and_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#logical_and_expression.=0D # @param ctx Type: CParser.Logical_and_expressionContext=0D - def exitLogical_and_expression(self,ctx):=0D + def exitLogical_and_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#inclusive_or_expression.=0D # @param ctx Type: CParser.Inclusive_or_expressionContext=0D - def enterInclusive_or_expression(self,ctx):=0D + def enterInclusive_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#inclusive_or_expression.=0D # @param ctx Type: CParser.Inclusive_or_expressionContext=0D - def exitInclusive_or_expression(self,ctx):=0D + def exitInclusive_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#exclusive_or_expression.=0D # @param ctx Type: CParser.Exclusive_or_expressionContext=0D - def enterExclusive_or_expression(self,ctx):=0D + def enterExclusive_or_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#exclusive_or_expression.=0D # @param ctx Type: CParser.Exclusive_or_expressionContext=0D - def exitExclusive_or_expression(self,ctx):=0D + def exitExclusive_or_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#and_expression.=0D # @param ctx Type: CParser.And_expressionContext=0D - def enterAnd_expression(self,ctx):=0D + def enterAnd_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#and_expression.=0D # @param ctx Type: CParser.And_expressionContext=0D - def exitAnd_expression(self,ctx):=0D + def exitAnd_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#equality_expression.=0D # @param ctx Type: CParser.Equality_expressionContext=0D - def enterEquality_expression(self,ctx):=0D + def enterEquality_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#equality_expression.=0D # @param ctx Type: CParser.Equality_expressionContext=0D - def exitEquality_expression(self,ctx):=0D + def exitEquality_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#relational_expression.=0D # @param ctx Type: CParser.Relational_expressionContext=0D - def enterRelational_expression(self,ctx):=0D + def enterRelational_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#relational_expression.=0D # @param ctx Type: CParser.Relational_expressionContext=0D - def exitRelational_expression(self,ctx):=0D + def exitRelational_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#shift_expression.=0D # @param ctx Type: CParser.Shift_expressionContext=0D - def enterShift_expression(self,ctx):=0D + def enterShift_expression(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#shift_expression.=0D # @param ctx Type: CParser.Shift_expressionContext=0D - def exitShift_expression(self,ctx):=0D + def exitShift_expression(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#statement.=0D # @param ctx Type: CParser.StatementContext=0D - def enterStatement(self,ctx):=0D + def enterStatement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#statement.=0D # @param ctx Type: CParser.StatementContext=0D - def exitStatement(self,ctx):=0D + def exitStatement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm2_statement.=0D # @param ctx Type: CParser.Asm2_statementContext=0D - def enterAsm2_statement(self,ctx):=0D + def enterAsm2_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm2_statement.=0D # @param ctx Type: CParser.Asm2_statementContext=0D - def exitAsm2_statement(self,ctx):=0D + def exitAsm2_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm1_statement.=0D # @param ctx Type: CParser.Asm1_statementContext=0D - def enterAsm1_statement(self,ctx):=0D + def enterAsm1_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm1_statement.=0D # @param ctx Type: CParser.Asm1_statementContext=0D - def exitAsm1_statement(self,ctx):=0D + def exitAsm1_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#asm_statement.=0D # @param ctx Type: CParser.Asm_statementContext=0D - def enterAsm_statement(self,ctx):=0D + def enterAsm_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#asm_statement.=0D # @param ctx Type: CParser.Asm_statementContext=0D - def exitAsm_statement(self,ctx):=0D + def exitAsm_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#macro_statement.=0D # @param ctx Type: CParser.Macro_statementContext=0D - def enterMacro_statement(self,ctx):=0D + def enterMacro_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#macro_statement.=0D # @param ctx Type: CParser.Macro_statementContext=0D - def exitMacro_statement(self,ctx):=0D + def exitMacro_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#labeled_statement.=0D # @param ctx Type: CParser.Labeled_statementContext=0D - def enterLabeled_statement(self,ctx):=0D + def enterLabeled_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#labeled_statement.=0D # @param ctx Type: CParser.Labeled_statementContext=0D - def exitLabeled_statement(self,ctx):=0D + def exitLabeled_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#compound_statement.=0D # @param ctx Type: CParser.Compound_statementContext=0D - def enterCompound_statement(self,ctx):=0D + def enterCompound_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#compound_statement.=0D # @param ctx Type: CParser.Compound_statementContext=0D - def exitCompound_statement(self,ctx):=0D + def exitCompound_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#statement_list.=0D # @param ctx Type: CParser.Statement_listContext=0D - def enterStatement_list(self,ctx):=0D + def enterStatement_list(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#statement_list.=0D # @param ctx Type: CParser.Statement_listContext=0D - def exitStatement_list(self,ctx):=0D + def exitStatement_list(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#expression_statement.=0D # @param ctx Type: CParser.Expression_statementContext=0D - def enterExpression_statement(self,ctx):=0D + def enterExpression_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#expression_statement.=0D # @param ctx Type: CParser.Expression_statementContext=0D - def exitExpression_statement(self,ctx):=0D + def exitExpression_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#selection_statement.=0D # @param ctx Type: CParser.Selection_statementContext=0D - def enterSelection_statement(self,ctx):=0D + def enterSelection_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#selection_statement.=0D # @param ctx Type: CParser.Selection_statementContext=0D - def exitSelection_statement(self,ctx):=0D + def exitSelection_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#iteration_statement.=0D # @param ctx Type: CParser.Iteration_statementContext=0D - def enterIteration_statement(self,ctx):=0D + def enterIteration_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#iteration_statement.=0D # @param ctx Type: CParser.Iteration_statementContext=0D - def exitIteration_statement(self,ctx):=0D + def exitIteration_statement(self, ctx):=0D pass=0D =0D -=0D # Enter a parse tree produced by CParser#jump_statement.=0D # @param ctx Type: CParser.Jump_statementContext=0D - def enterJump_statement(self,ctx):=0D + def enterJump_statement(self, ctx):=0D pass=0D =0D # Exit a parse tree produced by CParser#jump_statement.=0D # @param ctx Type: CParser.Jump_statementContext=0D - def exitJump_statement(self,ctx):=0D + def exitJump_statement(self, ctx):=0D pass=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Eot/CParser4/CParser.py b/BaseTools/So= urce/Python/Eot/CParser4/CParser.py index 31d23d55aa57..22c17c66680a 100644 --- a/BaseTools/Source/Python/Eot/CParser4/CParser.py +++ b/BaseTools/Source/Python/Eot/CParser4/CParser.py @@ -6,7 +6,7 @@ from typing.io import TextIO import sys=0D =0D =0D -## @file=0D +# @file=0D # The file defines the parser for C source files.=0D #=0D # THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.=0D @@ -22,6 +22,7 @@ import sys import Ecc.CodeFragment as CodeFragment=0D import Ecc.FileProfile as FileProfile=0D =0D +=0D def serializedATN():=0D with StringIO() as buf:=0D buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3k")= =0D @@ -475,61 +476,61 @@ def serializedATN(): return buf.getvalue()=0D =0D =0D -class CParser ( Parser ):=0D +class CParser (Parser):=0D =0D grammarFileName =3D "C.g4"=0D =0D atn =3D ATNDeserializer().deserialize(serializedATN())=0D =0D - decisionsToDFA =3D [ DFA(ds, i) for i, ds in enumerate(atn.decisionToS= tate) ]=0D + decisionsToDFA =3D [DFA(ds, i) for i, ds in enumerate(atn.decisionToSt= ate)]=0D =0D sharedContextCache =3D PredictionContextCache()=0D =0D - literalNames =3D [ "", "'{'", "';'", "'typedef'", "','", "'= =3D'",=0D - "'extern'", "'static'", "'auto'", "'register'", "'STA= TIC'",=0D - "'void'", "'char'", "'short'", "'int'", "'long'", "'f= loat'",=0D - "'double'", "'signed'", "'unsigned'", "'}'", "'struct= '",=0D - "'union'", "':'", "'enum'", "'const'", "'volatile'",= =0D - "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED= '",=0D - "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EF= IAPI'",=0D - "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED= '",=0D - "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'",=0D - "'-'", "'/'", "'%'", "'++'", "'--'", "'sizeof'", "'.'= ",=0D - "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/=3D'", "'%= =3D'",=0D - "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", "= '^=3D'", "'|=3D'",=0D - "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'",=0D - "'<'", "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'_= _asm__'",=0D - "'_asm'", "'__asm'", "'case'", "'default'", "'if'",=0D - "'else'", "'switch'", "'while'", "'do'", "'goto'",=0D - "'continue'", "'break'", "'return'" ]=0D + literalNames =3D ["", "'{'", "';'", "'typedef'", "','", "'=3D= '",=0D + "'extern'", "'static'", "'auto'", "'register'", "'STAT= IC'",=0D + "'void'", "'char'", "'short'", "'int'", "'long'", "'fl= oat'",=0D + "'double'", "'signed'", "'unsigned'", "'}'", "'struct'= ",=0D + "'union'", "':'", "'enum'", "'const'", "'volatile'",=0D + "'IN'", "'OUT'", "'OPTIONAL'", "'CONST'", "'UNALIGNED'= ",=0D + "'VOLATILE'", "'GLOBAL_REMOVE_IF_UNREFERENCED'", "'EFI= API'",=0D + "'EFI_BOOTSERVICE'", "'EFI_RUNTIMESERVICE'", "'PACKED'= ",=0D + "'('", "')'", "'['", "']'", "'*'", "'...'", "'+'",=0D + "'-'", "'/'", "'%'", "'++'", "'--'", "'sizeof'", "'.'"= ,=0D + "'->'", "'&'", "'~'", "'!'", "'*=3D'", "'/=3D'", "'%= =3D'",=0D + "'+=3D'", "'-=3D'", "'<<=3D'", "'>>=3D'", "'&=3D'", "'= ^=3D'", "'|=3D'",=0D + "'?'", "'||'", "'&&'", "'|'", "'^'", "'=3D=3D'", "'!= =3D'",=0D + "'<'", "'>'", "'<=3D'", "'>=3D'", "'<<'", "'>>'", "'__= asm__'",=0D + "'_asm'", "'__asm'", "'case'", "'default'", "'if'",=0D + "'else'", "'switch'", "'while'", "'do'", "'goto'",=0D + "'continue'", "'break'", "'return'"]=0D =0D - symbolicNames =3D [ "", "", "", ""= ,=0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "", "", "",= =0D - "", "IDENTIFIER", "CHARACTER_LITERAL", "STR= ING_LITERAL",=0D - "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL",=0D - "FLOATING_POINT_LITERAL", "WS", "BS", "UnicodeVocabu= lary",=0D - "COMMENT", "LINE_COMMENT", "LINE_COMMAND" ]=0D + symbolicNames =3D ["", "", "", "",= =0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "", "", "",=0D + "", "IDENTIFIER", "CHARACTER_LITERAL", "STRI= NG_LITERAL",=0D + "HEX_LITERAL", "DECIMAL_LITERAL", "OCTAL_LITERAL",=0D + "FLOATING_POINT_LITERAL", "WS", "BS", "UnicodeVocabul= ary",=0D + "COMMENT", "LINE_COMMENT", "LINE_COMMAND"]=0D =0D RULE_translation_unit =3D 0=0D RULE_external_declaration =3D 1=0D @@ -603,225 +604,224 @@ class CParser ( Parser ): RULE_iteration_statement =3D 69=0D RULE_jump_statement =3D 70=0D =0D - ruleNames =3D [ "translation_unit", "external_declaration", "function= _definition",=0D - "declaration_specifiers", "declaration", "init_declarat= or_list",=0D - "init_declarator", "storage_class_specifier", "type_spe= cifier",=0D - "type_id", "struct_or_union_specifier", "struct_or_unio= n",=0D - "struct_declaration_list", "struct_declaration", "speci= fier_qualifier_list",=0D - "struct_declarator_list", "struct_declarator", "enum_sp= ecifier",=0D - "enumerator_list", "enumerator", "type_qualifier", "dec= larator",=0D - "direct_declarator", "declarator_suffix", "pointer",=0D - "parameter_type_list", "parameter_list", "parameter_dec= laration",=0D - "identifier_list", "type_name", "abstract_declarator",= =0D - "direct_abstract_declarator", "abstract_declarator_suff= ix",=0D - "initializer", "initializer_list", "argument_expression= _list",=0D - "additive_expression", "multiplicative_expression", "ca= st_expression",=0D - "unary_expression", "postfix_expression", "macro_parame= ter_list",=0D - "unary_operator", "primary_expression", "constant", "ex= pression",=0D - "constant_expression", "assignment_expression", "lvalue= ",=0D - "assignment_operator", "conditional_expression", "logic= al_or_expression",=0D - "logical_and_expression", "inclusive_or_expression",=0D - "exclusive_or_expression", "and_expression", "equality_= expression",=0D - "relational_expression", "shift_expression", "statement= ",=0D - "asm2_statement", "asm1_statement", "asm_statement",=0D - "macro_statement", "labeled_statement", "compound_state= ment",=0D - "statement_list", "expression_statement", "selection_st= atement",=0D - "iteration_statement", "jump_statement" ]=0D + ruleNames =3D ["translation_unit", "external_declaration", "function_d= efinition",=0D + "declaration_specifiers", "declaration", "init_declarator= _list",=0D + "init_declarator", "storage_class_specifier", "type_speci= fier",=0D + "type_id", "struct_or_union_specifier", "struct_or_union"= ,=0D + "struct_declaration_list", "struct_declaration", "specifi= er_qualifier_list",=0D + "struct_declarator_list", "struct_declarator", "enum_spec= ifier",=0D + "enumerator_list", "enumerator", "type_qualifier", "decla= rator",=0D + "direct_declarator", "declarator_suffix", "pointer",=0D + "parameter_type_list", "parameter_list", "parameter_decla= ration",=0D + "identifier_list", "type_name", "abstract_declarator",=0D + "direct_abstract_declarator", "abstract_declarator_suffix= ",=0D + "initializer", "initializer_list", "argument_expression_l= ist",=0D + "additive_expression", "multiplicative_expression", "cast= _expression",=0D + "unary_expression", "postfix_expression", "macro_paramete= r_list",=0D + "unary_operator", "primary_expression", "constant", "expr= ession",=0D + "constant_expression", "assignment_expression", "lvalue",= =0D + "assignment_operator", "conditional_expression", "logical= _or_expression",=0D + "logical_and_expression", "inclusive_or_expression",=0D + "exclusive_or_expression", "and_expression", "equality_ex= pression",=0D + "relational_expression", "shift_expression", "statement",= =0D + "asm2_statement", "asm1_statement", "asm_statement",=0D + "macro_statement", "labeled_statement", "compound_stateme= nt",=0D + "statement_list", "expression_statement", "selection_stat= ement",=0D + "iteration_statement", "jump_statement"]=0D =0D EOF =3D Token.EOF=0D - T__0=3D1=0D - T__1=3D2=0D - T__2=3D3=0D - T__3=3D4=0D - T__4=3D5=0D - T__5=3D6=0D - T__6=3D7=0D - T__7=3D8=0D - T__8=3D9=0D - T__9=3D10=0D - T__10=3D11=0D - T__11=3D12=0D - T__12=3D13=0D - T__13=3D14=0D - T__14=3D15=0D - T__15=3D16=0D - T__16=3D17=0D - T__17=3D18=0D - T__18=3D19=0D - T__19=3D20=0D - T__20=3D21=0D - T__21=3D22=0D - T__22=3D23=0D - T__23=3D24=0D - T__24=3D25=0D - T__25=3D26=0D - T__26=3D27=0D - T__27=3D28=0D - T__28=3D29=0D - T__29=3D30=0D - T__30=3D31=0D - T__31=3D32=0D - T__32=3D33=0D - T__33=3D34=0D - T__34=3D35=0D - T__35=3D36=0D - T__36=3D37=0D - T__37=3D38=0D - T__38=3D39=0D - T__39=3D40=0D - T__40=3D41=0D - T__41=3D42=0D - T__42=3D43=0D - T__43=3D44=0D - T__44=3D45=0D - T__45=3D46=0D - T__46=3D47=0D - T__47=3D48=0D - T__48=3D49=0D - T__49=3D50=0D - T__50=3D51=0D - T__51=3D52=0D - T__52=3D53=0D - T__53=3D54=0D - T__54=3D55=0D - T__55=3D56=0D - T__56=3D57=0D - T__57=3D58=0D - T__58=3D59=0D - T__59=3D60=0D - T__60=3D61=0D - T__61=3D62=0D - T__62=3D63=0D - T__63=3D64=0D - T__64=3D65=0D - T__65=3D66=0D - T__66=3D67=0D - T__67=3D68=0D - T__68=3D69=0D - T__69=3D70=0D - T__70=3D71=0D - T__71=3D72=0D - T__72=3D73=0D - T__73=3D74=0D - T__74=3D75=0D - T__75=3D76=0D - T__76=3D77=0D - T__77=3D78=0D - T__78=3D79=0D - T__79=3D80=0D - T__80=3D81=0D - T__81=3D82=0D - T__82=3D83=0D - T__83=3D84=0D - T__84=3D85=0D - T__85=3D86=0D - T__86=3D87=0D - T__87=3D88=0D - T__88=3D89=0D - T__89=3D90=0D - T__90=3D91=0D - T__91=3D92=0D - IDENTIFIER=3D93=0D - CHARACTER_LITERAL=3D94=0D - STRING_LITERAL=3D95=0D - HEX_LITERAL=3D96=0D - DECIMAL_LITERAL=3D97=0D - OCTAL_LITERAL=3D98=0D - FLOATING_POINT_LITERAL=3D99=0D - WS=3D100=0D - BS=3D101=0D - UnicodeVocabulary=3D102=0D - COMMENT=3D103=0D - LINE_COMMENT=3D104=0D - LINE_COMMAND=3D105=0D + T__0 =3D 1=0D + T__1 =3D 2=0D + T__2 =3D 3=0D + T__3 =3D 4=0D + T__4 =3D 5=0D + T__5 =3D 6=0D + T__6 =3D 7=0D + T__7 =3D 8=0D + T__8 =3D 9=0D + T__9 =3D 10=0D + T__10 =3D 11=0D + T__11 =3D 12=0D + T__12 =3D 13=0D + T__13 =3D 14=0D + T__14 =3D 15=0D + T__15 =3D 16=0D + T__16 =3D 17=0D + T__17 =3D 18=0D + T__18 =3D 19=0D + T__19 =3D 20=0D + T__20 =3D 21=0D + T__21 =3D 22=0D + T__22 =3D 23=0D + T__23 =3D 24=0D + T__24 =3D 25=0D + T__25 =3D 26=0D + T__26 =3D 27=0D + T__27 =3D 28=0D + T__28 =3D 29=0D + T__29 =3D 30=0D + T__30 =3D 31=0D + T__31 =3D 32=0D + T__32 =3D 33=0D + T__33 =3D 34=0D + T__34 =3D 35=0D + T__35 =3D 36=0D + T__36 =3D 37=0D + T__37 =3D 38=0D + T__38 =3D 39=0D + T__39 =3D 40=0D + T__40 =3D 41=0D + T__41 =3D 42=0D + T__42 =3D 43=0D + T__43 =3D 44=0D + T__44 =3D 45=0D + T__45 =3D 46=0D + T__46 =3D 47=0D + T__47 =3D 48=0D + T__48 =3D 49=0D + T__49 =3D 50=0D + T__50 =3D 51=0D + T__51 =3D 52=0D + T__52 =3D 53=0D + T__53 =3D 54=0D + T__54 =3D 55=0D + T__55 =3D 56=0D + T__56 =3D 57=0D + T__57 =3D 58=0D + T__58 =3D 59=0D + T__59 =3D 60=0D + T__60 =3D 61=0D + T__61 =3D 62=0D + T__62 =3D 63=0D + T__63 =3D 64=0D + T__64 =3D 65=0D + T__65 =3D 66=0D + T__66 =3D 67=0D + T__67 =3D 68=0D + T__68 =3D 69=0D + T__69 =3D 70=0D + T__70 =3D 71=0D + T__71 =3D 72=0D + T__72 =3D 73=0D + T__73 =3D 74=0D + T__74 =3D 75=0D + T__75 =3D 76=0D + T__76 =3D 77=0D + T__77 =3D 78=0D + T__78 =3D 79=0D + T__79 =3D 80=0D + T__80 =3D 81=0D + T__81 =3D 82=0D + T__82 =3D 83=0D + T__83 =3D 84=0D + T__84 =3D 85=0D + T__85 =3D 86=0D + T__86 =3D 87=0D + T__87 =3D 88=0D + T__88 =3D 89=0D + T__89 =3D 90=0D + T__90 =3D 91=0D + T__91 =3D 92=0D + IDENTIFIER =3D 93=0D + CHARACTER_LITERAL =3D 94=0D + STRING_LITERAL =3D 95=0D + HEX_LITERAL =3D 96=0D + DECIMAL_LITERAL =3D 97=0D + OCTAL_LITERAL =3D 98=0D + FLOATING_POINT_LITERAL =3D 99=0D + WS =3D 100=0D + BS =3D 101=0D + UnicodeVocabulary =3D 102=0D + COMMENT =3D 103=0D + LINE_COMMENT =3D 104=0D + LINE_COMMAND =3D 105=0D =0D # @param input Type: TokenStream=0D # @param output=3D sys.stdout Type: TextIO=0D - def __init__(self,input,output=3D sys.stdout):=0D + def __init__(self, input, output=3Dsys.stdout):=0D super().__init__(input, output)=0D self.checkVersion("4.7.1")=0D - self._interp =3D ParserATNSimulator(self, self.atn, self.decisions= ToDFA, self.sharedContextCache)=0D + self._interp =3D ParserATNSimulator(=0D + self, self.atn, self.decisionsToDFA, self.sharedContextCache)= =0D self._predicates =3D None=0D =0D + def printTokenInfo(self, line, offset, tokenText):=0D + print(str(line) + ',' + str(offset) + ':' + str(tokenText))=0D =0D -=0D -=0D - def printTokenInfo(self,line,offset,tokenText):=0D - print(str(line)+ ',' + str(offset) + ':' + str(tokenText))=0D -=0D - def StorePredicateExpression(self,StartLine,StartOffset,EndLine,EndOff= set,Text):=0D - PredExp =3D CodeFragment.PredicateExpression(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StorePredicateExpression(self, StartLine, StartOffset, EndLine, En= dOffset, Text):=0D + PredExp =3D CodeFragment.PredicateExpression(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.PredicateExpressionList.append(PredExp)=0D =0D - def StoreEnumerationDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - EnumDef =3D CodeFragment.EnumerationDefinition(Text, (StartLine, S= tartOffset), (EndLine, EndOffset))=0D + def StoreEnumerationDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + EnumDef =3D CodeFragment.EnumerationDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.EnumerationDefinitionList.append(EnumDef)=0D =0D - def StoreStructUnionDefinition(self,StartLine,StartOffset,EndLine,EndO= ffset,Text):=0D - SUDef =3D CodeFragment.StructUnionDefinition(Text, (StartLine, Sta= rtOffset), (EndLine, EndOffset))=0D + def StoreStructUnionDefinition(self, StartLine, StartOffset, EndLine, = EndOffset, Text):=0D + SUDef =3D CodeFragment.StructUnionDefinition(=0D + Text, (StartLine, StartOffset), (EndLine, EndOffset))=0D FileProfile.StructUnionDefinitionList.append(SUDef)=0D =0D - def StoreTypedefDefinition(self,StartLine,StartOffset,EndLine,EndOffse= t,FromText,ToText):=0D - Tdef =3D CodeFragment.TypedefDefinition(FromText, ToText, (StartLi= ne, StartOffset), (EndLine, EndOffset))=0D + def StoreTypedefDefinition(self, StartLine, StartOffset, EndLine, EndO= ffset, FromText, ToText):=0D + Tdef =3D CodeFragment.TypedefDefinition(=0D + FromText, ToText, (StartLine, StartOffset), (EndLine, EndOffse= t))=0D FileProfile.TypedefDefinitionList.append(Tdef)=0D =0D - def StoreFunctionDefinition(self,StartLine,StartOffset,EndLine,EndOffs= et,ModifierText,DeclText,LeftBraceLine,LeftBraceOffset,DeclLine,DeclOffset)= :=0D - FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (EndLine, EndOffset), (LeftBraceLine, LeftBrace= Offset), (DeclLine, DeclOffset))=0D + def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, End= Offset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, D= eclOffset):=0D + FuncDef =3D CodeFragment.FunctionDefinition(ModifierText, DeclText= , (StartLine, StartOffset), (=0D + EndLine, EndOffset), (LeftBraceLine, LeftBraceOffset), (DeclLi= ne, DeclOffset))=0D FileProfile.FunctionDefinitionList.append(FuncDef)=0D =0D - def StoreVariableDeclaration(self,StartLine,StartOffset,EndLine,EndOff= set,ModifierText,DeclText):=0D - VarDecl =3D CodeFragment.VariableDeclaration(ModifierText, DeclTex= t, (StartLine, StartOffset), (EndLine, EndOffset))=0D + def StoreVariableDeclaration(self, StartLine, StartOffset, EndLine, En= dOffset, ModifierText, DeclText):=0D + VarDecl =3D CodeFragment.VariableDeclaration(=0D + ModifierText, DeclText, (StartLine, StartOffset), (EndLine, En= dOffset))=0D FileProfile.VariableDeclarationList.append(VarDecl)=0D =0D - def StoreFunctionCalling(self,StartLine,StartOffset,EndLine,EndOffset,= FuncName,ParamList):=0D - FuncCall =3D CodeFragment.FunctionCalling(FuncName, ParamList, (St= artLine, StartOffset), (EndLine, EndOffset))=0D + def StoreFunctionCalling(self, StartLine, StartOffset, EndLine, EndOff= set, FuncName, ParamList):=0D + FuncCall =3D CodeFragment.FunctionCalling(=0D + FuncName, ParamList, (StartLine, StartOffset), (EndLine, EndOf= fset))=0D FileProfile.FunctionCallingList.append(FuncCall)=0D =0D -=0D -=0D class Translation_unitContext(ParserRuleContext):=0D =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def external_declaration(self,i=3DNone):=0D + def external_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.External_declarat= ionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.External_declarati= onContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.External_declarati= onContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_translation_unit=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterTranslation_unit" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterTranslation_unit"):=0D listener.enterTranslation_unit(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitTranslation_unit" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitTranslation_unit"):=0D listener.exitTranslation_unit(self)=0D =0D -=0D -=0D -=0D def translation_unit(self):=0D =0D localctx =3D CParser.Translation_unitContext(self, self._ctx, self= .state)=0D self.enterRule(localctx, 0, self.RULE_translation_unit)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 145=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T__7) = | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1 << = CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CParse= r.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.T__1= 7) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21) | (= 1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 << C= Parser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CParser= .T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T__32= ) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) | (1= << CParser.T__36) | (1 << CParser.T__37) | (1 << CParser.T__41))) !=3D 0) = or _la=3D=3DCParser.IDENTIFIER:=0D + while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T__7) = | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1 << = CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CParse= r.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.T__1= 7) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21) | (= 1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 << C= Parser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CParser= .T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T__32= ) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) | (1= << CParser.T__36) | (1 << CParser.T__37) | (1 << CParser.T__41))) !=3D 0) = or _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 142=0D self.external_declaration()=0D self.state =3D 147=0D @@ -840,75 +840,67 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def function_definition(self):=0D - return self.getTypedRuleContext(CParser.Function_definitionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Function_definitionCon= text, 0)=0D =0D def macro_statement(self):=0D - return self.getTypedRuleContext(CParser.Macro_statementContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_statementContext= , 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_external_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExternal_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExternal_declaration"):=0D listener.enterExternal_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExternal_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExternal_declaration"):=0D listener.exitExternal_declaration(self)=0D =0D -=0D -=0D -=0D def external_declaration(self):=0D =0D - localctx =3D CParser.External_declarationContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.External_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 2, self.RULE_external_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 166=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,4,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 4, self._ctx= )=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 149=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,1,self._c= tx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 1, self.= _ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 148=0D self.declaration_specifiers()=0D =0D -=0D self.state =3D 151=0D self.declarator()=0D self.state =3D 155=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << C= Parser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T_= _7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1= << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CP= arser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.= T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21)= | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 = << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CPa= rser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T= __32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) = | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.IDENTIFIER:=0D + while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << C= Parser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CParser.T_= _7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10) | (1= << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1 << CP= arser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CParser.= T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.T__21)= | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25) | (1 = << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 << CPa= rser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CParser.T= __32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T__35) = | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 152=0D self.declaration()=0D self.state =3D 157=0D @@ -938,14 +930,12 @@ class CParser ( Parser ): self.state =3D 164=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__1:=0D + if _la =3D=3D CParser.T__1:=0D self.state =3D 163=0D self.match(CParser.T__1)=0D =0D -=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -958,7 +948,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D self.ModifierText =3D ''=0D @@ -967,71 +957,64 @@ class CParser ( Parser ): self.LBOffset =3D 0=0D self.DeclLine =3D 0=0D self.DeclOffset =3D 0=0D - self.d =3D None # Declaration_specifiersContext=0D - self._declaration_specifiers =3D None # Declaration_specifiers= Context=0D - self._declarator =3D None # DeclaratorContext=0D - self.a =3D None # Compound_statementContext=0D - self.b =3D None # Compound_statementContext=0D + self.d =3D None # Declaration_specifiersContext=0D + self._declaration_specifiers =3D None # Declaration_specifier= sContext=0D + self._declarator =3D None # DeclaratorContext=0D + self.a =3D None # Compound_statementContext=0D + self.b =3D None # Compound_statementContext=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def compound_statement(self):=0D - return self.getTypedRuleContext(CParser.Compound_statementCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Compound_statementCont= ext, 0)=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_function_definition=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterFunction_definition" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterFunction_definition"):=0D listener.enterFunction_definition(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitFunction_definition" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitFunction_definition"):=0D listener.exitFunction_definition(self)=0D =0D -=0D -=0D -=0D def function_definition(self):=0D =0D - localctx =3D CParser.Function_definitionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Function_definitionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 4, self.RULE_function_definition)=0D =0D - ModifierText =3D '';=0D - DeclText =3D '';=0D - LBLine =3D 0;=0D - LBOffset =3D 0;=0D - DeclLine =3D 0;=0D - DeclOffset =3D 0;=0D + ModifierText =3D ''=0D + DeclText =3D ''=0D + LBLine =3D 0=0D + LBOffset =3D 0=0D + DeclLine =3D 0=0D + DeclOffset =3D 0=0D =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 169=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,5,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 5, self._ctx= )=0D if la_ =3D=3D 1:=0D self.state =3D 168=0D localctx.d =3D localctx._declaration_specifiers =3D self.d= eclaration_specifiers()=0D =0D -=0D self.state =3D 171=0D localctx._declarator =3D self.declarator()=0D self.state =3D 180=0D @@ -1047,7 +1030,7 @@ class CParser ( Parser ): self.state =3D 175=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((= 1 << CParser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CPar= ser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10= ) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1= << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CP= arser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.= T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25)= | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 = << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CPa= rser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T= __35) | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.IDENTIFIER):=0D + if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((= 1 << CParser.T__2) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << CPar= ser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T__10= ) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) | (1= << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 << CP= arser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CParser.= T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << CParser.T__25)= | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParser.T__28) | (1 = << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__31) | (1 << CPa= rser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (1 << CParser.T= __35) | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.IDENTIFIER):=0D break=0D =0D self.state =3D 177=0D @@ -1060,24 +1043,30 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D if localctx.d !=3D None:=0D - ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText((localctx._declaration_specifiers.start,l= ocalctx._declaration_specifiers.stop)))=0D + ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText(=0D + (localctx._declaration_specifiers.start, localctx._dec= laration_specifiers.stop)))=0D else:=0D ModifierText =3D ''=0D - DeclText =3D (None if localctx._declarator is None else self._= input.getText((localctx._declarator.start,localctx._declarator.stop)))=0D - DeclLine =3D (None if localctx._declarator is None else localc= tx._declarator.start).line=0D - DeclOffset =3D (None if localctx._declarator is None else loca= lctx._declarator.start).column=0D + DeclText =3D (None if localctx._declarator is None else self._= input.getText(=0D + (localctx._declarator.start, localctx._declarator.stop)))= =0D + DeclLine =3D (=0D + None if localctx._declarator is None else localctx._declar= ator.start).line=0D + DeclOffset =3D (=0D + None if localctx._declarator is None else localctx._declar= ator.start).column=0D if localctx.a !=3D None:=0D LBLine =3D (None if localctx.a is None else localctx.a.sta= rt).line=0D - LBOffset =3D (None if localctx.a is None else localctx.a.s= tart).column=0D + LBOffset =3D (=0D + None if localctx.a is None else localctx.a.start).colu= mn=0D else:=0D LBLine =3D (None if localctx.b is None else localctx.b.sta= rt).line=0D - LBOffset =3D (None if localctx.b is None else localctx.b.s= tart).column=0D + LBOffset =3D (=0D + None if localctx.b is None else localctx.b.start).colu= mn=0D =0D self._ctx.stop =3D self._input.LT(-1)=0D =0D - self.StoreFunctionDefinition(localctx.start.line, localctx.sta= rt.column, localctx.stop.line, localctx.stop.column, ModifierText, DeclText= , LBLine, LBOffset, DeclLine, DeclOffset)=0D + self.StoreFunctionDefinition(localctx.start.line, localctx.sta= rt.column, localctx.stop.line,=0D + localctx.stop.column, ModifierTex= t, DeclText, LBLine, LBOffset, DeclLine, DeclOffset)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1091,60 +1080,55 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def storage_class_specifier(self,i=3DNone):=0D + def storage_class_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Storage_class_spe= cifierContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Storage_class_spec= ifierContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Storage_class_spec= ifierContext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_specifier(self,i=3DNone):=0D + def type_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_specifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_specifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_specifierCont= ext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declaration_specifiers=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclaration_specifiers" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclaration_specifiers"):=0D listener.enterDeclaration_specifiers(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclaration_specifiers" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclaration_specifiers"):=0D listener.exitDeclaration_specifiers(self)=0D =0D -=0D -=0D -=0D def declaration_specifiers(self):=0D =0D - localctx =3D CParser.Declaration_specifiersContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Declaration_specifiersContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 6, self.RULE_declaration_specifiers)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 187=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 187=0D self._errHandler.sync(self)=0D @@ -1164,12 +1148,11 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D else:=0D raise NoViableAltException(self)=0D self.state =3D 189=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,9,self._= ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 9, self= ._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1183,46 +1166,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.a =3D None # Token=0D - self.b =3D None # Declaration_specifiersContext=0D - self.c =3D None # Init_declarator_listContext=0D - self.d =3D None # Token=0D - self.s =3D None # Declaration_specifiersContext=0D - self.t =3D None # Init_declarator_listContext=0D - self.e =3D None # Token=0D + self.a =3D None # Token=0D + self.b =3D None # Declaration_specifiersContext=0D + self.c =3D None # Init_declarator_listContext=0D + self.d =3D None # Token=0D + self.s =3D None # Declaration_specifiersContext=0D + self.t =3D None # Init_declarator_listContext=0D + self.e =3D None # Token=0D =0D def init_declarator_list(self):=0D - return self.getTypedRuleContext(CParser.Init_declarator_listCo= ntext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Init_declarator_listCo= ntext, 0)=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclaration"):=0D listener.enterDeclaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclaration"):=0D listener.exitDeclaration(self)=0D =0D -=0D -=0D -=0D def declaration(self):=0D =0D localctx =3D CParser.DeclarationContext(self, self._ctx, self.stat= e)=0D self.enterRule(localctx, 8, self.RULE_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 206=0D self._errHandler.sync(self)=0D @@ -1233,21 +1211,22 @@ class CParser ( Parser ): localctx.a =3D self.match(CParser.T__2)=0D self.state =3D 193=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,10,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 10, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 192=0D localctx.b =3D self.declaration_specifiers()=0D =0D -=0D self.state =3D 195=0D localctx.c =3D self.init_declarator_list()=0D self.state =3D 196=0D localctx.d =3D self.match(CParser.T__1)=0D =0D if localctx.b is not None:=0D - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText((localctx.b.start,lo= calctx.b.stop))), (None if localctx.c is None else self._input.getText((loc= alctx.c.start,localctx.c.stop))))=0D + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText(=0D + (localctx.b.start, localctx.b.stop))), (None if lo= calctx.c is None else self._input.getText((localctx.c.start, localctx.c.sto= p))))=0D else:=0D - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , '', (None if localctx.c is None else self._input.getText((localctx.c.star= t,localctx.c.stop))))=0D + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line),=0D + localctx.d.column, '', (No= ne if localctx.c is None else self._input.getText((localctx.c.start, localc= tx.c.stop))))=0D =0D pass=0D elif token in [CParser.T__5, CParser.T__6, CParser.T__7, CPars= er.T__8, CParser.T__9, CParser.T__10, CParser.T__11, CParser.T__12, CParser= .T__13, CParser.T__14, CParser.T__15, CParser.T__16, CParser.T__17, CParser= .T__18, CParser.T__20, CParser.T__21, CParser.T__23, CParser.T__24, CParser= .T__25, CParser.T__26, CParser.T__27, CParser.T__28, CParser.T__29, CParser= .T__30, CParser.T__31, CParser.T__32, CParser.T__33, CParser.T__34, CParser= .T__35, CParser.T__36, CParser.IDENTIFIER]:=0D @@ -1261,12 +1240,12 @@ class CParser ( Parser ): self.state =3D 200=0D localctx.t =3D self.init_declarator_list()=0D =0D -=0D self.state =3D 203=0D localctx.e =3D self.match(CParser.T__1)=0D =0D if localctx.t is not None:=0D - self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= None if localctx.t is None else localctx.t.start).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop))), (= None if localctx.t is None else self._input.getText((localctx.t.start,local= ctx.t.stop))))=0D + self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= =0D + None if localctx.t is None else localctx.t.start).= column, (None if localctx.s is None else self._input.getText((localctx.s.st= art, localctx.s.stop))), (None if localctx.t is None else self._input.getTe= xt((localctx.t.start, localctx.t.stop))))=0D =0D pass=0D else:=0D @@ -1284,39 +1263,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def init_declarator(self,i=3DNone):=0D + def init_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Init_declaratorCo= ntext)=0D else:=0D - return self.getTypedRuleContext(CParser.Init_declaratorCon= text,i)=0D -=0D + return self.getTypedRuleContext(CParser.Init_declaratorCon= text, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_init_declarator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInit_declarator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInit_declarator_list"):=0D listener.enterInit_declarator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInit_declarator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInit_declarator_list"):=0D listener.exitInit_declarator_list(self)=0D =0D -=0D -=0D -=0D def init_declarator_list(self):=0D =0D - localctx =3D CParser.Init_declarator_listContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Init_declarator_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 10, self.RULE_init_declarator_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 208=0D @@ -1324,7 +1300,7 @@ class CParser ( Parser ): self.state =3D 213=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 209=0D self.match(CParser.T__3)=0D self.state =3D 210=0D @@ -1345,39 +1321,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def initializer(self):=0D - return self.getTypedRuleContext(CParser.InitializerContext,0)= =0D -=0D + return self.getTypedRuleContext(CParser.InitializerContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_init_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInit_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInit_declarator"):=0D listener.enterInit_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInit_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInit_declarator"):=0D listener.exitInit_declarator(self)=0D =0D -=0D -=0D -=0D def init_declarator(self):=0D =0D localctx =3D CParser.Init_declaratorContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 12, self.RULE_init_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 216=0D @@ -1385,13 +1356,12 @@ class CParser ( Parser ): self.state =3D 219=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__4:=0D + if _la =3D=3D CParser.T__4:=0D self.state =3D 217=0D self.match(CParser.T__4)=0D self.state =3D 218=0D self.initializer()=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1404,32 +1374,29 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_storage_class_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStorage_class_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStorage_class_specifier"):=0D listener.enterStorage_class_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStorage_class_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStorage_class_specifier"):=0D listener.exitStorage_class_specifier(self)=0D =0D -=0D -=0D -=0D def storage_class_specifier(self):=0D =0D - localctx =3D CParser.Storage_class_specifierContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Storage_class_specifierContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 14, self.RULE_storage_class_specifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 221=0D @@ -1451,55 +1418,47 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.s =3D None # Struct_or_union_specifierContext=0D - self.e =3D None # Enum_specifierContext=0D + self.s =3D None # Struct_or_union_specifierContext=0D + self.e =3D None # Enum_specifierContext=0D =0D def struct_or_union_specifier(self):=0D - return self.getTypedRuleContext(CParser.Struct_or_union_specif= ierContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_or_union_specif= ierContext, 0)=0D =0D def enum_specifier(self):=0D - return self.getTypedRuleContext(CParser.Enum_specifierContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Enum_specifierContext,= 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def type_id(self):=0D - return self.getTypedRuleContext(CParser.Type_idContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_idContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_type_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_specifier"):=0D listener.enterType_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_specifier"):=0D listener.exitType_specifier(self)=0D =0D -=0D -=0D -=0D def type_specifier(self):=0D =0D localctx =3D CParser.Type_specifierContext(self, self._ctx, self.s= tate)=0D @@ -1507,7 +1466,7 @@ class CParser ( Parser ): try:=0D self.state =3D 247=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,16,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 16, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 223=0D @@ -1568,7 +1527,8 @@ class CParser ( Parser ): localctx.s =3D self.struct_or_union_specifier()=0D =0D if localctx.s.stop is not None:=0D - self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (None if localctx.s is None else localctx.s.stop).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop))))=0D + self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (=0D + None if localctx.s is None else localctx.s.stop).c= olumn, (None if localctx.s is None else self._input.getText((localctx.s.sta= rt, localctx.s.stop))))=0D =0D pass=0D =0D @@ -1578,7 +1538,8 @@ class CParser ( Parser ): localctx.e =3D self.enum_specifier()=0D =0D if localctx.e.stop is not None:=0D - self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (None if localctx.e is None else localctx.e.stop).column, (None if localctx= .e is None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (=0D + None if localctx.e is None else localctx.e.stop).c= olumn, (None if localctx.e is None else self._input.getText((localctx.e.sta= rt, localctx.e.stop))))=0D =0D pass=0D =0D @@ -1588,14 +1549,15 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D self.state =3D 242=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,15,self.= _ctx)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 15, sel= f._ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 239=0D self.type_qualifier()=0D self.state =3D 244=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,15,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 15, self._ctx)=0D =0D self.state =3D 245=0D self.declarator()=0D @@ -1607,7 +1569,6 @@ class CParser ( Parser ): self.type_id()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1620,7 +1581,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -1631,18 +1592,15 @@ class CParser ( Parser ): return CParser.RULE_type_id=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_id" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_id"):=0D listener.enterType_id(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_id" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_id"):=0D listener.exitType_id(self)=0D =0D -=0D -=0D -=0D def type_id(self):=0D =0D localctx =3D CParser.Type_idContext(self, self._ctx, self.state)=0D @@ -1663,17 +1621,15 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def struct_or_union(self):=0D - return self.getTypedRuleContext(CParser.Struct_or_unionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_or_unionContext= , 0)=0D =0D def struct_declaration_list(self):=0D - return self.getTypedRuleContext(CParser.Struct_declaration_lis= tContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaration_lis= tContext, 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D @@ -1682,27 +1638,25 @@ class CParser ( Parser ): return CParser.RULE_struct_or_union_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_or_union_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_or_union_specifier"):=0D listener.enterStruct_or_union_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_or_union_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_or_union_specifier"):=0D listener.exitStruct_or_union_specifier(self)=0D =0D -=0D -=0D -=0D def struct_or_union_specifier(self):=0D =0D - localctx =3D CParser.Struct_or_union_specifierContext(self, self._= ctx, self.state)=0D + localctx =3D CParser.Struct_or_union_specifierContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 20, self.RULE_struct_or_union_specifier)= =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 262=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,18,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 18, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 251=0D @@ -1710,11 +1664,10 @@ class CParser ( Parser ): self.state =3D 253=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.IDENTIFIER:=0D + if _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 252=0D self.match(CParser.IDENTIFIER)=0D =0D -=0D self.state =3D 255=0D self.match(CParser.T__0)=0D self.state =3D 256=0D @@ -1731,7 +1684,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -1744,37 +1696,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_struct_or_union=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_or_union" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_or_union"):=0D listener.enterStruct_or_union(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_or_union" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_or_union"):=0D listener.exitStruct_or_union(self)=0D =0D -=0D -=0D -=0D def struct_or_union(self):=0D =0D localctx =3D CParser.Struct_or_unionContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 22, self.RULE_struct_or_union)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 264=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__20 or _la=3D=3DCParser.T__21):=0D + if not(_la =3D=3D CParser.T__20 or _la =3D=3D CParser.T__21):= =0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -1791,39 +1739,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def struct_declaration(self,i=3DNone):=0D + def struct_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Struct_declaratio= nContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Struct_declaration= Context,i)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaration= Context, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declaration_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declaration_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declaration_list"):=0D listener.enterStruct_declaration_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declaration_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declaration_list"):=0D listener.exitStruct_declaration_list(self)=0D =0D -=0D -=0D -=0D def struct_declaration_list(self):=0D =0D - localctx =3D CParser.Struct_declaration_listContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Struct_declaration_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 24, self.RULE_struct_declaration_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 267=0D @@ -1835,7 +1780,7 @@ class CParser ( Parser ): self.state =3D 269=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 <<= CParser.T__10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CPars= er.T__13) | (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__= 16) | (1 << CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | = (1 << CParser.T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << = CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParse= r.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__3= 1) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (= 1 << CParser.T__35) | (1 << CParser.T__36))) !=3D 0) or _la=3D=3DCParser.ID= ENTIFIER):=0D + if not ((((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 <<= CParser.T__10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CPars= er.T__13) | (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__= 16) | (1 << CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | = (1 << CParser.T__21) | (1 << CParser.T__23) | (1 << CParser.T__24) | (1 << = CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | (1 << CParse= r.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << CParser.T__3= 1) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParser.T__34) | (= 1 << CParser.T__35) | (1 << CParser.T__36))) !=3D 0) or _la =3D=3D CParser.= IDENTIFIER):=0D break=0D =0D except RecognitionException as re:=0D @@ -1850,37 +1795,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def specifier_qualifier_list(self):=0D - return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext, 0)=0D =0D def struct_declarator_list(self):=0D - return self.getTypedRuleContext(CParser.Struct_declarator_list= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declarator_list= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declaration"):=0D listener.enterStruct_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declaration"):=0D listener.exitStruct_declaration(self)=0D =0D -=0D -=0D -=0D def struct_declaration(self):=0D =0D - localctx =3D CParser.Struct_declarationContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Struct_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 26, self.RULE_struct_declaration)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D @@ -1902,52 +1843,48 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D # @param i=3DNone Type: int=0D - def type_specifier(self,i=3DNone):=0D + def type_specifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_specifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_specifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_specifierCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_specifier_qualifier_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterSpecifier_qualifier_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterSpecifier_qualifier_list"):=0D listener.enterSpecifier_qualifier_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitSpecifier_qualifier_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitSpecifier_qualifier_list"):=0D listener.exitSpecifier_qualifier_list(self)=0D =0D -=0D -=0D -=0D def specifier_qualifier_list(self):=0D =0D - localctx =3D CParser.Specifier_qualifier_listContext(self, self._c= tx, self.state)=0D + localctx =3D CParser.Specifier_qualifier_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 28, self.RULE_specifier_qualifier_list)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 277=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 277=0D self._errHandler.sync(self)=0D @@ -1963,12 +1900,11 @@ class CParser ( Parser ): else:=0D raise NoViableAltException(self)=0D =0D -=0D else:=0D raise NoViableAltException(self)=0D self.state =3D 279=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,21,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 21, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -1982,39 +1918,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def struct_declarator(self,i=3DNone):=0D + def struct_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Struct_declarator= Context)=0D else:=0D - return self.getTypedRuleContext(CParser.Struct_declaratorC= ontext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Struct_declaratorC= ontext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declarator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declarator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declarator_list"):=0D listener.enterStruct_declarator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declarator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declarator_list"):=0D listener.exitStruct_declarator_list(self)=0D =0D -=0D -=0D -=0D def struct_declarator_list(self):=0D =0D - localctx =3D CParser.Struct_declarator_listContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Struct_declarator_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 30, self.RULE_struct_declarator_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 281=0D @@ -2022,7 +1955,7 @@ class CParser ( Parser ): self.state =3D 286=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 282=0D self.match(CParser.T__3)=0D self.state =3D 283=0D @@ -2043,39 +1976,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_struct_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStruct_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStruct_declarator"):=0D listener.enterStruct_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStruct_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStruct_declarator"):=0D listener.exitStruct_declarator(self)=0D =0D -=0D -=0D -=0D def struct_declarator(self):=0D =0D - localctx =3D CParser.Struct_declaratorContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Struct_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 32, self.RULE_struct_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 296=0D self._errHandler.sync(self)=0D @@ -2087,13 +2016,12 @@ class CParser ( Parser ): self.state =3D 292=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__22:=0D + if _la =3D=3D CParser.T__22:=0D self.state =3D 290=0D self.match(CParser.T__22)=0D self.state =3D 291=0D self.constant_expression()=0D =0D -=0D pass=0D elif token in [CParser.T__22]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -2117,13 +2045,12 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def enumerator_list(self):=0D - return self.getTypedRuleContext(CParser.Enumerator_listContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Enumerator_listContext= , 0)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D @@ -2132,27 +2059,24 @@ class CParser ( Parser ): return CParser.RULE_enum_specifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnum_specifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnum_specifier"):=0D listener.enterEnum_specifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnum_specifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnum_specifier"):=0D listener.exitEnum_specifier(self)=0D =0D -=0D -=0D -=0D def enum_specifier(self):=0D =0D localctx =3D CParser.Enum_specifierContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 34, self.RULE_enum_specifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 317=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,27,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 27, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 298=0D @@ -2164,11 +2088,10 @@ class CParser ( Parser ): self.state =3D 302=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 301=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 304=0D self.match(CParser.T__19)=0D pass=0D @@ -2186,11 +2109,10 @@ class CParser ( Parser ): self.state =3D 311=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 310=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 313=0D self.match(CParser.T__19)=0D pass=0D @@ -2203,7 +2125,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2216,34 +2137,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def enumerator(self,i=3DNone):=0D + def enumerator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.EnumeratorContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.EnumeratorContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.EnumeratorContext,= i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_enumerator_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnumerator_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnumerator_list"):=0D listener.enterEnumerator_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnumerator_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnumerator_list"):=0D listener.exitEnumerator_list(self)=0D =0D -=0D -=0D -=0D def enumerator_list(self):=0D =0D localctx =3D CParser.Enumerator_listContext(self, self._ctx, self.= state)=0D @@ -2254,16 +2171,16 @@ class CParser ( Parser ): self.enumerator()=0D self.state =3D 324=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,28,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 28, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 320=0D self.match(CParser.T__3)=0D self.state =3D 321=0D self.enumerator()=0D self.state =3D 326=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,28,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 28, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -2277,7 +2194,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -2285,30 +2202,26 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_enumerator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEnumerator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEnumerator"):=0D listener.enterEnumerator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEnumerator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEnumerator"):=0D listener.exitEnumerator(self)=0D =0D -=0D -=0D -=0D def enumerator(self):=0D =0D localctx =3D CParser.EnumeratorContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 38, self.RULE_enumerator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 327=0D @@ -2316,13 +2229,12 @@ class CParser ( Parser ): self.state =3D 330=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__4:=0D + if _la =3D=3D CParser.T__4:=0D self.state =3D 328=0D self.match(CParser.T__4)=0D self.state =3D 329=0D self.constant_expression()=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2335,32 +2247,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_type_qualifier=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_qualifier" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_qualifier"):=0D listener.enterType_qualifier(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_qualifier" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_qualifier"):=0D listener.exitType_qualifier(self)=0D =0D -=0D -=0D -=0D def type_qualifier(self):=0D =0D localctx =3D CParser.Type_qualifierContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 40, self.RULE_type_qualifier)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 332=0D @@ -2382,77 +2290,68 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def direct_declarator(self):=0D - return self.getTypedRuleContext(CParser.Direct_declaratorConte= xt,0)=0D -=0D + return self.getTypedRuleContext(CParser.Direct_declaratorConte= xt, 0)=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclarator"):=0D listener.enterDeclarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclarator"):=0D listener.exitDeclarator(self)=0D =0D -=0D -=0D -=0D def declarator(self):=0D =0D localctx =3D CParser.DeclaratorContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 42, self.RULE_declarator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 348=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,34,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 34, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 335=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__41:=0D + if _la =3D=3D CParser.T__41:=0D self.state =3D 334=0D self.pointer()=0D =0D -=0D self.state =3D 338=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__33:=0D + if _la =3D=3D CParser.T__33:=0D self.state =3D 337=0D self.match(CParser.T__33)=0D =0D -=0D self.state =3D 341=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__34:=0D + if _la =3D=3D CParser.T__34:=0D self.state =3D 340=0D self.match(CParser.T__34)=0D =0D -=0D self.state =3D 344=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__35:=0D + if _la =3D=3D CParser.T__35:=0D self.state =3D 343=0D self.match(CParser.T__35)=0D =0D -=0D self.state =3D 346=0D self.direct_declarator()=0D pass=0D @@ -2463,7 +2362,6 @@ class CParser ( Parser ): self.pointer()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2476,7 +2374,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -2484,36 +2382,32 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def declarator_suffix(self,i=3DNone):=0D + def declarator_suffix(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Declarator_suffix= Context)=0D else:=0D - return self.getTypedRuleContext(CParser.Declarator_suffixC= ontext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Declarator_suffixC= ontext, i)=0D =0D def declarator(self):=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_direct_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDirect_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDirect_declarator"):=0D listener.enterDirect_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDirect_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDirect_declarator"):=0D listener.exitDirect_declarator(self)=0D =0D -=0D -=0D -=0D def direct_declarator(self):=0D =0D - localctx =3D CParser.Direct_declaratorContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Direct_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 44, self.RULE_direct_declarator)=0D try:=0D self.state =3D 368=0D @@ -2525,14 +2419,15 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D self.state =3D 354=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,35,self.= _ctx)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 35, sel= f._ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 351=0D self.declarator_suffix()=0D self.state =3D 356=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,35,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 35, self._ctx)=0D =0D pass=0D elif token in [CParser.T__37]:=0D @@ -2541,12 +2436,11 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 359=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,36,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 36, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 358=0D self.match(CParser.T__33)=0D =0D -=0D self.state =3D 361=0D self.declarator()=0D self.state =3D 362=0D @@ -2554,7 +2448,7 @@ class CParser ( Parser ): self.state =3D 364=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 363=0D self.declarator_suffix()=0D @@ -2563,7 +2457,8 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 366=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,37,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 37, self._ctx)=0D =0D pass=0D else:=0D @@ -2581,46 +2476,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def parameter_type_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_type_listCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_type_listCon= text, 0)=0D =0D def identifier_list(self):=0D - return self.getTypedRuleContext(CParser.Identifier_listContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Identifier_listContext= , 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_declarator_suffix=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDeclarator_suffix" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDeclarator_suffix"):=0D listener.enterDeclarator_suffix(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDeclarator_suffix" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDeclarator_suffix"):=0D listener.exitDeclarator_suffix(self)=0D =0D -=0D -=0D -=0D def declarator_suffix(self):=0D =0D - localctx =3D CParser.Declarator_suffixContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Declarator_suffixContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 46, self.RULE_declarator_suffix)=0D try:=0D self.state =3D 386=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,39,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 39, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 370=0D @@ -2667,7 +2557,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2680,38 +2569,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def type_qualifier(self,i=3DNone):=0D + def type_qualifier(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Type_qualifierCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.Type_qualifierCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Type_qualifierCont= ext, i)=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_pointer=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPointer" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPointer"):=0D listener.enterPointer(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPointer" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPointer"):=0D listener.exitPointer(self)=0D =0D -=0D -=0D -=0D def pointer(self):=0D =0D localctx =3D CParser.PointerContext(self, self._ctx, self.state)=0D @@ -2719,7 +2603,7 @@ class CParser ( Parser ): try:=0D self.state =3D 400=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,42,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 42, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 388=0D @@ -2727,7 +2611,7 @@ class CParser ( Parser ): self.state =3D 390=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 389=0D self.type_qualifier()=0D @@ -2736,16 +2620,16 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 392=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,40,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 40, self._ctx)=0D =0D self.state =3D 395=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,41,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 41, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 394=0D self.pointer()=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -2762,7 +2646,6 @@ class CParser ( Parser ): self.match(CParser.T__41)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2775,35 +2658,32 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def parameter_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_listContext,= 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_type_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_type_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_type_list"):=0D listener.enterParameter_type_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_type_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_type_list"):=0D listener.exitParameter_type_list(self)=0D =0D -=0D -=0D -=0D def parameter_type_list(self):=0D =0D - localctx =3D CParser.Parameter_type_listContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Parameter_type_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 50, self.RULE_parameter_type_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 402=0D @@ -2811,21 +2691,19 @@ class CParser ( Parser ): self.state =3D 408=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 403=0D self.match(CParser.T__3)=0D self.state =3D 405=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 404=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 407=0D self.match(CParser.T__42)=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -2838,34 +2716,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def parameter_declaration(self,i=3DNone):=0D + def parameter_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Parameter_declara= tionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_list"):=0D listener.enterParameter_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_list"):=0D listener.exitParameter_list(self)=0D =0D -=0D -=0D -=0D def parameter_list(self):=0D =0D localctx =3D CParser.Parameter_listContext(self, self._ctx, self.s= tate)=0D @@ -2876,24 +2750,24 @@ class CParser ( Parser ): self.parameter_declaration()=0D self.state =3D 418=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,46,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 46, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 411=0D self.match(CParser.T__3)=0D self.state =3D 413=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,45,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 45, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 412=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 415=0D self.parameter_declaration()=0D self.state =3D 420=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,46,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 46, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -2907,66 +2781,60 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def declaration_specifiers(self):=0D - return self.getTypedRuleContext(CParser.Declaration_specifiers= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Declaration_specifiers= Context, 0)=0D =0D # @param i=3DNone Type: int=0D - def declarator(self,i=3DNone):=0D + def declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclaratorContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.DeclaratorContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclaratorContext,= i)=0D =0D # @param i=3DNone Type: int=0D - def abstract_declarator(self,i=3DNone):=0D + def abstract_declarator(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Abstract_declarat= orContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Abstract_declarato= rContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declarato= rContext, i)=0D =0D def IDENTIFIER(self):=0D return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def pointer(self,i=3DNone):=0D + def pointer(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.PointerContext)=0D else:=0D - return self.getTypedRuleContext(CParser.PointerContext,i)= =0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, i)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_parameter_declaration=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterParameter_declaration" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterParameter_declaration"):=0D listener.enterParameter_declaration(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitParameter_declaration" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitParameter_declaration"):=0D listener.exitParameter_declaration(self)=0D =0D -=0D -=0D -=0D def parameter_declaration(self):=0D =0D - localctx =3D CParser.Parameter_declarationContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Parameter_declarationContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 54, self.RULE_parameter_declaration)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 439=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,51,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 51, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 421=0D @@ -2977,7 +2845,8 @@ class CParser ( Parser ): while ((((_la - 34)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 3= 4)) & ((1 << (CParser.T__33 - 34)) | (1 << (CParser.T__34 - 34)) | (1 << (C= Parser.T__35 - 34)) | (1 << (CParser.T__37 - 34)) | (1 << (CParser.T__39 - = 34)) | (1 << (CParser.T__41 - 34)) | (1 << (CParser.IDENTIFIER - 34)))) != =3D 0):=0D self.state =3D 424=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,47,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 47, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 422=0D self.declarator()=0D @@ -2988,7 +2857,6 @@ class CParser ( Parser ): self.abstract_declarator()=0D pass=0D =0D -=0D self.state =3D 428=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -2996,11 +2864,10 @@ class CParser ( Parser ): self.state =3D 430=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 429=0D self.match(CParser.T__28)=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -3008,7 +2875,7 @@ class CParser ( Parser ): self.state =3D 435=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__41:=0D + while _la =3D=3D CParser.T__41:=0D self.state =3D 432=0D self.pointer()=0D self.state =3D 437=0D @@ -3019,7 +2886,6 @@ class CParser ( Parser ): self.match(CParser.IDENTIFIER)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3032,12 +2898,12 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D @@ -3047,23 +2913,20 @@ class CParser ( Parser ): return CParser.RULE_identifier_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterIdentifier_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterIdentifier_list"):=0D listener.enterIdentifier_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitIdentifier_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitIdentifier_list"):=0D listener.exitIdentifier_list(self)=0D =0D -=0D -=0D -=0D def identifier_list(self):=0D =0D localctx =3D CParser.Identifier_listContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 56, self.RULE_identifier_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 441=0D @@ -3071,7 +2934,7 @@ class CParser ( Parser ): self.state =3D 446=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 442=0D self.match(CParser.T__3)=0D self.state =3D 443=0D @@ -3092,47 +2955,41 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def specifier_qualifier_list(self):=0D - return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Specifier_qualifier_li= stContext, 0)=0D =0D def abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text, 0)=0D =0D def type_id(self):=0D - return self.getTypedRuleContext(CParser.Type_idContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_idContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_type_name=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterType_name" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterType_name"):=0D listener.enterType_name(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitType_name" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitType_name"):=0D listener.exitType_name(self)=0D =0D -=0D -=0D -=0D def type_name(self):=0D =0D localctx =3D CParser.Type_nameContext(self, self._ctx, self.state)= =0D self.enterRule(localctx, 58, self.RULE_type_name)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 454=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,54,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 54, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 449=0D @@ -3144,7 +3001,6 @@ class CParser ( Parser ): self.state =3D 450=0D self.abstract_declarator()=0D =0D -=0D pass=0D =0D elif la_ =3D=3D 2:=0D @@ -3153,7 +3009,6 @@ class CParser ( Parser ): self.type_id()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3166,37 +3021,33 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def pointer(self):=0D - return self.getTypedRuleContext(CParser.PointerContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.PointerContext, 0)=0D =0D def direct_abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Direct_abstract_declar= atorContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Direct_abstract_declar= atorContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_abstract_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAbstract_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAbstract_declarator"):=0D listener.enterAbstract_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAbstract_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAbstract_declarator"):=0D listener.exitAbstract_declarator(self)=0D =0D -=0D -=0D -=0D def abstract_declarator(self):=0D =0D - localctx =3D CParser.Abstract_declaratorContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Abstract_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 60, self.RULE_abstract_declarator)=0D try:=0D self.state =3D 461=0D @@ -3208,12 +3059,11 @@ class CParser ( Parser ): self.pointer()=0D self.state =3D 458=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,55,self._= ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 55, self= ._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 457=0D self.direct_abstract_declarator()=0D =0D -=0D pass=0D elif token in [CParser.T__37, CParser.T__39]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -3235,46 +3085,43 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def abstract_declarator(self):=0D - return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declaratorCon= text, 0)=0D =0D # @param i=3DNone Type: int=0D - def abstract_declarator_suffix(self,i=3DNone):=0D + def abstract_declarator_suffix(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Abstract_declarat= or_suffixContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Abstract_declarato= r_suffixContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Abstract_declarato= r_suffixContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_direct_abstract_declarator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterDirect_abstract_declarator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterDirect_abstract_declarator"):=0D listener.enterDirect_abstract_declarator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitDirect_abstract_declarator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitDirect_abstract_declarator"):=0D listener.exitDirect_abstract_declarator(self)=0D =0D -=0D -=0D def direct_abstract_declarator(self):=0D =0D - localctx =3D CParser.Direct_abstract_declaratorContext(self, self.= _ctx, self.state)=0D + localctx =3D CParser.Direct_abstract_declaratorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 62, self.RULE_direct_abstract_declarator)= =0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 468=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,57,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 57, self._ct= x)=0D if la_ =3D=3D 1:=0D self.state =3D 463=0D self.match(CParser.T__37)=0D @@ -3289,17 +3136,16 @@ class CParser ( Parser ): self.abstract_declarator_suffix()=0D pass=0D =0D -=0D self.state =3D 473=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,58,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 58, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 470=0D self.abstract_declarator_suffix()=0D self.state =3D 475=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,58,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 58, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -3313,42 +3159,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def parameter_type_list(self):=0D - return self.getTypedRuleContext(CParser.Parameter_type_listCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_type_listCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_abstract_declarator_suffix=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAbstract_declarator_suffix" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAbstract_declarator_suffix"):=0D listener.enterAbstract_declarator_suffix(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAbstract_declarator_suffix" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAbstract_declarator_suffix"):=0D listener.exitAbstract_declarator_suffix(self)=0D =0D -=0D -=0D -=0D def abstract_declarator_suffix(self):=0D =0D - localctx =3D CParser.Abstract_declarator_suffixContext(self, self.= _ctx, self.state)=0D + localctx =3D CParser.Abstract_declarator_suffixContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 64, self.RULE_abstract_declarator_suffix)= =0D try:=0D self.state =3D 488=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,59,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 59, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 476=0D @@ -3385,7 +3227,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3398,39 +3239,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def assignment_expression(self):=0D - return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext, 0)=0D =0D def initializer_list(self):=0D - return self.getTypedRuleContext(CParser.Initializer_listContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Initializer_listContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_initializer=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInitializer" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInitializer"):=0D listener.enterInitializer(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInitializer" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInitializer"):=0D listener.exitInitializer(self)=0D =0D -=0D -=0D -=0D def initializer(self):=0D =0D localctx =3D CParser.InitializerContext(self, self._ctx, self.stat= e)=0D self.enterRule(localctx, 66, self.RULE_initializer)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 498=0D self._errHandler.sync(self)=0D @@ -3449,11 +3285,10 @@ class CParser ( Parser ): self.state =3D 494=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__3:=0D + if _la =3D=3D CParser.T__3:=0D self.state =3D 493=0D self.match(CParser.T__3)=0D =0D -=0D self.state =3D 496=0D self.match(CParser.T__19)=0D pass=0D @@ -3472,34 +3307,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def initializer(self,i=3DNone):=0D + def initializer(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.InitializerContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.InitializerContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.InitializerContext= , i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_initializer_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInitializer_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInitializer_list"):=0D listener.enterInitializer_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInitializer_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInitializer_list"):=0D listener.exitInitializer_list(self)=0D =0D -=0D -=0D -=0D def initializer_list(self):=0D =0D localctx =3D CParser.Initializer_listContext(self, self._ctx, self= .state)=0D @@ -3510,16 +3341,16 @@ class CParser ( Parser ): self.initializer()=0D self.state =3D 505=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,62,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 62, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 501=0D self.match(CParser.T__3)=0D self.state =3D 502=0D self.initializer()=0D self.state =3D 507=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,62,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 62, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -3533,39 +3364,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def assignment_expression(self,i=3DNone):=0D + def assignment_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Assignment_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Assignment_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_argument_expression_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterArgument_expression_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterArgument_expression_list"):=0D listener.enterArgument_expression_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitArgument_expression_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitArgument_expression_list"):=0D listener.exitArgument_expression_list(self)=0D =0D -=0D -=0D -=0D def argument_expression_list(self):=0D =0D - localctx =3D CParser.Argument_expression_listContext(self, self._c= tx, self.state)=0D + localctx =3D CParser.Argument_expression_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 70, self.RULE_argument_expression_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 508=0D @@ -3573,15 +3401,14 @@ class CParser ( Parser ): self.state =3D 510=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 509=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 519=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 512=0D self.match(CParser.T__3)=0D self.state =3D 513=0D @@ -3589,11 +3416,10 @@ class CParser ( Parser ): self.state =3D 515=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__28:=0D + if _la =3D=3D CParser.T__28:=0D self.state =3D 514=0D self.match(CParser.T__28)=0D =0D -=0D self.state =3D 521=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -3610,39 +3436,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def multiplicative_expression(self,i=3DNone):=0D + def multiplicative_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Multiplicative_ex= pressionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Multiplicative_exp= ressionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Multiplicative_exp= ressionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_additive_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAdditive_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAdditive_expression"):=0D listener.enterAdditive_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAdditive_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAdditive_expression"):=0D listener.exitAdditive_expression(self)=0D =0D -=0D -=0D -=0D def additive_expression(self):=0D =0D - localctx =3D CParser.Additive_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Additive_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 72, self.RULE_additive_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 522=0D @@ -3650,7 +3473,7 @@ class CParser ( Parser ): self.state =3D 529=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__43 or _la=3D=3DCParser.T__44:=0D + while _la =3D=3D CParser.T__43 or _la =3D=3D CParser.T__44:=0D self.state =3D 527=0D self._errHandler.sync(self)=0D token =3D self._input.LA(1)=0D @@ -3685,39 +3508,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def cast_expression(self,i=3DNone):=0D + def cast_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Cast_expressionCo= ntext)=0D else:=0D - return self.getTypedRuleContext(CParser.Cast_expressionCon= text,i)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionCon= text, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_multiplicative_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMultiplicative_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMultiplicative_expression"):=0D listener.enterMultiplicative_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMultiplicative_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMultiplicative_expression"):=0D listener.exitMultiplicative_expression(self)=0D =0D -=0D -=0D -=0D def multiplicative_expression(self):=0D =0D - localctx =3D CParser.Multiplicative_expressionContext(self, self._= ctx, self.state)=0D + localctx =3D CParser.Multiplicative_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 74, self.RULE_multiplicative_expression)= =0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 532=0D @@ -3766,38 +3586,32 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def type_name(self):=0D - return self.getTypedRuleContext(CParser.Type_nameContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_nameContext, 0)=0D =0D def cast_expression(self):=0D - return self.getTypedRuleContext(CParser.Cast_expressionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionContext= , 0)=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_cast_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterCast_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterCast_expression"):=0D listener.enterCast_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitCast_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitCast_expression"):=0D listener.exitCast_expression(self)=0D =0D -=0D -=0D -=0D def cast_expression(self):=0D =0D localctx =3D CParser.Cast_expressionContext(self, self._ctx, self.= state)=0D @@ -3805,7 +3619,7 @@ class CParser ( Parser ): try:=0D self.state =3D 550=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,70,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 70, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 544=0D @@ -3824,7 +3638,6 @@ class CParser ( Parser ): self.unary_expression()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3837,46 +3650,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def postfix_expression(self):=0D - return self.getTypedRuleContext(CParser.Postfix_expressionCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Postfix_expressionCont= ext, 0)=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def unary_operator(self):=0D - return self.getTypedRuleContext(CParser.Unary_operatorContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_operatorContext,= 0)=0D =0D def cast_expression(self):=0D - return self.getTypedRuleContext(CParser.Cast_expressionContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Cast_expressionContext= , 0)=0D =0D def type_name(self):=0D - return self.getTypedRuleContext(CParser.Type_nameContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Type_nameContext, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_unary_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterUnary_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterUnary_expression"):=0D listener.enterUnary_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitUnary_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitUnary_expression"):=0D listener.exitUnary_expression(self)=0D =0D -=0D -=0D -=0D def unary_expression(self):=0D =0D localctx =3D CParser.Unary_expressionContext(self, self._ctx, self= .state)=0D @@ -3884,7 +3689,7 @@ class CParser ( Parser ): try:=0D self.state =3D 567=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,71,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 71, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 552=0D @@ -3935,7 +3740,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -3948,48 +3752,44 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D self.FuncCallText =3D ''=0D - self.p =3D None # Primary_expressionContext=0D - self.a =3D None # Token=0D - self.c =3D None # Argument_expression_listContext=0D - self.b =3D None # Token=0D - self.x =3D None # Token=0D - self.y =3D None # Token=0D - self.z =3D None # Token=0D + self.p =3D None # Primary_expressionContext=0D + self.a =3D None # Token=0D + self.c =3D None # Argument_expression_listContext=0D + self.b =3D None # Token=0D + self.x =3D None # Token=0D + self.y =3D None # Token=0D + self.z =3D None # Token=0D =0D def primary_expression(self):=0D - return self.getTypedRuleContext(CParser.Primary_expressionCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Primary_expressionCont= ext, 0)=0D =0D # @param i=3DNone Type: int=0D - def expression(self,i=3DNone):=0D + def expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.ExpressionContext= )=0D else:=0D - return self.getTypedRuleContext(CParser.ExpressionContext,= i)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext,= i)=0D =0D # @param i=3DNone Type: int=0D - def macro_parameter_list(self,i=3DNone):=0D + def macro_parameter_list(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Macro_parameter_l= istContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Macro_parameter_li= stContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_parameter_li= stContext, i)=0D =0D # @param i=3DNone Type: int=0D - def argument_expression_list(self,i=3DNone):=0D + def argument_expression_list(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Argument_expressi= on_listContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Argument_expressio= n_listContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Argument_expressio= n_listContext, i)=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D @@ -3999,38 +3799,38 @@ class CParser ( Parser ): return CParser.RULE_postfix_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPostfix_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPostfix_expression"):=0D listener.enterPostfix_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPostfix_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPostfix_expression"):=0D listener.exitPostfix_expression(self)=0D =0D -=0D -=0D -=0D def postfix_expression(self):=0D =0D - localctx =3D CParser.Postfix_expressionContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Postfix_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 80, self.RULE_postfix_expression)=0D =0D - self.FuncCallText=3D''=0D + self.FuncCallText =3D ''=0D =0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 569=0D localctx.p =3D self.primary_expression()=0D - self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText((localctx.p.start,localctx.p.stop)))=0D + self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText(=0D + (localctx.p.start, localctx.p.stop)))=0D self.state =3D 600=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,73,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 73, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 598=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,72,se= lf._ctx)=0D + la_ =3D self._interp.adaptivePredict(=0D + self._input, 72, self._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 571=0D self.match(CParser.T__39)=0D @@ -4045,7 +3845,8 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 576=0D localctx.a =3D self.match(CParser.T__38)=0D - self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.a is None else localctx.a.line), localctx.a= .column, self.FuncCallText, '')=0D + self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (=0D + 0 if localctx.a is None else localctx.a.line),= localctx.a.column, self.FuncCallText, '')=0D pass=0D =0D elif la_ =3D=3D 3:=0D @@ -4055,7 +3856,8 @@ class CParser ( Parser ): localctx.c =3D self.argument_expression_list()=0D self.state =3D 580=0D localctx.b =3D self.match(CParser.T__38)=0D - self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.b is None else localctx.b.line), localctx.b= .column, self.FuncCallText, (None if localctx.c is None else self._input.ge= tText((localctx.c.start,localctx.c.stop))))=0D + self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (=0D + 0 if localctx.b is None else localctx.b.line),= localctx.b.column, self.FuncCallText, (None if localctx.c is None else sel= f._input.getText((localctx.c.start, localctx.c.stop))))=0D pass=0D =0D elif la_ =3D=3D 4:=0D @@ -4072,7 +3874,8 @@ class CParser ( Parser ): self.match(CParser.T__50)=0D self.state =3D 588=0D localctx.x =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText +=3D '.' + (None if localctx.x i= s None else localctx.x.text)=0D + self.FuncCallText +=3D '.' + \=0D + (None if localctx.x is None else localctx.x.te= xt)=0D pass=0D =0D elif la_ =3D=3D 6:=0D @@ -4080,7 +3883,8 @@ class CParser ( Parser ): self.match(CParser.T__41)=0D self.state =3D 591=0D localctx.y =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText =3D (None if localctx.y is None = else localctx.y.text)=0D + self.FuncCallText =3D (=0D + None if localctx.y is None else localctx.y.tex= t)=0D pass=0D =0D elif la_ =3D=3D 7:=0D @@ -4088,7 +3892,8 @@ class CParser ( Parser ): self.match(CParser.T__51)=0D self.state =3D 594=0D localctx.z =3D self.match(CParser.IDENTIFIER)=0D - self.FuncCallText +=3D '->' + (None if localctx.z = is None else localctx.z.text)=0D + self.FuncCallText +=3D '->' + \=0D + (None if localctx.z is None else localctx.z.te= xt)=0D pass=0D =0D elif la_ =3D=3D 8:=0D @@ -4101,10 +3906,9 @@ class CParser ( Parser ): self.match(CParser.T__48)=0D pass=0D =0D -=0D self.state =3D 602=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,73,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 73, sel= f._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -4118,39 +3922,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def parameter_declaration(self,i=3DNone):=0D + def parameter_declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Parameter_declara= tionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Parameter_declarat= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_macro_parameter_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMacro_parameter_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMacro_parameter_list"):=0D listener.enterMacro_parameter_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMacro_parameter_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMacro_parameter_list"):=0D listener.exitMacro_parameter_list(self)=0D =0D -=0D -=0D -=0D def macro_parameter_list(self):=0D =0D - localctx =3D CParser.Macro_parameter_listContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Macro_parameter_listContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 82, self.RULE_macro_parameter_list)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 603=0D @@ -4158,7 +3959,7 @@ class CParser ( Parser ): self.state =3D 608=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 604=0D self.match(CParser.T__3)=0D self.state =3D 605=0D @@ -4179,32 +3980,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_unary_operator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterUnary_operator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterUnary_operator"):=0D listener.enterUnary_operator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitUnary_operator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitUnary_operator"):=0D listener.exitUnary_operator(self)=0D =0D -=0D -=0D -=0D def unary_operator(self):=0D =0D localctx =3D CParser.Unary_operatorContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 84, self.RULE_unary_operator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 611=0D @@ -4226,7 +4023,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -4234,37 +4031,33 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def constant(self):=0D - return self.getTypedRuleContext(CParser.ConstantContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ConstantContext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_primary_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterPrimary_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterPrimary_expression"):=0D listener.enterPrimary_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitPrimary_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitPrimary_expression"):=0D listener.exitPrimary_expression(self)=0D =0D -=0D -=0D -=0D def primary_expression(self):=0D =0D - localctx =3D CParser.Primary_expressionContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Primary_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 86, self.RULE_primary_expression)=0D try:=0D self.state =3D 619=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,75,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 75, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 613=0D @@ -4287,7 +4080,6 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -4300,7 +4092,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -4317,14 +4109,14 @@ class CParser ( Parser ): return self.getToken(CParser.CHARACTER_LITERAL, 0)=0D =0D # @param i=3DNone Type: int=0D - def IDENTIFIER(self,i=3DNone):=0D + def IDENTIFIER(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.IDENTIFIER)=0D else:=0D return self.getToken(CParser.IDENTIFIER, i)=0D =0D # @param i=3DNone Type: int=0D - def STRING_LITERAL(self,i=3DNone):=0D + def STRING_LITERAL(self, i=3DNone):=0D if i is None:=0D return self.getTokens(CParser.STRING_LITERAL)=0D else:=0D @@ -4337,23 +4129,20 @@ class CParser ( Parser ): return CParser.RULE_constant=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConstant" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConstant"):=0D listener.enterConstant(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConstant" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConstant"):=0D listener.exitConstant(self)=0D =0D -=0D -=0D -=0D def constant(self):=0D =0D localctx =3D CParser.ConstantContext(self, self._ctx, self.state)= =0D self.enterRule(localctx, 88, self.RULE_constant)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.state =3D 647=0D self._errHandler.sync(self)=0D @@ -4383,12 +4172,12 @@ class CParser ( Parser ): self.state =3D 636=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 628=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.IDENTIFIER:=0D + while _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 625=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 630=0D @@ -4398,7 +4187,7 @@ class CParser ( Parser ): self.state =3D 632=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER= :=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NU= MBER:=0D if _alt =3D=3D 1:=0D self.state =3D 631=0D self.match(CParser.STRING_LITERAL)=0D @@ -4407,19 +4196,20 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 634=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._in= put,77,self._ctx)=0D -=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 77, self._ctx)=0D =0D else:=0D raise NoViableAltException(self)=0D self.state =3D 638=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,78,s= elf._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 78, self._ctx)=0D =0D self.state =3D 643=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.IDENTIFIER:=0D + while _la =3D=3D CParser.IDENTIFIER:=0D self.state =3D 640=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 645=0D @@ -4447,39 +4237,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def assignment_expression(self,i=3DNone):=0D + def assignment_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Assignment_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Assignment_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExpression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExpression"):=0D listener.enterExpression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExpression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExpression"):=0D listener.exitExpression(self)=0D =0D -=0D -=0D -=0D def expression(self):=0D =0D localctx =3D CParser.ExpressionContext(self, self._ctx, self.state= )=0D self.enterRule(localctx, 90, self.RULE_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 649=0D @@ -4487,7 +4273,7 @@ class CParser ( Parser ): self.state =3D 654=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__3:=0D + while _la =3D=3D CParser.T__3:=0D self.state =3D 650=0D self.match(CParser.T__3)=0D self.state =3D 651=0D @@ -4508,33 +4294,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_constant_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConstant_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConstant_expression"):=0D listener.enterConstant_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConstant_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConstant_expression"):=0D listener.exitConstant_expression(self)=0D =0D -=0D -=0D -=0D def constant_expression(self):=0D =0D - localctx =3D CParser.Constant_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Constant_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 92, self.RULE_constant_expression)=0D try:=0D self.enterOuterAlt(localctx, 1)=0D @@ -4552,50 +4335,44 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def lvalue(self):=0D - return self.getTypedRuleContext(CParser.LvalueContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.LvalueContext, 0)=0D =0D def assignment_operator(self):=0D - return self.getTypedRuleContext(CParser.Assignment_operatorCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_operatorCon= text, 0)=0D =0D def assignment_expression(self):=0D - return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Assignment_expressionC= ontext, 0)=0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_assignment_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAssignment_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAssignment_expression"):=0D listener.enterAssignment_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAssignment_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAssignment_expression"):=0D listener.exitAssignment_expression(self)=0D =0D -=0D -=0D -=0D def assignment_expression(self):=0D =0D - localctx =3D CParser.Assignment_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Assignment_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 94, self.RULE_assignment_expression)=0D try:=0D self.state =3D 664=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,82,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 82, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 659=0D @@ -4612,7 +4389,6 @@ class CParser ( Parser ): self.conditional_expression()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -4625,30 +4401,26 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def unary_expression(self):=0D - return self.getTypedRuleContext(CParser.Unary_expressionContex= t,0)=0D -=0D + return self.getTypedRuleContext(CParser.Unary_expressionContex= t, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_lvalue=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLvalue" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLvalue"):=0D listener.enterLvalue(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLvalue" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLvalue"):=0D listener.exitLvalue(self)=0D =0D -=0D -=0D -=0D def lvalue(self):=0D =0D localctx =3D CParser.LvalueContext(self, self._ctx, self.state)=0D @@ -4669,32 +4441,29 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_assignment_operator=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAssignment_operator" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAssignment_operator"):=0D listener.enterAssignment_operator(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAssignment_operator" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAssignment_operator"):=0D listener.exitAssignment_operator(self)=0D =0D -=0D -=0D -=0D def assignment_operator(self):=0D =0D - localctx =3D CParser.Assignment_operatorContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Assignment_operatorContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 98, self.RULE_assignment_operator)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 668=0D @@ -4716,44 +4485,39 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # Logical_or_expressionContext=0D + self.e =3D None # Logical_or_expressionContext=0D =0D def logical_or_expression(self):=0D - return self.getTypedRuleContext(CParser.Logical_or_expressionC= ontext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Logical_or_expressionC= ontext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def conditional_expression(self):=0D - return self.getTypedRuleContext(CParser.Conditional_expression= Context,0)=0D -=0D + return self.getTypedRuleContext(CParser.Conditional_expression= Context, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_conditional_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterConditional_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterConditional_expression"):=0D listener.enterConditional_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitConditional_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitConditional_expression"):=0D listener.exitConditional_expression(self)=0D =0D -=0D -=0D -=0D def conditional_expression(self):=0D =0D - localctx =3D CParser.Conditional_expressionContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Conditional_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 100, self.RULE_conditional_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 670=0D @@ -4761,7 +4525,7 @@ class CParser ( Parser ): self.state =3D 677=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__65:=0D + if _la =3D=3D CParser.T__65:=0D self.state =3D 671=0D self.match(CParser.T__65)=0D self.state =3D 672=0D @@ -4770,8 +4534,8 @@ class CParser ( Parser ): self.match(CParser.T__22)=0D self.state =3D 674=0D self.conditional_expression()=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D -=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -4785,39 +4549,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def logical_and_expression(self,i=3DNone):=0D + def logical_and_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Logical_and_expre= ssionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Logical_and_expres= sionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Logical_and_expres= sionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_logical_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLogical_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLogical_or_expression"):=0D listener.enterLogical_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLogical_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLogical_or_expression"):=0D listener.exitLogical_or_expression(self)=0D =0D -=0D -=0D -=0D def logical_or_expression(self):=0D =0D - localctx =3D CParser.Logical_or_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Logical_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 102, self.RULE_logical_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 679=0D @@ -4825,7 +4586,7 @@ class CParser ( Parser ): self.state =3D 684=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__66:=0D + while _la =3D=3D CParser.T__66:=0D self.state =3D 680=0D self.match(CParser.T__66)=0D self.state =3D 681=0D @@ -4846,39 +4607,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def inclusive_or_expression(self,i=3DNone):=0D + def inclusive_or_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Inclusive_or_expr= essionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Inclusive_or_expre= ssionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Inclusive_or_expre= ssionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_logical_and_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLogical_and_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLogical_and_expression"):=0D listener.enterLogical_and_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLogical_and_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLogical_and_expression"):=0D listener.exitLogical_and_expression(self)=0D =0D -=0D -=0D -=0D def logical_and_expression(self):=0D =0D - localctx =3D CParser.Logical_and_expressionContext(self, self._ctx= , self.state)=0D + localctx =3D CParser.Logical_and_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 104, self.RULE_logical_and_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 687=0D @@ -4886,7 +4644,7 @@ class CParser ( Parser ): self.state =3D 692=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__67:=0D + while _la =3D=3D CParser.T__67:=0D self.state =3D 688=0D self.match(CParser.T__67)=0D self.state =3D 689=0D @@ -4907,39 +4665,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def exclusive_or_expression(self,i=3DNone):=0D + def exclusive_or_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Exclusive_or_expr= essionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Exclusive_or_expre= ssionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Exclusive_or_expre= ssionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_inclusive_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterInclusive_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterInclusive_or_expression"):=0D listener.enterInclusive_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitInclusive_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitInclusive_or_expression"):=0D listener.exitInclusive_or_expression(self)=0D =0D -=0D -=0D -=0D def inclusive_or_expression(self):=0D =0D - localctx =3D CParser.Inclusive_or_expressionContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Inclusive_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 106, self.RULE_inclusive_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 695=0D @@ -4947,7 +4702,7 @@ class CParser ( Parser ): self.state =3D 700=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__68:=0D + while _la =3D=3D CParser.T__68:=0D self.state =3D 696=0D self.match(CParser.T__68)=0D self.state =3D 697=0D @@ -4968,39 +4723,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def and_expression(self,i=3DNone):=0D + def and_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.And_expressionCon= text)=0D else:=0D - return self.getTypedRuleContext(CParser.And_expressionCont= ext,i)=0D -=0D + return self.getTypedRuleContext(CParser.And_expressionCont= ext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_exclusive_or_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExclusive_or_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExclusive_or_expression"):=0D listener.enterExclusive_or_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExclusive_or_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExclusive_or_expression"):=0D listener.exitExclusive_or_expression(self)=0D =0D -=0D -=0D -=0D def exclusive_or_expression(self):=0D =0D - localctx =3D CParser.Exclusive_or_expressionContext(self, self._ct= x, self.state)=0D + localctx =3D CParser.Exclusive_or_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 108, self.RULE_exclusive_or_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 703=0D @@ -5008,7 +4760,7 @@ class CParser ( Parser ): self.state =3D 708=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__69:=0D + while _la =3D=3D CParser.T__69:=0D self.state =3D 704=0D self.match(CParser.T__69)=0D self.state =3D 705=0D @@ -5029,39 +4781,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def equality_expression(self,i=3DNone):=0D + def equality_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Equality_expressi= onContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Equality_expressio= nContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Equality_expressio= nContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_and_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAnd_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAnd_expression"):=0D listener.enterAnd_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAnd_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAnd_expression"):=0D listener.exitAnd_expression(self)=0D =0D -=0D -=0D -=0D def and_expression(self):=0D =0D localctx =3D CParser.And_expressionContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 110, self.RULE_and_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 711=0D @@ -5069,7 +4817,7 @@ class CParser ( Parser ): self.state =3D 716=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__52:=0D + while _la =3D=3D CParser.T__52:=0D self.state =3D 712=0D self.match(CParser.T__52)=0D self.state =3D 713=0D @@ -5090,39 +4838,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def relational_expression(self,i=3DNone):=0D + def relational_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Relational_expres= sionContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Relational_express= ionContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Relational_express= ionContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_equality_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterEquality_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterEquality_expression"):=0D listener.enterEquality_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitEquality_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitEquality_expression"):=0D listener.exitEquality_expression(self)=0D =0D -=0D -=0D -=0D def equality_expression(self):=0D =0D - localctx =3D CParser.Equality_expressionContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Equality_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 112, self.RULE_equality_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 719=0D @@ -5130,10 +4875,10 @@ class CParser ( Parser ): self.state =3D 724=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__70 or _la=3D=3DCParser.T__71:=0D + while _la =3D=3D CParser.T__70 or _la =3D=3D CParser.T__71:=0D self.state =3D 720=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__70 or _la=3D=3DCParser.T__71):= =0D + if not(_la =3D=3D CParser.T__70 or _la =3D=3D CParser.T__7= 1):=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5156,39 +4901,36 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def shift_expression(self,i=3DNone):=0D + def shift_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Shift_expressionC= ontext)=0D else:=0D - return self.getTypedRuleContext(CParser.Shift_expressionCo= ntext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Shift_expressionCo= ntext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_relational_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterRelational_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterRelational_expression"):=0D listener.enterRelational_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitRelational_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitRelational_expression"):=0D listener.exitRelational_expression(self)=0D =0D -=0D -=0D -=0D def relational_expression(self):=0D =0D - localctx =3D CParser.Relational_expressionContext(self, self._ctx,= self.state)=0D + localctx =3D CParser.Relational_expressionContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 114, self.RULE_relational_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 727=0D @@ -5222,39 +4964,35 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def additive_expression(self,i=3DNone):=0D + def additive_expression(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.Additive_expressi= onContext)=0D else:=0D - return self.getTypedRuleContext(CParser.Additive_expressio= nContext,i)=0D -=0D + return self.getTypedRuleContext(CParser.Additive_expressio= nContext, i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_shift_expression=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterShift_expression" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterShift_expression"):=0D listener.enterShift_expression(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitShift_expression" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitShift_expression"):=0D listener.exitShift_expression(self)=0D =0D -=0D -=0D -=0D def shift_expression(self):=0D =0D localctx =3D CParser.Shift_expressionContext(self, self._ctx, self= .state)=0D self.enterRule(localctx, 116, self.RULE_shift_expression)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 735=0D @@ -5262,10 +5000,10 @@ class CParser ( Parser ): self.state =3D 740=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - while _la=3D=3DCParser.T__76 or _la=3D=3DCParser.T__77:=0D + while _la =3D=3D CParser.T__76 or _la =3D=3D CParser.T__77:=0D self.state =3D 736=0D _la =3D self._input.LA(1)=0D - if not(_la=3D=3DCParser.T__76 or _la=3D=3DCParser.T__77):= =0D + if not(_la =3D=3D CParser.T__76 or _la =3D=3D CParser.T__7= 7):=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5288,70 +5026,56 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def labeled_statement(self):=0D - return self.getTypedRuleContext(CParser.Labeled_statementConte= xt,0)=0D -=0D + return self.getTypedRuleContext(CParser.Labeled_statementConte= xt, 0)=0D =0D def compound_statement(self):=0D - return self.getTypedRuleContext(CParser.Compound_statementCont= ext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Compound_statementCont= ext, 0)=0D =0D def expression_statement(self):=0D - return self.getTypedRuleContext(CParser.Expression_statementCo= ntext,0)=0D -=0D + return self.getTypedRuleContext(CParser.Expression_statementCo= ntext, 0)=0D =0D def selection_statement(self):=0D - return self.getTypedRuleContext(CParser.Selection_statementCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Selection_statementCon= text, 0)=0D =0D def iteration_statement(self):=0D - return self.getTypedRuleContext(CParser.Iteration_statementCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Iteration_statementCon= text, 0)=0D =0D def jump_statement(self):=0D - return self.getTypedRuleContext(CParser.Jump_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Jump_statementContext,= 0)=0D =0D def macro_statement(self):=0D - return self.getTypedRuleContext(CParser.Macro_statementContext= ,0)=0D -=0D + return self.getTypedRuleContext(CParser.Macro_statementContext= , 0)=0D =0D def asm2_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm2_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Asm2_statementContext,= 0)=0D =0D def asm1_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm1_statementContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Asm1_statementContext,= 0)=0D =0D def asm_statement(self):=0D - return self.getTypedRuleContext(CParser.Asm_statementContext,0= )=0D -=0D + return self.getTypedRuleContext(CParser.Asm_statementContext, = 0)=0D =0D def declaration(self):=0D - return self.getTypedRuleContext(CParser.DeclarationContext,0)= =0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStatement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStatement"):=0D listener.enterStatement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStatement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStatement"):=0D listener.exitStatement(self)=0D =0D -=0D -=0D -=0D def statement(self):=0D =0D localctx =3D CParser.StatementContext(self, self._ctx, self.state)= =0D @@ -5359,7 +5083,7 @@ class CParser ( Parser ): try:=0D self.state =3D 754=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,92,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 92, self._ct= x)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 743=0D @@ -5426,7 +5150,6 @@ class CParser ( Parser ): self.declaration()=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -5439,7 +5162,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5450,52 +5173,48 @@ class CParser ( Parser ): return CParser.RULE_asm2_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm2_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm2_statement"):=0D listener.enterAsm2_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm2_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm2_statement"):=0D listener.exitAsm2_statement(self)=0D =0D -=0D -=0D -=0D def asm2_statement(self):=0D =0D localctx =3D CParser.Asm2_statementContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 120, self.RULE_asm2_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 757=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D - if _la=3D=3DCParser.T__78:=0D + if _la =3D=3D CParser.T__78:=0D self.state =3D 756=0D self.match(CParser.T__78)=0D =0D -=0D self.state =3D 759=0D self.match(CParser.IDENTIFIER)=0D self.state =3D 760=0D self.match(CParser.T__37)=0D self.state =3D 764=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,94,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 94, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 761=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__1:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__1:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D self.consume()=0D self.state =3D 766=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,94,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 94, sel= f._ctx)=0D =0D self.state =3D 767=0D self.match(CParser.T__38)=0D @@ -5513,32 +5232,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_asm1_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm1_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm1_statement"):=0D listener.enterAsm1_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm1_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm1_statement"):=0D listener.exitAsm1_statement(self)=0D =0D -=0D -=0D -=0D def asm1_statement(self):=0D =0D localctx =3D CParser.Asm1_statementContext(self, self._ctx, self.s= tate)=0D self.enterRule(localctx, 122, self.RULE_asm1_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 770=0D @@ -5551,7 +5266,7 @@ class CParser ( Parser ): while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__0) | (1 << CParser.T__1) | (1 << CParser.T__2) | (1 << CParser.T__3) = | (1 << CParser.T__4) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << C= Parser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T_= _10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) |= (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 <<= CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CPars= er.T__21) | (1 << CParser.T__22) | (1 << CParser.T__23) | (1 << CParser.T__= 24) | (1 << CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | = (1 << CParser.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << = CParser.T__31) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParse= r.T__34) | (1 << CParser.T__35) | (1 << CParser.T__36) | (1 << CParser.T__3= 7) | (1 << CParser.T__38) | (1 << CParser.T__39) | (1 << CParser.T__40) | (= 1 << CParser.T__41) | (1 << CParser.T__42) | (1 << CParser.T__43) | (1 << C= Parser.T__44) | (1 << CParser.T__45) | (1 << CParser.T__46) | (1 << CParser= .T__47) | (1 << CParser.T__48) | (1 << CParser.T__49) | (1 << CParser.T__50= ) | (1 << CParser.T__51) | (1 << CParser.T__52) | (1 << CParser.T__53) | (1= << CParser.T__54) | (1 << CParser.T__55) | (1 << CParser.T__56) | (1 << CP= arser.T__57) | (1 << CParser.T__58) | (1 << CParser.T__59) | (1 << CParser.= T__60) | (1 << CParser.T__61) | (1 << CParser.T__62))) !=3D 0) or ((((_la -= 64)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 64)) & ((1 << (CParser.T__63 - 64= )) | (1 << (CParser.T__64 - 64)) | (1 << (CParser.T__65 - 64)) | (1 << (CPa= rser.T__66 - 64)) | (1 << (CParser.T__67 - 64)) | (1 << (CParser.T__68 - 64= )) | (1 << (CParser.T__69 - 64)) | (1 << (CParser.T__70 - 64)) | (1 << (CPa= rser.T__71 - 64)) | (1 << (CParser.T__72 - 64)) | (1 << (CParser.T__73 - 64= )) | (1 << (CParser.T__74 - 64)) | (1 << (CParser.T__75 - 64)) | (1 << (CPa= rser.T__76 - 64)) | (1 << (CParser.T__77 - 64)) | (1 << (CParser.T__78 - 64= )) | (1 << (CParser.T__79 - 64)) | (1 << (CParser.T__80 - 64)) | (1 << (CPa= rser.T__81 - 64)) | (1 << (CParser.T__82 - 64)) | (1 << (CParser.T__83 - 64= )) | (1 << (CParser.T__84 - 64)) | (1 << (CParser.T__85 - 64)) | (1 << (CPa= rser.T__86 - 64)) | (1 << (CParser.T__87 - 64)) | (1 << (CParser.T__88 - 64= )) | (1 << (CParser.T__89 - 64)) | (1 << (CParser.T__90 - 64)) | (1 << (CPa= rser.T__91 - 64)) | (1 << (CParser.IDENTIFIER - 64)) | (1 << (CParser.CHARA= CTER_LITERAL - 64)) | (1 << (CParser.STRING_LITERAL - 64)) | (1 << (CParser= .HEX_LITERAL - 64)) | (1 << (CParser.DECIMAL_LITERAL - 64)) | (1 << (CParse= r.OCTAL_LITERAL - 64)) | (1 << (CParser.FLOATING_POINT_LITERAL - 64)) | (1 = << (CParser.WS - 64)) | (1 << (CParser.BS - 64)) | (1 << (CParser.UnicodeVo= cabulary - 64)) | (1 << (CParser.COMMENT - 64)) | (1 << (CParser.LINE_COMME= NT - 64)) | (1 << (CParser.LINE_COMMAND - 64)))) !=3D 0):=0D self.state =3D 772=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__19:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__19:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5574,32 +5289,28 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D -=0D def getRuleIndex(self):=0D return CParser.RULE_asm_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterAsm_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterAsm_statement"):=0D listener.enterAsm_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitAsm_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitAsm_statement"):=0D listener.exitAsm_statement(self)=0D =0D -=0D -=0D -=0D def asm_statement(self):=0D =0D localctx =3D CParser.Asm_statementContext(self, self._ctx, self.st= ate)=0D self.enterRule(localctx, 124, self.RULE_asm_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 780=0D @@ -5612,7 +5323,7 @@ class CParser ( Parser ): while (((_la) & ~0x3f) =3D=3D 0 and ((1 << _la) & ((1 << CPars= er.T__0) | (1 << CParser.T__1) | (1 << CParser.T__2) | (1 << CParser.T__3) = | (1 << CParser.T__4) | (1 << CParser.T__5) | (1 << CParser.T__6) | (1 << C= Parser.T__7) | (1 << CParser.T__8) | (1 << CParser.T__9) | (1 << CParser.T_= _10) | (1 << CParser.T__11) | (1 << CParser.T__12) | (1 << CParser.T__13) |= (1 << CParser.T__14) | (1 << CParser.T__15) | (1 << CParser.T__16) | (1 <<= CParser.T__17) | (1 << CParser.T__18) | (1 << CParser.T__20) | (1 << CPars= er.T__21) | (1 << CParser.T__22) | (1 << CParser.T__23) | (1 << CParser.T__= 24) | (1 << CParser.T__25) | (1 << CParser.T__26) | (1 << CParser.T__27) | = (1 << CParser.T__28) | (1 << CParser.T__29) | (1 << CParser.T__30) | (1 << = CParser.T__31) | (1 << CParser.T__32) | (1 << CParser.T__33) | (1 << CParse= r.T__34) | (1 << CParser.T__35) | (1 << CParser.T__36) | (1 << CParser.T__3= 7) | (1 << CParser.T__38) | (1 << CParser.T__39) | (1 << CParser.T__40) | (= 1 << CParser.T__41) | (1 << CParser.T__42) | (1 << CParser.T__43) | (1 << C= Parser.T__44) | (1 << CParser.T__45) | (1 << CParser.T__46) | (1 << CParser= .T__47) | (1 << CParser.T__48) | (1 << CParser.T__49) | (1 << CParser.T__50= ) | (1 << CParser.T__51) | (1 << CParser.T__52) | (1 << CParser.T__53) | (1= << CParser.T__54) | (1 << CParser.T__55) | (1 << CParser.T__56) | (1 << CP= arser.T__57) | (1 << CParser.T__58) | (1 << CParser.T__59) | (1 << CParser.= T__60) | (1 << CParser.T__61) | (1 << CParser.T__62))) !=3D 0) or ((((_la -= 64)) & ~0x3f) =3D=3D 0 and ((1 << (_la - 64)) & ((1 << (CParser.T__63 - 64= )) | (1 << (CParser.T__64 - 64)) | (1 << (CParser.T__65 - 64)) | (1 << (CPa= rser.T__66 - 64)) | (1 << (CParser.T__67 - 64)) | (1 << (CParser.T__68 - 64= )) | (1 << (CParser.T__69 - 64)) | (1 << (CParser.T__70 - 64)) | (1 << (CPa= rser.T__71 - 64)) | (1 << (CParser.T__72 - 64)) | (1 << (CParser.T__73 - 64= )) | (1 << (CParser.T__74 - 64)) | (1 << (CParser.T__75 - 64)) | (1 << (CPa= rser.T__76 - 64)) | (1 << (CParser.T__77 - 64)) | (1 << (CParser.T__78 - 64= )) | (1 << (CParser.T__79 - 64)) | (1 << (CParser.T__80 - 64)) | (1 << (CPa= rser.T__81 - 64)) | (1 << (CParser.T__82 - 64)) | (1 << (CParser.T__83 - 64= )) | (1 << (CParser.T__84 - 64)) | (1 << (CParser.T__85 - 64)) | (1 << (CPa= rser.T__86 - 64)) | (1 << (CParser.T__87 - 64)) | (1 << (CParser.T__88 - 64= )) | (1 << (CParser.T__89 - 64)) | (1 << (CParser.T__90 - 64)) | (1 << (CPa= rser.T__91 - 64)) | (1 << (CParser.IDENTIFIER - 64)) | (1 << (CParser.CHARA= CTER_LITERAL - 64)) | (1 << (CParser.STRING_LITERAL - 64)) | (1 << (CParser= .HEX_LITERAL - 64)) | (1 << (CParser.DECIMAL_LITERAL - 64)) | (1 << (CParse= r.OCTAL_LITERAL - 64)) | (1 << (CParser.FLOATING_POINT_LITERAL - 64)) | (1 = << (CParser.WS - 64)) | (1 << (CParser.BS - 64)) | (1 << (CParser.UnicodeVo= cabulary - 64)) | (1 << (CParser.COMMENT - 64)) | (1 << (CParser.LINE_COMME= NT - 64)) | (1 << (CParser.LINE_COMMAND - 64)))) !=3D 0):=0D self.state =3D 782=0D _la =3D self._input.LA(1)=0D - if _la <=3D 0 or _la=3D=3DCParser.T__19:=0D + if _la <=3D 0 or _la =3D=3D CParser.T__19:=0D self._errHandler.recoverInline(self)=0D else:=0D self._errHandler.reportMatch(self)=0D @@ -5635,7 +5346,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5643,42 +5354,36 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def statement_list(self):=0D - return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_macro_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterMacro_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterMacro_statement"):=0D listener.enterMacro_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitMacro_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitMacro_statement"):=0D listener.exitMacro_statement(self)=0D =0D -=0D -=0D -=0D def macro_statement(self):=0D =0D localctx =3D CParser.Macro_statementContext(self, self._ctx, self.= state)=0D self.enterRule(localctx, 126, self.RULE_macro_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 790=0D @@ -5687,23 +5392,22 @@ class CParser ( Parser ): self.match(CParser.T__37)=0D self.state =3D 795=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,97,self._ctx= )=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 97, self._c= tx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 792=0D self.declaration()=0D self.state =3D 797=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,97,self.= _ctx)=0D + _alt =3D self._interp.adaptivePredict(self._input, 97, sel= f._ctx)=0D =0D self.state =3D 799=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,98,self._ctx)= =0D + la_ =3D self._interp.adaptivePredict(self._input, 98, self._ct= x)=0D if la_ =3D=3D 1:=0D self.state =3D 798=0D self.statement_list()=0D =0D -=0D self.state =3D 802=0D self._errHandler.sync(self)=0D _la =3D self._input.LA(1)=0D @@ -5711,7 +5415,6 @@ class CParser ( Parser ): self.state =3D 801=0D self.expression()=0D =0D -=0D self.state =3D 804=0D self.match(CParser.T__38)=0D except RecognitionException as re:=0D @@ -5726,7 +5429,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -5734,32 +5437,28 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def statement(self):=0D - return self.getTypedRuleContext(CParser.StatementContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, 0)=0D =0D def constant_expression(self):=0D - return self.getTypedRuleContext(CParser.Constant_expressionCon= text,0)=0D -=0D + return self.getTypedRuleContext(CParser.Constant_expressionCon= text, 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_labeled_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterLabeled_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterLabeled_statement"):=0D listener.enterLabeled_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitLabeled_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitLabeled_statement"):=0D listener.exitLabeled_statement(self)=0D =0D -=0D -=0D -=0D def labeled_statement(self):=0D =0D - localctx =3D CParser.Labeled_statementContext(self, self._ctx, sel= f.state)=0D + localctx =3D CParser.Labeled_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 128, self.RULE_labeled_statement)=0D try:=0D self.state =3D 817=0D @@ -5809,57 +5508,54 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def declaration(self,i=3DNone):=0D + def declaration(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.DeclarationContex= t)=0D else:=0D - return self.getTypedRuleContext(CParser.DeclarationContext= ,i)=0D -=0D + return self.getTypedRuleContext(CParser.DeclarationContext= , i)=0D =0D def statement_list(self):=0D - return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D -=0D + return self.getTypedRuleContext(CParser.Statement_listContext,= 0)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_compound_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterCompound_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterCompound_statement"):=0D listener.enterCompound_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitCompound_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitCompound_statement"):=0D listener.exitCompound_statement(self)=0D =0D -=0D -=0D -=0D def compound_statement(self):=0D =0D - localctx =3D CParser.Compound_statementContext(self, self._ctx, se= lf.state)=0D + localctx =3D CParser.Compound_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 130, self.RULE_compound_statement)=0D - self._la =3D 0 # Token type=0D + self._la =3D 0 # Token type=0D try:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 819=0D self.match(CParser.T__0)=0D self.state =3D 823=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,101,self._ct= x)=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D - if _alt=3D=3D1:=0D + _alt =3D self._interp.adaptivePredict(self._input, 101, self._= ctx)=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D + if _alt =3D=3D 1:=0D self.state =3D 820=0D self.declaration()=0D self.state =3D 825=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,101,self= ._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 101, self._ctx)=0D =0D self.state =3D 827=0D self._errHandler.sync(self)=0D @@ -5868,7 +5564,6 @@ class CParser ( Parser ): self.state =3D 826=0D self.statement_list()=0D =0D -=0D self.state =3D 829=0D self.match(CParser.T__19)=0D except RecognitionException as re:=0D @@ -5883,34 +5578,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D # @param i=3DNone Type: int=0D - def statement(self,i=3DNone):=0D + def statement(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.StatementContext)= =0D else:=0D - return self.getTypedRuleContext(CParser.StatementContext,i= )=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, = i)=0D =0D def getRuleIndex(self):=0D return CParser.RULE_statement_list=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterStatement_list" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterStatement_list"):=0D listener.enterStatement_list(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitStatement_list" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitStatement_list"):=0D listener.exitStatement_list(self)=0D =0D -=0D -=0D -=0D def statement_list(self):=0D =0D localctx =3D CParser.Statement_listContext(self, self._ctx, self.s= tate)=0D @@ -5920,7 +5611,7 @@ class CParser ( Parser ): self.state =3D 832=0D self._errHandler.sync(self)=0D _alt =3D 1=0D - while _alt!=3D2 and _alt!=3DATN.INVALID_ALT_NUMBER:=0D + while _alt !=3D 2 and _alt !=3D ATN.INVALID_ALT_NUMBER:=0D if _alt =3D=3D 1:=0D self.state =3D 831=0D self.statement()=0D @@ -5929,7 +5620,8 @@ class CParser ( Parser ): raise NoViableAltException(self)=0D self.state =3D 834=0D self._errHandler.sync(self)=0D - _alt =3D self._interp.adaptivePredict(self._input,103,self= ._ctx)=0D + _alt =3D self._interp.adaptivePredict(=0D + self._input, 103, self._ctx)=0D =0D except RecognitionException as re:=0D localctx.exception =3D re=0D @@ -5943,33 +5635,30 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_expression_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterExpression_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterExpression_statement"):=0D listener.enterExpression_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitExpression_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitExpression_statement"):=0D listener.exitExpression_statement(self)=0D =0D -=0D -=0D -=0D def expression_statement(self):=0D =0D - localctx =3D CParser.Expression_statementContext(self, self._ctx, = self.state)=0D + localctx =3D CParser.Expression_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 134, self.RULE_expression_statement)=0D try:=0D self.state =3D 840=0D @@ -6002,42 +5691,38 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # ExpressionContext=0D + self.e =3D None # ExpressionContext=0D =0D # @param i=3DNone Type: int=0D - def statement(self,i=3DNone):=0D + def statement(self, i=3DNone):=0D if i is None:=0D return self.getTypedRuleContexts(CParser.StatementContext)= =0D else:=0D - return self.getTypedRuleContext(CParser.StatementContext,i= )=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, = i)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_selection_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterSelection_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterSelection_statement"):=0D listener.enterSelection_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitSelection_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitSelection_statement"):=0D listener.exitSelection_statement(self)=0D =0D -=0D -=0D -=0D def selection_statement(self):=0D =0D - localctx =3D CParser.Selection_statementContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Selection_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 136, self.RULE_selection_statement)=0D try:=0D self.state =3D 858=0D @@ -6053,19 +5738,19 @@ class CParser ( Parser ): localctx.e =3D self.expression()=0D self.state =3D 845=0D self.match(CParser.T__38)=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D self.state =3D 847=0D self.statement()=0D self.state =3D 850=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,105,self.= _ctx)=0D + la_ =3D self._interp.adaptivePredict(self._input, 105, sel= f._ctx)=0D if la_ =3D=3D 1:=0D self.state =3D 848=0D self.match(CParser.T__84)=0D self.state =3D 849=0D self.statement()=0D =0D -=0D pass=0D elif token in [CParser.T__85]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -6095,38 +5780,34 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D - self.e =3D None # ExpressionContext=0D + self.e =3D None # ExpressionContext=0D =0D def statement(self):=0D - return self.getTypedRuleContext(CParser.StatementContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.StatementContext, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_iteration_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterIteration_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterIteration_statement"):=0D listener.enterIteration_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitIteration_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitIteration_statement"):=0D listener.exitIteration_statement(self)=0D =0D -=0D -=0D -=0D def iteration_statement(self):=0D =0D - localctx =3D CParser.Iteration_statementContext(self, self._ctx, s= elf.state)=0D + localctx =3D CParser.Iteration_statementContext(=0D + self, self._ctx, self.state)=0D self.enterRule(localctx, 138, self.RULE_iteration_statement)=0D try:=0D self.state =3D 876=0D @@ -6144,7 +5825,8 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D self.state =3D 864=0D self.statement()=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D pass=0D elif token in [CParser.T__87]:=0D self.enterOuterAlt(localctx, 2)=0D @@ -6162,7 +5844,8 @@ class CParser ( Parser ): self.match(CParser.T__38)=0D self.state =3D 873=0D self.match(CParser.T__1)=0D - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop))))=0D + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (=0D + None if localctx.e is None else localctx.e.stop).colum= n, (None if localctx.e is None else self._input.getText((localctx.e.start, = localctx.e.stop))))=0D pass=0D else:=0D raise NoViableAltException(self)=0D @@ -6179,7 +5862,7 @@ class CParser ( Parser ): =0D # @param parent=3DNone Type: ParserRuleContext=0D # @param invokingState=3D-1 Type: int=0D - def __init__(self,parser,parent=3DNone,invokingState=3D-1):=0D + def __init__(self, parser, parent=3DNone, invokingState=3D-1):=0D super().__init__(parent, invokingState)=0D self.parser =3D parser=0D =0D @@ -6187,25 +5870,21 @@ class CParser ( Parser ): return self.getToken(CParser.IDENTIFIER, 0)=0D =0D def expression(self):=0D - return self.getTypedRuleContext(CParser.ExpressionContext,0)=0D -=0D + return self.getTypedRuleContext(CParser.ExpressionContext, 0)= =0D =0D def getRuleIndex(self):=0D return CParser.RULE_jump_statement=0D =0D # @param listener Type: ParseTreeListener=0D - def enterRule(self,listener):=0D - if hasattr( listener, "enterJump_statement" ):=0D + def enterRule(self, listener):=0D + if hasattr(listener, "enterJump_statement"):=0D listener.enterJump_statement(self)=0D =0D # @param listener Type: ParseTreeListener=0D - def exitRule(self,listener):=0D - if hasattr( listener, "exitJump_statement" ):=0D + def exitRule(self, listener):=0D + if hasattr(listener, "exitJump_statement"):=0D listener.exitJump_statement(self)=0D =0D -=0D -=0D -=0D def jump_statement(self):=0D =0D localctx =3D CParser.Jump_statementContext(self, self._ctx, self.s= tate)=0D @@ -6213,7 +5892,7 @@ class CParser ( Parser ): try:=0D self.state =3D 891=0D self._errHandler.sync(self)=0D - la_ =3D self._interp.adaptivePredict(self._input,108,self._ctx= )=0D + la_ =3D self._interp.adaptivePredict(self._input, 108, self._c= tx)=0D if la_ =3D=3D 1:=0D self.enterOuterAlt(localctx, 1)=0D self.state =3D 878=0D @@ -6258,7 +5937,6 @@ class CParser ( Parser ): self.match(CParser.T__1)=0D pass=0D =0D -=0D except RecognitionException as re:=0D localctx.exception =3D re=0D self._errHandler.reportError(self, re)=0D @@ -6266,8 +5944,3 @@ class CParser ( Parser ): finally:=0D self.exitRule()=0D return localctx=0D -=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/Eot/CodeFragment.py b/BaseTools/Source= /Python/Eot/CodeFragment.py index 94c3f52d5c20..5ef7cb3557f4 100644 --- a/BaseTools/Source/Python/Eot/CodeFragment.py +++ b/BaseTools/Source/Python/Eot/CodeFragment.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # fragments of source file=0D #=0D # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
        = =0D @@ -7,11 +7,11 @@ #=0D =0D =0D -## The description of comment contents and start & end position=0D +# The description of comment contents and start & end position=0D #=0D #=0D -class Comment :=0D - ## The constructor=0D +class Comment:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -25,11 +25,13 @@ class Comment : self.EndPos =3D End=0D self.Type =3D CommentType=0D =0D -## The description of preprocess directives and start & end position=0D +# The description of preprocess directives and start & end position=0D #=0D #=0D -class PP_Directive :=0D - ## The constructor=0D +=0D +=0D +class PP_Directive:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -41,11 +43,13 @@ class PP_Directive : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of assignment expression and start & end position=0D +# The description of assignment expression and start & end position=0D #=0D #=0D -class AssignmentExpression :=0D - ## The constructor=0D +=0D +=0D +class AssignmentExpression:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -59,11 +63,13 @@ class AssignmentExpression : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of predicate expression and start & end position=0D +# The description of predicate expression and start & end position=0D #=0D #=0D -class PredicateExpression :=0D - ## The constructor=0D +=0D +=0D +class PredicateExpression:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -75,11 +81,13 @@ class PredicateExpression : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of function definition and start & end position=0D +# The description of function definition and start & end position=0D #=0D #=0D -class FunctionDefinition :=0D - ## The constructor=0D +=0D +=0D +class FunctionDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -95,11 +103,13 @@ class FunctionDefinition : self.LeftBracePos =3D LBPos=0D self.NamePos =3D NamePos=0D =0D -## The description of variable declaration and start & end position=0D +# The description of variable declaration and start & end position=0D #=0D #=0D -class VariableDeclaration :=0D - ## The constructor=0D +=0D +=0D +class VariableDeclaration:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -112,11 +122,13 @@ class VariableDeclaration : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of enum definition and start & end position=0D +# The description of enum definition and start & end position=0D #=0D #=0D -class EnumerationDefinition :=0D - ## The constructor=0D +=0D +=0D +class EnumerationDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -128,11 +140,13 @@ class EnumerationDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of struct/union definition and start & end position=0D +# The description of struct/union definition and start & end position=0D #=0D #=0D -class StructUnionDefinition :=0D - ## The constructor=0D +=0D +=0D +class StructUnionDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -144,11 +158,13 @@ class StructUnionDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of 'Typedef' definition and start & end position=0D +# The description of 'Typedef' definition and start & end position=0D #=0D #=0D -class TypedefDefinition :=0D - ## The constructor=0D +=0D +=0D +class TypedefDefinition:=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D @@ -161,11 +177,13 @@ class TypedefDefinition : self.StartPos =3D Begin=0D self.EndPos =3D End=0D =0D -## The description of function calling definition and start & end position= =0D +# The description of function calling definition and start & end position= =0D #=0D #=0D +=0D +=0D class FunctionCalling:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D diff --git a/BaseTools/Source/Python/Eot/CodeFragmentCollector.py b/BaseToo= ls/Source/Python/Eot/CodeFragmentCollector.py index a5c1ceeaea32..a9e2d18567a9 100644 --- a/BaseTools/Source/Python/Eot/CodeFragmentCollector.py +++ b/BaseTools/Source/Python/Eot/CodeFragmentCollector.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # preprocess source file=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -30,21 +30,21 @@ from Eot.CodeFragment import PP_Directive from Eot.ParserWarning import Warning=0D =0D =0D -##define T_CHAR_SPACE ' '=0D -##define T_CHAR_NULL '\0'=0D -##define T_CHAR_CR '\r'=0D -##define T_CHAR_TAB '\t'=0D -##define T_CHAR_LF '\n'=0D -##define T_CHAR_SLASH '/'=0D -##define T_CHAR_BACKSLASH '\\'=0D -##define T_CHAR_DOUBLE_QUOTE '\"'=0D -##define T_CHAR_SINGLE_QUOTE '\''=0D -##define T_CHAR_STAR '*'=0D -##define T_CHAR_HASH '#'=0D +# define T_CHAR_SPACE ' '=0D +# define T_CHAR_NULL '\0'=0D +# define T_CHAR_CR '\r'=0D +# define T_CHAR_TAB '\t'=0D +# define T_CHAR_LF '\n'=0D +# define T_CHAR_SLASH '/'=0D +# define T_CHAR_BACKSLASH '\\'=0D +# define T_CHAR_DOUBLE_QUOTE '\"'=0D +# define T_CHAR_SINGLE_QUOTE '\''=0D +# define T_CHAR_STAR '*'=0D +# define T_CHAR_HASH '#'=0D =0D -(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH= , \=0D -T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, T= _CHAR_HASH) =3D \=0D -(' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')=0D +(T_CHAR_SPACE, T_CHAR_NULL, T_CHAR_CR, T_CHAR_TAB, T_CHAR_LF, T_CHAR_SLASH= ,=0D + T_CHAR_BACKSLASH, T_CHAR_DOUBLE_QUOTE, T_CHAR_SINGLE_QUOTE, T_CHAR_STAR, = T_CHAR_HASH) =3D \=0D + (' ', '\0', '\r', '\t', '\n', '/', '\\', '\"', '\'', '*', '#')=0D =0D SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}')=0D =0D @@ -52,15 +52,17 @@ SEPERATOR_TUPLE =3D ('=3D', '|', ',', '{', '}') =0D (T_PP_INCLUDE, T_PP_DEFINE, T_PP_OTHERS) =3D (0, 1, 2)=0D =0D -## The collector for source code fragments.=0D +# The collector for source code fragments.=0D #=0D # PreprocessFile method should be called prior to ParseFile=0D #=0D # GetNext*** procedures mean these procedures will get next token first, t= hen make judgement.=0D # Get*** procedures mean these procedures will make judgement on current t= oken only.=0D #=0D +=0D +=0D class CodeFragmentCollector:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D @@ -75,7 +77,7 @@ class CodeFragmentCollector: self.__Token =3D ""=0D self.__SkippedChars =3D ""=0D =0D - ## __EndOfFile() method=0D + # __EndOfFile() method=0D #=0D # Judge current buffer pos is at file end=0D #=0D @@ -93,7 +95,7 @@ class CodeFragmentCollector: else:=0D return False=0D =0D - ## __EndOfLine() method=0D + # __EndOfLine() method=0D #=0D # Judge current buffer pos is at line end=0D #=0D @@ -102,13 +104,14 @@ class CodeFragmentCollector: # @retval False Current File buffer position is NOT at line en= d=0D #=0D def __EndOfLine(self):=0D - SizeOfCurrentLine =3D len(self.Profile.FileLinesList[self.CurrentL= ineNumber - 1])=0D + SizeOfCurrentLine =3D len(=0D + self.Profile.FileLinesList[self.CurrentLineNumber - 1])=0D if self.CurrentOffsetWithinLine >=3D SizeOfCurrentLine - 1:=0D return True=0D else:=0D return False=0D =0D - ## Rewind() method=0D + # Rewind() method=0D #=0D # Reset file data buffer to the initial state=0D #=0D @@ -118,7 +121,7 @@ class CodeFragmentCollector: self.CurrentLineNumber =3D 1=0D self.CurrentOffsetWithinLine =3D 0=0D =0D - ## __UndoOneChar() method=0D + # __UndoOneChar() method=0D #=0D # Go back one char in the file buffer=0D #=0D @@ -137,7 +140,7 @@ class CodeFragmentCollector: self.CurrentOffsetWithinLine -=3D 1=0D return True=0D =0D - ## __GetOneChar() method=0D + # __GetOneChar() method=0D #=0D # Move forward one char in the file buffer=0D #=0D @@ -145,12 +148,12 @@ class CodeFragmentCollector: #=0D def __GetOneChar(self):=0D if self.CurrentOffsetWithinLine =3D=3D len(self.Profile.FileLinesL= ist[self.CurrentLineNumber - 1]) - 1:=0D - self.CurrentLineNumber +=3D 1=0D - self.CurrentOffsetWithinLine =3D 0=0D + self.CurrentLineNumber +=3D 1=0D + self.CurrentOffsetWithinLine =3D 0=0D else:=0D - self.CurrentOffsetWithinLine +=3D 1=0D + self.CurrentOffsetWithinLine +=3D 1=0D =0D - ## __CurrentChar() method=0D + # __CurrentChar() method=0D #=0D # Get the char pointed to by the file buffer pointer=0D #=0D @@ -158,11 +161,12 @@ class CodeFragmentCollector: # @retval Char Current char=0D #=0D def __CurrentChar(self):=0D - CurrentChar =3D self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine]=0D + CurrentChar =3D self.Profile.FileLinesList[self.CurrentLineNumber = -=0D + 1][self.CurrentOffsetWith= inLine]=0D =0D return CurrentChar=0D =0D - ## __NextChar() method=0D + # __NextChar() method=0D #=0D # Get the one char pass the char pointed to by the file buffer point= er=0D #=0D @@ -175,7 +179,7 @@ class CodeFragmentCollector: else:=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1][= self.CurrentOffsetWithinLine + 1]=0D =0D - ## __SetCurrentCharValue() method=0D + # __SetCurrentCharValue() method=0D #=0D # Modify the value of current char=0D #=0D @@ -183,9 +187,10 @@ class CodeFragmentCollector: # @param Value The new value of current char=0D #=0D def __SetCurrentCharValue(self, Value):=0D - self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.Curren= tOffsetWithinLine] =3D Value=0D + self.Profile.FileLinesList[self.CurrentLineNumber -=0D + 1][self.CurrentOffsetWithinLine] =3D Va= lue=0D =0D - ## __SetCharValue() method=0D + # __SetCharValue() method=0D #=0D # Modify the value of current char=0D #=0D @@ -195,7 +200,7 @@ class CodeFragmentCollector: def __SetCharValue(self, Line, Offset, Value):=0D self.Profile.FileLinesList[Line - 1][Offset] =3D Value=0D =0D - ## __CurrentLine() method=0D + # __CurrentLine() method=0D #=0D # Get the list that contains current line contents=0D #=0D @@ -205,7 +210,7 @@ class CodeFragmentCollector: def __CurrentLine(self):=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1]=0D =0D - ## __InsertComma() method=0D + # __InsertComma() method=0D #=0D # Insert ',' to replace PP=0D #=0D @@ -214,9 +219,9 @@ class CodeFragmentCollector: #=0D def __InsertComma(self, Line):=0D =0D -=0D if self.Profile.FileLinesList[Line - 1][0] !=3D T_CHAR_HASH:=0D - BeforeHashPart =3D str(self.Profile.FileLinesList[Line - 1]).s= plit(T_CHAR_HASH)[0]=0D + BeforeHashPart =3D str(=0D + self.Profile.FileLinesList[Line - 1]).split(T_CHAR_HASH)[0= ]=0D if BeforeHashPart.rstrip().endswith(T_CHAR_COMMA) or BeforeHas= hPart.rstrip().endswith(';'):=0D return=0D =0D @@ -229,9 +234,10 @@ class CodeFragmentCollector: if str(self.Profile.FileLinesList[Line]).lstrip().startswith(',') = or str(self.Profile.FileLinesList[Line]).lstrip().startswith(';'):=0D return=0D =0D - self.Profile.FileLinesList[Line - 1].insert(self.CurrentOffsetWith= inLine, ',')=0D + self.Profile.FileLinesList[Line -=0D + 1].insert(self.CurrentOffsetWithinLine,= ',')=0D =0D - ## PreprocessFileWithClear() method=0D + # PreprocessFileWithClear() method=0D #=0D # Run a preprocess for the file to clean all comments=0D #=0D @@ -249,7 +255,8 @@ class CodeFragmentCollector: InString =3D False=0D InCharLiteral =3D False=0D =0D - self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesListFromFile]=0D + self.Profile.FileLinesList =3D [=0D + list(s) for s in self.Profile.FileLinesListFromFile]=0D while not self.__EndOfFile():=0D =0D if not InComment and self.__CurrentChar() =3D=3D T_CHAR_DOUBLE= _QUOTE:=0D @@ -266,7 +273,8 @@ class CodeFragmentCollector: else:=0D PPExtend =3D False=0D =0D - EndLinePos =3D (self.CurrentLineNumber, self.CurrentOffset= WithinLine)=0D + EndLinePos =3D (self.CurrentLineNumber,=0D + self.CurrentOffsetWithinLine)=0D =0D if InComment and DoubleSlashComment:=0D InComment =3D False=0D @@ -284,7 +292,8 @@ class CodeFragmentCollector: CurrentLine =3D "".join(self.__CurrentLine())=0D if CurrentLine.rstrip(T_CHAR_LF).rstrip(T_CHAR_CR).end= swith(T_CHAR_BACKSLASH):=0D SlashIndex =3D CurrentLine.rindex(T_CHAR_BACKSLASH= )=0D - self.__SetCharValue(self.CurrentLineNumber, SlashI= ndex, T_CHAR_SPACE)=0D + self.__SetCharValue(=0D + self.CurrentLineNumber, SlashIndex, T_CHAR_SPA= CE)=0D =0D self.CurrentLineNumber +=3D 1=0D self.CurrentOffsetWithinLine =3D 0=0D @@ -303,7 +312,8 @@ class CodeFragmentCollector: if self.__CurrentChar() =3D=3D T_CHAR_SLASH and self._= _NextChar() =3D=3D T_CHAR_SLASH:=0D InComment =3D False=0D HashComment =3D False=0D - PPDirectiveObj.EndPos =3D (self.CurrentLineNumber,= self.CurrentOffsetWithinLine - 1)=0D + PPDirectiveObj.EndPos =3D (=0D + self.CurrentLineNumber, self.CurrentOffsetWith= inLine - 1)=0D FileProfile.PPDirectiveList.append(PPDirectiveObj)= =0D PPDirectiveObj =3D None=0D continue=0D @@ -321,13 +331,14 @@ class CodeFragmentCollector: elif self.__CurrentChar() =3D=3D T_CHAR_HASH and not InString = and not InCharLiteral:=0D InComment =3D True=0D HashComment =3D True=0D - PPDirectiveObj =3D PP_Directive('', (self.CurrentLineNumbe= r, self.CurrentOffsetWithinLine), None)=0D + PPDirectiveObj =3D PP_Directive(=0D + '', (self.CurrentLineNumber, self.CurrentOffsetWithinL= ine), None)=0D # check for /* comment start=0D elif self.__CurrentChar() =3D=3D T_CHAR_SLASH and self.__NextC= har() =3D=3D T_CHAR_STAR:=0D =0D - self.__SetCurrentCharValue( T_CHAR_SPACE)=0D + self.__SetCurrentCharValue(T_CHAR_SPACE)=0D self.__GetOneChar()=0D - self.__SetCurrentCharValue( T_CHAR_SPACE)=0D + self.__SetCurrentCharValue(T_CHAR_SPACE)=0D self.__GetOneChar()=0D InComment =3D True=0D else:=0D @@ -340,7 +351,7 @@ class CodeFragmentCollector: FileProfile.PPDirectiveList.append(PPDirectiveObj)=0D self.Rewind()=0D =0D - ## ParseFile() method=0D + # ParseFile() method=0D #=0D # Parse the file profile buffer to extract fd, fv ... information=0D # Exception will be raised if syntax error found=0D @@ -350,7 +361,8 @@ class CodeFragmentCollector: def ParseFile(self):=0D self.PreprocessFileWithClear()=0D # restore from ListOfList to ListOfString=0D - self.Profile.FileLinesList =3D ["".join(list) for list in self.Pro= file.FileLinesList]=0D + self.Profile.FileLinesList =3D [=0D + "".join(list) for list in self.Profile.FileLinesList]=0D FileStringContents =3D ''=0D for fileLine in self.Profile.FileLinesList:=0D FileStringContents +=3D fileLine=0D @@ -360,7 +372,7 @@ class CodeFragmentCollector: parser =3D CParser(tStream)=0D parser.translation_unit()=0D =0D - ## CleanFileProfileBuffer() method=0D + # CleanFileProfileBuffer() method=0D #=0D # Reset all contents of the profile of a file=0D #=0D @@ -375,7 +387,7 @@ class CodeFragmentCollector: FileProfile.TypedefDefinitionList =3D []=0D FileProfile.FunctionCallingList =3D []=0D =0D - ## PrintFragments() method=0D + # PrintFragments() method=0D #=0D # Print the contents of the profile of a file=0D #=0D @@ -387,7 +399,8 @@ class CodeFragmentCollector: print('/************** ASSIGNMENTS *************/')=0D print('/****************************************/')=0D for assign in FileProfile.AssignmentExpressionList:=0D - print(str(assign.StartPos) + assign.Name + assign.Operator + a= ssign.Value)=0D + print(str(assign.StartPos) + assign.Name +=0D + assign.Operator + assign.Value)=0D =0D print('/****************************************/')=0D print('/********* PREPROCESS DIRECTIVES ********/')=0D @@ -399,13 +412,14 @@ class CodeFragmentCollector: print('/********* VARIABLE DECLARATIONS ********/')=0D print('/****************************************/')=0D for var in FileProfile.VariableDeclarationList:=0D - print(str(var.StartPos) + var.Modifier + ' '+ var.Declarator)= =0D + print(str(var.StartPos) + var.Modifier + ' ' + var.Declarator)= =0D =0D print('/****************************************/')=0D print('/********* FUNCTION DEFINITIONS *********/')=0D print('/****************************************/')=0D for func in FileProfile.FunctionDefinitionList:=0D - print(str(func.StartPos) + func.Modifier + ' '+ func.Declarato= r + ' ' + str(func.NamePos))=0D + print(str(func.StartPos) + func.Modifier + ' ' +=0D + func.Declarator + ' ' + str(func.NamePos))=0D =0D print('/****************************************/')=0D print('/************ ENUMERATIONS **************/')=0D @@ -425,6 +439,7 @@ class CodeFragmentCollector: for typedef in FileProfile.TypedefDefinitionList:=0D print(str(typedef.StartPos) + typedef.ToType)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Eot/Database.py b/BaseTools/Source/Pyt= hon/Eot/Database.py index fca08b96bbdf..46d2773272c9 100644 --- a/BaseTools/Source/Python/Eot/Database.py +++ b/BaseTools/Source/Python/Eot/Database.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by EOT tool=0D #=0D # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
        =0D @@ -9,7 +9,8 @@ # Import Modules=0D #=0D import sqlite3=0D -import Common.LongFilePathOs as os, time=0D +import Common.LongFilePathOs as os=0D +import time=0D =0D import Common.EdkLogger as EdkLogger=0D import CommonDataClass.DataClass as DataClass=0D @@ -30,14 +31,16 @@ from Table.TableQuery import TableQuery #=0D DATABASE_PATH =3D "Eot.db"=0D =0D -## Database class=0D +# Database class=0D #=0D # This class defined the EOT database=0D # During the phase of initialization, the database will create all tables = and=0D # insert all records of table DataModel=0D #=0D +=0D +=0D class Database(object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self: The object pointer=0D # @param DbPath: The file path of the database=0D @@ -58,7 +61,7 @@ class Database(object): self.TblQuery =3D None=0D self.TblQuery2 =3D None=0D =0D - ## InitDatabase() method=0D + # InitDatabase() method=0D # 1. Delete all old existing tables=0D # 2. Create new tables=0D # 3. Initialize table DataModel=0D @@ -66,7 +69,7 @@ class Database(object): # @param self: The object pointer=0D # @param NewDatabase: Check if it needs to create a new database=0D #=0D - def InitDatabase(self, NewDatabase =3D True):=0D + def InitDatabase(self, NewDatabase=3DTrue):=0D EdkLogger.verbose("\nInitialize EOT database started ...")=0D #=0D # Drop all old existing tables=0D @@ -74,7 +77,7 @@ class Database(object): if NewDatabase:=0D if os.path.exists(self.DbPath):=0D os.remove(self.DbPath)=0D - self.Conn =3D sqlite3.connect(self.DbPath, isolation_level =3D 'DE= FERRED')=0D + self.Conn =3D sqlite3.connect(self.DbPath, isolation_level=3D'DEFE= RRED')=0D self.Conn.execute("PRAGMA page_size=3D8192")=0D self.Conn.execute("PRAGMA synchronous=3DOFF")=0D # to avoid non-ascii character conversion error=0D @@ -129,7 +132,7 @@ class Database(object): =0D EdkLogger.verbose("Initialize EOT database ... DONE!")=0D =0D - ## QueryTable() method=0D + # QueryTable() method=0D #=0D # Query a table=0D #=0D @@ -139,7 +142,7 @@ class Database(object): def QueryTable(self, Table):=0D Table.Query()=0D =0D - ## Close() method=0D + # Close() method=0D #=0D # Commit all first=0D # Close the connection and cursor=0D @@ -152,7 +155,7 @@ class Database(object): self.Cur.close()=0D self.Conn.close()=0D =0D - ## InsertOneFile() method=0D + # InsertOneFile() method=0D #=0D # Insert one file's information to the database=0D # 1. Create a record in TableFile=0D @@ -167,37 +170,40 @@ class Database(object): #=0D def InsertOneFile(self, File):=0D # Insert a record for file=0D - FileID =3D self.TblFile.Insert(File.Name, File.ExtName, File.Path,= File.FullPath, Model =3D File.Model, TimeStamp =3D File.TimeStamp)=0D + FileID =3D self.TblFile.Insert(=0D + File.Name, File.ExtName, File.Path, File.FullPath, Model=3DFil= e.Model, TimeStamp=3DFile.TimeStamp)=0D IdTable =3D TableIdentifier(self.Cur)=0D IdTable.Table =3D "Identifier%s" % FileID=0D IdTable.Create()=0D =0D # Insert function of file=0D for Function in File.FunctionList:=0D - FunctionID =3D self.TblFunction.Insert(Function.Header, Functi= on.Modifier, Function.Name, Function.ReturnStatement, \=0D - Function.StartLine, Function.StartColu= mn, Function.EndLine, Function.EndColumn, \=0D - Function.BodyStartLine, Function.BodyS= tartColumn, FileID, \=0D - Function.FunNameStartLine, Function.Fu= nNameStartColumn)=0D + FunctionID =3D self.TblFunction.Insert(Function.Header, Functi= on.Modifier, Function.Name, Function.ReturnStatement,=0D + Function.StartLine, Funct= ion.StartColumn, Function.EndLine, Function.EndColumn,=0D + Function.BodyStartLine, F= unction.BodyStartColumn, FileID,=0D + Function.FunNameStartLine= , Function.FunNameStartColumn)=0D =0D # Insert Identifier of function=0D for Identifier in Function.IdentifierList:=0D - IdentifierID =3D IdTable.Insert(Identifier.Modifier, Ident= ifier.Type, Identifier.Name, Identifier.Value, Identifier.Model, \=0D - FileID, FunctionID, Identifier.Sta= rtLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)=0D + IdentifierID =3D IdTable.Insert(Identifier.Modifier, Ident= ifier.Type, Identifier.Name, Identifier.Value, Identifier.Model,=0D + FileID, FunctionID, Identifi= er.StartLine, Identifier.StartColumn, Identifier.EndLine, Identifier.EndCol= umn)=0D # Insert Identifier of file=0D for Identifier in File.IdentifierList:=0D - IdentifierID =3D IdTable.Insert(Identifier.Modifier, Identifie= r.Type, Identifier.Name, Identifier.Value, Identifier.Model, \=0D - FileID, -1, Identifier.StartLine, Iden= tifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)=0D + IdentifierID =3D IdTable.Insert(Identifier.Modifier, Identifie= r.Type, Identifier.Name, Identifier.Value, Identifier.Model,=0D + FileID, -1, Identifier.StartLine= , Identifier.StartColumn, Identifier.EndLine, Identifier.EndColumn)=0D =0D - EdkLogger.verbose("Insert information from file %s ... DONE!" % Fi= le.FullPath)=0D + EdkLogger.verbose(=0D + "Insert information from file %s ... DONE!" % File.FullPath)=0D =0D - ## UpdateIdentifierBelongsToFunction() method=0D + # UpdateIdentifierBelongsToFunction() method=0D #=0D # Update the field "BelongsToFunction" for each Identifier=0D #=0D # @param self: The object pointer=0D #=0D def UpdateIdentifierBelongsToFunction(self):=0D - EdkLogger.verbose("Update 'BelongsToFunction' for Identifiers star= ted ...")=0D + EdkLogger.verbose(=0D + "Update 'BelongsToFunction' for Identifiers started ...")=0D =0D SqlCommand =3D """select ID, BelongsToFile, StartLine, EndLine fro= m Function"""=0D Records =3D self.TblFunction.Exec(SqlCommand)=0D @@ -210,11 +216,12 @@ class Database(object): EndLine =3D Record[3]=0D =0D SqlCommand =3D """Update Identifier%s set BelongsToFunction = =3D %s where BelongsToFile =3D %s and StartLine > %s and EndLine < %s""" % = \=0D - (BelongsToFile, FunctionID, BelongsToFile, StartLi= ne, EndLine)=0D + (BelongsToFile, FunctionID, BelongsToFile, StartLine, EndL= ine)=0D self.TblIdentifier.Exec(SqlCommand)=0D =0D SqlCommand =3D """Update Identifier%s set BelongsToFunction = =3D %s, Model =3D %s where BelongsToFile =3D %s and Model =3D %s and EndLin= e =3D %s""" % \=0D - (BelongsToFile, FunctionID, DataClass.MODEL_IDENT= IFIER_FUNCTION_HEADER, BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMENT, S= tartLine - 1)=0D + (BelongsToFile, FunctionID, DataClass.MODEL_IDENT= IFIER_FUNCTION_HEADER,=0D + BelongsToFile, DataClass.MODEL_IDENTIFIER_COMMEN= T, StartLine - 1)=0D self.TblIdentifier.Exec(SqlCommand)=0D =0D =0D @@ -226,18 +233,25 @@ class Database(object): if __name__ =3D=3D '__main__':=0D EdkLogger.Initialize()=0D EdkLogger.SetLevel(EdkLogger.DEBUG_0)=0D - EdkLogger.verbose("Start at " + time.strftime('%H:%M:%S', time.localti= me()))=0D + EdkLogger.verbose(=0D + "Start at " + time.strftime('%H:%M:%S', time.localtime()))=0D =0D Db =3D Database(DATABASE_PATH)=0D Db.InitDatabase()=0D Db.QueryTable(Db.TblDataModel)=0D =0D - identifier1 =3D DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa', D= ataClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 32, 43, 54, 43)=0D - identifier2 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', Dat= aClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 15, 43, 20, 43)=0D - identifier3 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa', Dat= aClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 55, 43, 58, 43)=0D - identifier4 =3D DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa', Da= taClass.MODEL_IDENTIFIER_COMMENT, 1, -1, 77, 43, 88, 43)=0D - fun1 =3D DataClass.FunctionClass(-1, '', '', 'fun1', '', 21, 2, 60, 4= 5, 1, 23, 0, [], [])=0D - file =3D DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', Data= Class.MODEL_FILE_C, '2007-12-28', [fun1], [identifier1, identifier2, identi= fier3, identifier4], [])=0D + identifier1 =3D DataClass.IdentifierClass(-1, '', '', "i''1", 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 32, 43, 54, 43)=0D + identifier2 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 15, 43, 20, 43)=0D + identifier3 =3D DataClass.IdentifierClass(-1, '', '', 'i1', 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 55, 43, 58, 43)=0D + identifier4 =3D DataClass.IdentifierClass(-1, '', '', "i1'", 'aaa',=0D + DataClass.MODEL_IDENTIFIER_COM= MENT, 1, -1, 77, 43, 88, 43)=0D + fun1 =3D DataClass.FunctionClass(-1, '', '',=0D + 'fun1', '', 21, 2, 60, 45, 1, 23, 0, [= ], [])=0D + file =3D DataClass.FileClass(-1, 'F1', 'c', 'C:\\', 'C:\\F1.exe', Data= Class.MODEL_FILE_C,=0D + '2007-12-28', [fun1], [identifier1, identif= ier2, identifier3, identifier4], [])=0D Db.InsertOneFile(file)=0D =0D Db.QueryTable(Db.TblFile)=0D @@ -246,4 +260,3 @@ if __name__ =3D=3D '__main__': =0D Db.Close()=0D EdkLogger.verbose("End at " + time.strftime('%H:%M:%S', time.localtime= ()))=0D -=0D diff --git a/BaseTools/Source/Python/Eot/EotGlobalData.py b/BaseTools/Sourc= e/Python/Eot/EotGlobalData.py index 3218f86f441c..be9783707d61 100644 --- a/BaseTools/Source/Python/Eot/EotGlobalData.py +++ b/BaseTools/Source/Python/Eot/EotGlobalData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to save global datas=0D #=0D # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
        =0D @@ -44,7 +44,8 @@ gOP_UN_DISPATCHED =3D open(gUN_DISPATCHED_LOG, 'w+') =0D # Log file for unmatched variables in function calling=0D gUN_MATCHED_IN_LIBRARY_CALLING_LOG =3D 'Log_UnMatchedInLibraryCalling.log'= =0D -gOP_UN_MATCHED_IN_LIBRARY_CALLING =3D open(gUN_MATCHED_IN_LIBRARY_CALLING_= LOG, 'w+')=0D +gOP_UN_MATCHED_IN_LIBRARY_CALLING =3D open(=0D + gUN_MATCHED_IN_LIBRARY_CALLING_LOG, 'w+')=0D =0D # Log file for order of dispatched PEIM/DRIVER=0D gDISPATCH_ORDER_LOG =3D 'Log_DispatchOrder.log'=0D diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Pyth= on/Eot/EotMain.py index 791fcdfeaed8..f9989bc3de54 100644 --- a/BaseTools/Source/Python/Eot/EotMain.py +++ b/BaseTools/Source/Python/Eot/EotMain.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to be the main entrance of EOT tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -9,7 +9,9 @@ # Import Modules=0D #=0D from __future__ import absolute_import=0D -import Common.LongFilePathOs as os, time, glob=0D +import Common.LongFilePathOs as os=0D +import time=0D +import glob=0D import Common.EdkLogger as EdkLogger=0D import Eot.EotGlobalData as EotGlobalData=0D from optparse import OptionParser=0D @@ -36,6 +38,7 @@ from GenFds.AprioriSection import DXE_APRIORI_GUID, PEI_A= PRIORI_GUID gGuidStringFormat =3D "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X"=0D gIndention =3D -4=0D =0D +=0D class Image(array):=0D _HEADER_ =3D struct.Struct("")=0D _HEADER_SIZE_ =3D _HEADER_.size=0D @@ -52,7 +55,7 @@ class Image(array): self._LEN_ =3D None=0D self._OFF_ =3D None=0D =0D - self._SubImages =3D sdict() # {offset: Image()}=0D + self._SubImages =3D sdict() # {offset: Image()}=0D =0D array.__init__(self)=0D =0D @@ -66,7 +69,7 @@ class Image(array): return Len=0D =0D def _Unpack(self):=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._LEN_])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + self._LEN_])=0D return len(self)=0D =0D def _Pack(self, PadByte=3D0xFF):=0D @@ -106,18 +109,20 @@ class Image(array): =0D Data =3D property(_GetData, _SetData)=0D =0D -## CompressedImage() class=0D +# CompressedImage() class=0D #=0D # A class for Compressed Image=0D #=0D +=0D +=0D class CompressedImage(Image):=0D # UncompressedLength =3D 4-byte=0D # CompressionType =3D 1-byte=0D _HEADER_ =3D struct.Struct("1I 1B")=0D _HEADER_SIZE_ =3D _HEADER_.size=0D =0D - _ORIG_SIZE_ =3D struct.Struct("1I")=0D - _CMPRS_TYPE_ =3D struct.Struct("4x 1B")=0D + _ORIG_SIZE_ =3D struct.Struct("1I")=0D + _CMPRS_TYPE_ =3D struct.Struct("4x 1B")=0D =0D def __init__(self, CompressedData=3DNone, CompressionType=3DNone, Unco= mpressedLength=3DNone):=0D Image.__init__(self)=0D @@ -130,7 +135,8 @@ class CompressedImage(Image): =0D def __str__(self):=0D global gIndention=0D - S =3D "algorithm=3D%s uncompressed=3D%x" % (self.CompressionType, = self.UncompressedLength)=0D + S =3D "algorithm=3D%s uncompressed=3D%x" % (=0D + self.CompressionType, self.UncompressedLength)=0D for Sec in self.Sections:=0D S +=3D '\n' + str(Sec)=0D =0D @@ -175,10 +181,12 @@ class CompressedImage(Image): CompressionType =3D property(_GetCompressionType, _SetCompressionType)= =0D Sections =3D property(_GetSections)=0D =0D -## Ui() class=0D +# Ui() class=0D #=0D # A class for Ui=0D #=0D +=0D +=0D class Ui(Image):=0D _HEADER_ =3D struct.Struct("")=0D _HEADER_SIZE_ =3D 0=0D @@ -192,7 +200,7 @@ class Ui(Image): def _Unpack(self):=0D # keep header in this Image object=0D self.empty()=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._LEN_])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + self._LEN_])=0D return len(self)=0D =0D def _GetUiString(self):=0D @@ -200,42 +208,44 @@ class Ui(Image): =0D String =3D property(_GetUiString)=0D =0D -## Depex() class=0D +# Depex() class=0D #=0D # A class for Depex=0D #=0D +=0D +=0D class Depex(Image):=0D _HEADER_ =3D struct.Struct("")=0D _HEADER_SIZE_ =3D 0=0D =0D - _GUID_ =3D struct.Struct("1I2H8B")=0D - _OPCODE_ =3D struct.Struct("1B")=0D + _GUID_ =3D struct.Struct("1I2H8B")=0D + _OPCODE_ =3D struct.Struct("1B")=0D =0D _OPCODE_STRING_ =3D {=0D - 0x00 : "BEFORE",=0D - 0x01 : "AFTER",=0D - 0x02 : "PUSH",=0D - 0x03 : "AND",=0D - 0x04 : "OR",=0D - 0x05 : "NOT",=0D - 0x06 : "TRUE",=0D - 0x07 : "FALSE",=0D - 0x08 : "END",=0D - 0x09 : "SOR"=0D + 0x00: "BEFORE",=0D + 0x01: "AFTER",=0D + 0x02: "PUSH",=0D + 0x03: "AND",=0D + 0x04: "OR",=0D + 0x05: "NOT",=0D + 0x06: "TRUE",=0D + 0x07: "FALSE",=0D + 0x08: "END",=0D + 0x09: "SOR"=0D }=0D =0D _NEXT_ =3D {=0D - -1 : _OPCODE_, # first one in depex must be an opcdoe=0D - 0x00 : _GUID_, #"BEFORE",=0D - 0x01 : _GUID_, #"AFTER",=0D - 0x02 : _GUID_, #"PUSH",=0D - 0x03 : _OPCODE_, #"AND",=0D - 0x04 : _OPCODE_, #"OR",=0D - 0x05 : _OPCODE_, #"NOT",=0D - 0x06 : _OPCODE_, #"TRUE",=0D - 0x07 : _OPCODE_, #"FALSE",=0D - 0x08 : None, #"END",=0D - 0x09 : _OPCODE_, #"SOR"=0D + -1: _OPCODE_, # first one in depex must be an opcdoe=0D + 0x00: _GUID_, # "BEFORE",=0D + 0x01: _GUID_, # "AFTER",=0D + 0x02: _GUID_, # "PUSH",=0D + 0x03: _OPCODE_, # "AND",=0D + 0x04: _OPCODE_, # "OR",=0D + 0x05: _OPCODE_, # "NOT",=0D + 0x06: _OPCODE_, # "TRUE",=0D + 0x07: _OPCODE_, # "FALSE",=0D + 0x08: None, # "END",=0D + 0x09: _OPCODE_, # "SOR"=0D }=0D =0D def __init__(self):=0D @@ -260,7 +270,7 @@ class Depex(Image): def _Unpack(self):=0D # keep header in this Image object=0D self.empty()=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._LEN_])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + self._LEN_])=0D return len(self)=0D =0D def _GetExpression(self):=0D @@ -289,6 +299,8 @@ class Depex(Image): #=0D # A class for Firmware Volume=0D #=0D +=0D +=0D class FirmwareVolume(Image):=0D # Read FvLength, Attributes, HeaderLength, Checksum=0D _HEADER_ =3D struct.Struct("16x 1I2H8B 1Q 4x 1I 1H 1H")=0D @@ -351,11 +363,15 @@ class FirmwareVolume(Image): DepexList.append(Guid)=0D continue=0D elif Item =3D=3D 0x03 or Item =3D=3D 0x04:=0D - DepexStack.append(eval(str(DepexStack.pop()) + ' ' + Depex= ._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop())))=0D - DepexList.append(str(DepexList.pop()) + ' ' + Depex._OPCOD= E_STRING_[Item].upper() + ' ' + str(DepexList.pop()))=0D + DepexStack.append(eval(str(DepexStack.pop(=0D + )) + ' ' + Depex._OPCODE_STRING_[Item].lower() + ' ' + str= (DepexStack.pop())))=0D + DepexList.append(str(DepexList.pop(=0D + )) + ' ' + Depex._OPCODE_STRING_[Item].upper() + ' ' + str= (DepexList.pop()))=0D elif Item =3D=3D 0x05:=0D - DepexStack.append(eval(Depex._OPCODE_STRING_[Item].lower()= + ' ' + str(DepexStack.pop())))=0D - DepexList.append(Depex._OPCODE_STRING_[Item].lower() + ' '= + str(DepexList.pop()))=0D + DepexStack.append(=0D + eval(Depex._OPCODE_STRING_[Item].lower() + ' ' + str(D= epexStack.pop())))=0D + DepexList.append(Depex._OPCODE_STRING_[=0D + Item].lower() + ' ' + str(DepexList.pop()= ))=0D elif Item =3D=3D 0x06:=0D DepexStack.append(True)=0D DepexList.append('TRUE')=0D @@ -405,12 +421,14 @@ class FirmwareVolume(Image): =0D # Parse SEC_CORE first=0D if FfsSecCoreGuid is not None:=0D - self.OrderedFfsDict[FfsSecCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(FfsSecCoreGuid)=0D + self.OrderedFfsDict[FfsSecCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(=0D + FfsSecCoreGuid)=0D self.LoadPpi(Db, FfsSecCoreGuid)=0D =0D # Parse PEI first=0D if FfsPeiCoreGuid is not None:=0D - self.OrderedFfsDict[FfsPeiCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(FfsPeiCoreGuid)=0D + self.OrderedFfsDict[FfsPeiCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(=0D + FfsPeiCoreGuid)=0D self.LoadPpi(Db, FfsPeiCoreGuid)=0D if FfsPeiPrioriGuid is not None:=0D # Load PEIM described in priori file=0D @@ -421,18 +439,21 @@ class FirmwareVolume(Image): GuidStruct =3D struct.Struct('1I2H8B')=0D Start =3D 4=0D while len(Section) > Start:=0D - Guid =3D GuidStruct.unpack_from(Section[Start = : Start + 16])=0D + Guid =3D GuidStruct.unpack_from(=0D + Section[Start: Start + 16])=0D GuidString =3D gGuidStringFormat % Guid=0D Start =3D Start + 16=0D if GuidString in self.UnDispatchedFfsDict:=0D - self.OrderedFfsDict[GuidString] =3D self.U= nDispatchedFfsDict.pop(GuidString)=0D + self.OrderedFfsDict[GuidString] =3D self.U= nDispatchedFfsDict.pop(=0D + GuidString)=0D self.LoadPpi(Db, GuidString)=0D =0D self.DisPatchPei(Db)=0D =0D # Parse DXE then=0D if FfsDxeCoreGuid is not None:=0D - self.OrderedFfsDict[FfsDxeCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(FfsDxeCoreGuid)=0D + self.OrderedFfsDict[FfsDxeCoreGuid] =3D self.UnDispatchedFfsDi= ct.pop(=0D + FfsDxeCoreGuid)=0D self.LoadProtocol(Db, FfsDxeCoreGuid)=0D if FfsDxePrioriGuid is not None:=0D # Load PEIM described in priori file=0D @@ -443,11 +464,13 @@ class FirmwareVolume(Image): GuidStruct =3D struct.Struct('1I2H8B')=0D Start =3D 4=0D while len(Section) > Start:=0D - Guid =3D GuidStruct.unpack_from(Section[Start = : Start + 16])=0D + Guid =3D GuidStruct.unpack_from(=0D + Section[Start: Start + 16])=0D GuidString =3D gGuidStringFormat % Guid=0D Start =3D Start + 16=0D if GuidString in self.UnDispatchedFfsDict:=0D - self.OrderedFfsDict[GuidString] =3D self.U= nDispatchedFfsDict.pop(GuidString)=0D + self.OrderedFfsDict[GuidString] =3D self.U= nDispatchedFfsDict.pop(=0D + GuidString)=0D self.LoadProtocol(Db, GuidString)=0D =0D self.DisPatchDxe(Db)=0D @@ -503,21 +526,24 @@ class FirmwareVolume(Image): # Find Depex=0D if Section.Type =3D=3D 0x13:=0D IsFoundDepex =3D True=0D - CouldBeLoaded, DepexString, FileDepex =3D self.Par= seDepex(Section._SubImages[4], 'Protocol')=0D + CouldBeLoaded, DepexString, FileDepex =3D self.Par= seDepex(=0D + Section._SubImages[4], 'Protocol')=0D break=0D if Section.Type =3D=3D 0x01:=0D CompressSections =3D Section._SubImages[4]=0D for CompressSection in CompressSections.Sections:= =0D if CompressSection.Type =3D=3D 0x13:=0D IsFoundDepex =3D True=0D - CouldBeLoaded, DepexString, FileDepex =3D = self.ParseDepex(CompressSection._SubImages[4], 'Protocol')=0D + CouldBeLoaded, DepexString, FileDepex =3D = self.ParseDepex(=0D + CompressSection._SubImages[4], 'Protoc= ol')=0D break=0D if CompressSection.Type =3D=3D 0x02:=0D NewSections =3D CompressSection._SubImages= [4]=0D for NewSection in NewSections.Sections:=0D if NewSection.Type =3D=3D 0x13:=0D IsFoundDepex =3D True=0D - CouldBeLoaded, DepexString, FileDe= pex =3D self.ParseDepex(NewSection._SubImages[4], 'Protocol')=0D + CouldBeLoaded, DepexString, FileDe= pex =3D self.ParseDepex(=0D + NewSection._SubImages[4], 'Pro= tocol')=0D break=0D =0D # Not find Depex=0D @@ -532,7 +558,8 @@ class FirmwareVolume(Image): NewFfs =3D self.UnDispatchedFfsDict.pop(FfsID)=0D NewFfs.Depex =3D DepexString=0D if FileDepex is not None:=0D - ScheduleList.insert(FileDepex[1], FfsID, NewFfs, F= ileDepex[0])=0D + ScheduleList.insert(=0D + FileDepex[1], FfsID, NewFfs, FileDepex[0])=0D else:=0D ScheduleList[FfsID] =3D NewFfs=0D else:=0D @@ -565,19 +592,22 @@ class FirmwareVolume(Image): # Get Depex=0D for Section in Ffs.Sections.values():=0D if Section.Type =3D=3D 0x1B:=0D - CouldBeLoaded, DepexString, FileDepex =3D self.Par= seDepex(Section._SubImages[4], 'Ppi')=0D + CouldBeLoaded, DepexString, FileDepex =3D self.Par= seDepex(=0D + Section._SubImages[4], 'Ppi')=0D break=0D if Section.Type =3D=3D 0x01:=0D CompressSections =3D Section._SubImages[4]=0D for CompressSection in CompressSections.Sections:= =0D if CompressSection.Type =3D=3D 0x1B:=0D - CouldBeLoaded, DepexString, FileDepex =3D = self.ParseDepex(CompressSection._SubImages[4], 'Ppi')=0D + CouldBeLoaded, DepexString, FileDepex =3D = self.ParseDepex(=0D + CompressSection._SubImages[4], 'Ppi')= =0D break=0D if CompressSection.Type =3D=3D 0x02:=0D NewSections =3D CompressSection._SubImages= [4]=0D for NewSection in NewSections.Sections:=0D if NewSection.Type =3D=3D 0x1B:=0D - CouldBeLoaded, DepexString, FileDe= pex =3D self.ParseDepex(NewSection._SubImages[4], 'Ppi')=0D + CouldBeLoaded, DepexString, FileDe= pex =3D self.ParseDepex(=0D + NewSection._SubImages[4], 'Ppi= ')=0D break=0D =0D # Append New Ffs=0D @@ -593,13 +623,14 @@ class FirmwareVolume(Image): if IsInstalled:=0D self.DisPatchPei(Db)=0D =0D -=0D def __str__(self):=0D global gIndention=0D gIndention +=3D 4=0D FvInfo =3D '\n' + ' ' * gIndention=0D - FvInfo +=3D "[FV:%s] file_system=3D%s size=3D%x checksum=3D%s\n" %= (self.Name, self.FileSystemGuid, self.Size, self.Checksum)=0D - FfsInfo =3D "\n".join([str(self.FfsDict[FfsId]) for FfsId in self.= FfsDict])=0D + FvInfo +=3D "[FV:%s] file_system=3D%s size=3D%x checksum=3D%s\n" %= (=0D + self.Name, self.FileSystemGuid, self.Size, self.Checksum)=0D + FfsInfo =3D "\n".join([str(self.FfsDict[FfsId])=0D + for FfsId in self.FfsDict])=0D gIndention -=3D 4=0D return FvInfo + FfsInfo=0D =0D @@ -617,18 +648,20 @@ class FirmwareVolume(Image): FfsObj.frombuffer(self, FfsStartAddress)=0D FfsId =3D repr(FfsObj)=0D if ((self.Attributes & 0x00000800) !=3D 0 and len(FfsObj) =3D= =3D 0xFFFFFF) \=0D - or ((self.Attributes & 0x00000800) =3D=3D 0 and len(FfsObj= ) =3D=3D 0):=0D + or ((self.Attributes & 0x00000800) =3D=3D 0 and len(Ff= sObj) =3D=3D 0):=0D if LastFfsObj is not None:=0D - LastFfsObj.FreeSpace =3D EndOfFv - LastFfsObj._OFF_ - = len(LastFfsObj)=0D + LastFfsObj.FreeSpace =3D EndOfFv - \=0D + LastFfsObj._OFF_ - len(LastFfsObj)=0D else:=0D if FfsId in self.FfsDict:=0D EdkLogger.error("FV", 0, "Duplicate GUID in FFS",=0D - ExtraData=3D"\t%s @ %s\n\t%s @ %s" \=0D + ExtraData=3D"\t%s @ %s\n\t%s @ %s"=0D % (FfsObj.Guid, FfsObj.Offset,=0D self.FfsDict[FfsId].Guid, self.FfsD= ict[FfsId].Offset))=0D self.FfsDict[FfsId] =3D FfsObj=0D if LastFfsObj is not None:=0D - LastFfsObj.FreeSpace =3D FfsStartAddress - LastFfsObj.= _OFF_ - len(LastFfsObj)=0D + LastFfsObj.FreeSpace =3D FfsStartAddress - \=0D + LastFfsObj._OFF_ - len(LastFfsObj)=0D =0D FfsStartAddress +=3D len(FfsObj)=0D #=0D @@ -659,21 +692,23 @@ class FirmwareVolume(Image): HeaderSize =3D property(_GetHeaderLength)=0D FileSystemGuid =3D property(_GetFileSystemGuid)=0D =0D -## GuidDefinedImage() class=0D +# GuidDefinedImage() class=0D #=0D # A class for GUID Defined Image=0D #=0D +=0D +=0D class GuidDefinedImage(Image):=0D _HEADER_ =3D struct.Struct("1I2H8B 1H 1H")=0D _HEADER_SIZE_ =3D _HEADER_.size=0D =0D - _GUID_ =3D struct.Struct("1I2H8B")=0D - _DATA_OFFSET_ =3D struct.Struct("16x 1H")=0D - _ATTR_ =3D struct.Struct("18x 1H")=0D + _GUID_ =3D struct.Struct("1I2H8B")=0D + _DATA_OFFSET_ =3D struct.Struct("16x 1H")=0D + _ATTR_ =3D struct.Struct("18x 1H")=0D =0D - CRC32_GUID =3D "FC1BCDB0-7D31-49AA-936A-A4600D9DD083"=0D + CRC32_GUID =3D "FC1BCDB0-7D31-49AA-936A-A4600D9DD083"=0D TIANO_COMPRESS_GUID =3D 'A31280AD-481E-41B6-95E8-127F4C984779'=0D - LZMA_COMPRESS_GUID =3D 'EE4E5898-3914-4259-9D6E-DC7BD79403CF'=0D + LZMA_COMPRESS_GUID =3D 'EE4E5898-3914-4259-9D6E-DC7BD79403CF'=0D =0D def __init__(self, SectionDefinitionGuid=3DNone, DataOffset=3DNone, At= tributes=3DNone, Data=3DNone):=0D Image.__init__(self)=0D @@ -695,7 +730,7 @@ class GuidDefinedImage(Image): def _Unpack(self):=0D # keep header in this Image object=0D self.empty()=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._LEN_])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + self._LEN_])=0D return len(self)=0D =0D def _SetAttribute(self, Attribute):=0D @@ -781,35 +816,37 @@ class GuidDefinedImage(Image): DataOffset =3D property(_GetDataOffset, _SetDataOffset)=0D Sections =3D property(_GetSections)=0D =0D -## Section() class=0D +# Section() class=0D #=0D # A class for Section=0D #=0D +=0D +=0D class Section(Image):=0D _TypeName =3D {=0D - 0x00 : "",=0D - 0x01 : "COMPRESSION",=0D - 0x02 : "GUID_DEFINED",=0D - 0x10 : "PE32",=0D - 0x11 : "PIC",=0D - 0x12 : "TE",=0D - 0x13 : "DXE_DEPEX",=0D - 0x14 : "VERSION",=0D - 0x15 : "USER_INTERFACE",=0D - 0x16 : "COMPATIBILITY16",=0D - 0x17 : "FIRMWARE_VOLUME_IMAGE",=0D - 0x18 : "FREEFORM_SUBTYPE_GUID",=0D - 0x19 : "RAW",=0D - 0x1B : "PEI_DEPEX"=0D + 0x00: "",=0D + 0x01: "COMPRESSION",=0D + 0x02: "GUID_DEFINED",=0D + 0x10: "PE32",=0D + 0x11: "PIC",=0D + 0x12: "TE",=0D + 0x13: "DXE_DEPEX",=0D + 0x14: "VERSION",=0D + 0x15: "USER_INTERFACE",=0D + 0x16: "COMPATIBILITY16",=0D + 0x17: "FIRMWARE_VOLUME_IMAGE",=0D + 0x18: "FREEFORM_SUBTYPE_GUID",=0D + 0x19: "RAW",=0D + 0x1B: "PEI_DEPEX"=0D }=0D =0D _SectionSubImages =3D {=0D - 0x01 : CompressedImage,=0D - 0x02 : GuidDefinedImage,=0D - 0x17 : FirmwareVolume,=0D - 0x13 : Depex,=0D - 0x1B : Depex,=0D - 0x15 : Ui=0D + 0x01: CompressedImage,=0D + 0x02: GuidDefinedImage,=0D + 0x17: FirmwareVolume,=0D + 0x13: Depex,=0D + 0x1B: Depex,=0D + 0x15: Ui=0D }=0D =0D # Size =3D 3-byte=0D @@ -819,8 +856,8 @@ class Section(Image): =0D # SubTypeGuid=0D # _FREE_FORM_SUBTYPE_GUID_HEADER_ =3D struct.Struct("1I2H8B")=0D - _SIZE_ =3D struct.Struct("3B")=0D - _TYPE_ =3D struct.Struct("3x 1B")=0D + _SIZE_ =3D struct.Struct("3B")=0D + _TYPE_ =3D struct.Struct("3x 1B")=0D =0D def __init__(self, Type=3DNone, Size=3DNone):=0D Image.__init__(self)=0D @@ -835,9 +872,11 @@ class Section(Image): gIndention +=3D 4=0D SectionInfo =3D ' ' * gIndention=0D if self.Type in self._TypeName:=0D - SectionInfo +=3D "[SECTION:%s] offset=3D%x size=3D%x" % (self.= _TypeName[self.Type], self._OFF_, self.Size)=0D + SectionInfo +=3D "[SECTION:%s] offset=3D%x size=3D%x" % (=0D + self._TypeName[self.Type], self._OFF_, self.Size)=0D else:=0D - SectionInfo +=3D "[SECTION:%x] offset=3D%x size=3D%x = " % (self.Type, self._OFF_, self.Size)=0D + SectionInfo +=3D "[SECTION:%x] offset=3D%x size=3D%x = " % (=0D + self.Type, self._OFF_, self.Size)=0D for Offset in self._SubImages.keys():=0D SectionInfo +=3D ", " + str(self._SubImages[Offset])=0D gIndention -=3D 4=0D @@ -851,10 +890,11 @@ class Section(Image): =0D if Type not in self._SectionSubImages:=0D # no need to extract sub-image, keep all in this Image object= =0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + Size])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + Size])=0D else:=0D # keep header in this Image object=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._HEADER_= SIZE_])=0D + self.extend(=0D + self._BUF_[self._OFF_: self._OFF_ + self._HEADER_SIZE_])=0D #=0D # use new Image object to represent payload, which may be anot= her kind=0D # of image such as PE32=0D @@ -862,7 +902,8 @@ class Section(Image): PayloadOffset =3D self._HEADER_SIZE_=0D PayloadLen =3D self.Size - self._HEADER_SIZE_=0D Payload =3D self._SectionSubImages[self.Type]()=0D - Payload.frombuffer(self._BUF_, self._OFF_ + self._HEADER_SIZE_= , PayloadLen)=0D + Payload.frombuffer(self._BUF_, self._OFF_ +=0D + self._HEADER_SIZE_, PayloadLen)=0D self._SubImages[PayloadOffset] =3D Payload=0D =0D return Size=0D @@ -907,51 +948,53 @@ class Section(Image): Size =3D property(_GetSize, _SetSize)=0D Alignment =3D property(_GetAlignment, _SetAlignment)=0D =0D -## Ffs() class=0D +# Ffs() class=0D #=0D # A class for Ffs Section=0D #=0D +=0D +=0D class Ffs(Image):=0D _FfsFormat =3D "24B%(payload_size)sB"=0D # skip IntegrityCheck=0D _HEADER_ =3D struct.Struct("1I2H8B 2x 1B 1B 3B 1B")=0D _HEADER_SIZE_ =3D _HEADER_.size=0D =0D - _NAME_ =3D struct.Struct("1I2H8B")=0D + _NAME_ =3D struct.Struct("1I2H8B")=0D _INT_CHECK_ =3D struct.Struct("16x 1H")=0D - _TYPE_ =3D struct.Struct("18x 1B")=0D - _ATTR_ =3D struct.Struct("19x 1B")=0D - _SIZE_ =3D struct.Struct("20x 3B")=0D - _STATE_ =3D struct.Struct("23x 1B")=0D + _TYPE_ =3D struct.Struct("18x 1B")=0D + _ATTR_ =3D struct.Struct("19x 1B")=0D + _SIZE_ =3D struct.Struct("20x 3B")=0D + _STATE_ =3D struct.Struct("23x 1B")=0D =0D - FFS_ATTRIB_FIXED =3D 0x04=0D - FFS_ATTRIB_DATA_ALIGNMENT =3D 0x38=0D - FFS_ATTRIB_CHECKSUM =3D 0x40=0D + FFS_ATTRIB_FIXED =3D 0x04=0D + FFS_ATTRIB_DATA_ALIGNMENT =3D 0x38=0D + FFS_ATTRIB_CHECKSUM =3D 0x40=0D =0D _TypeName =3D {=0D - 0x00 : "",=0D - 0x01 : "RAW",=0D - 0x02 : "FREEFORM",=0D - 0x03 : "SECURITY_CORE",=0D - 0x04 : "PEI_CORE",=0D - 0x05 : "DXE_CORE",=0D - 0x06 : "PEIM",=0D - 0x07 : "DRIVER",=0D - 0x08 : "COMBINED_PEIM_DRIVER",=0D - 0x09 : "APPLICATION",=0D - 0x0A : "SMM",=0D - 0x0B : "FIRMWARE_VOLUME_IMAGE",=0D - 0x0C : "COMBINED_SMM_DXE",=0D - 0x0D : "SMM_CORE",=0D - 0x0E : "MM_STANDALONE",=0D - 0x0F : "MM_CORE_STANDALONE",=0D - 0xc0 : "OEM_MIN",=0D - 0xdf : "OEM_MAX",=0D - 0xe0 : "DEBUG_MIN",=0D - 0xef : "DEBUG_MAX",=0D - 0xf0 : "FFS_MIN",=0D - 0xff : "FFS_MAX",=0D - 0xf0 : "FFS_PAD",=0D + 0x00: "",=0D + 0x01: "RAW",=0D + 0x02: "FREEFORM",=0D + 0x03: "SECURITY_CORE",=0D + 0x04: "PEI_CORE",=0D + 0x05: "DXE_CORE",=0D + 0x06: "PEIM",=0D + 0x07: "DRIVER",=0D + 0x08: "COMBINED_PEIM_DRIVER",=0D + 0x09: "APPLICATION",=0D + 0x0A: "SMM",=0D + 0x0B: "FIRMWARE_VOLUME_IMAGE",=0D + 0x0C: "COMBINED_SMM_DXE",=0D + 0x0D: "SMM_CORE",=0D + 0x0E: "MM_STANDALONE",=0D + 0x0F: "MM_CORE_STANDALONE",=0D + 0xc0: "OEM_MIN",=0D + 0xdf: "OEM_MAX",=0D + 0xe0: "DEBUG_MIN",=0D + 0xef: "DEBUG_MAX",=0D + 0xf0: "FFS_MIN",=0D + 0xff: "FFS_MAX",=0D + 0xf0: "FFS_PAD",=0D }=0D =0D def __init__(self):=0D @@ -968,9 +1011,11 @@ class Ffs(Image): gIndention +=3D 4=0D Indention =3D ' ' * gIndention=0D FfsInfo =3D Indention=0D - FfsInfo +=3D "[FFS:%s] offset=3D%x size=3D%x guid=3D%s free_space= =3D%x alignment=3D%s\n" % \=0D - (Ffs._TypeName[self.Type], self._OFF_, self.Size, self= .Guid, self.FreeSpace, self.Alignment)=0D - SectionInfo =3D '\n'.join([str(self.Sections[Offset]) for Offset i= n self.Sections.keys()])=0D + FfsInfo +=3D "[FFS:%s] offset=3D%x size=3D%x guid=3D%s free_space= =3D%x alignment=3D%s\n" % \=0D + (Ffs._TypeName[self.Type], self._OFF_, self.Size,=0D + self.Guid, self.FreeSpace, self.Alignment)=0D + SectionInfo =3D '\n'.join([str(self.Sections[Offset])=0D + for Offset in self.Sections.keys()])=0D gIndention -=3D 4=0D return FfsInfo + SectionInfo + "\n"=0D =0D @@ -984,7 +1029,7 @@ class Ffs(Image): Size1, Size2, Size3 =3D self._SIZE_.unpack_from(self._BUF_, self._= OFF_)=0D Size =3D Size1 + (Size2 << 8) + (Size3 << 16)=0D self.empty()=0D - self.extend(self._BUF_[self._OFF_ : self._OFF_ + Size])=0D + self.extend(self._BUF_[self._OFF_: self._OFF_ + Size])=0D =0D # Pad FFS may use the same GUID. We need to avoid it.=0D if self.Type =3D=3D 0xf0:=0D @@ -1001,8 +1046,8 @@ class Ffs(Image): SectionObj.frombuffer(self, SectionStartAddress)=0D #f =3D open(repr(SectionObj), 'wb')=0D #SectionObj.Size =3D 0=0D - #SectionObj.tofile(f)=0D - #f.close()=0D + # SectionObj.tofile(f)=0D + # f.close()=0D self.Sections[SectionStartAddress] =3D SectionObj=0D SectionStartAddress +=3D len(SectionObj)=0D SectionStartAddress =3D (SectionStartAddress + 3) & (~3)=0D @@ -1076,7 +1121,7 @@ class Ffs(Image): State =3D property(_GetState, _SetState)=0D =0D =0D -## MultipleFv() class=0D +# MultipleFv() class=0D #=0D # A class for Multiple FV=0D #=0D @@ -1101,18 +1146,20 @@ class MultipleFv(FirmwareVolume): self.BasicInfo.append([Fv.Name, Fv.FileSystemGuid, Fv.Size])=0D self.FfsDict.update(Fv.FfsDict)=0D =0D -## Class Eot=0D +# Class Eot=0D #=0D # This class is used to define Eot main entrance=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class Eot(object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self: The object pointer=0D #=0D - def __init__(self, CommandLineOption=3DTrue, IsInit=3DTrue, SourceFile= List=3DNone, \=0D + def __init__(self, CommandLineOption=3DTrue, IsInit=3DTrue, SourceFile= List=3DNone,=0D IncludeDirList=3DNone, DecFileList=3DNone, GuidList=3DNon= e, LogFile=3DNone,=0D FvFileList=3D"", MapFileList=3D"", Report=3D'Report.html'= , Dispatch=3DNone):=0D # Version and Copyright=0D @@ -1136,10 +1183,13 @@ class Eot(object): if "EDK_SOURCE" not in os.environ:=0D pass=0D else:=0D - EotGlobalData.gEDK_SOURCE =3D os.path.normpath(os.getenv("= EDK_SOURCE"))=0D + EotGlobalData.gEDK_SOURCE =3D os.path.normpath(=0D + os.getenv("EDK_SOURCE"))=0D else:=0D - EotGlobalData.gEFI_SOURCE =3D os.path.normpath(os.getenv("EFI_= SOURCE"))=0D - EotGlobalData.gEDK_SOURCE =3D os.path.join(EotGlobalData.gEFI_= SOURCE, 'Edk')=0D + EotGlobalData.gEFI_SOURCE =3D os.path.normpath(=0D + os.getenv("EFI_SOURCE"))=0D + EotGlobalData.gEDK_SOURCE =3D os.path.join(=0D + EotGlobalData.gEFI_SOURCE, 'Edk')=0D =0D if "WORKSPACE" not in os.environ:=0D EdkLogger.error("EOT", BuildToolError.ATTRIBUTE_NOT_AVAILABLE,= "Environment variable not found",=0D @@ -1159,16 +1209,19 @@ class Eot(object): for FvFile in GetSplitValueList(self.FvFileList, ' '):=0D FvFile =3D os.path.normpath(FvFile)=0D if not os.path.isfile(FvFile):=0D - EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not f= ind file %s " % FvFile)=0D + EdkLogger.error("Eot", EdkLogger.EOT_ERROR,=0D + "Can not find file %s " % FvFile)=0D EotGlobalData.gFV_FILE.append(FvFile)=0D else:=0D - EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "The fv file list = of target platform was not specified")=0D + EdkLogger.error("Eot", EdkLogger.EOT_ERROR,=0D + "The fv file list of target platform was not s= pecified")=0D =0D if self.MapFileList:=0D for MapFile in GetSplitValueList(self.MapFileList, ' '):=0D MapFile =3D os.path.normpath(MapFile)=0D if not os.path.isfile(MapFile):=0D - EdkLogger.error("Eot", EdkLogger.EOT_ERROR, "Can not f= ind file %s " % MapFile)=0D + EdkLogger.error("Eot", EdkLogger.EOT_ERROR,=0D + "Can not find file %s " % MapFile)=0D EotGlobalData.gMAP_FILE.append(MapFile)=0D =0D # Generate source file list=0D @@ -1214,7 +1267,7 @@ class Eot(object): # Close Database=0D EotGlobalData.gDb.Close()=0D =0D - ## ParseDecFile() method=0D + # ParseDecFile() method=0D #=0D # parse DEC file and get all GUID names with GUID values as {GuidName= : GuidValue}=0D # The Dict is stored in EotGlobalData.gGuidDict=0D @@ -1227,17 +1280,18 @@ class Eot(object): path =3D os.path.normpath(DecFileList)=0D lfr =3D open(path, 'rb')=0D for line in lfr:=0D - path =3D os.path.normpath(os.path.join(EotGlobalData.gWORK= SPACE, line.strip()))=0D + path =3D os.path.normpath(os.path.join(=0D + EotGlobalData.gWORKSPACE, line.strip()))=0D if os.path.exists(path):=0D dfr =3D open(path, 'rb')=0D for line in dfr:=0D line =3D CleanString(line)=0D list =3D line.split('=3D')=0D if len(list) =3D=3D 2:=0D - EotGlobalData.gGuidDict[list[0].strip()] =3D G= uidStructureStringToGuidString(list[1].strip())=0D + EotGlobalData.gGuidDict[list[0].strip(=0D + )] =3D GuidStructureStringToGuidString(list[1]= .strip())=0D =0D -=0D - ## ParseGuidList() method=0D + # ParseGuidList() method=0D #=0D # Parse Guid list and get all GUID names with GUID values as {GuidNam= e : GuidValue}=0D # The Dict is stored in EotGlobalData.gGuidDict=0D @@ -1245,6 +1299,7 @@ class Eot(object): # @param self: The object pointer=0D # @param GuidList: A list of all GUID and its value=0D #=0D +=0D def ParseGuidList(self, GuidList):=0D Path =3D os.path.join(EotGlobalData.gWORKSPACE, GuidList)=0D if os.path.isfile(Path):=0D @@ -1253,7 +1308,7 @@ class Eot(object): (GuidName, GuidValue) =3D Line.split()=0D EotGlobalData.gGuidDict[GuidName] =3D GuidValue=0D =0D - ## ConvertLogFile() method=0D + # ConvertLogFile() method=0D #=0D # Parse a real running log file to get real dispatch order=0D # The result is saved to old file name + '.new'=0D @@ -1273,11 +1328,11 @@ class Eot(object): line =3D line.replace('.efi', '')=0D index =3D line.find("Loading PEIM at ")=0D if index > -1:=0D - newline.append(line[index + 55 : ])=0D + newline.append(line[index + 55:])=0D continue=0D index =3D line.find("Loading driver at ")=0D if index > -1:=0D - newline.append(line[index + 57 : ])=0D + newline.append(line[index + 57:])=0D continue=0D =0D for line in newline:=0D @@ -1288,7 +1343,7 @@ class Eot(object): if lfw:=0D lfw.close()=0D =0D - ## GenerateSourceFileList() method=0D + # GenerateSourceFileList() method=0D #=0D # Generate a list of all source files=0D # 1. Search the file list one by one=0D @@ -1314,8 +1369,9 @@ class Eot(object): if SourceFileList:=0D sfl =3D open(SourceFileList, 'r')=0D for line in sfl:=0D - line =3D os.path.normpath(os.path.join(EotGlobalData.gWORK= SPACE, line.strip()))=0D - if line[-2:].upper() =3D=3D '.C' or line[-2:].upper() =3D= =3D '.H':=0D + line =3D os.path.normpath(os.path.join(=0D + EotGlobalData.gWORKSPACE, line.strip()))=0D + if line[-2:].upper() =3D=3D '.C' or line[-2:].upper() =3D= =3D '.H':=0D if line not in mCurrentSourceFileList:=0D mCurrentSourceFileList.append(line)=0D mSourceFileList.append(line)=0D @@ -1324,7 +1380,8 @@ class Eot(object): if mCurrentInfFile !=3D '':=0D mFileList[mCurrentInfFile] =3D mCurrentSourceFileL= ist=0D mCurrentSourceFileList =3D []=0D - mCurrentInfFile =3D os.path.normpath(os.path.join(EotG= lobalData.gWORKSPACE, line))=0D + mCurrentInfFile =3D os.path.normpath(=0D + os.path.join(EotGlobalData.gWORKSPACE, line))=0D EotGlobalData.gOP_INF.write('%s\n' % mCurrentInfFile)= =0D if mCurrentInfFile not in mFileList:=0D mFileList[mCurrentInfFile] =3D mCurrentSourceFileList=0D @@ -1335,13 +1392,15 @@ class Eot(object): for line in ifl:=0D if not line.strip():=0D continue=0D - newline =3D os.path.normpath(os.path.join(EotGlobalData.gW= ORKSPACE, line.strip()))=0D + newline =3D os.path.normpath(os.path.join(=0D + EotGlobalData.gWORKSPACE, line.strip()))=0D for Root, Dirs, Files in os.walk(str(newline)):=0D for File in Files:=0D FullPath =3D os.path.normpath(os.path.join(Root, F= ile))=0D if FullPath not in mSourceFileList and File[-2:].u= pper() =3D=3D '.H':=0D mSourceFileList.append(FullPath)=0D - EotGlobalData.gOP_SOURCE_FILES.write('%s\n' % = FullPath)=0D + EotGlobalData.gOP_SOURCE_FILES.write(=0D + '%s\n' % FullPath)=0D if FullPath not in mDecFileList and File.upper().f= ind('.DEC') > -1:=0D mDecFileList.append(FullPath)=0D =0D @@ -1351,7 +1410,7 @@ class Eot(object): EotGlobalData.gINF_FILES =3D mFileList=0D EotGlobalData.gOP_INF.close()=0D =0D - ## GenerateReport() method=0D + # GenerateReport() method=0D #=0D # Generate final HTML report=0D #=0D @@ -1362,7 +1421,7 @@ class Eot(object): Rep =3D Report(self.Report, EotGlobalData.gFV, self.Dispatch)=0D Rep.GenerateReport()=0D =0D - ## LoadMapInfo() method=0D + # LoadMapInfo() method=0D #=0D # Load map files and parse them=0D #=0D @@ -1373,7 +1432,7 @@ class Eot(object): EdkLogger.quiet("Parsing Map file ... ")=0D EotGlobalData.gMap =3D ParseMapFile(EotGlobalData.gMAP_FILE)=0D =0D - ## LoadFvInfo() method=0D + # LoadFvInfo() method=0D #=0D # Load FV binary files and parse them=0D #=0D @@ -1385,9 +1444,10 @@ class Eot(object): EotGlobalData.gFV.Dispatch(EotGlobalData.gDb)=0D =0D for Protocol in EotGlobalData.gProtocolList:=0D - EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write('%s\n' %= Protocol)=0D + EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write(=0D + '%s\n' % Protocol)=0D =0D - ## GenerateReportDatabase() method=0D + # GenerateReportDatabase() method=0D #=0D # Generate data for the information needed by report=0D # 1. Update name, macro and value of all found PPI/PROTOCOL GUID=0D @@ -1396,7 +1456,8 @@ class Eot(object): # @param self: The object pointer=0D #=0D def GenerateReportDatabase(self):=0D - EdkLogger.quiet("Generating the cross-reference table of GUID for = Ppi/Protocol ... ")=0D + EdkLogger.quiet(=0D + "Generating the cross-reference table of GUID for Ppi/Protocol= ... ")=0D =0D # Update Protocol/Ppi Guid=0D SqlCommand =3D """select DISTINCT GuidName from Report"""=0D @@ -1410,12 +1471,13 @@ class Eot(object): # Find guid value defined in Dec file=0D if GuidName in EotGlobalData.gGuidDict:=0D GuidValue =3D EotGlobalData.gGuidDict[GuidName]=0D - SqlCommand =3D """update Report set GuidMacro =3D '%s', Gu= idValue =3D '%s' where GuidName =3D '%s'""" %(GuidMacro, GuidValue, GuidNam= e)=0D + SqlCommand =3D """update Report set GuidMacro =3D '%s', Gu= idValue =3D '%s' where GuidName =3D '%s'""" % (=0D + GuidMacro, GuidValue, GuidName)=0D EotGlobalData.gDb.TblReport.Exec(SqlCommand)=0D continue=0D =0D # Search defined Macros for guid name=0D - SqlCommand =3D"""select DISTINCT Value, Modifier from Query wh= ere Name like '%s'""" % GuidName=0D + SqlCommand =3D """select DISTINCT Value, Modifier from Query w= here Name like '%s'""" % GuidName=0D GuidMacroSet =3D EotGlobalData.gDb.TblReport.Exec(SqlCommand)= =0D # Ignore NULL result=0D if not GuidMacroSet:=0D @@ -1424,14 +1486,18 @@ class Eot(object): if not GuidMacro:=0D continue=0D # Find Guid value of Guid Macro=0D - SqlCommand =3D"""select DISTINCT Value from Query2 where Value= like '%%%s%%' and Model =3D %s""" % (GuidMacro, MODEL_IDENTIFIER_MACRO_DEF= INE)=0D + SqlCommand =3D """select DISTINCT Value from Query2 where Valu= e like '%%%s%%' and Model =3D %s""" % (=0D + GuidMacro, MODEL_IDENTIFIER_MACRO_DEFINE)=0D GuidValueSet =3D EotGlobalData.gDb.TblReport.Exec(SqlCommand)= =0D if GuidValueSet !=3D []:=0D GuidValue =3D GuidValueSet[0][0]=0D - GuidValue =3D GuidValue[GuidValue.find(GuidMacro) + len(Gu= idMacro) :]=0D - GuidValue =3D GuidValue.lower().replace('\\', '').replace(= '\r', '').replace('\n', '').replace('l', '').strip()=0D + GuidValue =3D GuidValue[GuidValue.find(=0D + GuidMacro) + len(GuidMacro):]=0D + GuidValue =3D GuidValue.lower().replace('\\', '').replace(= =0D + '\r', '').replace('\n', '').replace('l', '').strip()=0D GuidValue =3D GuidStructureStringToGuidString(GuidValue)=0D - SqlCommand =3D """update Report set GuidMacro =3D '%s', Gu= idValue =3D '%s' where GuidName =3D '%s'""" %(GuidMacro, GuidValue, GuidNam= e)=0D + SqlCommand =3D """update Report set GuidMacro =3D '%s', Gu= idValue =3D '%s' where GuidName =3D '%s'""" % (=0D + GuidMacro, GuidValue, GuidName)=0D EotGlobalData.gDb.TblReport.Exec(SqlCommand)=0D continue=0D =0D @@ -1444,7 +1510,7 @@ class Eot(object): if Record[1] =3D=3D 'Protocol':=0D EotGlobalData.gProtocolList[Record[0].lower()] =3D -2=0D =0D - ## GenerateQueryTable() method=0D + # GenerateQueryTable() method=0D #=0D # Generate two tables improve query performance=0D #=0D @@ -1462,7 +1528,7 @@ class Eot(object): % (Identifier[0], MODEL_IDENTIFIER_MACRO_DEFIN= E)=0D EotGlobalData.gDb.TblReport.Exec(SqlCommand)=0D =0D - ## ParseExecutionOrder() method=0D + # ParseExecutionOrder() method=0D #=0D # Get final execution order=0D # 1. Search all PPI=0D @@ -1474,7 +1540,7 @@ class Eot(object): EdkLogger.quiet("Searching Ppi/Protocol ... ")=0D for Identifier in EotGlobalData.gIdentifierTableList:=0D ModuleID, ModuleName, ModuleGuid, SourceFileID, SourceFileFull= Path, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, Belongs= ToFunction, Enabled =3D \=0D - -1, '', '', -1, '', '', '', '', '', '', '', '', 0=0D + -1, '', '', -1, '', '', '', '', '', '', '', '', 0=0D =0D SourceFileID =3D Identifier[0].replace('Identifier', '')=0D SourceFileFullPath =3D Identifier[1]=0D @@ -1485,85 +1551,108 @@ class Eot(object): SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ' or Name like '%%%s%%') and Model =3D %s""" \=0D % (Identifier, '.InstallPpi', '->InstallPpi', = 'PeiInstallPpi', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFull= Path, ItemMode)=0D + SearchPpi(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode)=0D =0D ItemMode =3D 'Produced'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.ReInstallPpi', '->ReInstallPp= i', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFull= Path, ItemMode, 2)=0D + SearchPpi(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 2)=0D =0D - SearchPpiCallFunction(Identifier, SourceFileID, SourceFileFull= Path, ItemMode)=0D + SearchPpiCallFunction(Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode)=0D =0D ItemMode =3D 'Consumed'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.LocatePpi', '->LocatePpi', MO= DEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFull= Path, ItemMode)=0D + SearchPpi(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode)=0D =0D - SearchFunctionCalling(Identifier, SourceFileID, SourceFileFull= Path, 'Ppi', ItemMode)=0D + SearchFunctionCalling(Identifier, SourceFileID,=0D + SourceFileFullPath, 'Ppi', ItemMode)=0D =0D ItemMode =3D 'Callback'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.NotifyPpi', '->NotifyPpi', MO= DEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchPpi(SqlCommand, Identifier, SourceFileID, SourceFileFull= Path, ItemMode)=0D + SearchPpi(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode)=0D =0D # Find Protocols=0D ItemMode =3D 'Produced'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ' or Name like '%%%s%%' or Name like '%%%s%%') and Model =3D %s""" \=0D % (Identifier, '.InstallProtocolInterface', '.= ReInstallProtocolInterface', '->InstallProtocolInterface', '->ReInstallProt= ocolInterface', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFi= leFullPath, ItemMode, 1)=0D + SearchProtocols(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 1)=0D =0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.InstallMultipleProtocolInterf= aces', '->InstallMultipleProtocolInterfaces', MODEL_IDENTIFIER_FUNCTION_CAL= LING)=0D - SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFi= leFullPath, ItemMode, 2)=0D + SearchProtocols(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 2)=0D =0D - SearchFunctionCalling(Identifier, SourceFileID, SourceFileFull= Path, 'Protocol', ItemMode)=0D + SearchFunctionCalling(Identifier, SourceFileID,=0D + SourceFileFullPath, 'Protocol', ItemMode= )=0D =0D ItemMode =3D 'Consumed'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.LocateProtocol', '->LocatePro= tocol', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFi= leFullPath, ItemMode, 0)=0D + SearchProtocols(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 0)=0D =0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.HandleProtocol', '->HandlePro= tocol', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFi= leFullPath, ItemMode, 1)=0D + SearchProtocols(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 1)=0D =0D - SearchFunctionCalling(Identifier, SourceFileID, SourceFileFull= Path, 'Protocol', ItemMode)=0D + SearchFunctionCalling(Identifier, SourceFileID,=0D + SourceFileFullPath, 'Protocol', ItemMode= )=0D =0D ItemMode =3D 'Callback'=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine= , EndLine from %s=0D where (Name like '%%%s%%' or Name like '%%%s%%= ') and Model =3D %s""" \=0D % (Identifier, '.RegisterProtocolNotify', '->R= egisterProtocolNotify', MODEL_IDENTIFIER_FUNCTION_CALLING)=0D - SearchProtocols(SqlCommand, Identifier, SourceFileID, SourceFi= leFullPath, ItemMode, 0)=0D + SearchProtocols(SqlCommand, Identifier, SourceFileID,=0D + SourceFileFullPath, ItemMode, 0)=0D =0D - SearchFunctionCalling(Identifier, SourceFileID, SourceFileFull= Path, 'Protocol', ItemMode)=0D + SearchFunctionCalling(Identifier, SourceFileID,=0D + SourceFileFullPath, 'Protocol', ItemMode= )=0D =0D # Hard Code=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gEfiSecPlatformInformationPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gEfiNtLoadAsDllPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gNtPeiLoadFileGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gPeiNtAutoScanPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gNtFwhPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gPeiNtThunkPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gPeiPlatformTypePpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gPeiFrequencySelectionCpuPpiGuid', '', '', '', 0)=0D - EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi', = 'Produced', 'gPeiCachePpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi',= =0D + 'Produced', 'gEfiSecPlatformInf= ormationPpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gEfiNtLoadA= sDllPpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gNtPeiLoadF= ileGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gPeiNtAutoS= canPpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '',=0D + '', 'Ppi', 'Produced', 'gNtFwhP= piGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gPeiNtThunk= PpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gPeiPlatfor= mTypePpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '', 'Ppi',= =0D + 'Produced', 'gPeiFrequencySelec= tionCpuPpiGuid', '', '', '', 0)=0D + EotGlobalData.gDb.TblReport.Insert(-2, '', '', -1, '', '',=0D + 'Ppi', 'Produced', 'gPeiCachePp= iGuid', '', '', '', 0)=0D =0D EotGlobalData.gDb.Conn.commit()=0D =0D -=0D - ## BuildDatabase() methoc=0D + # BuildDatabase() methoc=0D #=0D # Build the database for target=0D #=0D # @param self: The object pointer=0D #=0D +=0D def BuildDatabase(self):=0D # Clean report table=0D EotGlobalData.gDb.TblReport.Drop()=0D @@ -1576,9 +1665,10 @@ class Eot(object): c.CreateCCodeDB(EotGlobalData.gSOURCE_FILES)=0D EdkLogger.quiet("Building database for source code done!")=0D =0D - EotGlobalData.gIdentifierTableList =3D GetTableList((MODEL_FILE_C,= MODEL_FILE_H), 'Identifier', EotGlobalData.gDb)=0D + EotGlobalData.gIdentifierTableList =3D GetTableList(=0D + (MODEL_FILE_C, MODEL_FILE_H), 'Identifier', EotGlobalData.gDb)= =0D =0D - ## BuildMetaDataFileDatabase() method=0D + # BuildMetaDataFileDatabase() method=0D #=0D # Build the database for meta data files=0D #=0D @@ -1590,13 +1680,13 @@ class Eot(object): for InfFile in Inf_Files:=0D if not InfFile:=0D continue=0D - EdkLogger.quiet("Parsing %s ..." % str(InfFile))=0D + EdkLogger.quiet("Parsing %s ..." % str(InfFile))=0D EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile])=0D =0D EotGlobalData.gDb.Conn.commit()=0D EdkLogger.quiet("Building database for meta data files done!")=0D =0D - ## ParseOption() method=0D + # ParseOption() method=0D #=0D # Parse command line options=0D #=0D @@ -1632,7 +1722,7 @@ class Eot(object): if Options.keepdatabase:=0D self.IsInit =3D False=0D =0D - ## SetLogLevel() method=0D + # SetLogLevel() method=0D #=0D # Set current log level of the tool based on args=0D #=0D @@ -1649,7 +1739,7 @@ class Eot(object): else:=0D EdkLogger.SetLevel(EdkLogger.INFO)=0D =0D - ## EotOptionParser() method=0D + # EotOptionParser() method=0D #=0D # Using standard Python module optparse to parse command line option = of this tool.=0D #=0D @@ -1659,38 +1749,43 @@ class Eot(object): # @retval Args Target of build command=0D #=0D def EotOptionParser(self):=0D - Parser =3D OptionParser(description =3D self.Copyright, version = =3D self.Version, prog =3D "Eot.exe", usage =3D "%prog [options]")=0D + Parser =3D OptionParser(description=3Dself.Copyright,=0D + version=3Dself.Version, prog=3D"Eot.exe", us= age=3D"%prog [options]")=0D Parser.add_option("-m", "--makefile filename", action=3D"store", t= ype=3D"string", dest=3D'MakeFile',=0D - help=3D"Specify a makefile for the platform.")=0D + help=3D"Specify a makefile for the platform.")=0D Parser.add_option("-c", "--dsc filename", action=3D"store", type= =3D"string", dest=3D"DscFile",=0D - help=3D"Specify a dsc file for the platform.")=0D + help=3D"Specify a dsc file for the platform.")=0D Parser.add_option("-f", "--fv filename", action=3D"store", type=3D= "string", dest=3D"FvFileList",=0D - help=3D"Specify fv file list, quoted by \"\".")=0D + help=3D"Specify fv file list, quoted by \"\".")= =0D Parser.add_option("-a", "--map filename", action=3D"store", type= =3D"string", dest=3D"MapFileList",=0D - help=3D"Specify map file list, quoted by \"\".")=0D + help=3D"Specify map file list, quoted by \"\".")= =0D Parser.add_option("-s", "--source files", action=3D"store", type= =3D"string", dest=3D"SourceFileList",=0D - help=3D"Specify source file list by a file")=0D + help=3D"Specify source file list by a file")=0D Parser.add_option("-i", "--include dirs", action=3D"store", type= =3D"string", dest=3D"IncludeDirList",=0D - help=3D"Specify include dir list by a file")=0D + help=3D"Specify include dir list by a file")=0D Parser.add_option("-e", "--dec files", action=3D"store", type=3D"s= tring", dest=3D"DecFileList",=0D - help=3D"Specify dec file list by a file")=0D + help=3D"Specify dec file list by a file")=0D Parser.add_option("-g", "--guid list", action=3D"store", type=3D"s= tring", dest=3D"GuidList",=0D - help=3D"Specify guid file list by a file")=0D + help=3D"Specify guid file list by a file")=0D Parser.add_option("-l", "--log filename", action=3D"store", type= =3D"string", dest=3D"LogFile",=0D - help=3D"Specify real execution log file")=0D + help=3D"Specify real execution log file")=0D =0D - Parser.add_option("-k", "--keepdatabase", action=3D"store_true", t= ype=3DNone, help=3D"The existing Eot database will not be cleaned except re= port information if this option is specified.")=0D + Parser.add_option("-k", "--keepdatabase", action=3D"store_true", t= ype=3DNone,=0D + help=3D"The existing Eot database will not be cl= eaned except report information if this option is specified.")=0D =0D - Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DN= one, help=3D"Disable all messages except FATAL ERRORS.")=0D - Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "\=0D - = "including library instances selected, final dependency expression= , "\=0D - = "and warning messages, etc.")=0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= help=3D"Enable debug messages at specified level.")=0D + Parser.add_option("-q", "--quiet", action=3D"store_true",=0D + type=3DNone, help=3D"Disable all messages except= FATAL ERRORS.")=0D + Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "=0D + "including library instances selected, final dep= endency expression, "=0D + "and warning messages, etc.")=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= =0D + help=3D"Enable debug messages at specified level= .")=0D =0D - (Opt, Args)=3DParser.parse_args()=0D + (Opt, Args) =3D Parser.parse_args()=0D =0D return (Opt, Args)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -1700,7 +1795,8 @@ if __name__ =3D=3D '__main__': # Initialize log system=0D EdkLogger.Initialize()=0D EdkLogger.IsRaiseError =3D False=0D - EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ", time.localtime())= + "[00:00]" + "\n")=0D + EdkLogger.quiet(time.strftime("%H:%M:%S, %b.%d %Y ",=0D + time.localtime()) + "[00:00]" + "\n")=0D =0D StartTime =3D time.clock()=0D Eot =3D Eot(CommandLineOption=3DFalse,=0D @@ -1709,5 +1805,7 @@ if __name__ =3D=3D '__main__': FvFileList=3Dr'C:\TestEot\FVRECOVERY.Fv')=0D FinishTime =3D time.clock()=0D =0D - BuildDuration =3D time.strftime("%M:%S", time.gmtime(int(round(FinishT= ime - StartTime))))=0D - EdkLogger.quiet("\n%s [%s]" % (time.strftime("%H:%M:%S, %b.%d %Y", tim= e.localtime()), BuildDuration))=0D + BuildDuration =3D time.strftime(=0D + "%M:%S", time.gmtime(int(round(FinishTime - StartTime))))=0D + EdkLogger.quiet("\n%s [%s]" % (time.strftime(=0D + "%H:%M:%S, %b.%d %Y", time.localtime()), BuildDuration))=0D diff --git a/BaseTools/Source/Python/Eot/EotToolError.py b/BaseTools/Source= /Python/Eot/EotToolError.py index d4f4f3a18664..6dc146abbf20 100644 --- a/BaseTools/Source/Python/Eot/EotToolError.py +++ b/BaseTools/Source/Python/Eot/EotToolError.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Standardized Error Handling infrastructures.=0D #=0D # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.
        =0D @@ -10,6 +10,5 @@ ERROR_1 =3D 1000 =0D # Error message=0D gEccErrorMessage =3D {=0D - ERROR_1 : "RESERVED"=0D - }=0D -=0D + ERROR_1: "RESERVED"=0D +}=0D diff --git a/BaseTools/Source/Python/Eot/FileProfile.py b/BaseTools/Source/= Python/Eot/FileProfile.py index 1f3ec156d06c..1c4145d8dd09 100644 --- a/BaseTools/Source/Python/Eot/FileProfile.py +++ b/BaseTools/Source/Python/Eot/FileProfile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # fragments of source file=0D #=0D # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
        = =0D @@ -27,15 +27,17 @@ StructUnionDefinitionList =3D [] TypedefDefinitionList =3D []=0D FunctionCallingList =3D []=0D =0D -## Class FileProfile=0D +# Class FileProfile=0D #=0D # record file data when parsing source=0D #=0D # May raise Exception when opening file.=0D #=0D -class FileProfile :=0D =0D - ## The constructor=0D +=0D +class FileProfile:=0D +=0D + # The constructor=0D #=0D # @param self: The object pointer=0D # @param FileName: The file that to be parsed=0D diff --git a/BaseTools/Source/Python/Eot/Identification.py b/BaseTools/Sour= ce/Python/Eot/Identification.py index 31d47602e519..1f5aac258839 100644 --- a/BaseTools/Source/Python/Eot/Identification.py +++ b/BaseTools/Source/Python/Eot/Identification.py @@ -1,10 +1,10 @@ -## @file=0D +# @file=0D # This file is used to define the identification of INF/DEC/DSC files=0D #=0D # Copyright (c) 2007, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D -## Identification=0D +# Identification=0D #=0D # This class defined basic Identification information structure which is u= sed by INF/DEC/DSC files=0D #=0D @@ -22,27 +22,28 @@ class Identification(object): self.FileRelativePath =3D ''=0D self.PackagePath =3D ''=0D =0D - ## GetFileName=0D + # GetFileName=0D #=0D # Reserved=0D #=0D def GetFileName(self, FileFullPath, FileRelativePath):=0D pass=0D =0D - ## GetFileName=0D + # GetFileName=0D #=0D # Reserved=0D #=0D def GetFileFullPath(self, FileName, FileRelativePath):=0D pass=0D =0D - ## GetFileName=0D + # GetFileName=0D #=0D # Reserved=0D #=0D def GetFileRelativePath(self, FileName, FileFullPath):=0D pass=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py b/BaseTools/Sourc= e/Python/Eot/InfParserLite.py index 2c6bc50b6cd0..10ca7ad3a471 100644 --- a/BaseTools/Source/Python/Eot/InfParserLite.py +++ b/BaseTools/Source/Python/Eot/InfParserLite.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse INF file of EDK project=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -21,21 +21,23 @@ from Eot.Parser import * from Eot import Database=0D from Eot import EotGlobalData=0D =0D -## EdkInfParser() class=0D +# EdkInfParser() class=0D #=0D # This class defined basic INF object which is used by inheriting=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class EdkInfParser(object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self: The object pointer=0D # @param Filename: INF file name=0D # @param Database: Eot database=0D # @param SourceFileList: A list for all source file belonging this I= NF file=0D #=0D - def __init__(self, Filename =3D None, Database =3D None, SourceFileLis= t =3D None):=0D + def __init__(self, Filename=3DNone, Database=3DNone, SourceFileList=3D= None):=0D self.Identification =3D Identification()=0D self.Sources =3D []=0D self.Macros =3D {}=0D @@ -51,27 +53,30 @@ class EdkInfParser(object): =0D if SourceFileList:=0D for Item in SourceFileList:=0D - self.TblInf.Insert(MODEL_EFI_SOURCE_FILE, Item, '', '', ''= , '', 'COMMON', -1, self.FileID, -1, -1, -1, -1, 0)=0D + self.TblInf.Insert(MODEL_EFI_SOURCE_FILE, Item, '', '',=0D + '', '', 'COMMON', -1, self.FileID, -1, = -1, -1, -1, 0)=0D =0D -=0D - ## LoadInffile() method=0D + # LoadInffile() method=0D #=0D # Load INF file and insert a record in database=0D #=0D # @param self: The object pointer=0D # @param Filename: Input value for filename of Inf file=0D #=0D - def LoadInfFile(self, Filename =3D None):=0D +=0D + def LoadInfFile(self, Filename=3DNone):=0D # Insert a record for file=0D Filename =3D NormPath(Filename)=0D self.Identification.FileFullPath =3D Filename=0D - (self.Identification.FileRelativePath, self.Identification.FileNam= e) =3D os.path.split(Filename)=0D + (self.Identification.FileRelativePath,=0D + self.Identification.FileName) =3D os.path.split(Filename)=0D =0D self.FileID =3D self.TblFile.InsertFile(Filename, MODEL_FILE_INF)= =0D =0D - self.ParseInf(PreProcess(Filename, False), self.Identification.Fil= eRelativePath, Filename)=0D + self.ParseInf(PreProcess(Filename, False),=0D + self.Identification.FileRelativePath, Filename)=0D =0D - ## ParserSource() method=0D + # ParserSource() method=0D #=0D # Parse Source section and insert records in database=0D #=0D @@ -91,9 +96,10 @@ class EdkInfParser(object): for Item in SectionItemList:=0D if CurrentSection.upper() =3D=3D 'defines'.upper():=0D (Name, Value) =3D AddToSelfMacro(self.Macros, Item[0])= =0D - self.TblInf.Insert(MODEL_META_DATA_HEADER, Name, Value= , Third, '', '', Arch, -1, self.FileID, Item[1], -1, Item[1], -1, 0)=0D + self.TblInf.Insert(MODEL_META_DATA_HEADER, Name, Value= , Third,=0D + '', '', Arch, -1, self.FileID, Item= [1], -1, Item[1], -1, 0)=0D =0D - ## ParseInf() method=0D + # ParseInf() method=0D #=0D # Parse INF file and get sections information=0D #=0D @@ -102,9 +108,9 @@ class EdkInfParser(object): # @param FileRelativePath: relative path of the file=0D # @param Filename: file name of INF file=0D #=0D - def ParseInf(self, Lines =3D [], FileRelativePath =3D '', Filename =3D= ''):=0D + def ParseInf(self, Lines=3D[], FileRelativePath=3D'', Filename=3D''):= =0D IfDefList, SectionItemList, CurrentSection, ArchList, ThirdList, I= ncludeFiles =3D \=0D - [], [], TAB_UNKNOWN, [], [], []=0D + [], [], TAB_UNKNOWN, [], [], []=0D LineNo =3D 0=0D =0D for Line in Lines:=0D @@ -112,7 +118,8 @@ class EdkInfParser(object): if Line =3D=3D '':=0D continue=0D if Line.startswith(TAB_SECTION_START) and Line.endswith(TAB_SE= CTION_END):=0D - self.ParserSource(CurrentSection, SectionItemList, ArchLis= t, ThirdList)=0D + self.ParserSource(=0D + CurrentSection, SectionItemList, ArchList, ThirdList)= =0D =0D # Parse the new section=0D SectionItemList =3D []=0D @@ -120,18 +127,21 @@ class EdkInfParser(object): ThirdList =3D []=0D # Parse section name=0D CurrentSection =3D ''=0D - LineList =3D GetSplitValueList(Line[len(TAB_SECTION_START)= :len(Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)=0D + LineList =3D GetSplitValueList(Line[len(TAB_SECTION_START)= :len(=0D + Line) - len(TAB_SECTION_END)], TAB_COMMA_SPLIT)=0D for Item in LineList:=0D ItemList =3D GetSplitValueList(Item, TAB_SPLIT)=0D if CurrentSection =3D=3D '':=0D CurrentSection =3D ItemList[0]=0D else:=0D if CurrentSection !=3D ItemList[0]:=0D - EdkLogger.error("Parser", PARSER_ERROR, "Diffe= rent section names '%s' and '%s' are found in one section definition, this = is not allowed." % (CurrentSection, ItemList[0]), File=3DFilename, Line=3DL= ineNo)=0D + EdkLogger.error("Parser", PARSER_ERROR, "Diffe= rent section names '%s' and '%s' are found in one section definition, this = is not allowed." % (=0D + CurrentSection, ItemList[0]), File=3DFilen= ame, Line=3DLineNo)=0D ItemList.append('')=0D ItemList.append('')=0D if len(ItemList) > 5:=0D - RaiseParserError(Line, CurrentSection, Filename, '= ', LineNo)=0D + RaiseParserError(Line, CurrentSection,=0D + Filename, '', LineNo)=0D else:=0D ArchList.append(ItemList[1].upper())=0D ThirdList.append(ItemList[2])=0D @@ -143,6 +153,4 @@ class EdkInfParser(object): # End of parse=0D =0D self.ParserSource(CurrentSection, SectionItemList, ArchList, Third= List)=0D - #End of For=0D -=0D -=0D + # End of For=0D diff --git a/BaseTools/Source/Python/Eot/Parser.py b/BaseTools/Source/Pytho= n/Eot/Parser.py index f204051d01f7..e02c2267dafa 100644 --- a/BaseTools/Source/Python/Eot/Parser.py +++ b/BaseTools/Source/Python/Eot/Parser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common parsing related functions used in par= sing=0D # Inf/Dsc/Makefile process=0D #=0D @@ -10,7 +10,8 @@ # Import Modules=0D #=0D from __future__ import absolute_import=0D -import Common.LongFilePathOs as os, re=0D +import Common.LongFilePathOs as os=0D +import re=0D import Common.EdkLogger as EdkLogger=0D from Common.DataType import *=0D from CommonDataClass.DataClass import *=0D @@ -21,10 +22,12 @@ from Common.LongFilePathSupport import OpenLongFilePath= as open =0D import subprocess=0D =0D -## DeCompress=0D +# DeCompress=0D #=0D # Call external decompress tool to decompress the fv section=0D #=0D +=0D +=0D def DeCompress(Method, Input):=0D # Write the input to a temp file=0D open('_Temp.bin', 'wb').write(Input)=0D @@ -37,7 +40,8 @@ def DeCompress(Method, Input): cmd =3D r'TianoCompress -d -o _New.bin _Temp.bin'=0D =0D # Call tool to create the decompressed output file=0D - Process =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE, stderr=3Ds= ubprocess.STDOUT)=0D + Process =3D subprocess.Popen(=0D + cmd, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT)=0D Process.communicate()[0]=0D =0D # Return the beffer of New.bin=0D @@ -45,7 +49,7 @@ def DeCompress(Method, Input): return open('_New.bin', 'rb').read()=0D =0D =0D -## PreProcess() method=0D +# PreProcess() method=0D #=0D # Pre process a file=0D #=0D @@ -58,7 +62,7 @@ def DeCompress(Method, Input): #=0D # @return Lines: The file contents after removing comments=0D #=0D -def PreProcess(Filename, MergeMultipleLines =3D True, LineNo =3D -1):=0D +def PreProcess(Filename, MergeMultipleLines=3DTrue, LineNo=3D-1):=0D Lines =3D []=0D Filename =3D os.path.normpath(Filename)=0D if not os.path.isfile(Filename):=0D @@ -100,7 +104,8 @@ def PreProcess(Filename, MergeMultipleLines =3D True, L= ineNo =3D -1): IsFindBlockCode =3D False=0D continue=0D if Line[-1] =3D=3D TAB_SLASH:=0D - ReservedLine =3D ReservedLine + TAB_SPACE_SPLIT + Line[0:= -1].strip()=0D + ReservedLine =3D ReservedLine + \=0D + TAB_SPACE_SPLIT + Line[0:-1].strip()=0D ReservedLineLength =3D ReservedLineLength + 1=0D IsFindBlockCode =3D True=0D continue=0D @@ -109,18 +114,20 @@ def PreProcess(Filename, MergeMultipleLines =3D True,= LineNo =3D -1): =0D return Lines=0D =0D -## AddToGlobalMacro() method=0D +# AddToGlobalMacro() method=0D #=0D # Add a macro to EotGlobalData.gMACRO=0D #=0D # @param Name: Name of the macro=0D # @param Value: Value of the macro=0D #=0D +=0D +=0D def AddToGlobalMacro(Name, Value):=0D Value =3D ReplaceMacro(Value, EotGlobalData.gMACRO, True)=0D EotGlobalData.gMACRO[Name] =3D Value=0D =0D -## AddToSelfMacro() method=0D +# AddToSelfMacro() method=0D #=0D # Parse a line of macro definition and add it to a macro set=0D #=0D @@ -130,6 +137,8 @@ def AddToGlobalMacro(Name, Value): # @return Name: Name of macro=0D # @return Value: Value of macro=0D #=0D +=0D +=0D def AddToSelfMacro(SelfMacro, Line):=0D Name, Value =3D '', ''=0D List =3D GetSplitValueList(Line, TAB_EQUAL_SPLIT, 1)=0D @@ -142,7 +151,7 @@ def AddToSelfMacro(SelfMacro, Line): =0D return (Name, Value)=0D =0D -## GetIncludeListOfFile() method=0D +# GetIncludeListOfFile() method=0D #=0D # Get the include path list for a source file=0D #=0D @@ -156,6 +165,8 @@ def AddToSelfMacro(SelfMacro, Line): #=0D # @return IncludeList: A list of include directories=0D #=0D +=0D +=0D def GetIncludeListOfFile(WorkSpace, Filepath, Db):=0D IncludeList =3D []=0D Filepath =3D os.path.normpath(Filepath)=0D @@ -179,7 +190,7 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db): =0D return IncludeList=0D =0D -## GetTableList() method=0D +# GetTableList() method=0D #=0D # Search table file and find all small tables=0D #=0D @@ -189,9 +200,12 @@ def GetIncludeListOfFile(WorkSpace, Filepath, Db): #=0D # @return TableList: A list of tables=0D #=0D +=0D +=0D def GetTableList(FileModelList, Table, Db):=0D TableList =3D []=0D - SqlCommand =3D """select ID, FullPath from File where Model in %s""" %= str(FileModelList)=0D + SqlCommand =3D """select ID, FullPath from File where Model in %s""" %= str(=0D + FileModelList)=0D RecordSet =3D Db.TblFile.Exec(SqlCommand)=0D for Record in RecordSet:=0D TableName =3D Table + str(Record[0])=0D @@ -199,7 +213,7 @@ def GetTableList(FileModelList, Table, Db): =0D return TableList=0D =0D -## GetAllIncludeDir() method=0D +# GetAllIncludeDir() method=0D #=0D # Find all Include directories=0D #=0D @@ -207,6 +221,8 @@ def GetTableList(FileModelList, Table, Db): #=0D # @return IncludeList: A list of include directories=0D #=0D +=0D +=0D def GetAllIncludeDirs(Db):=0D IncludeList =3D []=0D SqlCommand =3D """select distinct Value1 from Inf where Model =3D %s o= rder by Value1""" % MODEL_EFI_INCLUDE=0D @@ -217,7 +233,7 @@ def GetAllIncludeDirs(Db): =0D return IncludeList=0D =0D -## GetAllIncludeFiles() method=0D +# GetAllIncludeFiles() method=0D #=0D # Find all Include files=0D #=0D @@ -225,6 +241,8 @@ def GetAllIncludeDirs(Db): #=0D # @return IncludeFileList: A list of include files=0D #=0D +=0D +=0D def GetAllIncludeFiles(Db):=0D IncludeList =3D GetAllIncludeDirs(Db)=0D IncludeFileList =3D []=0D @@ -238,7 +256,7 @@ def GetAllIncludeFiles(Db): =0D return IncludeFileList=0D =0D -## GetAllSourceFiles() method=0D +# GetAllSourceFiles() method=0D #=0D # Find all source files=0D #=0D @@ -246,6 +264,8 @@ def GetAllIncludeFiles(Db): #=0D # @return SourceFileList: A list of source files=0D #=0D +=0D +=0D def GetAllSourceFiles(Db):=0D SourceFileList =3D []=0D SqlCommand =3D """select distinct Value1 from Inf where Model =3D %s o= rder by Value1""" % MODEL_EFI_SOURCE_FILE=0D @@ -256,7 +276,7 @@ def GetAllSourceFiles(Db): =0D return SourceFileList=0D =0D -## GetAllFiles() method=0D +# GetAllFiles() method=0D #=0D # Find all files, both source files and include files=0D #=0D @@ -264,6 +284,8 @@ def GetAllSourceFiles(Db): #=0D # @return FileList: A list of files=0D #=0D +=0D +=0D def GetAllFiles(Db):=0D FileList =3D []=0D IncludeFileList =3D GetAllIncludeFiles(Db)=0D @@ -277,7 +299,7 @@ def GetAllFiles(Db): =0D return FileList=0D =0D -## ParseConditionalStatement() method=0D +# ParseConditionalStatement() method=0D #=0D # Parse conditional statement=0D #=0D @@ -288,10 +310,13 @@ def GetAllFiles(Db): # @retval True: Find keyword of conditional statement=0D # @retval False: Not find keyword of conditional statement=0D #=0D +=0D +=0D def ParseConditionalStatement(Line, Macros, StatusSet):=0D NewLine =3D Line.upper()=0D if NewLine.find(TAB_IF_EXIST.upper()) > -1:=0D - IfLine =3D Line[NewLine.find(TAB_IF_EXIST) + len(TAB_IF_EXIST) + 1= :].strip()=0D + IfLine =3D Line[NewLine.find(TAB_IF_EXIST) +=0D + len(TAB_IF_EXIST) + 1:].strip()=0D IfLine =3D ReplaceMacro(IfLine, EotGlobalData.gMACRO, True)=0D IfLine =3D ReplaceMacro(IfLine, Macros, True)=0D IfLine =3D IfLine.replace("\"", '')=0D @@ -308,7 +333,8 @@ def ParseConditionalStatement(Line, Macros, StatusSet): StatusSet.append([Status])=0D return True=0D if NewLine.find(TAB_IF_N_DEF.upper()) > -1:=0D - IfLine =3D Line[NewLine.find(TAB_IF_N_DEF) + len(TAB_IF_N_DEF) + 1= :].strip()=0D + IfLine =3D Line[NewLine.find(TAB_IF_N_DEF) +=0D + len(TAB_IF_N_DEF) + 1:].strip()=0D Status =3D False=0D if IfLine not in Macros and IfLine not in EotGlobalData.gMACRO:=0D Status =3D True=0D @@ -320,7 +346,8 @@ def ParseConditionalStatement(Line, Macros, StatusSet): StatusSet.append([Status])=0D return True=0D if NewLine.find(TAB_ELSE_IF.upper()) > -1:=0D - IfLine =3D Line[NewLine.find(TAB_ELSE_IF) + len(TAB_ELSE_IF) + 1:]= .strip()=0D + IfLine =3D Line[NewLine.find(TAB_ELSE_IF) +=0D + len(TAB_ELSE_IF) + 1:].strip()=0D Status =3D ParseConditionalStatementMacros(IfLine, Macros)=0D StatusSet[-1].append(Status)=0D return True=0D @@ -336,7 +363,7 @@ def ParseConditionalStatement(Line, Macros, StatusSet): =0D return False=0D =0D -## ParseConditionalStatement() method=0D +# ParseConditionalStatement() method=0D #=0D # Parse conditional statement with Macros=0D #=0D @@ -345,6 +372,8 @@ def ParseConditionalStatement(Line, Macros, StatusSet): #=0D # @return Line: New line after replacing macros=0D #=0D +=0D +=0D def ParseConditionalStatementMacros(Line, Macros):=0D if Line.upper().find('DEFINED(') > -1 or Line.upper().find('EXIST') > = -1:=0D return False=0D @@ -354,7 +383,7 @@ def ParseConditionalStatementMacros(Line, Macros): Line =3D Line.replace("||", "or")=0D return eval(Line)=0D =0D -## GetConditionalStatementStatus() method=0D +# GetConditionalStatementStatus() method=0D #=0D # 1. Assume the latest status as True=0D # 2. Pop the top status of status set, previous status=0D @@ -364,6 +393,8 @@ def ParseConditionalStatementMacros(Line, Macros): #=0D # @return Status: The final status=0D #=0D +=0D +=0D def GetConditionalStatementStatus(StatusSet):=0D Status =3D True=0D for Item in StatusSet:=0D @@ -371,7 +402,7 @@ def GetConditionalStatementStatus(StatusSet): =0D return Status=0D =0D -## SearchBelongsToFunction() method=0D +# SearchBelongsToFunction() method=0D #=0D # Search all functions belong to the file=0D #=0D @@ -381,15 +412,18 @@ def GetConditionalStatementStatus(StatusSet): #=0D # @return: The found function=0D #=0D +=0D +=0D def SearchBelongsToFunction(BelongsToFile, StartLine, EndLine):=0D - SqlCommand =3D """select ID, Name from Function where BelongsToFile = =3D %s and StartLine <=3D %s and EndLine >=3D %s""" %(BelongsToFile, StartL= ine, EndLine)=0D + SqlCommand =3D """select ID, Name from Function where BelongsToFile = =3D %s and StartLine <=3D %s and EndLine >=3D %s""" % (=0D + BelongsToFile, StartLine, EndLine)=0D RecordSet =3D EotGlobalData.gDb.TblFunction.Exec(SqlCommand)=0D if RecordSet !=3D []:=0D return RecordSet[0][0], RecordSet[0][1]=0D else:=0D return -1, ''=0D =0D -## SearchPpiCallFunction() method=0D +# SearchPpiCallFunction() method=0D #=0D # Search all used PPI calling function 'PeiServicesReInstallPpi' and 'Pei= ServicesInstallPpi'=0D # Store the result to database=0D @@ -399,6 +433,8 @@ def SearchBelongsToFunction(BelongsToFile, StartLine, E= ndLine): # @param SourceFileFullPath: Source file full path=0D # @param ItemMode: Mode of the item=0D #=0D +=0D +=0D def SearchPpiCallFunction(Identifier, SourceFileID, SourceFileFullPath, It= emMode):=0D ItemName, ItemType, GuidName, GuidMacro, GuidValue =3D '', 'Ppi', '', = '', ''=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine, EndLin= e from %s=0D @@ -410,13 +446,15 @@ def SearchPpiCallFunction(Identifier, SourceFileID, S= ourceFileFullPath, ItemMode for Record in RecordSet:=0D Index =3D 0=0D BelongsToFile, StartLine, EndLine =3D Record[2], Record[3], Record= [4]=0D - BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (BelongsToFile, StartLine, EndLine)=0D + BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (=0D + BelongsToFile, StartLine, EndLine)=0D VariableList =3D Record[0].split(',')=0D for Variable in VariableList:=0D Variable =3D Variable.strip()=0D # Get index of the variable=0D if Variable.find('[') > -1:=0D - Index =3D int(Variable[Variable.find('[') + 1 : Variable.f= ind(']')])=0D + Index =3D int(Variable[Variable.find(=0D + '[') + 1: Variable.find(']')])=0D Variable =3D Variable[:Variable.find('[')]=0D # Get variable name=0D if Variable.startswith('&'):=0D @@ -434,10 +472,12 @@ def SearchPpiCallFunction(Identifier, SourceFileID, S= ourceFileFullPath, ItemMode if len(NewVariableValueList) > 1:=0D NewVariableValue =3D NewVariableValueList[1].strip= ()=0D if NewVariableValue.startswith('&'):=0D - Db.Insert(-1, '', '', SourceFileID, SourceFile= FullPath, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, Gu= idValue, BelongsToFunction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFile= FullPath, ItemName, ItemType,=0D + ItemMode, NewVariableValue[1:], Guid= Macro, GuidValue, BelongsToFunction, 0)=0D continue=0D else:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s= , %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, St= artLine, NewParameter))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s= , %s, %s, %s\n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFi= leFullPath, StartLine, NewParameter))=0D =0D ItemName, ItemType, GuidName, GuidMacro, GuidValue =3D '', 'Ppi', '', = '', ''=0D SqlCommand =3D """select Value, Name, BelongsToFile, StartLine, EndLin= e from %s=0D @@ -458,12 +498,14 @@ def SearchPpiCallFunction(Identifier, SourceFileID, S= ourceFileFullPath, ItemMode continue=0D Index =3D 0=0D BelongsToFile, StartLine, EndLine =3D Record[2], Record[3], Record= [4]=0D - BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (BelongsToFile, StartLine, EndLine)=0D - Variable =3D Record[0].replace('PeiServicesInstallPpi', '').replac= e('(', '').replace(')', '').replace('&', '').strip()=0D + BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (=0D + BelongsToFile, StartLine, EndLine)=0D + Variable =3D Record[0].replace('PeiServicesInstallPpi', '').replac= e(=0D + '(', '').replace(')', '').replace('&', '').strip()=0D Variable =3D Variable[Variable.find(',') + 1:].strip()=0D # Get index of the variable=0D if Variable.find('[') > -1:=0D - Index =3D int(Variable[Variable.find('[') + 1 : Variable.find(= ']')])=0D + Index =3D int(Variable[Variable.find('[') + 1: Variable.find('= ]')])=0D Variable =3D Variable[:Variable.find('[')]=0D # Get variable name=0D if Variable.startswith('&'):=0D @@ -480,12 +522,14 @@ def SearchPpiCallFunction(Identifier, SourceFileID, S= ourceFileFullPath, ItemMode if len(NewVariableValueList) > 1:=0D NewVariableValue =3D NewVariableValueList[1].strip()=0D if NewVariableValue.startswith('&'):=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType, ItemMode, NewVariableValue[1:], GuidMacro, GuidVa= lue, BelongsToFunction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType,=0D + ItemMode, NewVariableValue[1:], GuidMacr= o, GuidValue, BelongsToFunction, 0)=0D continue=0D else:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s= , %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartL= ine, NewParameter))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s= , %s, %s\n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFu= llPath, StartLine, NewParameter))=0D =0D -## SearchPpis() method=0D +# SearchPpis() method=0D #=0D # Search all used PPI calling function=0D # Store the result to database=0D @@ -497,7 +541,9 @@ def SearchPpiCallFunction(Identifier, SourceFileID, Sou= rceFileFullPath, ItemMode # @param ItemMode: Mode of the item=0D # @param PpiMode: Mode of PPI=0D #=0D -def SearchPpi(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMod= e, PpiMode =3D 1):=0D +=0D +=0D +def SearchPpi(SqlCommand, Table, SourceFileID, SourceFileFullPath, ItemMod= e, PpiMode=3D1):=0D ItemName, ItemType, GuidName, GuidMacro, GuidValue =3D '', 'Ppi', '', = '', ''=0D BelongsToFunctionID, BelongsToFunction =3D -1, ''=0D Db =3D EotGlobalData.gDb.TblReport=0D @@ -506,7 +552,8 @@ def SearchPpi(SqlCommand, Table, SourceFileID, SourceFi= leFullPath, ItemMode, Ppi Parameter =3D GetPpiParameter(Record[0], PpiMode)=0D BelongsToFile, StartLine, EndLine =3D Record[2], Record[3], Record= [4]=0D # Get BelongsToFunction=0D - BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (BelongsToFile, StartLine, EndLine)=0D + BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (=0D + BelongsToFile, StartLine, EndLine)=0D =0D # Default is Not Found=0D IsFound =3D False=0D @@ -514,29 +561,34 @@ def SearchPpi(SqlCommand, Table, SourceFileID, Source= FileFullPath, ItemMode, Ppi # For Consumed Ppi=0D if ItemMode =3D=3D 'Consumed':=0D if Parameter.startswith('g'):=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType, ItemMode, Parameter, GuidMacro, GuidValue, BelongsToFunct= ion, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType,=0D + ItemMode, Parameter, GuidMacro, GuidValue, Belon= gsToFunction, 0)=0D else:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Par= ameter))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFullPath, = StartLine, Parameter))=0D continue=0D =0D # Direct Parameter.Guid=0D - SqlCommand =3D """select Value from %s where (Name like '%%%s.Guid= %%' or Name like '%%%s->Guid%%') and Model =3D %s""" % (Table, Parameter, P= arameter, MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION)=0D + SqlCommand =3D """select Value from %s where (Name like '%%%s.Guid= %%' or Name like '%%%s->Guid%%') and Model =3D %s""" % (=0D + Table, Parameter, Parameter, MODEL_IDENTIFIER_ASSIGNMENT_EXPRE= SSION)=0D NewRecordSet =3D Db.Exec(SqlCommand)=0D for NewRecord in NewRecordSet:=0D GuidName =3D GetParameterName(NewRecord[0])=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemNa= me, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFunction, = 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, ItemNa= me, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue, BelongsToF= unction, 0)=0D IsFound =3D True=0D =0D # Defined Parameter=0D if not IsFound:=0D Key =3D Parameter=0D if Key.rfind(' ') > -1:=0D - Key =3D Key[Key.rfind(' ') : ].strip().replace('&', '')=0D + Key =3D Key[Key.rfind(' '):].strip().replace('&', '')=0D Value =3D FindKeyValue(EotGlobalData.gDb.TblFile, Table, Key)= =0D List =3D GetSplitValueList(Value.replace('\n', ''), TAB_COMMA_= SPLIT)=0D if len(List) > 1:=0D GuidName =3D GetParameterName(List[1])=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFuncti= on, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue, Belong= sToFunction, 0)=0D IsFound =3D True=0D =0D # A list Parameter=0D @@ -545,14 +597,18 @@ def SearchPpi(SqlCommand, Table, SourceFileID, Source= FileFullPath, ItemMode, Ppi End =3D Parameter.find(']')=0D if Start > -1 and End > -1 and Start < End:=0D try:=0D - Index =3D int(Parameter[Start + 1 : End])=0D - Parameter =3D Parameter[0 : Start]=0D - SqlCommand =3D """select Value from %s where Name =3D = '%s' and Model =3D %s""" % (Table, Parameter, MODEL_IDENTIFIER_VARIABLE)=0D + Index =3D int(Parameter[Start + 1: End])=0D + Parameter =3D Parameter[0: Start]=0D + SqlCommand =3D """select Value from %s where Name =3D = '%s' and Model =3D %s""" % (=0D + Table, Parameter, MODEL_IDENTIFIER_VARIABLE)=0D NewRecordSet =3D Db.Exec(SqlCommand)=0D for NewRecord in NewRecordSet:=0D - NewParameter =3D GetSplitValueList(NewRecord[0], '= }')[Index]=0D - GuidName =3D GetPpiParameter(NewParameter[NewParam= eter.find('{') : ])=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, Belongs= ToFunction, 0)=0D + NewParameter =3D GetSplitValueList(=0D + NewRecord[0], '}')[Index]=0D + GuidName =3D GetPpiParameter(=0D + NewParameter[NewParameter.find('{'):])=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue= , BelongsToFunction, 0)=0D IsFound =3D True=0D except Exception:=0D pass=0D @@ -565,19 +621,22 @@ def SearchPpi(SqlCommand, Table, SourceFileID, Source= FileFullPath, ItemMode, Ppi NewRecordSet =3D Db.Exec(SqlCommand)=0D for NewRecord in NewRecordSet:=0D Table =3D 'Identifier' + str(NewRecord[0])=0D - SqlCommand =3D """select Value from %s where Name =3D '%s'= and Modifier =3D 'EFI_PEI_PPI_DESCRIPTOR' and Model =3D %s""" % (Table, Pa= rameter, MODEL_IDENTIFIER_VARIABLE)=0D + SqlCommand =3D """select Value from %s where Name =3D '%s'= and Modifier =3D 'EFI_PEI_PPI_DESCRIPTOR' and Model =3D %s""" % (=0D + Table, Parameter, MODEL_IDENTIFIER_VARIABLE)=0D PpiSet =3D Db.Exec(SqlCommand)=0D if PpiSet !=3D []:=0D GuidName =3D GetPpiParameter(PpiSet[0][0])=0D if GuidName !=3D '':=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, Belongs= ToFunction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue= , BelongsToFunction, 0)=0D IsFound =3D True=0D break=0D =0D if not IsFound:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' = % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Paramet= er))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s\n' = % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFullPath, Star= tLine, Parameter))=0D =0D -## SearchProtocols() method=0D +# SearchProtocols() method=0D #=0D # Search all used PROTOCOL calling function=0D # Store the result to database=0D @@ -589,6 +648,8 @@ def SearchPpi(SqlCommand, Table, SourceFileID, SourceFi= leFullPath, ItemMode, Ppi # @param ItemMode: Mode of the item=0D # @param ProtocolMode: Mode of PROTOCOL=0D #=0D +=0D +=0D def SearchProtocols(SqlCommand, Table, SourceFileID, SourceFileFullPath, I= temMode, ProtocolMode):=0D ItemName, ItemType, GuidName, GuidMacro, GuidValue =3D '', 'Protocol',= '', '', ''=0D BelongsToFunctionID, BelongsToFunction =3D -1, ''=0D @@ -598,7 +659,8 @@ def SearchProtocols(SqlCommand, Table, SourceFileID, So= urceFileFullPath, ItemMod Parameter =3D ''=0D BelongsToFile, StartLine, EndLine =3D Record[2], Record[3], Record= [4]=0D # Get BelongsToFunction=0D - BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (BelongsToFile, StartLine, EndLine)=0D + BelongsToFunctionID, BelongsToFunction =3D SearchBelongsToFunction= (=0D + BelongsToFile, StartLine, EndLine)=0D =0D # Default is Not Found=0D IsFound =3D False=0D @@ -607,7 +669,8 @@ def SearchProtocols(SqlCommand, Table, SourceFileID, So= urceFileFullPath, ItemMod Parameter =3D GetProtocolParameter(Record[0], ProtocolMode)=0D if Parameter.startswith('g') or Parameter.endswith('Guid') or = Parameter =3D=3D 'ShellEnvProtocol' or Parameter =3D=3D 'ShellInterfaceProt= ocol':=0D GuidName =3D GetParameterName(Parameter)=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFuncti= on, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath, It= emName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue, Belong= sToFunction, 0)=0D IsFound =3D True=0D =0D if ProtocolMode =3D=3D 2:=0D @@ -615,22 +678,27 @@ def SearchProtocols(SqlCommand, Table, SourceFileID, = SourceFileFullPath, ItemMod for Protocol in Protocols:=0D if Protocol.startswith('&') and Protocol.endswith('Guid'):= =0D GuidName =3D GetParameterName(Protocol)=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath= , ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFu= nction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath= , ItemName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue, Be= longsToFunction, 0)=0D IsFound =3D True=0D else:=0D - NewValue =3D FindKeyValue(EotGlobalData.gDb.TblFile, T= able, Protocol)=0D + NewValue =3D FindKeyValue(=0D + EotGlobalData.gDb.TblFile, Table, Protocol)=0D if Protocol !=3D NewValue and NewValue.endswith('Guid'= ):=0D GuidName =3D GetParameterName(NewValue)=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, Belongs= ToFunction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFull= Path, ItemName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue= , BelongsToFunction, 0)=0D IsFound =3D True=0D =0D if not IsFound:=0D if BelongsToFunction in EotGlobalData.gProducedProtocolLibrary= or BelongsToFunction in EotGlobalData.gConsumedProtocolLibrary:=0D - EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write('%s,= %s, %s, %s, %s, %s, %s\n' % (ItemType, ItemMode, SourceFileID, SourceFileF= ullPath, StartLine, Parameter, BelongsToFunction))=0D + EotGlobalData.gOP_UN_MATCHED_IN_LIBRARY_CALLING.write('%s,= %s, %s, %s, %s, %s, %s\n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFullPath, = StartLine, Parameter, BelongsToFunction))=0D else:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Par= ameter))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFullPath, = StartLine, Parameter))=0D =0D -## SearchFunctionCalling() method=0D +# SearchFunctionCalling() method=0D #=0D # Search all used PPI/PROTOCOL calling function by library=0D # Store the result to database=0D @@ -642,6 +710,8 @@ def SearchProtocols(SqlCommand, Table, SourceFileID, So= urceFileFullPath, ItemMod # @param ItemType: Type of the item, PPI or PROTOCOL=0D # @param ItemMode: Mode of item=0D #=0D +=0D +=0D def SearchFunctionCalling(Table, SourceFileID, SourceFileFullPath, ItemTyp= e, ItemMode):=0D LibraryList =3D {}=0D Db =3D EotGlobalData.gDb.TblReport=0D @@ -675,13 +745,15 @@ def SearchFunctionCalling(Table, SourceFileID, Source= FileFullPath, ItemType, Ite for Parameter in Parameters:=0D if Parameter.startswith('g') or Parameter.endswith('Guid')= or Parameter =3D=3D 'ShellEnvProtocol' or Parameter =3D=3D 'ShellInterface= Protocol':=0D GuidName =3D GetParameterName(Parameter)=0D - Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath= , ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue, BelongsToFu= nction, 0)=0D + Db.Insert(-1, '', '', SourceFileID, SourceFileFullPath= , ItemName, ItemType,=0D + ItemMode, GuidName, GuidMacro, GuidValue, Be= longsToFunction, 0)=0D IsFound =3D True=0D =0D if not IsFound:=0D - EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (ItemType, ItemMode, SourceFileID, SourceFileFullPath, StartLine, Par= ameter))=0D + EotGlobalData.gOP_UN_MATCHED.write('%s, %s, %s, %s, %s, %s= \n' % (=0D + ItemType, ItemMode, SourceFileID, SourceFileFullPath, = StartLine, Parameter))=0D =0D -## FindProtocols() method=0D +# FindProtocols() method=0D #=0D # Find defined protocols=0D #=0D @@ -693,14 +765,14 @@ def SearchFunctionCalling(Table, SourceFileID, Source= FileFullPath, ItemType, Ite # @param ItemType: Type of the item, PPI or PROTOCOL=0D # @param ItemMode: Mode of item=0D #=0D -#def FindProtocols(Db, SqlCommand, Table, SourceFileID, SourceFileFullPath= , ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue):=0D +# def FindProtocols(Db, SqlCommand, Table, SourceFileID, SourceFileFullPat= h, ItemName, ItemType, ItemMode, GuidName, GuidMacro, GuidValue):=0D # BelongsToFunction =3D ''=0D # RecordSet =3D Db.Exec(SqlCommand)=0D # for Record in RecordSet:=0D # IsFound =3D True=0D # Parameter =3D GetProtocolParameter(Record[0])=0D =0D -## GetProtocolParameter() method=0D +# GetProtocolParameter() method=0D #=0D # Parse string of protocol and find parameters=0D #=0D @@ -709,10 +781,12 @@ def SearchFunctionCalling(Table, SourceFileID, Source= FileFullPath, ItemType, Ite #=0D # @return: call common GetParameter=0D #=0D -def GetProtocolParameter(Parameter, Index =3D 1):=0D +=0D +=0D +def GetProtocolParameter(Parameter, Index=3D1):=0D return GetParameter(Parameter, Index)=0D =0D -## GetPpiParameter() method=0D +# GetPpiParameter() method=0D #=0D # Parse string of ppi and find parameters=0D #=0D @@ -721,10 +795,12 @@ def GetProtocolParameter(Parameter, Index =3D 1): #=0D # @return: call common GetParameter=0D #=0D -def GetPpiParameter(Parameter, Index =3D 1):=0D +=0D +=0D +def GetPpiParameter(Parameter, Index=3D1):=0D return GetParameter(Parameter, Index)=0D =0D -## GetParameter() method=0D +# GetParameter() method=0D #=0D # Get a parameter by index=0D #=0D @@ -733,7 +809,9 @@ def GetPpiParameter(Parameter, Index =3D 1): #=0D # @return Parameter: The found parameter=0D #=0D -def GetParameter(Parameter, Index =3D 1):=0D +=0D +=0D +def GetParameter(Parameter, Index=3D1):=0D ParameterList =3D GetSplitValueList(Parameter, TAB_COMMA_SPLIT)=0D if len(ParameterList) > Index:=0D Parameter =3D GetParameterName(ParameterList[Index])=0D @@ -742,7 +820,7 @@ def GetParameter(Parameter, Index =3D 1): =0D return ''=0D =0D -## GetParameterName() method=0D +# GetParameterName() method=0D #=0D # Get a parameter name=0D #=0D @@ -750,13 +828,15 @@ def GetParameter(Parameter, Index =3D 1): #=0D # @return: The name of parameter=0D #=0D +=0D +=0D def GetParameterName(Parameter):=0D if isinstance(Parameter, type('')) and Parameter.startswith('&'):=0D return Parameter[1:].replace('{', '').replace('}', '').replace('\r= ', '').replace('\n', '').strip()=0D else:=0D return Parameter.strip()=0D =0D -## FindKeyValue() method=0D +# FindKeyValue() method=0D #=0D # Find key value of a variable=0D #=0D @@ -766,8 +846,11 @@ def GetParameterName(Parameter): #=0D # @return Value: The value of the keyword=0D #=0D +=0D +=0D def FindKeyValue(Db, Table, Key):=0D - SqlCommand =3D """select Value from %s where Name =3D '%s' and (Model = =3D %s or Model =3D %s)""" % (Table, Key, MODEL_IDENTIFIER_VARIABLE, MODEL_= IDENTIFIER_ASSIGNMENT_EXPRESSION)=0D + SqlCommand =3D """select Value from %s where Name =3D '%s' and (Model = =3D %s or Model =3D %s)""" % (=0D + Table, Key, MODEL_IDENTIFIER_VARIABLE, MODEL_IDENTIFIER_ASSIGNMENT= _EXPRESSION)=0D RecordSet =3D Db.Exec(SqlCommand)=0D Value =3D ''=0D for Record in RecordSet:=0D @@ -779,7 +862,7 @@ def FindKeyValue(Db, Table, Key): else:=0D return Key=0D =0D -## ParseMapFile() method=0D +# ParseMapFile() method=0D #=0D # Parse map files to get a dict of 'ModuleName' : {FunName : FunAddress}= =0D #=0D @@ -787,6 +870,8 @@ def FindKeyValue(Db, Table, Key): #=0D # @return AllMaps: An object of all map files=0D #=0D +=0D +=0D def ParseMapFile(Files):=0D AllMaps =3D {}=0D CurrentModule =3D ''=0D @@ -819,7 +904,7 @@ def ParseMapFile(Files): =0D return AllMaps=0D =0D -## ConvertGuid=0D +# ConvertGuid=0D #=0D # Convert a GUID to a GUID with all upper letters=0D #=0D @@ -827,6 +912,8 @@ def ParseMapFile(Files): #=0D # @param newGuid: The GUID with all upper letters.=0D #=0D +=0D +=0D def ConvertGuid(guid):=0D numList =3D ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']=0D newGuid =3D ''=0D @@ -844,7 +931,7 @@ def ConvertGuid(guid): =0D return newGuid=0D =0D -## ConvertGuid2() method=0D +# ConvertGuid2() method=0D #=0D # Convert a GUID to a GUID with new string instead of old string=0D #=0D @@ -854,12 +941,15 @@ def ConvertGuid(guid): #=0D # @param newGuid: The GUID after replacement=0D #=0D +=0D +=0D def ConvertGuid2(guid, old, new):=0D newGuid =3D ConvertGuid(guid)=0D newGuid =3D newGuid.replace(old, new)=0D =0D return newGuid=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Eot/ParserWarning.py b/BaseTools/Sourc= e/Python/Eot/ParserWarning.py index e84990a4909c..bbee973c96c9 100644 --- a/BaseTools/Source/Python/Eot/ParserWarning.py +++ b/BaseTools/Source/Python/Eot/ParserWarning.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Warning information of Eot=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -6,14 +6,14 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D class Warning (Exception):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D # @param File The FDF name=0D # @param Line The Line number that error occurs=0D #=0D - def __init__(self, Str, File =3D None, Line =3D None):=0D + def __init__(self, Str, File=3DNone, Line=3DNone):=0D self.message =3D Str=0D self.FileName =3D File=0D self.LineNumber =3D Line=0D diff --git a/BaseTools/Source/Python/Eot/Report.py b/BaseTools/Source/Pytho= n/Eot/Report.py index 9d99fe22a0f1..4e39e1b072f6 100644 --- a/BaseTools/Source/Python/Eot/Report.py +++ b/BaseTools/Source/Python/Eot/Report.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create report for Eot tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,20 +13,22 @@ import Common.LongFilePathOs as os from . import EotGlobalData=0D from Common.LongFilePathSupport import OpenLongFilePath as open=0D =0D -## Report() class=0D +# Report() class=0D #=0D # This class defined Report=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class Report(object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self: The object pointer=0D # @param ReportName: name of the report=0D # @param FvObj: FV object after parsing FV images=0D #=0D - def __init__(self, ReportName =3D 'Report.html', FvObj =3D None, Dispa= tchName=3DNone):=0D + def __init__(self, ReportName=3D'Report.html', FvObj=3DNone, DispatchN= ame=3DNone):=0D self.ReportName =3D ReportName=0D self.Op =3D open(ReportName, 'w+')=0D self.DispatchList =3D None=0D @@ -39,7 +41,7 @@ class Report(object): if EotGlobalData.gMACRO['EFI_SOURCE'] =3D=3D '':=0D EotGlobalData.gMACRO['EFI_SOURCE'] =3D EotGlobalData.gMACRO['E= DK_SOURCE']=0D =0D - ## WriteLn() method=0D + # WriteLn() method=0D #=0D # Write a line in the report=0D #=0D @@ -49,7 +51,7 @@ class Report(object): def WriteLn(self, Line):=0D self.Op.write('%s\n' % Line)=0D =0D - ## GenerateReport() method=0D + # GenerateReport() method=0D #=0D # A caller to generate report=0D #=0D @@ -62,7 +64,7 @@ class Report(object): self.Op.close()=0D self.GenerateUnDispatchedList()=0D =0D - ## GenerateUnDispatchedList() method=0D + # GenerateUnDispatchedList() method=0D #=0D # Create a list for not dispatched items=0D #=0D @@ -72,9 +74,10 @@ class Report(object): FvObj =3D self.FvObj=0D EotGlobalData.gOP_UN_DISPATCHED.write('%s\n' % FvObj.Name)=0D for Item in FvObj.UnDispatchedFfsDict.keys():=0D - EotGlobalData.gOP_UN_DISPATCHED.write('%s\n' % FvObj.UnDispatc= hedFfsDict[Item])=0D + EotGlobalData.gOP_UN_DISPATCHED.write(=0D + '%s\n' % FvObj.UnDispatchedFfsDict[Item])=0D =0D - ## GenerateFv() method=0D + # GenerateFv() method=0D #=0D # Generate FV information=0D #=0D @@ -98,7 +101,7 @@ class Report(object): %s=0D %s=0D %s=0D - """ % (FvName, FvGuid, FvSize)=0D + """ % (FvName, FvGuid, FvSize)=0D self.WriteLn(Content)=0D =0D Content =3D """ =0D @@ -125,7 +128,7 @@ class Report(object): """=0D self.WriteLn(Content)=0D =0D - ## GenerateDepex() method=0D + # GenerateDepex() method=0D #=0D # Generate Depex information=0D #=0D @@ -138,7 +141,8 @@ class Report(object): DepexString =3D ''=0D for Item in ItemList:=0D if Item not in NonGuidList:=0D - SqlCommand =3D """select DISTINCT GuidName from Report whe= re GuidValue like '%s' and ItemMode =3D 'Produced' group by GuidName""" % (= Item)=0D + SqlCommand =3D """select DISTINCT GuidName from Report whe= re GuidValue like '%s' and ItemMode =3D 'Produced' group by GuidName""" % (= =0D + Item)=0D RecordSet =3D EotGlobalData.gDb.TblReport.Exec(SqlCommand)= =0D if RecordSet !=3D []:=0D Item =3D RecordSet[0][0]=0D @@ -149,7 +153,7 @@ class Report(object): """ % (DepexString)=0D self.WriteLn(Content)=0D =0D - ## GeneratePpi() method=0D + # GeneratePpi() method=0D #=0D # Generate PPI information=0D #=0D @@ -161,7 +165,7 @@ class Report(object): def GeneratePpi(self, Name, Guid, Type):=0D self.GeneratePpiProtocol('Ppi', Name, Guid, Type, self.PpiIndex)=0D =0D - ## GenerateProtocol() method=0D + # GenerateProtocol() method=0D #=0D # Generate PROTOCOL information=0D #=0D @@ -171,9 +175,10 @@ class Report(object): # @param Type: Type of a GUID=0D #=0D def GenerateProtocol(self, Name, Guid, Type):=0D - self.GeneratePpiProtocol('Protocol', Name, Guid, Type, self.Protoc= olIndex)=0D + self.GeneratePpiProtocol(=0D + 'Protocol', Name, Guid, Type, self.ProtocolIndex)=0D =0D - ## GeneratePpiProtocol() method=0D + # GeneratePpiProtocol() method=0D #=0D # Generate PPI/PROTOCOL information=0D #=0D @@ -201,7 +206,8 @@ class Report(object): select DISTINCT BelongsToFile from Inf=0D where Value1 like '%s')""" % Record[0]=0D ModuleSet =3D EotGlobalData.gDb.TblReport.Exec(SqlCommand)= =0D - Inf =3D ModuleSet[0][0].replace(EotGlobalData.gMACRO['WORK= SPACE'], '.')=0D + Inf =3D ModuleSet[0][0].replace(=0D + EotGlobalData.gMACRO['WORKSPACE'], '.')=0D Function =3D Record[1]=0D Address =3D ''=0D for Item in EotGlobalData.gMap:=0D @@ -220,7 +226,7 @@ class Report(object): """ % ('Callback', Inf, Function, Address)=0D self.WriteLn(Content)=0D =0D - ## GenerateFfs() method=0D + # GenerateFfs() method=0D #=0D # Generate FFS information=0D #=0D @@ -274,13 +280,15 @@ class Report(object): =0D if self.DispatchList:=0D if FfsObj.Type in [0x04, 0x06]:=0D - self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "P= ", FfsName, FfsPath))=0D + self.DispatchList.write("%s %s %s %s\n" % (=0D + FfsGuid, "P", FfsName, FfsPath))=0D if FfsObj.Type in [0x05, 0x07, 0x08, 0x0A]:=0D - self.DispatchList.write("%s %s %s %s\n" % (FfsGuid, "D= ", FfsName, FfsPath))=0D + self.DispatchList.write("%s %s %s %s\n" % (=0D + FfsGuid, "D", FfsName, FfsPath))=0D =0D self.WriteLn(Content)=0D =0D - EotGlobalData.gOP_DISPATCH_ORDER.write('%s\n' %FfsName)=0D + EotGlobalData.gOP_DISPATCH_ORDER.write('%s\n' % FfsName)=0D =0D if FfsObj.Depex !=3D '':=0D Content =3D """ =0D @@ -321,12 +329,13 @@ class Report(object): CName =3D Record[4]=0D Guid =3D Record[3]=0D Type =3D Record[1]=0D - self.GeneratePpiProtocol(Type, Name, Guid, 'Consumed',= CName)=0D + self.GeneratePpiProtocol(=0D + Type, Name, Guid, 'Consumed', CName)=0D =0D Content =3D """
        =0D """=0D self.WriteLn(Content)=0D - #End of Consumed Ppi/Protocol=0D + # End of Consumed Ppi/Protocol=0D =0D # Find Produced Ppi/Protocol=0D SqlCommand =3D """select ModuleName, ItemType, GuidName, GuidV= alue, GuidMacro from Report=0D @@ -354,7 +363,8 @@ class Report(object): CName =3D Record[4]=0D Guid =3D Record[3]=0D Type =3D Record[1]=0D - self.GeneratePpiProtocol(Type, Name, Guid, 'Produced',= CName)=0D + self.GeneratePpiProtocol(=0D + Type, Name, Guid, 'Produced', CName)=0D =0D Content =3D """ =0D """=0D @@ -366,7 +376,7 @@ class Report(object): """=0D self.WriteLn(Content)=0D =0D - ## GenerateTail() method=0D + # GenerateTail() method=0D #=0D # Generate end tags of HTML report=0D #=0D @@ -378,7 +388,7 @@ class Report(object): """=0D self.WriteLn(Tail)=0D =0D - ## GenerateHeader() method=0D + # GenerateHeader() method=0D #=0D # Generate start tags of HTML report=0D #=0D @@ -446,6 +456,7 @@ function funOnMouseOut() """=0D self.WriteLn(Header)=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/Eot/__init__.py b/BaseTools/Source/Pyt= hon/Eot/__init__.py index ba0b8c81fa30..0a328824eb9f 100644 --- a/BaseTools/Source/Python/Eot/__init__.py +++ b/BaseTools/Source/Python/Eot/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Eot' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Eot/c.py b/BaseTools/Source/Python/Eot= /c.py index dd9530fed6d0..95d396a0cde9 100644 --- a/BaseTools/Source/Python/Eot/c.py +++ b/BaseTools/Source/Python/Eot/c.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # preprocess source file=0D #=0D # Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
        = =0D @@ -27,46 +27,55 @@ IncludePathListDict =3D {} ComplexTypeDict =3D {}=0D SUDict =3D {}=0D =0D -## GetFuncDeclPattern() method=0D +# GetFuncDeclPattern() method=0D #=0D # Get the pattern of function declaration=0D #=0D # @return p: the pattern of function declaration=0D #=0D +=0D +=0D def GetFuncDeclPattern():=0D - p =3D re.compile(r'(EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*[_= \w]+\s*\(.*\).*', re.DOTALL)=0D + p =3D re.compile(=0D + r'(EFIAPI|EFI_BOOT_SERVICE|EFI_RUNTIME_SERVICE)?\s*[_\w]+\s*\(.*\)= .*', re.DOTALL)=0D return p=0D =0D -## GetArrayPattern() method=0D +# GetArrayPattern() method=0D #=0D # Get the pattern of array=0D #=0D # @return p: the pattern of array=0D #=0D +=0D +=0D def GetArrayPattern():=0D p =3D re.compile(r'[_\w]*\s*[\[.*\]]+')=0D return p=0D =0D -## GetTypedefFuncPointerPattern() method=0D +# GetTypedefFuncPointerPattern() method=0D #=0D # Get the pattern of function pointer=0D #=0D # @return p: the pattern of function pointer=0D #=0D +=0D +=0D def GetTypedefFuncPointerPattern():=0D p =3D re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOT= ALL)=0D return p=0D =0D -## GetDB() method=0D +# GetDB() method=0D #=0D # Get global database instance=0D #=0D # @return EotGlobalData.gDb: the global database instance=0D #=0D +=0D +=0D def GetDB():=0D return EotGlobalData.gDb=0D =0D -## PrintErrorMsg() method=0D +# PrintErrorMsg() method=0D #=0D # print error message=0D #=0D @@ -75,6 +84,8 @@ def GetDB(): # @param TableName: table name of error found=0D # @param ItemId: id of item=0D #=0D +=0D +=0D def PrintErrorMsg(ErrorType, Msg, TableName, ItemId):=0D Msg =3D Msg.replace('\n', '').replace('\r', '')=0D MsgPartList =3D Msg.split()=0D @@ -82,9 +93,10 @@ def PrintErrorMsg(ErrorType, Msg, TableName, ItemId): for Part in MsgPartList:=0D Msg +=3D Part=0D Msg +=3D ' '=0D - GetDB().TblReport.Insert(ErrorType, OtherMsg =3D Msg, BelongsToTable = =3D TableName, BelongsToItem =3D ItemId)=0D + GetDB().TblReport.Insert(ErrorType, OtherMsg=3DMsg,=0D + BelongsToTable=3DTableName, BelongsToItem=3DI= temId)=0D =0D -## GetIdType() method=0D +# GetIdType() method=0D #=0D # Find type of input string=0D #=0D @@ -92,6 +104,8 @@ def PrintErrorMsg(ErrorType, Msg, TableName, ItemId): #=0D # @return Type: The type of the string=0D #=0D +=0D +=0D def GetIdType(Str):=0D Type =3D DataClass.MODEL_UNKNOWN=0D Str =3D Str.replace('#', '# ')=0D @@ -112,22 +126,26 @@ def GetIdType(Str): Type =3D DataClass.MODEL_UNKNOWN=0D return Type=0D =0D -## GetIdentifierList() method=0D +# GetIdentifierList() method=0D #=0D # Get id of all files=0D #=0D # @return IdList: The list of all id of files=0D #=0D +=0D +=0D def GetIdentifierList():=0D IdList =3D []=0D =0D for pp in FileProfile.PPDirectiveList:=0D Type =3D GetIdType(pp.Content)=0D - IdPP =3D DataClass.IdentifierClass(-1, '', '', '', pp.Content, Typ= e, -1, -1, pp.StartPos[0], pp.StartPos[1], pp.EndPos[0], pp.EndPos[1])=0D + IdPP =3D DataClass.IdentifierClass(-1, '', '', '', pp.Content, Typ= e, -=0D + 1, -1, pp.StartPos[0], pp.StartPo= s[1], pp.EndPos[0], pp.EndPos[1])=0D IdList.append(IdPP)=0D =0D for ae in FileProfile.AssignmentExpressionList:=0D - IdAE =3D DataClass.IdentifierClass(-1, ae.Operator, '', ae.Name, a= e.Value, DataClass.MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION, -1, -1, ae.Start= Pos[0], ae.StartPos[1], ae.EndPos[0], ae.EndPos[1])=0D + IdAE =3D DataClass.IdentifierClass(-1, ae.Operator, '', ae.Name, a= e.Value, DataClass.MODEL_IDENTIFIER_ASSIGNMENT_EXPRESSION, -=0D + 1, -1, ae.StartPos[0], ae.StartPo= s[1], ae.EndPos[0], ae.EndPos[1])=0D IdList.append(IdAE)=0D =0D FuncDeclPattern =3D GetFuncDeclPattern()=0D @@ -147,9 +165,11 @@ def GetIdentifierList(): Index =3D 0=0D while Index < len(FuncNamePartList) - 1:=0D var.Modifier +=3D ' ' + FuncNamePartList[Index]=0D - var.Declarator =3D var.Declarator.lstrip().lstrip(Func= NamePartList[Index])=0D + var.Declarator =3D var.Declarator.lstrip().lstrip(=0D + FuncNamePartList[Index])=0D Index +=3D 1=0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', var.= Declarator, '', DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -1, -1, va= r.StartPos[0], var.StartPos[1], var.EndPos[0], var.EndPos[1])=0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', var.= Declarator, '', DataClass.MODEL_IDENTIFIER_FUNCTION_DECLARATION, -=0D + 1, -1, var.StartPos[0], var.= StartPos[1], var.EndPos[0], var.EndPos[1])=0D IdList.append(IdVar)=0D continue=0D =0D @@ -162,7 +182,8 @@ def GetIdentifierList(): var.Modifier +=3D ' ' + Name[LSBPos:]=0D Name =3D Name[0:LSBPos]=0D =0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', = Name, (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDEN= TIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], var.EndPos[0], v= ar.EndPos[1])=0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', = Name, (len(DeclList) > 1 and [DeclList[1]] or [''])[=0D + 0], DataClass.MODEL_IDEN= TIFIER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], var.EndPos[0], v= ar.EndPos[1])=0D IdList.append(IdVar)=0D else:=0D DeclList =3D var.Declarator.split('=3D')=0D @@ -171,7 +192,8 @@ def GetIdentifierList(): LSBPos =3D var.Declarator.find('[')=0D var.Modifier +=3D ' ' + Name[LSBPos:]=0D Name =3D Name[0:LSBPos]=0D - IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', Name= , (len(DeclList) > 1 and [DeclList[1]]or [''])[0], DataClass.MODEL_IDENTIFI= ER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], var.EndPos[0], var.E= ndPos[1])=0D + IdVar =3D DataClass.IdentifierClass(-1, var.Modifier, '', Name= , (len(DeclList) > 1 and [DeclList[1]] or [''])[=0D + 0], DataClass.MODEL_IDENTIFI= ER_VARIABLE, -1, -1, var.StartPos[0], var.StartPos[1], var.EndPos[0], var.E= ndPos[1])=0D IdList.append(IdVar)=0D =0D for enum in FileProfile.EnumerationDefinitionList:=0D @@ -179,7 +201,8 @@ def GetIdentifierList(): RBPos =3D enum.Content.find('}')=0D Name =3D enum.Content[4:LBPos].strip()=0D Value =3D enum.Content[LBPos+1:RBPos]=0D - IdEnum =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Data= Class.MODEL_IDENTIFIER_ENUMERATE, -1, -1, enum.StartPos[0], enum.StartPos[1= ], enum.EndPos[0], enum.EndPos[1])=0D + IdEnum =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Data= Class.MODEL_IDENTIFIER_ENUMERATE, -=0D + 1, -1, enum.StartPos[0], enum.S= tartPos[1], enum.EndPos[0], enum.EndPos[1])=0D IdList.append(IdEnum)=0D =0D for su in FileProfile.StructUnionDefinitionList:=0D @@ -196,7 +219,8 @@ def GetIdentifierList(): else:=0D Name =3D su.Content[SkipLen:LBPos].strip()=0D Value =3D su.Content[LBPos+1:RBPos]=0D - IdPE =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Type, = -1, -1, su.StartPos[0], su.StartPos[1], su.EndPos[0], su.EndPos[1])=0D + IdPE =3D DataClass.IdentifierClass(-1, '', '', Name, Value, Type, = -=0D + 1, -1, su.StartPos[0], su.StartPo= s[1], su.EndPos[0], su.EndPos[1])=0D IdList.append(IdPE)=0D =0D TdFuncPointerPattern =3D GetTypedefFuncPointerPattern()=0D @@ -219,15 +243,17 @@ def GetIdentifierList(): Name =3D TmpStr[0:RBPos]=0D Value =3D 'FP' + TmpStr[RBPos + 1:]=0D =0D - IdTd =3D DataClass.IdentifierClass(-1, Modifier, '', Name, Value, = DataClass.MODEL_IDENTIFIER_TYPEDEF, -1, -1, td.StartPos[0], td.StartPos[1],= td.EndPos[0], td.EndPos[1])=0D + IdTd =3D DataClass.IdentifierClass(-1, Modifier, '', Name, Value, = DataClass.MODEL_IDENTIFIER_TYPEDEF, -=0D + 1, -1, td.StartPos[0], td.StartPo= s[1], td.EndPos[0], td.EndPos[1])=0D IdList.append(IdTd)=0D =0D for funcCall in FileProfile.FunctionCallingList:=0D - IdFC =3D DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, = funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -1, -1, fu= ncCall.StartPos[0], funcCall.StartPos[1], funcCall.EndPos[0], funcCall.EndP= os[1])=0D + IdFC =3D DataClass.IdentifierClass(-1, '', '', funcCall.FuncName, = funcCall.ParamList, DataClass.MODEL_IDENTIFIER_FUNCTION_CALLING, -=0D + 1, -1, funcCall.StartPos[0], func= Call.StartPos[1], funcCall.EndPos[0], funcCall.EndPos[1])=0D IdList.append(IdFC)=0D return IdList=0D =0D -## GetParamList() method=0D +# GetParamList() method=0D #=0D # Get a list of parameters=0D #=0D @@ -237,7 +263,9 @@ def GetIdentifierList(): #=0D # @return ParamIdList: A list of parameters=0D #=0D -def GetParamList(FuncDeclarator, FuncNameLine =3D 0, FuncNameOffset =3D 0)= :=0D +=0D +=0D +def GetParamList(FuncDeclarator, FuncNameLine=3D0, FuncNameOffset=3D0):=0D ParamIdList =3D []=0D DeclSplitList =3D FuncDeclarator.split('(')=0D if len(DeclSplitList) < 2:=0D @@ -253,7 +281,7 @@ def GetParamList(FuncDeclarator, FuncNameLine =3D 0, Fu= ncNameOffset =3D 0): Start +=3D FuncName.find('\n', Start)=0D Start +=3D 1=0D OffsetSkipped +=3D len(FuncName[Start:])=0D - OffsetSkipped +=3D 1 #skip '('=0D + OffsetSkipped +=3D 1 # skip '('=0D ParamBeginLine =3D FuncNameLine + LineSkipped=0D ParamBeginOffset =3D OffsetSkipped=0D for p in ParamStr.split(','):=0D @@ -289,19 +317,22 @@ def GetParamList(FuncDeclarator, FuncNameLine =3D 0, = FuncNameOffset =3D 0): =0D ParamEndLine =3D ParamBeginLine + LineSkipped=0D ParamEndOffset =3D OffsetSkipped=0D - IdParam =3D DataClass.IdentifierClass(-1, ParamModifier, '', Param= Name, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -1, -1, ParamBeginLine, Par= amBeginOffset, ParamEndLine, ParamEndOffset)=0D + IdParam =3D DataClass.IdentifierClass(-1, ParamModifier, '', Param= Name, '', DataClass.MODEL_IDENTIFIER_PARAMETER, -=0D + 1, -1, ParamBeginLine, ParamBe= ginOffset, ParamEndLine, ParamEndOffset)=0D ParamIdList.append(IdParam)=0D ParamBeginLine =3D ParamEndLine=0D - ParamBeginOffset =3D OffsetSkipped + 1 #skip ','=0D + ParamBeginOffset =3D OffsetSkipped + 1 # skip ','=0D =0D return ParamIdList=0D =0D -## GetFunctionList()=0D +# GetFunctionList()=0D #=0D # Get a list of functions=0D #=0D # @return FuncObjList: A list of function objects=0D #=0D +=0D +=0D def GetFunctionList():=0D FuncObjList =3D []=0D for FuncDef in FileProfile.FunctionDefinitionList:=0D @@ -325,17 +356,20 @@ def GetFunctionList(): FuncDef.Modifier +=3D ' ' + FuncNamePartList[Index]=0D Index +=3D 1=0D =0D - FuncObj =3D DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDe= f.Modifier, FuncName.strip(), '', FuncDef.StartPos[0], FuncDef.StartPos[1],= FuncDef.EndPos[0], FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.Lef= tBracePos[1], -1, ParamIdList, [])=0D + FuncObj =3D DataClass.FunctionClass(-1, FuncDef.Declarator, FuncDe= f.Modifier, FuncName.strip(=0D + ), '', FuncDef.StartPos[0], FuncDef.StartPos[1], FuncDef.EndPos[0]= , FuncDef.EndPos[1], FuncDef.LeftBracePos[0], FuncDef.LeftBracePos[1], -1, = ParamIdList, [])=0D FuncObjList.append(FuncObj)=0D =0D return FuncObjList=0D =0D -## CreateCCodeDB() method=0D +# CreateCCodeDB() method=0D #=0D # Create database for all c code=0D #=0D # @param FileNameList: A list of all c code file names=0D #=0D +=0D +=0D def CreateCCodeDB(FileNameList):=0D FileObjList =3D []=0D ParseErrorFileList =3D []=0D @@ -346,7 +380,8 @@ def CreateCCodeDB(FileNameList): continue=0D ParsedFiles[FullName.lower()] =3D 1=0D EdkLogger.info("Parsing " + FullName)=0D - model =3D FullName.endswith('c') and DataClass.MODEL_FILE_C or= DataClass.MODEL_FILE_H=0D + model =3D FullName.endswith(=0D + 'c') and DataClass.MODEL_FILE_C or DataClass.MODEL_FILE_H= =0D collector =3D CodeFragmentCollector.CodeFragmentCollector(Full= Name)=0D try:=0D collector.ParseFile()=0D @@ -356,12 +391,14 @@ def CreateCCodeDB(FileNameList): DirName =3D os.path.dirname(FullName)=0D Ext =3D os.path.splitext(BaseName)[1].lstrip('.')=0D ModifiedTime =3D os.path.getmtime(FullName)=0D - FileObj =3D DataClass.FileClass(-1, BaseName, Ext, DirName, Fu= llName, model, ModifiedTime, GetFunctionList(), GetIdentifierList(), [])=0D + FileObj =3D DataClass.FileClass(-1, BaseName, Ext, DirName, Fu= llName,=0D + model, ModifiedTime, GetFunction= List(), GetIdentifierList(), [])=0D FileObjList.append(FileObj)=0D collector.CleanFileProfileBuffer()=0D =0D if len(ParseErrorFileList) > 0:=0D - EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n"= % "\n\t".join(ParseErrorFileList))=0D + EdkLogger.info("Found unrecoverable error during parsing:\n\t%s\n"= %=0D + "\n\t".join(ParseErrorFileList))=0D =0D Db =3D EotGlobalData.gDb=0D for file in FileObjList:=0D @@ -369,6 +406,7 @@ def CreateCCodeDB(FileNameList): =0D Db.UpdateIdentifierBelongsToFunction()=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python= /FMMT/FMMT.py index 10800e776a72..e566df65e5fa 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -41,35 +41,37 @@ parser.add_argument("-c", "--ConfigFilePath", dest=3D"C= onfigFilePath", nargs=3D'+', If do not provide, FMMT tool will search the input= file folder for FmmtConf.ini firstly, if not found,\=0D the FmmtConf.ini saved in FMMT tool's folder will = be used as default.")=0D =0D +=0D def print_banner():=0D print("")=0D =0D +=0D class FMMT():=0D def __init__(self) -> None:=0D self.firmware_packet =3D {}=0D =0D - def SetConfigFilePath(self, configfilepath:str) -> str:=0D + def SetConfigFilePath(self, configfilepath: str) -> str:=0D os.environ['FmmtConfPath'] =3D os.path.abspath(configfilepath)=0D =0D - def SetDestPath(self, inputfile:str) -> str:=0D + def SetDestPath(self, inputfile: str) -> str:=0D os.environ['FmmtConfPath'] =3D ''=0D self.dest_path =3D os.path.dirname(os.path.abspath(inputfile))=0D old_env =3D os.environ['PATH']=0D os.environ['PATH'] =3D self.dest_path + os.pathsep + old_env=0D =0D - def CheckFfsName(self, FfsName:str) -> str:=0D + def CheckFfsName(self, FfsName: str) -> str:=0D try:=0D return uuid.UUID(FfsName)=0D except:=0D return FfsName=0D =0D - def GetFvName(self, FvName:str) -> str:=0D + def GetFvName(self, FvName: str) -> str:=0D try:=0D return uuid.UUID(FvName)=0D except:=0D return FvName=0D =0D - def View(self, inputfile: str, layoutfilename: str=3DNone, outputfile:= str=3DNone) -> None:=0D + def View(self, inputfile: str, layoutfilename: str =3D None, outputfil= e: str =3D None) -> None:=0D # ViewFile(inputfile, ROOT_TYPE, logfile, outputfile)=0D self.SetDestPath(inputfile)=0D filetype =3D os.path.splitext(inputfile)[1].lower()=0D @@ -85,38 +87,43 @@ class FMMT(): ROOT_TYPE =3D ROOT_TREE=0D ViewFile(inputfile, ROOT_TYPE, layoutfilename, outputfile)=0D =0D - def Delete(self, inputfile: str, TargetFfs_name: str, outputfile: str,= Fv_name: str=3DNone) -> None:=0D + def Delete(self, inputfile: str, TargetFfs_name: str, outputfile: str,= Fv_name: str =3D None) -> None:=0D self.SetDestPath(inputfile)=0D if Fv_name:=0D - DeleteFfs(inputfile, self.CheckFfsName(TargetFfs_name), output= file, self.GetFvName(Fv_name))=0D + DeleteFfs(inputfile, self.CheckFfsName(TargetFfs_name),=0D + outputfile, self.GetFvName(Fv_name))=0D else:=0D DeleteFfs(inputfile, self.CheckFfsName(TargetFfs_name), output= file)=0D =0D - def Extract(self, inputfile: str, Ffs_name: str, outputfile: str, Fv_n= ame: str=3DNone) -> None:=0D + def Extract(self, inputfile: str, Ffs_name: str, outputfile: str, Fv_n= ame: str =3D None) -> None:=0D self.SetDestPath(inputfile)=0D if Fv_name:=0D - ExtractFfs(inputfile, self.CheckFfsName(Ffs_name), outputfile,= self.GetFvName(Fv_name))=0D + ExtractFfs(inputfile, self.CheckFfsName(Ffs_name),=0D + outputfile, self.GetFvName(Fv_name))=0D else:=0D ExtractFfs(inputfile, self.CheckFfsName(Ffs_name), outputfile)= =0D =0D def Add(self, inputfile: str, Fv_name: str, newffsfile: str, outputfil= e: str) -> None:=0D self.SetDestPath(inputfile)=0D - AddNewFfs(inputfile, self.CheckFfsName(Fv_name), newffsfile, outpu= tfile)=0D + AddNewFfs(inputfile, self.CheckFfsName(=0D + Fv_name), newffsfile, outputfile)=0D =0D - def Replace(self,inputfile: str, Ffs_name: str, newffsfile: str, outpu= tfile: str, Fv_name: str=3DNone) -> None:=0D + def Replace(self, inputfile: str, Ffs_name: str, newffsfile: str, outp= utfile: str, Fv_name: str =3D None) -> None:=0D self.SetDestPath(inputfile)=0D if Fv_name:=0D - ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name), newffsfile,= outputfile, self.GetFvName(Fv_name))=0D + ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name),=0D + newffsfile, outputfile, self.GetFvName(Fv_name))=0D else:=0D - ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name), newffsfile,= outputfile)=0D + ReplaceFfs(inputfile, self.CheckFfsName(=0D + Ffs_name), newffsfile, outputfile)=0D =0D =0D def main():=0D - args=3Dparser.parse_args()=0D - status=3D0=0D + args =3D parser.parse_args()=0D + status =3D 0=0D =0D try:=0D - fmmt=3DFMMT()=0D + fmmt =3D FMMT()=0D if args.ConfigFilePath:=0D fmmt.SetConfigFilePath(args.ConfigFilePath[0])=0D if args.View:=0D @@ -126,21 +133,25 @@ def main(): fmmt.View(args.View[0])=0D elif args.Delete:=0D if len(args.Delete) =3D=3D 4:=0D - fmmt.Delete(args.Delete[0],args.Delete[2],args.Delete[3],a= rgs.Delete[1])=0D + fmmt.Delete(args.Delete[0], args.Delete[2],=0D + args.Delete[3], args.Delete[1])=0D else:=0D - fmmt.Delete(args.Delete[0],args.Delete[1],args.Delete[2])= =0D + fmmt.Delete(args.Delete[0], args.Delete[1], args.Delete[2]= )=0D elif args.Extract:=0D if len(args.Extract) =3D=3D 4:=0D - fmmt.Extract(args.Extract[0],args.Extract[2],args.Extract[= 3], args.Extract[1])=0D + fmmt.Extract(args.Extract[0], args.Extract[2],=0D + args.Extract[3], args.Extract[1])=0D else:=0D - fmmt.Extract(args.Extract[0],args.Extract[1],args.Extract[= 2])=0D + fmmt.Extract(args.Extract[0], args.Extract[1], args.Extrac= t[2])=0D elif args.Add:=0D - fmmt.Add(args.Add[0],args.Add[1],args.Add[2],args.Add[3])=0D + fmmt.Add(args.Add[0], args.Add[1], args.Add[2], args.Add[3])=0D elif args.Replace:=0D if len(args.Replace) =3D=3D 5:=0D - fmmt.Replace(args.Replace[0],args.Replace[2],args.Replace[= 3],args.Replace[4],args.Replace[1])=0D + fmmt.Replace(args.Replace[0], args.Replace[2],=0D + args.Replace[3], args.Replace[4], args.Replac= e[1])=0D else:=0D - fmmt.Replace(args.Replace[0],args.Replace[1],args.Replace[= 2],args.Replace[3])=0D + fmmt.Replace(args.Replace[0], args.Replace[1],=0D + args.Replace[2], args.Replace[3])=0D else:=0D parser.print_help()=0D except Exception as e:=0D diff --git a/BaseTools/Source/Python/FMMT/__init__.py b/BaseTools/Source/Py= thon/FMMT/__init__.py index 04e6ec098d0e..ed81c69d67b0 100644 --- a/BaseTools/Source/Python/FMMT/__init__.py +++ b/BaseTools/Source/Python/FMMT/__init__.py @@ -1,6 +1,6 @@ -## @file=0D +# @file=0D # This file is used to define the FMMT dependent external tool.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D -##=0D \ No newline at end of file +##=0D diff --git a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py b/Ba= seTools/Source/Python/FMMT/core/BinaryFactoryProduct.py index 2d4e6d9276d7..16a3ddbc0ae6 100644 --- a/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py +++ b/BaseTools/Source/Python/FMMT/core/BinaryFactoryProduct.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to implement of the various bianry parser.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -29,19 +29,23 @@ SEC_FV_TREE =3D 'SEC_FV_IMAGE' BINARY_DATA =3D 'BINARY'=0D Fv_count =3D 0=0D =0D -## Abstract factory=0D +# Abstract factory=0D +=0D +=0D class BinaryFactory():=0D - type:list =3D []=0D + type: list =3D []=0D =0D def Create_Product():=0D pass=0D =0D +=0D class BinaryProduct():=0D - ## Use GuidTool to decompress data.=0D + # Use GuidTool to decompress data.=0D def DeCompressData(self, GuidTool, Section_Data: bytes, FileName) -> b= ytes:=0D guidtool =3D GUIDTools().__getitem__(struct2stream(GuidTool))=0D if not guidtool.ifexist:=0D - logger.error("GuidTool {} is not found when decompressing {} f= ile.\n".format(guidtool.command, FileName))=0D + logger.error("GuidTool {} is not found when decompressing {} f= ile.\n".format(=0D + guidtool.command, FileName))=0D raise Exception("Process Failed: GuidTool not found!")=0D DecompressedData =3D guidtool.unpack(Section_Data)=0D return DecompressedData=0D @@ -49,33 +53,38 @@ class BinaryProduct(): def ParserData():=0D pass=0D =0D +=0D class SectionFactory(BinaryFactory):=0D type =3D [SECTION_TREE]=0D =0D def Create_Product():=0D return SectionProduct()=0D =0D +=0D class FfsFactory(BinaryFactory):=0D type =3D [ROOT_SECTION_TREE, FFS_TREE]=0D =0D def Create_Product():=0D return FfsProduct()=0D =0D +=0D class FvFactory(BinaryFactory):=0D type =3D [ROOT_FFS_TREE, FV_TREE, SEC_FV_TREE]=0D =0D def Create_Product():=0D return FvProduct()=0D =0D +=0D class FdFactory(BinaryFactory):=0D type =3D [ROOT_FV_TREE, ROOT_TREE]=0D =0D def Create_Product():=0D return FdProduct()=0D =0D +=0D class SectionProduct(BinaryProduct):=0D - ## Decompress the compressed section.=0D - def ParserData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset= : int=3D0) -> None:=0D + # Decompress the compressed section.=0D + def ParserData(self, Section_Tree, whole_Data: bytes, Rel_Whole_Offset= : int =3D 0) -> None:=0D if Section_Tree.Data.Type =3D=3D 0x01:=0D Section_Tree.Data.OriData =3D Section_Tree.Data.Data=0D self.ParserSection(Section_Tree, b'')=0D @@ -83,8 +92,10 @@ class SectionProduct(BinaryProduct): elif Section_Tree.Data.Type =3D=3D 0x02:=0D Section_Tree.Data.OriData =3D Section_Tree.Data.Data=0D DeCompressGuidTool =3D Section_Tree.Data.ExtHeader.SectionDefi= nitionGuid=0D - Section_Tree.Data.Data =3D self.DeCompressData(DeCompressGuidT= ool, Section_Tree.Data.Data, Section_Tree.Parent.Data.Name)=0D - Section_Tree.Data.Size =3D len(Section_Tree.Data.Data) + Secti= on_Tree.Data.HeaderLength=0D + Section_Tree.Data.Data =3D self.DeCompressData(=0D + DeCompressGuidTool, Section_Tree.Data.Data, Section_Tree.P= arent.Data.Name)=0D + Section_Tree.Data.Size =3D len(=0D + Section_Tree.Data.Data) + Section_Tree.Data.HeaderLength=0D self.ParserSection(Section_Tree, b'')=0D elif Section_Tree.Data.Type =3D=3D 0x03:=0D Section_Tree.Data.OriData =3D Section_Tree.Data.Data=0D @@ -93,16 +104,17 @@ class SectionProduct(BinaryProduct): elif Section_Tree.Data.Type =3D=3D 0x17:=0D global Fv_count=0D Sec_Fv_Info =3D FvNode(Fv_count, Section_Tree.Data.Data)=0D - Sec_Fv_Tree =3D BIOSTREE('FV'+ str(Fv_count))=0D + Sec_Fv_Tree =3D BIOSTREE('FV' + str(Fv_count))=0D Sec_Fv_Tree.type =3D SEC_FV_TREE=0D Sec_Fv_Tree.Data =3D Sec_Fv_Info=0D Sec_Fv_Tree.Data.HOffset =3D Section_Tree.Data.DOffset=0D - Sec_Fv_Tree.Data.DOffset =3D Sec_Fv_Tree.Data.HOffset + Sec_Fv= _Tree.Data.Header.HeaderLength=0D + Sec_Fv_Tree.Data.DOffset =3D Sec_Fv_Tree.Data.HOffset + \=0D + Sec_Fv_Tree.Data.Header.HeaderLength=0D Sec_Fv_Tree.Data.Data =3D Section_Tree.Data.Data[Sec_Fv_Tree.D= ata.Header.HeaderLength:]=0D Section_Tree.insertChild(Sec_Fv_Tree)=0D Fv_count +=3D 1=0D =0D - def ParserSection(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: = int=3D0) -> None:=0D + def ParserSection(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: = int =3D 0) -> None:=0D Rel_Offset =3D 0=0D Section_Offset =3D 0=0D # Get the Data from parent tree, if do not have the tree then get = it from the whole_data.=0D @@ -118,8 +130,10 @@ class SectionProduct(BinaryProduct): Section_Info =3D SectionNode(Whole_Data[Rel_Offset:])=0D Section_Tree =3D BIOSTREE(Section_Info.Name)=0D Section_Tree.type =3D SECTION_TREE=0D - Section_Info.Data =3D Whole_Data[Rel_Offset+Section_Info.Heade= rLength: Rel_Offset+Section_Info.Size]=0D - Section_Info.DOffset =3D Section_Offset + Section_Info.HeaderL= ength + Rel_Whole_Offset=0D + Section_Info.Data =3D Whole_Data[Rel_Offset +=0D + Section_Info.HeaderLength: Rel_= Offset+Section_Info.Size]=0D + Section_Info.DOffset =3D Section_Offset + \=0D + Section_Info.HeaderLength + Rel_Whole_Offset=0D Section_Info.HOffset =3D Section_Offset + Rel_Whole_Offset=0D Section_Info.ROffset =3D Rel_Offset=0D if Section_Info.Header.Type =3D=3D 0:=0D @@ -127,11 +141,14 @@ class SectionProduct(BinaryProduct): # The final Section in parent Section does not need to add pad= ding, else must be 4-bytes align with parent Section start offset=0D Pad_Size =3D 0=0D if (Rel_Offset+Section_Info.HeaderLength+len(Section_Info.Data= ) !=3D Data_Size):=0D - Pad_Size =3D GetPadSize(Section_Info.Size, SECTION_COMMON_= ALIGNMENT)=0D + Pad_Size =3D GetPadSize(=0D + Section_Info.Size, SECTION_COMMON_ALIGNMENT)=0D Section_Info.PadData =3D Pad_Size * b'\x00'=0D if Section_Info.Header.Type =3D=3D 0x02:=0D - Section_Info.DOffset =3D Section_Offset + Section_Info.Ext= Header.DataOffset + Rel_Whole_Offset=0D - Section_Info.Data =3D Whole_Data[Rel_Offset+Section_Info.E= xtHeader.DataOffset: Rel_Offset+Section_Info.Size]=0D + Section_Info.DOffset =3D Section_Offset + \=0D + Section_Info.ExtHeader.DataOffset + Rel_Whole_Offset=0D + Section_Info.Data =3D Whole_Data[Rel_Offset +=0D + Section_Info.ExtHeader.Data= Offset: Rel_Offset+Section_Info.Size]=0D if Section_Info.Header.Type =3D=3D 0x14:=0D ParTree.Data.Version =3D Section_Info.ExtHeader.GetVersion= String()=0D if Section_Info.Header.Type =3D=3D 0x15:=0D @@ -144,9 +161,10 @@ class SectionProduct(BinaryProduct): Section_Tree.Data =3D Section_Info=0D ParTree.insertChild(Section_Tree)=0D =0D +=0D class FfsProduct(BinaryProduct):=0D # ParserFFs / GetSection=0D - def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int= =3D0) -> None:=0D + def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int= =3D 0) -> None:=0D Rel_Offset =3D 0=0D Section_Offset =3D 0=0D # Get the Data from parent tree, if do not have the tree then get = it from the whole_data.=0D @@ -162,8 +180,10 @@ class FfsProduct(BinaryProduct): Section_Info =3D SectionNode(Whole_Data[Rel_Offset:])=0D Section_Tree =3D BIOSTREE(Section_Info.Name)=0D Section_Tree.type =3D SECTION_TREE=0D - Section_Info.Data =3D Whole_Data[Rel_Offset+Section_Info.Heade= rLength: Rel_Offset+Section_Info.Size]=0D - Section_Info.DOffset =3D Section_Offset + Section_Info.HeaderL= ength + Rel_Whole_Offset=0D + Section_Info.Data =3D Whole_Data[Rel_Offset +=0D + Section_Info.HeaderLength: Rel_= Offset+Section_Info.Size]=0D + Section_Info.DOffset =3D Section_Offset + \=0D + Section_Info.HeaderLength + Rel_Whole_Offset=0D Section_Info.HOffset =3D Section_Offset + Rel_Whole_Offset=0D Section_Info.ROffset =3D Rel_Offset=0D if Section_Info.Header.Type =3D=3D 0:=0D @@ -171,11 +191,14 @@ class FfsProduct(BinaryProduct): # The final Section in Ffs does not need to add padding, else = must be 4-bytes align with Ffs start offset=0D Pad_Size =3D 0=0D if (Rel_Offset+Section_Info.HeaderLength+len(Section_Info.Data= ) !=3D Data_Size):=0D - Pad_Size =3D GetPadSize(Section_Info.Size, SECTION_COMMON_= ALIGNMENT)=0D + Pad_Size =3D GetPadSize(=0D + Section_Info.Size, SECTION_COMMON_ALIGNMENT)=0D Section_Info.PadData =3D Pad_Size * b'\x00'=0D if Section_Info.Header.Type =3D=3D 0x02:=0D - Section_Info.DOffset =3D Section_Offset + Section_Info.Ext= Header.DataOffset + Rel_Whole_Offset=0D - Section_Info.Data =3D Whole_Data[Rel_Offset+Section_Info.E= xtHeader.DataOffset: Rel_Offset+Section_Info.Size]=0D + Section_Info.DOffset =3D Section_Offset + \=0D + Section_Info.ExtHeader.DataOffset + Rel_Whole_Offset=0D + Section_Info.Data =3D Whole_Data[Rel_Offset +=0D + Section_Info.ExtHeader.Data= Offset: Rel_Offset+Section_Info.Size]=0D # If Section is Version or UI type, it saves the version and U= I info of its parent Ffs.=0D if Section_Info.Header.Type =3D=3D 0x14:=0D ParTree.Data.Version =3D Section_Info.ExtHeader.GetVersion= String()=0D @@ -189,9 +212,10 @@ class FfsProduct(BinaryProduct): Section_Tree.Data =3D Section_Info=0D ParTree.insertChild(Section_Tree)=0D =0D +=0D class FvProduct(BinaryProduct):=0D ## ParserFv / GetFfs=0D - def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int= =3D0) -> None:=0D + def ParserData(self, ParTree, Whole_Data: bytes, Rel_Whole_Offset: int= =3D 0) -> None:=0D Ffs_Offset =3D 0=0D Rel_Offset =3D 0=0D # Get the Data from parent tree, if do not have the tree then get = it from the whole_data.=0D @@ -221,8 +245,10 @@ class FvProduct(BinaryProduct): Ffs_Info.ROffset =3D Rel_Offset=0D if Ffs_Info.Name =3D=3D PADVECTOR:=0D Ffs_Tree.type =3D FFS_PAD=0D - Ffs_Info.Data =3D Whole_Data[Rel_Offset+Ffs_Info.Heade= r.HeaderLength: Rel_Offset+Ffs_Info.Size]=0D - Ffs_Info.Size =3D len(Ffs_Info.Data) + Ffs_Info.Header= .HeaderLength=0D + Ffs_Info.Data =3D Whole_Data[Rel_Offset +=0D + Ffs_Info.Header.HeaderLengt= h: Rel_Offset+Ffs_Info.Size]=0D + Ffs_Info.Size =3D len(Ffs_Info.Data) + \=0D + Ffs_Info.Header.HeaderLength=0D # if current Ffs is the final ffs of Fv and full of b'= \xff', define it with Free_Space=0D if struct2stream(Ffs_Info.Header).replace(b'\xff', b''= ) =3D=3D b'':=0D Ffs_Tree.type =3D FFS_FREE_SPACE=0D @@ -231,7 +257,8 @@ class FvProduct(BinaryProduct): ParTree.Data.Free_Space =3D Ffs_Info.Size=0D else:=0D Ffs_Tree.type =3D FFS_TREE=0D - Ffs_Info.Data =3D Whole_Data[Rel_Offset+Ffs_Info.Heade= r.HeaderLength: Rel_Offset+Ffs_Info.Size]=0D + Ffs_Info.Data =3D Whole_Data[Rel_Offset +=0D + Ffs_Info.Header.HeaderLengt= h: Rel_Offset+Ffs_Info.Size]=0D # The final Ffs in Fv does not need to add padding, else m= ust be 8-bytes align with Fv start offset=0D Pad_Size =3D 0=0D if Ffs_Tree.type !=3D FFS_FREE_SPACE and (Rel_Offset+Ffs_I= nfo.Header.HeaderLength+len(Ffs_Info.Data) !=3D Data_Size):=0D @@ -242,11 +269,12 @@ class FvProduct(BinaryProduct): Ffs_Tree.Data =3D Ffs_Info=0D ParTree.insertChild(Ffs_Tree)=0D =0D +=0D class FdProduct(BinaryProduct):=0D type =3D [ROOT_FV_TREE, ROOT_TREE]=0D =0D - ## Create DataTree with first level /fv Info, then parser each Fv.=0D - def ParserData(self, WholeFvTree, whole_data: bytes=3Db'', offset: int= =3D0) -> None:=0D + # Create DataTree with first level /fv Info, then parser each Fv.=0D + def ParserData(self, WholeFvTree, whole_data: bytes =3D b'', offset: i= nt =3D 0) -> None:=0D # Get all Fv image in Fd with offset and length=0D Fd_Struct =3D self.GetFvFromFd(whole_data)=0D data_size =3D len(whole_data)=0D @@ -254,7 +282,7 @@ class FdProduct(BinaryProduct): global Fv_count=0D # If the first Fv image is the Binary Fv, add it into the tree.=0D if Fd_Struct[0][1] !=3D 0:=0D - Binary_node =3D BIOSTREE('BINARY'+ str(Binary_count))=0D + Binary_node =3D BIOSTREE('BINARY' + str(Binary_count))=0D Binary_node.type =3D BINARY_DATA=0D Binary_node.Data =3D BinaryNode(str(Binary_count))=0D Binary_node.Data.Data =3D whole_data[:Fd_Struct[0][1]]=0D @@ -263,56 +291,66 @@ class FdProduct(BinaryProduct): WholeFvTree.insertChild(Binary_node)=0D Binary_count +=3D 1=0D # Add the first collected Fv image into the tree.=0D - Cur_node =3D BIOSTREE(Fd_Struct[0][0]+ str(Fv_count))=0D + Cur_node =3D BIOSTREE(Fd_Struct[0][0] + str(Fv_count))=0D Cur_node.type =3D Fd_Struct[0][0]=0D - Cur_node.Data =3D FvNode(Fv_count, whole_data[Fd_Struct[0][1]:Fd_S= truct[0][1]+Fd_Struct[0][2][0]])=0D + Cur_node.Data =3D FvNode(=0D + Fv_count, whole_data[Fd_Struct[0][1]:Fd_Struct[0][1]+Fd_Struct= [0][2][0]])=0D Cur_node.Data.HOffset =3D Fd_Struct[0][1] + offset=0D Cur_node.Data.DOffset =3D Cur_node.Data.HOffset+Cur_node.Data.Head= er.HeaderLength=0D - Cur_node.Data.Data =3D whole_data[Fd_Struct[0][1]+Cur_node.Data.He= ader.HeaderLength:Fd_Struct[0][1]+Cur_node.Data.Size]=0D + Cur_node.Data.Data =3D whole_data[Fd_Struct[0][1] +=0D + Cur_node.Data.Header.HeaderLength:= Fd_Struct[0][1]+Cur_node.Data.Size]=0D WholeFvTree.insertChild(Cur_node)=0D Fv_count +=3D 1=0D Fv_num =3D len(Fd_Struct)=0D # Add all the collected Fv image and the Binary Fv image between t= hem into the tree.=0D for i in range(Fv_num-1):=0D if Fd_Struct[i][1]+Fd_Struct[i][2][0] !=3D Fd_Struct[i+1][1]:= =0D - Binary_node =3D BIOSTREE('BINARY'+ str(Binary_count))=0D + Binary_node =3D BIOSTREE('BINARY' + str(Binary_count))=0D Binary_node.type =3D BINARY_DATA=0D Binary_node.Data =3D BinaryNode(str(Binary_count))=0D - Binary_node.Data.Data =3D whole_data[Fd_Struct[i][1]+Fd_St= ruct[i][2][0]:Fd_Struct[i+1][1]]=0D + Binary_node.Data.Data =3D whole_data[Fd_Struct[i]=0D + [1]+Fd_Struct[i][2][0]:= Fd_Struct[i+1][1]]=0D Binary_node.Data.Size =3D len(Binary_node.Data.Data)=0D - Binary_node.Data.HOffset =3D Fd_Struct[i][1]+Fd_Struct[i][= 2][0] + offset=0D + Binary_node.Data.HOffset =3D Fd_Struct[i][1] + \=0D + Fd_Struct[i][2][0] + offset=0D WholeFvTree.insertChild(Binary_node)=0D Binary_count +=3D 1=0D - Cur_node =3D BIOSTREE(Fd_Struct[i+1][0]+ str(Fv_count))=0D + Cur_node =3D BIOSTREE(Fd_Struct[i+1][0] + str(Fv_count))=0D Cur_node.type =3D Fd_Struct[i+1][0]=0D - Cur_node.Data =3D FvNode(Fv_count, whole_data[Fd_Struct[i+1][1= ]:Fd_Struct[i+1][1]+Fd_Struct[i+1][2][0]])=0D + Cur_node.Data =3D FvNode(=0D + Fv_count, whole_data[Fd_Struct[i+1][1]:Fd_Struct[i+1][1]+F= d_Struct[i+1][2][0]])=0D Cur_node.Data.HOffset =3D Fd_Struct[i+1][1] + offset=0D Cur_node.Data.DOffset =3D Cur_node.Data.HOffset+Cur_node.Data.= Header.HeaderLength=0D - Cur_node.Data.Data =3D whole_data[Fd_Struct[i+1][1]+Cur_node.D= ata.Header.HeaderLength:Fd_Struct[i+1][1]+Cur_node.Data.Size]=0D + Cur_node.Data.Data =3D whole_data[Fd_Struct[i+1][1] +=0D + Cur_node.Data.Header.HeaderLen= gth:Fd_Struct[i+1][1]+Cur_node.Data.Size]=0D WholeFvTree.insertChild(Cur_node)=0D Fv_count +=3D 1=0D # If the final Fv image is the Binary Fv, add it into the tree=0D if Fd_Struct[-1][1] + Fd_Struct[-1][2][0] !=3D data_size:=0D - Binary_node =3D BIOSTREE('BINARY'+ str(Binary_count))=0D + Binary_node =3D BIOSTREE('BINARY' + str(Binary_count))=0D Binary_node.type =3D BINARY_DATA=0D Binary_node.Data =3D BinaryNode(str(Binary_count))=0D - Binary_node.Data.Data =3D whole_data[Fd_Struct[-1][1]+Fd_Struc= t[-1][2][0]:]=0D + Binary_node.Data.Data =3D whole_data[Fd_Struct[-1]=0D + [1]+Fd_Struct[-1][2][0]:]=0D Binary_node.Data.Size =3D len(Binary_node.Data.Data)=0D - Binary_node.Data.HOffset =3D Fd_Struct[-1][1]+Fd_Struct[-1][2]= [0] + offset=0D + Binary_node.Data.HOffset =3D Fd_Struct[-1][1] + \=0D + Fd_Struct[-1][2][0] + offset=0D WholeFvTree.insertChild(Binary_node)=0D Binary_count +=3D 1=0D =0D - ## Get the first level Fv from Fd file.=0D - def GetFvFromFd(self, whole_data: bytes=3Db'') -> list:=0D + # Get the first level Fv from Fd file.=0D + def GetFvFromFd(self, whole_data: bytes =3D b'') -> list:=0D Fd_Struct =3D []=0D data_size =3D len(whole_data)=0D cur_index =3D 0=0D # Get all the EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE FV image offset = and length.=0D while cur_index < data_size:=0D if EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE in whole_data[cur_index= :]:=0D - target_index =3D whole_data[cur_index:].index(EFI_FIRMWARE= _FILE_SYSTEM2_GUID_BYTE) + cur_index=0D + target_index =3D whole_data[cur_index:].index(=0D + EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE) + cur_index=0D if whole_data[target_index+24:target_index+28] =3D=3D FVH_= SIGNATURE:=0D - Fd_Struct.append([FV_TREE, target_index - 16, unpack("= Q", whole_data[target_index+16:target_index+24])])=0D + Fd_Struct.append(=0D + [FV_TREE, target_index - 16, unpack("Q", whole_dat= a[target_index+16:target_index+24])])=0D cur_index =3D Fd_Struct[-1][1] + Fd_Struct[-1][2][0]=0D else:=0D cur_index =3D target_index + 16=0D @@ -322,9 +360,11 @@ class FdProduct(BinaryProduct): # Get all the EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE FV image offset = and length.=0D while cur_index < data_size:=0D if EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE in whole_data[cur_index= :]:=0D - target_index =3D whole_data[cur_index:].index(EFI_FIRMWARE= _FILE_SYSTEM3_GUID_BYTE) + cur_index=0D + target_index =3D whole_data[cur_index:].index(=0D + EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE) + cur_index=0D if whole_data[target_index+24:target_index+28] =3D=3D FVH_= SIGNATURE:=0D - Fd_Struct.append([FV_TREE, target_index - 16, unpack("= Q", whole_data[target_index+16:target_index+24])])=0D + Fd_Struct.append(=0D + [FV_TREE, target_index - 16, unpack("Q", whole_dat= a[target_index+16:target_index+24])])=0D cur_index =3D Fd_Struct[-1][1] + Fd_Struct[-1][2][0]=0D else:=0D cur_index =3D target_index + 16=0D @@ -334,28 +374,31 @@ class FdProduct(BinaryProduct): # Get all the EFI_SYSTEM_NVDATA_FV_GUID_BYTE FV image offset and l= ength.=0D while cur_index < data_size:=0D if EFI_SYSTEM_NVDATA_FV_GUID_BYTE in whole_data[cur_index:]:=0D - target_index =3D whole_data[cur_index:].index(EFI_SYSTEM_N= VDATA_FV_GUID_BYTE) + cur_index=0D + target_index =3D whole_data[cur_index:].index(=0D + EFI_SYSTEM_NVDATA_FV_GUID_BYTE) + cur_index=0D if whole_data[target_index+24:target_index+28] =3D=3D FVH_= SIGNATURE:=0D - Fd_Struct.append([DATA_FV_TREE, target_index - 16, unp= ack("Q", whole_data[target_index+16:target_index+24])])=0D + Fd_Struct.append(=0D + [DATA_FV_TREE, target_index - 16, unpack("Q", whol= e_data[target_index+16:target_index+24])])=0D cur_index =3D Fd_Struct[-1][1] + Fd_Struct[-1][2][0]=0D else:=0D cur_index =3D target_index + 16=0D else:=0D cur_index =3D data_size=0D # Sort all the collect Fv image with offset.=0D - Fd_Struct.sort(key=3Dlambda x:x[1])=0D + Fd_Struct.sort(key=3Dlambda x: x[1])=0D tmp_struct =3D copy.deepcopy(Fd_Struct)=0D tmp_index =3D 0=0D Fv_num =3D len(Fd_Struct)=0D # Remove the Fv image included in another Fv image.=0D - for i in range(1,Fv_num):=0D + for i in range(1, Fv_num):=0D if tmp_struct[i][1]+tmp_struct[i][2][0] < tmp_struct[i-1][1]+t= mp_struct[i-1][2][0]:=0D Fd_Struct.remove(Fd_Struct[i-tmp_index])=0D tmp_index +=3D 1=0D return Fd_Struct=0D =0D +=0D class ParserEntry():=0D - FactoryTable:dict =3D {=0D + FactoryTable: dict =3D {=0D SECTION_TREE: SectionFactory,=0D ROOT_SECTION_TREE: FfsFactory,=0D FFS_TREE: FfsFactory,=0D @@ -377,4 +420,4 @@ class ParserEntry(): def DataParser(self, Tree, Data: bytes, Offset: int) -> None:=0D TargetFactory =3D self.GetTargetFactory(Tree.type)=0D if TargetFactory:=0D - self.Generate_Product(TargetFactory, Tree, Data, Offset)=0D \ No newline at end of file + self.Generate_Product(TargetFactory, Tree, Data, Offset)=0D diff --git a/BaseTools/Source/Python/FMMT/core/BiosTree.py b/BaseTools/Sour= ce/Python/FMMT/core/BiosTree.py index d8fa4743354a..ab9cc6995e12 100644 --- a/BaseTools/Source/Python/FMMT/core/BiosTree.py +++ b/BaseTools/Source/Python/FMMT/core/BiosTree.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the Bios layout tree structure and related o= perations.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -27,6 +27,7 @@ FvType =3D [FV_TREE, SEC_FV_TREE] FfsType =3D FFS_TREE=0D SecType =3D SECTION_TREE=0D =0D +=0D class BIOSTREE:=0D def __init__(self, NodeName: str) -> None:=0D self.key =3D NodeName=0D @@ -52,7 +53,7 @@ class BIOSTREE: return False=0D =0D # FvTree.insertChild()=0D - def insertChild(self, newNode, pos: int=3DNone) -> None:=0D + def insertChild(self, newNode, pos: int =3D None) -> None:=0D if len(self.Child) =3D=3D 0:=0D self.Child.append(newNode)=0D else:=0D @@ -112,39 +113,48 @@ class BIOSTREE: self =3D self.Parent=0D return BiosTreePath=0D =0D - def parserTree(self, TargetDict: dict=3DNone, Info: list=3DNone, space= : int=3D0, ParFvId=3D"") -> None:=0D + def parserTree(self, TargetDict: dict =3D None, Info: list =3D None, s= pace: int =3D 0, ParFvId=3D"") -> None:=0D Key =3D list(TargetDict.keys())[0]=0D if TargetDict[Key]["Type"] in RootType:=0D Info.append("Image File: {}".format(Key))=0D - Info.append("FilesNum: {}".format(TargetDict.get(Key).get('Fil= esNum')))=0D + Info.append("FilesNum: {}".format(=0D + TargetDict.get(Key).get('FilesNum')))=0D Info.append("\n")=0D elif TargetDict[Key]["Type"] in FvType:=0D space +=3D 2=0D if TargetDict[Key]["Type"] =3D=3D SEC_FV_TREE:=0D - Info.append("{}Child FV named {} of {}".format(space*" ", = Key, ParFvId))=0D + Info.append("{}Child FV named {} of {}".format(=0D + space*" ", Key, ParFvId))=0D space +=3D 2=0D else:=0D Info.append("FvId: {}".format(Key))=0D ParFvId =3D Key=0D - Info.append("{}FvNameGuid: {}".format(space*" ", TargetDict.ge= t(Key).get('FvNameGuid')))=0D - Info.append("{}Attributes: {}".format(space*" ", TargetDict.ge= t(Key).get('Attributes')))=0D - Info.append("{}Total Volume Size: {}".format(space*" ", Target= Dict.get(Key).get('Size')))=0D - Info.append("{}Free Volume Size: {}".format(space*" ", TargetD= ict.get(Key).get('FreeSize')))=0D - Info.append("{}Volume Offset: {}".format(space*" ", TargetDict= .get(Key).get('Offset')))=0D - Info.append("{}FilesNum: {}".format(space*" ", TargetDict.get(= Key).get('FilesNum')))=0D + Info.append("{}FvNameGuid: {}".format(=0D + space*" ", TargetDict.get(Key).get('FvNameGuid')))=0D + Info.append("{}Attributes: {}".format(=0D + space*" ", TargetDict.get(Key).get('Attributes')))=0D + Info.append("{}Total Volume Size: {}".format(=0D + space*" ", TargetDict.get(Key).get('Size')))=0D + Info.append("{}Free Volume Size: {}".format(=0D + space*" ", TargetDict.get(Key).get('FreeSize')))=0D + Info.append("{}Volume Offset: {}".format(=0D + space*" ", TargetDict.get(Key).get('Offset')))=0D + Info.append("{}FilesNum: {}".format(=0D + space*" ", TargetDict.get(Key).get('FilesNum')))=0D elif TargetDict[Key]["Type"] in FfsType:=0D space +=3D 2=0D if TargetDict.get(Key).get('UiName') !=3D "b''":=0D - Info.append("{}File: {} / {}".format(space*" ", Key, Targe= tDict.get(Key).get('UiName')))=0D + Info.append("{}File: {} / {}".format(space*" ",=0D + Key, TargetDict.get(Key).get('UiName')))=0D else:=0D Info.append("{}File: {}".format(space*" ", Key))=0D if "Files" in list(TargetDict[Key].keys()):=0D for item in TargetDict[Key]["Files"]:=0D self.parserTree(item, Info, space, ParFvId)=0D =0D - def ExportTree(self,TreeInfo: dict=3DNone) -> dict:=0D + def ExportTree(self, TreeInfo: dict =3D None) -> dict:=0D if TreeInfo is None:=0D - TreeInfo =3Dcollections.OrderedDict()=0D + TreeInfo =3D collections.OrderedDict()=0D =0D if self.type =3D=3D ROOT_TREE or self.type =3D=3D ROOT_FV_TREE or = self.type =3D=3D ROOT_FFS_TREE or self.type =3D=3D ROOT_SECTION_TREE:=0D key =3D str(self.key)=0D @@ -152,7 +162,7 @@ class BIOSTREE: TreeInfo[self.key]["Name"] =3D key=0D TreeInfo[self.key]["Type"] =3D self.type=0D TreeInfo[self.key]["FilesNum"] =3D len(self.Child)=0D - elif self.type =3D=3D FV_TREE or self.type =3D=3D SEC_FV_TREE:=0D + elif self.type =3D=3D FV_TREE or self.type =3D=3D SEC_FV_TREE:=0D key =3D str(self.Data.FvId)=0D TreeInfo[key] =3D collections.OrderedDict()=0D TreeInfo[key]["Name"] =3D key=0D @@ -179,7 +189,8 @@ class BIOSTREE: TreeInfo[key] =3D collections.OrderedDict()=0D TreeInfo[key]["Name"] =3D key=0D TreeInfo[key]["Type"] =3D self.type=0D - TreeInfo[key]["Size"] =3D hex(len(self.Data.OriData) + self.Da= ta.HeaderLength)=0D + TreeInfo[key]["Size"] =3D hex(=0D + len(self.Data.OriData) + self.Data.HeaderLength)=0D TreeInfo[key]["DecompressedSize"] =3D hex(self.Data.Size)=0D TreeInfo[key]["Offset"] =3D hex(self.Data.HOffset)=0D TreeInfo[key]["FilesNum"] =3D len(self.Child)=0D @@ -193,6 +204,6 @@ class BIOSTREE: TreeInfo[key]["FilesNum"] =3D len(self.Child)=0D =0D for item in self.Child:=0D - TreeInfo[key].setdefault('Files',[]).append( item.ExportTree()= )=0D + TreeInfo[key].setdefault('Files', []).append(item.ExportTree()= )=0D =0D - return TreeInfo=0D \ No newline at end of file + return TreeInfo=0D diff --git a/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py b/BaseTools/= Source/Python/FMMT/core/BiosTreeNode.py index 20447766c821..360d9477d79a 100644 --- a/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py +++ b/BaseTools/Source/Python/FMMT/core/BiosTreeNode.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the BIOS Tree Node.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -12,24 +12,25 @@ from utils.FmmtLogger import FmmtLogger as logger import uuid=0D =0D SectionHeaderType =3D {=0D - 0x01:'EFI_COMPRESSION_SECTION',=0D - 0x02:'EFI_GUID_DEFINED_SECTION',=0D - 0x03:'EFI_SECTION_DISPOSABLE',=0D - 0x10:'EFI_SECTION_PE32',=0D - 0x11:'EFI_SECTION_PIC',=0D - 0x12:'EFI_SECTION_TE',=0D - 0x13:'EFI_SECTION_DXE_DEPEX',=0D - 0x14:'EFI_SECTION_VERSION',=0D - 0x15:'EFI_SECTION_USER_INTERFACE',=0D - 0x16:'EFI_SECTION_COMPATIBILITY16',=0D - 0x17:'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',=0D - 0x18:'EFI_FREEFORM_SUBTYPE_GUID_SECTION',=0D - 0x19:'EFI_SECTION_RAW',=0D - 0x1B:'EFI_SECTION_PEI_DEPEX',=0D - 0x1C:'EFI_SECTION_MM_DEPEX'=0D + 0x01: 'EFI_COMPRESSION_SECTION',=0D + 0x02: 'EFI_GUID_DEFINED_SECTION',=0D + 0x03: 'EFI_SECTION_DISPOSABLE',=0D + 0x10: 'EFI_SECTION_PE32',=0D + 0x11: 'EFI_SECTION_PIC',=0D + 0x12: 'EFI_SECTION_TE',=0D + 0x13: 'EFI_SECTION_DXE_DEPEX',=0D + 0x14: 'EFI_SECTION_VERSION',=0D + 0x15: 'EFI_SECTION_USER_INTERFACE',=0D + 0x16: 'EFI_SECTION_COMPATIBILITY16',=0D + 0x17: 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',=0D + 0x18: 'EFI_FREEFORM_SUBTYPE_GUID_SECTION',=0D + 0x19: 'EFI_SECTION_RAW',=0D + 0x1B: 'EFI_SECTION_PEI_DEPEX',=0D + 0x1C: 'EFI_SECTION_MM_DEPEX'=0D }=0D HeaderType =3D [0x01, 0x02, 0x14, 0x15, 0x18]=0D =0D +=0D class BinaryNode:=0D def __init__(self, name: str) -> None:=0D self.Size =3D 0=0D @@ -37,6 +38,7 @@ class BinaryNode: self.HOffset =3D 0=0D self.Data =3D b''=0D =0D +=0D class FvNode:=0D def __init__(self, name, buffer: bytes) -> None:=0D self.Header =3D EFI_FIRMWARE_VOLUME_HEADER.from_buffer_copy(buffer= )=0D @@ -45,21 +47,27 @@ class FvNode: self.FvId =3D "FV" + str(name)=0D self.Name =3D "FV" + str(name)=0D if self.Header.ExtHeaderOffset:=0D - self.ExtHeader =3D EFI_FIRMWARE_VOLUME_EXT_HEADER.from_buffer_= copy(buffer[self.Header.ExtHeaderOffset:])=0D - self.Name =3D uuid.UUID(bytes_le=3Dstruct2stream(self.ExtHead= er.FvName))=0D + self.ExtHeader =3D EFI_FIRMWARE_VOLUME_EXT_HEADER.from_buffer_= copy(=0D + buffer[self.Header.ExtHeaderOffset:])=0D + self.Name =3D uuid.UUID(=0D + bytes_le=3Dstruct2stream(self.ExtHeader.FvName))=0D self.ExtEntryOffset =3D self.Header.ExtHeaderOffset + 20=0D if self.ExtHeader.ExtHeaderSize !=3D 20:=0D self.ExtEntryExist =3D 1=0D - self.ExtEntry =3D EFI_FIRMWARE_VOLUME_EXT_ENTRY.from_buffe= r_copy(buffer[self.ExtEntryOffset:])=0D + self.ExtEntry =3D EFI_FIRMWARE_VOLUME_EXT_ENTRY.from_buffe= r_copy(=0D + buffer[self.ExtEntryOffset:])=0D self.ExtTypeExist =3D 1=0D if self.ExtEntry.ExtEntryType =3D=3D 0x01:=0D nums =3D (self.ExtEntry.ExtEntrySize - 8) // 16=0D - self.ExtEntry =3D Refine_FV_EXT_ENTRY_OEM_TYPE_Header(= nums).from_buffer_copy(buffer[self.ExtEntryOffset:])=0D + self.ExtEntry =3D Refine_FV_EXT_ENTRY_OEM_TYPE_Header(= =0D + nums).from_buffer_copy(buffer[self.ExtEntryOffset:= ])=0D elif self.ExtEntry.ExtEntryType =3D=3D 0x02:=0D nums =3D self.ExtEntry.ExtEntrySize - 20=0D - self.ExtEntry =3D Refine_FV_EXT_ENTRY_GUID_TYPE_Header= (nums).from_buffer_copy(buffer[self.ExtEntryOffset:])=0D + self.ExtEntry =3D Refine_FV_EXT_ENTRY_GUID_TYPE_Header= (=0D + nums).from_buffer_copy(buffer[self.ExtEntryOffset:= ])=0D elif self.ExtEntry.ExtEntryType =3D=3D 0x03:=0D - self.ExtEntry =3D EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_S= IZE_TYPE.from_buffer_copy(buffer[self.ExtEntryOffset:])=0D + self.ExtEntry =3D EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_S= IZE_TYPE.from_buffer_copy(=0D + buffer[self.ExtEntryOffset:])=0D else:=0D self.ExtTypeExist =3D 0=0D else:=0D @@ -71,7 +79,8 @@ class FvNode: self.ROffset =3D 0=0D self.Data =3D b''=0D if self.Header.Signature !=3D 1213613663:=0D - logger.error('Invalid Fv Header! Fv {} signature {} is not "_F= VH".'.format(struct2stream(self.Header), self.Header.Signature))=0D + logger.error('Invalid Fv Header! Fv {} signature {} is not "_F= VH".'.format(=0D + struct2stream(self.Header), self.Header.Signature))=0D raise Exception("Process Failed: Fv Header Signature!")=0D self.PadData =3D b''=0D self.Free_Space =3D 0=0D @@ -85,7 +94,8 @@ class FvNode: for i in range(Size):=0D Sum +=3D int(Header[i*2: i*2 + 2].hex(), 16)=0D if Sum & 0xffff:=0D - self.Header.Checksum =3D 0x10000 - (Sum - self.Header.Checksum= ) % 0x10000=0D + self.Header.Checksum =3D 0x10000 - \=0D + (Sum - self.Header.Checksum) % 0x10000=0D =0D def ModFvExt(self) -> None:=0D # If used space changes and self.ExtEntry.UsedSize exists, self.Ex= tEntry.UsedSize need to be changed.=0D @@ -103,18 +113,22 @@ class FvNode: if self.Header.ExtHeaderOffset:=0D ExtHeaderData =3D struct2stream(self.ExtHeader)=0D ExtHeaderDataOffset =3D self.Header.ExtHeaderOffset - self.Hea= derLength=0D - self.Data =3D self.Data[:ExtHeaderDataOffset] + ExtHeaderData = + self.Data[ExtHeaderDataOffset+20:]=0D + self.Data =3D self.Data[:ExtHeaderDataOffset] + \=0D + ExtHeaderData + self.Data[ExtHeaderDataOffset+20:]=0D if self.Header.ExtHeaderOffset and self.ExtEntryExist:=0D ExtHeaderEntryData =3D struct2stream(self.ExtEntry)=0D ExtHeaderEntryDataOffset =3D self.Header.ExtHeaderOffset + 20 = - self.HeaderLength=0D - self.Data =3D self.Data[:ExtHeaderEntryDataOffset] + ExtHeader= EntryData + self.Data[ExtHeaderEntryDataOffset+len(ExtHeaderEntryData):]=0D + self.Data =3D self.Data[:ExtHeaderEntryDataOffset] + ExtHeader= EntryData + \=0D + self.Data[ExtHeaderEntryDataOffset+len(ExtHeaderEntryData)= :]=0D +=0D =0D class FfsNode:=0D def __init__(self, buffer: bytes) -> None:=0D self.Header =3D EFI_FFS_FILE_HEADER.from_buffer_copy(buffer)=0D # self.Attributes =3D unpack(" None:=0D if buffer[0:3] !=3D b'\xff\xff\xff':=0D @@ -154,7 +169,8 @@ class SectionNode: else:=0D self.Name =3D "SECTION"=0D if self.Header.Type in HeaderType:=0D - self.ExtHeader =3D self.GetExtHeader(self.Header.Type, buffer[= self.Header.Common_Header_Size():], (self.Header.SECTION_SIZE-self.Header.C= ommon_Header_Size()))=0D + self.ExtHeader =3D self.GetExtHeader(self.Header.Type, buffer[= self.Header.Common_Header_Size(=0D + ):], (self.Header.SECTION_SIZE-self.Header.Common_Header_Size(= )))=0D self.HeaderLength =3D self.Header.Common_Header_Size() + self.= ExtHeader.ExtHeaderSize()=0D else:=0D self.ExtHeader =3D None=0D @@ -171,7 +187,7 @@ class SectionNode: self.IsPadSection =3D False=0D self.SectionMaxAlignment =3D SECTION_COMMON_ALIGNMENT # 4-align=0D =0D - def GetExtHeader(self, Type: int, buffer: bytes, nums: int=3D0) -> Non= e:=0D + def GetExtHeader(self, Type: int, buffer: bytes, nums: int =3D 0) -> N= one:=0D if Type =3D=3D 0x01:=0D return EFI_COMPRESSION_SECTION.from_buffer_copy(buffer)=0D elif Type =3D=3D 0x02:=0D @@ -183,6 +199,7 @@ class SectionNode: elif Type =3D=3D 0x18:=0D return EFI_FREEFORM_SUBTYPE_GUID_SECTION.from_buffer_copy(buff= er)=0D =0D +=0D class FreeSpaceNode:=0D def __init__(self, buffer: bytes) -> None:=0D self.Name =3D 'Free_Space'=0D @@ -191,4 +208,4 @@ class FreeSpaceNode: self.HOffset =3D 0=0D self.DOffset =3D 0=0D self.ROffset =3D 0=0D - self.PadData =3D b''=0D \ No newline at end of file + self.PadData =3D b''=0D diff --git a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py b/BaseTools= /Source/Python/FMMT/core/FMMTOperation.py index c2cc2e246740..19fb9177e6bf 100644 --- a/BaseTools/Source/Python/FMMT/core/FMMTOperation.py +++ b/BaseTools/Source/Python/FMMT/core/FMMTOperation.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the functions to operate bios binary file.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -13,7 +13,9 @@ global Fv_count Fv_count =3D 0=0D =0D # The ROOT_TYPE can be 'ROOT_TREE', 'ROOT_FV_TREE', 'ROOT_FFS_TREE', 'ROOT= _SECTION_TREE'=0D -def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: str=3DNone, outpu= tfile: str=3DNone) -> None:=0D +=0D +=0D +def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: str =3D None, out= putfile: str =3D None) -> None:=0D if not os.path.exists(inputfile):=0D logger.error("Invalid inputfile, can not open {}.".format(inputfil= e))=0D raise Exception("Process Failed: Invalid inputfile!")=0D @@ -36,9 +38,11 @@ def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile:= str=3DNone, outputfile: s layoutfilename =3D layoutfile=0D layoutfileformat =3D os.path.splitext(layoutfile)[1][1:].lower= ()=0D else:=0D - layoutfilename =3D "Layout_{}{}".format(os.path.basename(input= file),".{}".format(layoutfile.lower()))=0D + layoutfilename =3D "Layout_{}{}".format(os.path.basename(=0D + inputfile), ".{}".format(layoutfile.lower()))=0D layoutfileformat =3D layoutfile.lower()=0D - GetFormatter(layoutfileformat).dump(InfoDict, FmmtParser.BinaryInf= o, layoutfilename)=0D + GetFormatter(layoutfileformat).dump(=0D + InfoDict, FmmtParser.BinaryInfo, layoutfilename)=0D # 4. Data Encapsulation=0D if outputfile:=0D logger.debug('Start encapsulating data......')=0D @@ -47,7 +51,8 @@ def ViewFile(inputfile: str, ROOT_TYPE: str, layoutfile: = str=3DNone, outputfile: s f.write(FmmtParser.FinalData)=0D logger.debug('Encapsulated data is saved in {}.'.format(outputfile= ))=0D =0D -def DeleteFfs(inputfile: str, TargetFfs_name: str, outputfile: str, Fv_nam= e: str=3DNone) -> None:=0D +=0D +def DeleteFfs(inputfile: str, TargetFfs_name: str, outputfile: str, Fv_nam= e: str =3D None) -> None:=0D if not os.path.exists(inputfile):=0D logger.error("Invalid inputfile, can not open {}.".format(inputfil= e))=0D raise Exception("Process Failed: Invalid inputfile!")=0D @@ -60,7 +65,8 @@ def DeleteFfs(inputfile: str, TargetFfs_name: str, output= file: str, Fv_name: str FmmtParser.ParserFromRoot(FmmtParser.WholeFvTree, whole_data)=0D logger.debug('Done!')=0D # 3. Data Modify=0D - FmmtParser.WholeFvTree.FindNode(TargetFfs_name, FmmtParser.WholeFvTree= .Findlist)=0D + FmmtParser.WholeFvTree.FindNode(=0D + TargetFfs_name, FmmtParser.WholeFvTree.Findlist)=0D # Choose the Specfic DeleteFfs with Fv info=0D if Fv_name:=0D for item in FmmtParser.WholeFvTree.Findlist:=0D @@ -81,6 +87,7 @@ def DeleteFfs(inputfile: str, TargetFfs_name: str, output= file: str, Fv_name: str f.write(FmmtParser.FinalData)=0D logger.debug('Encapsulated data is saved in {}.'.format(outputfile= ))=0D =0D +=0D def AddNewFfs(inputfile: str, Fv_name: str, newffsfile: str, outputfile: s= tr) -> None:=0D if not os.path.exists(inputfile):=0D logger.error("Invalid inputfile, can not open {}.".format(inputfil= e))=0D @@ -109,11 +116,14 @@ def AddNewFfs(inputfile: str, Fv_name: str, newffsfil= e: str, outputfile: str) -> TargetFfsPad =3D TargetFv.Child[-1]=0D logger.debug('Parsing newffsfile data......')=0D if TargetFfsPad.type =3D=3D FFS_FREE_SPACE:=0D - NewFmmtParser.ParserFromRoot(NewFmmtParser.WholeFvTree, ne= w_ffs_data, TargetFfsPad.Data.HOffset)=0D + NewFmmtParser.ParserFromRoot(=0D + NewFmmtParser.WholeFvTree, new_ffs_data, TargetFfsPad.= Data.HOffset)=0D else:=0D - NewFmmtParser.ParserFromRoot(NewFmmtParser.WholeFvTree, ne= w_ffs_data, TargetFfsPad.Data.HOffset+TargetFfsPad.Data.Size)=0D + NewFmmtParser.ParserFromRoot(=0D + NewFmmtParser.WholeFvTree, new_ffs_data, TargetFfsPad.= Data.HOffset+TargetFfsPad.Data.Size)=0D logger.debug('Done!')=0D - FfsMod =3D FvHandler(NewFmmtParser.WholeFvTree.Child[0], Targe= tFfsPad)=0D + FfsMod =3D FvHandler(=0D + NewFmmtParser.WholeFvTree.Child[0], TargetFfsPad)=0D Status =3D FfsMod.AddFfs()=0D else:=0D logger.error('Target Fv not found!!!')=0D @@ -125,7 +135,8 @@ def AddNewFfs(inputfile: str, Fv_name: str, newffsfile:= str, outputfile: str) -> f.write(FmmtParser.FinalData)=0D logger.debug('Encapsulated data is saved in {}.'.format(outputfile= ))=0D =0D -def ReplaceFfs(inputfile: str, Ffs_name: str, newffsfile: str, outputfile:= str, Fv_name: str=3DNone) -> None:=0D +=0D +def ReplaceFfs(inputfile: str, Ffs_name: str, newffsfile: str, outputfile:= str, Fv_name: str =3D None) -> None:=0D if not os.path.exists(inputfile):=0D logger.error("Invalid inputfile, can not open {}.".format(inputfil= e))=0D raise Exception("Process Failed: Invalid inputfile!")=0D @@ -146,7 +157,8 @@ def ReplaceFfs(inputfile: str, Ffs_name: str, newffsfil= e: str, outputfile: str, Status =3D False=0D # 3. Data Modify=0D new_ffs =3D newFmmtParser.WholeFvTree.Child[0]=0D - new_ffs.Data.PadData =3D GetPadSize(new_ffs.Data.Size, FFS_COMMON_ALIG= NMENT) * b'\xff'=0D + new_ffs.Data.PadData =3D GetPadSize(=0D + new_ffs.Data.Size, FFS_COMMON_ALIGNMENT) * b'\xff'=0D FmmtParser.WholeFvTree.FindNode(Ffs_name, FmmtParser.WholeFvTree.Findl= ist)=0D if Fv_name:=0D for item in FmmtParser.WholeFvTree.Findlist:=0D @@ -166,7 +178,8 @@ def ReplaceFfs(inputfile: str, Ffs_name: str, newffsfil= e: str, outputfile: str, f.write(FmmtParser.FinalData)=0D logger.debug('Encapsulated data is saved in {}.'.format(outputfile= ))=0D =0D -def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: str, Fv_name: st= r=3DNone) -> None:=0D +=0D +def ExtractFfs(inputfile: str, Ffs_name: str, outputfile: str, Fv_name: st= r =3D None) -> None:=0D if not os.path.exists(inputfile):=0D logger.error("Invalid inputfile, can not open {}.".format(inputfil= e))=0D raise Exception("Process Failed: Invalid inputfile!")=0D @@ -189,7 +202,8 @@ def ExtractFfs(inputfile: str, Ffs_name: str, outputfil= e: str, Fv_name: str=3DNone if TargetFv.Data.Header.Attributes & EFI_FVB2_ERASE_POLARITY:=0D TargetNode.Data.Header.State =3D c_uint8(=0D ~TargetNode.Data.Header.State)=0D - FinalData =3D struct2stream(TargetNode.Data.Header) + TargetNode.D= ata.Data=0D + FinalData =3D struct2stream(=0D + TargetNode.Data.Header) + TargetNode.Data.Data=0D with open(outputfile, "wb") as f:=0D f.write(FinalData)=0D logger.debug('Extract ffs data is saved in {}.'.format(outputfile)= )=0D diff --git a/BaseTools/Source/Python/FMMT/core/FMMTParser.py b/BaseTools/So= urce/Python/FMMT/core/FMMTParser.py index e76ac5118509..cd275801ba0c 100644 --- a/BaseTools/Source/Python/FMMT/core/FMMTParser.py +++ b/BaseTools/Source/Python/FMMT/core/FMMTParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the interface of Bios Parser.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -11,6 +11,7 @@ from core.BiosTree import * from core.GuidTools import *=0D from utils.FmmtLogger import FmmtLogger as logger=0D =0D +=0D class FMMTParser:=0D def __init__(self, name: str, TYPE: str) -> None:=0D self.WholeFvTree =3D BIOSTREE(name)=0D @@ -18,8 +19,8 @@ class FMMTParser: self.FinalData =3D b''=0D self.BinaryInfo =3D []=0D =0D - ## Parser the nodes in WholeTree.=0D - def ParserFromRoot(self, WholeFvTree=3DNone, whole_data: bytes=3Db'', = Reloffset: int=3D0) -> None:=0D + # Parser the nodes in WholeTree.=0D + def ParserFromRoot(self, WholeFvTree=3DNone, whole_data: bytes =3D b''= , Reloffset: int =3D 0) -> None:=0D if WholeFvTree.type =3D=3D ROOT_TREE or WholeFvTree.type =3D=3D RO= OT_FV_TREE:=0D ParserEntry().DataParser(self.WholeFvTree, whole_data, Reloffs= et)=0D else:=0D @@ -27,7 +28,7 @@ class FMMTParser: for Child in WholeFvTree.Child:=0D self.ParserFromRoot(Child, "")=0D =0D - ## Encapuslation all the data in tree into self.FinalData=0D + # Encapuslation all the data in tree into self.FinalData=0D def Encapsulation(self, rootTree, CompressStatus: bool) -> None:=0D # If current node is Root node, skip it.=0D if rootTree.type =3D=3D ROOT_TREE or rootTree.type =3D=3D ROOT_FV_= TREE or rootTree.type =3D=3D ROOT_FFS_TREE or rootTree.type =3D=3D ROOT_SEC= TION_TREE:=0D @@ -38,7 +39,8 @@ class FMMTParser: rootTree.Child =3D []=0D # If current node do not have Child and ExtHeader, just add its He= ader and Data.=0D elif rootTree.type =3D=3D DATA_FV_TREE or rootTree.type =3D=3D FFS= _PAD:=0D - self.FinalData +=3D struct2stream(rootTree.Data.Header) + root= Tree.Data.Data + rootTree.Data.PadData=0D + self.FinalData +=3D struct2stream(rootTree.Data.Header) + \=0D + rootTree.Data.Data + rootTree.Data.PadData=0D if rootTree.isFinalChild():=0D ParTree =3D rootTree.Parent=0D if ParTree.type !=3D 'ROOT':=0D @@ -49,7 +51,8 @@ class FMMTParser: if rootTree.HasChild():=0D self.FinalData +=3D struct2stream(rootTree.Data.Header)=0D else:=0D - self.FinalData +=3D struct2stream(rootTree.Data.Header) + = rootTree.Data.Data + rootTree.Data.PadData=0D + self.FinalData +=3D struct2stream(rootTree.Data.Header) + = \=0D + rootTree.Data.Data + rootTree.Data.PadData=0D if rootTree.isFinalChild():=0D ParTree =3D rootTree.Parent=0D if ParTree.type !=3D 'ROOT':=0D @@ -60,15 +63,18 @@ class FMMTParser: if rootTree.Data.OriData =3D=3D b'' or (rootTree.Data.OriData = !=3D b'' and CompressStatus):=0D if rootTree.HasChild():=0D if rootTree.Data.ExtHeader:=0D - self.FinalData +=3D struct2stream(rootTree.Data.He= ader) + struct2stream(rootTree.Data.ExtHeader)=0D + self.FinalData +=3D struct2stream(=0D + rootTree.Data.Header) + struct2stream(rootTree= .Data.ExtHeader)=0D else:=0D self.FinalData +=3D struct2stream(rootTree.Data.He= ader)=0D else:=0D Data =3D rootTree.Data.Data=0D if rootTree.Data.ExtHeader:=0D - self.FinalData +=3D struct2stream(rootTree.Data.He= ader) + struct2stream(rootTree.Data.ExtHeader) + Data + rootTree.Data.PadDa= ta=0D + self.FinalData +=3D struct2stream(rootTree.Data.He= ader) + struct2stream(=0D + rootTree.Data.ExtHeader) + Data + rootTree.Dat= a.PadData=0D else:=0D - self.FinalData +=3D struct2stream(rootTree.Data.He= ader) + Data + rootTree.Data.PadData=0D + self.FinalData +=3D struct2stream(=0D + rootTree.Data.Header) + Data + rootTree.Data.P= adData=0D if rootTree.isFinalChild():=0D ParTree =3D rootTree.Parent=0D self.FinalData +=3D ParTree.Data.PadData=0D @@ -77,9 +83,11 @@ class FMMTParser: Data =3D rootTree.Data.OriData=0D rootTree.Child =3D []=0D if rootTree.Data.ExtHeader:=0D - self.FinalData +=3D struct2stream(rootTree.Data.Header= ) + struct2stream(rootTree.Data.ExtHeader) + Data + rootTree.Data.PadData=0D + self.FinalData +=3D struct2stream(rootTree.Data.Header= ) + struct2stream(=0D + rootTree.Data.ExtHeader) + Data + rootTree.Data.Pa= dData=0D else:=0D - self.FinalData +=3D struct2stream(rootTree.Data.Header= ) + Data + rootTree.Data.PadData=0D + self.FinalData +=3D struct2stream(=0D + rootTree.Data.Header) + Data + rootTree.Data.PadDa= ta=0D if rootTree.isFinalChild():=0D ParTree =3D rootTree.Parent=0D self.FinalData +=3D ParTree.Data.PadData=0D diff --git a/BaseTools/Source/Python/FMMT/core/FvHandler.py b/BaseTools/Sou= rce/Python/FMMT/core/FvHandler.py index c81541ec18b1..1a59767afd2f 100644 --- a/BaseTools/Source/Python/FMMT/core/FvHandler.py +++ b/BaseTools/Source/Python/FMMT/core/FvHandler.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to the implementation of Bios layout handler.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -13,7 +13,8 @@ from utils.FmmtLogger import FmmtLogger as logger =0D EFI_FVB2_ERASE_POLARITY =3D 0x00000800=0D =0D -def ChangeSize(TargetTree, size_delta: int=3D0) -> None:=0D +=0D +def ChangeSize(TargetTree, size_delta: int =3D 0) -> None:=0D # If Size increase delta, then should be: size_delta =3D -delta=0D if type(TargetTree.Data.Header) =3D=3D type(EFI_FFS_FILE_HEADER2()) or= type(TargetTree.Data.Header) =3D=3D type(EFI_COMMON_SECTION_HEADER2()):=0D TargetTree.Data.Size -=3D size_delta=0D @@ -22,14 +23,16 @@ def ChangeSize(TargetTree, size_delta: int=3D0) -> None: OriSize =3D TargetTree.Data.Header.SECTION_SIZE=0D OriSize -=3D size_delta=0D TargetTree.Data.Header.Size[0] =3D OriSize % (16**2)=0D - TargetTree.Data.Header.Size[1] =3D OriSize % (16**4) //(16**2)=0D + TargetTree.Data.Header.Size[1] =3D OriSize % (16**4) // (16**2)=0D TargetTree.Data.Header.Size[2] =3D OriSize // (16**4)=0D else:=0D TargetTree.Data.Size -=3D size_delta=0D TargetTree.Data.Header.Size[0] =3D TargetTree.Data.Size % (16**2)= =0D - TargetTree.Data.Header.Size[1] =3D TargetTree.Data.Size % (16**4) = //(16**2)=0D + TargetTree.Data.Header.Size[1] =3D TargetTree.Data.Size % (=0D + 16**4) // (16**2)=0D TargetTree.Data.Header.Size[2] =3D TargetTree.Data.Size // (16**4)= =0D =0D +=0D def ModifyFfsType(TargetFfs) -> None:=0D if type(TargetFfs.Data.Header) =3D=3D type(EFI_FFS_FILE_HEADER()) and = TargetFfs.Data.Size > 0xFFFFFF:=0D ExtendSize =3D TargetFfs.Data.Header.FFS_FILE_SIZE + 8=0D @@ -37,10 +40,12 @@ def ModifyFfsType(TargetFfs) -> None: New_Header.Name =3D TargetFfs.Data.Header.Name=0D New_Header.IntegrityCheck =3D TargetFfs.Data.Header.IntegrityCheck= =0D New_Header.Type =3D TargetFfs.Data.Header.Type=0D - New_Header.Attributes =3D TargetFfs.Data.Header.Attributes | 0x01 = # set the Attribute with FFS_ATTRIB_LARGE_FILE (0x01)=0D + # set the Attribute with FFS_ATTRIB_LARGE_FILE (0x01)=0D + New_Header.Attributes =3D TargetFfs.Data.Header.Attributes | 0x01= =0D NewSize =3D 0=0D - New_Header.Size[0] =3D NewSize % (16**2) # minus the delta size= of Header=0D - New_Header.Size[1] =3D NewSize % (16**4) //(16**2)=0D + # minus the delta size of Header=0D + New_Header.Size[0] =3D NewSize % (16**2)=0D + New_Header.Size[1] =3D NewSize % (16**4) // (16**2)=0D New_Header.Size[2] =3D NewSize // (16**4)=0D New_Header.State =3D TargetFfs.Data.Header.State=0D New_Header.ExtendedSize =3D ExtendSize=0D @@ -53,9 +58,11 @@ def ModifyFfsType(TargetFfs) -> None: New_Header.Name =3D TargetFfs.Data.Header.Name=0D New_Header.IntegrityCheck =3D TargetFfs.Data.Header.IntegrityCheck= =0D New_Header.Type =3D TargetFfs.Data.Header.Type=0D - New_Header.Attributes =3D TargetFfs.Data.Header.Attributes - 1 # = remove the FFS_ATTRIB_LARGE_FILE (0x01) from Attribute=0D - New_Header.Size[0] =3D (TargetFfs.Data.Size - 8) % (16**2) # mi= nus the delta size of Header=0D - New_Header.Size[1] =3D (TargetFfs.Data.Size - 8) % (16**4) //(16**= 2)=0D + # remove the FFS_ATTRIB_LARGE_FILE (0x01) from Attribute=0D + New_Header.Attributes =3D TargetFfs.Data.Header.Attributes - 1=0D + # minus the delta size of Header=0D + New_Header.Size[0] =3D (TargetFfs.Data.Size - 8) % (16**2)=0D + New_Header.Size[1] =3D (TargetFfs.Data.Size - 8) % (16**4) // (16*= *2)=0D New_Header.Size[2] =3D (TargetFfs.Data.Size - 8) // (16**4)=0D New_Header.State =3D TargetFfs.Data.Header.State=0D TargetFfs.Data.Header =3D New_Header=0D @@ -68,19 +75,24 @@ def ModifyFfsType(TargetFfs) -> None: if type(item.Data.Header) =3D=3D type(EFI_FFS_FILE_HEADER2= ()):=0D NeedChange =3D False=0D if NeedChange:=0D - TargetFfs.Parent.Data.Header.FileSystemGuid =3D ModifyGuid= Format("8c8ce578-8a3d-4f1c-9935-896185c32dd3")=0D + TargetFfs.Parent.Data.Header.FileSystemGuid =3D ModifyGuid= Format(=0D + "8c8ce578-8a3d-4f1c-9935-896185c32dd3")=0D =0D if type(TargetFfs.Data.Header) =3D=3D type(EFI_FFS_FILE_HEADER2()):=0D TarParent =3D TargetFfs.Parent=0D while TarParent:=0D if TarParent.type =3D=3D FV_TREE and struct2stream(TarParent.D= ata.Header.FileSystemGuid) =3D=3D EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE:=0D - TarParent.Data.Header.FileSystemGuid =3D ModifyGuidFormat(= "5473C07A-3DCB-4dca-BD6F-1E9689E7349A")=0D + TarParent.Data.Header.FileSystemGuid =3D ModifyGuidFormat(= =0D + "5473C07A-3DCB-4dca-BD6F-1E9689E7349A")=0D TarParent =3D TarParent.Parent=0D =0D +=0D def PadSectionModify(PadSection, Offset) -> None:=0D # Offset > 0, Size decrease; Offset < 0, Size increase;=0D ChangeSize(PadSection, Offset)=0D - PadSection.Data.Data =3D (PadSection.Data.Size - PadSection.Data.Heade= rLength) * b'\xff'=0D + PadSection.Data.Data =3D (PadSection.Data.Size -=0D + PadSection.Data.HeaderLength) * b'\xff'=0D +=0D =0D def ModifySectionType(TargetSection) -> None:=0D # If Section Size is increased larger than 0xFFFFFF, need modify Secti= on Header from EFI_COMMON_SECTION_HEADER to EFI_COMMON_SECTION_HEADER2.=0D @@ -88,8 +100,9 @@ def ModifySectionType(TargetSection) -> None: New_Header =3D EFI_COMMON_SECTION_HEADER2()=0D New_Header.Type =3D TargetSection.Data.Header.Type=0D NewSize =3D 0xFFFFFF=0D - New_Header.Size[0] =3D NewSize % (16**2) # minus the delta size= of Header=0D - New_Header.Size[1] =3D NewSize % (16**4) //(16**2)=0D + # minus the delta size of Header=0D + New_Header.Size[0] =3D NewSize % (16**2)=0D + New_Header.Size[1] =3D NewSize % (16**4) // (16**2)=0D New_Header.Size[2] =3D NewSize // (16**4)=0D New_Header.ExtendedSize =3D TargetSection.Data.Size + 4=0D TargetSection.Data.Header =3D New_Header=0D @@ -106,8 +119,9 @@ def ModifySectionType(TargetSection) -> None: elif type(TargetSection.Data.Header) =3D=3D type(EFI_COMMON_SECTION_HE= ADER2()) and TargetSection.Data.Size < 0xFFFFFF:=0D New_Header =3D EFI_COMMON_SECTION_HEADER()=0D New_Header.Type =3D TargetSection.Data.Header.Type=0D - New_Header.Size[0] =3D (TargetSection.Data.Size - 4) % (16**2) = # minus the delta size of Header=0D - New_Header.Size[1] =3D (TargetSection.Data.Size - 4) % (16**4) //(= 16**2)=0D + # minus the delta size of Header=0D + New_Header.Size[0] =3D (TargetSection.Data.Size - 4) % (16**2)=0D + New_Header.Size[1] =3D (TargetSection.Data.Size - 4) % (16**4) // = (16**2)=0D New_Header.Size[2] =3D (TargetSection.Data.Size - 4) // (16**4)=0D TargetSection.Data.Header =3D New_Header=0D TargetSection.Data.Size =3D TargetSection.Data.Header.SECTION_SIZE= =0D @@ -120,6 +134,7 @@ def ModifySectionType(TargetSection) -> None: NewPadSection =3D SectionNode(b'\x00\x00\x00\x19')=0D SecParent.insertChild(NewPadSection, Target_index)=0D =0D +=0D def ModifyFvExtData(TreeNode) -> None:=0D FvExtData =3D b''=0D if TreeNode.Data.Header.ExtHeaderOffset:=0D @@ -130,19 +145,24 @@ def ModifyFvExtData(TreeNode) -> None: FvExtData +=3D FvExtEntry=0D if FvExtData:=0D InfoNode =3D TreeNode.Child[0]=0D - InfoNode.Data.Data =3D FvExtData + InfoNode.Data.Data[TreeNode.Dat= a.ExtHeader.ExtHeaderSize:]=0D + InfoNode.Data.Data =3D FvExtData + \=0D + InfoNode.Data.Data[TreeNode.Data.ExtHeader.ExtHeaderSize:]=0D InfoNode.Data.ModCheckSum()=0D =0D +=0D def ModifyFvSystemGuid(TargetFv) -> None:=0D if struct2stream(TargetFv.Data.Header.FileSystemGuid) =3D=3D EFI_FIRMW= ARE_FILE_SYSTEM2_GUID_BYTE:=0D - TargetFv.Data.Header.FileSystemGuid =3D ModifyGuidFormat("5473C07A= -3DCB-4dca-BD6F-1E9689E7349A")=0D + TargetFv.Data.Header.FileSystemGuid =3D ModifyGuidFormat(=0D + "5473C07A-3DCB-4dca-BD6F-1E9689E7349A")=0D TargetFv.Data.ModCheckSum()=0D TargetFv.Data.Data =3D b''=0D for item in TargetFv.Child:=0D if item.type =3D=3D FFS_FREE_SPACE:=0D TargetFv.Data.Data +=3D item.Data.Data + item.Data.PadData=0D else:=0D - TargetFv.Data.Data +=3D struct2stream(item.Data.Header)+ item.= Data.Data + item.Data.PadData=0D + TargetFv.Data.Data +=3D struct2stream(item.Data.Header) + \=0D + item.Data.Data + item.Data.PadData=0D +=0D =0D class FvHandler:=0D def __init__(self, NewFfs, TargetFfs) -> None:=0D @@ -151,7 +171,7 @@ class FvHandler: self.Status =3D False=0D self.Remain_New_Free_Space =3D 0=0D =0D - ## Use for Compress the Section Data=0D + # Use for Compress the Section Data=0D def CompressData(self, TargetTree) -> None:=0D TreePath =3D TargetTree.GetTreePath()=0D pos =3D len(TreePath)=0D @@ -159,7 +179,8 @@ class FvHandler: while pos:=0D if not self.Status:=0D if TreePath[pos-1].type =3D=3D SECTION_TREE and TreePath[p= os-1].Data.Type =3D=3D 0x02:=0D - self.CompressSectionData(TreePath[pos-1], None, TreePa= th[pos-1].Data.ExtHeader.SectionDefinitionGuid)=0D + self.CompressSectionData(=0D + TreePath[pos-1], None, TreePath[pos-1].Data.ExtHea= der.SectionDefinitionGuid)=0D else:=0D if pos =3D=3D len(TreePath):=0D self.CompressSectionData(TreePath[pos-1], pos)=0D @@ -174,15 +195,19 @@ class FvHandler: # Update current node data as adding all the header and data o= f its child node.=0D for item in temp_save_child:=0D if item.type =3D=3D SECTION_TREE and not item.Data.OriData= and item.Data.ExtHeader:=0D - NewData +=3D struct2stream(item.Data.Header) + struct2= stream(item.Data.ExtHeader) + item.Data.Data + item.Data.PadData=0D + NewData +=3D struct2stream(item.Data.Header) + struct2= stream(=0D + item.Data.ExtHeader) + item.Data.Data + item.Data.= PadData=0D elif item.type =3D=3D SECTION_TREE and item.Data.OriData a= nd not item.Data.ExtHeader:=0D - NewData +=3D struct2stream(item.Data.Header) + item.Da= ta.OriData + item.Data.PadData=0D + NewData +=3D struct2stream(item.Data.Header) + \=0D + item.Data.OriData + item.Data.PadData=0D elif item.type =3D=3D SECTION_TREE and item.Data.OriData a= nd item.Data.ExtHeader:=0D - NewData +=3D struct2stream(item.Data.Header) + struct2= stream(item.Data.ExtHeader) + item.Data.OriData + item.Data.PadData=0D + NewData +=3D struct2stream(item.Data.Header) + struct2= stream(=0D + item.Data.ExtHeader) + item.Data.OriData + item.Da= ta.PadData=0D elif item.type =3D=3D FFS_FREE_SPACE:=0D NewData +=3D item.Data.Data + item.Data.PadData=0D else:=0D - NewData +=3D struct2stream(item.Data.Header) + item.Da= ta.Data + item.Data.PadData=0D + NewData +=3D struct2stream(item.Data.Header) + \=0D + item.Data.Data + item.Data.PadData=0D # If node is FFS_TREE, update Pad data and Header info.=0D # Remain_New_Free_Space is used for move more free space into = lst level Fv.=0D if TargetTree.type =3D=3D FFS_TREE:=0D @@ -205,11 +230,13 @@ class FvHandler: TargetTree.Data.Data +=3D self.Remain_New_Free_Spa= ce * b'\xff'=0D New_Free_Space =3D BIOSTREE('FREE_SPACE')=0D New_Free_Space.type =3D FFS_FREE_SPACE=0D - New_Free_Space.Data =3D FreeSpaceNode(b'\xff' * se= lf.Remain_New_Free_Space)=0D + New_Free_Space.Data =3D FreeSpaceNode(=0D + b'\xff' * self.Remain_New_Free_Space)=0D TargetTree.insertChild(New_Free_Space)=0D self.Remain_New_Free_Space =3D 0=0D if TargetTree.type =3D=3D SEC_FV_TREE:=0D - Size_delta =3D len(NewData) + self.Remain_New_Free_Spa= ce - len(TargetTree.Data.Data)=0D + Size_delta =3D len(=0D + NewData) + self.Remain_New_Free_Space - len(Target= Tree.Data.Data)=0D TargetTree.Data.Header.FvLength +=3D Size_delta=0D TargetTree.Data.ModFvExt()=0D TargetTree.Data.ModFvSize()=0D @@ -223,32 +250,39 @@ class FvHandler: Size_delta =3D len(NewData) - len(TargetTree.Data.Data)=0D ChangeSize(TargetTree, -Size_delta)=0D if TargetTree.NextRel:=0D - Delta_Pad_Size =3D len(TargetTree.Data.PadData) - New_= Pad_Size=0D + Delta_Pad_Size =3D len(=0D + TargetTree.Data.PadData) - New_Pad_Size=0D self.Remain_New_Free_Space +=3D Delta_Pad_Size=0D TargetTree.Data.PadData =3D b'\x00' * New_Pad_Size=0D TargetTree.Data.Data =3D NewData=0D if GuidTool:=0D guidtool =3D GUIDTools().__getitem__(struct2stream(GuidTool))= =0D if not guidtool.ifexist:=0D - logger.error("GuidTool {} is not found when decompressing = {} file.\n".format(guidtool.command, TargetTree.Parent.Data.Name))=0D + logger.error("GuidTool {} is not found when decompressing = {} file.\n".format(=0D + guidtool.command, TargetTree.Parent.Data.Name))=0D raise Exception("Process Failed: GuidTool not found!")=0D CompressedData =3D guidtool.pack(TargetTree.Data.Data)=0D if len(CompressedData) < len(TargetTree.Data.OriData):=0D - New_Pad_Size =3D GetPadSize(len(CompressedData), SECTION_C= OMMON_ALIGNMENT)=0D + New_Pad_Size =3D GetPadSize(=0D + len(CompressedData), SECTION_COMMON_ALIGNMENT)=0D Size_delta =3D len(CompressedData) - len(TargetTree.Data.O= riData)=0D ChangeSize(TargetTree, -Size_delta)=0D if TargetTree.NextRel:=0D TargetTree.Data.PadData =3D b'\x00' * New_Pad_Size=0D - self.Remain_New_Free_Space =3D len(TargetTree.Data.Ori= Data) + len(TargetTree.Data.PadData) - len(CompressedData) - New_Pad_Size=0D + self.Remain_New_Free_Space =3D len(TargetTree.Data.Ori= Data) + len(=0D + TargetTree.Data.PadData) - len(CompressedData) - N= ew_Pad_Size=0D else:=0D TargetTree.Data.PadData =3D b''=0D - self.Remain_New_Free_Space =3D len(TargetTree.Data.Ori= Data) - len(CompressedData)=0D + self.Remain_New_Free_Space =3D len(=0D + TargetTree.Data.OriData) - len(CompressedData)=0D TargetTree.Data.OriData =3D CompressedData=0D elif len(CompressedData) =3D=3D len(TargetTree.Data.OriData):= =0D TargetTree.Data.OriData =3D CompressedData=0D elif len(CompressedData) > len(TargetTree.Data.OriData):=0D - New_Pad_Size =3D GetPadSize(len(CompressedData), SECTION_C= OMMON_ALIGNMENT)=0D - self.Remain_New_Free_Space =3D len(CompressedData) + New_P= ad_Size - len(TargetTree.Data.OriData) - len(TargetTree.Data.PadData)=0D + New_Pad_Size =3D GetPadSize(=0D + len(CompressedData), SECTION_COMMON_ALIGNMENT)=0D + self.Remain_New_Free_Space =3D len(CompressedData) + New_P= ad_Size - len(=0D + TargetTree.Data.OriData) - len(TargetTree.Data.PadData= )=0D self.ModifyTest(TargetTree, self.Remain_New_Free_Space)=0D self.Status =3D True=0D =0D @@ -271,7 +305,7 @@ class FvHandler: self.Status =3D False=0D else:=0D BlockSize =3D ParTree.Data.Header.BlockMap[0].Leng= th=0D - New_Add_Len =3D BlockSize - Needed_Space%BlockSize= =0D + New_Add_Len =3D BlockSize - Needed_Space % BlockSi= ze=0D if New_Add_Len % BlockSize:=0D ParTree.Child[-1].Data.Data =3D b'\xff' * New_= Add_Len=0D ParTree.Data.Free_Space =3D New_Add_Len=0D @@ -286,7 +320,8 @@ class FvHandler: if item.type =3D=3D FFS_FREE_SPACE:=0D ParTree.Data.Data +=3D item.Data.Data + item.Data.= PadData=0D else:=0D - ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der)+ item.Data.Data + item.Data.PadData=0D + ParTree.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.Data= .PadData=0D ParTree.Data.ModFvExt()=0D ParTree.Data.ModFvSize()=0D ParTree.Data.ModExtHeaderData()=0D @@ -300,22 +335,28 @@ class FvHandler: for item in ParTree.Child:=0D if item.Data.OriData:=0D if item.Data.ExtHeader:=0D - ParTree.Data.Data +=3D struct2stream(item.Data= .Header) + struct2stream(item.Data.ExtHeader) + item.Data.OriData + item.Da= ta.PadData=0D + ParTree.Data.Data +=3D struct2stream(item.Data= .Header) + struct2stream(=0D + item.Data.ExtHeader) + item.Data.OriData += item.Data.PadData=0D else:=0D - ParTree.Data.Data +=3D struct2stream(item.Data= .Header)+ item.Data.OriData + item.Data.PadData=0D + ParTree.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.OriData + it= em.Data.PadData=0D else:=0D if item.Data.ExtHeader:=0D - ParTree.Data.Data +=3D struct2stream(item.Data= .Header) + struct2stream(item.Data.ExtHeader) + item.Data.Data + item.Data.= PadData=0D + ParTree.Data.Data +=3D struct2stream(item.Data= .Header) + struct2stream(=0D + item.Data.ExtHeader) + item.Data.Data + it= em.Data.PadData=0D else:=0D - ParTree.Data.Data +=3D struct2stream(item.Data= .Header)+ item.Data.Data + item.Data.PadData=0D + ParTree.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.= Data.PadData=0D ChangeSize(ParTree, -Needed_Space)=0D ModifyFfsType(ParTree)=0D # Recalculate pad data, update needed space with Delta_Pad= _Size.=0D Needed_Space +=3D ParTree.Data.HeaderLength - OriHeaderLen= =0D - New_Pad_Size =3D GetPadSize(ParTree.Data.Size, FFS_COMMON_= ALIGNMENT)=0D + New_Pad_Size =3D GetPadSize(=0D + ParTree.Data.Size, FFS_COMMON_ALIGNMENT)=0D Delta_Pad_Size =3D New_Pad_Size - len(ParTree.Data.PadData= )=0D Needed_Space +=3D Delta_Pad_Size=0D - ParTree.Data.PadData =3D b'\xff' * GetPadSize(ParTree.Data= .Size, FFS_COMMON_ALIGNMENT)=0D + ParTree.Data.PadData =3D b'\xff' * \=0D + GetPadSize(ParTree.Data.Size, FFS_COMMON_ALIGNMENT)=0D ParTree.Data.ModCheckSum()=0D # If current node is a Section node=0D elif ParTree.type =3D=3D SECTION_TREE:=0D @@ -325,50 +366,61 @@ class FvHandler: # Update its data as adding all the header and data of its= child node.=0D for item in ParTree.Child:=0D if item.type =3D=3D SECTION_TREE and item.Data.ExtHead= er and item.Data.Type !=3D 0x02:=0D - ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der) + struct2stream(item.Data.ExtHeader) + item.Data.Data + item.Data.PadD= ata=0D + ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der) + struct2stream(=0D + item.Data.ExtHeader) + item.Data.Data + item.D= ata.PadData=0D elif item.type =3D=3D SECTION_TREE and item.Data.ExtHe= ader and item.Data.Type =3D=3D 0x02:=0D - ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der) + struct2stream(item.Data.ExtHeader) + item.Data.OriData + item.Data.P= adData=0D + ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der) + struct2stream(=0D + item.Data.ExtHeader) + item.Data.OriData + ite= m.Data.PadData=0D else:=0D - ParTree.Data.Data +=3D struct2stream(item.Data.Hea= der) + item.Data.Data + item.Data.PadData=0D + ParTree.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.Data= .PadData=0D # If the current section is guided section=0D if ParTree.Data.Type =3D=3D 0x02:=0D - guidtool =3D GUIDTools().__getitem__(struct2stream(Par= Tree.Data.ExtHeader.SectionDefinitionGuid))=0D + guidtool =3D GUIDTools().__getitem__(struct2stream(=0D + ParTree.Data.ExtHeader.SectionDefinitionGuid))=0D if not guidtool.ifexist:=0D - logger.error("GuidTool {} is not found when decomp= ressing {} file.\n".format(guidtool.command, ParTree.Parent.Data.Name))=0D + logger.error("GuidTool {} is not found when decomp= ressing {} file.\n".format(=0D + guidtool.command, ParTree.Parent.Data.Name))=0D raise Exception("Process Failed: GuidTool not foun= d!")=0D # Recompress current data, and recalculate the needed = space=0D CompressedData =3D guidtool.pack(ParTree.Data.Data)=0D - Needed_Space =3D len(CompressedData) - len(ParTree.Dat= a.OriData)=0D + Needed_Space =3D len(CompressedData) - \=0D + len(ParTree.Data.OriData)=0D ParTree.Data.OriData =3D CompressedData=0D New_Size =3D ParTree.Data.HeaderLength + len(Compresse= dData)=0D ParTree.Data.Header.Size[0] =3D New_Size % (16**2)=0D - ParTree.Data.Header.Size[1] =3D New_Size % (16**4) //(= 16**2)=0D + ParTree.Data.Header.Size[1] =3D New_Size % (16**4) // = (16**2)=0D ParTree.Data.Header.Size[2] =3D New_Size // (16**4)=0D ParTree.Data.Size =3D ParTree.Data.Header.SECTION_SIZE= =0D ModifySectionType(ParTree)=0D Needed_Space +=3D ParTree.Data.HeaderLength - OriHeade= rLen=0D # Update needed space with Delta_Pad_Size=0D if ParTree.NextRel:=0D - New_Pad_Size =3D GetPadSize(ParTree.Data.Size, SEC= TION_COMMON_ALIGNMENT)=0D - Delta_Pad_Size =3D New_Pad_Size - len(ParTree.Data= .PadData)=0D + New_Pad_Size =3D GetPadSize(=0D + ParTree.Data.Size, SECTION_COMMON_ALIGNMENT)=0D + Delta_Pad_Size =3D New_Pad_Size - \=0D + len(ParTree.Data.PadData)=0D ParTree.Data.PadData =3D b'\x00' * New_Pad_Size=0D Needed_Space +=3D Delta_Pad_Size=0D else:=0D ParTree.Data.PadData =3D b''=0D if Needed_Space < 0:=0D - self.Remain_New_Free_Space =3D len(ParTree.Data.Or= iData) - len(CompressedData)=0D + self.Remain_New_Free_Space =3D len(=0D + ParTree.Data.OriData) - len(CompressedData)=0D # If current section is not guided section=0D elif Needed_Space:=0D ChangeSize(ParTree, -Needed_Space)=0D ModifySectionType(ParTree)=0D # Update needed space with Delta_Pad_Size=0D Needed_Space +=3D ParTree.Data.HeaderLength - OriHeade= rLen=0D - New_Pad_Size =3D GetPadSize(ParTree.Data.Size, SECTION= _COMMON_ALIGNMENT)=0D + New_Pad_Size =3D GetPadSize(=0D + ParTree.Data.Size, SECTION_COMMON_ALIGNMENT)=0D Delta_Pad_Size =3D New_Pad_Size - len(ParTree.Data.Pad= Data)=0D Needed_Space +=3D Delta_Pad_Size=0D ParTree.Data.PadData =3D b'\x00' * New_Pad_Size=0D NewParTree =3D ParTree.Parent=0D - ROOT_TYPE =3D [ROOT_FV_TREE, ROOT_FFS_TREE, ROOT_SECTION_TREE,= ROOT_TREE]=0D + ROOT_TYPE =3D [ROOT_FV_TREE, ROOT_FFS_TREE,=0D + ROOT_SECTION_TREE, ROOT_TREE]=0D if NewParTree and NewParTree.type not in ROOT_TYPE:=0D self.ModifyTest(NewParTree, Needed_Space)=0D # If current node have enough space, will recompress all the relat= ed node data, return true.=0D @@ -381,16 +433,20 @@ class FvHandler: TargetFv =3D self.TargetFfs.Parent=0D # If the Fv Header Attributes is EFI_FVB2_ERASE_POLARITY, Child Ff= s Header State need be reversed.=0D if TargetFv.Data.Header.Attributes & EFI_FVB2_ERASE_POLARITY:=0D - self.NewFfs.Data.Header.State =3D c_uint8(=0D - ~self.NewFfs.Data.Header.State)=0D + self.NewFfs.Data.Header.State =3D c_uint8(=0D + ~self.NewFfs.Data.Header.State)=0D # NewFfs parsing will not calculate the PadSize, thus recalculate.= =0D - self.NewFfs.Data.PadData =3D b'\xff' * GetPadSize(self.NewFfs.Data= .Size, FFS_COMMON_ALIGNMENT)=0D + self.NewFfs.Data.PadData =3D b'\xff' * \=0D + GetPadSize(self.NewFfs.Data.Size, FFS_COMMON_ALIGNMENT)=0D if self.NewFfs.Data.Size >=3D self.TargetFfs.Data.Size:=0D - Needed_Space =3D self.NewFfs.Data.Size + len(self.NewFfs.Data.= PadData) - self.TargetFfs.Data.Size - len(self.TargetFfs.Data.PadData)=0D + Needed_Space =3D self.NewFfs.Data.Size + \=0D + len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size -= \=0D + len(self.TargetFfs.Data.PadData)=0D # If TargetFv have enough free space, just move part of the fr= ee space to NewFfs.=0D if TargetFv.Data.Free_Space >=3D Needed_Space:=0D # Modify TargetFv Child info and BiosTree.=0D - TargetFv.Child[-1].Data.Data =3D b'\xff' * (TargetFv.Data.= Free_Space - Needed_Space)=0D + TargetFv.Child[-1].Data.Data =3D b'\xff' * \=0D + (TargetFv.Data.Free_Space - Needed_Space)=0D TargetFv.Data.Free_Space -=3D Needed_Space=0D Target_index =3D TargetFv.Child.index(self.TargetFfs)=0D TargetFv.Child.remove(self.TargetFfs)=0D @@ -413,7 +469,7 @@ class FvHandler: # Recalculate TargetFv needed space to keep it match t= he BlockSize setting.=0D Needed_Space -=3D TargetFv.Data.Free_Space=0D BlockSize =3D TargetFv.Data.Header.BlockMap[0].Length= =0D - New_Add_Len =3D BlockSize - Needed_Space%BlockSize=0D + New_Add_Len =3D BlockSize - Needed_Space % BlockSize=0D Target_index =3D TargetFv.Child.index(self.TargetFfs)= =0D if New_Add_Len % BlockSize:=0D TargetFv.Child[-1].Data.Data =3D b'\xff' * New_Add= _Len=0D @@ -431,7 +487,8 @@ class FvHandler: if item.type =3D=3D FFS_FREE_SPACE:=0D TargetFv.Data.Data +=3D item.Data.Data + item.= Data.PadData=0D else:=0D - TargetFv.Data.Data +=3D struct2stream(item.Dat= a.Header)+ item.Data.Data + item.Data.PadData=0D + TargetFv.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.= Data.PadData=0D TargetFv.Data.Size +=3D Needed_Space=0D # Modify TargetFv Data Header and ExtHeader info.=0D TargetFv.Data.Header.FvLength =3D TargetFv.Data.Size=0D @@ -477,9 +534,12 @@ class FvHandler: def AddFfs(self) -> bool:=0D logger.debug('Start Adding Process......')=0D # NewFfs parsing will not calculate the PadSize, thus recalculate.= =0D - self.NewFfs.Data.PadData =3D b'\xff' * GetPadSize(self.NewFfs.Data= .Size, FFS_COMMON_ALIGNMENT)=0D + self.NewFfs.Data.PadData =3D b'\xff' * \=0D + GetPadSize(self.NewFfs.Data.Size, FFS_COMMON_ALIGNMENT)=0D if self.TargetFfs.type =3D=3D FFS_FREE_SPACE:=0D - TargetLen =3D self.NewFfs.Data.Size + len(self.NewFfs.Data.Pad= Data) - self.TargetFfs.Data.Size - len(self.TargetFfs.Data.PadData)=0D + TargetLen =3D self.NewFfs.Data.Size + \=0D + len(self.NewFfs.Data.PadData) - self.TargetFfs.Data.Size -= \=0D + len(self.TargetFfs.Data.PadData)=0D TargetFv =3D self.TargetFfs.Parent=0D # If the Fv Header Attributes is EFI_FVB2_ERASE_POLARITY, Chil= d Ffs Header State need be reversed.=0D if TargetFv.Data.Header.Attributes & EFI_FVB2_ERASE_POLARITY:= =0D @@ -512,7 +572,7 @@ class FvHandler: elif TargetFv.type =3D=3D SEC_FV_TREE:=0D # Recalculate TargetFv needed space to keep it match t= he BlockSize setting.=0D BlockSize =3D TargetFv.Data.Header.BlockMap[0].Length= =0D - New_Add_Len =3D BlockSize - TargetLen%BlockSize=0D + New_Add_Len =3D BlockSize - TargetLen % BlockSize=0D if New_Add_Len % BlockSize:=0D self.TargetFfs.Data.Data =3D b'\xff' * New_Add_Len= =0D self.TargetFfs.Data.Size =3D New_Add_Len=0D @@ -530,7 +590,8 @@ class FvHandler: if item.type =3D=3D FFS_FREE_SPACE:=0D TargetFv.Data.Data +=3D item.Data.Data + item.= Data.PadData=0D else:=0D - TargetFv.Data.Data +=3D struct2stream(item.Dat= a.Header)+ item.Data.Data + item.Data.PadData=0D + TargetFv.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.= Data.PadData=0D # Encapsulate the Fv Data for update.=0D TargetFv.Data.Size +=3D TargetLen=0D TargetFv.Data.Header.FvLength =3D TargetFv.Data.Size=0D @@ -552,7 +613,7 @@ class FvHandler: self.Status =3D False=0D elif TargetFv.type =3D=3D SEC_FV_TREE:=0D BlockSize =3D TargetFv.Data.Header.BlockMap[0].Length=0D - New_Add_Len =3D BlockSize - TargetLen%BlockSize=0D + New_Add_Len =3D BlockSize - TargetLen % BlockSize=0D if New_Add_Len % BlockSize:=0D New_Free_Space =3D BIOSTREE('FREE_SPACE')=0D New_Free_Space.type =3D FFS_FREE_SPACE=0D @@ -570,7 +631,8 @@ class FvHandler: if item.type =3D=3D FFS_FREE_SPACE:=0D TargetFv.Data.Data +=3D item.Data.Data + item.Data= .PadData=0D else:=0D - TargetFv.Data.Data +=3D struct2stream(item.Data.He= ader)+ item.Data.Data + item.Data.PadData=0D + TargetFv.Data.Data +=3D struct2stream(=0D + item.Data.Header) + item.Data.Data + item.Data= .PadData=0D TargetFv.Data.Size +=3D TargetLen=0D TargetFv.Data.Header.FvLength =3D TargetFv.Data.Size=0D TargetFv.Data.ModFvExt()=0D @@ -596,7 +658,8 @@ class FvHandler: Used_Size =3D Delete_Fv.Data.Size - Delete_Fv.Data.Free_Sp= ace - Add_Free_Space=0D BlockSize =3D Delete_Fv.Data.Header.BlockMap[0].Length=0D New_Free_Space =3D BlockSize - Used_Size % BlockSize=0D - self.Remain_New_Free_Space +=3D Delete_Fv.Data.Free_Space = + Add_Free_Space - New_Free_Space=0D + self.Remain_New_Free_Space +=3D Delete_Fv.Data.Free_Space = + \=0D + Add_Free_Space - New_Free_Space=0D Delete_Fv.Child[-1].Data.Data =3D New_Free_Space * b'\xff'= =0D Delete_Fv.Data.Free_Space =3D New_Free_Space=0D # If Fv is lst level Fv, new free space will be merged with or= igin free space.=0D diff --git a/BaseTools/Source/Python/FMMT/core/GuidTools.py b/BaseTools/Sou= rce/Python/FMMT/core/GuidTools.py index a25681709bc8..ea196daa9c8a 100644 --- a/BaseTools/Source/Python/FMMT/core/GuidTools.py +++ b/BaseTools/Source/Python/FMMT/core/GuidTools.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the FMMT dependent external tool management = class.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -15,8 +15,10 @@ from FirmwareStorageFormat.Common import * from utils.FmmtLogger import FmmtLogger as logger=0D import subprocess=0D =0D +=0D def ExecuteCommand(cmd: list) -> None:=0D - subprocess.run(cmd,stdout=3Dsubprocess.DEVNULL)=0D + subprocess.run(cmd, stdout=3Dsubprocess.DEVNULL)=0D +=0D =0D class GUIDTool:=0D def __init__(self, guid: str, short_name: str, command: str) -> None:= =0D @@ -39,7 +41,7 @@ class GUIDTool: file.write(buffer)=0D file.close()=0D command =3D [tool, '-e', '-o', ToolOuputFile,=0D - ToolInputFile]=0D + ToolInputFile]=0D ExecuteCommand(command)=0D buf =3D open(ToolOuputFile, "rb")=0D res_buffer =3D buf.read()=0D @@ -57,7 +59,6 @@ class GUIDTool: logger.info("Its GUID is: %s" % self.guid)=0D return ""=0D =0D -=0D def unpack(self, buffer: bytes) -> bytes:=0D """=0D buffer: remove common header=0D @@ -85,10 +86,12 @@ class GUIDTool: shutil.rmtree(tmp)=0D return res_buffer=0D else:=0D - logger.error("Error parsing section: EFI_SECTION_GUID_DEFINED = cannot be parsed at this time.")=0D + logger.error(=0D + "Error parsing section: EFI_SECTION_GUID_DEFINED cannot be= parsed at this time.")=0D logger.info("Its GUID is: %s" % self.guid)=0D return ""=0D =0D +=0D class GUIDTools:=0D '''=0D GUIDTools is responsible for reading FMMTConfig.ini, verify the tools = and provide interfaces to access those tools.=0D @@ -101,19 +104,22 @@ class GUIDTools: struct2stream(ModifyGuidFormat("3d532050-5cda-4fd0-879e-0f7f630d5a= fb")): GUIDTool("3d532050-5cda-4fd0-879e-0f7f630d5afb", "BROTLI", "BrotliCo= mpress"),=0D }=0D =0D - def __init__(self, tooldef_file: str=3DNone) -> None:=0D + def __init__(self, tooldef_file: str =3D None) -> None:=0D self.dir =3D os.path.join(os.path.dirname(__file__), "..")=0D - self.tooldef_file =3D tooldef_file if tooldef_file else os.path.jo= in(self.dir, "FmmtConf.ini")=0D + self.tooldef_file =3D tooldef_file if tooldef_file else os.path.jo= in(=0D + self.dir, "FmmtConf.ini")=0D self.tooldef =3D dict()=0D =0D def SetConfigFile(self) -> None:=0D if os.environ['FmmtConfPath']:=0D - self.tooldef_file =3D os.path.join(os.environ['FmmtConfPath'],= 'FmmtConf.ini')=0D + self.tooldef_file =3D os.path.join(=0D + os.environ['FmmtConfPath'], 'FmmtConf.ini')=0D else:=0D PathList =3D os.environ['PATH']=0D for CurrentPath in PathList:=0D if os.path.exists(os.path.join(CurrentPath, 'FmmtConf.ini'= )):=0D - self.tooldef_file =3D os.path.join(CurrentPath, 'FmmtC= onf.ini')=0D + self.tooldef_file =3D os.path.join(=0D + CurrentPath, 'FmmtConf.ini')=0D break=0D =0D def VerifyTools(self, guidtool) -> None:=0D @@ -128,10 +134,13 @@ class GUIDTools: if os.path.isabs(cmd):=0D if not os.path.exists(cmd):=0D if guidtool not in self.default_tools:=0D - logger.error("Tool Not found %s, which causes compress= /uncompress process error." % cmd)=0D - logger.error("Please goto edk2 repo in current console= , run 'edksetup.bat rebuild' command, and try again.\n")=0D + logger.error(=0D + "Tool Not found %s, which causes compress/uncompre= ss process error." % cmd)=0D + logger.error(=0D + "Please goto edk2 repo in current console, run 'ed= ksetup.bat rebuild' command, and try again.\n")=0D else:=0D - logger.error("Tool Not found %s, which causes compress= /uncompress process error." % cmd)=0D + logger.error(=0D + "Tool Not found %s, which causes compress/uncompre= ss process error." % cmd)=0D else:=0D guidtool.ifexist =3D True=0D else:=0D @@ -141,10 +150,13 @@ class GUIDTools: break=0D else:=0D if guidtool not in self.default_tools:=0D - logger.error("Tool Not found %s, which causes compress= /uncompress process error." % cmd)=0D - logger.error("Please goto edk2 repo in current console= , run 'edksetup.bat rebuild' command, and try again.\n")=0D + logger.error(=0D + "Tool Not found %s, which causes compress/uncompre= ss process error." % cmd)=0D + logger.error(=0D + "Please goto edk2 repo in current console, run 'ed= ksetup.bat rebuild' command, and try again.\n")=0D else:=0D - logger.error("Tool Not found %s, which causes compress= /uncompress process error." % cmd)=0D + logger.error(=0D + "Tool Not found %s, which causes compress/uncompre= ss process error." % cmd)=0D =0D def LoadingTools(self) -> None:=0D self.SetConfigFile()=0D @@ -155,7 +167,8 @@ class GUIDTools: try:=0D if not line.startswith("#"):=0D guid, short_name, command =3D line.split()=0D - new_format_guid =3D struct2stream(ModifyGuidFormat= (guid.strip()))=0D + new_format_guid =3D struct2stream(=0D + ModifyGuidFormat(guid.strip()))=0D self.tooldef[new_format_guid] =3D GUIDTool(=0D guid.strip(), short_name.strip(), command.stri= p())=0D except:=0D @@ -175,5 +188,5 @@ class GUIDTools: logger.error("{} GuidTool is not defined!".format(guid))=0D raise Exception("Process Failed: is not defined!")=0D =0D +=0D guidtools =3D GUIDTools()=0D -=0D diff --git a/BaseTools/Source/Python/FMMT/utils/FmmtLogger.py b/BaseTools/S= ource/Python/FMMT/utils/FmmtLogger.py index 385f098310a0..df2c30477bfb 100644 --- a/BaseTools/Source/Python/FMMT/utils/FmmtLogger.py +++ b/BaseTools/Source/Python/FMMT/utils/FmmtLogger.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the Fmmt Logger.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -17,12 +17,12 @@ if os.path.exists(logfile): FmmtLogger =3D logging.getLogger('FMMT')=0D FmmtLogger.setLevel(logging.DEBUG)=0D =0D -log_stream_handler=3Dlogging.StreamHandler(sys.stdout)=0D -log_file_handler=3Dlogging.FileHandler(logfile)=0D +log_stream_handler =3D logging.StreamHandler(sys.stdout)=0D +log_file_handler =3D logging.FileHandler(logfile)=0D log_stream_handler.setLevel(logging.INFO)=0D =0D -stream_format=3Dlogging.Formatter("%(levelname)-8s: %(message)s")=0D -file_format=3Dlogging.Formatter("%(levelname)-8s: %(message)s")=0D +stream_format =3D logging.Formatter("%(levelname)-8s: %(message)s")=0D +file_format =3D logging.Formatter("%(levelname)-8s: %(message)s")=0D =0D log_stream_handler.setFormatter(stream_format)=0D log_file_handler.setFormatter(file_format)=0D diff --git a/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py b/BaseTool= s/Source/Python/FMMT/utils/FvLayoutPrint.py index 7dafcae3b583..eadef2766380 100644 --- a/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py +++ b/BaseTools/Source/Python/FMMT/utils/FvLayoutPrint.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the printer for Bios layout.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -6,6 +6,7 @@ ##=0D from utils.FmmtLogger import FmmtLogger as logger=0D =0D +=0D def GetFormatter(layout_format: str):=0D if layout_format =3D=3D 'json':=0D return JsonFormatter()=0D @@ -16,12 +17,14 @@ def GetFormatter(layout_format: str): else:=0D return TxtFormatter()=0D =0D +=0D class Formatter(object):=0D - def dump(self, layoutdict, layoutlist, outputfile: str=3DNone) -> None= :=0D + def dump(self, layoutdict, layoutlist, outputfile: str =3D None) -> No= ne:=0D raise NotImplemented=0D =0D +=0D class JsonFormatter(Formatter):=0D - def dump(self,layoutdict: dict, layoutlist: list, outputfile: str=3DNo= ne) -> None:=0D + def dump(self, layoutdict: dict, layoutlist: list, outputfile: str =3D= None) -> None:=0D try:=0D import json=0D except:=0D @@ -29,27 +32,31 @@ class JsonFormatter(Formatter): return=0D print(outputfile)=0D if outputfile:=0D - with open(outputfile,"w") as fw:=0D + with open(outputfile, "w") as fw:=0D json.dump(layoutdict, fw, indent=3D2)=0D else:=0D - print(json.dumps(layoutdict,indent=3D2))=0D + print(json.dumps(layoutdict, indent=3D2))=0D +=0D =0D class TxtFormatter(Formatter):=0D - def LogPrint(self,layoutlist: list) -> None:=0D + def LogPrint(self, layoutlist: list) -> None:=0D for item in layoutlist:=0D print(item)=0D print('\n')=0D =0D - def dump(self,layoutdict: dict, layoutlist: list, outputfile: str=3DNo= ne) -> None:=0D - logger.info('Binary Layout Info is saved in {} file.'.format(outpu= tfile))=0D + def dump(self, layoutdict: dict, layoutlist: list, outputfile: str =3D= None) -> None:=0D + logger.info(=0D + 'Binary Layout Info is saved in {} file.'.format(outputfile))= =0D with open(outputfile, "w") as f:=0D for item in layoutlist:=0D f.writelines(item + '\n')=0D =0D +=0D class YamlFormatter(Formatter):=0D - def dump(self,layoutdict, layoutlist, outputfile =3D None):=0D + def dump(self, layoutdict, layoutlist, outputfile=3DNone):=0D TxtFormatter().dump(layoutdict, layoutlist, outputfile)=0D =0D +=0D class HtmlFormatter(Formatter):=0D - def dump(self,layoutdict, layoutlist, outputfile =3D None):=0D - TxtFormatter().dump(layoutdict, layoutlist, outputfile)=0D \ No newline at end of file + def dump(self, layoutdict, layoutlist, outputfile=3DNone):=0D + TxtFormatter().dump(layoutdict, layoutlist, outputfile)=0D diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/Common.py b/Base= Tools/Source/Python/FirmwareStorageFormat/Common.py index 5082268a0063..f45df799cd0b 100644 --- a/BaseTools/Source/Python/FirmwareStorageFormat/Common.py +++ b/BaseTools/Source/Python/FirmwareStorageFormat/Common.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the common C struct and functions.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -12,24 +12,28 @@ import uuid # EFI_FIRMWARE_FILE_SYSTEM3_GUID =3D uuid.UUID('{5473C07A-3DCB-4dca-BD6F-1= E9689E7349A}')=0D # EFI_FFS_VOLUME_TOP_FILE_GUID =3D uuid.UUID('{1BA0062E-C779-4582-8566-336= AE8F78F09}')=0D =0D -EFI_FIRMWARE_FILE_SYSTEM2_GUID =3D uuid.UUID("8c8ce578-8a3d-4f1c-9935-8961= 85c32dd3")=0D +EFI_FIRMWARE_FILE_SYSTEM2_GUID =3D uuid.UUID(=0D + "8c8ce578-8a3d-4f1c-9935-896185c32dd3")=0D EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE =3D b'x\xe5\x8c\x8c=3D\x8a\x1cO\x995\x= 89a\x85\xc3-\xd3'=0D # EFI_FIRMWARE_FILE_SYSTEM2_GUID_BYTE =3D EFI_FIRMWARE_FILE_SYSTEM2_GUID.b= ytes=0D -EFI_FIRMWARE_FILE_SYSTEM3_GUID =3D uuid.UUID("5473C07A-3DCB-4dca-BD6F-1E96= 89E7349A")=0D +EFI_FIRMWARE_FILE_SYSTEM3_GUID =3D uuid.UUID(=0D + "5473C07A-3DCB-4dca-BD6F-1E9689E7349A")=0D # EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE =3D b'x\xe5\x8c\x8c=3D\x8a\x1cO\x995= \x89a\x85\xc3-\xd3'=0D EFI_FIRMWARE_FILE_SYSTEM3_GUID_BYTE =3D b'z\xc0sT\xcb=3D\xcaM\xbdo\x1e\x96= \x89\xe74\x9a'=0D EFI_SYSTEM_NVDATA_FV_GUID =3D uuid.UUID("fff12b8d-7696-4c8b-a985-2747075b4= f50")=0D EFI_SYSTEM_NVDATA_FV_GUID_BYTE =3D b"\x8d+\xf1\xff\x96v\x8bL\xa9\x85'G\x07= [OP"=0D -EFI_FFS_VOLUME_TOP_FILE_GUID =3D uuid.UUID("1ba0062e-c779-4582-8566-336ae8= f78f09")=0D +EFI_FFS_VOLUME_TOP_FILE_GUID =3D uuid.UUID(=0D + "1ba0062e-c779-4582-8566-336ae8f78f09")=0D EFI_FFS_VOLUME_TOP_FILE_GUID_BYTE =3D b'.\x06\xa0\x1by\xc7\x82E\x85f3j\xe8= \xf7\x8f\t'=0D ZEROVECTOR_BYTE =3D b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00= \x00\x00\x00'=0D PADVECTOR =3D uuid.UUID("ffffffff-ffff-ffff-ffff-ffffffffffff")=0D FVH_SIGNATURE =3D b'_FVH'=0D =0D -#Alignment=0D +# Alignment=0D SECTION_COMMON_ALIGNMENT =3D 4=0D FFS_COMMON_ALIGNMENT =3D 8=0D =0D +=0D class GUID(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -56,11 +60,12 @@ class GUID(Structure): rt =3D rt & (self.Guid4[i] =3D=3D otherguid.Guid4[i])=0D return rt=0D =0D +=0D def ModifyGuidFormat(target_guid: str) -> GUID:=0D target_guid =3D target_guid.replace('-', '')=0D target_list =3D []=0D - start =3D [0,8,12,16,18,20,22,24,26,28,30]=0D - end =3D [8,12,16,18,20,22,24,26,28,30,32]=0D + start =3D [0, 8, 12, 16, 18, 20, 22, 24, 26, 28, 30]=0D + end =3D [8, 12, 16, 18, 20, 22, 24, 26, 28, 30, 32]=0D num =3D len(start)=0D for pos in range(num):=0D new_value =3D int(target_guid[start[pos]:end[pos]], 16)=0D @@ -77,7 +82,6 @@ def struct2stream(s) -> bytes: return p.contents.raw=0D =0D =0D -=0D def GetPadSize(Size: int, alignment: int) -> int:=0D if Size % alignment =3D=3D 0:=0D return 0=0D diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py= b/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py index e9c619d2240e..2b37dc8b797b 100644 --- a/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py +++ b/BaseTools/Source/Python/FirmwareStorageFormat/FfsFileHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the Ffs Header C Struct.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -11,6 +11,7 @@ from FirmwareStorageFormat.Common import * EFI_FFS_FILE_HEADER_LEN =3D 24=0D EFI_FFS_FILE_HEADER2_LEN =3D 32=0D =0D +=0D class CHECK_SUM(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -18,6 +19,7 @@ class CHECK_SUM(Structure): ('File', c_uint8),=0D ]=0D =0D +=0D class EFI_FFS_INTEGRITY_CHECK(Union):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -45,6 +47,7 @@ class EFI_FFS_FILE_HEADER(Structure): def HeaderLength(self) -> int:=0D return 24=0D =0D +=0D class EFI_FFS_FILE_HEADER2(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py b/Ba= seTools/Source/Python/FirmwareStorageFormat/FvHeader.py index 078beda9e5c1..e293da55b5f3 100644 --- a/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py +++ b/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the FV Header C Struct.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -9,6 +9,7 @@ from struct import * from ctypes import *=0D from FirmwareStorageFormat.Common import *=0D =0D +=0D class EFI_FV_BLOCK_MAP_ENTRY(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -30,7 +31,8 @@ class EFI_FIRMWARE_VOLUME_HEADER(Structure): ('Reserved', c_uint8),=0D ('Revision', c_uint8),=0D ('BlockMap', ARRAY(EFI_FV_BLOCK_MAP_ENTRY, 1)),=0D - ]=0D + ]=0D +=0D =0D def Refine_FV_Header(nums):=0D class EFI_FIRMWARE_VOLUME_HEADER(Structure):=0D @@ -46,33 +48,38 @@ def Refine_FV_Header(nums): ('Reserved', c_uint8),=0D ('Revision', c_uint8),=0D ('BlockMap', ARRAY(EFI_FV_BLOCK_MAP_ENTRY, nums)),= =0D - ]=0D + ]=0D return EFI_FIRMWARE_VOLUME_HEADER=0D =0D +=0D class EFI_FIRMWARE_VOLUME_EXT_HEADER(Structure):=0D _fields_ =3D [=0D ('FvName', GUID),=0D ('ExtHeaderSize', c_uint32)=0D - ]=0D + ]=0D +=0D =0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY(Structure):=0D _fields_ =3D [=0D ('ExtEntrySize', c_uint16),=0D ('ExtEntryType', c_uint16)=0D - ]=0D + ]=0D +=0D =0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE_0(Structure):=0D _fields_ =3D [=0D ('Hdr', EFI_FIRMWARE_VOLUME_EXT_ENTRY),=0D ('TypeMask', c_uint32)=0D - ]=0D + ]=0D +=0D =0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE(Structure):=0D _fields_ =3D [=0D ('Hdr', EFI_FIRMWARE_VOLUME_EXT_ENTRY),=0D ('TypeMask', c_uint32),=0D ('Types', ARRAY(GUID, 1))=0D - ]=0D + ]=0D +=0D =0D def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_= EXT_ENTRY_OEM_TYPE:=0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE(Structure):=0D @@ -83,18 +90,21 @@ def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> E= FI_FIRMWARE_VOLUME_EXT_EN ]=0D return EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE(Structure)=0D =0D +=0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE_0(Structure):=0D _fields_ =3D [=0D ('Hdr', EFI_FIRMWARE_VOLUME_EXT_ENTRY),=0D ('FormatType', GUID)=0D - ]=0D + ]=0D +=0D =0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE(Structure):=0D _fields_ =3D [=0D ('Hdr', EFI_FIRMWARE_VOLUME_EXT_ENTRY),=0D ('FormatType', GUID),=0D ('Data', ARRAY(c_uint8, 1))=0D - ]=0D + ]=0D +=0D =0D def Refine_FV_EXT_ENTRY_GUID_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME= _EXT_ENTRY_GUID_TYPE:=0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE(Structure):=0D @@ -105,8 +115,9 @@ def Refine_FV_EXT_ENTRY_GUID_TYPE_Header(nums: int) -> = EFI_FIRMWARE_VOLUME_EXT_E ]=0D return EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE(Structure)=0D =0D +=0D class EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE(Structure):=0D _fields_ =3D [=0D ('Hdr', EFI_FIRMWARE_VOLUME_EXT_ENTRY),=0D ('UsedSize', c_uint32)=0D - ]=0D + ]=0D diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py= b/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py index ee6a63679d89..f22e86f19365 100644 --- a/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py +++ b/BaseTools/Source/Python/FirmwareStorageFormat/SectionHeader.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define the Section Header C Struct.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D @@ -11,6 +11,7 @@ from FirmwareStorageFormat.Common import * EFI_COMMON_SECTION_HEADER_LEN =3D 4=0D EFI_COMMON_SECTION_HEADER2_LEN =3D 8=0D =0D +=0D class EFI_COMMON_SECTION_HEADER(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -25,6 +26,7 @@ class EFI_COMMON_SECTION_HEADER(Structure): def Common_Header_Size(self) -> int:=0D return 4=0D =0D +=0D class EFI_COMMON_SECTION_HEADER2(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -40,6 +42,7 @@ class EFI_COMMON_SECTION_HEADER2(Structure): def Common_Header_Size(self) -> int:=0D return 8=0D =0D +=0D class EFI_COMPRESSION_SECTION(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -50,6 +53,7 @@ class EFI_COMPRESSION_SECTION(Structure): def ExtHeaderSize(self) -> int:=0D return 5=0D =0D +=0D class EFI_FREEFORM_SUBTYPE_GUID_SECTION(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -59,6 +63,7 @@ class EFI_FREEFORM_SUBTYPE_GUID_SECTION(Structure): def ExtHeaderSize(self) -> int:=0D return 16=0D =0D +=0D class EFI_GUID_DEFINED_SECTION(Structure):=0D _pack_ =3D 1=0D _fields_ =3D [=0D @@ -70,6 +75,7 @@ class EFI_GUID_DEFINED_SECTION(Structure): def ExtHeaderSize(self) -> int:=0D return 20=0D =0D +=0D def Get_USER_INTERFACE_Header(nums: int):=0D class EFI_SECTION_USER_INTERFACE(Structure):=0D _pack_ =3D 1=0D @@ -89,6 +95,7 @@ def Get_USER_INTERFACE_Header(nums: int): =0D return EFI_SECTION_USER_INTERFACE=0D =0D +=0D def Get_VERSION_Header(nums: int):=0D class EFI_SECTION_VERSION(Structure):=0D _pack_ =3D 1=0D diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/__init__.py b/Ba= seTools/Source/Python/FirmwareStorageFormat/__init__.py index 335653c6cc60..94330f5ae148 100644 --- a/BaseTools/Source/Python/FirmwareStorageFormat/__init__.py +++ b/BaseTools/Source/Python/FirmwareStorageFormat/__init__.py @@ -1,6 +1,6 @@ -## @file=0D +# @file=0D # This file is used to define the Firmware Storage Format.=0D #=0D # Copyright (c) 2021-, Intel Corporation. All rights reserved.
        =0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D -##=0D \ No newline at end of file +##=0D diff --git a/BaseTools/Source/Python/GenFds/AprioriSection.py b/BaseTools/S= ource/Python/GenFds/AprioriSection.py index 9f64c613eb8f..c1432394335e 100644 --- a/BaseTools/Source/Python/GenFds/AprioriSection.py +++ b/BaseTools/Source/Python/GenFds/AprioriSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process APRIORI file data and generate PEI/DXE APRIORI file=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -24,11 +24,13 @@ from Common.DataType import TAB_COMMON DXE_APRIORI_GUID =3D "FC510EE7-FFDC-11D4-BD41-0080C73C8881"=0D PEI_APRIORI_GUID =3D "1B45CC0A-156A-428A-AF62-49864DA0E6E6"=0D =0D -## process APRIORI file data and generate PEI/DXE APRIORI file=0D +# process APRIORI file data and generate PEI/DXE APRIORI file=0D #=0D #=0D +=0D +=0D class AprioriSection (object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -37,7 +39,7 @@ class AprioriSection (object): self.FfsList =3D []=0D self.AprioriType =3D ""=0D =0D - ## GenFfs() method=0D + # GenFfs() method=0D #=0D # Generate FFS for APRIORI file=0D #=0D @@ -46,7 +48,7 @@ class AprioriSection (object): # @param Dict dictionary contains macro and its value=0D # @retval string Generated file name=0D #=0D - def GenFfs (self, FvName, Dict =3D None, IsMakefile =3D False):=0D + def GenFfs(self, FvName, Dict=3DNone, IsMakefile=3DFalse):=0D if Dict is None:=0D Dict =3D {}=0D Buffer =3D BytesIO()=0D @@ -55,16 +57,16 @@ class AprioriSection (object): else:=0D AprioriFileGuid =3D DXE_APRIORI_GUID=0D =0D - OutputAprFilePath =3D os.path.join (GenFdsGlobalVariable.WorkSpace= Dir, \=0D - GenFdsGlobalVariable.FfsDir,\=0D - AprioriFileGuid + FvName)=0D + OutputAprFilePath =3D os.path.join(GenFdsGlobalVariable.WorkSpaceD= ir,=0D + GenFdsGlobalVariable.FfsDir,=0D + AprioriFileGuid + FvName)=0D if not os.path.exists(OutputAprFilePath):=0D os.makedirs(OutputAprFilePath)=0D =0D - OutputAprFileName =3D os.path.join( OutputAprFilePath, \=0D - AprioriFileGuid + FvName + '.Apri' = )=0D - AprFfsFileName =3D os.path.join (OutputAprFilePath,\=0D - AprioriFileGuid + FvName + '.Ffs')=0D + OutputAprFileName =3D os.path.join(OutputAprFilePath,=0D + AprioriFileGuid + FvName + '.Apri= ')=0D + AprFfsFileName =3D os.path.join(OutputAprFilePath,=0D + AprioriFileGuid + FvName + '.Ffs')=0D =0D Dict.update(self.DefineVarDict)=0D InfFileName =3D None=0D @@ -78,19 +80,22 @@ class AprioriSection (object): =0D if Arch:=0D Dict['$(ARCH)'] =3D Arch=0D - InfFileName =3D GenFdsGlobalVariable.MacroExtend(InfFileNa= me, Dict, Arch)=0D + InfFileName =3D GenFdsGlobalVariable.MacroExtend(=0D + InfFileName, Dict, Arch)=0D =0D if Arch:=0D - Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), Arch, GenFdsGlobalV= ariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(=0D + InfFileName, GenFdsGlobalVariable.WorkSpaceDir), A= rch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D Guid =3D Inf.Guid=0D else:=0D - Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(InfFileName, GenFdsGlobalVariable.WorkSpaceDir), TAB_COMMON, GenFdsG= lobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(=0D + InfFileName, GenFdsGlobalVariable.WorkSpaceDir), T= AB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainT= ag]=0D Guid =3D Inf.Guid=0D =0D if not Inf.Module.Binaries:=0D EdkLoggerError("GenFds", RESOURCE_NOT_AVAILABLE,=0D - "INF %s not found in build ARCH %s= !" \=0D - % (InfFileName, GenFdsGlobalVariab= le.ArchList))=0D + "INF %s not found in build ARCH %s!= "=0D + % (InfFileName, GenFdsGlobalVariabl= e.ArchList))=0D =0D GuidPart =3D Guid.split('-')=0D Buffer.write(pack('I', int(GuidPart[0], 16)))=0D @@ -107,15 +112,16 @@ class AprioriSection (object): =0D SaveFileOnChange(OutputAprFileName, Buffer.getvalue())=0D =0D - RawSectionFileName =3D os.path.join( OutputAprFilePath, \=0D - AprioriFileGuid + FvName + '.raw' )= =0D + RawSectionFileName =3D os.path.join(OutputAprFilePath,=0D + AprioriFileGuid + FvName + '.raw= ')=0D MakefilePath =3D None=0D if IsMakefile:=0D if not InfFileName:=0D return None=0D MakefilePath =3D InfFileName, Arch=0D - GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [OutputAp= rFileName], 'EFI_SECTION_RAW', IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(RawSectionFileName, [=0D + OutputAprFileName], 'EFI_SECT= ION_RAW', IsMakefile=3DIsMakefile)=0D GenFdsGlobalVariable.GenerateFfs(AprFfsFileName, [RawSectionFileNa= me],=0D - 'EFI_FV_FILETYPE_FREEFORM', Aprior= iFileGuid, MakefilePath=3DMakefilePath)=0D + 'EFI_FV_FILETYPE_FREEFORM', Aprio= riFileGuid, MakefilePath=3DMakefilePath)=0D =0D return AprFfsFileName=0D diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/P= ython/GenFds/Capsule.py index f4bfc74e551c..50fa5722fc91 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # generate capsule=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -24,13 +24,16 @@ from Common.DataType import TAB_LINE_BREAK WIN_CERT_REVISION =3D 0x0200=0D WIN_CERT_TYPE_EFI_GUID =3D 0x0EF1=0D EFI_CERT_TYPE_PKCS7_GUID =3D uuid.UUID('{4aafd29d-68df-49ee-8aa9-347d37566= 5a7}')=0D -EFI_CERT_TYPE_RSA2048_SHA256_GUID =3D uuid.UUID('{a7717414-c616-4977-9420-= 844712a735bf}')=0D +EFI_CERT_TYPE_RSA2048_SHA256_GUID =3D uuid.UUID(=0D + '{a7717414-c616-4977-9420-844712a735bf}')=0D =0D -## create inf file describes what goes into capsule and call GenFv to gene= rate capsule=0D +# create inf file describes what goes into capsule and call GenFv to gener= ate capsule=0D #=0D #=0D +=0D +=0D class Capsule (CapsuleClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -42,7 +45,7 @@ class Capsule (CapsuleClassObject): self.BlockNum =3D None=0D self.CapsuleName =3D None=0D =0D - ## Generate FMP capsule=0D + # Generate FMP capsule=0D #=0D # @retval string Generated Capsule file path=0D #=0D @@ -60,10 +63,12 @@ class Capsule (CapsuleClassObject): #=0D # Use FMP capsule GUID: 6DCBD5ED-E82D-4C44-BDA1-7194199AD92A=0D #=0D - Header.write(PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split= ('-')))=0D + Header.write(=0D + PackGUID('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A'.split('-')))=0D HdrSize =3D 0=0D if 'CAPSULE_HEADER_SIZE' in self.TokensDict:=0D - Header.write(pack('=3DI', int(self.TokensDict['CAPSULE_HEADER_= SIZE'], 16)))=0D + Header.write(=0D + pack('=3DI', int(self.TokensDict['CAPSULE_HEADER_SIZE'], 1= 6)))=0D HdrSize =3D int(self.TokensDict['CAPSULE_HEADER_SIZE'], 16)=0D else:=0D Header.write(pack('=3DI', 0x20))=0D @@ -89,11 +94,14 @@ class Capsule (CapsuleClassObject): #=0D FwMgrHdr =3D BytesIO()=0D if 'CAPSULE_HEADER_INIT_VERSION' in self.TokensDict:=0D - FwMgrHdr.write(pack('=3DI', int(self.TokensDict['CAPSULE_HEADE= R_INIT_VERSION'], 16)))=0D + FwMgrHdr.write(=0D + pack('=3DI', int(self.TokensDict['CAPSULE_HEADER_INIT_VERS= ION'], 16)))=0D else:=0D FwMgrHdr.write(pack('=3DI', 0x00000001))=0D - FwMgrHdr.write(pack('=3DHH', len(self.CapsuleDataList), len(self.F= mpPayloadList)))=0D - FwMgrHdrSize =3D 4+2+2+8*(len(self.CapsuleDataList)+len(self.FmpPa= yloadList))=0D + FwMgrHdr.write(pack('=3DHH', len(self.CapsuleDataList),=0D + len(self.FmpPayloadList)))=0D + FwMgrHdrSize =3D 4+2+2+8 * \=0D + (len(self.CapsuleDataList)+len(self.FmpPayloadList))=0D =0D #=0D # typedef struct _WIN_CERTIFICATE {=0D @@ -143,27 +151,37 @@ class Capsule (CapsuleClassObject): for Obj in fmp.VendorCodeFile:=0D fmp.VendorCodeFile =3D Obj.GenCapsuleSubItem()=0D if fmp.Certificate_Guid:=0D - ExternalTool, ExternalOption =3D FindExtendTool([], GenFds= GlobalVariable.ArchList, fmp.Certificate_Guid)=0D + ExternalTool, ExternalOption =3D FindExtendTool(=0D + [], GenFdsGlobalVariable.ArchList, fmp.Certificate_Gui= d)=0D CmdOption =3D ''=0D CapInputFile =3D fmp.ImageFile=0D if not os.path.isabs(fmp.ImageFile):=0D - CapInputFile =3D os.path.join(GenFdsGlobalVariable.Wor= kSpaceDir, fmp.ImageFile)=0D - CapOutputTmp =3D os.path.join(GenFdsGlobalVariable.FvDir, = self.UiCapsuleName) + '.tmp'=0D + CapInputFile =3D os.path.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, fmp.ImageFile)= =0D + CapOutputTmp =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.UiCapsuleName) + '.tm= p'=0D if ExternalTool is None:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "No tool found= with GUID %s" % fmp.Certificate_Guid)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "No tool found with GUID %= s" % fmp.Certificate_Guid)=0D else:=0D CmdOption +=3D ExternalTool=0D if ExternalOption:=0D CmdOption =3D CmdOption + ' ' + ExternalOption=0D - CmdOption +=3D ' -e ' + ' --monotonic-count ' + str(fmp.Mo= notonicCount) + ' -o ' + CapOutputTmp + ' ' + CapInputFile=0D + CmdOption +=3D ' -e ' + ' --monotonic-count ' + \=0D + str(fmp.MonotonicCount) + ' -o ' + \=0D + CapOutputTmp + ' ' + CapInputFile=0D CmdList =3D CmdOption.split()=0D - GenFdsGlobalVariable.CallExternalTool(CmdList, "Failed to = generate FMP auth capsule")=0D + GenFdsGlobalVariable.CallExternalTool(=0D + CmdList, "Failed to generate FMP auth capsule")=0D if uuid.UUID(fmp.Certificate_Guid) =3D=3D EFI_CERT_TYPE_PK= CS7_GUID:=0D - dwLength =3D 4 + 2 + 2 + 16 + os.path.getsize(CapOutpu= tTmp) - os.path.getsize(CapInputFile)=0D + dwLength =3D 4 + 2 + 2 + 16 + \=0D + os.path.getsize(CapOutputTmp) - \=0D + os.path.getsize(CapInputFile)=0D else:=0D dwLength =3D 4 + 2 + 2 + 16 + 16 + 256 + 256=0D fmp.ImageFile =3D CapOutputTmp=0D - AuthData =3D [fmp.MonotonicCount, dwLength, WIN_CERT_REVIS= ION, WIN_CERT_TYPE_EFI_GUID, fmp.Certificate_Guid]=0D + AuthData =3D [fmp.MonotonicCount, dwLength, WIN_CERT_REVIS= ION,=0D + WIN_CERT_TYPE_EFI_GUID, fmp.Certificate_Guid]= =0D fmp.Buffer =3D fmp.GenCapsuleSubItem(AuthData)=0D else:=0D fmp.Buffer =3D fmp.GenCapsuleSubItem()=0D @@ -181,11 +199,12 @@ class Capsule (CapsuleClassObject): #=0D # Generate FMP capsule file=0D #=0D - CapOutputFile =3D os.path.join(GenFdsGlobalVariable.FvDir, self.Ui= CapsuleName) + '.Cap'=0D + CapOutputFile =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.UiCapsuleName) + '.Cap'=0D SaveFileOnChange(CapOutputFile, Header.getvalue(), True)=0D return CapOutputFile=0D =0D - ## Generate capsule=0D + # Generate capsule=0D #=0D # @param self The object pointer=0D # @retval string Generated Capsule file path=0D @@ -194,9 +213,10 @@ class Capsule (CapsuleClassObject): if self.UiCapsuleName.upper() + 'cap' in GenFdsGlobalVariable.Imag= eBinDict:=0D return GenFdsGlobalVariable.ImageBinDict[self.UiCapsuleName.up= per() + 'cap']=0D =0D - GenFdsGlobalVariable.InfLogger( "\nGenerate %s Capsule" %self.UiCa= psuleName)=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nGenerate %s Capsule" % self.UiCapsuleName)=0D if ('CAPSULE_GUID' in self.TokensDict and=0D - uuid.UUID(self.TokensDict['CAPSULE_GUID']) =3D=3D uuid.UUID('6= DCBD5ED-E82D-4C44-BDA1-7194199AD92A')):=0D + uuid.UUID(self.TokensDict['CAPSULE_GUID']) =3D=3D uuid.UUI= D('6DCBD5ED-E82D-4C44-BDA1-7194199AD92A')):=0D return self.GenFmpCapsule()=0D =0D CapInfFile =3D self.GenCapInf()=0D @@ -207,44 +227,47 @@ class Capsule (CapsuleClassObject): FileName =3D CapsuleDataObj.GenCapsuleSubItem()=0D CapsuleDataObj.CapsuleName =3D None=0D CapFileList.append(FileName)=0D - CapInfFile.append("EFI_FILE_NAME =3D " + \=0D - FileName + \=0D - TAB_LINE_BREAK)=0D + CapInfFile.append("EFI_FILE_NAME =3D " +=0D + FileName +=0D + TAB_LINE_BREAK)=0D SaveFileOnChange(self.CapInfFileName, ''.join(CapInfFile), False)= =0D #=0D # Call GenFv tool to generate capsule=0D #=0D - CapOutputFile =3D os.path.join(GenFdsGlobalVariable.FvDir, self.Ui= CapsuleName)=0D + CapOutputFile =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.UiCapsuleName)=0D CapOutputFile =3D CapOutputFile + '.Cap'=0D GenFdsGlobalVariable.GenerateFirmwareVolume(=0D - CapOutputFile,=0D - [self.CapInfFileName],=0D - Capsule=3DTrue,=0D - FfsList=3DCapFileList=0D - )=0D + CapOutputFile,=0D + [self.CapInfFileName],=0D + Capsule=3DTrue,=0D + FfsList=3DCapFileList=0D + )=0D =0D - GenFdsGlobalVariable.VerboseLogger( "\nGenerate %s Capsule Success= fully" %self.UiCapsuleName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "\nGenerate %s Capsule Successfully" % self.UiCapsuleName)=0D GenFdsGlobalVariable.SharpCounter =3D 0=0D - GenFdsGlobalVariable.ImageBinDict[self.UiCapsuleName.upper() + 'ca= p'] =3D CapOutputFile=0D + GenFdsGlobalVariable.ImageBinDict[self.UiCapsuleName.upper(=0D + ) + 'cap'] =3D CapOutputFile=0D return CapOutputFile=0D =0D - ## Generate inf file for capsule=0D + # Generate inf file for capsule=0D #=0D # @param self The object pointer=0D # @retval file inf file object=0D #=0D def GenCapInf(self):=0D self.CapInfFileName =3D os.path.join(GenFdsGlobalVariable.FvDir,=0D - self.UiCapsuleName + "_Cap" + '.inf')= =0D + self.UiCapsuleName + "_Cap" + '= .inf')=0D CapInfFile =3D []=0D =0D CapInfFile.append("[options]" + TAB_LINE_BREAK)=0D =0D for Item in self.TokensDict:=0D - CapInfFile.append("EFI_" + \=0D - Item + \=0D - ' =3D ' + \=0D - self.TokensDict[Item] + \=0D - TAB_LINE_BREAK)=0D + CapInfFile.append("EFI_" +=0D + Item +=0D + ' =3D ' +=0D + self.TokensDict[Item] +=0D + TAB_LINE_BREAK)=0D =0D return CapInfFile=0D diff --git a/BaseTools/Source/Python/GenFds/CapsuleData.py b/BaseTools/Sour= ce/Python/GenFds/CapsuleData.py index ebbde7f8708c..f9b1569635aa 100644 --- a/BaseTools/Source/Python/GenFds/CapsuleData.py +++ b/BaseTools/Source/Python/GenFds/CapsuleData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # generate capsule=0D #=0D # Copyright (c) 2007-2018, Intel Corporation. All rights reserved.
        =0D @@ -17,35 +17,39 @@ import os from Common.Misc import SaveFileOnChange=0D import uuid=0D =0D -## base class for capsule data=0D +# base class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleData:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D def __init__(self):=0D pass=0D =0D - ## generate capsule data=0D + # generate capsule data=0D #=0D # @param self The object pointer=0D def GenCapsuleSubItem(self):=0D pass=0D =0D -## FFS class for capsule data=0D +# FFS class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleFfs (CapsuleData):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self) :=0D + def __init__(self):=0D self.Ffs =3D None=0D self.FvName =3D None=0D =0D - ## generate FFS capsule data=0D + # generate FFS capsule data=0D #=0D # @param self The object pointer=0D # @retval string Generated file name=0D @@ -54,20 +58,22 @@ class CapsuleFfs (CapsuleData): FfsFile =3D self.Ffs.GenFfs()=0D return FfsFile=0D =0D -## FV class for capsule data=0D +# FV class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleFv (CapsuleData):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self) :=0D + def __init__(self):=0D self.Ffs =3D None=0D self.FvName =3D None=0D self.CapsuleName =3D None=0D =0D - ## generate FV capsule data=0D + # generate FV capsule data=0D #=0D # @param self The object pointer=0D # @retval string Generated file name=0D @@ -75,7 +81,8 @@ class CapsuleFv (CapsuleData): def GenCapsuleSubItem(self):=0D if self.FvName.find('.fv') =3D=3D -1:=0D if self.FvName.upper() in GenFdsGlobalVariable.FdfParser.Profi= le.FvDict:=0D - FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict[se= lf.FvName.upper()]=0D + FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict[se= lf.FvName.upper(=0D + )]=0D FdBuffer =3D BytesIO()=0D FvObj.CapsuleName =3D self.CapsuleName=0D FvFile =3D FvObj.AddToBuffer(FdBuffer)=0D @@ -86,20 +93,22 @@ class CapsuleFv (CapsuleData): FvFile =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FvN= ame)=0D return FvFile=0D =0D -## FD class for capsule data=0D +# FD class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleFd (CapsuleData):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self) :=0D + def __init__(self):=0D self.Ffs =3D None=0D self.FdName =3D None=0D self.CapsuleName =3D None=0D =0D - ## generate FD capsule data=0D + # generate FD capsule data=0D #=0D # @param self The object pointer=0D # @retval string Generated file name=0D @@ -107,26 +116,29 @@ class CapsuleFd (CapsuleData): def GenCapsuleSubItem(self):=0D if self.FdName.find('.fd') =3D=3D -1:=0D if self.FdName.upper() in GenFdsGlobalVariable.FdfParser.Profi= le.FdDict:=0D - FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[se= lf.FdName.upper()]=0D + FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[se= lf.FdName.upper(=0D + )]=0D FdFile =3D FdObj.GenFd()=0D return FdFile=0D else:=0D FdFile =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FdN= ame)=0D return FdFile=0D =0D -## AnyFile class for capsule data=0D +# AnyFile class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleAnyFile (CapsuleData):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self) :=0D + def __init__(self):=0D self.Ffs =3D None=0D self.FileName =3D None=0D =0D - ## generate AnyFile capsule data=0D + # generate AnyFile capsule data=0D #=0D # @param self The object pointer=0D # @retval string Generated file name=0D @@ -134,19 +146,21 @@ class CapsuleAnyFile (CapsuleData): def GenCapsuleSubItem(self):=0D return self.FileName=0D =0D -## Afile class for capsule data=0D +# Afile class for capsule data=0D #=0D #=0D +=0D +=0D class CapsuleAfile (CapsuleData):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self) :=0D + def __init__(self):=0D self.Ffs =3D None=0D self.FileName =3D None=0D =0D - ## generate Afile capsule data=0D + # generate Afile capsule data=0D #=0D # @param self The object pointer=0D # @retval string Generated file name=0D @@ -154,6 +168,7 @@ class CapsuleAfile (CapsuleData): def GenCapsuleSubItem(self):=0D return self.FileName=0D =0D +=0D class CapsulePayload(CapsuleData):=0D '''Generate payload file, the header is defined below:=0D #pragma pack(1)=0D @@ -167,6 +182,7 @@ class CapsulePayload(CapsuleData): UINT64 UpdateHardwareInstance; //Introduced in v2=0D } EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER;=0D '''=0D +=0D def __init__(self):=0D self.UiName =3D None=0D self.Version =3D None=0D @@ -201,28 +217,29 @@ class CapsulePayload(CapsuleData): #=0D Guid =3D self.ImageTypeId.split('-')=0D Buffer =3D pack('=3DILHHBBBBBBBBBBBBIIQ',=0D - int(self.Version, 16),=0D - int(Guid[0], 16),=0D - int(Guid[1], 16),=0D - int(Guid[2], 16),=0D - int(Guid[3][-4:-2], 16),=0D - int(Guid[3][-2:], 16),=0D - int(Guid[4][-12:-10], 16),=0D - int(Guid[4][-10:-8], 16),=0D - int(Guid[4][-8:-6], 16),=0D - int(Guid[4][-6:-4], 16),=0D - int(Guid[4][-4:-2], 16),=0D - int(Guid[4][-2:], 16),=0D - int(self.ImageIndex, 16),=0D - 0,=0D - 0,=0D - 0,=0D - ImageFileSize,=0D - VendorFileSize,=0D - int(self.HardwareInstance, 16)=0D - )=0D + int(self.Version, 16),=0D + int(Guid[0], 16),=0D + int(Guid[1], 16),=0D + int(Guid[2], 16),=0D + int(Guid[3][-4:-2], 16),=0D + int(Guid[3][-2:], 16),=0D + int(Guid[4][-12:-10], 16),=0D + int(Guid[4][-10:-8], 16),=0D + int(Guid[4][-8:-6], 16),=0D + int(Guid[4][-6:-4], 16),=0D + int(Guid[4][-4:-2], 16),=0D + int(Guid[4][-2:], 16),=0D + int(self.ImageIndex, 16),=0D + 0,=0D + 0,=0D + 0,=0D + ImageFileSize,=0D + VendorFileSize,=0D + int(self.HardwareInstance, 16)=0D + )=0D if AuthData:=0D - Buffer +=3D pack('QIHH', AuthData[0], AuthData[1], AuthData[2]= , AuthData[3])=0D + Buffer +=3D pack('QIHH', AuthData[0],=0D + AuthData[1], AuthData[2], AuthData[3])=0D Buffer +=3D uuid.UUID(AuthData[4]).bytes_le=0D =0D #=0D diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/= Source/Python/GenFds/CompressSection.py index e62280fc16c2..f248cb4ceaa1 100644 --- a/BaseTools/Source/Python/GenFds/CompressSection.py +++ b/BaseTools/Source/Python/GenFds/CompressSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process compress section generation=0D #=0D # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
        = =0D @@ -18,25 +18,27 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable from CommonDataClass.FdfClass import CompressSectionClassObject=0D from Common.DataType import *=0D =0D -## generate compress section=0D +# generate compress section=0D #=0D #=0D -class CompressSection (CompressSectionClassObject) :=0D =0D - ## compress types: PI standard and non PI standard=0D +=0D +class CompressSection (CompressSectionClassObject):=0D +=0D + # compress types: PI standard and non PI standard=0D CompTypeDict =3D {=0D - 'PI_STD' : 'PI_STD',=0D - 'PI_NONE' : 'PI_NONE'=0D + 'PI_STD': 'PI_STD',=0D + 'PI_NONE': 'PI_NONE'=0D }=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D CompressSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate compressed section=0D #=0D @@ -49,7 +51,7 @@ class CompressSection (CompressSectionClassObject) : # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name, section alignment)=0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf =3D None, Dict =3D None, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D =0D if FfsInf is not None:=0D self.CompType =3D FfsInf.__ExtendMacro__(self.CompType)=0D @@ -63,12 +65,13 @@ class CompressSection (CompressSectionClassObject) : Dict =3D {}=0D for Sect in self.SectionList:=0D Index =3D Index + 1=0D - SecIndex =3D '%s.%d' %(SecNum, Index)=0D - ReturnSectList, AlignValue =3D Sect.GenSection(OutputPath, Mod= uleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=3DIsMakefile)=0D + SecIndex =3D '%s.%d' % (SecNum, Index)=0D + ReturnSectList, AlignValue =3D Sect.GenSection(=0D + OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, D= ict, IsMakefile=3DIsMakefile)=0D if AlignValue is not None:=0D if MaxAlign is None:=0D MaxAlign =3D AlignValue=0D - if GenFdsGlobalVariable.GetAlignment (AlignValue) > GenFds= GlobalVariable.GetAlignment (MaxAlign):=0D + if GenFdsGlobalVariable.GetAlignment(AlignValue) > GenFdsG= lobalVariable.GetAlignment(MaxAlign):=0D MaxAlign =3D AlignValue=0D if ReturnSectList !=3D []:=0D if AlignValue is None:=0D @@ -78,19 +81,18 @@ class CompressSection (CompressSectionClassObject) : SectAlign.append(AlignValue)=0D =0D OutputFile =3D OutputPath + \=0D - os.sep + \=0D - ModuleName + \=0D - SUP_MODULE_SEC + \=0D - SecNum + \=0D - SectionSuffix['COMPRESS']=0D + os.sep + \=0D + ModuleName + \=0D + SUP_MODULE_SEC + \=0D + SecNum + \=0D + SectionSuffix['COMPRESS']=0D OutputFile =3D os.path.normpath(OutputFile)=0D DummyFile =3D OutputFile + '.dummy'=0D - GenFdsGlobalVariable.GenerateSection(DummyFile, SectFiles, InputAl= ign=3DSectAlign, IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(=0D + DummyFile, SectFiles, InputAlign=3DSectAlign, IsMakefile=3DIsM= akefile)=0D =0D GenFdsGlobalVariable.GenerateSection(OutputFile, [DummyFile], Sect= ion.Section.SectionType['COMPRESS'],=0D CompressionType=3Dself.CompTy= peDict[self.CompType], IsMakefile=3DIsMakefile)=0D OutputFileList =3D []=0D OutputFileList.append(OutputFile)=0D return OutputFileList, self.Alignment=0D -=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Sour= ce/Python/GenFds/DataSection.py index 5af3ee7b7f7c..d7c859649863 100644 --- a/BaseTools/Source/Python/GenFds/DataSection.py +++ b/BaseTools/Source/Python/GenFds/DataSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process data section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -20,18 +20,20 @@ from Common.Misc import PeImageClass from Common.LongFilePathSupport import CopyLongFilePath=0D from Common.DataType import *=0D =0D -## generate data section=0D +# generate data section=0D #=0D #=0D +=0D +=0D class DataSection (DataSectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D DataSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate compressed section=0D #=0D @@ -44,24 +46,28 @@ class DataSection (DataSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name list, section alignment)= =0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile =3D None, Dict =3D None, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D #=0D # Prepare the parameter of GenSection=0D #=0D if Dict is None:=0D Dict =3D {}=0D if FfsFile is not None:=0D - self.SectFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMac= ro(self.SectFileName)=0D - self.SectFileName =3D GenFdsGlobalVariable.MacroExtend(self.Se= ctFileName, Dict, FfsFile.CurrentArch)=0D + self.SectFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMac= ro(=0D + self.SectFileName)=0D + self.SectFileName =3D GenFdsGlobalVariable.MacroExtend(=0D + self.SectFileName, Dict, FfsFile.CurrentArch)=0D else:=0D - self.SectFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMac= ro(self.SectFileName)=0D - self.SectFileName =3D GenFdsGlobalVariable.MacroExtend(self.Se= ctFileName, Dict)=0D + self.SectFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMac= ro(=0D + self.SectFileName)=0D + self.SectFileName =3D GenFdsGlobalVariable.MacroExtend(=0D + self.SectFileName, Dict)=0D =0D """Check Section file exist or not !"""=0D =0D if not os.path.exists(self.SectFileName):=0D - self.SectFileName =3D os.path.join (GenFdsGlobalVariable.WorkS= paceDir,=0D - self.SectFileName)=0D + self.SectFileName =3D os.path.join(GenFdsGlobalVariable.WorkSp= aceDir,=0D + self.SectFileName)=0D =0D """Copy Map file to Ffs output"""=0D Filename =3D GenFdsGlobalVariable.MacroExtend(self.SectFileName)=0D @@ -72,13 +78,14 @@ class DataSection (DataSectionClassObject): if GenFdsGlobalVariable.CopyList =3D=3D []:=0D GenFdsGlobalVariable.CopyList =3D [(MapFile, CopyMapFi= le)]=0D else:=0D - GenFdsGlobalVariable.CopyList.append((MapFile, CopyMap= File))=0D + GenFdsGlobalVariable.CopyList.append(=0D + (MapFile, CopyMapFile))=0D else:=0D if os.path.exists(MapFile):=0D if not os.path.exists(CopyMapFile) or (os.path.getmtim= e(MapFile) > os.path.getmtime(CopyMapFile)):=0D CopyLongFilePath(MapFile, CopyMapFile)=0D =0D - #Get PE Section alignment when align is set to AUTO=0D + # Get PE Section alignment when align is set to AUTO=0D if self.Alignment =3D=3D 'Auto' and self.SecType in (BINARY_FILE_T= YPE_TE, BINARY_FILE_TYPE_PE32):=0D self.Alignment =3D "0"=0D NoStrip =3D True=0D @@ -89,29 +96,31 @@ class DataSection (DataSectionClassObject): if not NoStrip:=0D FileBeforeStrip =3D os.path.join(OutputPath, ModuleName + '.ef= i')=0D if not os.path.exists(FileBeforeStrip) or \=0D - (os.path.getmtime(self.SectFileName) > os.path.getmtime(Fi= leBeforeStrip)):=0D + (os.path.getmtime(self.SectFileName) > os.path.getmtim= e(FileBeforeStrip)):=0D CopyLongFilePath(self.SectFileName, FileBeforeStrip)=0D StrippedFile =3D os.path.join(OutputPath, ModuleName + '.strip= ped')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - StrippedFile,=0D - [GenFdsGlobalVariable.MacroExtend(self.SectFileName, D= ict)],=0D - Strip=3DTrue,=0D - IsMakefile =3D IsMakefile=0D - )=0D + StrippedFile,=0D + [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)= ],=0D + Strip=3DTrue,=0D + IsMakefile=3DIsMakefile=0D + )=0D self.SectFileName =3D StrippedFile=0D =0D if self.SecType =3D=3D BINARY_FILE_TYPE_TE:=0D - TeFile =3D os.path.join( OutputPath, ModuleName + 'Te.raw')=0D + TeFile =3D os.path.join(OutputPath, ModuleName + 'Te.raw')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - TeFile,=0D - [GenFdsGlobalVariable.MacroExtend(self.SectFileName, D= ict)],=0D - Type=3D'te',=0D - IsMakefile =3D IsMakefile=0D - )=0D + TeFile,=0D + [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)= ],=0D + Type=3D'te',=0D + IsMakefile=3DIsMakefile=0D + )=0D self.SectFileName =3D TeFile=0D =0D - OutputFile =3D os.path.join (OutputPath, ModuleName + SUP_MODULE_S= EC + SecNum + SectionSuffix.get(self.SecType))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + SectionSuff= ix.get(self.SecType))=0D OutputFile =3D os.path.normpath(OutputFile)=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileNam= e], Section.Section.SectionType.get(self.SecType), IsMakefile =3D IsMakefil= e)=0D + GenFdsGlobalVariable.GenerateSection(OutputFile, [=0D + self.SectFileName], Section.S= ection.SectionType.get(self.SecType), IsMakefile=3DIsMakefile)=0D FileList =3D [OutputFile]=0D return FileList, self.Alignment=0D diff --git a/BaseTools/Source/Python/GenFds/DepexSection.py b/BaseTools/Sou= rce/Python/GenFds/DepexSection.py index 6cabac38c496..fabbcba79e37 100644 --- a/BaseTools/Source/Python/GenFds/DepexSection.py +++ b/BaseTools/Source/Python/GenFds/DepexSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process depex section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -20,11 +20,13 @@ from Common.BuildToolError import * from Common.Misc import PathClass=0D from Common.DataType import *=0D =0D -## generate data section=0D +# generate data section=0D #=0D #=0D +=0D +=0D class DepexSection (DepexSectionClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -39,11 +41,11 @@ class DepexSection (DepexSectionClassObject): GenFds= GlobalVariable.ToolChainTag)=0D for Inf in GenFdsGlobalVariable.FdfParser.Profile.InfList:=0D ModuleData =3D GenFdsGlobalVariable.WorkSpace.BuildObject[= =0D - PathClass(Inf,= GenFdsGlobalVariable.WorkSpaceDir),=0D - Arch,=0D - GenFdsGlobalVa= riable.TargetName,=0D - GenFdsGlobalVa= riable.ToolChainTag=0D - ]=0D + PathClass(Inf, GenFdsGlobalVariable.WorkSpaceDir),=0D + Arch,=0D + GenFdsGlobalVariable.TargetName,=0D + GenFdsGlobalVariable.ToolChainTag=0D + ]=0D for Pkg in ModuleData.Packages:=0D if Pkg not in PkgList:=0D PkgList.append(Pkg)=0D @@ -56,7 +58,7 @@ class DepexSection (DepexSectionClassObject): return PkgDb.Guids[CName]=0D return None=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate compressed section=0D #=0D @@ -69,9 +71,10 @@ class DepexSection (DepexSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name list, section alignment)= =0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile =3D None, Dict =3D None, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, Ff= sFile=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D if self.ExpressionProcessed =3D=3D False:=0D - self.Expression =3D self.Expression.replace("\n", " ").replace= ("\r", " ")=0D + self.Expression =3D self.Expression.replace(=0D + "\n", " ").replace("\r", " ")=0D ExpList =3D self.Expression.split()=0D =0D for Exp in ExpList:=0D @@ -88,24 +91,27 @@ class DepexSection (DepexSectionClassObject): =0D if self.DepexType =3D=3D 'PEI_DEPEX_EXP':=0D ModuleType =3D SUP_MODULE_PEIM=0D - SecType =3D BINARY_FILE_TYPE_PEI_DEPEX=0D + SecType =3D BINARY_FILE_TYPE_PEI_DEPEX=0D elif self.DepexType =3D=3D 'DXE_DEPEX_EXP':=0D ModuleType =3D SUP_MODULE_DXE_DRIVER=0D - SecType =3D BINARY_FILE_TYPE_DXE_DEPEX=0D + SecType =3D BINARY_FILE_TYPE_DXE_DEPEX=0D elif self.DepexType =3D=3D 'SMM_DEPEX_EXP':=0D ModuleType =3D SUP_MODULE_DXE_SMM_DRIVER=0D - SecType =3D BINARY_FILE_TYPE_SMM_DEPEX=0D + SecType =3D BINARY_FILE_TYPE_SMM_DEPEX=0D else:=0D EdkLogger.error("GenFds", FORMAT_INVALID,=0D "Depex type %s is not valid for module %s" % (= self.DepexType, ModuleName))=0D =0D - InputFile =3D os.path.join (OutputPath, ModuleName + SUP_MODULE_SE= C + SecNum + '.depex')=0D + InputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + '.depex')=0D InputFile =3D os.path.normpath(InputFile)=0D Depex =3D DependencyExpression(self.Expression, ModuleType)=0D Depex.Generate(InputFile)=0D =0D - OutputFile =3D os.path.join (OutputPath, ModuleName + SUP_MODULE_S= EC + SecNum + '.dpx')=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + '.dpx')=0D OutputFile =3D os.path.normpath(OutputFile)=0D =0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [InputFile], Sect= ion.Section.SectionType.get (SecType), IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(OutputFile, [=0D + InputFile], Section.Section.S= ectionType.get(SecType), IsMakefile=3DIsMakefile)=0D return [OutputFile], self.Alignment=0D diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Sourc= e/Python/GenFds/EfiSection.py index fd58391dac99..8db984e83c71 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process rule section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -24,19 +24,21 @@ from Common.LongFilePathSupport import OpenLongFilePath= as open from Common.LongFilePathSupport import CopyLongFilePath=0D from Common.DataType import *=0D =0D -## generate rule section=0D +# generate rule section=0D #=0D #=0D +=0D +=0D class EfiSection (EfiSectionClassObject):=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D - EfiSectionClassObject.__init__(self)=0D + EfiSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate rule section=0D #=0D @@ -49,12 +51,12 @@ class EfiSection (EfiSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name list, section alignment)= =0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf =3D None, Dict =3D None, IsMakefile =3D False) :=0D + def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D =0D if self.FileName is not None and self.FileName.startswith('PCD('):= =0D self.FileName =3D GenFdsGlobalVariable.GetPcdValue(self.FileNa= me)=0D """Prepare the parameter of GenSection"""=0D - if FfsInf is not None :=0D + if FfsInf is not None:=0D InfFileName =3D FfsInf.InfFileName=0D SectionType =3D FfsInf.__ExtendMacro__(self.SectionType)=0D Filename =3D FfsInf.__ExtendMacro__(self.FileName)=0D @@ -72,7 +74,8 @@ class EfiSection (EfiSectionClassObject): elif FfsInf.ShadowFromInfFile is not None:=0D NoStrip =3D FfsInf.ShadowFromInfFile=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s apply rule = for None!" %ModuleName)=0D + EdkLogger.error("GenFds", GENFDS_ERROR,=0D + "Module %s apply rule for None!" % ModuleName)= =0D =0D """If the file name was pointed out, add it in FileList"""=0D FileList =3D []=0D @@ -84,7 +87,8 @@ class EfiSection (EfiSectionClassObject): if os.path.isabs(Filename):=0D Filename =3D os.path.normpath(Filename)=0D else:=0D - Filename =3D os.path.normpath(os.path.join(FfsInf.EfiOutpu= tPath, Filename))=0D + Filename =3D os.path.normpath(=0D + os.path.join(FfsInf.EfiOutputPath, Filename))=0D =0D if not self.Optional:=0D FileList.append(Filename)=0D @@ -95,8 +99,9 @@ class EfiSection (EfiSectionClassObject): if '.depex' in SuffixMap:=0D FileList.append(Filename)=0D else:=0D - FileList, IsSect =3D Section.Section.GetFileList(FfsInf, self.= FileType, self.FileExtension, Dict, IsMakefile=3DIsMakefile, SectionType=3D= SectionType)=0D - if IsSect :=0D + FileList, IsSect =3D Section.Section.GetFileList(=0D + FfsInf, self.FileType, self.FileExtension, Dict, IsMakefil= e=3DIsMakefile, SectionType=3DSectionType)=0D + if IsSect:=0D return FileList, self.Alignment=0D =0D Index =3D 0=0D @@ -120,18 +125,20 @@ class EfiSection (EfiSectionClassObject): BuildNumTuple =3D tuple()=0D =0D Num =3D SecNum=0D - OutputFile =3D os.path.join( OutputPath, ModuleName + SUP_= MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + S= ectionSuffix.get(SectionType))=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_VERSION',=0D - #Ui=3DStringData,=0D - Ver=3DBuildNum,=0D - IsMakefile=3DIsMakefil= e)=0D + # Ui=3DStringData,=0D + Ver=3DBuildNum,=0D + IsMakefile=3DIsMakefi= le)=0D OutputFileList.append(OutputFile)=0D =0D elif FileList !=3D []:=0D for File in FileList:=0D Index =3D Index + 1=0D - Num =3D '%s.%d' %(SecNum, Index)=0D - OutputFile =3D os.path.join(OutputPath, ModuleName + S= UP_MODULE_SEC + Num + SectionSuffix.get(SectionType))=0D + Num =3D '%s.%d' % (SecNum, Index)=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + Num + Se= ctionSuffix.get(SectionType))=0D f =3D open(File, 'r')=0D VerString =3D f.read()=0D f.close()=0D @@ -139,9 +146,9 @@ class EfiSection (EfiSectionClassObject): if BuildNum is not None and BuildNum !=3D '':=0D BuildNumTuple =3D ('-j', BuildNum)=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], '= EFI_SECTION_VERSION',=0D - #Ui=3DVerString,=0D - Ver=3DBuildNum,=0D - IsMakefile=3DIsMak= efile)=0D + # Ui=3DVerString,= =0D + Ver=3DBuildNum,=0D + IsMakefile=3DIsMa= kefile)=0D OutputFileList.append(OutputFile)=0D =0D else:=0D @@ -152,19 +159,22 @@ class EfiSection (EfiSectionClassObject): BuildNumTuple =3D tuple()=0D BuildNumString =3D ' ' + ' '.join(BuildNumTuple)=0D =0D - #if VerString =3D=3D '' and=0D + # if VerString =3D=3D '' and=0D if BuildNumString =3D=3D '':=0D - if self.Optional =3D=3D True :=0D - GenFdsGlobalVariable.VerboseLogger( "Optional Sect= ion don't exist!")=0D + if self.Optional =3D=3D True:=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Optional Section don't exist!")=0D return [], None=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s = miss Version Section value" %InfFileName)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "File: %s miss Version= Section value" % InfFileName)=0D Num =3D SecNum=0D - OutputFile =3D os.path.join( OutputPath, ModuleName + SUP_= MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + S= ectionSuffix.get(SectionType))=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_VERSION',=0D - #Ui=3DVerString,=0D - Ver=3DBuildNum,=0D - IsMakefile=3DIsMakefil= e)=0D + # Ui=3DVerString,=0D + Ver=3DBuildNum,=0D + IsMakefile=3DIsMakefi= le)=0D OutputFileList.append(OutputFile)=0D =0D #=0D @@ -181,7 +191,8 @@ class EfiSection (EfiSectionClassObject): Num =3D SecNum=0D if IsMakefile and StringData =3D=3D ModuleNameStr:=0D StringData =3D "$(MODULE_NAME)"=0D - OutputFile =3D os.path.join( OutputPath, ModuleName + SUP_= MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + S= ectionSuffix.get(SectionType))=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE',=0D Ui=3DStringData, IsMa= kefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D @@ -189,15 +200,16 @@ class EfiSection (EfiSectionClassObject): elif FileList !=3D []:=0D for File in FileList:=0D Index =3D Index + 1=0D - Num =3D '%s.%d' %(SecNum, Index)=0D - OutputFile =3D os.path.join(OutputPath, ModuleName + S= UP_MODULE_SEC + Num + SectionSuffix.get(SectionType))=0D + Num =3D '%s.%d' % (SecNum, Index)=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + Num + Se= ctionSuffix.get(SectionType))=0D f =3D open(File, 'r')=0D UiString =3D f.read()=0D f.close()=0D if IsMakefile and UiString =3D=3D ModuleNameStr:=0D UiString =3D "$(MODULE_NAME)"=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], '= EFI_SECTION_USER_INTERFACE',=0D - Ui=3DUiString, IsM= akefile=3DIsMakefile)=0D + Ui=3DUiString, Is= Makefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D else:=0D if StringData is not None and len(StringData) > 0:=0D @@ -205,16 +217,19 @@ class EfiSection (EfiSectionClassObject): else:=0D UiTuple =3D tuple()=0D =0D - if self.Optional =3D=3D True :=0D - GenFdsGlobalVariable.VerboseLogger( "Optional Sect= ion don't exist!")=0D + if self.Optional =3D=3D True:=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Optional Section don't exist!")=0D return '', None=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "File: %s = miss UI Section value" %InfFileName)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "File: %s miss UI Sect= ion value" % InfFileName)=0D =0D Num =3D SecNum=0D if IsMakefile and StringData =3D=3D ModuleNameStr:=0D StringData =3D "$(MODULE_NAME)"=0D - OutputFile =3D os.path.join( OutputPath, ModuleName + SUP_= MODULE_SEC + str(Num) + SectionSuffix.get(SectionType))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + str(Num) + S= ectionSuffix.get(SectionType))=0D GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_= SECTION_USER_INTERFACE',=0D Ui=3DStringData, IsMa= kefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D @@ -226,15 +241,17 @@ class EfiSection (EfiSectionClassObject): """If File List is empty"""=0D if FileList =3D=3D []:=0D if self.Optional =3D=3D True:=0D - GenFdsGlobalVariable.VerboseLogger("Optional Section d= on't exist!")=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Optional Section don't exist!")=0D return [], None=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Output file f= or %s section could not be found for %s" % (SectionType, InfFileName))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Output file f= or %s section could not be found for %s" % (=0D + SectionType, InfFileName))=0D =0D elif len(FileList) > 1:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D "Files suffixed with %s are not allowed to= have more than one file in %s[Binaries] section" % (=0D - self.FileExtension, InfFileName))=0D + self.FileExtension, InfFileName))=0D else:=0D for File in FileList:=0D File =3D GenFdsGlobalVariable.MacroExtend(File, Dict)= =0D @@ -242,77 +259,89 @@ class EfiSection (EfiSectionClassObject): =0D else:=0D """If File List is empty"""=0D - if FileList =3D=3D [] :=0D + if FileList =3D=3D []:=0D if self.Optional =3D=3D True:=0D - GenFdsGlobalVariable.VerboseLogger("Optional Section d= on't exist!")=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Optional Section don't exist!")=0D return [], None=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Output file f= or %s section could not be found for %s" % (SectionType, InfFileName))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Output file f= or %s section could not be found for %s" % (=0D + SectionType, InfFileName))=0D =0D else:=0D """Convert the File to Section file one by one """=0D for File in FileList:=0D """ Copy Map file to FFS output path """=0D Index =3D Index + 1=0D - Num =3D '%s.%d' %(SecNum, Index)=0D - OutputFile =3D os.path.join( OutputPath, ModuleName + = SUP_MODULE_SEC + Num + SectionSuffix.get(SectionType))=0D + Num =3D '%s.%d' % (SecNum, Index)=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + Num + Se= ctionSuffix.get(SectionType))=0D File =3D GenFdsGlobalVariable.MacroExtend(File, Dict)= =0D =0D - #Get PE Section alignment when align is set to AUTO=0D + # Get PE Section alignment when align is set to AUTO=0D if self.Alignment =3D=3D 'Auto' and (SectionType =3D= =3D BINARY_FILE_TYPE_PE32 or SectionType =3D=3D BINARY_FILE_TYPE_TE):=0D Align =3D "0"=0D if File[(len(File)-4):] =3D=3D '.efi' and FfsInf.InfMo= dule.BaseName =3D=3D os.path.basename(File)[:-4]:=0D MapFile =3D File.replace('.efi', '.map')=0D - CopyMapFile =3D os.path.join(OutputPath, ModuleNam= e + '.map')=0D + CopyMapFile =3D os.path.join(=0D + OutputPath, ModuleName + '.map')=0D if IsMakefile:=0D if GenFdsGlobalVariable.CopyList =3D=3D []:=0D - GenFdsGlobalVariable.CopyList =3D [(MapFil= e, CopyMapFile)]=0D + GenFdsGlobalVariable.CopyList =3D [=0D + (MapFile, CopyMapFile)]=0D else:=0D - GenFdsGlobalVariable.CopyList.append((MapF= ile, CopyMapFile))=0D + GenFdsGlobalVariable.CopyList.append(=0D + (MapFile, CopyMapFile))=0D else:=0D if os.path.exists(MapFile):=0D if not os.path.exists(CopyMapFile) or \=0D - (os.path.getmtime(MapFile) > os.pat= h.getmtime(CopyMapFile)):=0D + (os.path.getmtime(MapFile) > os.pa= th.getmtime(CopyMapFile)):=0D CopyLongFilePath(MapFile, CopyMapFile)= =0D =0D if not NoStrip:=0D - FileBeforeStrip =3D os.path.join(OutputPath, Modul= eName + '.efi')=0D + FileBeforeStrip =3D os.path.join(=0D + OutputPath, ModuleName + '.efi')=0D if IsMakefile:=0D if GenFdsGlobalVariable.CopyList =3D=3D []:=0D - GenFdsGlobalVariable.CopyList =3D [(File, = FileBeforeStrip)]=0D + GenFdsGlobalVariable.CopyList =3D [=0D + (File, FileBeforeStrip)]=0D else:=0D - GenFdsGlobalVariable.CopyList.append((File= , FileBeforeStrip))=0D + GenFdsGlobalVariable.CopyList.append(=0D + (File, FileBeforeStrip))=0D else:=0D if not os.path.exists(FileBeforeStrip) or \=0D - (os.path.getmtime(File) > os.path.getmtime= (FileBeforeStrip)):=0D + (os.path.getmtime(File) > os.path.getm= time(FileBeforeStrip)):=0D CopyLongFilePath(File, FileBeforeStrip)=0D - StrippedFile =3D os.path.join(OutputPath, ModuleNa= me + '.stripped')=0D + StrippedFile =3D os.path.join(=0D + OutputPath, ModuleName + '.stripped')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - StrippedFile,=0D - [File],=0D - Strip=3DTrue,=0D - IsMakefile =3D IsMakefile=0D - )=0D + StrippedFile,=0D + [File],=0D + Strip=3DTrue,=0D + IsMakefile=3DIsMakefile=0D + )=0D File =3D StrippedFile=0D =0D """For TE Section call GenFw to generate TE image"""=0D =0D if SectionType =3D=3D BINARY_FILE_TYPE_TE:=0D - TeFile =3D os.path.join( OutputPath, ModuleName + = 'Te.raw')=0D + TeFile =3D os.path.join(=0D + OutputPath, ModuleName + 'Te.raw')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - TeFile,=0D - [File],=0D - Type=3D'te',=0D - IsMakefile =3D IsMakefile=0D - )=0D + TeFile,=0D + [File],=0D + Type=3D'te',=0D + IsMakefile=3DIsMakefile=0D + )=0D File =3D TeFile=0D =0D """Call GenSection"""=0D GenFdsGlobalVariable.GenerateSection(OutputFile,=0D - [File],=0D - Section.Section.Se= ctionType.get (SectionType),=0D - IsMakefile=3DIsMak= efile=0D - )=0D + [File],=0D + Section.Section.S= ectionType.get(=0D + SectionType),= =0D + IsMakefile=3DIsMa= kefile=0D + )=0D OutputFileList.append(OutputFile)=0D =0D return OutputFileList, Align=0D diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python= /GenFds/Fd.py index 973936b6f273..03196f8b0d60 100644 --- a/BaseTools/Source/Python/GenFds/Fd.py +++ b/BaseTools/Source/Python/GenFds/Fd.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FD generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -23,40 +23,46 @@ from Common.BuildToolError import * from Common.Misc import SaveFileOnChange=0D from Common.DataType import BINARY_FILE_TYPE_FV=0D =0D -## generate FD=0D +# generate FD=0D #=0D #=0D +=0D +=0D class FD(FDClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D FDClassObject.__init__(self)=0D =0D - ## GenFd() method=0D + # GenFd() method=0D #=0D # Generate FD=0D #=0D # @retval string Generated FD file name=0D #=0D - def GenFd (self, Flag =3D False):=0D + def GenFd(self, Flag=3DFalse):=0D if self.FdUiName.upper() + 'fd' in GenFdsGlobalVariable.ImageBinDi= ct:=0D return GenFdsGlobalVariable.ImageBinDict[self.FdUiName.upper()= + 'fd']=0D =0D #=0D # Print Information=0D #=0D - FdFileName =3D os.path.join(GenFdsGlobalVariable.FvDir, self.FdUiN= ame + '.fd')=0D + FdFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.FdUiName + '.fd')=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger("\nFd File Name:%s (%s)" %(self= .FdUiName, FdFileName))=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nFd File Name:%s (%s)" % (self.FdUiName, FdFileName))=0D =0D Offset =3D 0x00=0D for item in self.BlockSizeList:=0D - Offset =3D Offset + item[0] * item[1]=0D + Offset =3D Offset + item[0] * item[1]=0D if Offset !=3D self.Size:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'FD %s Size not consis= tent with block array' % self.FdUiName)=0D - GenFdsGlobalVariable.VerboseLogger('Following Fv will be add to Fd= !!!')=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, 'FD %s Size not consistent with bl= ock array' % self.FdUiName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + 'Following Fv will be add to Fd !!!')=0D for FvObj in GenFdsGlobalVariable.FdfParser.Profile.FvDict:=0D GenFdsGlobalVariable.VerboseLogger(FvObj)=0D =0D @@ -70,21 +76,23 @@ class FD(FDClassObject): PreviousRegionStart =3D -1=0D PreviousRegionSize =3D 1=0D =0D - for RegionObj in self.RegionList :=0D + for RegionObj in self.RegionList:=0D if RegionObj.RegionType =3D=3D 'CAPSULE':=0D continue=0D if RegionObj.Offset + RegionObj.Size <=3D PreviousRegionSt= art:=0D pass=0D - elif RegionObj.Offset <=3D PreviousRegionStart or (RegionO= bj.Offset >=3DPreviousRegionStart and RegionObj.Offset < PreviousRegionStar= t + PreviousRegionSize):=0D + elif RegionObj.Offset <=3D PreviousRegionStart or (RegionO= bj.Offset >=3D PreviousRegionStart and RegionObj.Offset < PreviousRegionSta= rt + PreviousRegionSize):=0D pass=0D elif RegionObj.Offset > PreviousRegionStart + PreviousRegi= onSize:=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger('Padding region sta= rting from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousReg= ionSize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))=0D + GenFdsGlobalVariable.InfLogger('Padding region sta= rting from offset 0x%X, with size 0x%X' % (=0D + PreviousRegionStart + PreviousRegionSize, Regi= onObj.Offset - (PreviousRegionStart + PreviousRegionSize)))=0D PadRegion =3D Region.Region()=0D PadRegion.Offset =3D PreviousRegionStart + PreviousReg= ionSize=0D PadRegion.Size =3D RegionObj.Offset - PadRegion.Offset= =0D if not Flag:=0D - PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddre= ss, self.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDi= ct, self.DefineVarDict)=0D + PadRegion.AddToBuffer(TempFdBuffer, self.BaseAddre= ss, self.BlockSizeList,=0D + self.ErasePolarity, GenFdsGl= obalVariable.ImageBinDict, self.DefineVarDict)=0D PreviousRegionStart =3D RegionObj.Offset=0D PreviousRegionSize =3D RegionObj.Size=0D #=0D @@ -92,29 +100,33 @@ class FD(FDClassObject): #=0D if PreviousRegionSize > self.Size:=0D pass=0D - GenFdsGlobalVariable.VerboseLogger('Call each region\'s Ad= dToBuffer function')=0D - RegionObj.AddToBuffer (TempFdBuffer, self.BaseAddress, sel= f.BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, sel= f.DefineVarDict)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + 'Call each region\'s AddToBuffer function')=0D + RegionObj.AddToBuffer(TempFdBuffer, self.BaseAddress, self= .BlockSizeList,=0D + self.ErasePolarity, GenFdsGlobalVari= able.ImageBinDict, self.DefineVarDict)=0D =0D FdBuffer =3D BytesIO()=0D PreviousRegionStart =3D -1=0D PreviousRegionSize =3D 1=0D - for RegionObj in self.RegionList :=0D + for RegionObj in self.RegionList:=0D if RegionObj.Offset + RegionObj.Size <=3D PreviousRegionStart:= =0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - 'Region offset 0x%X in wrong order with Re= gion starting from 0x%X, size 0x%X\nRegions in FDF must have offsets appear= in ascending order.'\=0D + 'Region offset 0x%X in wrong order with Re= gion starting from 0x%X, size 0x%X\nRegions in FDF must have offsets appear= in ascending order.'=0D % (RegionObj.Offset, PreviousRegionStart, = PreviousRegionSize))=0D - elif RegionObj.Offset <=3D PreviousRegionStart or (RegionObj.O= ffset >=3DPreviousRegionStart and RegionObj.Offset < PreviousRegionStart + = PreviousRegionSize):=0D + elif RegionObj.Offset <=3D PreviousRegionStart or (RegionObj.O= ffset >=3D PreviousRegionStart and RegionObj.Offset < PreviousRegionStart += PreviousRegionSize):=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - 'Region offset 0x%X overlaps with Region s= tarting from 0x%X, size 0x%X' \=0D + 'Region offset 0x%X overlaps with Region s= tarting from 0x%X, size 0x%X'=0D % (RegionObj.Offset, PreviousRegionStart, = PreviousRegionSize))=0D elif RegionObj.Offset > PreviousRegionStart + PreviousRegionSi= ze:=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger('Padding region startin= g from offset 0x%X, with size 0x%X' %(PreviousRegionStart + PreviousRegionS= ize, RegionObj.Offset - (PreviousRegionStart + PreviousRegionSize)))=0D + GenFdsGlobalVariable.InfLogger('Padding region startin= g from offset 0x%X, with size 0x%X' % (=0D + PreviousRegionStart + PreviousRegionSize, RegionOb= j.Offset - (PreviousRegionStart + PreviousRegionSize)))=0D PadRegion =3D Region.Region()=0D PadRegion.Offset =3D PreviousRegionStart + PreviousRegionS= ize=0D PadRegion.Size =3D RegionObj.Offset - PadRegion.Offset=0D if not Flag:=0D - PadRegion.AddToBuffer(FdBuffer, self.BaseAddress, self= .BlockSizeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self= .DefineVarDict)=0D + PadRegion.AddToBuffer(FdBuffer, self.BaseAddress, self= .BlockSizeList,=0D + self.ErasePolarity, GenFdsGlobal= Variable.ImageBinDict, self.DefineVarDict)=0D PreviousRegionStart =3D RegionObj.Offset=0D PreviousRegionSize =3D RegionObj.Size=0D #=0D @@ -127,29 +139,25 @@ class FD(FDClassObject): #=0D # Call each region's AddToBuffer function=0D #=0D - GenFdsGlobalVariable.VerboseLogger('Call each region\'s AddToB= uffer function')=0D - RegionObj.AddToBuffer (FdBuffer, self.BaseAddress, self.BlockS= izeList, self.ErasePolarity, GenFdsGlobalVariable.ImageBinDict, self.Define= VarDict, Flag=3DFlag)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + 'Call each region\'s AddToBuffer function')=0D + RegionObj.AddToBuffer(FdBuffer, self.BaseAddress, self.BlockSi= zeList, self.ErasePolarity,=0D + GenFdsGlobalVariable.ImageBinDict, self.= DefineVarDict, Flag=3DFlag)=0D #=0D # Write the buffer contents to Fd file=0D #=0D - GenFdsGlobalVariable.VerboseLogger('Write the buffer contents to F= d file')=0D + GenFdsGlobalVariable.VerboseLogger(=0D + 'Write the buffer contents to Fd file')=0D if not Flag:=0D SaveFileOnChange(FdFileName, FdBuffer.getvalue())=0D FdBuffer.close()=0D - GenFdsGlobalVariable.ImageBinDict[self.FdUiName.upper() + 'fd'] = =3D FdFileName=0D + GenFdsGlobalVariable.ImageBinDict[self.FdUiName.upper(=0D + ) + 'fd'] =3D FdFileName=0D return FdFileName=0D =0D - ## generate flash map file=0D + # generate flash map file=0D #=0D # @param self The object pointer=0D #=0D - def GenFlashMap (self):=0D + def GenFlashMap(self):=0D pass=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source= /Python/GenFds/FdfParser.py index 5c8263f9bcc9..0b83d3b98c50 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # parse FDF file=0D #=0D # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
        = =0D @@ -58,37 +58,47 @@ T_CHAR_DOUBLE_QUOTE =3D '\"' T_CHAR_SINGLE_QUOTE =3D '\''=0D T_CHAR_BRACE_R =3D '}'=0D =0D -SEPARATORS =3D {TAB_EQUAL_SPLIT, TAB_VALUE_SPLIT, TAB_COMMA_SPLIT, '{', T_= CHAR_BRACE_R}=0D +SEPARATORS =3D {TAB_EQUAL_SPLIT, TAB_VALUE_SPLIT,=0D + TAB_COMMA_SPLIT, '{', T_CHAR_BRACE_R}=0D ALIGNMENTS =3D {"Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "= 32K", "64K", "128K",=0D - "256K", "512K", "1M", "2M", "4M", "8M"= , "16M"}=0D + "256K", "512K", "1M", "2M", "4M", "8M", "16M"}=0D ALIGNMENT_NOAUTO =3D ALIGNMENTS - {"Auto"}=0D CR_LB_SET =3D {T_CHAR_CR, TAB_LINE_BREAK}=0D =0D -RegionSizePattern =3D compile("\s*(?P(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*= (?P(?:0x|0X)?[a-fA-F0-9]+)\s*")=0D -RegionSizeGuidPattern =3D compile("\s*(?P\w+\.\w+[\.\w\[\]]*)\s*\|\s= *(?P\w+\.\w+[\.\w\[\]]*)\s*")=0D +RegionSizePattern =3D compile(=0D + "\s*(?P(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P(?:0x|0X)?[a-fA-F= 0-9]+)\s*")=0D +RegionSizeGuidPattern =3D compile(=0D + "\s*(?P\w+\.\w+[\.\w\[\]]*)\s*\|\s*(?P\w+\.\w+[\.\w\[\]]*)= \s*")=0D RegionOffsetPcdPattern =3D compile("\s*(?P\w+\.\w+[\.\w\[\]]*)\s*$")= =0D -ShortcutPcdPattern =3D compile("\s*\w+\s*=3D\s*(?P(?:0x|0X)?[a-fA-F= 0-9]+)\s*\|\s*(?P\w+\.\w+)\s*")=0D +ShortcutPcdPattern =3D compile(=0D + "\s*\w+\s*=3D\s*(?P(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P\w+\= .\w+)\s*")=0D BaseAddrValuePattern =3D compile('^0[xX][0-9a-fA-F]+')=0D FileExtensionPattern =3D compile(r'([a-zA-Z][a-zA-Z0-9]*)')=0D -TokenFindPattern =3D compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-= 9\-]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')=0D +TokenFindPattern =3D compile(=0D + r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOOL_CHAIN_TAG\= )|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\)|\*)')=0D AllIncludeFileList =3D []=0D =0D # Get the closest parent=0D -def GetParentAtLine (Line):=0D +=0D +=0D +def GetParentAtLine(Line):=0D for Profile in AllIncludeFileList:=0D if Profile.IsLineInFile(Line):=0D return Profile=0D return None=0D =0D # Check include loop=0D -def IsValidInclude (File, Line):=0D +=0D +=0D +def IsValidInclude(File, Line):=0D for Profile in AllIncludeFileList:=0D if Profile.IsLineInFile(Line) and Profile.FileName =3D=3D File:=0D return False=0D =0D return True=0D =0D -def GetRealFileLine (File, Line):=0D +=0D +def GetRealFileLine(File, Line):=0D InsertedLines =3D 0=0D for Profile in AllIncludeFileList:=0D if Profile.IsLineInFile(Line):=0D @@ -98,19 +108,21 @@ def GetRealFileLine (File, Line): =0D return (File, Line - InsertedLines)=0D =0D -## The exception class that used to report error messages when parsing FDF= =0D +# The exception class that used to report error messages when parsing FDF= =0D #=0D # Currently the "ToolName" is set to be "FdfParser".=0D #=0D +=0D +=0D class Warning (Exception):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Str The message to record=0D # @param File The FDF name=0D # @param Line The Line number that error occurs=0D #=0D - def __init__(self, Str, File =3D None, Line =3D None):=0D + def __init__(self, Str, File=3DNone, Line=3DNone):=0D FileLineTuple =3D GetRealFileLine(File, Line)=0D self.FileName =3D FileLineTuple[0]=0D self.LineNumber =3D FileLineTuple[1]=0D @@ -126,25 +138,31 @@ class Warning (Exception): @staticmethod=0D def Expected(Str, File, Line):=0D return Warning("expected {}".format(Str), File, Line)=0D +=0D @staticmethod=0D def ExpectedEquals(File, Line):=0D return Warning.Expected("'=3D'", File, Line)=0D +=0D @staticmethod=0D def ExpectedCurlyOpen(File, Line):=0D return Warning.Expected("'{'", File, Line)=0D +=0D @staticmethod=0D def ExpectedCurlyClose(File, Line):=0D return Warning.Expected("'}'", File, Line)=0D +=0D @staticmethod=0D def ExpectedBracketClose(File, Line):=0D return Warning.Expected("']'", File, Line)=0D =0D -## The Include file content class that used to record file data when parsi= ng include file=0D +# The Include file content class that used to record file data when parsin= g include file=0D #=0D # May raise Exception when opening file.=0D #=0D +=0D +=0D class IncludeFileProfile:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D @@ -164,7 +182,7 @@ class IncludeFileProfile: self.InsertStartLineNumber =3D None=0D self.InsertAdjust =3D 0=0D self.IncludeFileList =3D []=0D - self.Level =3D 1 # first level include file=0D + self.Level =3D 1 # first level include file=0D =0D def GetTotalLines(self):=0D TotalLines =3D self.InsertAdjust + len(self.FileLinesList)=0D @@ -181,7 +199,7 @@ class IncludeFileProfile: return False=0D =0D def GetLineInFile(self, Line):=0D - if not self.IsLineInFile (Line):=0D + if not self.IsLineInFile(Line):=0D return (self.FileName, -1)=0D =0D InsertedLines =3D self.InsertStartLineNumber=0D @@ -194,12 +212,14 @@ class IncludeFileProfile: =0D return (self.FileName, Line - InsertedLines + 1)=0D =0D -## The FDF content class that used to record file data when parsing FDF=0D +# The FDF content class that used to record file data when parsing FDF=0D #=0D # May raise Exception when opening file.=0D #=0D +=0D +=0D class FileProfile:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D @@ -217,7 +237,7 @@ class FileProfile: self.PcdDict =3D OrderedDict()=0D self.PcdLocalDict =3D OrderedDict()=0D self.InfList =3D []=0D - self.InfDict =3D {'ArchTBD':[]}=0D + self.InfDict =3D {'ArchTBD': []}=0D # ECC will use this Dict and List information=0D self.PcdFileLineDict =3D {}=0D self.InfFileLineList =3D []=0D @@ -230,7 +250,7 @@ class FileProfile: self.OptRomDict =3D {}=0D self.FmpPayloadDict =3D {}=0D =0D -## The syntax parser for FDF=0D +# The syntax parser for FDF=0D #=0D # PreprocessFile method should be called prior to ParseFile=0D # CycleReferenceCheck method can detect cycles in FDF contents=0D @@ -238,8 +258,10 @@ class FileProfile: # GetNext*** procedures mean these procedures will get next token first, t= hen make judgement.=0D # Get*** procedures mean these procedures will make judgement on current t= oken only.=0D #=0D +=0D +=0D class FdfParser:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param FileName The file that to be parsed=0D @@ -266,7 +288,7 @@ class FdfParser: if GenFdsGlobalVariable.WorkSpaceDir =3D=3D '':=0D GenFdsGlobalVariable.WorkSpaceDir =3D os.getenv("WORKSPACE")=0D =0D - ## _SkipWhiteSpace() method=0D + # _SkipWhiteSpace() method=0D #=0D # Skip white spaces from current char.=0D #=0D @@ -281,7 +303,7 @@ class FdfParser: return=0D return=0D =0D - ## _EndOfFile() method=0D + # _EndOfFile() method=0D #=0D # Judge current buffer pos is at file end=0D #=0D @@ -298,7 +320,7 @@ class FdfParser: return True=0D return False=0D =0D - ## _EndOfLine() method=0D + # _EndOfLine() method=0D #=0D # Judge current buffer pos is at line end=0D #=0D @@ -309,12 +331,13 @@ class FdfParser: def _EndOfLine(self):=0D if self.CurrentLineNumber > len(self.Profile.FileLinesList):=0D return True=0D - SizeOfCurrentLine =3D len(self.Profile.FileLinesList[self.CurrentL= ineNumber - 1])=0D + SizeOfCurrentLine =3D len(=0D + self.Profile.FileLinesList[self.CurrentLineNumber - 1])=0D if self.CurrentOffsetWithinLine >=3D SizeOfCurrentLine:=0D return True=0D return False=0D =0D - ## Rewind() method=0D + # Rewind() method=0D #=0D # Reset file data buffer to the initial state=0D #=0D @@ -322,11 +345,11 @@ class FdfParser: # @param DestLine Optional new destination line number.=0D # @param DestOffset Optional new destination offset.=0D #=0D - def Rewind(self, DestLine =3D 1, DestOffset =3D 0):=0D + def Rewind(self, DestLine=3D1, DestOffset=3D0):=0D self.CurrentLineNumber =3D DestLine=0D self.CurrentOffsetWithinLine =3D DestOffset=0D =0D - ## _UndoOneChar() method=0D + # _UndoOneChar() method=0D #=0D # Go back one char in the file buffer=0D #=0D @@ -344,7 +367,7 @@ class FdfParser: self.CurrentOffsetWithinLine -=3D 1=0D return True=0D =0D - ## _GetOneChar() method=0D + # _GetOneChar() method=0D #=0D # Move forward one char in the file buffer=0D #=0D @@ -357,7 +380,7 @@ class FdfParser: else:=0D self.CurrentOffsetWithinLine +=3D 1=0D =0D - ## _CurrentChar() method=0D + # _CurrentChar() method=0D #=0D # Get the char pointed to by the file buffer pointer=0D #=0D @@ -367,7 +390,7 @@ class FdfParser: def _CurrentChar(self):=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self= .CurrentOffsetWithinLine]=0D =0D - ## _NextChar() method=0D + # _NextChar() method=0D #=0D # Get the one char pass the char pointed to by the file buffer point= er=0D #=0D @@ -379,7 +402,7 @@ class FdfParser: return self.Profile.FileLinesList[self.CurrentLineNumber][0]=0D return self.Profile.FileLinesList[self.CurrentLineNumber - 1][self= .CurrentOffsetWithinLine + 1]=0D =0D - ## _SetCurrentCharValue() method=0D + # _SetCurrentCharValue() method=0D #=0D # Modify the value of current char=0D #=0D @@ -387,9 +410,10 @@ class FdfParser: # @param Value The new value of current char=0D #=0D def _SetCurrentCharValue(self, Value):=0D - self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.Curren= tOffsetWithinLine] =3D Value=0D + self.Profile.FileLinesList[self.CurrentLineNumber -=0D + 1][self.CurrentOffsetWithinLine] =3D Va= lue=0D =0D - ## _CurrentLine() method=0D + # _CurrentLine() method=0D #=0D # Get the list that contains current line contents=0D #=0D @@ -400,12 +424,14 @@ class FdfParser: return self.Profile.FileLinesList[self.CurrentLineNumber - 1]=0D =0D def _StringToList(self):=0D - self.Profile.FileLinesList =3D [list(s) for s in self.Profile.File= LinesList]=0D + self.Profile.FileLinesList =3D [list(s)=0D + for s in self.Profile.FileLinesList]= =0D if not self.Profile.FileLinesList:=0D - EdkLogger.error('FdfParser', FILE_READ_FAILURE, 'The file is e= mpty!', File=3Dself.FileName)=0D + EdkLogger.error('FdfParser', FILE_READ_FAILURE,=0D + 'The file is empty!', File=3Dself.FileName)=0D self.Profile.FileLinesList[-1].append(' ')=0D =0D - def _ReplaceFragment(self, StartPos, EndPos, Value =3D ' '):=0D + def _ReplaceFragment(self, StartPos, EndPos, Value=3D' '):=0D if StartPos[0] =3D=3D EndPos[0]:=0D Offset =3D StartPos[1]=0D while Offset <=3D EndPos[1]:=0D @@ -437,9 +463,11 @@ class FdfParser: =0D MacroDict =3D {}=0D if not self._MacroDict[self._CurSection[0], self._CurSection[1], s= elf._CurSection[2]]:=0D - self._MacroDict[self._CurSection[0], self._CurSection[1], self= ._CurSection[2]] =3D MacroDict=0D + self._MacroDict[self._CurSection[0],=0D + self._CurSection[1], self._CurSection[2]] =3D = MacroDict=0D else:=0D - MacroDict =3D self._MacroDict[self._CurSection[0], self._CurSe= ction[1], self._CurSection[2]]=0D + MacroDict =3D self._MacroDict[self._CurSection[0],=0D + self._CurSection[1], self._CurSect= ion[2]]=0D MacroDict[Macro] =3D Value=0D =0D def _GetMacroValue(self, Macro):=0D @@ -451,9 +479,9 @@ class FdfParser: =0D if self._CurSection:=0D MacroDict =3D self._MacroDict[=0D - self._CurSection[0],=0D - self._CurSection[1],=0D - self._CurSection[2]=0D + self._CurSection[0],=0D + self._CurSection[1],=0D + self._CurSection[2]=0D ]=0D if MacroDict and Macro in MacroDict:=0D return MacroDict[Macro]=0D @@ -471,7 +499,8 @@ class FdfParser: # [Rule]: don't take rule section into account, macro is not allow= ed in this section=0D # [OptionRom.DriverName]=0D self._CurSection =3D []=0D - Section =3D Section.strip()[1:-1].upper().replace(' ', '').strip(T= AB_SPLIT)=0D + Section =3D Section.strip(=0D + )[1:-1].upper().replace(' ', '').strip(TAB_SPLIT)=0D ItemList =3D Section.split(TAB_SPLIT)=0D Item =3D ItemList[0]=0D if Item =3D=3D '' or Item =3D=3D 'RULE':=0D @@ -484,7 +513,7 @@ class FdfParser: elif len(ItemList) > 0:=0D self._CurSection =3D [ItemList[0], 'DUMMY', TAB_COMMON]=0D =0D - ## PreprocessFile() method=0D + # PreprocessFile() method=0D #=0D # Preprocess file contents, replace comments with spaces.=0D # In the end, rewind the file buffer pointer to the beginning=0D @@ -545,10 +574,11 @@ class FdfParser: self._GetOneChar()=0D =0D # restore from ListOfList to ListOfString=0D - self.Profile.FileLinesList =3D ["".join(list) for list in self.Pro= file.FileLinesList]=0D + self.Profile.FileLinesList =3D [=0D + "".join(list) for list in self.Profile.FileLinesList]=0D self.Rewind()=0D =0D - ## PreprocessIncludeFile() method=0D + # PreprocessIncludeFile() method=0D #=0D # Preprocess file contents, replace !include statements with file co= ntents.=0D # In the end, rewind the file buffer pointer to the beginning=0D @@ -563,10 +593,12 @@ class FdfParser: =0D if self._Token =3D=3D TAB_DEFINE:=0D if not self._GetNextToken():=0D - raise Warning.Expected("Macro name", self.FileName, se= lf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Macro name", self.FileName, self.CurrentLineNumbe= r)=0D Macro =3D self._Token=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D Value =3D self._GetExpression()=0D MacroDict[Macro] =3D Value=0D =0D @@ -575,7 +607,8 @@ class FdfParser: IncludeLine =3D self.CurrentLineNumber=0D IncludeOffset =3D self.CurrentOffsetWithinLine - len(TAB_I= NCLUDE)=0D if not self._GetNextToken():=0D - raise Warning.Expected("include file name", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "include file name", self.FileName, self.CurrentLi= neNumber)=0D IncFileName =3D self._Token=0D PreIndex =3D 0=0D StartPos =3D IncFileName.find('$(', PreIndex)=0D @@ -587,13 +620,15 @@ class FdfParser: if Macro in MacroDict:=0D MacroVal =3D MacroDict[Macro]=0D if MacroVal is not None:=0D - IncFileName =3D IncFileName.replace('$(' + Macro += ')', MacroVal, 1)=0D + IncFileName =3D IncFileName.replace(=0D + '$(' + Macro + ')', MacroVal, 1)=0D if MacroVal.find('$(') !=3D -1:=0D PreIndex =3D StartPos=0D else:=0D PreIndex =3D StartPos + len(MacroVal)=0D else:=0D - raise Warning("The Macro %s is not defined" %Macro= , self.FileName, self.CurrentLineNumber)=0D + raise Warning("The Macro %s is not defined" %=0D + Macro, self.FileName, self.CurrentLi= neNumber)=0D StartPos =3D IncFileName.find('$(', PreIndex)=0D EndPos =3D IncFileName.find(')', StartPos+2)=0D =0D @@ -601,7 +636,8 @@ class FdfParser: #=0D # First search the include file under the same directory a= s FDF file=0D #=0D - IncludedFile1 =3D PathClass(IncludedFile, os.path.dirname(= self.FileName))=0D + IncludedFile1 =3D PathClass(=0D + IncludedFile, os.path.dirname(self.FileName))=0D ErrorCode =3D IncludedFile1.Validate()[0]=0D if ErrorCode !=3D 0:=0D #=0D @@ -618,14 +654,16 @@ class FdfParser: #=0D # Also search file under the WORKSPACE directory=0D #=0D - IncludedFile1 =3D PathClass(IncludedFile, GlobalDa= ta.gWorkspace)=0D + IncludedFile1 =3D PathClass(=0D + IncludedFile, GlobalData.gWorkspace)=0D ErrorCode =3D IncludedFile1.Validate()[0]=0D if ErrorCode !=3D 0:=0D - 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),=0D + 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),=0D self.FileName, self.CurrentLineN= umber)=0D =0D - if not IsValidInclude (IncludedFile1.Path, self.CurrentLin= eNumber):=0D - raise Warning("The include file {0} is causing a inclu= de loop.\n".format (IncludedFile1.Path), self.FileName, self.CurrentLineNum= ber)=0D + if not IsValidInclude(IncludedFile1.Path, self.CurrentLine= Number):=0D + raise Warning("The include file {0} is causing a inclu= de loop.\n".format(=0D + IncludedFile1.Path), self.FileName, self.CurrentLi= neNumber)=0D =0D IncFileProfile =3D IncludeFileProfile(IncludedFile1.Path)= =0D =0D @@ -633,7 +671,7 @@ class FdfParser: CurrentOffset =3D self.CurrentOffsetWithinLine=0D # list index of the insertion, note that line number is 'C= urrentLine + 1'=0D InsertAtLine =3D CurrentLine=0D - ParentProfile =3D GetParentAtLine (CurrentLine)=0D + ParentProfile =3D GetParentAtLine(CurrentLine)=0D if ParentProfile is not None:=0D ParentProfile.IncludeFileList.insert(0, IncFileProfile= )=0D IncFileProfile.Level =3D ParentProfile.Level + 1=0D @@ -642,7 +680,8 @@ class FdfParser: if self._GetNextToken():=0D if self.CurrentLineNumber =3D=3D CurrentLine:=0D RemainingLine =3D self._CurrentLine()[CurrentOffse= t:]=0D - self.Profile.FileLinesList.insert(self.CurrentLine= Number, RemainingLine)=0D + self.Profile.FileLinesList.insert(=0D + self.CurrentLineNumber, RemainingLine)=0D IncFileProfile.InsertAdjust +=3D 1=0D self.CurrentLineNumber +=3D 1=0D self.CurrentOffsetWithinLine =3D 0=0D @@ -659,8 +698,8 @@ class FdfParser: TempList =3D list(self.Profile.FileLinesList[IncludeLine -= 1])=0D TempList.insert(IncludeOffset, TAB_COMMENT_SPLIT)=0D self.Profile.FileLinesList[IncludeLine - 1] =3D ''.join(Te= mpList)=0D - if Processed: # Nested and back-to-back support=0D - self.Rewind(DestLine =3D IncFileProfile.InsertStartLineNum= ber - 1)=0D + if Processed: # Nested and back-to-back support=0D + self.Rewind(DestLine=3DIncFileProfile.InsertStartLineNumbe= r - 1)=0D Processed =3D False=0D # Preprocess done.=0D self.Rewind()=0D @@ -676,7 +715,7 @@ class FdfParser: =0D return True=0D =0D - ## PreprocessConditionalStatement() method=0D + # PreprocessConditionalStatement() method=0D #=0D # Preprocess conditional statement.=0D # In the end, rewind the file buffer pointer to the beginning=0D @@ -697,7 +736,8 @@ class FdfParser: self._SkipToToken(TAB_SECTION_END)=0D Header +=3D self._SkippedChars=0D if Header.find('$(') !=3D -1:=0D - raise Warning("macro cannot be used in section hea= der", self.FileName, self.CurrentLineNumber)=0D + raise Warning(=0D + "macro cannot be used in section header", self= .FileName, self.CurrentLineNumber)=0D self._SectionHeaderParser(Header)=0D continue=0D # Replace macros except in RULE section or out of section= =0D @@ -712,7 +752,8 @@ class FdfParser: MacroName =3D CurLine[StartPos+2: EndPos]=0D MacroValue =3D self._GetMacroValue(MacroName)=0D if MacroValue is not None:=0D - CurLine =3D CurLine.replace('$(' + MacroName += ')', MacroValue, 1)=0D + CurLine =3D CurLine.replace(=0D + '$(' + MacroName + ')', MacroValue, 1)=0D if MacroValue.find('$(') !=3D -1:=0D PreIndex =3D StartPos=0D else:=0D @@ -727,18 +768,23 @@ class FdfParser: if self._Token =3D=3D TAB_DEFINE:=0D if self._GetIfListCurrentItemStat(IfList):=0D if not self._CurSection:=0D - raise Warning("macro cannot be defined in Rule sec= tion or out of section", self.FileName, self.CurrentLineNumber)=0D + raise Warning(=0D + "macro cannot be defined in Rule section or ou= t of section", self.FileName, self.CurrentLineNumber)=0D DefineLine =3D self.CurrentLineNumber - 1=0D - DefineOffset =3D self.CurrentOffsetWithinLine - len(TA= B_DEFINE)=0D + DefineOffset =3D self.CurrentOffsetWithinLine - \=0D + len(TAB_DEFINE)=0D if not self._GetNextToken():=0D - raise Warning.Expected("Macro name", self.FileName= , self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Macro name", self.FileName, self.CurrentLineN= umber)=0D Macro =3D self._Token=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D Value =3D self._GetExpression()=0D self._SetMacroValue(Macro, Value)=0D - self._WipeOffArea.append(((DefineLine, DefineOffset), = (self.CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + ((DefineLine, DefineOffset), (self.CurrentLineNumb= er - 1, self.CurrentOffsetWithinLine - 1)))=0D elif self._Token =3D=3D 'SET':=0D if not self._GetIfListCurrentItemStat(IfList):=0D continue=0D @@ -747,91 +793,115 @@ class FdfParser: PcdPair =3D self._GetNextPcdSettings()=0D PcdName =3D "%s.%s" % (PcdPair[1], PcdPair[0])=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D Value =3D self._GetExpression()=0D - Value =3D self._EvaluateConditional(Value, self.CurrentLin= eNumber, 'eval', True)=0D + Value =3D self._EvaluateConditional(=0D + Value, self.CurrentLineNumber, 'eval', True)=0D =0D self._PcdDict[PcdName] =3D Value=0D =0D self.Profile.PcdDict[PcdPair] =3D Value=0D self.SetPcdLocalation(PcdPair)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.Curr= entLineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[PcdPair] =3D FileLineTuple=0D =0D - self._WipeOffArea.append(((SetLine, SetOffset), (self.Curr= entLineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + ((SetLine, SetOffset), (self.CurrentLineNumber - 1, se= lf.CurrentOffsetWithinLine - 1)))=0D elif self._Token in {TAB_IF_DEF, TAB_IF_N_DEF, TAB_IF}:=0D - IfStartPos =3D (self.CurrentLineNumber - 1, self.CurrentOf= fsetWithinLine - len(self._Token))=0D + IfStartPos =3D (self.CurrentLineNumber - 1,=0D + self.CurrentOffsetWithinLine - len(self._Tok= en))=0D IfList.append([IfStartPos, None, None])=0D =0D CondLabel =3D self._Token=0D Expression =3D self._GetExpression()=0D =0D if CondLabel =3D=3D TAB_IF:=0D - ConditionSatisfied =3D self._EvaluateConditional(Expre= ssion, IfList[-1][0][0] + 1, 'eval')=0D + ConditionSatisfied =3D self._EvaluateConditional(=0D + Expression, IfList[-1][0][0] + 1, 'eval')=0D else:=0D - ConditionSatisfied =3D self._EvaluateConditional(Expre= ssion, IfList[-1][0][0] + 1, 'in')=0D + ConditionSatisfied =3D self._EvaluateConditional(=0D + Expression, IfList[-1][0][0] + 1, 'in')=0D if CondLabel =3D=3D TAB_IF_N_DEF:=0D ConditionSatisfied =3D not ConditionSatisfied=0D =0D BranchDetermined =3D ConditionSatisfied=0D - IfList[-1] =3D [IfList[-1][0], ConditionSatisfied, BranchD= etermined]=0D + IfList[-1] =3D [IfList[-1][0],=0D + ConditionSatisfied, BranchDetermined]=0D if ConditionSatisfied:=0D - self._WipeOffArea.append((IfList[-1][0], (self.Current= LineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + (IfList[-1][0], (self.CurrentLineNumber - 1, self.= CurrentOffsetWithinLine - 1)))=0D elif self._Token in {TAB_ELSE_IF, TAB_ELSE}:=0D - ElseStartPos =3D (self.CurrentLineNumber - 1, self.Current= OffsetWithinLine - len(self._Token))=0D + ElseStartPos =3D (self.CurrentLineNumber - 1,=0D + self.CurrentOffsetWithinLine - len(self._T= oken))=0D if len(IfList) <=3D 0:=0D - raise Warning("Missing !if statement", self.FileName, = self.CurrentLineNumber)=0D + raise Warning("Missing !if statement",=0D + self.FileName, self.CurrentLineNumber)=0D =0D if IfList[-1][1]:=0D IfList[-1] =3D [ElseStartPos, False, True]=0D - self._WipeOffArea.append((ElseStartPos, (self.CurrentL= ineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + (ElseStartPos, (self.CurrentLineNumber - 1, self.C= urrentOffsetWithinLine - 1)))=0D else:=0D self._WipeOffArea.append((IfList[-1][0], ElseStartPos)= )=0D IfList[-1] =3D [ElseStartPos, True, IfList[-1][2]]=0D if self._Token =3D=3D TAB_ELSE_IF:=0D Expression =3D self._GetExpression()=0D - ConditionSatisfied =3D self._EvaluateConditional(E= xpression, IfList[-1][0][0] + 1, 'eval')=0D - IfList[-1] =3D [IfList[-1][0], ConditionSatisfied,= IfList[-1][2]]=0D + ConditionSatisfied =3D self._EvaluateConditional(= =0D + Expression, IfList[-1][0][0] + 1, 'eval')=0D + IfList[-1] =3D [IfList[-1][0],=0D + ConditionSatisfied, IfList[-1][2]]=0D =0D if IfList[-1][1]:=0D if IfList[-1][2]:=0D IfList[-1][1] =3D False=0D else:=0D IfList[-1][2] =3D True=0D - self._WipeOffArea.append((IfList[-1][0], (self= .CurrentLineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + (IfList[-1][0], (self.CurrentLineNumber - = 1, self.CurrentOffsetWithinLine - 1)))=0D elif self._Token =3D=3D '!endif':=0D if len(IfList) <=3D 0:=0D - raise Warning("Missing !if statement", self.FileName, = self.CurrentLineNumber)=0D + raise Warning("Missing !if statement",=0D + self.FileName, self.CurrentLineNumber)=0D if IfList[-1][1]:=0D - self._WipeOffArea.append(((self.CurrentLineNumber - 1,= self.CurrentOffsetWithinLine - len('!endif')), (self.CurrentLineNumber - 1= , self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(((self.CurrentLineNumber - 1,= self.CurrentOffsetWithinLine - len(=0D + '!endif')), (self.CurrentLineNumber - 1, self.Curr= entOffsetWithinLine - 1)))=0D else:=0D - self._WipeOffArea.append((IfList[-1][0], (self.Current= LineNumber - 1, self.CurrentOffsetWithinLine - 1)))=0D + self._WipeOffArea.append(=0D + (IfList[-1][0], (self.CurrentLineNumber - 1, self.= CurrentOffsetWithinLine - 1)))=0D =0D IfList.pop()=0D elif not IfList: # Don't use PCDs inside conditional direct= ive=0D if self.CurrentLineNumber <=3D RegionLayoutLine:=0D # Don't try the same line twice=0D continue=0D - SetPcd =3D ShortcutPcdPattern.match(self.Profile.FileLines= List[self.CurrentLineNumber - 1])=0D + SetPcd =3D ShortcutPcdPattern.match(=0D + self.Profile.FileLinesList[self.CurrentLineNumber - 1]= )=0D if SetPcd:=0D self._PcdDict[SetPcd.group('name')] =3D SetPcd.group('= value')=0D RegionLayoutLine =3D self.CurrentLineNumber=0D continue=0D - RegionSize =3D RegionSizePattern.match(self.Profile.FileLi= nesList[self.CurrentLineNumber - 1])=0D + RegionSize =3D RegionSizePattern.match(=0D + self.Profile.FileLinesList[self.CurrentLineNumber - 1]= )=0D if not RegionSize:=0D RegionLayoutLine =3D self.CurrentLineNumber=0D continue=0D - RegionSizeGuid =3D RegionSizeGuidPattern.match(self.Profil= e.FileLinesList[self.CurrentLineNumber])=0D + RegionSizeGuid =3D RegionSizeGuidPattern.match(=0D + self.Profile.FileLinesList[self.CurrentLineNumber])=0D if not RegionSizeGuid:=0D RegionLayoutLine =3D self.CurrentLineNumber + 1=0D continue=0D - self._PcdDict[RegionSizeGuid.group('base')] =3D RegionSize= .group('base')=0D - self._PcdDict[RegionSizeGuid.group('size')] =3D RegionSize= .group('size')=0D + self._PcdDict[RegionSizeGuid.group(=0D + 'base')] =3D RegionSize.group('base')=0D + self._PcdDict[RegionSizeGuid.group(=0D + 'size')] =3D RegionSize.group('size')=0D RegionLayoutLine =3D self.CurrentLineNumber + 1=0D =0D if IfList:=0D - raise Warning("Missing !endif", self.FileName, self.CurrentLin= eNumber)=0D + raise Warning("Missing !endif", self.FileName,=0D + self.CurrentLineNumber)=0D self.Rewind()=0D =0D def _CollectMacroPcd(self):=0D @@ -852,9 +922,9 @@ class FdfParser: =0D # Section macro=0D ScopeMacro =3D self._MacroDict[=0D - self._CurSection[0],=0D - self._CurSection[1],=0D - self._CurSection[2]=0D + self._CurSection[0],=0D + self._CurSection[1],=0D + self._CurSection[2]=0D ]=0D if ScopeMacro:=0D MacroDict.update(ScopeMacro)=0D @@ -871,7 +941,7 @@ class FdfParser: =0D return MacroDict=0D =0D - def _EvaluateConditional(self, Expression, Line, Op =3D None, Value = =3D None):=0D + def _EvaluateConditional(self, Expression, Line, Op=3DNone, Value=3DNo= ne):=0D MacroPcdDict =3D self._CollectMacroPcd()=0D if Op =3D=3D 'eval':=0D try:=0D @@ -885,8 +955,8 @@ class FdfParser: # the precise number of line and return the evaluation res= ult=0D #=0D EdkLogger.warn('Parser', "Suspicious expression: %s" % str= (Excpt),=0D - File=3Dself.FileName, ExtraData=3Dself._Cu= rrentLine(),=0D - Line=3DLine)=0D + File=3Dself.FileName, ExtraData=3Dself._Cur= rentLine(),=0D + Line=3DLine)=0D return Excpt.result=0D except Exception as Excpt:=0D if hasattr(Excpt, 'Pcd'):=0D @@ -895,7 +965,8 @@ class FdfParser: raise Warning("Cannot use this PCD (%s) in an expr= ession as"=0D " it must be defined in a [PcdsFixed= AtBuild] or [PcdsFeatureFlag] section"=0D " of the DSC file (%s), and it is cu= rrently defined in this section:"=0D - " %s, line #: %d." % (Excpt.Pcd, Glo= balData.gPlatformOtherPcds['DSCFILE'], Info[0], Info[1]),=0D + " %s, line #: %d." % (=0D + Excpt.Pcd, GlobalData.gPlatformO= therPcds['DSCFILE'], Info[0], Info[1]),=0D self.FileName, Line)=0D else:=0D raise Warning("PCD (%s) is not defined in DSC file= (%s)" % (Excpt.Pcd, GlobalData.gPlatformOtherPcds['DSCFILE']),=0D @@ -907,7 +978,7 @@ class FdfParser: Expression =3D Expression[2:-1]=0D return Expression in MacroPcdDict=0D =0D - ## _IsToken() method=0D + # _IsToken() method=0D #=0D # Check whether input string is found from current char position alo= ng=0D # If found, the string value is put into self._Token=0D @@ -918,23 +989,26 @@ class FdfParser: # @retval True Successfully find string, file buffer pointer = moved forward=0D # @retval False Not able to find string, file buffer pointer n= ot changed=0D #=0D - def _IsToken(self, String, IgnoreCase =3D False):=0D + def _IsToken(self, String, IgnoreCase=3DFalse):=0D self._SkipWhiteSpace()=0D =0D # Only consider the same line, no multi-line token allowed=0D StartPos =3D self.CurrentOffsetWithinLine=0D index =3D -1=0D if IgnoreCase:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine: ].= upper().find(String.upper())=0D + index =3D self._CurrentLine()[self.CurrentOffsetWithinLine:].u= pper().find(=0D + String.upper())=0D else:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine: ].= find(String)=0D + index =3D self._CurrentLine(=0D + )[self.CurrentOffsetWithinLine:].find(String)=0D if index =3D=3D 0:=0D self.CurrentOffsetWithinLine +=3D len(String)=0D - self._Token =3D self._CurrentLine()[StartPos: self.CurrentOffs= etWithinLine]=0D + self._Token =3D self._CurrentLine(=0D + )[StartPos: self.CurrentOffsetWithinLine]=0D return True=0D return False=0D =0D - ## _IsKeyword() method=0D + # _IsKeyword() method=0D #=0D # Check whether input keyword is found from current char position al= ong, whole word only!=0D # If found, the string value is put into self._Token=0D @@ -945,22 +1019,26 @@ class FdfParser: # @retval True Successfully find string, file buffer pointer = moved forward=0D # @retval False Not able to find string, file buffer pointer n= ot changed=0D #=0D - def _IsKeyword(self, KeyWord, IgnoreCase =3D False):=0D + def _IsKeyword(self, KeyWord, IgnoreCase=3DFalse):=0D self._SkipWhiteSpace()=0D =0D # Only consider the same line, no multi-line token allowed=0D StartPos =3D self.CurrentOffsetWithinLine=0D index =3D -1=0D if IgnoreCase:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine: ].= upper().find(KeyWord.upper())=0D + index =3D self._CurrentLine()[self.CurrentOffsetWithinLine:].u= pper().find(=0D + KeyWord.upper())=0D else:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine: ].= find(KeyWord)=0D + index =3D self._CurrentLine(=0D + )[self.CurrentOffsetWithinLine:].find(KeyWord)=0D if index =3D=3D 0:=0D - followingChar =3D self._CurrentLine()[self.CurrentOffsetWithin= Line + len(KeyWord)]=0D + followingChar =3D self._CurrentLine(=0D + )[self.CurrentOffsetWithinLine + len(KeyWord)]=0D if not str(followingChar).isspace() and followingChar not in S= EPARATORS:=0D return False=0D self.CurrentOffsetWithinLine +=3D len(KeyWord)=0D - self._Token =3D self._CurrentLine()[StartPos: self.CurrentOffs= etWithinLine]=0D + self._Token =3D self._CurrentLine(=0D + )[StartPos: self.CurrentOffsetWithinLine]=0D return True=0D return False=0D =0D @@ -969,12 +1047,13 @@ class FdfParser: Index =3D len(Line) - 1=0D while Line[Index] in CR_LB_SET:=0D Index -=3D 1=0D - ExpressionString =3D self.Profile.FileLinesList[self.CurrentLineNu= mber - 1][self.CurrentOffsetWithinLine:Index+1]=0D + ExpressionString =3D self.Profile.FileLinesList[self.CurrentLineNu= mber -=0D + 1][self.CurrentOffse= tWithinLine:Index+1]=0D self.CurrentOffsetWithinLine +=3D len(ExpressionString)=0D ExpressionString =3D ExpressionString.strip()=0D return ExpressionString=0D =0D - ## _GetNextWord() method=0D + # _GetNextWord() method=0D #=0D # Get next C name from file lines=0D # If found, the string value is put into self._Token=0D @@ -995,13 +1074,14 @@ class FdfParser: while not self._EndOfLine():=0D TempChar =3D self._CurrentChar()=0D if (TempChar >=3D 'a' and TempChar <=3D 'z') or (TempChar = >=3D 'A' and TempChar <=3D 'Z') \=0D - or (TempChar >=3D '0' and TempChar <=3D '9') or TempChar = =3D=3D '_' or TempChar =3D=3D '-':=0D + or (TempChar >=3D '0' and TempChar <=3D '9') or Te= mpChar =3D=3D '_' or TempChar =3D=3D '-':=0D self._GetOneChar()=0D =0D else:=0D break=0D =0D - self._Token =3D self._CurrentLine()[StartPos: self.CurrentOffs= etWithinLine]=0D + self._Token =3D self._CurrentLine(=0D + )[StartPos: self.CurrentOffsetWithinLine]=0D return True=0D =0D return False=0D @@ -1018,18 +1098,19 @@ class FdfParser: while not self._EndOfLine():=0D TempChar =3D self._CurrentChar()=0D if (TempChar >=3D 'a' and TempChar <=3D 'z') or (TempChar = >=3D 'A' and TempChar <=3D 'Z') \=0D - or (TempChar >=3D '0' and TempChar <=3D '9') or TempChar = =3D=3D '_' or TempChar =3D=3D '-' or TempChar =3D=3D TAB_SECTION_START or T= empChar =3D=3D TAB_SECTION_END:=0D + or (TempChar >=3D '0' and TempChar <=3D '9') or Te= mpChar =3D=3D '_' or TempChar =3D=3D '-' or TempChar =3D=3D TAB_SECTION_STA= RT or TempChar =3D=3D TAB_SECTION_END:=0D self._GetOneChar()=0D =0D else:=0D break=0D =0D - self._Token =3D self._CurrentLine()[StartPos: self.CurrentOffs= etWithinLine]=0D + self._Token =3D self._CurrentLine(=0D + )[StartPos: self.CurrentOffsetWithinLine]=0D return True=0D =0D return False=0D =0D - ## _GetNextToken() method=0D + # _GetNextToken() method=0D #=0D # Get next token unit before a separator=0D # If found, the string value is put into self._Token=0D @@ -1073,7 +1154,7 @@ class FdfParser: else:=0D return False=0D =0D - ## _GetNextGuid() method=0D + # _GetNextGuid() method=0D #=0D # Get next token unit before a separator=0D # If found, the GUID string is put into self._Token=0D @@ -1103,14 +1184,17 @@ class FdfParser: try:=0D ValueNumber =3D int(Value, 0)=0D except:=0D - EdkLogger.error("FdfParser", FORMAT_INVALID, "The value is not= valid dec or hex number for %s." % Name)=0D + EdkLogger.error("FdfParser", FORMAT_INVALID,=0D + "The value is not valid dec or hex number for = %s." % Name)=0D if ValueNumber < 0:=0D - EdkLogger.error("FdfParser", FORMAT_INVALID, "The value can't = be set to negative value for %s." % Name)=0D + EdkLogger.error("FdfParser", FORMAT_INVALID,=0D + "The value can't be set to negative value for = %s." % Name)=0D if ValueNumber > MAX_VAL_TYPE[Scope]:=0D - EdkLogger.error("FdfParser", FORMAT_INVALID, "Too large value = for %s." % Name)=0D + EdkLogger.error("FdfParser", FORMAT_INVALID,=0D + "Too large value for %s." % Name)=0D return True=0D =0D - ## _UndoToken() method=0D + # _UndoToken() method=0D #=0D # Go back one token unit in file buffer=0D #=0D @@ -1123,7 +1207,6 @@ class FdfParser: self._GetOneChar()=0D return=0D =0D -=0D StartPos =3D self.CurrentOffsetWithinLine=0D CurrentLine =3D self.CurrentLineNumber=0D while CurrentLine =3D=3D self.CurrentLineNumber:=0D @@ -1143,7 +1226,7 @@ class FdfParser: =0D self._GetOneChar()=0D =0D - ## _GetNextHexNumber() method=0D + # _GetNextHexNumber() method=0D #=0D # Get next HEX data before a separator=0D # If found, the HEX data is put into self._Token=0D @@ -1161,7 +1244,7 @@ class FdfParser: self._UndoToken()=0D return False=0D =0D - ## _GetNextDecimalNumber() method=0D + # _GetNextDecimalNumber() method=0D #=0D # Get next decimal data before a separator=0D # If found, the decimal data is put into self._Token=0D @@ -1181,25 +1264,28 @@ class FdfParser: =0D def _GetNextPcdSettings(self):=0D if not self._GetNextWord():=0D - raise Warning.Expected("", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "", self.FileName, self.CurrentLineNum= ber)=0D pcdTokenSpaceCName =3D self._Token=0D =0D if not self._IsToken(TAB_SPLIT):=0D raise Warning.Expected(".", self.FileName, self.CurrentLineNum= ber)=0D =0D if not self._GetNextWord():=0D - raise Warning.Expected("", self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.Expected(=0D + "", self.FileName, self.CurrentLineNumber)=0D pcdCName =3D self._Token=0D =0D Fields =3D []=0D while self._IsToken(TAB_SPLIT):=0D if not self._GetNextPcdWord():=0D - raise Warning.Expected("Pcd Fields", self.FileName, self.C= urrentLineNumber)=0D + raise Warning.Expected(=0D + "Pcd Fields", self.FileName, self.CurrentLineNumber)=0D Fields.append(self._Token)=0D =0D - return (pcdCName, pcdTokenSpaceCName,TAB_SPLIT.join(Fields))=0D + return (pcdCName, pcdTokenSpaceCName, TAB_SPLIT.join(Fields))=0D =0D - ## _GetStringData() method=0D + # _GetStringData() method=0D #=0D # Get string contents quoted in ""=0D # If found, the decimal data is put into self._Token=0D @@ -1228,7 +1314,7 @@ class FdfParser: self._Token =3D self._SkippedChars.rstrip(QuoteToUse)=0D return True=0D =0D - ## _SkipToToken() method=0D + # _SkipToToken() method=0D #=0D # Search forward in file buffer for the string=0D # The skipped chars are put into self._SkippedChars=0D @@ -1239,16 +1325,18 @@ class FdfParser: # @retval True Successfully find the string, file buffer poin= ter moved forward=0D # @retval False Not able to find the string, file buffer point= er not changed=0D #=0D - def _SkipToToken(self, String, IgnoreCase =3D False):=0D + def _SkipToToken(self, String, IgnoreCase=3DFalse):=0D StartPos =3D self.GetFileBufferPos()=0D =0D self._SkippedChars =3D ""=0D while not self._EndOfFile():=0D index =3D -1=0D if IgnoreCase:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine= : ].upper().find(String.upper())=0D + index =3D self._CurrentLine()[self.CurrentOffsetWithinLine= :].upper().find(=0D + String.upper())=0D else:=0D - index =3D self._CurrentLine()[self.CurrentOffsetWithinLine= : ].find(String)=0D + index =3D self._CurrentLine(=0D + )[self.CurrentOffsetWithinLine:].find(String)=0D if index =3D=3D 0:=0D self.CurrentOffsetWithinLine +=3D len(String)=0D self._SkippedChars +=3D String=0D @@ -1260,7 +1348,7 @@ class FdfParser: self._SkippedChars =3D ""=0D return False=0D =0D - ## GetFileBufferPos() method=0D + # GetFileBufferPos() method=0D #=0D # Return the tuple of current line and offset within the line=0D #=0D @@ -1270,7 +1358,7 @@ class FdfParser: def GetFileBufferPos(self):=0D return (self.CurrentLineNumber, self.CurrentOffsetWithinLine)=0D =0D - ## SetFileBufferPos() method=0D + # SetFileBufferPos() method=0D #=0D # Restore the file buffer position=0D #=0D @@ -1280,7 +1368,7 @@ class FdfParser: def SetFileBufferPos(self, Pos):=0D (self.CurrentLineNumber, self.CurrentOffsetWithinLine) =3D Pos=0D =0D - ## Preprocess() method=0D + # Preprocess() method=0D #=0D # Preprocess comment, conditional directive, include directive, repl= ace macro.=0D # Exception will be raised if syntax error found=0D @@ -1297,12 +1385,13 @@ class FdfParser: self._StringToList()=0D for Pos in self._WipeOffArea:=0D self._ReplaceFragment(Pos[0], Pos[1])=0D - self.Profile.FileLinesList =3D ["".join(list) for list in self.Pro= file.FileLinesList]=0D + self.Profile.FileLinesList =3D [=0D + "".join(list) for list in self.Profile.FileLinesList]=0D =0D while self._GetDefines():=0D pass=0D =0D - ## ParseFile() method=0D + # ParseFile() method=0D #=0D # Parse the file profile buffer to extract fd, fv ... information=0D # Exception will be raised if syntax error found=0D @@ -1321,19 +1410,20 @@ class FdfParser: =0D except Warning as X:=0D self._UndoToken()=0D - #'\n\tGot Token: \"%s\" from File %s\n' % (self._Token, FileLi= neTuple[0]) + \=0D + # '\n\tGot Token: \"%s\" from File %s\n' % (self._Token, FileL= ineTuple[0]) + \=0D # At this point, the closest parent would be the included file= itself=0D Profile =3D GetParentAtLine(X.OriginalLineNumber)=0D if Profile is not None:=0D X.Message +=3D ' near line %d, column %d: %s' \=0D - % (X.LineNumber, 0, Profile.FileLinesList[X.LineNumber-1])= =0D + % (X.LineNumber, 0, Profile.FileLinesList[X.LineNumber= -1])=0D else:=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.Curr= entLineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D X.Message +=3D ' near line %d, column %d: %s' \=0D - % (FileLineTuple[1], self.CurrentOffsetWithinLine + 1, sel= f.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetWithi= nLine:].rstrip(TAB_LINE_BREAK).rstrip(T_CHAR_CR))=0D + % (FileLineTuple[1], self.CurrentOffsetWithinLine + 1,= self.Profile.FileLinesList[self.CurrentLineNumber - 1][self.CurrentOffsetW= ithinLine:].rstrip(TAB_LINE_BREAK).rstrip(T_CHAR_CR))=0D raise=0D =0D - ## SectionParser() method=0D + # SectionParser() method=0D #=0D # Parse the file section info=0D # Exception will be raised if syntax error found=0D @@ -1344,10 +1434,11 @@ class FdfParser: def SectionParser(self, section):=0D S =3D section.upper()=0D if not S.startswith("[DEFINES") and not S.startswith("[FD.") and n= ot S.startswith("[FV.") and not S.startswith("[CAPSULE.") \=0D - and not S.startswith("[RULE.") and not S.startswith("[OPTIONR= OM.") and not S.startswith('[FMPPAYLOAD.'):=0D - raise Warning("Unknown section or section appear sequence erro= r (The correct sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [Rul= e.], [OptionRom.], [FMPPAYLOAD.])", self.FileName, self.CurrentLineNumber)= =0D + and not S.startswith("[RULE.") and not S.startswith("[OPTI= ONROM.") and not S.startswith('[FMPPAYLOAD.'):=0D + raise Warning(=0D + "Unknown section or section appear sequence error (The cor= rect sequence should be [DEFINES], [FD.], [FV.], [Capsule.], [Rule.], [Opti= onRom.], [FMPPAYLOAD.])", self.FileName, self.CurrentLineNumber)=0D =0D - ## _GetDefines() method=0D + # _GetDefines() method=0D #=0D # Get Defines section contents and store its data into AllMacrosList= =0D #=0D @@ -1367,13 +1458,16 @@ class FdfParser: =0D self._UndoToken()=0D if not self._IsToken("[DEFINES", True):=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D - #print 'Parsing String: %s in File %s, At line: %d, Offset Wit= hin Line: %d' \=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D + # print 'Parsing String: %s in File %s, At line: %d, Offset Wi= thin Line: %d' \=0D # % (self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine:], FileLineTuple[0], FileLineTuple[1], se= lf.CurrentOffsetWithinLine)=0D - raise Warning.Expected("[DEFINES", self.FileName, self.Current= LineNumber)=0D + raise Warning.Expected(=0D + "[DEFINES", self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D while self._GetNextWord():=0D # handle the SET statement=0D @@ -1385,25 +1479,28 @@ class FdfParser: Macro =3D self._Token=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken() or self._Token.startswith(TAB_SECT= ION_START):=0D - raise Warning.Expected("MACRO value", self.FileName, self.= CurrentLineNumber)=0D + raise Warning.Expected(=0D + "MACRO value", self.FileName, self.CurrentLineNumber)= =0D Value =3D self._Token=0D =0D return False=0D =0D - ##_GetError() method=0D + # _GetError() method=0D def _GetError(self):=0D - #save the Current information=0D + # save the Current information=0D CurrentLine =3D self.CurrentLineNumber=0D CurrentOffset =3D self.CurrentOffsetWithinLine=0D while self._GetNextToken():=0D if self._Token =3D=3D TAB_ERROR:=0D - EdkLogger.error('FdfParser', ERROR_STATEMENT, self._Curren= tLine().replace(TAB_ERROR, '', 1), File=3Dself.FileName, Line=3Dself.Curren= tLineNumber)=0D + EdkLogger.error('FdfParser', ERROR_STATEMENT, self._Curren= tLine().replace(=0D + TAB_ERROR, '', 1), File=3Dself.FileName, Line=3Dself.C= urrentLineNumber)=0D self.CurrentLineNumber =3D CurrentLine=0D self.CurrentOffsetWithinLine =3D CurrentOffset=0D =0D - ## _GetFd() method=0D + # _GetFd() method=0D #=0D # Get FD section contents and store its data into FD dictionary of s= elf.Profile=0D #=0D @@ -1418,52 +1515,61 @@ class FdfParser: S =3D self._Token.upper()=0D if S.startswith(TAB_SECTION_START) and not S.startswith("[FD."):=0D if not S.startswith("[FV.") and not S.startswith('[FMPPAYLOAD.= ') and not S.startswith("[CAPSULE.") \=0D - and not S.startswith("[RULE.") and not S.startswith("[OPTI= ONROM."):=0D - raise Warning("Unknown section", self.FileName, self.Curre= ntLineNumber)=0D + and not S.startswith("[RULE.") and not S.startswith("[= OPTIONROM."):=0D + raise Warning("Unknown section", self.FileName,=0D + self.CurrentLineNumber)=0D self._UndoToken()=0D return False=0D =0D self._UndoToken()=0D if not self._IsToken("[FD.", True):=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D - #print 'Parsing String: %s in File %s, At line: %d, Offset Wit= hin Line: %d' \=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D + # print 'Parsing String: %s in File %s, At line: %d, Offset Wi= thin Line: %d' \=0D # % (self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine:], FileLineTuple[0], FileLineTuple[1], se= lf.CurrentOffsetWithinLine)=0D - raise Warning.Expected("[FD.]", self.FileName, self.CurrentLin= eNumber)=0D + raise Warning.Expected(=0D + "[FD.]", self.FileName, self.CurrentLineNumber)=0D =0D FdName =3D self._GetUiName()=0D if FdName =3D=3D "":=0D - if len (self.Profile.FdDict) =3D=3D 0:=0D + if len(self.Profile.FdDict) =3D=3D 0:=0D FdName =3D GenFdsGlobalVariable.PlatformName=0D if FdName =3D=3D "" and GlobalData.gActivePlatform:=0D FdName =3D GlobalData.gActivePlatform.PlatformName=0D self.Profile.FdNameNotSet =3D True=0D else:=0D - raise Warning.Expected("FdName in [FD.] section", self.Fil= eName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "FdName in [FD.] section", self.FileName, self.Current= LineNumber)=0D self.CurrentFdName =3D FdName.upper()=0D =0D if self.CurrentFdName in self.Profile.FdDict:=0D - raise Warning("Unexpected the same FD name", self.FileName, se= lf.CurrentLineNumber)=0D + raise Warning("Unexpected the same FD name",=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D FdObj =3D FD()=0D FdObj.FdUiName =3D self.CurrentFdName=0D self.Profile.FdDict[self.CurrentFdName] =3D FdObj=0D =0D - if len (self.Profile.FdDict) > 1 and self.Profile.FdNameNotSet:=0D - raise Warning.Expected("all FDs have their name", self.FileNam= e, self.CurrentLineNumber)=0D + if len(self.Profile.FdDict) > 1 and self.Profile.FdNameNotSet:=0D + raise Warning.Expected(=0D + "all FDs have their name", self.FileName, self.CurrentLine= Number)=0D =0D Status =3D self._GetCreateFile(FdObj)=0D if not Status:=0D - raise Warning("FD name error", self.FileName, self.CurrentLine= Number)=0D + raise Warning("FD name error", self.FileName,=0D + self.CurrentLineNumber)=0D =0D while self._GetTokenStatements(FdObj):=0D pass=0D for Attr in ("BaseAddress", "Size", "ErasePolarity"):=0D if getattr(FdObj, Attr) is None:=0D self._GetNextToken()=0D - raise Warning("Keyword %s missing" % Attr, self.FileName, = self.CurrentLineNumber)=0D + raise Warning("Keyword %s missing" %=0D + Attr, self.FileName, self.CurrentLineNumber)= =0D =0D if not FdObj.BlockSizeList:=0D FdObj.BlockSizeList.append((1, FdObj.Size, None))=0D @@ -1473,13 +1579,14 @@ class FdfParser: self._GetSetStatements(FdObj)=0D =0D if not self._GetRegionLayout(FdObj):=0D - raise Warning.Expected("region layout", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "region layout", self.FileName, self.CurrentLineNumber)=0D =0D while self._GetRegionLayout(FdObj):=0D pass=0D return True=0D =0D - ## _GetUiName() method=0D + # _GetUiName() method=0D #=0D # Return the UI name of a section=0D #=0D @@ -1493,7 +1600,7 @@ class FdfParser: =0D return Name=0D =0D - ## _GetCreateFile() method=0D + # _GetCreateFile() method=0D #=0D # Return the output file name of object=0D #=0D @@ -1504,20 +1611,23 @@ class FdfParser: def _GetCreateFile(self, Obj):=0D if self._IsKeyword("CREATE_FILE"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("file name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "file name", self.FileName, self.CurrentLineNumber)=0D =0D FileName =3D self._Token=0D Obj.CreateFileName =3D FileName=0D =0D return True=0D =0D - def SetPcdLocalation(self,pcdpair):=0D - self.Profile.PcdLocalDict[pcdpair] =3D (self.Profile.FileName,self= .CurrentLineNumber)=0D + def SetPcdLocalation(self, pcdpair):=0D + self.Profile.PcdLocalDict[pcdpair] =3D (=0D + self.Profile.FileName, self.CurrentLineNumber)=0D =0D - ## _GetTokenStatements() method=0D + # _GetTokenStatements() method=0D #=0D # Get token statements=0D #=0D @@ -1527,10 +1637,12 @@ class FdfParser: def _GetTokenStatements(self, Obj):=0D if self._IsKeyword("BaseAddress"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex base address", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex base address", self.FileName, self.CurrentLineNum= ber)=0D =0D Obj.BaseAddress =3D self._Token=0D =0D @@ -1539,16 +1651,19 @@ class FdfParser: Obj.BaseAddressPcd =3D pcdPair=0D self.Profile.PcdDict[pcdPair] =3D Obj.BaseAddress=0D self.SetPcdLocalation(pcdPair)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.Curr= entLineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[pcdPair] =3D FileLineTuple=0D return True=0D =0D if self._IsKeyword("Size"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex size", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "Hex size", self.FileName, self.CurrentLineNumber)=0D =0D Size =3D self._Token=0D if self._IsToken(TAB_VALUE_SPLIT):=0D @@ -1556,27 +1671,31 @@ class FdfParser: Obj.SizePcd =3D pcdPair=0D self.Profile.PcdDict[pcdPair] =3D Size=0D self.SetPcdLocalation(pcdPair)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.Curr= entLineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[pcdPair] =3D FileLineTuple=0D Obj.Size =3D int(Size, 0)=0D return True=0D =0D if self._IsKeyword("ErasePolarity"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("Erase Polarity", self.FileName, se= lf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Erase Polarity", self.FileName, self.CurrentLineNumbe= r)=0D =0D if not self._Token in {"1", "0"}:=0D - raise Warning.Expected("1 or 0 Erase Polarity", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "1 or 0 Erase Polarity", self.FileName, self.CurrentLi= neNumber)=0D =0D Obj.ErasePolarity =3D self._Token=0D return True=0D =0D return self._GetBlockStatements(Obj)=0D =0D - ## _GetAddressStatements() method=0D + # _GetAddressStatements() method=0D #=0D # Get address statements=0D #=0D @@ -1588,25 +1707,29 @@ class FdfParser: def _GetAddressStatements(self, Obj):=0D if self._IsKeyword("BsBaseAddress"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextDecimalNumber() and not self._GetNextHexNu= mber():=0D - raise Warning.Expected("address", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "address", self.FileName, self.CurrentLineNumber)=0D =0D BsAddress =3D int(self._Token, 0)=0D Obj.BsBaseAddress =3D BsAddress=0D =0D if self._IsKeyword("RtBaseAddress"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextDecimalNumber() and not self._GetNextHexNu= mber():=0D - raise Warning.Expected("address", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "address", self.FileName, self.CurrentLineNumber)=0D =0D RtAddress =3D int(self._Token, 0)=0D Obj.RtBaseAddress =3D RtAddress=0D =0D - ## _GetBlockStatements() method=0D + # _GetBlockStatements() method=0D #=0D # Get block statements=0D #=0D @@ -1620,10 +1743,11 @@ class FdfParser: =0D Item =3D Obj.BlockSizeList[-1]=0D if Item[0] is None or Item[1] is None:=0D - raise Warning.Expected("block statement", self.FileName, s= elf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "block statement", self.FileName, self.CurrentLineNumb= er)=0D return IsBlock=0D =0D - ## _GetBlockStatement() method=0D + # _GetBlockStatement() method=0D #=0D # Get block statement=0D #=0D @@ -1640,7 +1764,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextHexNumber() and not self._GetNextDecimalNumber= ():=0D - raise Warning.Expected("Hex or Integer block size", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex or Integer block size", self.FileName, self.CurrentLi= neNumber)=0D =0D BlockSize =3D self._Token=0D BlockSizePcd =3D None=0D @@ -1649,24 +1774,27 @@ class FdfParser: BlockSizePcd =3D PcdPair=0D self.Profile.PcdDict[PcdPair] =3D BlockSize=0D self.SetPcdLocalation(PcdPair)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[PcdPair] =3D FileLineTuple=0D BlockSize =3D int(BlockSize, 0)=0D =0D BlockNumber =3D None=0D if self._IsKeyword("NumBlocks"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextDecimalNumber() and not self._GetNextHexNu= mber():=0D - raise Warning.Expected("block numbers", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "block numbers", self.FileName, self.CurrentLineNumber= )=0D =0D BlockNumber =3D int(self._Token, 0)=0D =0D Obj.BlockSizeList.append((BlockSize, BlockNumber, BlockSizePcd))=0D return True=0D =0D - ## _GetDefineStatements() method=0D + # _GetDefineStatements() method=0D #=0D # Get define statements=0D #=0D @@ -1679,7 +1807,7 @@ class FdfParser: while self._GetDefineStatement(Obj):=0D pass=0D =0D - ## _GetDefineStatement() method=0D + # _GetDefineStatement() method=0D #=0D # Get define statement=0D #=0D @@ -1693,10 +1821,12 @@ class FdfParser: self._GetNextToken()=0D Macro =3D self._Token=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("value", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "value", self.FileName, self.CurrentLineNumber)=0D =0D Value =3D self._Token=0D Macro =3D '$(' + Macro + ')'=0D @@ -1705,7 +1835,7 @@ class FdfParser: =0D return False=0D =0D - ## _GetSetStatements() method=0D + # _GetSetStatements() method=0D #=0D # Get set statements=0D #=0D @@ -1718,7 +1848,7 @@ class FdfParser: while self._GetSetStatement(Obj):=0D pass=0D =0D - ## _GetSetStatement() method=0D + # _GetSetStatement() method=0D #=0D # Get set statement=0D #=0D @@ -1732,22 +1862,25 @@ class FdfParser: PcdPair =3D self._GetNextPcdSettings()=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D Value =3D self._GetExpression()=0D - Value =3D self._EvaluateConditional(Value, self.CurrentLineNum= ber, 'eval', True)=0D + Value =3D self._EvaluateConditional(=0D + Value, self.CurrentLineNumber, 'eval', True)=0D =0D if Obj:=0D Obj.SetVarDict[PcdPair] =3D Value=0D self.Profile.PcdDict[PcdPair] =3D Value=0D self.SetPcdLocalation(PcdPair)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[PcdPair] =3D FileLineTuple=0D return True=0D =0D return False=0D =0D - ## _CalcRegionExpr(self)=0D + # _CalcRegionExpr(self)=0D #=0D # Calculate expression for offset or size of a region=0D #=0D @@ -1778,7 +1911,7 @@ class FdfParser: self.SetFileBufferPos(StartPos)=0D return None=0D =0D - ## _GetRegionLayout() method=0D + # _GetRegionLayout() method=0D #=0D # Get region layout for FD=0D #=0D @@ -1797,11 +1930,13 @@ class FdfParser: theFd.RegionList.append(RegionObj)=0D =0D if not self._IsToken(TAB_VALUE_SPLIT):=0D - raise Warning.Expected("'|'", self.FileName, self.CurrentLineN= umber)=0D + raise Warning.Expected("'|'", self.FileName,=0D + self.CurrentLineNumber)=0D =0D Size =3D self._CalcRegionExpr()=0D if Size is None:=0D - raise Warning.Expected("Region Size", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "Region Size", self.FileName, self.CurrentLineNumber)=0D RegionObj.Size =3D Size=0D =0D if not self._GetNextWord():=0D @@ -1818,17 +1953,22 @@ class FdfParser: RegionOffsetPcdPattern.match(self._CurrentLine(= )[self.CurrentOffsetWithinLine:]))=0D if IsRegionPcd:=0D RegionObj.PcdOffset =3D self._GetNextPcdSettings()=0D - self.Profile.PcdDict[RegionObj.PcdOffset] =3D "0x%08X" % (= RegionObj.Offset + int(theFd.BaseAddress, 0))=0D + self.Profile.PcdDict[RegionObj.PcdOffset] =3D "0x%08X" % (= =0D + RegionObj.Offset + int(theFd.BaseAddress, 0))=0D self.SetPcdLocalation(RegionObj.PcdOffset)=0D - self._PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj= .PcdOffset[0])] =3D "0x%x" % RegionObj.Offset=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.Curr= entLineNumber)=0D + self._PcdDict['%s.%s' % (=0D + RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] =3D "= 0x%x" % RegionObj.Offset=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[RegionObj.PcdOffset] =3D File= LineTuple=0D if self._IsToken(TAB_VALUE_SPLIT):=0D RegionObj.PcdSize =3D self._GetNextPcdSettings()=0D self.Profile.PcdDict[RegionObj.PcdSize] =3D "0x%08X" %= RegionObj.Size=0D self.SetPcdLocalation(RegionObj.PcdSize)=0D - self._PcdDict['%s.%s' % (RegionObj.PcdSize[1], RegionO= bj.PcdSize[0])] =3D "0x%x" % RegionObj.Size=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.= CurrentLineNumber)=0D + self._PcdDict['%s.%s' % (=0D + RegionObj.PcdSize[1], RegionObj.PcdSize[0])] =3D "= 0x%x" % RegionObj.Size=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.PcdFileLineDict[RegionObj.PcdSize] =3D Fi= leLineTuple=0D =0D if not self._GetNextWord():=0D @@ -1875,7 +2015,7 @@ class FdfParser: =0D return True=0D =0D - ## _GetRegionFvType() method=0D + # _GetRegionFvType() method=0D #=0D # Get region fv data for region=0D #=0D @@ -1884,13 +2024,15 @@ class FdfParser: #=0D def _GetRegionFvType(self, RegionObj):=0D if not self._IsKeyword(BINARY_FILE_TYPE_FV):=0D - raise Warning.Expected("'FV'", self.FileName, self.CurrentLine= Number)=0D + raise Warning.Expected("'FV'", self.FileName,=0D + self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FV name", self.FileName, self.CurrentL= ineNumber)=0D + raise Warning.Expected(=0D + "FV name", self.FileName, self.CurrentLineNumber)=0D =0D RegionObj.RegionType =3D BINARY_FILE_TYPE_FV=0D RegionObj.RegionDataList.append((self._Token).upper())=0D @@ -1898,14 +2040,16 @@ class FdfParser: while self._IsKeyword(BINARY_FILE_TYPE_FV):=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FV name", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "FV name", self.FileName, self.CurrentLineNumber)=0D =0D RegionObj.RegionDataList.append((self._Token).upper())=0D =0D - ## _GetRegionCapType() method=0D + # _GetRegionCapType() method=0D #=0D # Get region capsule data for region=0D #=0D @@ -1914,13 +2058,15 @@ class FdfParser: #=0D def _GetRegionCapType(self, RegionObj):=0D if not self._IsKeyword("CAPSULE"):=0D - raise Warning.Expected("'CAPSULE'", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "'CAPSULE'", self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("CAPSULE name", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "CAPSULE name", self.FileName, self.CurrentLineNumber)=0D =0D RegionObj.RegionType =3D "CAPSULE"=0D RegionObj.RegionDataList.append(self._Token)=0D @@ -1928,14 +2074,16 @@ class FdfParser: while self._IsKeyword("CAPSULE"):=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("CAPSULE name", self.FileName, self= .CurrentLineNumber)=0D + raise Warning.Expected(=0D + "CAPSULE name", self.FileName, self.CurrentLineNumber)= =0D =0D RegionObj.RegionDataList.append(self._Token)=0D =0D - ## _GetRegionFileType() method=0D + # _GetRegionFileType() method=0D #=0D # Get region file data for region=0D #=0D @@ -1944,13 +2092,15 @@ class FdfParser: #=0D def _GetRegionFileType(self, RegionObj):=0D if not self._IsKeyword("FILE"):=0D - raise Warning.Expected("'FILE'", self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.Expected(=0D + "'FILE'", self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("File name", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "File name", self.FileName, self.CurrentLineNumber)=0D =0D RegionObj.RegionType =3D "FILE"=0D RegionObj.RegionDataList.append(self._Token)=0D @@ -1958,14 +2108,16 @@ class FdfParser: while self._IsKeyword("FILE"):=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FILE name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "FILE name", self.FileName, self.CurrentLineNumber)=0D =0D RegionObj.RegionDataList.append(self._Token)=0D =0D - ## _GetRegionDataType() method=0D + # _GetRegionDataType() method=0D #=0D # Get region array data for region=0D #=0D @@ -1974,41 +2126,49 @@ class FdfParser: #=0D def _GetRegionDataType(self, RegionObj):=0D if not self._IsKeyword("DATA"):=0D - raise Warning.Expected("Region Data type", self.FileName, self= .CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Region Data type", self.FileName, self.CurrentLineNumber)= =0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.CurrentLin= eNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex byte", self.FileName, self.Current= LineNumber)=0D + raise Warning.Expected(=0D + "Hex byte", self.FileName, self.CurrentLineNumber)=0D =0D if len(self._Token) > 18:=0D - raise Warning("Hex string can't be converted to a valid UINT64= value", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Hex string can't be converted to a valid UINT64= value",=0D + self.FileName, self.CurrentLineNumber)=0D =0D # convert hex string value to byte hex string array=0D AllString =3D self._Token=0D - AllStrLen =3D len (AllString)=0D + AllStrLen =3D len(AllString)=0D DataString =3D ""=0D while AllStrLen > 4:=0D - DataString =3D DataString + "0x" + AllString[AllStrLen - 2: Al= lStrLen] + TAB_COMMA_SPLIT=0D - AllStrLen =3D AllStrLen - 2=0D + DataString =3D DataString + "0x" + \=0D + AllString[AllStrLen - 2: AllStrLen] + TAB_COMMA_SPLIT=0D + AllStrLen =3D AllStrLen - 2=0D DataString =3D DataString + AllString[:AllStrLen] + TAB_COMMA_SPLI= T=0D =0D # byte value array=0D - if len (self._Token) <=3D 4:=0D + if len(self._Token) <=3D 4:=0D while self._IsToken(TAB_COMMA_SPLIT):=0D if not self._GetNextHexNumber():=0D - raise Warning("Invalid Hex number", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning("Invalid Hex number",=0D + self.FileName, self.CurrentLineNumber)=0D if len(self._Token) > 4:=0D - raise Warning("Hex byte(must be 2 digits) too long", s= elf.FileName, self.CurrentLineNumber)=0D + raise Warning("Hex byte(must be 2 digits) too long",=0D + self.FileName, self.CurrentLineNumber)=0D DataString +=3D self._Token=0D DataString +=3D TAB_COMMA_SPLIT=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D DataString =3D DataString.rstrip(TAB_COMMA_SPLIT)=0D RegionObj.RegionType =3D "DATA"=0D @@ -2017,43 +2177,51 @@ class FdfParser: while self._IsKeyword("DATA"):=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex byte", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "Hex byte", self.FileName, self.CurrentLineNumber)=0D =0D if len(self._Token) > 18:=0D - raise Warning("Hex string can't be converted to a valid UI= NT64 value", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Hex string can't be converted to a valid UI= NT64 value",=0D + self.FileName, self.CurrentLineNumber)=0D =0D # convert hex string value to byte hex string array=0D AllString =3D self._Token=0D - AllStrLen =3D len (AllString)=0D + AllStrLen =3D len(AllString)=0D DataString =3D ""=0D while AllStrLen > 4:=0D - DataString =3D DataString + "0x" + AllString[AllStrLen - 2= : AllStrLen] + TAB_COMMA_SPLIT=0D - AllStrLen =3D AllStrLen - 2=0D + DataString =3D DataString + "0x" + \=0D + AllString[AllStrLen - 2: AllStrLen] + TAB_COMMA_SPLIT= =0D + AllStrLen =3D AllStrLen - 2=0D DataString =3D DataString + AllString[:AllStrLen] + TAB_COMMA_= SPLIT=0D =0D # byte value array=0D - if len (self._Token) <=3D 4:=0D + if len(self._Token) <=3D 4:=0D while self._IsToken(TAB_COMMA_SPLIT):=0D if not self._GetNextHexNumber():=0D - raise Warning("Invalid Hex number", self.FileName,= self.CurrentLineNumber)=0D + raise Warning("Invalid Hex number",=0D + self.FileName, self.CurrentLineNumbe= r)=0D if len(self._Token) > 4:=0D - raise Warning("Hex byte(must be 2 digits) too long= ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Hex byte(must be 2 digits) too long= ",=0D + self.FileName, self.CurrentLineNumbe= r)=0D DataString +=3D self._Token=0D DataString +=3D TAB_COMMA_SPLIT=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D DataString =3D DataString.rstrip(TAB_COMMA_SPLIT)=0D RegionObj.RegionDataList.append(DataString)=0D =0D - ## _GetFv() method=0D + # _GetFv() method=0D #=0D # Get FV section contents and store its data into FV dictionary of s= elf.Profile=0D #=0D @@ -2073,23 +2241,27 @@ class FdfParser: =0D self._UndoToken()=0D if not self._IsToken("[FV.", True):=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D - #print 'Parsing String: %s in File %s, At line: %d, Offset Wit= hin Line: %d' \=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D + # print 'Parsing String: %s in File %s, At line: %d, Offset Wi= thin Line: %d' \=0D # % (self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine:], FileLineTuple[0], FileLineTuple[1], se= lf.CurrentOffsetWithinLine)=0D - raise Warning("Unknown Keyword '%s'" % self._Token, self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning("Unknown Keyword '%s'" % self._Token,=0D + self.FileName, self.CurrentLineNumber)=0D =0D FvName =3D self._GetUiName()=0D self.CurrentFvName =3D FvName.upper()=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D FvObj =3D FV(Name=3Dself.CurrentFvName)=0D self.Profile.FvDict[self.CurrentFvName] =3D FvObj=0D =0D Status =3D self._GetCreateFile(FvObj)=0D if not Status:=0D - raise Warning("FV name error", self.FileName, self.CurrentLine= Number)=0D + raise Warning("FV name error", self.FileName,=0D + self.CurrentLineNumber)=0D =0D self._GetDefineStatements(FvObj)=0D =0D @@ -2099,13 +2271,14 @@ class FdfParser: self._GetSetStatements(FvObj)=0D =0D if not (self._GetBlockStatement(FvObj) or self._GetFvBaseAddre= ss(FvObj) or=0D - self._GetFvForceRebase(FvObj) or self._GetFvAlignment(FvOb= j) or=0D - self._GetFvAttributes(FvObj) or self._GetFvNameGuid(FvObj)= or=0D - self._GetFvExtEntryStatement(FvObj) or self._GetFvNameStri= ng(FvObj)):=0D + self._GetFvForceRebase(FvObj) or self._GetFvAlignment(= FvObj) or=0D + self._GetFvAttributes(FvObj) or self._GetFvNameGuid(Fv= Obj) or=0D + self._GetFvExtEntryStatement(FvObj) or self._GetFvName= String(FvObj)):=0D break=0D =0D if FvObj.FvNameString =3D=3D 'TRUE' and not FvObj.FvNameGuid:=0D - raise Warning("FvNameString found but FvNameGuid was not found= ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("FvNameString found but FvNameGuid was not found= ",=0D + self.FileName, self.CurrentLineNumber)=0D =0D self._GetAprioriSection(FvObj)=0D self._GetAprioriSection(FvObj)=0D @@ -2118,7 +2291,7 @@ class FdfParser: =0D return True=0D =0D - ## _GetFvAlignment() method=0D + # _GetFvAlignment() method=0D #=0D # Get alignment for FV=0D #=0D @@ -2135,17 +2308,19 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("alignment value", self.FileName, self.= CurrentLineNumber)=0D + raise Warning.Expected(=0D + "alignment value", self.FileName, self.CurrentLineNumber)= =0D =0D - if self._Token.upper() not in {"1", "2", "4", "8", "16", "32", "64= ", "128", "256", "512", \=0D - "1K", "2K", "4K", "8K", "16K", "32= K", "64K", "128K", "256K", "512K", \=0D - "1M", "2M", "4M", "8M", "16M", "32= M", "64M", "128M", "256M", "512M", \=0D - "1G", "2G"}:=0D - raise Warning("Unknown alignment value '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D + if self._Token.upper() not in {"1", "2", "4", "8", "16", "32", "64= ", "128", "256", "512",=0D + "1K", "2K", "4K", "8K", "16K", "32K= ", "64K", "128K", "256K", "512K",=0D + "1M", "2M", "4M", "8M", "16M", "32M= ", "64M", "128M", "256M", "512M",=0D + "1G", "2G"}:=0D + raise Warning("Unknown alignment value '%s'" %=0D + self._Token, self.FileName, self.CurrentLineNumb= er)=0D Obj.FvAlignment =3D self._Token=0D return True=0D =0D - ## _GetFvBaseAddress() method=0D + # _GetFvBaseAddress() method=0D #=0D # Get BaseAddress for FV=0D #=0D @@ -2162,14 +2337,16 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FV base address value", self.FileName,= self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "FV base address value", self.FileName, self.CurrentLineNu= mber)=0D =0D if not BaseAddrValuePattern.match(self._Token.upper()):=0D - raise Warning("Unknown FV base address value '%s'" % self._Tok= en, self.FileName, self.CurrentLineNumber)=0D + raise Warning("Unknown FV base address value '%s'" %=0D + self._Token, self.FileName, self.CurrentLineNumb= er)=0D Obj.FvBaseAddress =3D self._Token=0D return True=0D =0D - ## _GetFvForceRebase() method=0D + # _GetFvForceRebase() method=0D #=0D # Get FvForceRebase for FV=0D #=0D @@ -2186,10 +2363,12 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FvForceRebase value", self.FileName, s= elf.CurrentLineNumber)=0D + raise Warning.Expected("FvForceRebase value",=0D + self.FileName, self.CurrentLineNumber)= =0D =0D if self._Token.upper() not in {"TRUE", "FALSE", "0", "0X0", "0X00"= , "1", "0X1", "0X01"}:=0D - raise Warning("Unknown FvForceRebase value '%s'" % self._Token= , self.FileName, self.CurrentLineNumber)=0D + raise Warning("Unknown FvForceRebase value '%s'" %=0D + self._Token, self.FileName, self.CurrentLineNumb= er)=0D =0D if self._Token.upper() in {"TRUE", "1", "0X1", "0X01"}:=0D Obj.FvForceRebase =3D True=0D @@ -2200,8 +2379,7 @@ class FdfParser: =0D return True=0D =0D -=0D - ## _GetFvAttributes() method=0D + # _GetFvAttributes() method=0D #=0D # Get attributes for FV=0D #=0D @@ -2209,31 +2387,34 @@ class FdfParser: # @param Obj for whom attribute is got=0D # @retval None=0D #=0D +=0D def _GetFvAttributes(self, FvObj):=0D IsWordToken =3D False=0D while self._GetNextWord():=0D IsWordToken =3D True=0D name =3D self._Token=0D - if name not in {"ERASE_POLARITY", "MEMORY_MAPPED", \=0D - "STICKY_WRITE", "LOCK_CAP", "LOCK_STATUS", "WRI= TE_ENABLED_CAP", \=0D - "WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_ENA= BLED_CAP", \=0D - "READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK_= CAP", \=0D - "READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_LO= CK_STATUS", \=0D - "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT", "FvU= sedSizeEnable"}:=0D + if name not in {"ERASE_POLARITY", "MEMORY_MAPPED",=0D + "STICKY_WRITE", "LOCK_CAP", "LOCK_STATUS", "WR= ITE_ENABLED_CAP",=0D + "WRITE_DISABLED_CAP", "WRITE_STATUS", "READ_EN= ABLED_CAP",=0D + "READ_DISABLED_CAP", "READ_STATUS", "READ_LOCK= _CAP",=0D + "READ_LOCK_STATUS", "WRITE_LOCK_CAP", "WRITE_L= OCK_STATUS",=0D + "WRITE_POLICY_RELIABLE", "WEAK_ALIGNMENT", "Fv= UsedSizeEnable"}:=0D self._UndoToken()=0D return False=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken() or self._Token.upper() not in {"TR= UE", "FALSE", "1", "0"}:=0D - raise Warning.Expected("TRUE/FALSE (1/0)", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNum= ber)=0D =0D FvObj.FvAttributeDict[name] =3D self._Token=0D =0D return IsWordToken=0D =0D - ## _GetFvNameGuid() method=0D + # _GetFvNameGuid() method=0D #=0D # Get FV GUID for FV=0D #=0D @@ -2249,9 +2430,11 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextGuid():=0D - raise Warning.Expected("GUID value", self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.Expected(=0D + "GUID value", self.FileName, self.CurrentLineNumber)=0D if self._Token in GlobalData.gGuidDict:=0D - self._Token =3D GuidStructureStringToGuidString(GlobalData.gGu= idDict[self._Token]).upper()=0D + self._Token =3D GuidStructureStringToGuidString(=0D + GlobalData.gGuidDict[self._Token]).upper()=0D =0D FvObj.FvNameGuid =3D self._Token=0D =0D @@ -2265,7 +2448,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken() or self._Token.upper() not in {'TRUE',= 'FALSE'}:=0D - raise Warning.Expected("TRUE or FALSE for FvNameString", self.= FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "TRUE or FALSE for FvNameString", self.FileName, self.Curr= entLineNumber)=0D =0D FvObj.FvNameString =3D self._Token=0D =0D @@ -2275,73 +2459,88 @@ class FdfParser: if not (self._IsKeyword("FV_EXT_ENTRY") or self._IsKeyword("FV_EXT= _ENTRY_TYPE")):=0D return False=0D =0D - if not self._IsKeyword ("TYPE"):=0D - raise Warning.Expected("'TYPE'", self.FileName, self.CurrentLi= neNumber)=0D + if not self._IsKeyword("TYPE"):=0D + raise Warning.Expected(=0D + "'TYPE'", self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextHexNumber() and not self._GetNextDecimalNumber= ():=0D - raise Warning.Expected("Hex FV extension entry type value At L= ine ", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex FV extension entry type value At Line ", self.FileNam= e, self.CurrentLineNumber)=0D =0D FvObj.FvExtEntryTypeValue.append(self._Token)=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.CurrentLin= eNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsKeyword("FILE") and not self._IsKeyword("DATA"):=0D - raise Warning.Expected("'FILE' or 'DATA'", self.FileName, self= .CurrentLineNumber)=0D + raise Warning.Expected(=0D + "'FILE' or 'DATA'", self.FileName, self.CurrentLineNumber)= =0D =0D FvObj.FvExtEntryType.append(self._Token)=0D =0D if self._Token =3D=3D 'DATA':=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex byte", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "Hex byte", self.FileName, self.CurrentLineNumber)=0D =0D if len(self._Token) > 4:=0D - raise Warning("Hex byte(must be 2 digits) too long", self.= FileName, self.CurrentLineNumber)=0D + raise Warning("Hex byte(must be 2 digits) too long",=0D + self.FileName, self.CurrentLineNumber)=0D =0D DataString =3D self._Token=0D DataString +=3D TAB_COMMA_SPLIT=0D =0D while self._IsToken(TAB_COMMA_SPLIT):=0D if not self._GetNextHexNumber():=0D - raise Warning("Invalid Hex number", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning("Invalid Hex number",=0D + self.FileName, self.CurrentLineNumber)=0D if len(self._Token) > 4:=0D - raise Warning("Hex byte(must be 2 digits) too long", s= elf.FileName, self.CurrentLineNumber)=0D + raise Warning("Hex byte(must be 2 digits) too long",=0D + self.FileName, self.CurrentLineNumber)=0D DataString +=3D self._Token=0D DataString +=3D TAB_COMMA_SPLIT=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D DataString =3D DataString.rstrip(TAB_COMMA_SPLIT)=0D FvObj.FvExtEntryData.append(DataString)=0D =0D if self._Token =3D=3D 'FILE':=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FV Extension Entry file path At Li= ne ", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "FV Extension Entry file path At Line ", self.FileName= , self.CurrentLineNumber)=0D =0D FvObj.FvExtEntryData.append(self._Token)=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D return True=0D =0D - ## _GetAprioriSection() method=0D + # _GetAprioriSection() method=0D #=0D # Get token statements=0D #=0D @@ -2355,11 +2554,13 @@ class FdfParser: return False=0D =0D if not self._IsKeyword("PEI") and not self._IsKeyword("DXE"):=0D - raise Warning.Expected("Apriori file type", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected("Apriori file type",=0D + self.FileName, self.CurrentLineNumber)= =0D AprType =3D self._Token=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.CurrentLin= eNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D AprSectionObj =3D AprioriSection()=0D AprSectionObj.AprioriType =3D AprType=0D @@ -2373,7 +2574,8 @@ class FdfParser: break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D FvObj.AprioriSectionList.append(AprSectionObj)=0D return True=0D @@ -2386,36 +2588,42 @@ class FdfParser: self._GetInfOptions(ffsInf)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("INF file path", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "INF file path", self.FileName, self.CurrentLineNumber)=0D ffsInf.InfFileName =3D self._Token=0D if not ffsInf.InfFileName.endswith('.inf'):=0D - raise Warning.Expected(".inf file path", self.FileName, self.C= urrentLineNumber)=0D + raise Warning.Expected(=0D + ".inf file path", self.FileName, self.CurrentLineNumber)=0D =0D ffsInf.CurrentLineNum =3D self.CurrentLineNumber=0D ffsInf.CurrentLineContent =3D self._CurrentLine()=0D =0D - #Replace $(SAPCE) with real space=0D + # Replace $(SAPCE) with real space=0D ffsInf.InfFileName =3D ffsInf.InfFileName.replace('$(SPACE)', ' ')= =0D =0D if ffsInf.InfFileName.replace(TAB_WORKSPACE, '').find('$') =3D=3D = -1:=0D - #do case sensitive check for file path=0D - ErrorCode, ErrorInfo =3D PathClass(NormPath(ffsInf.InfFileName= ), GenFdsGlobalVariable.WorkSpaceDir).Validate()=0D + # do case sensitive check for file path=0D + ErrorCode, ErrorInfo =3D PathClass(=0D + NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpa= ceDir).Validate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo= )=0D =0D NewFileName =3D ffsInf.InfFileName=0D if ffsInf.OverrideGuid:=0D - NewFileName =3D ProcessDuplicatedInf(PathClass(ffsInf.InfFileN= ame,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVa= riable.WorkSpaceDir).Path=0D + NewFileName =3D ProcessDuplicatedInf(PathClass(=0D + ffsInf.InfFileName, GenFdsGlobalVariable.WorkSpaceDir), ff= sInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path=0D =0D if not NewFileName in self.Profile.InfList:=0D self.Profile.InfList.append(NewFileName)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.InfFileLineList.append(FileLineTuple)=0D if ffsInf.UseArch:=0D if ffsInf.UseArch not in self.Profile.InfDict:=0D self.Profile.InfDict[ffsInf.UseArch] =3D [ffsInf.InfFi= leName]=0D else:=0D - self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.Inf= FileName)=0D + self.Profile.InfDict[ffsInf.UseArch].append(=0D + ffsInf.InfFileName)=0D else:=0D self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)= =0D =0D @@ -2425,10 +2633,11 @@ class FdfParser: elif self._IsKeyword('RELOCS_RETAINED'):=0D ffsInf.KeepReloc =3D True=0D else:=0D - raise Warning("Unknown reloc strip flag '%s'" % self._Toke= n, self.FileName, self.CurrentLineNumber)=0D + raise Warning("Unknown reloc strip flag '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D return ffsInf=0D =0D - ## _GetInfStatement() method=0D + # _GetInfStatement() method=0D #=0D # Get INF statements=0D #=0D @@ -2450,7 +2659,7 @@ class FdfParser: Obj.FfsList.append(ffsInf)=0D return True=0D =0D - ## _GetInfOptions() method=0D + # _GetInfOptions() method=0D #=0D # Get options for INF=0D #=0D @@ -2460,48 +2669,59 @@ class FdfParser: def _GetInfOptions(self, FfsInfObj):=0D if self._IsKeyword("FILE_GUID"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextGuid():=0D - raise Warning.Expected("GUID value", self.FileName, self.C= urrentLineNumber)=0D + raise Warning.Expected(=0D + "GUID value", self.FileName, self.CurrentLineNumber)=0D if self._Token in GlobalData.gGuidDict:=0D - self._Token =3D GuidStructureStringToGuidString(GlobalData= .gGuidDict[self._Token]).upper()=0D + self._Token =3D GuidStructureStringToGuidString(=0D + GlobalData.gGuidDict[self._Token]).upper()=0D FfsInfObj.OverrideGuid =3D self._Token=0D =0D if self._IsKeyword("RuleOverride"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("Rule name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "Rule name", self.FileName, self.CurrentLineNumber)=0D FfsInfObj.Rule =3D self._Token=0D =0D if self._IsKeyword("VERSION"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("Version", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "Version", self.FileName, self.CurrentLineNumber)=0D =0D if self._GetStringData():=0D FfsInfObj.Version =3D self._Token=0D =0D if self._IsKeyword(BINARY_FILE_TYPE_UI):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("UI name", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "UI name", self.FileName, self.CurrentLineNumber)=0D =0D if self._GetStringData():=0D FfsInfObj.Ui =3D self._Token=0D =0D if self._IsKeyword("USE"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("ARCH name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "ARCH name", self.FileName, self.CurrentLineNumber)=0D FfsInfObj.UseArch =3D self._Token=0D =0D -=0D if self._GetNextToken():=0D - p =3D compile(r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-= ]+|\$\(TOOL_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\))')=0D + p =3D compile(=0D + r'([a-zA-Z0-9\-]+|\$\(TARGET\)|\*)_([a-zA-Z0-9\-]+|\$\(TOO= L_CHAIN_TAG\)|\*)_([a-zA-Z0-9\-]+|\$\(ARCH\))')=0D if p.match(self._Token) and p.match(self._Token).span()[1] =3D= =3D len(self._Token):=0D FfsInfObj.KeyStringList.append(self._Token)=0D if not self._IsToken(TAB_COMMA_SPLIT):=0D @@ -2512,13 +2732,14 @@ class FdfParser: =0D while self._GetNextToken():=0D if not p.match(self._Token):=0D - raise Warning.Expected("KeyString \"Target_Tag_Arch\""= , self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "KeyString \"Target_Tag_Arch\"", self.FileName, se= lf.CurrentLineNumber)=0D FfsInfObj.KeyStringList.append(self._Token)=0D =0D if not self._IsToken(TAB_COMMA_SPLIT):=0D break=0D =0D - ## _GetFileStatement() method=0D + # _GetFileStatement() method=0D #=0D # Get FILE statements=0D #=0D @@ -2527,12 +2748,13 @@ class FdfParser: # @retval True Successfully find FILE statement=0D # @retval False Not able to find FILE statement=0D #=0D - def _GetFileStatement(self, Obj, ForCapsule =3D False):=0D + def _GetFileStatement(self, Obj, ForCapsule=3DFalse):=0D if not self._IsKeyword("FILE"):=0D return False=0D =0D if not self._GetNextWord():=0D - raise Warning.Expected("FFS type", self.FileName, self.Current= LineNumber)=0D + raise Warning.Expected(=0D + "FFS type", self.FileName, self.CurrentLineNumber)=0D =0D if ForCapsule and self._Token =3D=3D 'DATA':=0D self._UndoToken()=0D @@ -2547,17 +2769,21 @@ class FdfParser: =0D if not self._GetNextGuid():=0D if not self._GetNextWord():=0D - raise Warning.Expected("File GUID", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "File GUID", self.FileName, self.CurrentLineNumber)=0D if self._Token =3D=3D 'PCD':=0D if not self._IsToken("("):=0D - raise Warning.Expected("'('", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "'('", self.FileName, self.CurrentLineNumber)=0D PcdPair =3D self._GetNextPcdSettings()=0D if not self._IsToken(")"):=0D - raise Warning.Expected("')'", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "')'", self.FileName, self.CurrentLineNumber)=0D self._Token =3D 'PCD('+PcdPair[1]+TAB_SPLIT+PcdPair[0]+')'= =0D =0D if self._Token in GlobalData.gGuidDict:=0D - self._Token =3D GuidStructureStringToGuidString(GlobalData.gGu= idDict[self._Token]).upper()=0D + self._Token =3D GuidStructureStringToGuidString(=0D + GlobalData.gGuidDict[self._Token]).upper()=0D FfsFileObj.NameGuid =3D self._Token=0D =0D self._GetFilePart(FfsFileObj)=0D @@ -2571,7 +2797,7 @@ class FdfParser: =0D return True=0D =0D - ## _FileCouldHaveRelocFlag() method=0D + # _FileCouldHaveRelocFlag() method=0D #=0D # Check whether reloc strip flag can be set for a file type.=0D #=0D @@ -2580,13 +2806,13 @@ class FdfParser: # @retval False No way to have it=0D #=0D @staticmethod=0D - def _FileCouldHaveRelocFlag (FileType):=0D + def _FileCouldHaveRelocFlag(FileType):=0D if FileType in {SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PE= IM, SUP_MODULE_MM_CORE_STANDALONE, 'PEI_DXE_COMBO'}:=0D return True=0D else:=0D return False=0D =0D - ## _SectionCouldHaveRelocFlag() method=0D + # _SectionCouldHaveRelocFlag() method=0D #=0D # Check whether reloc strip flag can be set for a section type.=0D #=0D @@ -2595,13 +2821,13 @@ class FdfParser: # @retval False No way to have it=0D #=0D @staticmethod=0D - def _SectionCouldHaveRelocFlag (SectionType):=0D + def _SectionCouldHaveRelocFlag(SectionType):=0D if SectionType in {BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32}:=0D return True=0D else:=0D return False=0D =0D - ## _GetFilePart() method=0D + # _GetFilePart() method=0D #=0D # Get components for FILE statement=0D #=0D @@ -2619,26 +2845,33 @@ class FdfParser: else:=0D FfsFileObj.KeepReloc =3D True=0D else:=0D - raise Warning("File type %s could not have reloc strip= flag%d" % (FfsFileObj.FvFileType, self.CurrentLineNumber), self.FileName, = self.CurrentLineNumber)=0D + raise Warning("File type %s could not have reloc strip= flag%d" % (=0D + FfsFileObj.FvFileType, self.CurrentLineNumber), se= lf.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("File name or section data", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "File name or section data", self.FileName, self.CurrentLi= neNumber)=0D =0D if self._Token =3D=3D BINARY_FILE_TYPE_FV:=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("FV name", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "FV name", self.FileName, self.CurrentLineNumber)=0D FfsFileObj.FvName =3D self._Token=0D =0D elif self._Token =3D=3D "FD":=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("FD name", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "FD name", self.FileName, self.CurrentLineNumber)=0D FfsFileObj.FdName =3D self._Token=0D =0D elif self._Token in {TAB_DEFINE, "APRIORI", "SECTION"}:=0D @@ -2656,9 +2889,10 @@ class FdfParser: self._VerifyFile(FfsFileObj.FileName)=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D - ## _GetRAWData() method=0D + # _GetRAWData() method=0D #=0D # Get RAW data for FILE statement=0D #=0D @@ -2672,20 +2906,24 @@ class FdfParser: AlignValue =3D None=0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token= , self.FileName, self.CurrentLineNumber)=0D - #For FFS, Auto is default option same to ""=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.Current= LineNumber)=0D + # For FFS, Auto is default option same to ""=0D if not self._Token =3D=3D "Auto":=0D AlignValue =3D self._Token=0D if not self._GetNextToken():=0D - raise Warning.Expected("Filename value", self.FileName, se= lf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Filename value", self.FileName, self.CurrentLineNumbe= r)=0D =0D FileName =3D self._Token.replace('$(SPACE)', ' ')=0D if FileName =3D=3D T_CHAR_BRACE_R:=0D self._UndoToken()=0D - raise Warning.Expected("Filename value", self.FileName, se= lf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Filename value", self.FileName, self.CurrentLineNumbe= r)=0D =0D self._VerifyFile(FileName)=0D - File =3D PathClass(NormPath(FileName), GenFdsGlobalVariable.Wo= rkSpaceDir)=0D + File =3D PathClass(NormPath(FileName),=0D + GenFdsGlobalVariable.WorkSpaceDir)=0D FfsFileObj.FileName.append(File.Path)=0D FfsFileObj.SubAlignment.append(AlignValue)=0D =0D @@ -2698,7 +2936,7 @@ class FdfParser: if len(FfsFileObj.FileName) =3D=3D 1:=0D FfsFileObj.FileName =3D FfsFileObj.FileName[0]=0D =0D - ## _GetFileOpts() method=0D + # _GetFileOpts() method=0D #=0D # Get options for FILE statement=0D #=0D @@ -2712,7 +2950,8 @@ class FdfParser: if self._IsToken(TAB_COMMA_SPLIT):=0D while self._GetNextToken():=0D if not TokenFindPattern.match(self._Token):=0D - raise Warning.Expected("KeyString \"Target_Tag= _Arch\"", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "KeyString \"Target_Tag_Arch\"", self.File= Name, self.CurrentLineNumber)=0D FfsFileObj.KeyStringList.append(self._Token)=0D =0D if not self._IsToken(TAB_COMMA_SPLIT):=0D @@ -2729,12 +2968,13 @@ class FdfParser: =0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D - #For FFS, Auto is default option same to ""=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D + # For FFS, Auto is default option same to ""=0D if not self._Token =3D=3D "Auto":=0D FfsFileObj.Alignment =3D self._Token=0D =0D - ## _GetAlignment() method=0D + # _GetAlignment() method=0D #=0D # Return the alignment value=0D #=0D @@ -2745,15 +2985,17 @@ class FdfParser: def _GetAlignment(self):=0D if self._IsKeyword("Align", True):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("alignment value", self.FileName, s= elf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "alignment value", self.FileName, self.CurrentLineNumb= er)=0D return True=0D =0D return False=0D =0D - ## _GetSectionData() method=0D + # _GetSectionData() method=0D #=0D # Get section data for FILE statement=0D #=0D @@ -2769,7 +3011,7 @@ class FdfParser: if not IsLeafSection and not IsEncapSection:=0D break=0D =0D - ## _GetLeafSection() method=0D + # _GetLeafSection() method=0D #=0D # Get leaf section for Obj=0D #=0D @@ -2783,33 +3025,40 @@ class FdfParser: =0D if not self._IsKeyword("SECTION"):=0D if len(Obj.SectionList) =3D=3D 0:=0D - raise Warning.Expected("SECTION", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "SECTION", self.FileName, self.CurrentLineNumber)=0D else:=0D return False=0D =0D AlignValue =3D None=0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D AlignValue =3D self._Token=0D =0D BuildNum =3D None=0D if self._IsKeyword("BUILD_NUM"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("Build number value", self.FileName= , self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Build number value", self.FileName, self.CurrentLineN= umber)=0D =0D BuildNum =3D self._Token=0D =0D if self._IsKeyword("VERSION"):=0D if AlignValue =3D=3D 'Auto':=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("version", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "version", self.FileName, self.CurrentLineNumber)=0D VerSectionObj =3D VerSection()=0D VerSectionObj.Alignment =3D AlignValue=0D VerSectionObj.BuildNum =3D BuildNum=0D @@ -2821,11 +3070,14 @@ class FdfParser: =0D elif self._IsKeyword(BINARY_FILE_TYPE_UI):=0D if AlignValue =3D=3D 'Auto':=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("UI", self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.Expected(=0D + "UI", self.FileName, self.CurrentLineNumber)=0D UiSectionObj =3D UiSection()=0D UiSectionObj.Alignment =3D AlignValue=0D if self._GetStringData():=0D @@ -2836,11 +3088,14 @@ class FdfParser: =0D elif self._IsKeyword("FV_IMAGE"):=0D if AlignValue =3D=3D 'Auto':=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("FV name or FV file path", self.Fil= eName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "FV name or FV file path", self.FileName, self.Current= LineNumber)=0D =0D FvName =3D self._Token=0D FvObj =3D None=0D @@ -2862,7 +3117,8 @@ class FdfParser: break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D FvImageSectionObj =3D FvImageSection()=0D FvImageSectionObj.Alignment =3D AlignValue=0D @@ -2877,35 +3133,43 @@ class FdfParser: =0D elif self._IsKeyword("PEI_DEPEX_EXP") or self._IsKeyword("DXE_DEPE= X_EXP") or self._IsKeyword("SMM_DEPEX_EXP"):=0D if AlignValue =3D=3D 'Auto':=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D DepexSectionObj =3D DepexSection()=0D DepexSectionObj.Alignment =3D AlignValue=0D DepexSectionObj.DepexType =3D self._Token=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._SkipToToken(T_CHAR_BRACE_R):=0D - raise Warning.Expected("Depex expression ending '}'", self= .FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Depex expression ending '}'", self.FileName, self.Cur= rentLineNumber)=0D =0D - DepexSectionObj.Expression =3D self._SkippedChars.rstrip(T_CHA= R_BRACE_R)=0D + DepexSectionObj.Expression =3D self._SkippedChars.rstrip(=0D + T_CHAR_BRACE_R)=0D Obj.SectionList.append(DepexSectionObj)=0D =0D else:=0D if not self._GetNextWord():=0D - raise Warning.Expected("section type", self.FileName, self= .CurrentLineNumber)=0D + raise Warning.Expected(=0D + "section type", self.FileName, self.CurrentLineNumber)= =0D =0D # Encapsulation section appear, UndoToken and return=0D if self._Token =3D=3D "COMPRESS" or self._Token =3D=3D "GUIDED= ":=0D self.SetFileBufferPos(OldPos)=0D return False=0D =0D - if self._Token not in {"COMPAT16", BINARY_FILE_TYPE_PE32, BINA= RY_FILE_TYPE_PIC, BINARY_FILE_TYPE_TE, "FV_IMAGE", "RAW", BINARY_FILE_TYPE_= DXE_DEPEX,\=0D - BINARY_FILE_TYPE_UI, "VERSION", BINARY_FILE= _TYPE_PEI_DEPEX, "SUBTYPE_GUID", BINARY_FILE_TYPE_SMM_DEPEX}:=0D - raise Warning("Unknown section type '%s'" % self._Token, s= elf.FileName, self.CurrentLineNumber)=0D - if AlignValue =3D=3D 'Auto'and (not self._Token =3D=3D BINARY_= FILE_TYPE_PE32) and (not self._Token =3D=3D BINARY_FILE_TYPE_TE):=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + if self._Token not in {"COMPAT16", BINARY_FILE_TYPE_PE32, BINA= RY_FILE_TYPE_PIC, BINARY_FILE_TYPE_TE, "FV_IMAGE", "RAW", BINARY_FILE_TYPE_= DXE_DEPEX,=0D + BINARY_FILE_TYPE_UI, "VERSION", BINARY_= FILE_TYPE_PEI_DEPEX, "SUBTYPE_GUID", BINARY_FILE_TYPE_SMM_DEPEX}:=0D + raise Warning("Unknown section type '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D + if AlignValue =3D=3D 'Auto' and (not self._Token =3D=3D BINARY= _FILE_TYPE_PE32) and (not self._Token =3D=3D BINARY_FILE_TYPE_TE):=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D =0D # DataSection=0D DataSectionObj =3D DataSection()=0D @@ -2919,11 +3183,13 @@ class FdfParser: else:=0D DataSectionObj.KeepReloc =3D True=0D else:=0D - raise Warning("File type %s, section type %s, could no= t have reloc strip flag%d" % (Obj.FvFileType, DataSectionObj.SecType, self.= CurrentLineNumber), self.FileName, self.CurrentLineNumber)=0D + raise Warning("File type %s, section type %s, could no= t have reloc strip flag%d" % (=0D + Obj.FvFileType, DataSectionObj.SecType, self.Curre= ntLineNumber), self.FileName, self.CurrentLineNumber)=0D =0D if self._IsToken(TAB_EQUAL_SPLIT):=0D if not self._GetNextToken():=0D - raise Warning.Expected("section file path", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "section file path", self.FileName, self.CurrentLi= neNumber)=0D DataSectionObj.SectFileName =3D self._Token=0D self._VerifyFile(DataSectionObj.SectFileName)=0D else:=0D @@ -2934,7 +3200,7 @@ class FdfParser: =0D return True=0D =0D - ## _VerifyFile=0D + # _VerifyFile=0D #=0D # Check if file exists or not:=0D # If current phase if GenFds, the file must exist;=0D @@ -2945,11 +3211,12 @@ class FdfParser: if FileName.replace(TAB_WORKSPACE, '').find('$') !=3D -1:=0D return=0D if not GlobalData.gAutoGenPhase or not self._GetMacroValue(TAB_DSC= _DEFINES_OUTPUT_DIRECTORY) in FileName:=0D - ErrorCode, ErrorInfo =3D PathClass(NormPath(FileName), GenFdsG= lobalVariable.WorkSpaceDir).Validate()=0D + ErrorCode, ErrorInfo =3D PathClass(=0D + NormPath(FileName), GenFdsGlobalVariable.WorkSpaceDir).Val= idate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo= )=0D =0D - ## _GetCglSection() method=0D + # _GetCglSection() method=0D #=0D # Get compressed or GUIDed section for Obj=0D #=0D @@ -2959,7 +3226,7 @@ class FdfParser: # @retval True Successfully find section statement=0D # @retval False Not able to find section statement=0D #=0D - def _GetCglSection(self, Obj, AlignValue =3D None):=0D + def _GetCglSection(self, Obj, AlignValue=3DNone):=0D =0D if self._IsKeyword("COMPRESS"):=0D type =3D "PI_STD"=0D @@ -2967,7 +3234,8 @@ class FdfParser: type =3D self._Token=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D CompressSectionObj =3D CompressSection()=0D CompressSectionObj.Alignment =3D AlignValue=0D @@ -2979,9 +3247,9 @@ class FdfParser: if not IsLeafSection and not IsEncapSection:=0D break=0D =0D -=0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D Obj.SectionList.append(CompressSectionObj)=0D return True=0D =0D @@ -2989,12 +3257,14 @@ class FdfParser: GuidValue =3D None=0D if self._GetNextGuid():=0D if self._Token in GlobalData.gGuidDict:=0D - self._Token =3D GuidStructureStringToGuidString(Global= Data.gGuidDict[self._Token]).upper()=0D + self._Token =3D GuidStructureStringToGuidString(=0D + GlobalData.gGuidDict[self._Token]).upper()=0D GuidValue =3D self._Token=0D =0D AttribDict =3D self._GetGuidAttrib()=0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D GuidSectionObj =3D GuidSection()=0D GuidSectionObj.Alignment =3D AlignValue=0D GuidSectionObj.NameGuid =3D GuidValue=0D @@ -3010,14 +3280,15 @@ class FdfParser: break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D Obj.SectionList.append(GuidSectionObj)=0D =0D return True=0D =0D return False=0D =0D - ## _GetGuidAttri() method=0D + # _GetGuidAttri() method=0D #=0D # Get attributes for GUID section=0D #=0D @@ -3030,14 +3301,16 @@ class FdfParser: AttribDict["AUTH_STATUS_VALID"] =3D "NONE"=0D AttribDict["EXTRA_HEADER_SIZE"] =3D -1=0D while self._IsKeyword("PROCESSING_REQUIRED") or self._IsKeyword("A= UTH_STATUS_VALID") \=0D - or self._IsKeyword("EXTRA_HEADER_SIZE"):=0D + or self._IsKeyword("EXTRA_HEADER_SIZE"):=0D AttribKey =3D self._Token=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("TRUE(1)/FALSE(0)/Number", self.Fil= eName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "TRUE(1)/FALSE(0)/Number", self.FileName, self.Current= LineNumber)=0D elif AttribKey =3D=3D "EXTRA_HEADER_SIZE":=0D Base =3D 10=0D if self._Token[0:2].upper() =3D=3D "0X":=0D @@ -3046,14 +3319,16 @@ class FdfParser: AttribDict[AttribKey] =3D int(self._Token, Base)=0D continue=0D except ValueError:=0D - raise Warning.Expected("Number", self.FileName, self.C= urrentLineNumber)=0D + raise Warning.Expected(=0D + "Number", self.FileName, self.CurrentLineNumber)=0D elif self._Token.upper() not in {"TRUE", "FALSE", "1", "0"}:=0D - raise Warning.Expected("TRUE/FALSE (1/0)", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "TRUE/FALSE (1/0)", self.FileName, self.CurrentLineNum= ber)=0D AttribDict[AttribKey] =3D self._Token=0D =0D return AttribDict=0D =0D - ## _GetEncapsulationSec() method=0D + # _GetEncapsulationSec() method=0D #=0D # Get encapsulation section for FILE=0D #=0D @@ -3066,14 +3341,16 @@ class FdfParser: OldPos =3D self.GetFileBufferPos()=0D if not self._IsKeyword("SECTION"):=0D if len(FfsFileObj.SectionList) =3D=3D 0:=0D - raise Warning.Expected("SECTION", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "SECTION", self.FileName, self.CurrentLineNumber)=0D else:=0D return False=0D =0D AlignValue =3D None=0D if self._GetAlignment():=0D if self._Token not in ALIGNMENT_NOAUTO:=0D - raise Warning("Incorrect alignment '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D AlignValue =3D self._Token=0D =0D if not self._GetCglSection(FfsFileObj, AlignValue):=0D @@ -3095,35 +3372,44 @@ class FdfParser: self._SkipToToken("[FMPPAYLOAD.", True)=0D FmpUiName =3D self._GetUiName().upper()=0D if FmpUiName in self.Profile.FmpPayloadDict:=0D - raise Warning("Duplicated FMP UI name found: %s" % FmpUiName, = self.FileName, self.CurrentLineNumber)=0D + raise Warning("Duplicated FMP UI name found: %s" %=0D + FmpUiName, self.FileName, self.CurrentLineNumber= )=0D =0D FmpData =3D CapsulePayload()=0D FmpData.UiName =3D FmpUiName=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning("The FMP payload section is empty!", self.FileNa= me, self.CurrentLineNumber)=0D - FmpKeyList =3D ['IMAGE_HEADER_INIT_VERSION', 'IMAGE_TYPE_ID', 'IMA= GE_INDEX', 'HARDWARE_INSTANCE', 'CERTIFICATE_GUID', 'MONOTONIC_COUNT']=0D + raise Warning("The FMP payload section is empty!",=0D + self.FileName, self.CurrentLineNumber)=0D + FmpKeyList =3D ['IMAGE_HEADER_INIT_VERSION', 'IMAGE_TYPE_ID', 'IMA= GE_INDEX',=0D + 'HARDWARE_INSTANCE', 'CERTIFICATE_GUID', 'MONOTONIC_= COUNT']=0D while self._Token in FmpKeyList:=0D Name =3D self._Token=0D FmpKeyList.remove(Name)=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if Name =3D=3D 'IMAGE_TYPE_ID':=0D if not self._GetNextGuid():=0D - raise Warning.Expected("GUID value for IMAGE_TYPE_ID."= , self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "GUID value for IMAGE_TYPE_ID.", self.FileName, se= lf.CurrentLineNumber)=0D FmpData.ImageTypeId =3D self._Token=0D elif Name =3D=3D 'CERTIFICATE_GUID':=0D if not self._GetNextGuid():=0D - raise Warning.Expected("GUID value for CERTIFICATE_GUI= D.", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "GUID value for CERTIFICATE_GUID.", self.FileName,= self.CurrentLineNumber)=0D FmpData.Certificate_Guid =3D self._Token=0D if UUID(FmpData.Certificate_Guid) !=3D EFI_CERT_TYPE_RSA20= 48_SHA256_GUID and UUID(FmpData.Certificate_Guid) !=3D EFI_CERT_TYPE_PKCS7_= GUID:=0D - raise Warning("Only support EFI_CERT_TYPE_RSA2048_SHA2= 56_GUID or EFI_CERT_TYPE_PKCS7_GUID for CERTIFICATE_GUID.", self.FileName, = self.CurrentLineNumber)=0D + raise Warning("Only support EFI_CERT_TYPE_RSA2048_SHA2= 56_GUID or EFI_CERT_TYPE_PKCS7_GUID for CERTIFICATE_GUID.",=0D + self.FileName, self.CurrentLineNumber)=0D else:=0D if not self._GetNextToken():=0D - raise Warning.Expected("value of %s" % Name, self.File= Name, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "value of %s" % Name, self.FileName, self.CurrentL= ineNumber)=0D Value =3D self._Token=0D if Name =3D=3D 'IMAGE_HEADER_INIT_VERSION':=0D if FdfParser._Verify(Name, Value, 'UINT8'):=0D @@ -3138,31 +3424,37 @@ class FdfParser: if FdfParser._Verify(Name, Value, 'UINT64'):=0D FmpData.MonotonicCount =3D Value=0D if FmpData.MonotonicCount.upper().startswith('0X')= :=0D - FmpData.MonotonicCount =3D int(FmpData.Monoton= icCount, 16)=0D + FmpData.MonotonicCount =3D int(=0D + FmpData.MonotonicCount, 16)=0D else:=0D - FmpData.MonotonicCount =3D int(FmpData.Monoton= icCount)=0D + FmpData.MonotonicCount =3D int(=0D + FmpData.MonotonicCount)=0D if not self._GetNextToken():=0D break=0D else:=0D self._UndoToken()=0D =0D if (FmpData.MonotonicCount and not FmpData.Certificate_Guid) or (n= ot FmpData.MonotonicCount and FmpData.Certificate_Guid):=0D - EdkLogger.error("FdfParser", FORMAT_INVALID, "CERTIFICATE_GUID= and MONOTONIC_COUNT must be work as a pair.")=0D + EdkLogger.error("FdfParser", FORMAT_INVALID,=0D + "CERTIFICATE_GUID and MONOTONIC_COUNT must be = work as a pair.")=0D =0D # Only the IMAGE_TYPE_ID is required item=0D if FmpKeyList and 'IMAGE_TYPE_ID' in FmpKeyList:=0D - raise Warning("'IMAGE_TYPE_ID' in FMP payload section.", self.= FileName, self.CurrentLineNumber)=0D + raise Warning("'IMAGE_TYPE_ID' in FMP payload section.",=0D + self.FileName, self.CurrentLineNumber)=0D # get the Image file and Vendor code file=0D self._GetFMPCapsuleData(FmpData)=0D if not FmpData.ImageFile:=0D - raise Warning("Missing image file in FMP payload section.", se= lf.FileName, self.CurrentLineNumber)=0D + raise Warning("Missing image file in FMP payload section.",=0D + self.FileName, self.CurrentLineNumber)=0D # check whether more than one Vendor code file=0D if len(FmpData.VendorCodeFile) > 1:=0D - raise Warning("Vendor code file max of 1 per FMP payload secti= on.", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Vendor code file max of 1 per FMP payload secti= on.",=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.FmpPayloadDict[FmpUiName] =3D FmpData=0D return True=0D =0D - ## _GetCapsule() method=0D + # _GetCapsule() method=0D #=0D # Get capsule section contents and store its data into capsule list = of self.Profile=0D #=0D @@ -3182,28 +3474,34 @@ class FdfParser: =0D self._UndoToken()=0D if not self._IsToken("[CAPSULE.", True):=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D - #print 'Parsing String: %s in File %s, At line: %d, Offset Wit= hin Line: %d' \=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D + # print 'Parsing String: %s in File %s, At line: %d, Offset Wi= thin Line: %d' \=0D # % (self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine:], FileLineTuple[0], FileLineTuple[1], se= lf.CurrentOffsetWithinLine)=0D - raise Warning.Expected("[Capsule.]", self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.Expected(=0D + "[Capsule.]", self.FileName, self.CurrentLineNumber)=0D =0D CapsuleObj =3D Capsule()=0D =0D CapsuleName =3D self._GetUiName()=0D if not CapsuleName:=0D - raise Warning.Expected("capsule name", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "capsule name", self.FileName, self.CurrentLineNumber)=0D =0D CapsuleObj.UiCapsuleName =3D CapsuleName.upper()=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if self._IsKeyword("CREATE_FILE"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("file name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "file name", self.FileName, self.CurrentLineNumber)=0D =0D CapsuleObj.CreateFile =3D self._Token=0D =0D @@ -3211,7 +3509,7 @@ class FdfParser: self.Profile.CapsuleDict[CapsuleObj.UiCapsuleName] =3D CapsuleObj= =0D return True=0D =0D - ## _GetCapsuleStatements() method=0D + # _GetCapsuleStatements() method=0D #=0D # Get statements for capsule=0D #=0D @@ -3224,7 +3522,7 @@ class FdfParser: self._GetSetStatements(Obj)=0D self._GetCapsuleData(Obj)=0D =0D - ## _GetCapsuleTokens() method=0D + # _GetCapsuleTokens() method=0D #=0D # Get token statements for capsule=0D #=0D @@ -3237,30 +3535,38 @@ class FdfParser: while self._Token in {"CAPSULE_GUID", "CAPSULE_HEADER_SIZE", "CAPS= ULE_FLAGS", "OEM_CAPSULE_FLAGS", "CAPSULE_HEADER_INIT_VERSION"}:=0D Name =3D self._Token.strip()=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("value", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "value", self.FileName, self.CurrentLineNumber)=0D if Name =3D=3D 'CAPSULE_FLAGS':=0D if not self._Token in {"PersistAcrossReset", "PopulateSyst= emTable", "InitiateReset"}:=0D - raise Warning.Expected("PersistAcrossReset, PopulateSy= stemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "PersistAcrossReset, PopulateSystemTable, or Initi= ateReset", self.FileName, self.CurrentLineNumber)=0D Value =3D self._Token.strip()=0D while self._IsToken(TAB_COMMA_SPLIT):=0D Value +=3D TAB_COMMA_SPLIT=0D if not self._GetNextToken():=0D - raise Warning.Expected("value", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "value", self.FileName, self.CurrentLineNumber= )=0D if not self._Token in {"PersistAcrossReset", "Populate= SystemTable", "InitiateReset"}:=0D - raise Warning.Expected("PersistAcrossReset, Popula= teSystemTable, or InitiateReset", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "PersistAcrossReset, PopulateSystemTable, or I= nitiateReset", self.FileName, self.CurrentLineNumber)=0D Value +=3D self._Token.strip()=0D elif Name =3D=3D 'OEM_CAPSULE_FLAGS':=0D Value =3D self._Token.strip()=0D if not Value.upper().startswith('0X'):=0D - raise Warning.Expected("hex value starting with 0x", s= elf.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "hex value starting with 0x", self.FileName, self.= CurrentLineNumber)=0D try:=0D Value =3D int(Value, 0)=0D except ValueError:=0D - raise Warning.Expected("hex string failed to convert t= o value", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "hex string failed to convert to value", self.File= Name, self.CurrentLineNumber)=0D if not 0x0000 <=3D Value <=3D 0xFFFF:=0D - raise Warning.Expected("hex value between 0x0000 and 0= xFFFF", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "hex value between 0x0000 and 0xFFFF", self.FileNa= me, self.CurrentLineNumber)=0D Value =3D self._Token.strip()=0D else:=0D Value =3D self._Token.strip()=0D @@ -3269,7 +3575,7 @@ class FdfParser: return False=0D self._UndoToken()=0D =0D - ## _GetCapsuleData() method=0D + # _GetCapsuleData() method=0D #=0D # Get capsule data for capsule=0D #=0D @@ -3288,7 +3594,7 @@ class FdfParser: if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfil= e or IsFmp):=0D break=0D =0D - ## _GetFMPCapsuleData() method=0D + # _GetFMPCapsuleData() method=0D #=0D # Get capsule data for FMP capsule=0D #=0D @@ -3303,7 +3609,7 @@ class FdfParser: if not (IsFv or IsFd or IsAnyFile):=0D break=0D =0D - ## _GetFvStatement() method=0D + # _GetFvStatement() method=0D #=0D # Get FV for capsule=0D #=0D @@ -3312,7 +3618,7 @@ class FdfParser: # @retval True Successfully find a FV statement=0D # @retval False Not able to find a FV statement=0D #=0D - def _GetFvStatement(self, CapsuleObj, FMPCapsule =3D False):=0D + def _GetFvStatement(self, CapsuleObj, FMPCapsule=3DFalse):=0D if not self._IsKeyword(BINARY_FILE_TYPE_FV):=0D return False=0D =0D @@ -3320,10 +3626,12 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FV name", self.FileName, self.CurrentL= ineNumber)=0D + raise Warning.Expected(=0D + "FV name", self.FileName, self.CurrentLineNumber)=0D =0D if self._Token.upper() not in self.Profile.FvDict:=0D - raise Warning("FV name does not exist", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning("FV name does not exist",=0D + self.FileName, self.CurrentLineNumber)=0D =0D myCapsuleFv =3D CapsuleFv()=0D myCapsuleFv.FvName =3D self._Token=0D @@ -3336,7 +3644,7 @@ class FdfParser: CapsuleObj.CapsuleDataList.append(myCapsuleFv)=0D return True=0D =0D - ## _GetFdStatement() method=0D + # _GetFdStatement() method=0D #=0D # Get FD for capsule=0D #=0D @@ -3345,7 +3653,7 @@ class FdfParser: # @retval True Successfully find a FD statement=0D # @retval False Not able to find a FD statement=0D #=0D - def _GetFdStatement(self, CapsuleObj, FMPCapsule =3D False):=0D + def _GetFdStatement(self, CapsuleObj, FMPCapsule=3DFalse):=0D if not self._IsKeyword("FD"):=0D return False=0D =0D @@ -3353,10 +3661,12 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("FD name", self.FileName, self.CurrentL= ineNumber)=0D + raise Warning.Expected(=0D + "FD name", self.FileName, self.CurrentLineNumber)=0D =0D if self._Token.upper() not in self.Profile.FdDict:=0D - raise Warning("FD name does not exist", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning("FD name does not exist",=0D + self.FileName, self.CurrentLineNumber)=0D =0D myCapsuleFd =3D CapsuleFd()=0D myCapsuleFd.FdName =3D self._Token=0D @@ -3382,10 +3692,12 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("payload name after FMP_PAYLOAD =3D", s= elf.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "payload name after FMP_PAYLOAD =3D", self.FileName, self.= CurrentLineNumber)=0D Payload =3D self._Token.upper()=0D if Payload not in self.Profile.FmpPayloadDict:=0D - raise Warning("This FMP Payload does not exist: %s" % self._To= ken, self.FileName, self.CurrentLineNumber)=0D + raise Warning("This FMP Payload does not exist: %s" %=0D + self._Token, self.FileName, self.CurrentLineNumb= er)=0D CapsuleObj.FmpPayloadList.append(self.Profile.FmpPayloadDict[Paylo= ad])=0D return True=0D =0D @@ -3401,17 +3713,19 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("File name", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "File name", self.FileName, self.CurrentLineNumber)=0D =0D AnyFileName =3D self._Token=0D self._VerifyFile(AnyFileName)=0D =0D if not os.path.isabs(AnyFileName):=0D - AnyFileName =3D mws.join(GenFdsGlobalVariable.WorkSpaceDir, An= yFileName)=0D + AnyFileName =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, AnyFileName)=0D =0D return AnyFileName=0D =0D - ## _GetAnyFileStatement() method=0D + # _GetAnyFileStatement() method=0D #=0D # Get AnyFile for capsule=0D #=0D @@ -3420,7 +3734,7 @@ class FdfParser: # @retval True Successfully find a Anyfile statement=0D # @retval False Not able to find a AnyFile statement=0D #=0D - def _GetAnyFileStatement(self, CapsuleObj, FMPCapsule =3D False):=0D + def _GetAnyFileStatement(self, CapsuleObj, FMPCapsule=3DFalse):=0D AnyFileName =3D self._ParseRawFileStatement()=0D if not AnyFileName:=0D return False=0D @@ -3436,7 +3750,7 @@ class FdfParser: CapsuleObj.CapsuleDataList.append(myCapsuleAnyFile)=0D return True=0D =0D - ## _GetAfileStatement() method=0D + # _GetAfileStatement() method=0D #=0D # Get Afile for capsule=0D #=0D @@ -3453,13 +3767,14 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("Afile name", self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.Expected(=0D + "Afile name", self.FileName, self.CurrentLineNumber)=0D =0D AfileName =3D self._Token=0D AfileBaseName =3D os.path.basename(AfileName)=0D =0D - if os.path.splitext(AfileBaseName)[1] not in {".bin", ".BIN", ".B= in", ".dat", ".DAT", ".Dat", ".data", ".DATA", ".Data"}:=0D - raise Warning('invalid binary file type, should be one of "bin= ",BINARY_FILE_TYPE_BIN,"Bin","dat","DAT","Dat","data","DATA","Data"', \=0D + if os.path.splitext(AfileBaseName)[1] not in {".bin", ".BIN", ".Bi= n", ".dat", ".DAT", ".Dat", ".data", ".DATA", ".Data"}:=0D + raise Warning('invalid binary file type, should be one of "bin= ",BINARY_FILE_TYPE_BIN,"Bin","dat","DAT","Dat","data","DATA","Data"',=0D self.FileName, self.CurrentLineNumber)=0D =0D if not os.path.isabs(AfileName):=0D @@ -3467,7 +3782,8 @@ class FdfParser: self._VerifyFile(AfileName)=0D else:=0D if not os.path.exists(AfileName):=0D - raise Warning('%s does not exist' % AfileName, self.FileNa= me, self.CurrentLineNumber)=0D + raise Warning('%s does not exist' % AfileName,=0D + self.FileName, self.CurrentLineNumber)=0D else:=0D pass=0D =0D @@ -3476,7 +3792,7 @@ class FdfParser: CapsuleObj.CapsuleDataList.append(myCapsuleAfile)=0D return True=0D =0D - ## _GetRule() method=0D + # _GetRule() method=0D #=0D # Get Rule section contents and store its data into rule list of sel= f.Profile=0D #=0D @@ -3495,13 +3811,16 @@ class FdfParser: return False=0D self._UndoToken()=0D if not self._IsToken("[Rule.", True):=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D - #print 'Parsing String: %s in File %s, At line: %d, Offset Wit= hin Line: %d' \=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D + # print 'Parsing String: %s in File %s, At line: %d, Offset Wi= thin Line: %d' \=0D # % (self.Profile.FileLinesList[self.CurrentLineNumber = - 1][self.CurrentOffsetWithinLine:], FileLineTuple[0], FileLineTuple[1], se= lf.CurrentOffsetWithinLine)=0D - raise Warning.Expected("[Rule.]", self.FileName, self.CurrentL= ineNumber)=0D + raise Warning.Expected(=0D + "[Rule.]", self.FileName, self.CurrentLineNumber)=0D =0D if not self._SkipToToken(TAB_SPLIT):=0D - raise Warning.Expected("'.'", self.FileName, self.CurrentLineN= umber)=0D + raise Warning.Expected("'.'", self.FileName,=0D + self.CurrentLineNumber)=0D =0D Arch =3D self._SkippedChars.rstrip(TAB_SPLIT)=0D =0D @@ -3510,33 +3829,35 @@ class FdfParser: TemplateName =3D ""=0D if self._IsToken(TAB_SPLIT):=0D if not self._GetNextWord():=0D - raise Warning.Expected("template name", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "template name", self.FileName, self.CurrentLineNumber= )=0D TemplateName =3D self._Token=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D RuleObj =3D self._GetRuleFileStatements()=0D RuleObj.Arch =3D Arch.upper()=0D RuleObj.ModuleType =3D ModuleType=0D RuleObj.TemplateName =3D TemplateName=0D if TemplateName =3D=3D '':=0D - self.Profile.RuleDict['RULE' + \=0D - TAB_SPLIT + \=0D - Arch.upper() + \=0D - TAB_SPLIT + \=0D - ModuleType.upper() ] =3D RuleObj=0D + self.Profile.RuleDict['RULE' +=0D + TAB_SPLIT +=0D + Arch.upper() +=0D + TAB_SPLIT +=0D + ModuleType.upper()] =3D RuleObj=0D else:=0D - self.Profile.RuleDict['RULE' + \=0D - TAB_SPLIT + \=0D - Arch.upper() + \=0D - TAB_SPLIT + \=0D - ModuleType.upper() + \=0D - TAB_SPLIT + \=0D - TemplateName.upper() ] =3D RuleObj=0D + self.Profile.RuleDict['RULE' +=0D + TAB_SPLIT +=0D + Arch.upper() +=0D + TAB_SPLIT +=0D + ModuleType.upper() +=0D + TAB_SPLIT +=0D + TemplateName.upper()] =3D RuleObj=0D return True=0D =0D - ## _GetModuleType() method=0D + # _GetModuleType() method=0D #=0D # Return the module type=0D #=0D @@ -3545,7 +3866,8 @@ class FdfParser: #=0D def _GetModuleType(self):=0D if not self._GetNextWord():=0D - raise Warning.Expected("Module type", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "Module type", self.FileName, self.CurrentLineNumber)=0D if self._Token.upper() not in {=0D SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM,=0D SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER,=0D @@ -3562,10 +3884,11 @@ class FdfParser: EDK_COMPONENT_TYPE_APPLICATION, "ACPITABLE",=0D SUP_MODULE_SMM_CORE, SUP_MODULE_MM_STANDALONE,=0D SUP_MODULE_MM_CORE_STANDALONE}:=0D - raise Warning("Unknown Module type '%s'" % self._Token, self.F= ileName, self.CurrentLineNumber)=0D + raise Warning("Unknown Module type '%s'" %=0D + self._Token, self.FileName, self.CurrentLineNumb= er)=0D return self._Token=0D =0D - ## _GetFileExtension() method=0D + # _GetFileExtension() method=0D #=0D # Return the file extension=0D #=0D @@ -3574,7 +3897,8 @@ class FdfParser: #=0D def _GetFileExtension(self):=0D if not self._IsToken(TAB_SPLIT):=0D - raise Warning.Expected("'.'", self.FileName, self.CurrentLineN= umber)=0D + raise Warning.Expected("'.'", self.FileName,=0D + self.CurrentLineNumber)=0D =0D Ext =3D ""=0D if self._GetNextToken():=0D @@ -3582,12 +3906,14 @@ class FdfParser: Ext =3D self._Token=0D return TAB_SPLIT + Ext=0D else:=0D - raise Warning("Unknown file extension '%s'" % self._Token,= self.FileName, self.CurrentLineNumber)=0D + raise Warning("Unknown file extension '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D =0D else:=0D - raise Warning.Expected("file extension", self.FileName, self.C= urrentLineNumber)=0D + raise Warning.Expected(=0D + "file extension", self.FileName, self.CurrentLineNumber)=0D =0D - ## _GetRuleFileStatement() method=0D + # _GetRuleFileStatement() method=0D #=0D # Get rule contents=0D #=0D @@ -3596,35 +3922,42 @@ class FdfParser: #=0D def _GetRuleFileStatements(self):=0D if not self._IsKeyword("FILE"):=0D - raise Warning.Expected("FILE", self.FileName, self.CurrentLine= Number)=0D + raise Warning.Expected("FILE", self.FileName,=0D + self.CurrentLineNumber)=0D =0D if not self._GetNextWord():=0D - raise Warning.Expected("FFS type", self.FileName, self.Current= LineNumber)=0D + raise Warning.Expected(=0D + "FFS type", self.FileName, self.CurrentLineNumber)=0D =0D Type =3D self._Token.strip().upper()=0D if Type not in {"RAW", "FREEFORM", SUP_MODULE_SEC, SUP_MODULE_PEI_= CORE, SUP_MODULE_PEIM,=0D "PEI_DXE_COMBO", "DRIVER", SUP_MODULE_DXE_CORE, ED= K_COMPONENT_TYPE_APPLICATION,=0D "FV_IMAGE", "SMM", SUP_MODULE_SMM_CORE, SUP_MODULE= _MM_STANDALONE,=0D SUP_MODULE_MM_CORE_STANDALONE}:=0D - raise Warning("Unknown FV type '%s'" % self._Token, self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning("Unknown FV type '%s'" % self._Token,=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D raise Warning.ExpectedEquals(self.FileName, self.CurrentLineNu= mber)=0D =0D if not self._IsKeyword("$(NAMED_GUID)"):=0D if not self._GetNextWord():=0D - NamedGuid =3D self._CurrentLine()[self.CurrentOffsetWithin= Line:].split()[0].strip()=0D + NamedGuid =3D self._CurrentLine()[self.CurrentOffsetWithin= Line:].split()[=0D + 0].strip()=0D if GlobalData.gGuidPatternEnd.match(NamedGuid):=0D self.CurrentOffsetWithinLine +=3D len(NamedGuid)=0D self._Token =3D NamedGuid=0D else:=0D - raise Warning.Expected("$(NAMED_GUID)", self.FileName,= self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "$(NAMED_GUID)", self.FileName, self.CurrentLineNu= mber)=0D if self._Token =3D=3D 'PCD':=0D if not self._IsToken("("):=0D - raise Warning.Expected("'('", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "'('", self.FileName, self.CurrentLineNumber)=0D PcdPair =3D self._GetNextPcdSettings()=0D if not self._IsToken(")"):=0D - raise Warning.Expected("')'", self.FileName, self.Curr= entLineNumber)=0D + raise Warning.Expected(=0D + "')'", self.FileName, self.CurrentLineNumber)=0D self._Token =3D 'PCD('+PcdPair[1]+TAB_SPLIT+PcdPair[0]+')'= =0D =0D NameGuid =3D self._Token=0D @@ -3637,7 +3970,8 @@ class FdfParser: else:=0D KeepReloc =3D True=0D else:=0D - raise Warning("File type %s could not have reloc strip fla= g%d" % (Type, self.CurrentLineNumber), self.FileName, self.CurrentLineNumbe= r)=0D + raise Warning("File type %s could not have reloc strip fla= g%d" % (=0D + Type, self.CurrentLineNumber), self.FileName, self.Cur= rentLineNumber)=0D =0D KeyStringList =3D []=0D if self._GetNextToken():=0D @@ -3646,7 +3980,8 @@ class FdfParser: if self._IsToken(TAB_COMMA_SPLIT):=0D while self._GetNextToken():=0D if not TokenFindPattern.match(self._Token):=0D - raise Warning.Expected("KeyString \"Target_Tag= _Arch\"", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "KeyString \"Target_Tag_Arch\"", self.File= Name, self.CurrentLineNumber)=0D KeyStringList.append(self._Token)=0D =0D if not self._IsToken(TAB_COMMA_SPLIT):=0D @@ -3655,7 +3990,6 @@ class FdfParser: else:=0D self._UndoToken()=0D =0D -=0D Fixed =3D False=0D if self._IsKeyword("Fixed", True):=0D Fixed =3D True=0D @@ -3667,8 +4001,9 @@ class FdfParser: AlignValue =3D ""=0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D - #For FFS, Auto is default option same to ""=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D + # For FFS, Auto is default option same to ""=0D if not self._Token =3D=3D "Auto":=0D AlignValue =3D self._Token=0D =0D @@ -3691,25 +4026,27 @@ class FdfParser: break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D return NewRule=0D =0D else:=0D # Simple file rule expected=0D if not self._GetNextWord():=0D - raise Warning.Expected("leaf section type", self.FileName,= self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "leaf section type", self.FileName, self.CurrentLineNu= mber)=0D =0D SectionName =3D self._Token=0D =0D if SectionName not in {=0D "COMPAT16", BINARY_FILE_TYPE_PE32,=0D BINARY_FILE_TYPE_PIC, BINARY_FILE_TYPE_TE, "FV_IMAGE",= =0D - "RAW",BINARY_FILE_TYPE_DXE_DEPEX, BINARY_FILE_TYPE_UI,= =0D + "RAW", BINARY_FILE_TYPE_DXE_DEPEX, BINARY_FILE_TYPE_UI= ,=0D BINARY_FILE_TYPE_PEI_DEPEX, "VERSION", "SUBTYPE_GUID",= =0D BINARY_FILE_TYPE_SMM_DEPEX}:=0D - raise Warning("Unknown leaf section name '%s'" % SectionNa= me, self.FileName, self.CurrentLineNumber)=0D -=0D + raise Warning("Unknown leaf section name '%s'" %=0D + SectionName, self.FileName, self.CurrentLine= Number)=0D =0D if self._IsKeyword("Fixed", True):=0D Fixed =3D True=0D @@ -3720,16 +4057,19 @@ class FdfParser: SectAlignment =3D ""=0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token= , self.FileName, self.CurrentLineNumber)=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.Current= LineNumber)=0D if self._Token =3D=3D 'Auto' and (not SectionName =3D=3D B= INARY_FILE_TYPE_PE32) and (not SectionName =3D=3D BINARY_FILE_TYPE_TE):=0D - raise Warning("Auto alignment can only be used in PE32= or TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32= or TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D SectAlignment =3D self._Token=0D =0D Ext =3D None=0D if self._IsToken(TAB_VALUE_SPLIT):=0D Ext =3D self._GetFileExtension()=0D elif not self._GetNextToken():=0D - raise Warning.Expected("File name", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "File name", self.FileName, self.CurrentLineNumber)=0D =0D NewRule =3D RuleSimpleFile()=0D NewRule.SectionType =3D SectionName=0D @@ -3746,7 +4086,7 @@ class FdfParser: NewRule.FileName =3D self._Token=0D return NewRule=0D =0D - ## _GetEfiSection() method=0D + # _GetEfiSection() method=0D #=0D # Get section list for Rule=0D #=0D @@ -3759,7 +4099,8 @@ class FdfParser: OldPos =3D self.GetFileBufferPos()=0D EfiSectionObj =3D EfiSection()=0D if not self._GetNextWord():=0D - CurrentLine =3D self._CurrentLine()[self.CurrentOffsetWithinLi= ne:].split()[0].strip()=0D + CurrentLine =3D self._CurrentLine()[self.CurrentOffsetWithinLi= ne:].split()[=0D + 0].strip()=0D if self._Token =3D=3D '{' and Obj.FvFileType =3D=3D "RAW" and = TAB_SPLIT in CurrentLine:=0D if self._IsToken(TAB_VALUE_SPLIT):=0D EfiSectionObj.FileExtension =3D self._GetFileExtension= ()=0D @@ -3773,11 +4114,11 @@ class FdfParser: SectionName =3D self._Token=0D =0D if SectionName not in {=0D - "COMPAT16", BINARY_FILE_TYPE_PE32,=0D - BINARY_FILE_TYPE_PIC, BINARY_FILE_TYPE_TE, "FV_IMAGE",= =0D - "RAW",BINARY_FILE_TYPE_DXE_DEPEX, BINARY_FILE_TYPE_UI,= =0D - BINARY_FILE_TYPE_PEI_DEPEX, "VERSION", "SUBTYPE_GUID",= =0D - BINARY_FILE_TYPE_SMM_DEPEX, BINARY_FILE_TYPE_GUID}:=0D + "COMPAT16", BINARY_FILE_TYPE_PE32,=0D + BINARY_FILE_TYPE_PIC, BINARY_FILE_TYPE_TE, "FV_IMAGE",=0D + "RAW", BINARY_FILE_TYPE_DXE_DEPEX, BINARY_FILE_TYPE_UI,=0D + BINARY_FILE_TYPE_PEI_DEPEX, "VERSION", "SUBTYPE_GUID",=0D + BINARY_FILE_TYPE_SMM_DEPEX, BINARY_FILE_TYPE_GUID}:=0D self._UndoToken()=0D return False=0D =0D @@ -3802,18 +4143,21 @@ class FdfParser: break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D FvImageSectionObj.Fv =3D FvObj=0D FvImageSectionObj.FvName =3D None=0D =0D else:=0D if not self._IsKeyword(BINARY_FILE_TYPE_FV):=0D - raise Warning.Expected("'FV'", self.FileName, self.Cur= rentLineNumber)=0D + raise Warning.Expected(=0D + "'FV'", self.FileName, self.CurrentLineNumber)=0D FvImageSectionObj.FvFileType =3D self._Token=0D =0D if self._GetAlignment():=0D if self._Token not in ALIGNMENT_NOAUTO:=0D - raise Warning("Incorrect alignment '%s'" % self._T= oken, self.FileName, self.CurrentLineNumber)=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.Cur= rentLineNumber)=0D FvImageSectionObj.Alignment =3D self._Token=0D =0D if self._IsToken(TAB_VALUE_SPLIT):=0D @@ -3830,7 +4174,8 @@ class FdfParser: else:=0D self._UndoToken()=0D else:=0D - raise Warning.Expected("FV file name", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "FV file name", self.FileName, self.CurrentLineNum= ber)=0D =0D Obj.SectionList.append(FvImageSectionObj)=0D return True=0D @@ -3838,55 +4183,69 @@ class FdfParser: EfiSectionObj.SectionType =3D SectionName=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("file type", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "file type", self.FileName, self.CurrentLineNumber)=0D =0D if self._Token =3D=3D "STRING":=0D if not self._RuleSectionCouldHaveString(EfiSectionObj.SectionT= ype):=0D - raise Warning("%s section could NOT have string data%d" % = (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning("%s section could NOT have string data%d" % = (=0D + EfiSectionObj.SectionType, self.CurrentLineNumber), se= lf.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("Quoted String", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Quoted String", self.FileName, self.CurrentLineNumber= )=0D =0D if self._GetStringData():=0D EfiSectionObj.StringData =3D self._Token=0D =0D if self._IsKeyword("BUILD_NUM"):=0D if not self._RuleSectionCouldHaveBuildNum(EfiSectionObj.Se= ctionType):=0D - raise Warning("%s section could NOT have BUILD_NUM%d" = % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.= CurrentLineNumber)=0D + raise Warning("%s section could NOT have BUILD_NUM%d" = % (=0D + EfiSectionObj.SectionType, self.CurrentLineNumber)= , self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("Build number", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Build number", self.FileName, self.CurrentLineNum= ber)=0D EfiSectionObj.BuildNum =3D self._Token=0D =0D else:=0D EfiSectionObj.FileType =3D self._Token=0D - self._CheckRuleSectionFileType(EfiSectionObj.SectionType, EfiS= ectionObj.FileType)=0D + self._CheckRuleSectionFileType(=0D + EfiSectionObj.SectionType, EfiSectionObj.FileType)=0D =0D if self._IsKeyword("Optional"):=0D if not self._RuleSectionCouldBeOptional(EfiSectionObj.SectionT= ype):=0D - raise Warning("%s section could NOT be optional%d" % (EfiS= ectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.Current= LineNumber)=0D + raise Warning("%s section could NOT be optional%d" % (=0D + EfiSectionObj.SectionType, self.CurrentLineNumber), se= lf.FileName, self.CurrentLineNumber)=0D EfiSectionObj.Optional =3D True=0D =0D if self._IsKeyword("BUILD_NUM"):=0D if not self._RuleSectionCouldHaveBuildNum(EfiSectionObj.Se= ctionType):=0D - raise Warning("%s section could NOT have BUILD_NUM%d" = % (EfiSectionObj.SectionType, self.CurrentLineNumber), self.FileName, self.= CurrentLineNumber)=0D + raise Warning("%s section could NOT have BUILD_NUM%d" = % (=0D + EfiSectionObj.SectionType, self.CurrentLineNumber)= , self.FileName, self.CurrentLineNumber)=0D =0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("Build number", self.FileName, = self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Build number", self.FileName, self.CurrentLineNum= ber)=0D EfiSectionObj.BuildNum =3D self._Token=0D =0D if self._GetAlignment():=0D if self._Token not in ALIGNMENTS:=0D - raise Warning("Incorrect alignment '%s'" % self._Token, se= lf.FileName, self.CurrentLineNumber)=0D + raise Warning("Incorrect alignment '%s'" %=0D + self._Token, self.FileName, self.CurrentLine= Number)=0D if self._Token =3D=3D 'Auto' and (not SectionName =3D=3D BINAR= Y_FILE_TYPE_PE32) and (not SectionName =3D=3D BINARY_FILE_TYPE_TE):=0D - raise Warning("Auto alignment can only be used in PE32 or = TE section ", self.FileName, self.CurrentLineNumber)=0D + raise Warning("Auto alignment can only be used in PE32 or = TE section ",=0D + self.FileName, self.CurrentLineNumber)=0D EfiSectionObj.Alignment =3D self._Token=0D =0D if self._IsKeyword('RELOCS_STRIPPED') or self._IsKeyword('RELOCS_R= ETAINED'):=0D @@ -3896,10 +4255,11 @@ class FdfParser: else:=0D EfiSectionObj.KeepReloc =3D True=0D if Obj.KeepReloc is not None and Obj.KeepReloc !=3D EfiSec= tionObj.KeepReloc:=0D - raise Warning("Section type %s has reloc strip flag co= nflict with Rule" % EfiSectionObj.SectionType, self.FileName, self.CurrentL= ineNumber)=0D + raise Warning("Section type %s has reloc strip flag co= nflict with Rule" %=0D + EfiSectionObj.SectionType, self.FileName= , self.CurrentLineNumber)=0D else:=0D - raise Warning("Section type %s could not have reloc strip = flag" % EfiSectionObj.SectionType, self.FileName, self.CurrentLineNumber)=0D -=0D + raise Warning("Section type %s could not have reloc strip = flag" %=0D + EfiSectionObj.SectionType, self.FileName, se= lf.CurrentLineNumber)=0D =0D if self._IsToken(TAB_VALUE_SPLIT):=0D EfiSectionObj.FileExtension =3D self._GetFileExtension()=0D @@ -3918,23 +4278,27 @@ class FdfParser: =0D if self._Token =3D=3D 'PCD':=0D if not self._IsToken("("):=0D - raise Warning.Expected("'('", self.FileName, s= elf.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "'('", self.FileName, self.CurrentLineNumb= er)=0D PcdPair =3D self._GetNextPcdSettings()=0D if not self._IsToken(")"):=0D - raise Warning.Expected("')'", self.FileName, s= elf.CurrentLineNumber)=0D - self._Token =3D 'PCD('+PcdPair[1]+TAB_SPLIT+PcdPai= r[0]+')'=0D + raise Warning.Expected(=0D + "')'", self.FileName, self.CurrentLineNumb= er)=0D + self._Token =3D 'PCD(' + \=0D + PcdPair[1]+TAB_SPLIT+PcdPair[0]+')'=0D =0D EfiSectionObj.FileName =3D self._Token=0D =0D else:=0D self._UndoToken()=0D else:=0D - raise Warning.Expected("section file name", self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning.Expected("section file name",=0D + self.FileName, self.CurrentLineNumber)= =0D =0D Obj.SectionList.append(EfiSectionObj)=0D return True=0D =0D - ## _RuleSectionCouldBeOptional() method=0D + # _RuleSectionCouldBeOptional() method=0D #=0D # Get whether a section could be optional=0D #=0D @@ -3949,7 +4313,7 @@ class FdfParser: else:=0D return False=0D =0D - ## _RuleSectionCouldHaveBuildNum() method=0D + # _RuleSectionCouldHaveBuildNum() method=0D #=0D # Get whether a section could have build number information=0D #=0D @@ -3964,7 +4328,7 @@ class FdfParser: else:=0D return False=0D =0D - ## _RuleSectionCouldHaveString() method=0D + # _RuleSectionCouldHaveString() method=0D #=0D # Get whether a section could have string=0D #=0D @@ -3979,7 +4343,7 @@ class FdfParser: else:=0D return False=0D =0D - ## _CheckRuleSectionFileType() method=0D + # _CheckRuleSectionFileType() method=0D #=0D # Get whether a section matches a file type=0D #=0D @@ -3991,36 +4355,46 @@ class FdfParser: WarningString =3D "Incorrect section file type '%s'"=0D if SectionType =3D=3D "COMPAT16":=0D if FileType not in {"COMPAT16", "SEC_COMPAT16"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_PE32:=0D if FileType not in {BINARY_FILE_TYPE_PE32, "SEC_PE32"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_PIC:=0D if FileType not in {BINARY_FILE_TYPE_PIC, BINARY_FILE_TYPE_PIC= }:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_TE:=0D if FileType not in {BINARY_FILE_TYPE_TE, "SEC_TE"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D "RAW":=0D if FileType not in {BINARY_FILE_TYPE_BIN, "SEC_BIN", "RAW", "A= SL", "ACPI"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_DXE_DEPEX or SectionType = =3D=3D BINARY_FILE_TYPE_SMM_DEPEX:=0D if FileType not in {BINARY_FILE_TYPE_DXE_DEPEX, "SEC_DXE_DEPEX= ", BINARY_FILE_TYPE_SMM_DEPEX}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_UI:=0D if FileType not in {BINARY_FILE_TYPE_UI, "SEC_UI"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D "VERSION":=0D if FileType not in {"VERSION", "SEC_VERSION"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_PEI_DEPEX:=0D if FileType not in {BINARY_FILE_TYPE_PEI_DEPEX, "SEC_PEI_DEPEX= "}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D elif SectionType =3D=3D BINARY_FILE_TYPE_GUID:=0D if FileType not in {BINARY_FILE_TYPE_PE32, "SEC_GUID"}:=0D - raise Warning(WarningString % FileType, self.FileName, sel= f.CurrentLineNumber)=0D + raise Warning(WarningString %=0D + FileType, self.FileName, self.CurrentLineNum= ber)=0D =0D - ## _GetRuleEncapsulationSection() method=0D + # _GetRuleEncapsulationSection() method=0D #=0D # Get encapsulation section for Rule=0D #=0D @@ -4036,20 +4410,23 @@ class FdfParser: Type =3D self._Token=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D =0D CompressSectionObj =3D CompressSection()=0D =0D CompressSectionObj.CompType =3D Type=0D # Recursive sections...=0D while True:=0D - IsEncapsulate =3D self._GetRuleEncapsulationSection(Compre= ssSectionObj)=0D + IsEncapsulate =3D self._GetRuleEncapsulationSection(=0D + CompressSectionObj)=0D IsLeaf =3D self._GetEfiSection(CompressSectionObj)=0D if not IsEncapsulate and not IsLeaf:=0D break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D theRule.SectionList.append(CompressSectionObj)=0D =0D return True=0D @@ -4058,7 +4435,8 @@ class FdfParser: GuidValue =3D None=0D if self._GetNextGuid():=0D if self._Token in GlobalData.gGuidDict:=0D - self._Token =3D GuidStructureStringToGuidString(Global= Data.gGuidDict[self._Token]).upper()=0D + self._Token =3D GuidStructureStringToGuidString(=0D + GlobalData.gGuidDict[self._Token]).upper()=0D GuidValue =3D self._Token=0D =0D if self._IsKeyword("$(NAMED_GUID)"):=0D @@ -4067,7 +4445,8 @@ class FdfParser: AttribDict =3D self._GetGuidAttrib()=0D =0D if not self._IsToken("{"):=0D - raise Warning.ExpectedCurlyOpen(self.FileName, self.Curren= tLineNumber)=0D + raise Warning.ExpectedCurlyOpen(=0D + self.FileName, self.CurrentLineNumber)=0D GuidSectionObj =3D GuidSection()=0D GuidSectionObj.NameGuid =3D GuidValue=0D GuidSectionObj.SectionType =3D "GUIDED"=0D @@ -4077,20 +4456,22 @@ class FdfParser: =0D # Efi sections...=0D while True:=0D - IsEncapsulate =3D self._GetRuleEncapsulationSection(GuidSe= ctionObj)=0D + IsEncapsulate =3D self._GetRuleEncapsulationSection(=0D + GuidSectionObj)=0D IsLeaf =3D self._GetEfiSection(GuidSectionObj)=0D if not IsEncapsulate and not IsLeaf:=0D break=0D =0D if not self._IsToken(T_CHAR_BRACE_R):=0D - raise Warning.ExpectedCurlyClose(self.FileName, self.Curre= ntLineNumber)=0D + raise Warning.ExpectedCurlyClose(=0D + self.FileName, self.CurrentLineNumber)=0D theRule.SectionList.append(GuidSectionObj)=0D =0D return True=0D =0D return False=0D =0D - ## _GetOptionRom() method=0D + # _GetOptionRom() method=0D #=0D # Get OptionROM section contents and store its data into OptionROM l= ist of self.Profile=0D #=0D @@ -4110,12 +4491,14 @@ class FdfParser: =0D self._UndoToken()=0D if not self._IsToken("[OptionRom.", True):=0D - raise Warning("Unknown Keyword '%s'" % self._Token, self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning("Unknown Keyword '%s'" % self._Token,=0D + self.FileName, self.CurrentLineNumber)=0D =0D OptRomName =3D self._GetUiName()=0D =0D if not self._IsToken(TAB_SECTION_END):=0D - raise Warning.ExpectedBracketClose(self.FileName, self.Current= LineNumber)=0D + raise Warning.ExpectedBracketClose(=0D + self.FileName, self.CurrentLineNumber)=0D =0D OptRomObj =3D OPTIONROM(OptRomName)=0D self.Profile.OptRomDict[OptRomName] =3D OptRomObj=0D @@ -4128,7 +4511,7 @@ class FdfParser: =0D return True=0D =0D - ## _GetOptRomInfStatement() method=0D + # _GetOptRomInfStatement() method=0D #=0D # Get INF statements=0D #=0D @@ -4145,37 +4528,41 @@ class FdfParser: self._GetInfOptions(ffsInf)=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("INF file path", self.FileName, self.Cu= rrentLineNumber)=0D + raise Warning.Expected(=0D + "INF file path", self.FileName, self.CurrentLineNumber)=0D ffsInf.InfFileName =3D self._Token=0D if ffsInf.InfFileName.replace(TAB_WORKSPACE, '').find('$') =3D=3D = -1:=0D - #check for file path=0D - ErrorCode, ErrorInfo =3D PathClass(NormPath(ffsInf.InfFileName= ), GenFdsGlobalVariable.WorkSpaceDir).Validate()=0D + # check for file path=0D + ErrorCode, ErrorInfo =3D PathClass(=0D + NormPath(ffsInf.InfFileName), GenFdsGlobalVariable.WorkSpa= ceDir).Validate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo= )=0D =0D NewFileName =3D ffsInf.InfFileName=0D if ffsInf.OverrideGuid:=0D - NewFileName =3D ProcessDuplicatedInf(PathClass(ffsInf.InfFileN= ame,GenFdsGlobalVariable.WorkSpaceDir), ffsInf.OverrideGuid, GenFdsGlobalVa= riable.WorkSpaceDir).Path=0D + NewFileName =3D ProcessDuplicatedInf(PathClass(=0D + ffsInf.InfFileName, GenFdsGlobalVariable.WorkSpaceDir), ff= sInf.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir).Path=0D =0D if not NewFileName in self.Profile.InfList:=0D self.Profile.InfList.append(NewFileName)=0D - FileLineTuple =3D GetRealFileLine(self.FileName, self.CurrentL= ineNumber)=0D + FileLineTuple =3D GetRealFileLine(=0D + self.FileName, self.CurrentLineNumber)=0D self.Profile.InfFileLineList.append(FileLineTuple)=0D if ffsInf.UseArch:=0D if ffsInf.UseArch not in self.Profile.InfDict:=0D self.Profile.InfDict[ffsInf.UseArch] =3D [ffsInf.InfFi= leName]=0D else:=0D - self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.Inf= FileName)=0D + self.Profile.InfDict[ffsInf.UseArch].append(=0D + ffsInf.InfFileName)=0D else:=0D self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)= =0D =0D -=0D - self._GetOptRomOverrides (ffsInf)=0D + self._GetOptRomOverrides(ffsInf)=0D =0D Obj.FfsList.append(ffsInf)=0D return True=0D =0D - ## _GetOptRomOverrides() method=0D + # _GetOptRomOverrides() method=0D #=0D # Get overrides for OptROM INF & FILE=0D #=0D @@ -4188,55 +4575,67 @@ class FdfParser: while True:=0D if self._IsKeyword("PCI_VENDOR_ID"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex vendor id", self.FileN= ame, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex vendor id", self.FileName, self.CurrentLi= neNumber)=0D Overrides.PciVendorId =3D self._Token=0D continue=0D =0D if self._IsKeyword("PCI_CLASS_CODE"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex class code", self.File= Name, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex class code", self.FileName, self.CurrentL= ineNumber)=0D Overrides.PciClassCode =3D self._Token=0D continue=0D =0D if self._IsKeyword("PCI_DEVICE_ID"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D # Get a list of PCI IDs=0D Overrides.PciDeviceId =3D ""=0D while (self._GetNextHexNumber()):=0D - Overrides.PciDeviceId =3D "{} {}".format(Overrides= .PciDeviceId, self._Token)=0D + Overrides.PciDeviceId =3D "{} {}".format(=0D + Overrides.PciDeviceId, self._Token)=0D if not Overrides.PciDeviceId:=0D - raise Warning.Expected("one or more Hex device ids= ", self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "one or more Hex device ids", self.FileName, s= elf.CurrentLineNumber)=0D continue=0D =0D if self._IsKeyword("PCI_REVISION"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextHexNumber():=0D - raise Warning.Expected("Hex revision", self.FileNa= me, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Hex revision", self.FileName, self.CurrentLin= eNumber)=0D Overrides.PciRevision =3D self._Token=0D continue=0D =0D if self._IsKeyword("PCI_COMPRESS"):=0D if not self._IsToken(TAB_EQUAL_SPLIT):=0D - raise Warning.ExpectedEquals(self.FileName, self.C= urrentLineNumber)=0D + raise Warning.ExpectedEquals(=0D + self.FileName, self.CurrentLineNumber)=0D if not self._GetNextToken():=0D - raise Warning.Expected("TRUE/FALSE for compress", = self.FileName, self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "TRUE/FALSE for compress", self.FileName, self= .CurrentLineNumber)=0D Overrides.NeedCompress =3D self._Token.upper() =3D=3D = 'TRUE'=0D continue=0D =0D if self._IsToken(T_CHAR_BRACE_R):=0D break=0D else:=0D - EdkLogger.error("FdfParser", FORMAT_INVALID, File=3Dse= lf.FileName, Line=3Dself.CurrentLineNumber)=0D + EdkLogger.error("FdfParser", FORMAT_INVALID,=0D + File=3Dself.FileName, Line=3Dself.Curr= entLineNumber)=0D =0D Obj.OverrideAttribs =3D Overrides=0D =0D - ## _GetOptRomFileStatement() method=0D + # _GetOptRomFileStatement() method=0D #=0D # Get FILE statements=0D #=0D @@ -4252,15 +4651,18 @@ class FdfParser: FfsFileObj =3D OptRomFileStatement()=0D =0D if not self._IsKeyword("EFI") and not self._IsKeyword(BINARY_FILE_= TYPE_BIN):=0D - raise Warning.Expected("Binary type (EFI/BIN)", self.FileName,= self.CurrentLineNumber)=0D + raise Warning.Expected(=0D + "Binary type (EFI/BIN)", self.FileName, self.CurrentLineNu= mber)=0D FfsFileObj.FileType =3D self._Token=0D =0D if not self._GetNextToken():=0D - raise Warning.Expected("File path", self.FileName, self.Curren= tLineNumber)=0D + raise Warning.Expected(=0D + "File path", self.FileName, self.CurrentLineNumber)=0D FfsFileObj.FileName =3D self._Token=0D if FfsFileObj.FileName.replace(TAB_WORKSPACE, '').find('$') =3D=3D= -1:=0D - #check for file path=0D - ErrorCode, ErrorInfo =3D PathClass(NormPath(FfsFileObj.FileNam= e), GenFdsGlobalVariable.WorkSpaceDir).Validate()=0D + # check for file path=0D + ErrorCode, ErrorInfo =3D PathClass(=0D + NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSp= aceDir).Validate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo= )=0D =0D @@ -4271,7 +4673,7 @@ class FdfParser: =0D return True=0D =0D - ## _GetCapInFd() method=0D + # _GetCapInFd() method=0D #=0D # Get Cap list contained in FD=0D #=0D @@ -4279,7 +4681,7 @@ class FdfParser: # @param FdName FD name=0D # @retval CapList List of Capsule in FD=0D #=0D - def _GetCapInFd (self, FdName):=0D + def _GetCapInFd(self, FdName):=0D CapList =3D []=0D if FdName.upper() in self.Profile.FdDict:=0D FdObj =3D self.Profile.FdDict[FdName.upper()]=0D @@ -4292,7 +4694,7 @@ class FdfParser: CapList.append(elementRegionData.upper())=0D return CapList=0D =0D - ## _GetReferencedFdCapTuple() method=0D + # _GetReferencedFdCapTuple() method=0D #=0D # Get FV and FD list referenced by a capsule image=0D #=0D @@ -4301,12 +4703,12 @@ class FdfParser: # @param RefFdList referenced FD by section=0D # @param RefFvList referenced FV by section=0D #=0D - def _GetReferencedFdCapTuple(self, CapObj, RefFdList =3D [], RefFvList= =3D []):=0D + def _GetReferencedFdCapTuple(self, CapObj, RefFdList=3D[], RefFvList= =3D[]):=0D for CapsuleDataObj in CapObj.CapsuleDataList:=0D if hasattr(CapsuleDataObj, 'FvName') and CapsuleDataObj.FvName= is not None and CapsuleDataObj.FvName.upper() not in RefFvList:=0D - RefFvList.append (CapsuleDataObj.FvName.upper())=0D + RefFvList.append(CapsuleDataObj.FvName.upper())=0D elif hasattr(CapsuleDataObj, 'FdName') and CapsuleDataObj.FdNa= me is not None and CapsuleDataObj.FdName.upper() not in RefFdList:=0D - RefFdList.append (CapsuleDataObj.FdName.upper())=0D + RefFdList.append(CapsuleDataObj.FdName.upper())=0D elif CapsuleDataObj.Ffs is not None:=0D if isinstance(CapsuleDataObj.Ffs, FileStatement):=0D if CapsuleDataObj.Ffs.FvName is not None and CapsuleDa= taObj.Ffs.FvName.upper() not in RefFvList:=0D @@ -4314,9 +4716,10 @@ class FdfParser: elif CapsuleDataObj.Ffs.FdName is not None and Capsule= DataObj.Ffs.FdName.upper() not in RefFdList:=0D RefFdList.append(CapsuleDataObj.Ffs.FdName.upper()= )=0D else:=0D - self._GetReferencedFdFvTupleFromSection(CapsuleDat= aObj.Ffs, RefFdList, RefFvList)=0D + self._GetReferencedFdFvTupleFromSection(=0D + CapsuleDataObj.Ffs, RefFdList, RefFvList)=0D =0D - ## _GetFvInFd() method=0D + # _GetFvInFd() method=0D #=0D # Get FV list contained in FD=0D #=0D @@ -4324,7 +4727,7 @@ class FdfParser: # @param FdName FD name=0D # @retval FvList list of FV in FD=0D #=0D - def _GetFvInFd (self, FdName):=0D + def _GetFvInFd(self, FdName):=0D FvList =3D []=0D if FdName.upper() in self.Profile.FdDict:=0D FdObj =3D self.Profile.FdDict[FdName.upper()]=0D @@ -4337,7 +4740,7 @@ class FdfParser: FvList.append(elementRegionData.upper())=0D return FvList=0D =0D - ## _GetReferencedFdFvTuple() method=0D + # _GetReferencedFdFvTuple() method=0D #=0D # Get FD and FV list referenced by a FFS file=0D #=0D @@ -4346,7 +4749,7 @@ class FdfParser: # @param RefFdList referenced FD by section=0D # @param RefFvList referenced FV by section=0D #=0D - def _GetReferencedFdFvTuple(self, FvObj, RefFdList =3D [], RefFvList = =3D []):=0D + def _GetReferencedFdFvTuple(self, FvObj, RefFdList=3D[], RefFvList=3D[= ]):=0D for FfsObj in FvObj.FfsList:=0D if isinstance(FfsObj, FileStatement):=0D if FfsObj.FvName is not None and FfsObj.FvName.upper() not= in RefFvList:=0D @@ -4354,9 +4757,10 @@ class FdfParser: elif FfsObj.FdName is not None and FfsObj.FdName.upper() n= ot in RefFdList:=0D RefFdList.append(FfsObj.FdName.upper())=0D else:=0D - self._GetReferencedFdFvTupleFromSection(FfsObj, RefFdL= ist, RefFvList)=0D + self._GetReferencedFdFvTupleFromSection(=0D + FfsObj, RefFdList, RefFvList)=0D =0D - ## _GetReferencedFdFvTupleFromSection() method=0D + # _GetReferencedFdFvTupleFromSection() method=0D #=0D # Get FD and FV list referenced by a FFS section=0D #=0D @@ -4365,7 +4769,7 @@ class FdfParser: # @param FdList referenced FD by section=0D # @param FvList referenced FV by section=0D #=0D - def _GetReferencedFdFvTupleFromSection(self, FfsFile, FdList =3D [], F= vList =3D []):=0D + def _GetReferencedFdFvTupleFromSection(self, FfsFile, FdList=3D[], FvL= ist=3D[]):=0D SectionStack =3D list(FfsFile.SectionList)=0D while SectionStack !=3D []:=0D SectionObj =3D SectionStack.pop()=0D @@ -4379,7 +4783,7 @@ class FdfParser: if isinstance(SectionObj, CompressSection) or isinstance(Secti= onObj, GuidSection):=0D SectionStack.extend(SectionObj.SectionList)=0D =0D - ## CycleReferenceCheck() method=0D + # CycleReferenceCheck() method=0D #=0D # Check whether cycle reference exists in FDF=0D #=0D @@ -4391,7 +4795,7 @@ class FdfParser: #=0D # Check the cycle between FV and FD image=0D #=0D - MaxLength =3D len (self.Profile.FvDict)=0D + MaxLength =3D len(self.Profile.FvDict)=0D for FvName in self.Profile.FvDict:=0D LogStr =3D "\nCycle Reference Checking for FV: %s\n" % FvName= =0D RefFvStack =3D set(FvName)=0D @@ -4414,11 +4818,13 @@ class FdfParser: if RefFdName in FdAnalyzedList:=0D continue=0D =0D - LogStr +=3D "FV %s contains FD %s\n" % (FvNameFromStac= k, RefFdName)=0D + LogStr +=3D "FV %s contains FD %s\n" % (=0D + FvNameFromStack, RefFdName)=0D FvInFdList =3D self._GetFvInFd(RefFdName)=0D if FvInFdList !=3D []:=0D for FvNameInFd in FvInFdList:=0D - LogStr +=3D "FD %s contains FV %s\n" % (RefFdN= ame, FvNameInFd)=0D + LogStr +=3D "FD %s contains FV %s\n" % (=0D + RefFdName, FvNameInFd)=0D if FvNameInFd not in RefFvStack:=0D RefFvStack.add(FvNameInFd)=0D =0D @@ -4428,7 +4834,8 @@ class FdfParser: FdAnalyzedList.add(RefFdName)=0D =0D for RefFvName in RefFvList:=0D - LogStr +=3D "FV %s contains FV %s\n" % (FvNameFromStac= k, RefFvName)=0D + LogStr +=3D "FV %s contains FV %s\n" % (=0D + FvNameFromStack, RefFvName)=0D if RefFvName not in RefFvStack:=0D RefFvStack.add(RefFvName)=0D =0D @@ -4439,7 +4846,7 @@ class FdfParser: #=0D # Check the cycle between Capsule and FD image=0D #=0D - MaxLength =3D len (self.Profile.CapsuleDict)=0D + MaxLength =3D len(self.Profile.CapsuleDict)=0D for CapName in self.Profile.CapsuleDict:=0D #=0D # Capsule image to be checked.=0D @@ -4464,14 +4871,16 @@ class FdfParser: =0D FvListLength =3D 0=0D FdListLength =3D 0=0D - while FvListLength < len (RefFvList) or FdListLength < len= (RefFdList):=0D + while FvListLength < len(RefFvList) or FdListLength < len(= RefFdList):=0D for RefFdName in RefFdList:=0D if RefFdName in FdAnalyzedList:=0D continue=0D =0D - LogStr +=3D "Capsule %s contains FD %s\n" % (CapNa= meFromStack, RefFdName)=0D + LogStr +=3D "Capsule %s contains FD %s\n" % (=0D + CapNameFromStack, RefFdName)=0D for CapNameInFd in self._GetCapInFd(RefFdName):=0D - LogStr +=3D "FD %s contains Capsule %s\n" % (R= efFdName, CapNameInFd)=0D + LogStr +=3D "FD %s contains Capsule %s\n" % (= =0D + RefFdName, CapNameInFd)=0D if CapNameInFd not in RefCapStack:=0D RefCapStack.append(CapNameInFd)=0D =0D @@ -4480,7 +4889,8 @@ class FdfParser: return True=0D =0D for FvNameInFd in self._GetFvInFd(RefFdName):=0D - LogStr +=3D "FD %s contains FV %s\n" % (RefFdN= ame, FvNameInFd)=0D + LogStr +=3D "FD %s contains FV %s\n" % (=0D + RefFdName, FvNameInFd)=0D if FvNameInFd not in RefFvList:=0D RefFvList.append(FvNameInFd)=0D =0D @@ -4488,25 +4898,28 @@ class FdfParser: #=0D # the number of the parsed FV and FD image=0D #=0D - FvListLength =3D len (RefFvList)=0D - FdListLength =3D len (RefFdList)=0D + FvListLength =3D len(RefFvList)=0D + FdListLength =3D len(RefFdList)=0D for RefFvName in RefFvList:=0D if RefFvName in FvAnalyzedList:=0D continue=0D - LogStr +=3D "Capsule %s contains FV %s\n" % (CapNa= meFromStack, RefFvName)=0D + LogStr +=3D "Capsule %s contains FV %s\n" % (=0D + CapNameFromStack, RefFvName)=0D if RefFvName.upper() in self.Profile.FvDict:=0D FvObj =3D self.Profile.FvDict[RefFvName.upper(= )]=0D else:=0D continue=0D - self._GetReferencedFdFvTuple(FvObj, RefFdList, Ref= FvList)=0D + self._GetReferencedFdFvTuple(=0D + FvObj, RefFdList, RefFvList)=0D FvAnalyzedList.add(RefFvName)=0D =0D return False=0D =0D - def GetAllIncludedFile (self):=0D + def GetAllIncludedFile(self):=0D global AllIncludeFileList=0D return AllIncludeFileList=0D =0D +=0D if __name__ =3D=3D "__main__":=0D import sys=0D try:=0D @@ -4523,4 +4936,3 @@ if __name__ =3D=3D "__main__": print(str(X))=0D else:=0D print("Success!")=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/Ffs.py b/BaseTools/Source/Pytho= n/GenFds/Ffs.py index 4e58df279b14..272fabc41e03 100644 --- a/BaseTools/Source/Python/GenFds/Ffs.py +++ b/BaseTools/Source/Python/GenFds/Ffs.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FFS generation=0D #=0D # Copyright (c) 2007-2018, Intel Corporation. All rights reserved.
        =0D @@ -13,37 +13,37 @@ from Common.DataType import * =0D # mapping between FILE type in FDF and file type for GenFfs=0D FdfFvFileTypeToFileType =3D {=0D - SUP_MODULE_SEC : 'EFI_FV_FILETYPE_SECURITY_CORE',=0D - SUP_MODULE_PEI_CORE : 'EFI_FV_FILETYPE_PEI_CORE',=0D - SUP_MODULE_PEIM : 'EFI_FV_FILETYPE_PEIM',=0D - SUP_MODULE_DXE_CORE : 'EFI_FV_FILETYPE_DXE_CORE',=0D - 'FREEFORM' : 'EFI_FV_FILETYPE_FREEFORM',=0D - 'DRIVER' : 'EFI_FV_FILETYPE_DRIVER',=0D - 'APPLICATION' : 'EFI_FV_FILETYPE_APPLICATION',=0D - 'FV_IMAGE' : 'EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE',=0D - 'RAW' : 'EFI_FV_FILETYPE_RAW',=0D - 'PEI_DXE_COMBO' : 'EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER',=0D - 'SMM' : 'EFI_FV_FILETYPE_SMM',=0D - SUP_MODULE_SMM_CORE : 'EFI_FV_FILETYPE_SMM_CORE',=0D - SUP_MODULE_MM_STANDALONE : 'EFI_FV_FILETYPE_MM_STANDALONE',=0D - SUP_MODULE_MM_CORE_STANDALONE : 'EFI_FV_FILETYPE_MM_CORE_STANDALONE'=0D + SUP_MODULE_SEC: 'EFI_FV_FILETYPE_SECURITY_CORE',=0D + SUP_MODULE_PEI_CORE: 'EFI_FV_FILETYPE_PEI_CORE',=0D + SUP_MODULE_PEIM: 'EFI_FV_FILETYPE_PEIM',=0D + SUP_MODULE_DXE_CORE: 'EFI_FV_FILETYPE_DXE_CORE',=0D + 'FREEFORM': 'EFI_FV_FILETYPE_FREEFORM',=0D + 'DRIVER': 'EFI_FV_FILETYPE_DRIVER',=0D + 'APPLICATION': 'EFI_FV_FILETYPE_APPLICATION',=0D + 'FV_IMAGE': 'EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE',=0D + 'RAW': 'EFI_FV_FILETYPE_RAW',=0D + 'PEI_DXE_COMBO': 'EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER',=0D + 'SMM': 'EFI_FV_FILETYPE_SMM',=0D + SUP_MODULE_SMM_CORE: 'EFI_FV_FILETYPE_SMM_CORE',=0D + SUP_MODULE_MM_STANDALONE: 'EFI_FV_FILETYPE_MM_STANDALONE',=0D + SUP_MODULE_MM_CORE_STANDALONE: 'EFI_FV_FILETYPE_MM_CORE_STANDALONE'=0D }=0D =0D # mapping between section type in FDF and file suffix=0D SectionSuffix =3D {=0D - BINARY_FILE_TYPE_PE32 : '.pe32',=0D - BINARY_FILE_TYPE_PIC : '.pic',=0D - BINARY_FILE_TYPE_TE : '.te',=0D - BINARY_FILE_TYPE_DXE_DEPEX : '.dpx',=0D - 'VERSION' : '.ver',=0D - BINARY_FILE_TYPE_UI : '.ui',=0D - 'COMPAT16' : '.com16',=0D - 'RAW' : '.raw',=0D + BINARY_FILE_TYPE_PE32: '.pe32',=0D + BINARY_FILE_TYPE_PIC: '.pic',=0D + BINARY_FILE_TYPE_TE: '.te',=0D + BINARY_FILE_TYPE_DXE_DEPEX: '.dpx',=0D + 'VERSION': '.ver',=0D + BINARY_FILE_TYPE_UI: '.ui',=0D + 'COMPAT16': '.com16',=0D + 'RAW': '.raw',=0D 'FREEFORM_SUBTYPE_GUID': '.guid',=0D - 'SUBTYPE_GUID' : '.guid',=0D - 'FV_IMAGE' : 'fv.sec',=0D - 'COMPRESS' : '.com',=0D - 'GUIDED' : '.guided',=0D - BINARY_FILE_TYPE_PEI_DEPEX : '.dpx',=0D - BINARY_FILE_TYPE_SMM_DEPEX : '.dpx'=0D + 'SUBTYPE_GUID': '.guid',=0D + 'FV_IMAGE': 'fv.sec',=0D + 'COMPRESS': '.com',=0D + 'GUIDED': '.guided',=0D + BINARY_FILE_TYPE_PEI_DEPEX: '.dpx',=0D + BINARY_FILE_TYPE_SMM_DEPEX: '.dpx'=0D }=0D diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools= /Source/Python/GenFds/FfsFileStatement.py index 1c6e59bac75c..92758df91e5a 100644 --- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FFS generation from FILE statement=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -23,11 +23,13 @@ from .Ffs import FdfFvFileTypeToFileType from .GenFdsGlobalVariable import GenFdsGlobalVariable=0D import shutil=0D =0D -## generate FFS from FILE=0D +# generate FFS from FILE=0D #=0D #=0D +=0D +=0D class FileStatement (FileStatementClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -39,7 +41,7 @@ class FileStatement (FileStatementClassObject): self.InfFileName =3D None=0D self.SubAlignment =3D None=0D =0D - ## GenFfs() method=0D + # GenFfs() method=0D #=0D # Generate FFS=0D #=0D @@ -49,19 +51,19 @@ class FileStatement (FileStatementClassObject): # @param FvParentAddr Parent Fv base address=0D # @retval string Generated FFS file name=0D #=0D - def GenFfs(self, Dict =3D None, FvChildAddr=3D[], FvParentAddr=3DNone,= IsMakefile=3DFalse, FvName=3DNone):=0D + def GenFfs(self, Dict=3DNone, FvChildAddr=3D[], FvParentAddr=3DNone, I= sMakefile=3DFalse, FvName=3DNone):=0D =0D if self.NameGuid and self.NameGuid.startswith('PCD('):=0D PcdValue =3D GenFdsGlobalVariable.GetPcdValue(self.NameGuid)=0D if len(PcdValue) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' = \=0D - % (self.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.'= =0D + % (self.NameGuid))=0D if PcdValue.startswith('{'):=0D PcdValue =3D GuidStructureByteArrayToGuidString(PcdValue)= =0D RegistryGuidStr =3D PcdValue=0D if len(RegistryGuidStr) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.' \=0D - % (self.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.'=0D + % (self.NameGuid))=0D self.NameGuid =3D RegistryGuidStr=0D =0D Str =3D self.NameGuid=0D @@ -81,15 +83,19 @@ class FileStatement (FileStatementClassObject): if self.FvName:=0D Buffer =3D BytesIO()=0D if self.FvName.upper() not in GenFdsGlobalVariable.FdfParser.P= rofile.FvDict:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT de= scribed in FDF file!" % (self.FvName))=0D - Fv =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.= FvName.upper())=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "FV (%s) is NOT described in F= DF file!" % (self.FvName))=0D + Fv =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(=0D + self.FvName.upper())=0D FileName =3D Fv.AddToBuffer(Buffer)=0D SectionFiles =3D [FileName]=0D =0D elif self.FdName:=0D if self.FdName.upper() not in GenFdsGlobalVariable.FdfParser.P= rofile.FdDict:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "FD (%s) is NOT de= scribed in FDF file!" % (self.FdName))=0D - Fd =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.= FdName.upper())=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "FD (%s) is NOT described in F= DF file!" % (self.FdName))=0D + Fd =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(=0D + self.FdName.upper())=0D FileName =3D Fd.GenFd()=0D SectionFiles =3D [FileName]=0D =0D @@ -103,37 +109,44 @@ class FileStatement (FileStatementClassObject): try:=0D f =3D open(File, 'rb')=0D except:=0D - GenFdsGlobalVariable.ErrorLogger("Error openin= g RAW file %s." % (File))=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "Error opening RAW file %s." % (File))=0D Content =3D f.read()=0D f.close()=0D AlignValue =3D 1=0D if self.SubAlignment[Index]:=0D - AlignValue =3D GenFdsGlobalVariable.GetAlignme= nt(self.SubAlignment[Index])=0D + AlignValue =3D GenFdsGlobalVariable.GetAlignme= nt(=0D + self.SubAlignment[Index])=0D if AlignValue > MaxAlignValue:=0D MaxAlignIndex =3D Index=0D MaxAlignValue =3D AlignValue=0D FileContent.write(Content)=0D if len(FileContent.getvalue()) % AlignValue !=3D 0= :=0D - Size =3D AlignValue - len(FileContent.getvalue= ()) % AlignValue=0D + Size =3D AlignValue - \=0D + len(FileContent.getvalue()) % AlignValue=0D for i in range(0, Size):=0D FileContent.write(pack('B', 0xFF))=0D =0D if FileContent.getvalue() !=3D b'':=0D - OutputRAWFile =3D os.path.join(GenFdsGlobalVariabl= e.FfsDir, self.NameGuid, self.NameGuid + '.raw')=0D - SaveFileOnChange(OutputRAWFile, FileContent.getval= ue(), True)=0D + OutputRAWFile =3D os.path.join(=0D + GenFdsGlobalVariable.FfsDir, self.NameGuid, se= lf.NameGuid + '.raw')=0D + SaveFileOnChange(=0D + OutputRAWFile, FileContent.getvalue(), True)=0D self.FileName =3D OutputRAWFile=0D self.SubAlignment =3D self.SubAlignment[MaxAlignIn= dex]=0D =0D if self.Alignment and self.SubAlignment:=0D - if GenFdsGlobalVariable.GetAlignment (self.Alignment) = < GenFdsGlobalVariable.GetAlignment (self.SubAlignment):=0D + if GenFdsGlobalVariable.GetAlignment(self.Alignment) <= GenFdsGlobalVariable.GetAlignment(self.SubAlignment):=0D self.Alignment =3D self.SubAlignment=0D elif self.SubAlignment:=0D self.Alignment =3D self.SubAlignment=0D =0D - self.FileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(s= elf.FileName)=0D - #Replace $(SAPCE) with real space=0D + self.FileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(= =0D + self.FileName)=0D + # Replace $(SAPCE) with real space=0D self.FileName =3D self.FileName.replace('$(SPACE)', ' ')=0D - SectionFiles =3D [GenFdsGlobalVariable.MacroExtend(self.FileNa= me, Dict)]=0D + SectionFiles =3D [=0D + GenFdsGlobalVariable.MacroExtend(self.FileName, Dict)]=0D =0D else:=0D SectionFiles =3D []=0D @@ -141,7 +154,7 @@ class FileStatement (FileStatementClassObject): SectionAlignments =3D []=0D for section in self.SectionList:=0D Index =3D Index + 1=0D - SecIndex =3D '%d' %Index=0D + SecIndex =3D '%d' % Index=0D # process the inside FvImage from FvSection or GuidSection= =0D if FvChildAddr !=3D []:=0D if isinstance(section, FvImageSection):=0D @@ -153,7 +166,8 @@ class FileStatement (FileStatementClassObject): =0D if self.KeepReloc =3D=3D False:=0D section.KeepReloc =3D False=0D - sectList, align =3D section.GenSection(OutputDir, self.Nam= eGuid, SecIndex, self.KeyStringList, None, Dict)=0D + sectList, align =3D section.GenSection(=0D + OutputDir, self.NameGuid, SecIndex, self.KeyStringList= , None, Dict)=0D if sectList !=3D []:=0D for sect in sectList:=0D SectionFiles.append(sect)=0D @@ -164,12 +178,13 @@ class FileStatement (FileStatementClassObject): #=0D FfsFileOutput =3D os.path.join(OutputDir, self.NameGuid + '.ffs')= =0D GenFdsGlobalVariable.GenerateFfs(FfsFileOutput, SectionFiles,=0D - FdfFvFileTypeToFileType.get(self.= FvFileType),=0D + FdfFvFileTypeToFileType.get(=0D + self.FvFileType),=0D self.NameGuid,=0D Fixed=3Dself.Fixed,=0D CheckSum=3Dself.CheckSum,=0D Align=3Dself.Alignment,=0D SectionAlign=3DSectionAlignments= =0D - )=0D + )=0D =0D return FfsFileOutput=0D diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/= Source/Python/GenFds/FfsInfStatement.py index 568efb6d7685..17095e5edf1d 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FFS generation from INF statement=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -16,7 +16,7 @@ import Common.LongFilePathOs as os from io import BytesIO=0D from struct import *=0D from .GenFdsGlobalVariable import GenFdsGlobalVariable=0D -from .Ffs import SectionSuffix,FdfFvFileTypeToFileType=0D +from .Ffs import SectionSuffix, FdfFvFileTypeToFileType=0D import subprocess=0D import sys=0D from . import Section=0D @@ -46,11 +46,13 @@ from Common.Misc import SaveFileOnChange from Common.Expression import *=0D from Common.DataType import *=0D =0D -## generate FFS from INF=0D +# generate FFS from INF=0D #=0D #=0D +=0D +=0D class FfsInfStatement(FfsInfStatementClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -73,22 +75,25 @@ class FfsInfStatement(FfsInfStatementClassObject): self.MacroDict =3D {}=0D self.Depex =3D False=0D =0D - ## GetFinalTargetSuffixMap() method=0D + # GetFinalTargetSuffixMap() method=0D #=0D # Get final build target list=0D def GetFinalTargetSuffixMap(self):=0D if not self.InfModule or not self.CurrentArch:=0D return []=0D if not self.FinalTargetSuffixMap:=0D - FinalBuildTargetList =3D GenFdsGlobalVariable.GetModuleCodaTar= getList(self.InfModule, self.CurrentArch)=0D + FinalBuildTargetList =3D GenFdsGlobalVariable.GetModuleCodaTar= getList(=0D + self.InfModule, self.CurrentArch)=0D for File in FinalBuildTargetList:=0D - self.FinalTargetSuffixMap.setdefault(os.path.splitext(File= )[1], []).append(File)=0D + self.FinalTargetSuffixMap.setdefault(=0D + os.path.splitext(File)[1], []).append(File)=0D =0D # Check if current INF module has DEPEX=0D if '.depex' not in self.FinalTargetSuffixMap and self.InfModul= e.ModuleType !=3D SUP_MODULE_USER_DEFINED and self.InfModule.ModuleType != =3D SUP_MODULE_HOST_APPLICATION \=0D - and not self.InfModule.DxsFile and not self.InfModule.Libr= aryClass:=0D + and not self.InfModule.DxsFile and not self.InfModule.= LibraryClass:=0D ModuleType =3D self.InfModule.ModuleType=0D - PlatformDataBase =3D GenFdsGlobalVariable.WorkSpace.BuildO= bject[GenFdsGlobalVariable.ActivePlatform, self.CurrentArch, GenFdsGlobalVa= riable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + PlatformDataBase =3D GenFdsGlobalVariable.WorkSpace.BuildO= bject[GenFdsGlobalVariable.ActivePlatform,=0D + = self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable= .ToolChainTag]=0D =0D if ModuleType !=3D SUP_MODULE_USER_DEFINED and ModuleType = !=3D SUP_MODULE_HOST_APPLICATION:=0D for LibraryClass in PlatformDataBase.LibraryClasses.Ge= tKeys():=0D @@ -131,31 +136,34 @@ class FfsInfStatement(FfsInfStatementClassObject): LibraryPath =3D Module.LibraryClasses[LibName]= =0D if not LibraryPath:=0D continue=0D - LibraryModule =3D GenFdsGlobalVariable.WorkSpace.B= uildObject[LibraryPath, self.CurrentArch, GenFdsGlobalVariable.TargetName, = GenFdsGlobalVariable.ToolChainTag]=0D + LibraryModule =3D GenFdsGlobalVariable.WorkSpace.B= uildObject[LibraryPath,=0D + = self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVar= iable.ToolChainTag]=0D LibraryInstance[LibName] =3D LibraryModule=0D DependencyList.append(LibraryModule)=0D if DepexList:=0D Dpx =3D DependencyExpression(DepexList, ModuleType, Tr= ue)=0D if len(Dpx.PostfixNotation) !=3D 0:=0D # It means this module has DEPEX=0D - self.FinalTargetSuffixMap['.depex'] =3D [os.path.j= oin(self.EfiOutputPath, self.BaseName) + '.depex']=0D + self.FinalTargetSuffixMap['.depex'] =3D [os.path.j= oin(=0D + self.EfiOutputPath, self.BaseName) + '.depex']= =0D return self.FinalTargetSuffixMap=0D =0D - ## __InfParse() method=0D + # __InfParse() method=0D #=0D # Parse inf file to get module information=0D #=0D # @param self The object pointer=0D # @param Dict dictionary contains macro and value pair=0D #=0D - def __InfParse__(self, Dict =3D None, IsGenFfs=3DFalse):=0D + def __InfParse__(self, Dict=3DNone, IsGenFfs=3DFalse):=0D =0D - GenFdsGlobalVariable.VerboseLogger( " Begine parsing INf file : %s= " %self.InfFileName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + " Begine parsing INf file : %s" % self.InfFileName)=0D =0D self.InfFileName =3D self.InfFileName.replace('$(WORKSPACE)', '')= =0D if len(self.InfFileName) > 1 and self.InfFileName[0] =3D=3D '\\' a= nd self.InfFileName[1] =3D=3D '\\':=0D pass=0D - elif self.InfFileName[0] =3D=3D '\\' or self.InfFileName[0] =3D=3D= '/' :=0D + elif self.InfFileName[0] =3D=3D '\\' or self.InfFileName[0] =3D=3D= '/':=0D self.InfFileName =3D self.InfFileName[1:]=0D =0D if self.InfFileName.find('$') =3D=3D -1:=0D @@ -163,14 +171,16 @@ class FfsInfStatement(FfsInfStatementClassObject): if not os.path.exists(InfPath):=0D InfPath =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(Inf= Path)=0D if not os.path.exists(InfPath):=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Non-existant = Module %s !" % (self.InfFileName))=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "Non-existant Module %s !"= % (self.InfFileName))=0D =0D self.CurrentArch =3D self.GetCurrentArch()=0D #=0D # Get the InfClass object=0D #=0D =0D - PathClassObj =3D PathClass(self.InfFileName, GenFdsGlobalVariable.= WorkSpaceDir)=0D + PathClassObj =3D PathClass(=0D + self.InfFileName, GenFdsGlobalVariable.WorkSpaceDir)=0D ErrorCode, ErrorInfo =3D PathClassObj.Validate(".inf")=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo)=0D @@ -180,10 +190,12 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D InfLowerPath =3D str(PathClassObj).lower()=0D if self.OverrideGuid:=0D - PathClassObj =3D ProcessDuplicatedInf(PathClassObj, self.Overr= ideGuid, GenFdsGlobalVariable.WorkSpaceDir)=0D + PathClassObj =3D ProcessDuplicatedInf(=0D + PathClassObj, self.OverrideGuid, GenFdsGlobalVariable.Work= SpaceDir)=0D if self.CurrentArch is not None:=0D =0D - Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassOb= j, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.= ToolChainTag]=0D + Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassOb= j, self.CurrentArch,=0D + GenFdsGlobalV= ariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D #=0D # Set Ffs BaseName, ModuleGuid, ModuleType, Version, OutputPat= h=0D #=0D @@ -201,7 +213,8 @@ class FfsInfStatement(FfsInfStatementClassObject): self.ShadowFromInfFile =3D Inf.Shadow=0D =0D else:=0D - Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassOb= j, TAB_COMMON, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolCh= ainTag]=0D + Inf =3D GenFdsGlobalVariable.WorkSpace.BuildObject[PathClassOb= j, TAB_COMMON,=0D + GenFdsGlobalV= ariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D self.BaseName =3D Inf.BaseName=0D self.ModuleGuid =3D Inf.Guid=0D self.ModuleType =3D Inf.ModuleType=0D @@ -212,27 +225,31 @@ class FfsInfStatement(FfsInfStatementClassObject): self.SourceFileList =3D Inf.Sources=0D if self.BinFileList =3D=3D []:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - "INF %s specified in FDF could not be foun= d in build ARCH %s!" \=0D + "INF %s specified in FDF could not be foun= d in build ARCH %s!"=0D % (self.InfFileName, GenFdsGlobalVariable.= ArchList))=0D =0D if self.OverrideGuid:=0D self.ModuleGuid =3D self.OverrideGuid=0D =0D if len(self.SourceFileList) !=3D 0 and not self.InDsc:=0D - EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in= DSC file; Is it really a binary module?" % (self.InfFileName))=0D + EdkLogger.warn("GenFds", GENFDS_ERROR, "Module %s NOT found in= DSC file; Is it really a binary module?" % (=0D + self.InfFileName))=0D =0D if self.ModuleType =3D=3D SUP_MODULE_SMM_CORE and int(self.PiSpecV= ersion, 16) < 0x0001000A:=0D - 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)=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "SMM_CORE module type can't be used in the mod= ule with PI_SPECIFICATION_VERSION less than 0x0001000A", File=3Dself.InfFil= eName)=0D =0D if self.ModuleType =3D=3D SUP_MODULE_MM_CORE_STANDALONE and int(se= lf.PiSpecVersion, 16) < 0x00010032:=0D - 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)=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "MM_CORE_STANDALONE module type can't be used = in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Ds= elf.InfFileName)=0D =0D if Inf._Defs is not None and len(Inf._Defs) > 0:=0D self.OptRomDefs.update(Inf._Defs)=0D =0D self.PatchPcds =3D []=0D InfPcds =3D Inf.Pcds=0D - Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlob= alVariable.ActivePlatform, self.CurrentArch, GenFdsGlobalVariable.TargetNam= e, GenFdsGlobalVariable.ToolChainTag]=0D + Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlob= alVariable.ActivePlatform,=0D + self.Current= Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D FdfPcdDict =3D GenFdsGlobalVariable.FdfParser.Profile.PcdDict=0D PlatformPcds =3D Platform.Pcds=0D =0D @@ -282,15 +299,19 @@ class FfsInfStatement(FfsInfStatementClassObject): # Support Flexible PCD format=0D if DefaultValue:=0D try:=0D - DefaultValue =3D ValueExpressionEx(DefaultValue, Pcd.D= atumType, Platform._GuidDict)(True)=0D + DefaultValue =3D ValueExpressionEx(=0D + DefaultValue, Pcd.DatumType, Platform._GuidDict)(T= rue)=0D except BadExpression:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] V= alue "%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, DefaultValue), File= =3Dself.InfFileName)=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] V= alue "%s"' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, DefaultVa= lue), File=3Dself.InfFileName)=0D =0D if Pcd.InfDefaultValue:=0D try:=0D - Pcd.InfDefaultValue =3D ValueExpressionEx(Pcd.InfDefau= ltValue, Pcd.DatumType, Platform._GuidDict)(True)=0D + Pcd.InfDefaultValue =3D ValueExpressionEx(=0D + Pcd.InfDefaultValue, Pcd.DatumType, Platform._Guid= Dict)(True)=0D except BadExpression:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] V= alue "%s"' %(Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DefaultValue), Fi= le=3Dself.InfFileName)=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'PCD [%s.%s] V= alue "%s"' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.Defau= ltValue), File=3Dself.InfFileName)=0D =0D # Check value, if value are equal, no need to patch=0D if Pcd.DatumType =3D=3D TAB_VOID:=0D @@ -325,12 +346,12 @@ class FfsInfStatement(FfsInfStatementClassObject): # Check the Pcd size and data type=0D if Pcd.DatumType =3D=3D TAB_VOID:=0D if int(MaxDatumSize) > int(Pcd.MaxDatumSize):=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "The size of V= OID* type PCD '%s.%s' exceeds its maximum size %d bytes." \=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "The size of V= OID* type PCD '%s.%s' exceeds its maximum size %d bytes."=0D % (Pcd.TokenSpaceGuidCName, Pcd.TokenC= Name, int(MaxDatumSize) - int(Pcd.MaxDatumSize)))=0D else:=0D if PcdValueInDscOrFdf > MAX_VAL_TYPE[Pcd.DatumType] \=0D - or PcdValueInImg > MAX_VAL_TYPE[Pcd.DatumType]:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "The size of %= s type PCD '%s.%s' doesn't match its data type." \=0D + or PcdValueInImg > MAX_VAL_TYPE[Pcd.DatumType]:=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "The size of %= s type PCD '%s.%s' doesn't match its data type."=0D % (Pcd.DatumType, Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName))=0D self.PatchPcds.append((Pcd, DefaultValue))=0D =0D @@ -343,8 +364,10 @@ class FfsInfStatement(FfsInfStatementClassObject): GenFdsGlobalVariable.VerboseLogger("BaseName : %s" % self.BaseName= )=0D GenFdsGlobalVariable.VerboseLogger("ModuleGuid : %s" % self.Module= Guid)=0D GenFdsGlobalVariable.VerboseLogger("ModuleType : %s" % self.Module= Type)=0D - GenFdsGlobalVariable.VerboseLogger("VersionString : %s" % self.Ver= sionString)=0D - GenFdsGlobalVariable.VerboseLogger("InfFileName :%s" % self.InfFil= eName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "VersionString : %s" % self.VersionString)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "InfFileName :%s" % self.InfFileName)=0D =0D #=0D # Set OutputPath =3D ${WorkSpace}\Build\Fv\Ffs\${ModuleGuid}+ ${Mo= duleName}\=0D @@ -353,15 +376,16 @@ class FfsInfStatement(FfsInfStatementClassObject): Rule =3D self.__GetRule__()=0D if GlobalData.gGuidPatternEnd.match(Rule.NameGuid):=0D self.ModuleGuid =3D Rule.NameGuid=0D - self.OutputPath =3D os.path.join(GenFdsGlobalVariable.FfsDir, \=0D + self.OutputPath =3D os.path.join(GenFdsGlobalVariable.FfsDir,=0D self.ModuleGuid + self.BaseName)=0D - if not os.path.exists(self.OutputPath) :=0D + if not os.path.exists(self.OutputPath):=0D os.makedirs(self.OutputPath)=0D =0D self.EfiOutputPath, self.EfiDebugPath =3D self.__GetEFIOutPutPath_= _()=0D - GenFdsGlobalVariable.VerboseLogger( "ModuelEFIPath: " + self.EfiOu= tputPath)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "ModuelEFIPath: " + self.EfiOutputPath)=0D =0D - ## PatchEfiFile=0D + # PatchEfiFile=0D #=0D # Patch EFI file with patch PCD=0D #=0D @@ -386,13 +410,13 @@ class FfsInfStatement(FfsInfStatementClassObject): # Generate path to patched output file=0D #=0D Basename =3D os.path.basename(EfiFile)=0D - Output =3D os.path.normpath (os.path.join(self.OutputPath, Basenam= e))=0D + Output =3D os.path.normpath(os.path.join(self.OutputPath, Basename= ))=0D =0D #=0D # If this file has already been patched, then return the path to t= he patched file=0D #=0D if self.PatchedBinFile =3D=3D Output:=0D - return Output=0D + return Output=0D =0D #=0D # If a different file from the same module has already been patche= d, then generate an error=0D @@ -401,7 +425,8 @@ class FfsInfStatement(FfsInfStatementClassObject): EdkLogger.error("GenFds", GENFDS_ERROR,=0D 'Only one binary file can be patched:\n'=0D ' a binary file has been patched: %s\n'=0D - ' current file: %s' % (self.PatchedBinFile, E= fiFile),=0D + ' current file: %s' % (=0D + self.PatchedBinFile, EfiFile),=0D File=3Dself.InfFileName)=0D =0D #=0D @@ -413,9 +438,11 @@ class FfsInfStatement(FfsInfStatementClassObject): # Apply patches to patched output file=0D #=0D for Pcd, Value in self.PatchPcds:=0D - RetVal, RetStr =3D PatchBinaryFile(Output, int(Pcd.Offset, 0),= Pcd.DatumType, Value, Pcd.MaxDatumSize)=0D + RetVal, RetStr =3D PatchBinaryFile(Output, int(=0D + Pcd.Offset, 0), Pcd.DatumType, Value, Pcd.MaxDatumSize)=0D if RetVal:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, RetStr, File=3Dsel= f.InfFileName)=0D + EdkLogger.error("GenFds", GENFDS_ERROR,=0D + RetStr, File=3Dself.InfFileName)=0D =0D #=0D # Save the path of the patched output file=0D @@ -427,7 +454,7 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D return Output=0D =0D - ## GenFfs() method=0D + # GenFfs() method=0D #=0D # Generate FFS=0D #=0D @@ -437,7 +464,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param FvParentAddr Parent Fv base address=0D # @retval string Generated FFS file name=0D #=0D - def GenFfs(self, Dict =3D None, FvChildAddr =3D [], FvParentAddr=3DNon= e, IsMakefile=3DFalse, FvName=3DNone):=0D + def GenFfs(self, Dict=3DNone, FvChildAddr=3D[], FvParentAddr=3DNone, I= sMakefile=3DFalse, FvName=3DNone):=0D #=0D # Parse Inf file get Module related information=0D #=0D @@ -445,8 +472,8 @@ class FfsInfStatement(FfsInfStatementClassObject): Dict =3D {}=0D self.__InfParse__(Dict, IsGenFfs=3DTrue)=0D Arch =3D self.GetCurrentArch()=0D - SrcFile =3D mws.join( GenFdsGlobalVariable.WorkSpaceDir, self.InfF= ileName);=0D - DestFile =3D os.path.join( self.OutputPath, self.ModuleGuid + '.ff= s')=0D + SrcFile =3D mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFi= leName)=0D + DestFile =3D os.path.join(self.OutputPath, self.ModuleGuid + '.ffs= ')=0D =0D SrcFileDir =3D "."=0D SrcPath =3D os.path.dirname(SrcFile)=0D @@ -457,18 +484,18 @@ class FfsInfStatement(FfsInfStatementClassObject): DestFileBase, DestFileExt =3D os.path.splitext(DestFileName)=0D self.MacroDict =3D {=0D # source file=0D - "${src}" : SrcFile,=0D - "${s_path}" : SrcPath,=0D - "${s_dir}" : SrcFileDir,=0D - "${s_name}" : SrcFileName,=0D - "${s_base}" : SrcFileBase,=0D - "${s_ext}" : SrcFileExt,=0D + "${src}": SrcFile,=0D + "${s_path}": SrcPath,=0D + "${s_dir}": SrcFileDir,=0D + "${s_name}": SrcFileName,=0D + "${s_base}": SrcFileBase,=0D + "${s_ext}": SrcFileExt,=0D # destination file=0D - "${dst}" : DestFile,=0D - "${d_path}" : DestPath,=0D - "${d_name}" : DestFileName,=0D - "${d_base}" : DestFileBase,=0D - "${d_ext}" : DestFileExt=0D + "${dst}": DestFile,=0D + "${d_path}": DestPath,=0D + "${d_name}": DestFileName,=0D + "${d_base}": DestFileBase,=0D + "${d_ext}": DestFileExt=0D }=0D #=0D # Allow binary type module not specify override rule in FDF file.= =0D @@ -483,7 +510,8 @@ class FfsInfStatement(FfsInfStatementClassObject): # Get the rule of how to generate Ffs file=0D #=0D Rule =3D self.__GetRule__()=0D - GenFdsGlobalVariable.VerboseLogger( "Packing binaries from inf fil= e : %s" %self.InfFileName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Packing binaries from inf file : %s" % self.InfFileName)=0D #=0D # Convert Fv File Type for PI1.1 SMM driver.=0D #=0D @@ -495,7 +523,8 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D if self.ModuleType =3D=3D SUP_MODULE_DXE_SMM_DRIVER and int(self.P= iSpecVersion, 16) < 0x0001000A:=0D if Rule.FvFileType =3D=3D 'SMM' or Rule.FvFileType =3D=3D SUP_= MODULE_SMM_CORE:=0D - EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework= SMM module doesn't support SMM or SMM_CORE FV file type", File=3Dself.InfF= ileName)=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "Framework SMM module doesn't support SMM = or SMM_CORE FV file type", File=3Dself.InfFileName)=0D #=0D # For the rule only has simpleFile=0D #=0D @@ -503,23 +532,29 @@ class FfsInfStatement(FfsInfStatementClassObject): if self.IsBinaryModule:=0D IsMakefile =3D False=0D if IsMakefile:=0D - PathClassObj =3D PathClass(self.InfFileName, GenFdsGlobalVaria= ble.WorkSpaceDir)=0D + PathClassObj =3D PathClass(=0D + self.InfFileName, GenFdsGlobalVariable.WorkSpaceDir)=0D if self.OverrideGuid:=0D - PathClassObj =3D ProcessDuplicatedInf(PathClassObj, self.O= verrideGuid, GenFdsGlobalVariable.WorkSpaceDir)=0D + PathClassObj =3D ProcessDuplicatedInf(=0D + PathClassObj, self.OverrideGuid, GenFdsGlobalVariable.= WorkSpaceDir)=0D MakefilePath =3D PathClassObj.Path, Arch=0D - if isinstance (Rule, RuleSimpleFile.RuleSimpleFile):=0D - SectionOutputList =3D self.__GenSimpleFileSection__(Rule, IsMa= kefile=3DIsMakefile)=0D - FfsOutput =3D self.__GenSimpleFileFfs__(Rule, SectionOutputLis= t, MakefilePath=3DMakefilePath)=0D + if isinstance(Rule, RuleSimpleFile.RuleSimpleFile):=0D + SectionOutputList =3D self.__GenSimpleFileSection__(=0D + Rule, IsMakefile=3DIsMakefile)=0D + FfsOutput =3D self.__GenSimpleFileFfs__(=0D + Rule, SectionOutputList, MakefilePath=3DMakefilePath)=0D return FfsOutput=0D #=0D # For Rule has ComplexFile=0D #=0D elif isinstance(Rule, RuleComplexFile.RuleComplexFile):=0D - InputSectList, InputSectAlignments =3D self.__GenComplexFileSe= ction__(Rule, FvChildAddr, FvParentAddr, IsMakefile=3DIsMakefile)=0D - FfsOutput =3D self.__GenComplexFileFfs__(Rule, InputSectList, = InputSectAlignments, MakefilePath=3DMakefilePath)=0D + InputSectList, InputSectAlignments =3D self.__GenComplexFileSe= ction__(=0D + Rule, FvChildAddr, FvParentAddr, IsMakefile=3DIsMakefile)= =0D + FfsOutput =3D self.__GenComplexFileFfs__(=0D + Rule, InputSectList, InputSectAlignments, MakefilePath=3DM= akefilePath)=0D return FfsOutput=0D =0D - ## __ExtendMacro__() method=0D + # __ExtendMacro__() method=0D #=0D # Replace macro with its value=0D #=0D @@ -527,26 +562,26 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param String The string to be replaced=0D # @retval string Macro replaced string=0D #=0D - def __ExtendMacro__ (self, String):=0D + def __ExtendMacro__(self, String):=0D MacroDict =3D {=0D - '$(INF_OUTPUT)' : self.EfiOutputPath,=0D - '$(MODULE_NAME)' : self.BaseName,=0D + '$(INF_OUTPUT)': self.EfiOutputPath,=0D + '$(MODULE_NAME)': self.BaseName,=0D '$(BUILD_NUMBER)': self.BuildNum,=0D - '$(INF_VERSION)' : self.VersionString,=0D - '$(NAMED_GUID)' : self.ModuleGuid=0D + '$(INF_VERSION)': self.VersionString,=0D + '$(NAMED_GUID)': self.ModuleGuid=0D }=0D String =3D GenFdsGlobalVariable.MacroExtend(String, MacroDict)=0D String =3D GenFdsGlobalVariable.MacroExtend(String, self.MacroDict= )=0D return String=0D =0D - ## __GetRule__() method=0D + # __GetRule__() method=0D #=0D # Get correct rule for generating FFS for this INF=0D #=0D # @param self The object pointer=0D # @retval Rule Rule object=0D #=0D - def __GetRule__ (self) :=0D + def __GetRule__(self):=0D CurrentArchList =3D []=0D if self.CurrentArch is None:=0D CurrentArchList =3D ['common']=0D @@ -554,44 +589,48 @@ class FfsInfStatement(FfsInfStatementClassObject): CurrentArchList.append(self.CurrentArch)=0D =0D for CurrentArch in CurrentArchList:=0D - RuleName =3D 'RULE' + \=0D - '.' + \=0D + RuleName =3D 'RULE' + \=0D + '.' + \=0D CurrentArch.upper() + \=0D - '.' + \=0D + '.' + \=0D self.ModuleType.upper()=0D if self.Rule is not None:=0D RuleName =3D RuleName + \=0D - '.' + \=0D - self.Rule.upper()=0D + '.' + \=0D + self.Rule.upper()=0D =0D - Rule =3D GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(R= uleName)=0D + Rule =3D GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(= =0D + RuleName)=0D if Rule is not None:=0D - GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Nam= e is : " + RuleName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Want To Find Rule Name is : " + RuleName)=0D return Rule=0D =0D - RuleName =3D 'RULE' + \=0D - '.' + \=0D - TAB_COMMON + \=0D - '.' + \=0D + RuleName =3D 'RULE' + \=0D + '.' + \=0D + TAB_COMMON + \=0D + '.' + \=0D self.ModuleType.upper()=0D =0D if self.Rule is not None:=0D RuleName =3D RuleName + \=0D - '.' + \=0D - self.Rule.upper()=0D + '.' + \=0D + self.Rule.upper()=0D =0D - GenFdsGlobalVariable.VerboseLogger ('Trying to apply common rule %= s for INF %s' % (RuleName, self.InfFileName))=0D + GenFdsGlobalVariable.VerboseLogger(=0D + 'Trying to apply common rule %s for INF %s' % (RuleName, self.= InfFileName))=0D =0D Rule =3D GenFdsGlobalVariable.FdfParser.Profile.RuleDict.get(RuleN= ame)=0D if Rule is not None:=0D - GenFdsGlobalVariable.VerboseLogger ("Want To Find Rule Name is= : " + RuleName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Want To Find Rule Name is : " + RuleName)=0D return Rule=0D =0D - if Rule is None :=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'Don\'t Find common ru= le %s for INF %s' \=0D + if Rule is None:=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'Don\'t Find common ru= le %s for INF %s'=0D % (RuleName, self.InfFileName))=0D =0D - ## __GetPlatformArchList__() method=0D + # __GetPlatformArchList__() method=0D #=0D # Get Arch list this INF built under=0D #=0D @@ -600,13 +639,15 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D def __GetPlatformArchList__(self):=0D =0D - InfFileKey =3D os.path.normpath(mws.join(GenFdsGlobalVariable.Work= SpaceDir, self.InfFileName))=0D + InfFileKey =3D os.path.normpath(=0D + mws.join(GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName))= =0D DscArchList =3D []=0D - for Arch in GenFdsGlobalVariable.ArchList :=0D - PlatformDataBase =3D GenFdsGlobalVariable.WorkSpace.BuildObjec= t[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetNam= e, GenFdsGlobalVariable.ToolChainTag]=0D - if PlatformDataBase is not None:=0D + for Arch in GenFdsGlobalVariable.ArchList:=0D + PlatformDataBase =3D GenFdsGlobalVariable.WorkSpace.BuildObjec= t[GenFdsGlobalVariable.ActivePlatform,=0D + = Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + if PlatformDataBase is not None:=0D if InfFileKey in PlatformDataBase.Modules:=0D - DscArchList.append (Arch)=0D + DscArchList.append(Arch)=0D else:=0D #=0D # BaseTools support build same module more than once, = the module path with FILE_GUID overridden has=0D @@ -615,19 +656,19 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D for key in PlatformDataBase.Modules:=0D if InfFileKey =3D=3D str((PlatformDataBase.Modules= [key]).MetaFile.Path):=0D - DscArchList.append (Arch)=0D + DscArchList.append(Arch)=0D break=0D =0D return DscArchList=0D =0D - ## GetCurrentArch() method=0D + # GetCurrentArch() method=0D #=0D # Get Arch list of the module from this INF is to be placed into fla= sh=0D #=0D # @param self The object pointer=0D # @retval list Arch list=0D #=0D - def GetCurrentArch(self) :=0D + def GetCurrentArch(self):=0D =0D TargetArchList =3D GenFdsGlobalVariable.ArchList=0D =0D @@ -635,8 +676,9 @@ class FfsInfStatement(FfsInfStatementClassObject): =0D CurArchList =3D TargetArchList=0D if PlatformArchList !=3D []:=0D - CurArchList =3D list(set (TargetArchList) & set (PlatformArchL= ist))=0D - GenFdsGlobalVariable.VerboseLogger ("Valid target architecture(s) = is : " + " ".join(CurArchList))=0D + CurArchList =3D list(set(TargetArchList) & set(PlatformArchLis= t))=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Valid target architecture(s) is : " + " ".join(CurArchList))= =0D =0D ArchList =3D []=0D if self.KeyStringList !=3D []:=0D @@ -654,12 +696,13 @@ class FfsInfStatement(FfsInfStatementClassObject): if self.UseArch is not None:=0D UseArchList =3D []=0D UseArchList.append(self.UseArch)=0D - ArchList =3D list(set (UseArchList) & set (ArchList))=0D + ArchList =3D list(set(UseArchList) & set(ArchList))=0D =0D self.InfFileName =3D NormPath(self.InfFileName)=0D if len(PlatformArchList) =3D=3D 0:=0D self.InDsc =3D False=0D - PathClassObj =3D PathClass(self.InfFileName, GenFdsGlobalVaria= ble.WorkSpaceDir)=0D + PathClassObj =3D PathClass(=0D + self.InfFileName, GenFdsGlobalVariable.WorkSpaceDir)=0D ErrorCode, ErrorInfo =3D PathClassObj.Validate(".inf")=0D if ErrorCode !=3D 0:=0D EdkLogger.error("GenFds", ErrorCode, ExtraData=3DErrorInfo= )=0D @@ -668,14 +711,16 @@ class FfsInfStatement(FfsInfStatementClassObject): return Arch=0D elif len(ArchList) > 1:=0D if len(PlatformArchList) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "GenFds command li= ne option has multiple ARCHs %s. Not able to determine which ARCH is valid = for Module %s !" % (str(ArchList), self.InfFileName))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "GenFds command li= ne option has multiple ARCHs %s. Not able to determine which ARCH is valid = for Module %s !" % (=0D + str(ArchList), self.InfFileName))=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Module built unde= r multiple ARCHs %s. Not able to determine which output to put into flash f= or Module %s !" % (str(ArchList), self.InfFileName))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Module built unde= r multiple ARCHs %s. Not able to determine which output to put into flash f= or Module %s !" % (=0D + str(ArchList), self.InfFileName))=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s appears und= er ARCH %s in platform %s, but current deduced ARCH is %s, so NO build outp= ut could be put into flash." \=0D - % (self.InfFileName, str(PlatformArchList), Ge= nFdsGlobalVariable.ActivePlatform, str(set (UseArchList) & set (TargetArchL= ist))))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s appears und= er ARCH %s in platform %s, but current deduced ARCH is %s, so NO build outp= ut could be put into flash."=0D + % (self.InfFileName, str(PlatformArchList), Ge= nFdsGlobalVariable.ActivePlatform, str(set(UseArchList) & set(TargetArchLis= t))))=0D =0D - ## __GetEFIOutPutPath__() method=0D + # __GetEFIOutPutPath__() method=0D #=0D # Get the output path for generated files=0D #=0D @@ -702,16 +747,16 @@ class FfsInfStatement(FfsInfStatementClassObject): 'OUTPUT'=0D )=0D DebugPath =3D os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch= ],=0D - Arch,=0D - ModulePath,=0D - FileName,=0D - 'DEBUG'=0D - )=0D + Arch,=0D + ModulePath,=0D + FileName,=0D + 'DEBUG'=0D + )=0D OutputPath =3D os.path.abspath(OutputPath)=0D DebugPath =3D os.path.abspath(DebugPath)=0D return OutputPath, DebugPath=0D =0D - ## __GenSimpleFileSection__() method=0D + # __GenSimpleFileSection__() method=0D #=0D # Generate section by specified file name or a list of files with fi= le extension=0D #=0D @@ -719,7 +764,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param Rule The rule object used to generate section=0D # @retval string File name of the generated section file=0D #=0D - def __GenSimpleFileSection__(self, Rule, IsMakefile =3D False):=0D + def __GenSimpleFileSection__(self, Rule, IsMakefile=3DFalse):=0D #=0D # Prepare the parameter of GenSection=0D #=0D @@ -731,9 +776,11 @@ class FfsInfStatement(FfsInfStatementClassObject): if os.path.isabs(GenSecInputFile):=0D GenSecInputFile =3D os.path.normpath(GenSecInputFile)=0D else:=0D - GenSecInputFile =3D os.path.normpath(os.path.join(self.Efi= OutputPath, GenSecInputFile))=0D + GenSecInputFile =3D os.path.normpath(=0D + os.path.join(self.EfiOutputPath, GenSecInputFile))=0D else:=0D - FileList, IsSect =3D Section.Section.GetFileList(self, '', Rul= e.FileExtension)=0D + FileList, IsSect =3D Section.Section.GetFileList(=0D + self, '', Rule.FileExtension)=0D =0D Index =3D 1=0D SectionType =3D Rule.SectionType=0D @@ -748,7 +795,8 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D if self.ModuleType =3D=3D SUP_MODULE_DXE_SMM_DRIVER and int(self.P= iSpecVersion, 16) < 0x0001000A:=0D if SectionType =3D=3D BINARY_FILE_TYPE_SMM_DEPEX:=0D - EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Framework= SMM module doesn't support SMM_DEPEX section type", File=3Dself.InfFileNam= e)=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "Framework SMM module doesn't support SMM_= DEPEX section type", File=3Dself.InfFileName)=0D NoStrip =3D True=0D if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MO= DULE_PEIM):=0D if self.KeepReloc is not None:=0D @@ -758,98 +806,112 @@ class FfsInfStatement(FfsInfStatementClassObject): elif self.ShadowFromInfFile is not None:=0D NoStrip =3D self.ShadowFromInfFile=0D =0D - if FileList !=3D [] :=0D + if FileList !=3D []:=0D for File in FileList:=0D =0D - SecNum =3D '%d' %Index=0D - GenSecOutputFile=3D self.__ExtendMacro__(Rule.NameGuid) + = \=0D - SectionSuffix[SectionType] + SUP_MODULE_SEC = + SecNum=0D + SecNum =3D '%d' % Index=0D + GenSecOutputFile =3D self.__ExtendMacro__(Rule.NameGuid) += \=0D + SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum=0D Index =3D Index + 1=0D OutputFile =3D os.path.join(self.OutputPath, GenSecOutputF= ile)=0D - File =3D GenFdsGlobalVariable.MacroExtend(File, Dict, self= .CurrentArch)=0D + File =3D GenFdsGlobalVariable.MacroExtend(=0D + File, Dict, self.CurrentArch)=0D =0D - #Get PE Section alignment when align is set to AUTO=0D + # Get PE Section alignment when align is set to AUTO=0D if self.Alignment =3D=3D 'Auto' and (SectionType =3D=3D BI= NARY_FILE_TYPE_PE32 or SectionType =3D=3D BINARY_FILE_TYPE_TE):=0D - ImageObj =3D PeImageClass (File)=0D + ImageObj =3D PeImageClass(File)=0D if ImageObj.SectionAlignment < 0x400:=0D - self.Alignment =3D str (ImageObj.SectionAlignment)= =0D + self.Alignment =3D str(ImageObj.SectionAlignment)= =0D elif ImageObj.SectionAlignment < 0x100000:=0D - self.Alignment =3D str (ImageObj.SectionAlignment = // 0x400) + 'K'=0D + self.Alignment =3D str(=0D + ImageObj.SectionAlignment // 0x400) + 'K'=0D else:=0D - self.Alignment =3D str (ImageObj.SectionAlignment = // 0x100000) + 'M'=0D + self.Alignment =3D str(=0D + ImageObj.SectionAlignment // 0x100000) + 'M'=0D =0D if not NoStrip:=0D - FileBeforeStrip =3D os.path.join(self.OutputPath, Modu= leName + '.reloc')=0D + FileBeforeStrip =3D os.path.join(=0D + self.OutputPath, ModuleName + '.reloc')=0D if not os.path.exists(FileBeforeStrip) or \=0D - (os.path.getmtime(File) > os.path.getmtime(File= BeforeStrip)):=0D + (os.path.getmtime(File) > os.path.getmtime(Fil= eBeforeStrip)):=0D CopyLongFilePath(File, FileBeforeStrip)=0D - StrippedFile =3D os.path.join(self.OutputPath, ModuleN= ame + '.stipped')=0D + StrippedFile =3D os.path.join(=0D + self.OutputPath, ModuleName + '.stipped')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - StrippedFile,=0D - [File],=0D - Strip=3DTrue,=0D - IsMakefile=3DIsMakefile=0D - )=0D + StrippedFile,=0D + [File],=0D + Strip=3DTrue,=0D + IsMakefile=3DIsMakefile=0D + )=0D File =3D StrippedFile=0D =0D if SectionType =3D=3D BINARY_FILE_TYPE_TE:=0D - TeFile =3D os.path.join( self.OutputPath, self.ModuleG= uid + 'Te.raw')=0D + TeFile =3D os.path.join(=0D + self.OutputPath, self.ModuleGuid + 'Te.raw')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - TeFile,=0D - [File],=0D - Type=3D'te',=0D - IsMakefile=3DIsMakefile=0D - )=0D + TeFile,=0D + [File],=0D + Type=3D'te',=0D + IsMakefile=3DIsMakefile=0D + )=0D File =3D TeFile=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [File], S= ection.Section.SectionType[SectionType], IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(=0D + OutputFile, [File], Section.Section.SectionType[Sectio= nType], IsMakefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D else:=0D - SecNum =3D '%d' %Index=0D - GenSecOutputFile=3D self.__ExtendMacro__(Rule.NameGuid) + \=0D - SectionSuffix[SectionType] + SUP_MODULE_SEC = + SecNum=0D + SecNum =3D '%d' % Index=0D + GenSecOutputFile =3D self.__ExtendMacro__(Rule.NameGuid) + \=0D + SectionSuffix[SectionType] + SUP_MODULE_SEC + SecNum=0D OutputFile =3D os.path.join(self.OutputPath, GenSecOutputFile)= =0D - GenSecInputFile =3D GenFdsGlobalVariable.MacroExtend(GenSecInp= utFile, Dict, self.CurrentArch)=0D + GenSecInputFile =3D GenFdsGlobalVariable.MacroExtend(=0D + GenSecInputFile, Dict, self.CurrentArch)=0D =0D - #Get PE Section alignment when align is set to AUTO=0D + # Get PE Section alignment when align is set to AUTO=0D if self.Alignment =3D=3D 'Auto' and (SectionType =3D=3D BINARY= _FILE_TYPE_PE32 or SectionType =3D=3D BINARY_FILE_TYPE_TE):=0D - ImageObj =3D PeImageClass (GenSecInputFile)=0D + ImageObj =3D PeImageClass(GenSecInputFile)=0D if ImageObj.SectionAlignment < 0x400:=0D - self.Alignment =3D str (ImageObj.SectionAlignment)=0D + self.Alignment =3D str(ImageObj.SectionAlignment)=0D elif ImageObj.SectionAlignment < 0x100000:=0D - self.Alignment =3D str (ImageObj.SectionAlignment // 0= x400) + 'K'=0D + self.Alignment =3D str(=0D + ImageObj.SectionAlignment // 0x400) + 'K'=0D else:=0D - self.Alignment =3D str (ImageObj.SectionAlignment // 0= x100000) + 'M'=0D + self.Alignment =3D str(=0D + ImageObj.SectionAlignment // 0x100000) + 'M'=0D =0D if not NoStrip:=0D - FileBeforeStrip =3D os.path.join(self.OutputPath, ModuleNa= me + '.reloc')=0D + FileBeforeStrip =3D os.path.join(=0D + self.OutputPath, ModuleName + '.reloc')=0D if not os.path.exists(FileBeforeStrip) or \=0D - (os.path.getmtime(GenSecInputFile) > os.path.getmti= me(FileBeforeStrip)):=0D + (os.path.getmtime(GenSecInputFile) > os.path.getmt= ime(FileBeforeStrip)):=0D CopyLongFilePath(GenSecInputFile, FileBeforeStrip)=0D =0D - StrippedFile =3D os.path.join(self.OutputPath, ModuleName = + '.stipped')=0D + StrippedFile =3D os.path.join(=0D + self.OutputPath, ModuleName + '.stipped')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - StrippedFile,=0D - [GenSecInputFile],=0D - Strip=3DTrue,=0D - IsMakefile=3DIsMakefile=0D - )=0D + StrippedFile,=0D + [GenSecInputFile],=0D + Strip=3DTrue,=0D + IsMakefile=3DIsMakefile=0D + )=0D GenSecInputFile =3D StrippedFile=0D =0D if SectionType =3D=3D BINARY_FILE_TYPE_TE:=0D - TeFile =3D os.path.join( self.OutputPath, self.ModuleGuid = + 'Te.raw')=0D + TeFile =3D os.path.join(=0D + self.OutputPath, self.ModuleGuid + 'Te.raw')=0D GenFdsGlobalVariable.GenerateFirmwareImage(=0D - TeFile,=0D - [GenSecInputFile],=0D - Type=3D'te',=0D - IsMakefile=3DIsMakefile=0D - )=0D + TeFile,=0D + [GenSecInputFile],=0D + Type=3D'te',=0D + IsMakefile=3DIsMakefile=0D + )=0D GenSecInputFile =3D TeFile=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [GenSecInputF= ile], Section.Section.SectionType[SectionType], IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(OutputFile, [=0D + GenSecInputFile], Section= .Section.SectionType[SectionType], IsMakefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D =0D return OutputFileList=0D =0D - ## __GenSimpleFileFfs__() method=0D + # __GenSimpleFileFfs__() method=0D #=0D # Generate FFS=0D #=0D @@ -858,11 +920,11 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param InputFileList The output file list from GenSection= =0D # @retval string Generated FFS file name=0D #=0D - def __GenSimpleFileFfs__(self, Rule, InputFileList, MakefilePath =3D N= one):=0D - FfsOutput =3D self.OutputPath + \=0D - os.sep + \=0D - self.__ExtendMacro__(Rule.NameGuid) + \=0D - '.ffs'=0D + def __GenSimpleFileFfs__(self, Rule, InputFileList, MakefilePath=3DNon= e):=0D + FfsOutput =3D self.OutputPath + \=0D + os.sep + \=0D + self.__ExtendMacro__(Rule.NameGuid) + \=0D + '.ffs'=0D =0D GenFdsGlobalVariable.VerboseLogger(self.__ExtendMacro__(Rule.NameG= uid))=0D InputSection =3D []=0D @@ -874,14 +936,14 @@ class FfsInfStatement(FfsInfStatementClassObject): if Rule.NameGuid is not None and Rule.NameGuid.startswith('PCD('):= =0D PcdValue =3D GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)=0D if len(PcdValue) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' = \=0D - % (Rule.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.'= =0D + % (Rule.NameGuid))=0D if PcdValue.startswith('{'):=0D PcdValue =3D GuidStructureByteArrayToGuidString(PcdValue)= =0D RegistryGuidStr =3D PcdValue=0D if len(RegistryGuidStr) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.' \=0D - % (Rule.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.'=0D + % (Rule.NameGuid))=0D self.ModuleGuid =3D RegistryGuidStr=0D =0D GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputSection,=0D @@ -893,7 +955,7 @@ class FfsInfStatement(FfsInfStatementClassObject): )=0D return FfsOutput=0D =0D - ## __GenComplexFileSection__() method=0D + # __GenComplexFileSection__() method=0D #=0D # Generate section by sections in Rule=0D #=0D @@ -903,7 +965,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param FvParentAddr Parent Fv base address=0D # @retval string File name of the generated section file=0D #=0D - def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr, I= sMakefile =3D False):=0D + def __GenComplexFileSection__(self, Rule, FvChildAddr, FvParentAddr, I= sMakefile=3DFalse):=0D if self.ModuleType in (SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MO= DULE_PEIM, SUP_MODULE_MM_CORE_STANDALONE):=0D if Rule.KeepReloc is not None:=0D self.KeepRelocFromRule =3D Rule.KeepReloc=0D @@ -913,33 +975,39 @@ class FfsInfStatement(FfsInfStatementClassObject): HasGeneratedFlag =3D False=0D if self.PcdIsDriver =3D=3D 'PEI_PCD_DRIVER':=0D if self.IsBinaryModule:=0D - PcdExDbFileName =3D os.path.join(GenFdsGlobalVariable.FvDi= r, "PEIPcdDataBase.raw")=0D + PcdExDbFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, "PEIPcdDataBase.raw")=0D else:=0D - PcdExDbFileName =3D os.path.join(self.EfiOutputPath, "PEIP= cdDataBase.raw")=0D - PcdExDbSecName =3D os.path.join(self.OutputPath, "PEIPcdDataBa= seSec.raw")=0D + PcdExDbFileName =3D os.path.join(=0D + self.EfiOutputPath, "PEIPcdDataBase.raw")=0D + PcdExDbSecName =3D os.path.join(=0D + self.OutputPath, "PEIPcdDataBaseSec.raw")=0D GenFdsGlobalVariable.GenerateSection(PcdExDbSecName,=0D [PcdExDbFileName],=0D "EFI_SECTION_RAW",=0D - IsMakefile =3D IsMakefile= =0D + IsMakefile=3DIsMakefile=0D )=0D SectFiles.append(PcdExDbSecName)=0D SectAlignments.append(None)=0D elif self.PcdIsDriver =3D=3D 'DXE_PCD_DRIVER':=0D if self.IsBinaryModule:=0D - PcdExDbFileName =3D os.path.join(GenFdsGlobalVariable.FvDi= r, "DXEPcdDataBase.raw")=0D + PcdExDbFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, "DXEPcdDataBase.raw")=0D else:=0D - PcdExDbFileName =3D os.path.join(self.EfiOutputPath, "DXEP= cdDataBase.raw")=0D - PcdExDbSecName =3D os.path.join(self.OutputPath, "DXEPcdDataBa= seSec.raw")=0D + PcdExDbFileName =3D os.path.join(=0D + self.EfiOutputPath, "DXEPcdDataBase.raw")=0D + PcdExDbSecName =3D os.path.join(=0D + self.OutputPath, "DXEPcdDataBaseSec.raw")=0D GenFdsGlobalVariable.GenerateSection(PcdExDbSecName,=0D - [PcdExDbFileName],=0D - "EFI_SECTION_RAW",=0D - IsMakefile =3D IsMakefile= =0D - )=0D + [PcdExDbFileName],=0D + "EFI_SECTION_RAW",=0D + IsMakefile=3DIsMakefile=0D + )=0D SectFiles.append(PcdExDbSecName)=0D SectAlignments.append(None)=0D for Sect in Rule.SectionList:=0D - SecIndex =3D '%d' %Index=0D - SectList =3D []=0D + SecIndex =3D '%d' % Index=0D + SectList =3D []=0D #=0D # Convert Fv Section Type for PI1.1 SMM driver.=0D #=0D @@ -951,7 +1019,8 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D if self.ModuleType =3D=3D SUP_MODULE_DXE_SMM_DRIVER and int(se= lf.PiSpecVersion, 16) < 0x0001000A:=0D if Sect.SectionType =3D=3D BINARY_FILE_TYPE_SMM_DEPEX:=0D - EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Frame= work SMM module doesn't support SMM_DEPEX section type", File=3Dself.InfFil= eName)=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "Framework SMM module doesn't support = SMM_DEPEX section type", File=3Dself.InfFileName)=0D #=0D # process the inside FvImage from FvSection or GuidSection=0D #=0D @@ -964,75 +1033,89 @@ class FfsInfStatement(FfsInfStatementClassObject): Sect.FvParentAddr =3D FvParentAddr=0D =0D if Rule.KeyStringList !=3D []:=0D - SectList, Align =3D Sect.GenSection(self.OutputPath, self.= ModuleGuid, SecIndex, Rule.KeyStringList, self, IsMakefile =3D IsMakefile)= =0D - else :=0D - SectList, Align =3D Sect.GenSection(self.OutputPath, self.= ModuleGuid, SecIndex, self.KeyStringList, self, IsMakefile =3D IsMakefile)= =0D + SectList, Align =3D Sect.GenSection(=0D + self.OutputPath, self.ModuleGuid, SecIndex, Rule.KeySt= ringList, self, IsMakefile=3DIsMakefile)=0D + else:=0D + SectList, Align =3D Sect.GenSection(=0D + self.OutputPath, self.ModuleGuid, SecIndex, self.KeySt= ringList, self, IsMakefile=3DIsMakefile)=0D =0D if not HasGeneratedFlag:=0D UniVfrOffsetFileSection =3D ""=0D - ModuleFileName =3D mws.join(GenFdsGlobalVariable.WorkSpace= Dir, self.InfFileName)=0D - InfData =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(ModuleFileName), self.CurrentArch]=0D + ModuleFileName =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, self.InfFileName)=0D + InfData =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Pat= hClass(=0D + ModuleFileName), self.CurrentArch]=0D #=0D # Search the source list in InfData to find if there are .= vfr file exist.=0D #=0D VfrUniBaseName =3D {}=0D VfrUniOffsetList =3D []=0D for SourceFile in InfData.Sources:=0D - if SourceFile.Type.upper() =3D=3D ".VFR" :=0D + if SourceFile.Type.upper() =3D=3D ".VFR":=0D #=0D # search the .map file to find the offset of vfr b= inary in the PE32+/TE file.=0D #=0D - VfrUniBaseName[SourceFile.BaseName] =3D (SourceFil= e.BaseName + "Bin")=0D - if SourceFile.Type.upper() =3D=3D ".UNI" :=0D + VfrUniBaseName[SourceFile.BaseName] =3D (=0D + SourceFile.BaseName + "Bin")=0D + if SourceFile.Type.upper() =3D=3D ".UNI":=0D #=0D # search the .map file to find the offset of Uni s= trings binary in the PE32+/TE file.=0D #=0D - VfrUniBaseName["UniOffsetName"] =3D (self.BaseName= + "Strings")=0D -=0D + VfrUniBaseName["UniOffsetName"] =3D (=0D + self.BaseName + "Strings")=0D =0D if len(VfrUniBaseName) > 0:=0D if IsMakefile:=0D if InfData.BuildType !=3D 'UEFI_HII':=0D - UniVfrOffsetFileName =3D os.path.join(self.Out= putPath, self.BaseName + '.offset')=0D - UniVfrOffsetFileSection =3D os.path.join(self.= OutputPath, self.BaseName + 'Offset' + '.raw')=0D + UniVfrOffsetFileName =3D os.path.join(=0D + self.OutputPath, self.BaseName + '.offset'= )=0D + UniVfrOffsetFileSection =3D os.path.join(=0D + self.OutputPath, self.BaseName + 'Offset' = + '.raw')=0D UniVfrOffsetFileNameList =3D []=0D - UniVfrOffsetFileNameList.append(UniVfrOffsetFi= leName)=0D - TrimCmd =3D "Trim --Vfr-Uni-Offset -o %s --Mod= uleName=3D%s --DebugDir=3D%s " % (UniVfrOffsetFileName, self.BaseName, self= .EfiDebugPath)=0D + UniVfrOffsetFileNameList.append(=0D + UniVfrOffsetFileName)=0D + TrimCmd =3D "Trim --Vfr-Uni-Offset -o %s --Mod= uleName=3D%s --DebugDir=3D%s " % (=0D + UniVfrOffsetFileName, self.BaseName, self.= EfiDebugPath)=0D GenFdsGlobalVariable.SecCmdList.append(TrimCmd= )=0D GenFdsGlobalVariable.GenerateSection(UniVfrOff= setFileSection,=0D - [UniVfrOff= setFileName],=0D - "EFI_SECTI= ON_RAW",=0D - IsMakefile= =3D True=0D - )=0D + [UniVfrOf= fsetFileName],=0D + "EFI_SECT= ION_RAW",=0D + IsMakefil= e=3DTrue=0D + )=0D else:=0D - VfrUniOffsetList =3D self.__GetBuildOutputMapFileV= frUniInfo(VfrUniBaseName)=0D + VfrUniOffsetList =3D self.__GetBuildOutputMapFileV= frUniInfo(=0D + VfrUniBaseName)=0D #=0D # Generate the Raw data of raw section=0D #=0D if VfrUniOffsetList:=0D - UniVfrOffsetFileName =3D os.path.join(self.Out= putPath, self.BaseName + '.offset')=0D - UniVfrOffsetFileSection =3D os.path.join(self.= OutputPath, self.BaseName + 'Offset' + '.raw')=0D - FfsInfStatement.__GenUniVfrOffsetFile (VfrUniO= ffsetList, UniVfrOffsetFileName)=0D + UniVfrOffsetFileName =3D os.path.join(=0D + self.OutputPath, self.BaseName + '.offset'= )=0D + UniVfrOffsetFileSection =3D os.path.join(=0D + self.OutputPath, self.BaseName + 'Offset' = + '.raw')=0D + FfsInfStatement.__GenUniVfrOffsetFile(=0D + VfrUniOffsetList, UniVfrOffsetFileName)=0D UniVfrOffsetFileNameList =3D []=0D - UniVfrOffsetFileNameList.append(UniVfrOffsetFi= leName)=0D + UniVfrOffsetFileNameList.append(=0D + UniVfrOffsetFileName)=0D """Call GenSection"""=0D =0D GenFdsGlobalVariable.GenerateSection(UniVfrOff= setFileSection,=0D UniVfrOff= setFileNameList,=0D "EFI_SECT= ION_RAW"=0D )=0D - #os.remove(UniVfrOffsetFileName)=0D + # os.remove(UniVfrOffsetFileName)=0D if UniVfrOffsetFileSection:=0D SectList.append(UniVfrOffsetFileSection)=0D HasGeneratedFlag =3D True=0D =0D - for SecName in SectList :=0D + for SecName in SectList:=0D SectFiles.append(SecName)=0D SectAlignments.append(Align)=0D Index =3D Index + 1=0D return SectFiles, SectAlignments=0D =0D - ## __GenComplexFileFfs__() method=0D + # __GenComplexFileFfs__() method=0D #=0D # Generate FFS=0D #=0D @@ -1041,32 +1124,32 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param InputFileList The output file list from GenSection= =0D # @retval string Generated FFS file name=0D #=0D - def __GenComplexFileFfs__(self, Rule, InputFile, Alignments, MakefileP= ath =3D None):=0D + def __GenComplexFileFfs__(self, Rule, InputFile, Alignments, MakefileP= ath=3DNone):=0D =0D if Rule.NameGuid is not None and Rule.NameGuid.startswith('PCD('):= =0D PcdValue =3D GenFdsGlobalVariable.GetPcdValue(Rule.NameGuid)=0D if len(PcdValue) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' = \=0D - % (Rule.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.'= =0D + % (Rule.NameGuid))=0D if PcdValue.startswith('{'):=0D PcdValue =3D GuidStructureByteArrayToGuidString(PcdValue)= =0D RegistryGuidStr =3D PcdValue=0D if len(RegistryGuidStr) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.' \=0D - % (Rule.NameGuid))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, 'GUID value for %s= in wrong format.'=0D + % (Rule.NameGuid))=0D self.ModuleGuid =3D RegistryGuidStr=0D =0D - FfsOutput =3D os.path.join( self.OutputPath, self.ModuleGuid + '.f= fs')=0D + FfsOutput =3D os.path.join(self.OutputPath, self.ModuleGuid + '.ff= s')=0D GenFdsGlobalVariable.GenerateFfs(FfsOutput, InputFile,=0D - FdfFvFileTypeToFileType[Rule.= FvFileType],=0D - self.ModuleGuid, Fixed=3DRule= .Fixed,=0D - CheckSum=3DRule.CheckSum, Ali= gn=3DRule.Alignment,=0D - SectionAlign=3DAlignments,=0D - MakefilePath=3DMakefilePath=0D - )=0D + FdfFvFileTypeToFileType[Rule.FvFi= leType],=0D + self.ModuleGuid, Fixed=3DRule.Fix= ed,=0D + CheckSum=3DRule.CheckSum, Align= =3DRule.Alignment,=0D + SectionAlign=3DAlignments,=0D + MakefilePath=3DMakefilePath=0D + )=0D return FfsOutput=0D =0D - ## __GetBuildOutputMapFileVfrUniInfo() method=0D + # __GetBuildOutputMapFileVfrUniInfo() method=0D #=0D # Find the offset of UNI/INF object offset in the EFI image file.=0D #=0D @@ -1079,7 +1162,7 @@ class FfsInfStatement(FfsInfStatementClassObject): EfiFileName =3D os.path.join(self.EfiOutputPath, self.BaseName + "= .efi")=0D return GetVariableOffset(MapFileName, EfiFileName, list(VfrUniBase= Name.values()))=0D =0D - ## __GenUniVfrOffsetFile() method=0D + # __GenUniVfrOffsetFile() method=0D #=0D # Generate the offset file for the module which contain VFR or UNI f= ile.=0D #=0D @@ -1101,8 +1184,8 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D UniGuid =3D b'\xe0\xc5\x13\x89\xf63\x86M\x9b\xf1C\xef\x89\= xfc\x06f'=0D fStringIO.write(UniGuid)=0D - UniValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (UniValue)=0D + UniValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(UniValue)=0D else:=0D #=0D # VFR binary offset in image.=0D @@ -1111,18 +1194,17 @@ class FfsInfStatement(FfsInfStatementClassObject): #=0D VfrGuid =3D b'\xb4|\xbc\xd0Gj_I\xaa\x11q\x07F\xda\x06\xa2'= =0D fStringIO.write(VfrGuid)=0D - type (Item[1])=0D - VfrValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (VfrValue)=0D + type(Item[1])=0D + VfrValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(VfrValue)=0D =0D #=0D # write data into file.=0D #=0D - try :=0D + try:=0D SaveFileOnChange(UniVfrOffsetFileName, fStringIO.getvalue())=0D except:=0D - 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)=0D -=0D - fStringIO.close ()=0D -=0D + EdkLogger.error("GenFds", FILE_WRITE_FAILURE,=0D + "Write data to file %s failed, please check wh= ether the file been locked or using by other applications." % UniVfrOffsetF= ileName, None)=0D =0D + fStringIO.close()=0D diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python= /GenFds/Fv.py index 16c944a0bd79..578b1ad0e196 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FV generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -23,11 +23,13 @@ from Common.DataType import * =0D FV_UI_EXT_ENTY_GUID =3D 'A67DF1FA-8DE8-4E98-AF09-4BDF2EFFBC7C'=0D =0D -## generate FV=0D +# generate FV=0D #=0D #=0D +=0D +=0D class FV (object):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -58,7 +60,7 @@ class FV (object): self.FvExtEntryTypeValue =3D []=0D self.FvExtEntryType =3D []=0D self.FvExtEntryData =3D []=0D - ## AddToBuffer()=0D + # AddToBuffer()=0D #=0D # Generate Fv and add it to the Buffer=0D #=0D @@ -71,7 +73,8 @@ class FV (object): # @param MacroDict macro value pair=0D # @retval string Generated FV file path=0D #=0D - def AddToBuffer (self, Buffer, BaseAddress=3DNone, BlockSize=3D None, = BlockNum=3DNone, ErasePloarity=3D'1', MacroDict =3D None, Flag=3DFalse):=0D +=0D + def AddToBuffer(self, Buffer, BaseAddress=3DNone, BlockSize=3DNone, Bl= ockNum=3DNone, ErasePloarity=3D'1', MacroDict=3DNone, Flag=3DFalse):=0D if BaseAddress is None and self.UiFvName.upper() + 'fv' in GenFdsG= lobalVariable.ImageBinDict:=0D return GenFdsGlobalVariable.ImageBinDict[self.UiFvName.upper()= + 'fv']=0D if MacroDict is None:=0D @@ -91,16 +94,19 @@ class FV (object): elif RegionData.upper() + 'fv' in GenFdsGlobal= Variable.ImageBinDict:=0D continue=0D elif self.UiFvName.upper() =3D=3D RegionData.u= pper():=0D - GenFdsGlobalVariable.ErrorLogger("Capsule = %s in FD region can't contain a FV %s in FD region." % (self.CapsuleName, s= elf.UiFvName.upper()))=0D + GenFdsGlobalVariable.ErrorLogger("Capsule = %s in FD region can't contain a FV %s in FD region." % (=0D + self.CapsuleName, self.UiFvName.upper(= )))=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger( "\nGenerating %s FV" %self.UiF= vName)=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nGenerating %s FV" % self.UiFvName)=0D GenFdsGlobalVariable.LargeFileInFvFlags.append(False)=0D FFSGuid =3D None=0D =0D if self.FvBaseAddress is not None:=0D BaseAddress =3D self.FvBaseAddress=0D if not Flag:=0D - self._InitializeInf(BaseAddress, BlockSize, BlockNum, ErasePlo= arity)=0D + self._InitializeInf(BaseAddress, BlockSize,=0D + BlockNum, ErasePloarity)=0D #=0D # First Process the Apriori section=0D #=0D @@ -109,13 +115,14 @@ class FV (object): GenFdsGlobalVariable.VerboseLogger('First generate Apriori file !'= )=0D FfsFileList =3D []=0D for AprSection in self.AprioriSectionList:=0D - FileName =3D AprSection.GenFfs (self.UiFvName, MacroDict, IsMa= kefile=3DFlag)=0D + FileName =3D AprSection.GenFfs(=0D + self.UiFvName, MacroDict, IsMakefile=3DFlag)=0D FfsFileList.append(FileName)=0D # Add Apriori file name to Inf file=0D if not Flag:=0D - self.FvInfFile.append("EFI_FILE_NAME =3D " + \=0D - FileName + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_FILE_NAME =3D " +=0D + FileName +=0D + TAB_LINE_BREAK)=0D =0D # Process Modules in FfsList=0D for FfsFile in self.FfsList:=0D @@ -124,12 +131,13 @@ class FV (object): continue=0D if GenFdsGlobalVariable.EnableGenfdsMultiThread and GenFdsGlob= alVariable.ModuleFile and GenFdsGlobalVariable.ModuleFile.Path.find(os.path= .normpath(FfsFile.InfFileName)) =3D=3D -1:=0D continue=0D - FileName =3D FfsFile.GenFfs(MacroDict, FvParentAddr=3DBaseAddr= ess, IsMakefile=3DFlag, FvName=3Dself.UiFvName)=0D + FileName =3D FfsFile.GenFfs(=0D + MacroDict, FvParentAddr=3DBaseAddress, IsMakefile=3DFlag, = FvName=3Dself.UiFvName)=0D FfsFileList.append(FileName)=0D if not Flag:=0D - self.FvInfFile.append("EFI_FILE_NAME =3D " + \=0D - FileName + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_FILE_NAME =3D " +=0D + FileName +=0D + TAB_LINE_BREAK)=0D if not Flag:=0D FvInfFile =3D ''.join(self.FvInfFile)=0D SaveFileOnChange(self.InfFileName, FvInfFile, False)=0D @@ -143,28 +151,31 @@ class FV (object): FvOutputFile =3D self.CreateFileName=0D =0D if Flag:=0D - GenFdsGlobalVariable.ImageBinDict[self.UiFvName.upper() + 'fv'= ] =3D FvOutputFile=0D + GenFdsGlobalVariable.ImageBinDict[self.UiFvName.upper(=0D + ) + 'fv'] =3D FvOutputFile=0D return FvOutputFile=0D =0D - FvInfoFileName =3D os.path.join(GenFdsGlobalVariable.FfsDir, self.= UiFvName + '.inf')=0D + FvInfoFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FfsDir, self.UiFvName + '.inf')=0D if not Flag:=0D - CopyLongFilePath(GenFdsGlobalVariable.FvAddressFileName, FvInf= oFileName)=0D + CopyLongFilePath(=0D + GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)=0D OrigFvInfo =3D None=0D - if os.path.exists (FvInfoFileName):=0D + if os.path.exists(FvInfoFileName):=0D OrigFvInfo =3D open(FvInfoFileName, 'r').read()=0D if GenFdsGlobalVariable.LargeFileInFvFlags[-1]:=0D FFSGuid =3D GenFdsGlobalVariable.EFI_FIRMWARE_FILE_SYSTEM3= _GUID=0D GenFdsGlobalVariable.GenerateFirmwareVolume(=0D - FvOutputFile,=0D - [self.InfFileName],=0D - AddressFile=3DFvInfoFileName,=0D - FfsList=3DFfsFileList,=0D - ForceRebase=3Dself.FvForceRebase,=0D - FileSystemGuid=3DFFSGuid=0D - )=0D + FvOutputFile,=0D + [self.InfFileName],=0D + AddressFile=3DFvInfoFileName,=0D + FfsList=3DFfsFileList,=0D + ForceRebase=3Dself.FvForceRebase,=0D + FileSystemGuid=3DFFSGuid=0D + )=0D =0D NewFvInfo =3D None=0D - if os.path.exists (FvInfoFileName):=0D + if os.path.exists(FvInfoFileName):=0D NewFvInfo =3D open(FvInfoFileName, 'r').read()=0D if NewFvInfo is not None and NewFvInfo !=3D OrigFvInfo:=0D FvChildAddr =3D []=0D @@ -173,28 +184,29 @@ class FV (object): AddrKeyFound =3D False=0D for AddrString in AddrStrings:=0D if AddrKeyFound:=0D - #get base address for the inside FvImage=0D - FvChildAddr.append (AddrString)=0D - elif AddrString.find ("[FV_BASE_ADDRESS]") !=3D -1:=0D + # get base address for the inside FvImage=0D + FvChildAddr.append(AddrString)=0D + elif AddrString.find("[FV_BASE_ADDRESS]") !=3D -1:=0D AddrKeyFound =3D True=0D AddFileObj.close()=0D =0D if FvChildAddr !=3D []:=0D # Update Ffs again=0D for FfsFile in self.FfsList:=0D - FileName =3D FfsFile.GenFfs(MacroDict, FvChildAddr= , BaseAddress, IsMakefile=3DFlag, FvName=3Dself.UiFvName)=0D + FileName =3D FfsFile.GenFfs(=0D + MacroDict, FvChildAddr, BaseAddress, IsMakefil= e=3DFlag, FvName=3Dself.UiFvName)=0D =0D if GenFdsGlobalVariable.LargeFileInFvFlags[-1]:=0D - FFSGuid =3D GenFdsGlobalVariable.EFI_FIRMWARE_FILE= _SYSTEM3_GUID;=0D - #Update GenFv again=0D + FFSGuid =3D GenFdsGlobalVariable.EFI_FIRMWARE_FILE= _SYSTEM3_GUID=0D + # Update GenFv again=0D GenFdsGlobalVariable.GenerateFirmwareVolume(=0D - FvOutputFile,=0D - [self.InfFileName],=0D - AddressFile=3DFvInfoFileNa= me,=0D - FfsList=3DFfsFileList,=0D - ForceRebase=3Dself.FvForce= Rebase,=0D - FileSystemGuid=3DFFSGuid=0D - )=0D + FvOutputFile,=0D + [self.InfFileName],=0D + AddressFile=3DFvInfoFileName,=0D + FfsList=3DFfsFileList,=0D + ForceRebase=3Dself.FvForceRebase,=0D + FileSystemGuid=3DFFSGuid=0D + )=0D =0D #=0D # Write the Fv contents to Buffer=0D @@ -205,35 +217,42 @@ class FV (object): FvHeaderBuffer =3D FvFileObj.read(0x48)=0D Signature =3D FvHeaderBuffer[0x28:0x32]=0D if Signature and Signature.startswith(b'_FVH'):=0D - GenFdsGlobalVariable.VerboseLogger("\nGenerate %s FV S= uccessfully" % self.UiFvName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "\nGenerate %s FV Successfully" % self.UiFvName)=0D GenFdsGlobalVariable.SharpCounter =3D 0=0D =0D FvFileObj.seek(0)=0D Buffer.write(FvFileObj.read())=0D # FV alignment position.=0D - FvAlignmentValue =3D 1 << (ord(FvHeaderBuffer[0x2E:0x2= F]) & 0x1F)=0D + FvAlignmentValue =3D 1 << (=0D + ord(FvHeaderBuffer[0x2E:0x2F]) & 0x1F)=0D if FvAlignmentValue >=3D 0x400:=0D if FvAlignmentValue >=3D 0x100000:=0D if FvAlignmentValue >=3D 0x1000000:=0D - #The max alignment supported by FFS is 16M.=0D + # The max alignment supported by FFS is 16= M.=0D self.FvAlignment =3D "16M"=0D else:=0D - self.FvAlignment =3D str(FvAlignmentValue = // 0x100000) + "M"=0D + self.FvAlignment =3D str(=0D + FvAlignmentValue // 0x100000) + "M"=0D else:=0D - self.FvAlignment =3D str(FvAlignmentValue // 0= x400) + "K"=0D + self.FvAlignment =3D str(=0D + FvAlignmentValue // 0x400) + "K"=0D else:=0D # FvAlignmentValue is less than 1K=0D - self.FvAlignment =3D str (FvAlignmentValue)=0D + self.FvAlignment =3D str(FvAlignmentValue)=0D FvFileObj.close()=0D - GenFdsGlobalVariable.ImageBinDict[self.UiFvName.upper(= ) + 'fv'] =3D FvOutputFile=0D + GenFdsGlobalVariable.ImageBinDict[self.UiFvName.upper(= =0D + ) + 'fv'] =3D FvOutputFile=0D GenFdsGlobalVariable.LargeFileInFvFlags.pop()=0D else:=0D - GenFdsGlobalVariable.ErrorLogger("Invalid FV file %s."= % self.UiFvName)=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "Invalid FV file %s." % self.UiFvName)=0D else:=0D - GenFdsGlobalVariable.ErrorLogger("Failed to generate %s FV= file." %self.UiFvName)=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "Failed to generate %s FV file." % self.UiFvName)=0D return FvOutputFile=0D =0D - ## _GetBlockSize()=0D + # _GetBlockSize()=0D #=0D # Calculate FV's block size=0D # Inherit block size from FD if no block size specified in FV=0D @@ -256,7 +275,7 @@ class FV (object): return True=0D return False=0D =0D - ## _InitializeInf()=0D + # _InitializeInf()=0D #=0D # Initialize the inf file to create FV=0D #=0D @@ -266,12 +285,12 @@ class FV (object): # @param BlockNum How many blocks in FV=0D # @param ErasePolarity Flash erase polarity=0D #=0D - def _InitializeInf (self, BaseAddress =3D None, BlockSize=3D None, Blo= ckNum =3D None, ErasePloarity=3D'1'):=0D + def _InitializeInf(self, BaseAddress=3DNone, BlockSize=3DNone, BlockNu= m=3DNone, ErasePloarity=3D'1'):=0D #=0D # Create FV inf file=0D #=0D self.InfFileName =3D os.path.join(GenFdsGlobalVariable.FvDir,=0D - self.UiFvName + '.inf')=0D + self.UiFvName + '.inf')=0D self.FvInfFile =3D []=0D =0D #=0D @@ -279,79 +298,81 @@ class FV (object): #=0D self.FvInfFile.append("[options]" + TAB_LINE_BREAK)=0D if BaseAddress is not None:=0D - self.FvInfFile.append("EFI_BASE_ADDRESS =3D " + \=0D - BaseAddress + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_BASE_ADDRESS =3D " +=0D + BaseAddress +=0D + TAB_LINE_BREAK)=0D =0D if BlockSize is not None:=0D - self.FvInfFile.append("EFI_BLOCK_SIZE =3D " + \=0D - '0x%X' %BlockSize + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_BLOCK_SIZE =3D " +=0D + '0x%X' % BlockSize +=0D + TAB_LINE_BREAK)=0D if BlockNum is not None:=0D - self.FvInfFile.append("EFI_NUM_BLOCKS =3D " + \=0D - ' 0x%X' %BlockNum + \=0D + self.FvInfFile.append("EFI_NUM_BLOCKS =3D " +=0D + ' 0x%X' % BlockNum +=0D TAB_LINE_BREAK)=0D else:=0D if self.BlockSizeList =3D=3D []:=0D if not self._GetBlockSize():=0D - #set default block size is 1=0D - self.FvInfFile.append("EFI_BLOCK_SIZE =3D 0x1" + TAB_= LINE_BREAK)=0D + # set default block size is 1=0D + self.FvInfFile.append(=0D + "EFI_BLOCK_SIZE =3D 0x1" + TAB_LINE_BREAK)=0D =0D for BlockSize in self.BlockSizeList:=0D if BlockSize[0] is not None:=0D - self.FvInfFile.append("EFI_BLOCK_SIZE =3D " + \=0D - '0x%X' %BlockSize[0] + \=0D + self.FvInfFile.append("EFI_BLOCK_SIZE =3D " +=0D + '0x%X' % BlockSize[0] +=0D TAB_LINE_BREAK)=0D =0D if BlockSize[1] is not None:=0D - self.FvInfFile.append("EFI_NUM_BLOCKS =3D " + \=0D - ' 0x%X' %BlockSize[1] + \=0D + self.FvInfFile.append("EFI_NUM_BLOCKS =3D " +=0D + ' 0x%X' % BlockSize[1] +=0D TAB_LINE_BREAK)=0D =0D if self.BsBaseAddress is not None:=0D - self.FvInfFile.append('EFI_BOOT_DRIVER_BASE_ADDRESS =3D ' + \= =0D - '0x%X' %self.BsBaseAddress)=0D + self.FvInfFile.append('EFI_BOOT_DRIVER_BASE_ADDRESS =3D ' +=0D + '0x%X' % self.BsBaseAddress)=0D if self.RtBaseAddress is not None:=0D - self.FvInfFile.append('EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D ' += \=0D - '0x%X' %self.RtBaseAddress)=0D + self.FvInfFile.append('EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D ' += =0D + '0x%X' % self.RtBaseAddress)=0D #=0D # Add attribute=0D #=0D self.FvInfFile.append("[attributes]" + TAB_LINE_BREAK)=0D =0D - self.FvInfFile.append("EFI_ERASE_POLARITY =3D " + \=0D - ' %s' %ErasePloarity + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_ERASE_POLARITY =3D " +=0D + ' %s' % ErasePloarity +=0D + TAB_LINE_BREAK)=0D if not (self.FvAttributeDict is None):=0D for FvAttribute in self.FvAttributeDict.keys():=0D if FvAttribute =3D=3D "FvUsedSizeEnable":=0D if self.FvAttributeDict[FvAttribute].upper() in ('TRUE= ', '1'):=0D self.UsedSizeEnable =3D True=0D continue=0D - self.FvInfFile.append("EFI_" + \=0D - FvAttribute + \=0D - ' =3D ' + \=0D - self.FvAttributeDict[FvAttribute= ] + \=0D - TAB_LINE_BREAK )=0D + self.FvInfFile.append("EFI_" +=0D + FvAttribute +=0D + ' =3D ' +=0D + self.FvAttributeDict[FvAttribute] += =0D + TAB_LINE_BREAK)=0D if self.FvAlignment is not None:=0D - self.FvInfFile.append("EFI_FVB2_ALIGNMENT_" + \=0D - self.FvAlignment.strip() + \=0D - " =3D TRUE" + \=0D - TAB_LINE_BREAK)=0D + self.FvInfFile.append("EFI_FVB2_ALIGNMENT_" +=0D + self.FvAlignment.strip() +=0D + " =3D TRUE" +=0D + TAB_LINE_BREAK)=0D =0D #=0D # Generate FV extension header file=0D #=0D if not self.FvNameGuid:=0D if len(self.FvExtEntryType) > 0 or self.UsedSizeEnable:=0D - GenFdsGlobalVariable.ErrorLogger("FV Extension Header Entr= ies declared for %s with no FvNameGuid declaration." % (self.UiFvName))=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "FV Extension Header Entries declared for %s with no F= vNameGuid declaration." % (self.UiFvName))=0D else:=0D TotalSize =3D 16 + 4=0D Buffer =3D bytearray()=0D if self.UsedSizeEnable:=0D TotalSize +=3D (4 + 4)=0D - ## define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03=0D - #typedef struct=0D + # define EFI_FV_EXT_TYPE_USED_SIZE_TYPE 0x03=0D + # typedef struct=0D # {=0D # EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;=0D # UINT32 UsedSize;=0D @@ -376,34 +397,41 @@ class FV (object): + PackGUID(Guid)=0D + self.UiFvName.encode('utf-8'))=0D =0D - for Index in range (0, len(self.FvExtEntryType)):=0D + for Index in range(0, len(self.FvExtEntryType)):=0D if self.FvExtEntryType[Index] =3D=3D 'FILE':=0D # check if the path is absolute or relative=0D if os.path.isabs(self.FvExtEntryData[Index]):=0D - FileFullPath =3D os.path.normpath(self.FvExtEntryD= ata[Index])=0D + FileFullPath =3D os.path.normpath(=0D + self.FvExtEntryData[Index])=0D else:=0D - FileFullPath =3D os.path.normpath(os.path.join(Gen= FdsGlobalVariable.WorkSpaceDir, self.FvExtEntryData[Index]))=0D + FileFullPath =3D os.path.normpath(os.path.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, self.FvExtE= ntryData[Index]))=0D # check if the file path exists or not=0D if not os.path.isfile(FileFullPath):=0D - GenFdsGlobalVariable.ErrorLogger("Error opening FV= Extension Header Entry file %s." % (self.FvExtEntryData[Index]))=0D - FvExtFile =3D open (FileFullPath, 'rb')=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "Error opening FV Extension Header Entry file = %s." % (self.FvExtEntryData[Index]))=0D + FvExtFile =3D open(FileFullPath, 'rb')=0D FvExtFile.seek(0, 2)=0D Size =3D FvExtFile.tell()=0D if Size >=3D 0x10000:=0D - GenFdsGlobalVariable.ErrorLogger("The size of FV E= xtension Header Entry file %s exceeds 0x10000." % (self.FvExtEntryData[Inde= x]))=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "The size of FV Extension Header Entry file %s= exceeds 0x10000." % (self.FvExtEntryData[Index]))=0D TotalSize +=3D (Size + 4)=0D FvExtFile.seek(0)=0D - Buffer +=3D pack('HH', (Size + 4), int(self.FvExtEntry= TypeValue[Index], 16))=0D + Buffer +=3D pack('HH', (Size + 4),=0D + int(self.FvExtEntryTypeValue[Index], 16= ))=0D Buffer +=3D FvExtFile.read()=0D FvExtFile.close()=0D if self.FvExtEntryType[Index] =3D=3D 'DATA':=0D ByteList =3D self.FvExtEntryData[Index].split(',')=0D - Size =3D len (ByteList)=0D + Size =3D len(ByteList)=0D if Size >=3D 0x10000:=0D - GenFdsGlobalVariable.ErrorLogger("The size of FV E= xtension Header Entry data %s exceeds 0x10000." % (self.FvExtEntryData[Inde= x]))=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "The size of FV Extension Header Entry data %s= exceeds 0x10000." % (self.FvExtEntryData[Index]))=0D TotalSize +=3D (Size + 4)=0D - Buffer +=3D pack('HH', (Size + 4), int(self.FvExtEntry= TypeValue[Index], 16))=0D - for Index1 in range (0, Size):=0D + Buffer +=3D pack('HH', (Size + 4),=0D + int(self.FvExtEntryTypeValue[Index], 16= ))=0D + for Index1 in range(0, Size):=0D Buffer +=3D pack('B', int(ByteList[Index1], 16))=0D =0D Guid =3D self.FvNameGuid.split('-')=0D @@ -413,17 +441,19 @@ class FV (object): # Generate FV extension header file if the total size is not z= ero=0D #=0D if TotalSize > 0:=0D - FvExtHeaderFileName =3D os.path.join(GenFdsGlobalVariable.= FvDir, self.UiFvName + '.ext')=0D + FvExtHeaderFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.UiFvName + '.ext')=0D FvExtHeaderFile =3D BytesIO()=0D FvExtHeaderFile.write(Buffer)=0D - Changed =3D SaveFileOnChange(FvExtHeaderFileName, FvExtHea= derFile.getvalue(), True)=0D + Changed =3D SaveFileOnChange(=0D + FvExtHeaderFileName, FvExtHeaderFile.getvalue(), True)= =0D FvExtHeaderFile.close()=0D if Changed:=0D - if os.path.exists (self.InfFileName):=0D - os.remove (self.InfFileName)=0D - self.FvInfFile.append("EFI_FV_EXT_HEADER_FILE_NAME =3D " = + \=0D - FvExtHeaderFileName = + \=0D - TAB_LINE_BREAK)=0D + if os.path.exists(self.InfFileName):=0D + os.remove(self.InfFileName)=0D + self.FvInfFile.append("EFI_FV_EXT_HEADER_FILE_NAME =3D " += =0D + FvExtHeaderFileName +=0D + TAB_LINE_BREAK)=0D =0D #=0D # Add [Files]=0D diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/S= ource/Python/GenFds/FvImageSection.py index ff2d5ca3c053..4fade8d888ea 100644 --- a/BaseTools/Source/Python/GenFds/FvImageSection.py +++ b/BaseTools/Source/Python/GenFds/FvImageSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FV image section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -22,19 +22,21 @@ from Common import EdkLogger from Common.BuildToolError import *=0D from Common.DataType import *=0D =0D -## generate FV image section=0D +# generate FV image section=0D #=0D #=0D +=0D +=0D class FvImageSection(FvImageSectionClassObject):=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D FvImageSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate FV image section=0D #=0D @@ -47,14 +49,15 @@ class FvImageSection(FvImageSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name, section alignment)=0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf =3D None, Dict =3D None, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D =0D OutputFileList =3D []=0D if Dict is None:=0D Dict =3D {}=0D if self.FvFileType is not None:=0D - FileList, IsSect =3D Section.Section.GetFileList(FfsInf, self.= FvFileType, self.FvFileExtension)=0D - if IsSect :=0D + FileList, IsSect =3D Section.Section.GetFileList(=0D + FfsInf, self.FvFileType, self.FvFileExtension)=0D + if IsSect:=0D return FileList, self.Alignment=0D =0D Num =3D SecNum=0D @@ -63,36 +66,39 @@ class FvImageSection(FvImageSectionClassObject): for FvFileName in FileList:=0D FvAlignmentValue =3D 0=0D if os.path.isfile(FvFileName):=0D - FvFileObj =3D open (FvFileName, 'rb')=0D + FvFileObj =3D open(FvFileName, 'rb')=0D FvFileObj.seek(0)=0D # PI FvHeader is 0x48 byte=0D FvHeaderBuffer =3D FvFileObj.read(0x48)=0D # FV alignment position.=0D if isinstance(FvHeaderBuffer[0x2E], str):=0D - FvAlignmentValue =3D 1 << (ord(FvHeaderBuffer[0x2E= ]) & 0x1F)=0D + FvAlignmentValue =3D 1 << (=0D + ord(FvHeaderBuffer[0x2E]) & 0x1F)=0D else:=0D FvAlignmentValue =3D 1 << (FvHeaderBuffer[0x2E] & = 0x1F)=0D FvFileObj.close()=0D if FvAlignmentValue > MaxFvAlignment:=0D MaxFvAlignment =3D FvAlignmentValue=0D =0D - OutputFile =3D os.path.join(OutputPath, ModuleName + SUP_M= ODULE_SEC + Num + SectionSuffix.get("FV_IMAGE"))=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileNa= me], 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE', IsMakefile=3DIsMakefile)=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + Num + Sectio= nSuffix.get("FV_IMAGE"))=0D + GenFdsGlobalVariable.GenerateSection(=0D + OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME= _IMAGE', IsMakefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D =0D # MaxFvAlignment is larger than or equal to 1K=0D if MaxFvAlignment >=3D 0x400:=0D if MaxFvAlignment >=3D 0x100000:=0D - #The max alignment supported by FFS is 16M.=0D + # The max alignment supported by FFS is 16M.=0D if MaxFvAlignment >=3D 0x1000000:=0D self.Alignment =3D "16M"=0D else:=0D self.Alignment =3D str(MaxFvAlignment // 0x100000)= + "M"=0D else:=0D - self.Alignment =3D str (MaxFvAlignment // 0x400) + "K"= =0D + self.Alignment =3D str(MaxFvAlignment // 0x400) + "K"= =0D else:=0D # MaxFvAlignment is less than 1K=0D - self.Alignment =3D str (MaxFvAlignment)=0D + self.Alignment =3D str(MaxFvAlignment)=0D =0D return OutputFileList, self.Alignment=0D #=0D @@ -105,54 +111,65 @@ class FvImageSection(FvImageSectionClassObject): self.Fv =3D Fv=0D if not self.FvAddr and self.Fv.BaseAddress:=0D self.FvAddr =3D self.Fv.BaseAddress=0D - FvFileName =3D Fv.AddToBuffer(Buffer, self.FvAddr, MacroDi= ct =3D Dict, Flag=3DIsMakefile)=0D + FvFileName =3D Fv.AddToBuffer(=0D + Buffer, self.FvAddr, MacroDict=3DDict, Flag=3DIsMakefi= le)=0D if Fv.FvAlignment is not None:=0D if self.Alignment is None:=0D self.Alignment =3D Fv.FvAlignment=0D else:=0D - if GenFdsGlobalVariable.GetAlignment (Fv.FvAlignme= nt) > GenFdsGlobalVariable.GetAlignment (self.Alignment):=0D + if GenFdsGlobalVariable.GetAlignment(Fv.FvAlignmen= t) > GenFdsGlobalVariable.GetAlignment(self.Alignment):=0D self.Alignment =3D Fv.FvAlignment=0D else:=0D if self.FvFileName is not None:=0D - FvFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMa= cro(self.FvFileName)=0D + FvFileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMa= cro(=0D + self.FvFileName)=0D if os.path.isfile(FvFileName):=0D - FvFileObj =3D open (FvFileName, 'rb')=0D + FvFileObj =3D open(FvFileName, 'rb')=0D FvFileObj.seek(0)=0D # PI FvHeader is 0x48 byte=0D FvHeaderBuffer =3D FvFileObj.read(0x48)=0D # FV alignment position.=0D if isinstance(FvHeaderBuffer[0x2E], str):=0D - FvAlignmentValue =3D 1 << (ord(FvHeaderBuffer[= 0x2E]) & 0x1F)=0D + FvAlignmentValue =3D 1 << (=0D + ord(FvHeaderBuffer[0x2E]) & 0x1F)=0D else:=0D - FvAlignmentValue =3D 1 << (FvHeaderBuffer[0x2E= ] & 0x1F)=0D + FvAlignmentValue =3D 1 << (=0D + FvHeaderBuffer[0x2E] & 0x1F)=0D # FvAlignmentValue is larger than or equal to 1K=0D if FvAlignmentValue >=3D 0x400:=0D if FvAlignmentValue >=3D 0x100000:=0D - #The max alignment supported by FFS is 16M= .=0D + # The max alignment supported by FFS is 16= M.=0D if FvAlignmentValue >=3D 0x1000000:=0D self.Alignment =3D "16M"=0D else:=0D - self.Alignment =3D str(FvAlignmentValu= e // 0x100000) + "M"=0D + self.Alignment =3D str(=0D + FvAlignmentValue // 0x100000) + "M= "=0D else:=0D - self.Alignment =3D str (FvAlignmentValue /= / 0x400) + "K"=0D + self.Alignment =3D str(=0D + FvAlignmentValue // 0x400) + "K"=0D else:=0D # FvAlignmentValue is less than 1K=0D - self.Alignment =3D str (FvAlignmentValue)=0D + self.Alignment =3D str(FvAlignmentValue)=0D FvFileObj.close()=0D else:=0D - if len (mws.getPkgPath()) =3D=3D 0:=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s = is not found in WORKSPACE: %s" % self.FvFileName, GenFdsGlobalVariable.Work= SpaceDir)=0D + if len(mws.getPkgPath()) =3D=3D 0:=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s = is not found in WORKSPACE: %s" %=0D + self.FvFileName, GenFdsGlobalV= ariable.WorkSpaceDir)=0D else:=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s = is not found in packages path:\n\t%s" % (self.FvFileName, '\n\t'.join(mws.g= etPkgPath())))=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND, "%s = is not found in packages path:\n\t%s" % (=0D + self.FvFileName, '\n\t'.join(mws.getPkgPat= h())))=0D =0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "FvImageSectio= n Failed! %s NOT found in FDF" % self.FvName)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "FvImageSection Failed! %s= NOT found in FDF" % self.FvName)=0D =0D #=0D # Prepare the parameter of GenSection=0D #=0D - OutputFile =3D os.path.join(OutputPath, ModuleName + SUP_MODUL= E_SEC + SecNum + SectionSuffix.get("FV_IMAGE"))=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, [FvFileName],= 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE', IsMakefile=3DIsMakefile)=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + Section= Suffix.get("FV_IMAGE"))=0D + GenFdsGlobalVariable.GenerateSection(=0D + OutputFile, [FvFileName], 'EFI_SECTION_FIRMWARE_VOLUME_IMA= GE', IsMakefile=3DIsMakefile)=0D OutputFileList.append(OutputFile)=0D =0D return OutputFileList, self.Alignment=0D diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index 17b71b7cd347..856d4c84c435 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # generate flash image=0D #=0D # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
        = =0D @@ -20,7 +20,7 @@ from linecache import getlines from io import BytesIO=0D =0D import Common.LongFilePathOs as os=0D -from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFil= e=0D +from Common.TargetTxtClassObject import TargetTxtDict, gDefaultTargetTxtFi= le=0D from Common.DataType import *=0D import Common.GlobalData as GlobalData=0D from Common import EdkLogger=0D @@ -43,7 +43,7 @@ versionNumber =3D "1.0" + ' ' + gBUILD_VERSION __version__ =3D "%prog Version " + versionNumber=0D __copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s reserved."=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -52,12 +52,15 @@ __copyright__ =3D "Copyright (c) 2007 - 2018, Intel Cor= poration All rights reserv # @retval 0 Tool was successful=0D # @retval 1 Tool failed=0D #=0D +=0D +=0D def main():=0D global Options=0D Options =3D myOptionParser()=0D EdkLogger.Initialize()=0D return GenFdsApi(OptionsToCommandDict(Options))=0D =0D +=0D def resetFdsGlobalVariable():=0D GenFdsGlobalVariable.FvDir =3D ''=0D GenFdsGlobalVariable.OutputDirDict =3D {}=0D @@ -91,7 +94,7 @@ def resetFdsGlobalVariable(): GenFdsGlobalVariable.GuidToolDefinition =3D {}=0D GenFdsGlobalVariable.FfsCmdDict =3D {}=0D GenFdsGlobalVariable.SecCmdList =3D []=0D - GenFdsGlobalVariable.CopyList =3D []=0D + GenFdsGlobalVariable.CopyList =3D []=0D GenFdsGlobalVariable.ModuleFile =3D ''=0D GenFdsGlobalVariable.EnableGenfdsMultiThread =3D True=0D =0D @@ -104,6 +107,7 @@ def resetFdsGlobalVariable(): # FvName, FdName, CapName in FDF, Image file name=0D GenFdsGlobalVariable.ImageBinDict =3D {}=0D =0D +=0D def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone):=0D global Workspace=0D Workspace =3D ""=0D @@ -127,17 +131,19 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): else:=0D EdkLogger.SetLevel(EdkLogger.INFO)=0D =0D - if not FdsCommandDict.get("Workspace",os.environ.get('WORKSPACE'))= :=0D + if not FdsCommandDict.get("Workspace", os.environ.get('WORKSPACE')= ):=0D EdkLogger.error("GenFds", OPTION_MISSING, "WORKSPACE not defin= ed",=0D ExtraData=3D"Please use '-w' switch to pass it= or set the WORKSPACE environment variable.")=0D - elif not os.path.exists(FdsCommandDict.get("Workspace",os.environ.= get('WORKSPACE'))):=0D + elif not os.path.exists(FdsCommandDict.get("Workspace", os.environ= .get('WORKSPACE'))):=0D EdkLogger.error("GenFds", PARAMETER_INVALID, "WORKSPACE is inv= alid",=0D ExtraData=3D"Please use '-w' switch to pass it= or set the WORKSPACE environment variable.")=0D else:=0D - Workspace =3D os.path.normcase(FdsCommandDict.get("Workspace",= os.environ.get('WORKSPACE')))=0D + Workspace =3D os.path.normcase(FdsCommandDict.get(=0D + "Workspace", os.environ.get('WORKSPACE')))=0D GenFdsGlobalVariable.WorkSpaceDir =3D Workspace=0D if FdsCommandDict.get("debug"):=0D - GenFdsGlobalVariable.VerboseLogger("Using Workspace:" + Wo= rkspace)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Using Workspace:" + Workspace)=0D if FdsCommandDict.get("GenfdsMultiThread"):=0D GenFdsGlobalVariable.EnableGenfdsMultiThread =3D True=0D else:=0D @@ -150,46 +156,58 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): =0D if FdsCommandDict.get("fdf_file"):=0D FdfFilename =3D FdsCommandDict.get("fdf_file")[0].Path=0D - FdfFilename =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(Fdf= Filename)=0D + FdfFilename =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(=0D + FdfFilename)=0D =0D if FdfFilename[0:2] =3D=3D '..':=0D FdfFilename =3D os.path.abspath(FdfFilename)=0D if not os.path.isabs(FdfFilename):=0D - FdfFilename =3D mws.join(GenFdsGlobalVariable.WorkSpaceDir= , FdfFilename)=0D + FdfFilename =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, FdfFilename)=0D if not os.path.exists(FdfFilename):=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=3DFdfF= ilename)=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + ExtraData=3DFdfFilename)=0D =0D GenFdsGlobalVariable.FdfFile =3D FdfFilename=0D - GenFdsGlobalVariable.FdfFileTimeStamp =3D os.path.getmtime(Fdf= Filename)=0D + GenFdsGlobalVariable.FdfFileTimeStamp =3D os.path.getmtime(=0D + FdfFilename)=0D else:=0D EdkLogger.error("GenFds", OPTION_MISSING, "Missing FDF filenam= e")=0D =0D if FdsCommandDict.get("build_target"):=0D - GenFdsGlobalVariable.TargetName =3D FdsCommandDict.get("build_= target")=0D + GenFdsGlobalVariable.TargetName =3D FdsCommandDict.get(=0D + "build_target")=0D =0D if FdsCommandDict.get("toolchain_tag"):=0D - GenFdsGlobalVariable.ToolChainTag =3D FdsCommandDict.get("tool= chain_tag")=0D + GenFdsGlobalVariable.ToolChainTag =3D FdsCommandDict.get(=0D + "toolchain_tag")=0D =0D if FdsCommandDict.get("active_platform"):=0D ActivePlatform =3D FdsCommandDict.get("active_platform")=0D - ActivePlatform =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(= ActivePlatform)=0D + ActivePlatform =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(= =0D + ActivePlatform)=0D =0D if ActivePlatform[0:2] =3D=3D '..':=0D ActivePlatform =3D os.path.abspath(ActivePlatform)=0D =0D - if not os.path.isabs (ActivePlatform):=0D - ActivePlatform =3D mws.join(GenFdsGlobalVariable.WorkSpace= Dir, ActivePlatform)=0D + if not os.path.isabs(ActivePlatform):=0D + ActivePlatform =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform)=0D =0D if not os.path.exists(ActivePlatform):=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, "ActivePlatform = doesn't exist!")=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + "ActivePlatform doesn't exist!")=0D else:=0D - EdkLogger.error("GenFds", OPTION_MISSING, "Missing active plat= form")=0D + EdkLogger.error("GenFds", OPTION_MISSING,=0D + "Missing active platform")=0D =0D - GenFdsGlobalVariable.ActivePlatform =3D PathClass(NormPath(ActiveP= latform))=0D + GenFdsGlobalVariable.ActivePlatform =3D PathClass(=0D + NormPath(ActivePlatform))=0D =0D if FdsCommandDict.get("conf_directory"):=0D # Get alternate Conf location, if it is absolute, then just us= e the absolute directory name=0D - ConfDirectoryPath =3D os.path.normpath(FdsCommandDict.get("con= f_directory"))=0D + ConfDirectoryPath =3D os.path.normpath(=0D + FdsCommandDict.get("conf_directory"))=0D if ConfDirectoryPath.startswith('"'):=0D ConfDirectoryPath =3D ConfDirectoryPath[1:]=0D if ConfDirectoryPath.endswith('"'):=0D @@ -197,17 +215,20 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): if not os.path.isabs(ConfDirectoryPath):=0D # Since alternate directory name is not absolute, the alte= rnate directory is located within the WORKSPACE=0D # This also handles someone specifying the Conf directory = in the workspace. Using --conf=3DConf=0D - ConfDirectoryPath =3D os.path.join(GenFdsGlobalVariable.Wo= rkSpaceDir, ConfDirectoryPath)=0D + ConfDirectoryPath =3D os.path.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath)= =0D else:=0D if "CONF_PATH" in os.environ:=0D ConfDirectoryPath =3D os.path.normcase(os.environ["CONF_PA= TH"])=0D else:=0D # Get standard WORKSPACE/Conf, use the absolute path to th= e WORKSPACE/Conf=0D - ConfDirectoryPath =3D mws.join(GenFdsGlobalVariable.WorkSp= aceDir, 'Conf')=0D + ConfDirectoryPath =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, 'Conf')=0D GenFdsGlobalVariable.ConfDir =3D ConfDirectoryPath=0D if not GlobalData.gConfDirectory:=0D GlobalData.gConfDirectory =3D GenFdsGlobalVariable.ConfDir=0D - BuildConfigurationFile =3D os.path.normpath(os.path.join(ConfDirec= toryPath, gDefaultTargetTxtFile))=0D + BuildConfigurationFile =3D os.path.normpath(=0D + os.path.join(ConfDirectoryPath, gDefaultTargetTxtFile))=0D if os.path.isfile(BuildConfigurationFile) =3D=3D True:=0D # if no build target given in command line, get it from target= .txt=0D TargetObj =3D TargetTxtDict()=0D @@ -215,21 +236,25 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): if not GenFdsGlobalVariable.TargetName:=0D BuildTargetList =3D TargetTxt.TargetTxtDictionary[TAB_TAT_= DEFINES_TARGET]=0D if len(BuildTargetList) !=3D 1:=0D - EdkLogger.error("GenFds", OPTION_VALUE_INVALID, ExtraD= ata=3D"Only allows one instance for Target.")=0D + EdkLogger.error("GenFds", OPTION_VALUE_INVALID,=0D + ExtraData=3D"Only allows one instance = for Target.")=0D GenFdsGlobalVariable.TargetName =3D BuildTargetList[0]=0D =0D # if no tool chain given in command line, get it from target.t= xt=0D if not GenFdsGlobalVariable.ToolChainTag:=0D ToolChainList =3D TargetTxt.TargetTxtDictionary[TAB_TAT_DE= FINES_TOOL_CHAIN_TAG]=0D if ToolChainList is None or len(ToolChainList) =3D=3D 0:=0D - EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE, Extr= aData=3D"No toolchain given. Don't know how to build.")=0D + EdkLogger.error("GenFds", RESOURCE_NOT_AVAILABLE,=0D + ExtraData=3D"No toolchain given. Don't= know how to build.")=0D if len(ToolChainList) !=3D 1:=0D - EdkLogger.error("GenFds", OPTION_VALUE_INVALID, ExtraD= ata=3D"Only allows one instance for ToolChain.")=0D + EdkLogger.error("GenFds", OPTION_VALUE_INVALID,=0D + ExtraData=3D"Only allows one instance = for ToolChain.")=0D GenFdsGlobalVariable.ToolChainTag =3D ToolChainList[0]=0D else:=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=3DBuildCon= figurationFile)=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + ExtraData=3DBuildConfigurationFile)=0D =0D - #Set global flag for build mode=0D + # Set global flag for build mode=0D GlobalData.gIgnoreSource =3D FdsCommandDict.get("IgnoreSources")=0D =0D if FdsCommandDict.get("macro"):=0D @@ -241,11 +266,14 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): List =3D Pair.split('=3D')=0D if len(List) =3D=3D 2:=0D if not List[1].strip():=0D - EdkLogger.error("GenFds", OPTION_VALUE_INVALID, Ex= traData=3D"No Value given for Macro %s" %List[0])=0D + EdkLogger.error(=0D + "GenFds", OPTION_VALUE_INVALID, ExtraData=3D"N= o Value given for Macro %s" % List[0])=0D if List[0].strip() in ["WORKSPACE", "TARGET", "TOOLCHA= IN"]:=0D - GlobalData.gGlobalDefines[List[0].strip()] =3D Lis= t[1].strip()=0D + GlobalData.gGlobalDefines[List[0].strip(=0D + )] =3D List[1].strip()=0D else:=0D - GlobalData.gCommandLineDefines[List[0].strip()] = =3D List[1].strip()=0D + GlobalData.gCommandLineDefines[List[0].strip(=0D + )] =3D List[1].strip()=0D else:=0D GlobalData.gCommandLineDefines[List[0].strip()] =3D "T= RUE"=0D os.environ["WORKSPACE"] =3D Workspace=0D @@ -259,7 +287,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] =3D GenFdsGlobalVa= riable.ToolChainTag=0D =0D """call Workspace build create database"""=0D - GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(ConfDir= ectoryPath, GlobalData.gDatabasePath))=0D + GlobalData.gDatabasePath =3D os.path.normpath(=0D + os.path.join(ConfDirectoryPath, GlobalData.gDatabasePath))=0D =0D if WorkSpaceDataBase:=0D BuildWorkSpace =3D WorkSpaceDataBase=0D @@ -274,27 +303,35 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): if FdsCommandDict.get("build_architecture_list"):=0D ArchList =3D FdsCommandDict.get("build_architecture_list").spl= it(',')=0D else:=0D - ArchList =3D BuildWorkSpace.BuildObject[GenFdsGlobalVariable.A= ctivePlatform, TAB_COMMON, FdsCommandDict.get("build_target"), FdsCommandDi= ct.get("toolchain_tag")].SupArchList=0D + ArchList =3D BuildWorkSpace.BuildObject[GenFdsGlobalVariable.A= ctivePlatform, TAB_COMMON, FdsCommandDict.get(=0D + "build_target"), FdsCommandDict.get("toolchain_tag")].SupA= rchList=0D =0D - TargetArchList =3D set(BuildWorkSpace.BuildObject[GenFdsGlobalVari= able.ActivePlatform, TAB_COMMON, FdsCommandDict.get("build_target"), FdsCom= mandDict.get("toolchain_tag")].SupArchList) & set(ArchList)=0D + TargetArchList =3D set(BuildWorkSpace.BuildObject[GenFdsGlobalVari= able.ActivePlatform, TAB_COMMON, FdsCommandDict.get(=0D + "build_target"), FdsCommandDict.get("toolchain_tag")].SupArchL= ist) & set(ArchList)=0D if len(TargetArchList) =3D=3D 0:=0D - 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)))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Target ARCH %s not in= platform supported ARCH %s" % (str(=0D + ArchList), str(BuildWorkSpace.BuildObject[GenFdsGlobalVari= able.ActivePlatform, TAB_COMMON].SupArchList)))=0D =0D for Arch in ArchList:=0D - GenFdsGlobalVariable.OutputDirFromDscDict[Arch] =3D NormPath(B= uildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, FdsCom= mandDict.get("build_target"), FdsCommandDict.get("toolchain_tag")].OutputDi= rectory)=0D + GenFdsGlobalVariable.OutputDirFromDscDict[Arch] =3D NormPath(B= uildWorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, FdsCom= mandDict.get(=0D + "build_target"), FdsCommandDict.get("toolchain_tag")].Outp= utDirectory)=0D =0D # assign platform name based on last entry in ArchList=0D - GenFdsGlobalVariable.PlatformName =3D BuildWorkSpace.BuildObject[G= enFdsGlobalVariable.ActivePlatform, ArchList[-1], FdsCommandDict.get("build= _target"), FdsCommandDict.get("toolchain_tag")].PlatformName=0D + GenFdsGlobalVariable.PlatformName =3D BuildWorkSpace.BuildObject[G= enFdsGlobalVariable.ActivePlatform,=0D + Arc= hList[-1], FdsCommandDict.get("build_target"), FdsCommandDict.get("toolchai= n_tag")].PlatformName=0D =0D if FdsCommandDict.get("platform_build_directory"):=0D - OutputDirFromCommandLine =3D GenFdsGlobalVariable.ReplaceWorks= paceMacro(FdsCommandDict.get("platform_build_directory"))=0D - if not os.path.isabs (OutputDirFromCommandLine):=0D - OutputDirFromCommandLine =3D os.path.join(GenFdsGlobalVari= able.WorkSpaceDir, OutputDirFromCommandLine)=0D + OutputDirFromCommandLine =3D GenFdsGlobalVariable.ReplaceWorks= paceMacro(=0D + FdsCommandDict.get("platform_build_directory"))=0D + if not os.path.isabs(OutputDirFromCommandLine):=0D + OutputDirFromCommandLine =3D os.path.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, OutputDirFromComman= dLine)=0D for Arch in ArchList:=0D GenFdsGlobalVariable.OutputDirDict[Arch] =3D OutputDirFrom= CommandLine=0D else:=0D for Arch in ArchList:=0D - GenFdsGlobalVariable.OutputDirDict[Arch] =3D os.path.join(= GenFdsGlobalVariable.OutputDirFromDscDict[Arch], GenFdsGlobalVariable.Targe= tName + '_' + GenFdsGlobalVariable.ToolChainTag)=0D + GenFdsGlobalVariable.OutputDirDict[Arch] =3D os.path.join(= =0D + GenFdsGlobalVariable.OutputDirFromDscDict[Arch], GenFd= sGlobalVariable.TargetName + '_' + GenFdsGlobalVariable.ToolChainTag)=0D =0D for Key in GenFdsGlobalVariable.OutputDirDict:=0D OutputDir =3D GenFdsGlobalVariable.OutputDirDict[Key]=0D @@ -302,7 +339,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): OutputDir =3D os.path.abspath(OutputDir)=0D =0D if OutputDir[1] !=3D ':':=0D - OutputDir =3D os.path.join (GenFdsGlobalVariable.WorkSpace= Dir, OutputDir)=0D + OutputDir =3D os.path.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, OutputDir)=0D =0D if not os.path.exists(OutputDir):=0D EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=3DOutp= utDir)=0D @@ -316,7 +354,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): FdfParserObj.ParseFile()=0D =0D if FdfParserObj.CycleReferenceCheck():=0D - EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED, "Cycle Referen= ce Detected in FDF file")=0D + EdkLogger.error("GenFds", FORMAT_NOT_SUPPORTED,=0D + "Cycle Reference Detected in FDF file")=0D =0D if FdsCommandDict.get("fd"):=0D if FdsCommandDict.get("fd")[0].upper() in FdfParserObj.Profile= .FdDict:=0D @@ -347,7 +386,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): =0D """Modify images from build output if the feature of loading drive= r at fixed address is on."""=0D if GenFdsGlobalVariable.FixedLoadAddress:=0D - GenFds.PreprocessImage(BuildWorkSpace, GenFdsGlobalVariable.Ac= tivePlatform)=0D + GenFds.PreprocessImage(=0D + BuildWorkSpace, GenFdsGlobalVariable.ActivePlatform)=0D =0D # Record the FV Region info that may specific in the FD=0D if FdfParserObj.Profile.FvDict and FdfParserObj.Profile.FdDict:=0D @@ -359,13 +399,16 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): for RegionData in RegionObj.RegionDataList:=0D if FvObj.UiFvName.upper() =3D=3D RegionData.up= per():=0D if not FvObj.BaseAddress:=0D - FvObj.BaseAddress =3D '0x%x' % (int(Fd= Obj.BaseAddress, 0) + RegionObj.Offset)=0D + FvObj.BaseAddress =3D '0x%x' % (=0D + int(FdObj.BaseAddress, 0) + Region= Obj.Offset)=0D if FvObj.FvRegionInFD:=0D if FvObj.FvRegionInFD !=3D RegionObj.S= ize:=0D - EdkLogger.error("GenFds", FORMAT_I= NVALID, "The FV %s's region is specified in multiple FD with different valu= e." %FvObj.UiFvName)=0D + EdkLogger.error(=0D + "GenFds", FORMAT_INVALID, "The= FV %s's region is specified in multiple FD with different value." % FvObj.= UiFvName)=0D else:=0D FvObj.FvRegionInFD =3D RegionObj.Size= =0D - RegionObj.BlockInfoOfRegion(FdObj.Bloc= kSizeList, FvObj)=0D + RegionObj.BlockInfoOfRegion(=0D + FdObj.BlockSizeList, FvObj)=0D =0D """Call GenFds"""=0D GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)=0D @@ -377,7 +420,8 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): GenFds.DisplayFvSpaceInfo(FdfParserObj)=0D =0D except Warning as X:=0D - EdkLogger.error(X.ToolName, FORMAT_INVALID, File=3DX.FileName, Lin= e=3DX.LineNumber, ExtraData=3DX.Message, RaiseError=3DFalse)=0D + EdkLogger.error(X.ToolName, FORMAT_INVALID, File=3DX.FileName,=0D + Line=3DX.LineNumber, ExtraData=3DX.Message, RaiseE= rror=3DFalse)=0D ReturnCode =3D FORMAT_INVALID=0D except FatalError as X:=0D if FdsCommandDict.get("debug") is not None:=0D @@ -387,18 +431,19 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNon= e): except:=0D import traceback=0D EdkLogger.error(=0D - "\nPython",=0D - CODE_ERROR,=0D - "Tools code failure",=0D - ExtraData=3D"Please send email to %s for help, attachi= ng following call stack trace!\n" % MSG_EDKII_MAIL_ADDR,=0D - RaiseError=3DFalse=0D - )=0D + "\nPython",=0D + CODE_ERROR,=0D + "Tools code failure",=0D + ExtraData=3D"Please send email to %s for help, attaching follo= wing call stack trace!\n" % MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D EdkLogger.quiet(traceback.format_exc())=0D ReturnCode =3D CODE_ERROR=0D finally:=0D ClearDuplicatedInf()=0D return ReturnCode=0D =0D +=0D def OptionsToCommandDict(Options):=0D FdsCommandDict =3D {}=0D FdsCommandDict["verbose"] =3D Options.verbose=0D @@ -407,7 +452,8 @@ def OptionsToCommandDict(Options): FdsCommandDict["debug"] =3D Options.debug=0D FdsCommandDict["Workspace"] =3D Options.Workspace=0D FdsCommandDict["GenfdsMultiThread"] =3D not Options.NoGenfdsMultiThrea= d=0D - FdsCommandDict["fdf_file"] =3D [PathClass(Options.filename)] if Option= s.filename else []=0D + FdsCommandDict["fdf_file"] =3D [=0D + PathClass(Options.filename)] if Options.filename else []=0D FdsCommandDict["build_target"] =3D Options.BuildTarget=0D FdsCommandDict["toolchain_tag"] =3D Options.ToolChain=0D FdsCommandDict["active_platform"] =3D Options.activePlatform=0D @@ -424,65 +470,88 @@ def OptionsToCommandDict(Options): =0D =0D gParamCheck =3D []=0D +=0D +=0D def SingleCheckCallback(option, opt_str, value, parser):=0D if option not in gParamCheck:=0D setattr(parser.values, option.dest, value)=0D gParamCheck.append(option)=0D else:=0D - parser.error("Option %s only allows one instance in command line!"= % option)=0D + parser.error(=0D + "Option %s only allows one instance in command line!" % option= )=0D =0D -## Parse command line options=0D +# Parse command line options=0D #=0D # Using standard Python module optparse to parse command line option of th= is tool.=0D #=0D # @retval Opt A optparse.Values object containing the parsed options=0D #=0D +=0D +=0D def myOptionParser():=0D usage =3D "%prog [options] -f input_file -a arch_list -b build_target = -p active_platform -t tool_chain_tag -D \"MacroName [=3D MacroValue]\""=0D - Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__, ve= rsion=3D"%prog " + str(versionNumber))=0D - Parser.add_option("-f", "--file", dest=3D"filename", type=3D"string", = help=3D"Name of FDF file to convert", action=3D"callback", callback=3DSingl= eCheckCallback)=0D - Parser.add_option("-a", "--arch", dest=3D"archList", help=3D"comma sep= arated list containing one or more of: IA32, X64, IPF, ARM, AARCH64 or EBC = which should be built, overrides target.txt?s TARGET_ARCH")=0D - Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DNone,= help=3D"Disable all messages except FATAL ERRORS.")=0D - Parser.add_option("-v", "--verbose", action=3D"store_true", type=3DNon= e, help=3D"Turn on verbose output with informational messages printed.")=0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int", hel= p=3D"Enable debug messages at specified level.")=0D + Parser =3D OptionParser(usage=3Dusage, description=3D__copyright__,=0D + version=3D"%prog " + str(versionNumber))=0D + Parser.add_option("-f", "--file", dest=3D"filename", type=3D"string",= =0D + help=3D"Name of FDF file to convert", action=3D"call= back", callback=3DSingleCheckCallback)=0D + Parser.add_option("-a", "--arch", dest=3D"archList",=0D + help=3D"comma separated list containing one or more = of: IA32, X64, IPF, ARM, AARCH64 or EBC which should be built, overrides ta= rget.txt?s TARGET_ARCH")=0D + Parser.add_option("-q", "--quiet", action=3D"store_true",=0D + type=3DNone, help=3D"Disable all messages except FAT= AL ERRORS.")=0D + Parser.add_option("-v", "--verbose", action=3D"store_true", type=3DNon= e,=0D + help=3D"Turn on verbose output with informational me= ssages printed.")=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",=0D + help=3D"Enable debug messages at specified level.")= =0D Parser.add_option("-p", "--platform", type=3D"string", dest=3D"activeP= latform", help=3D"Set the ACTIVE_PLATFORM, overrides target.txt ACTIVE_PLAT= FORM setting.",=0D action=3D"callback", callback=3DSingleCheckCallback)= =0D Parser.add_option("-w", "--workspace", type=3D"string", dest=3D"Worksp= ace", default=3Dos.environ.get('WORKSPACE'), help=3D"Set the WORKSPACE",=0D action=3D"callback", callback=3DSingleCheckCallback)= =0D Parser.add_option("-o", "--outputDir", type=3D"string", dest=3D"output= Dir", help=3D"Name of Build Output directory",=0D action=3D"callback", callback=3DSingleCheckCallback)= =0D - Parser.add_option("-r", "--rom_image", dest=3D"uiFdName", help=3D"Buil= d the image using the [FD] section named by FdUiName.")=0D - Parser.add_option("-i", "--FvImage", dest=3D"uiFvName", help=3D"Build = the FV image using the [FV] section named by UiFvName")=0D - Parser.add_option("-C", "--CapsuleImage", dest=3D"uiCapName", help=3D"= Build the Capsule image using the [Capsule] section named by UiCapName")=0D + Parser.add_option("-r", "--rom_image", dest=3D"uiFdName",=0D + help=3D"Build the image using the [FD] section named= by FdUiName.")=0D + Parser.add_option("-i", "--FvImage", dest=3D"uiFvName",=0D + help=3D"Build the FV image using the [FV] section na= med by UiFvName")=0D + Parser.add_option("-C", "--CapsuleImage", dest=3D"uiCapName",=0D + help=3D"Build the Capsule image using the [Capsule] = section named by UiCapName")=0D Parser.add_option("-b", "--buildtarget", type=3D"string", dest=3D"Buil= dTarget", help=3D"Set the build TARGET, overrides target.txt TARGET setting= .",=0D action=3D"callback", callback=3DSingleCheckCallback)= =0D Parser.add_option("-t", "--tagname", type=3D"string", dest=3D"ToolChai= n", help=3D"Using the tools: TOOL_CHAIN_TAG name to build the platform.",=0D action=3D"callback", callback=3DSingleCheckCallback)= =0D - Parser.add_option("-D", "--define", action=3D"append", type=3D"string"= , dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\".")=0D - Parser.add_option("-s", "--specifyaddress", dest=3D"FixedAddress", act= ion=3D"store_true", type=3DNone, help=3D"Specify driver load address.")=0D - Parser.add_option("--conf", action=3D"store", type=3D"string", dest=3D= "ConfDirectory", help=3D"Specify the customized Conf directory.")=0D - Parser.add_option("--ignore-sources", action=3D"store_true", dest=3D"I= gnoreSources", default=3DFalse, help=3D"Focus to a binary build and ignore = all source files")=0D - Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd", help= =3D"Set PCD value by command line. Format: \"PcdName=3DValue\" ")=0D - Parser.add_option("--genfds-multi-thread", action=3D"store_true", dest= =3D"GenfdsMultiThread", default=3DTrue, help=3D"Enable GenFds multi thread = to generate ffs file.")=0D - Parser.add_option("--no-genfds-multi-thread", action=3D"store_true", d= est=3D"NoGenfdsMultiThread", default=3DFalse, help=3D"Disable GenFds multi = thread to generate ffs file.")=0D + Parser.add_option("-D", "--define", action=3D"append", type=3D"string"= ,=0D + dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\"= .")=0D + Parser.add_option("-s", "--specifyaddress", dest=3D"FixedAddress",=0D + action=3D"store_true", type=3DNone, help=3D"Specify = driver load address.")=0D + Parser.add_option("--conf", action=3D"store", type=3D"string",=0D + dest=3D"ConfDirectory", help=3D"Specify the customiz= ed Conf directory.")=0D + Parser.add_option("--ignore-sources", action=3D"store_true", dest=3D"I= gnoreSources",=0D + default=3DFalse, help=3D"Focus to a binary build and= ignore all source files")=0D + Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd",=0D + help=3D"Set PCD value by command line. Format: \"Pcd= Name=3DValue\" ")=0D + Parser.add_option("--genfds-multi-thread", action=3D"store_true", dest= =3D"GenfdsMultiThread",=0D + default=3DTrue, help=3D"Enable GenFds multi thread t= o generate ffs file.")=0D + Parser.add_option("--no-genfds-multi-thread", action=3D"store_true", d= est=3D"NoGenfdsMultiThread",=0D + default=3DFalse, help=3D"Disable GenFds multi thread= to generate ffs file.")=0D =0D Options, _ =3D Parser.parse_args()=0D return Options=0D =0D -## The class implementing the EDK2 flash image generation process=0D +# The class implementing the EDK2 flash image generation process=0D #=0D # This process includes:=0D # 1. Collect workspace information, includes platform and module inf= ormation=0D # 2. Call methods of Fd class to generate FD=0D # 3. Call methods of Fv class to generate FV that not belong to FD=0D #=0D +=0D +=0D class GenFds(object):=0D FdfParsef =3D None=0D OnlyGenerateThisFd =3D None=0D OnlyGenerateThisFv =3D None=0D OnlyGenerateThisCap =3D None=0D =0D - ## GenFd()=0D + # GenFd()=0D #=0D # @param OutputDir Output directory=0D # @param FdfParserObject FDF contents parser=0D @@ -490,18 +559,21 @@ class GenFds(object): # @param ArchList The Arch list of platform=0D #=0D @staticmethod=0D - def GenFd (OutputDir, FdfParserObject, WorkSpace, ArchList):=0D - GenFdsGlobalVariable.SetDir ('', FdfParserObject, WorkSpace, ArchL= ist)=0D + def GenFd(OutputDir, FdfParserObject, WorkSpace, ArchList):=0D + GenFdsGlobalVariable.SetDir('', FdfParserObject, WorkSpace, ArchLi= st)=0D =0D - GenFdsGlobalVariable.VerboseLogger(" Generate all Fd images and th= eir required FV and Capsule images!")=0D + GenFdsGlobalVariable.VerboseLogger(=0D + " Generate all Fd images and their required FV and Capsule ima= ges!")=0D if GenFds.OnlyGenerateThisCap is not None and GenFds.OnlyGenerateT= hisCap.upper() in GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict:=0D - CapsuleObj =3D GenFdsGlobalVariable.FdfParser.Profile.CapsuleD= ict[GenFds.OnlyGenerateThisCap.upper()]=0D + CapsuleObj =3D GenFdsGlobalVariable.FdfParser.Profile.CapsuleD= ict[GenFds.OnlyGenerateThisCap.upper(=0D + )]=0D if CapsuleObj is not None:=0D CapsuleObj.GenCapsule()=0D return=0D =0D if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateTh= isFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict:=0D - FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds= .OnlyGenerateThisFd.upper()]=0D + FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds= .OnlyGenerateThisFd.upper(=0D + )]=0D if FdObj is not None:=0D FdObj.GenFd()=0D return=0D @@ -511,7 +583,8 @@ class GenFds(object): =0D GenFdsGlobalVariable.VerboseLogger("\n Generate other FV images! "= )=0D if GenFds.OnlyGenerateThisFv is not None and GenFds.OnlyGenerateTh= isFv.upper() in GenFdsGlobalVariable.FdfParser.Profile.FvDict:=0D - FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict[GenFds= .OnlyGenerateThisFv.upper()]=0D + FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.FvDict[GenFds= .OnlyGenerateThisFv.upper(=0D + )]=0D if FvObj is not None:=0D Buffer =3D BytesIO()=0D FvObj.AddToBuffer(Buffer)=0D @@ -525,18 +598,21 @@ class GenFds(object): =0D if GenFds.OnlyGenerateThisFv is None and GenFds.OnlyGenerateThisFd= is None and GenFds.OnlyGenerateThisCap is None:=0D if GenFdsGlobalVariable.FdfParser.Profile.CapsuleDict !=3D {}:= =0D - GenFdsGlobalVariable.VerboseLogger("\n Generate other Caps= ule images!")=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "\n Generate other Capsule images!")=0D for CapsuleObj in GenFdsGlobalVariable.FdfParser.Profile.C= apsuleDict.values():=0D CapsuleObj.GenCapsule()=0D =0D if GenFdsGlobalVariable.FdfParser.Profile.OptRomDict !=3D {}:= =0D - GenFdsGlobalVariable.VerboseLogger("\n Generate all Option= ROM!")=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "\n Generate all Option ROM!")=0D for OptRomObj in GenFdsGlobalVariable.FdfParser.Profile.Op= tRomDict.values():=0D OptRomObj.AddToBuffer(None)=0D =0D @staticmethod=0D def GenFfsMakefile(OutputDir, FdfParserObject, WorkSpace, ArchList, Gl= obalData):=0D - GenFdsGlobalVariable.SetEnv(FdfParserObject, WorkSpace, ArchList, = GlobalData)=0D + GenFdsGlobalVariable.SetEnv(=0D + FdfParserObject, WorkSpace, ArchList, GlobalData)=0D for FdObj in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values(= ):=0D FdObj.GenFd(Flag=3DTrue)=0D =0D @@ -549,7 +625,7 @@ class GenFds(object): =0D return GenFdsGlobalVariable.FfsCmdDict=0D =0D - ## GetFvBlockSize()=0D + # GetFvBlockSize()=0D #=0D # @param FvObj Whose block size to get=0D # @retval int Block size value=0D @@ -559,7 +635,8 @@ class GenFds(object): DefaultBlockSize =3D 0x1=0D FdObj =3D None=0D if GenFds.OnlyGenerateThisFd is not None and GenFds.OnlyGenerateTh= isFd.upper() in GenFdsGlobalVariable.FdfParser.Profile.FdDict:=0D - FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds= .OnlyGenerateThisFd.upper()]=0D + FdObj =3D GenFdsGlobalVariable.FdfParser.Profile.FdDict[GenFds= .OnlyGenerateThisFd.upper(=0D + )]=0D if FdObj is None:=0D for ElementFd in GenFdsGlobalVariable.FdfParser.Profile.FdDict= .values():=0D for ElementRegion in ElementFd.RegionList:=0D @@ -575,16 +652,16 @@ class GenFds(object): return DefaultBlockSize=0D else:=0D for ElementRegion in FdObj.RegionList:=0D - if ElementRegion.RegionType =3D=3D BINARY_FILE_TYPE_FV= :=0D - for ElementRegionData in ElementRegion.RegionDataL= ist:=0D - if ElementRegionData is not None and ElementRe= gionData.upper() =3D=3D FvObj.UiFvName:=0D - if FvObj.BlockSizeList !=3D []:=0D - return FvObj.BlockSizeList[0][0]=0D - else:=0D - return ElementRegion.BlockSizeOfRegion= (ElementFd.BlockSizeList)=0D + if ElementRegion.RegionType =3D=3D BINARY_FILE_TYPE_FV:=0D + for ElementRegionData in ElementRegion.RegionDataList:= =0D + if ElementRegionData is not None and ElementRegion= Data.upper() =3D=3D FvObj.UiFvName:=0D + if FvObj.BlockSizeList !=3D []:=0D + return FvObj.BlockSizeList[0][0]=0D + else:=0D + return ElementRegion.BlockSizeOfRegion(Ele= mentFd.BlockSizeList)=0D return DefaultBlockSize=0D =0D - ## DisplayFvSpaceInfo()=0D + # DisplayFvSpaceInfo()=0D #=0D # @param FvObj Whose block size to get=0D # @retval None=0D @@ -597,7 +674,8 @@ class GenFds(object): for FvName in FdfParserObject.Profile.FvDict:=0D if len(FvName) > MaxFvNameLength:=0D MaxFvNameLength =3D len(FvName)=0D - FvSpaceInfoFileName =3D os.path.join(GenFdsGlobalVariable.FvDi= r, FvName.upper() + '.Fv.map')=0D + FvSpaceInfoFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, FvName.upper() + '.Fv.map')=0D if os.path.exists(FvSpaceInfoFileName):=0D FileLinesList =3D getlines(FvSpaceInfoFileName)=0D TotalFound =3D False=0D @@ -631,14 +709,18 @@ class GenFds(object): if UsedSizeValue =3D=3D TotalSizeValue:=0D Percentage =3D '100'=0D else:=0D - Percentage =3D str((UsedSizeValue + 0.0) / TotalSizeValue)= [0:4].lstrip('0.')=0D + Percentage =3D str((UsedSizeValue + 0.0) /=0D + TotalSizeValue)[0:4].lstrip('0.')=0D =0D - GenFdsGlobalVariable.InfLogger(Name + ' ' + '[' + Percentage += '%Full] '\=0D - + str(TotalSizeValue) + ' (' + = hex(TotalSizeValue) + ')' + ' total, '\=0D - + str(UsedSizeValue) + ' (' + h= ex(UsedSizeValue) + ')' + ' used, '\=0D + GenFdsGlobalVariable.InfLogger(Name + ' ' + '[' + Percentage += '%Full] '=0D + + str(TotalSizeValue) + ' (' += =0D + hex(TotalSizeValue) +=0D + ')' + ' total, '=0D + + str(UsedSizeValue) + ' (' +=0D + hex(UsedSizeValue) + ')' + ' us= ed, '=0D + str(FreeSizeValue) + ' (' + h= ex(FreeSizeValue) + ')' + ' free')=0D =0D - ## PreprocessImage()=0D + # PreprocessImage()=0D #=0D # @param BuildDb Database from build meta data files=0D # @param DscFile modules from dsc file will be preprocessed= =0D @@ -646,7 +728,8 @@ class GenFds(object): #=0D @staticmethod=0D def PreprocessImage(BuildDb, DscFile):=0D - PcdDict =3D BuildDb.BuildObject[DscFile, TAB_COMMON, GenFdsGlobalV= ariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Pcds=0D + PcdDict =3D BuildDb.BuildObject[DscFile, TAB_COMMON,=0D + GenFdsGlobalVariable.TargetName, Gen= FdsGlobalVariable.ToolChainTag].Pcds=0D PcdValue =3D ''=0D for Key in PcdDict:=0D PcdObj =3D PcdDict[Key]=0D @@ -665,14 +748,17 @@ class GenFds(object): if Int64PcdValue > 0:=0D TopAddress =3D Int64PcdValue=0D =0D - ModuleDict =3D BuildDb.BuildObject[DscFile, TAB_COMMON, GenFdsGlob= alVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].Modules=0D + ModuleDict =3D BuildDb.BuildObject[DscFile, TAB_COMMON,=0D + GenFdsGlobalVariable.TargetName, = GenFdsGlobalVariable.ToolChainTag].Modules=0D for Key in ModuleDict:=0D - ModuleObj =3D BuildDb.BuildObject[Key, TAB_COMMON, GenFdsGloba= lVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + ModuleObj =3D BuildDb.BuildObject[Key, TAB_COMMON,=0D + GenFdsGlobalVariable.TargetNam= e, GenFdsGlobalVariable.ToolChainTag]=0D print(ModuleObj.BaseName + ' ' + ModuleObj.ModuleType)=0D =0D @staticmethod=0D def GenerateGuidXRefFile(BuildDb, ArchList, FdfParserObj):=0D - GuidXRefFileName =3D os.path.join(GenFdsGlobalVariable.FvDir, "Gui= d.xref")=0D + GuidXRefFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, "Guid.xref")=0D GuidXRefFile =3D []=0D PkgGuidDict =3D {}=0D GuidDict =3D {}=0D @@ -680,8 +766,10 @@ class GenFds(object): FileGuidList =3D []=0D VariableGuidSet =3D set()=0D for Arch in ArchList:=0D - PlatformDataBase =3D BuildDb.BuildObject[GenFdsGlobalVariable.= ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable= .ToolChainTag]=0D - PkgList =3D GenFdsGlobalVariable.WorkSpace.GetPackageList(GenF= dsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, Gen= FdsGlobalVariable.ToolChainTag)=0D + PlatformDataBase =3D BuildDb.BuildObject[GenFdsGlobalVariable.= ActivePlatform,=0D + Arch, GenFdsGlobalVaria= ble.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + PkgList =3D GenFdsGlobalVariable.WorkSpace.GetPackageList(=0D + GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVar= iable.TargetName, GenFdsGlobalVariable.ToolChainTag)=0D for P in PkgList:=0D PkgGuidDict.update(P.Guids)=0D for Name, Guid in PlatformDataBase.Pcds:=0D @@ -689,33 +777,40 @@ class GenFds(object): if Pcd.Type in [TAB_PCDS_DYNAMIC_HII, TAB_PCDS_DYNAMIC_EX_= HII]:=0D for SkuId in Pcd.SkuInfoList:=0D Sku =3D Pcd.SkuInfoList[SkuId]=0D - if Sku.VariableGuid in VariableGuidSet:continue=0D + if Sku.VariableGuid in VariableGuidSet:=0D + continue=0D VariableGuidSet.add(Sku.VariableGuid)=0D if Sku.VariableGuid and Sku.VariableGuid in PkgGui= dDict.keys():=0D GuidDict[Sku.VariableGuid] =3D PkgGuidDict[Sku= .VariableGuid]=0D for ModuleFile in PlatformDataBase.Modules:=0D - Module =3D BuildDb.BuildObject[ModuleFile, Arch, GenFdsGlo= balVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + Module =3D BuildDb.BuildObject[ModuleFile, Arch,=0D + GenFdsGlobalVariable.TargetNa= me, GenFdsGlobalVariable.ToolChainTag]=0D if Module in ModuleList:=0D continue=0D else:=0D ModuleList.append(Module)=0D if GlobalData.gGuidPattern.match(ModuleFile.BaseName):=0D - GuidXRefFile.append("%s %s\n" % (ModuleFile.BaseName, = Module.BaseName))=0D + GuidXRefFile.append("%s %s\n" %=0D + (ModuleFile.BaseName, Module.BaseN= ame))=0D else:=0D - GuidXRefFile.append("%s %s\n" % (Module.Guid, Module.B= aseName))=0D + GuidXRefFile.append("%s %s\n" %=0D + (Module.Guid, Module.BaseName))=0D GuidDict.update(Module.Protocols)=0D GuidDict.update(Module.Guids)=0D GuidDict.update(Module.Ppis)=0D for FvName in FdfParserObj.Profile.FvDict:=0D for FfsObj in FdfParserObj.Profile.FvDict[FvName].FfsList:= =0D if not isinstance(FfsObj, FileStatement):=0D - InfPath =3D PathClass(NormPath(mws.join(GenFdsGlob= alVariable.WorkSpaceDir, FfsObj.InfFileName)))=0D - FdfModule =3D BuildDb.BuildObject[InfPath, Arch, G= enFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D + InfPath =3D PathClass(=0D + NormPath(mws.join(GenFdsGlobalVariable.WorkSpa= ceDir, FfsObj.InfFileName)))=0D + FdfModule =3D BuildDb.BuildObject[InfPath, Arch,=0D + GenFdsGlobalVariab= le.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D if FdfModule in ModuleList:=0D continue=0D else:=0D ModuleList.append(FdfModule)=0D - GuidXRefFile.append("%s %s\n" % (FdfModule.Guid, F= dfModule.BaseName))=0D + GuidXRefFile.append("%s %s\n" % (=0D + FdfModule.Guid, FdfModule.BaseName))=0D GuidDict.update(FdfModule.Protocols)=0D GuidDict.update(FdfModule.Guids)=0D GuidDict.update(FdfModule.Ppis)=0D @@ -726,21 +821,25 @@ class GenFds(object): else:=0D FileGuidList.append(FileStatementGuid)=0D Name =3D []=0D - FfsPath =3D os.path.join(GenFdsGlobalVariable.FvDi= r, 'Ffs')=0D - FfsPath =3D glob(os.path.join(FfsPath, FileStateme= ntGuid) + TAB_STAR)=0D + FfsPath =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, 'Ffs')=0D + FfsPath =3D glob(os.path.join(=0D + FfsPath, FileStatementGuid) + TAB_STAR)=0D if not FfsPath:=0D continue=0D if not os.path.exists(FfsPath[0]):=0D continue=0D MatchDict =3D {}=0D - ReFileEnds =3D compile('\S+(.ui)$|\S+(fv.sec.txt)$= |\S+(.pe32.txt)$|\S+(.te.txt)$|\S+(.pic.txt)$|\S+(.raw.txt)$|\S+(.ffs.txt)$= ')=0D + ReFileEnds =3D compile(=0D + '\S+(.ui)$|\S+(fv.sec.txt)$|\S+(.pe32.txt)$|\S= +(.te.txt)$|\S+(.pic.txt)$|\S+(.raw.txt)$|\S+(.ffs.txt)$')=0D FileList =3D os.listdir(FfsPath[0])=0D for File in FileList:=0D Match =3D ReFileEnds.search(File)=0D if Match:=0D for Index in range(1, 8):=0D if Match.group(Index) and Match.group(= Index) in MatchDict:=0D - MatchDict[Match.group(Index)].appe= nd(File)=0D + MatchDict[Match.group(=0D + Index)].append(File)=0D elif Match.group(Index):=0D MatchDict[Match.group(Index)] =3D = [File]=0D if not MatchDict:=0D @@ -751,7 +850,8 @@ class GenFds(object): F.read()=0D length =3D F.tell()=0D F.seek(4)=0D - TmpStr =3D unpack('%dh' % ((length - 4= ) // 2), F.read())=0D + TmpStr =3D unpack(=0D + '%dh' % ((length - 4) // 2), F.rea= d())=0D Name =3D ''.join(chr(c) for c in TmpSt= r[:-1])=0D else:=0D FileList =3D []=0D @@ -775,26 +875,29 @@ class GenFds(object): if not Name:=0D continue=0D =0D - Name =3D ' '.join(Name) if isinstance(Name, type([= ])) else Name=0D - GuidXRefFile.append("%s %s\n" %(FileStatementGuid,= Name))=0D + Name =3D ' '.join(Name) if isinstance(=0D + Name, type([])) else Name=0D + GuidXRefFile.append("%s %s\n" %=0D + (FileStatementGuid, Name))=0D =0D # Append GUIDs, Protocols, and PPIs to the Xref file=0D GuidXRefFile.append("\n")=0D for key, item in GuidDict.items():=0D - GuidXRefFile.append("%s %s\n" % (GuidStructureStringToGuidStri= ng(item).upper(), key))=0D + GuidXRefFile.append("%s %s\n" % (=0D + GuidStructureStringToGuidString(item).upper(), key))=0D =0D if GuidXRefFile:=0D GuidXRefFile =3D ''.join(GuidXRefFile)=0D SaveFileOnChange(GuidXRefFileName, GuidXRefFile, False)=0D - GenFdsGlobalVariable.InfLogger("\nGUID cross reference file ca= n be found at %s" % GuidXRefFileName)=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nGUID cross reference file can be found at %s" % GuidXRe= fFileName)=0D elif os.path.exists(GuidXRefFileName):=0D os.remove(GuidXRefFileName)=0D =0D =0D if __name__ =3D=3D '__main__':=0D r =3D main()=0D - ## 0-127 is a safe return range, and 1 is a standard default error=0D + # 0-127 is a safe return range, and 1 is a standard default error=0D if r < 0 or r > 127:=0D r =3D 1=0D exit(r)=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index d7668ba681aa..8b68d60aca68 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Global variables for GenFds=0D #=0D # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
        = =0D @@ -15,28 +15,30 @@ from __future__ import absolute_import import Common.LongFilePathOs as os=0D import sys=0D from sys import stdout=0D -from subprocess import PIPE,Popen=0D +from subprocess import PIPE, Popen=0D from struct import Struct=0D from array import array=0D =0D -from Common.BuildToolError import COMMAND_FAILURE,GENFDS_ERROR=0D +from Common.BuildToolError import COMMAND_FAILURE, GENFDS_ERROR=0D from Common import EdkLogger=0D from Common.Misc import SaveFileOnChange=0D =0D from Common.TargetTxtClassObject import TargetTxtDict=0D -from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile=0D +from Common.ToolDefClassObject import ToolDefDict, gDefaultToolsDefFile=0D from AutoGen.BuildEngine import ToolBuildRule=0D import Common.DataType as DataType=0D -from Common.Misc import PathClass,CreateDirectory=0D +from Common.Misc import PathClass, CreateDirectory=0D from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D import Common.GlobalData as GlobalData=0D from Common.BuildToolError import *=0D from AutoGen.AutoGen import CalculatePriorityValue=0D =0D -## Global variables=0D +# Global variables=0D #=0D #=0D +=0D +=0D class GenFdsGlobalVariable:=0D FvDir =3D ''=0D OutputDirDict =3D {}=0D @@ -70,7 +72,7 @@ class GenFdsGlobalVariable: GuidToolDefinition =3D {}=0D FfsCmdDict =3D {}=0D SecCmdList =3D []=0D - CopyList =3D []=0D + CopyList =3D []=0D ModuleFile =3D ''=0D EnableGenfdsMultiThread =3D True=0D =0D @@ -92,7 +94,7 @@ class GenFdsGlobalVariable: # FvName, FdName, CapName in FDF, Image file name=0D ImageBinDict =3D {}=0D =0D - ## LoadBuildRule=0D + # LoadBuildRule=0D #=0D @staticmethod=0D def _LoadBuildRule():=0D @@ -101,24 +103,28 @@ class GenFdsGlobalVariable: BuildRule =3D ToolBuildRule()=0D GenFdsGlobalVariable.__BuildRuleDatabase =3D BuildRule.ToolBuildRu= le=0D TargetObj =3D TargetTxtDict()=0D - ToolDefinitionFile =3D TargetObj.Target.TargetTxtDictionary[DataTy= pe.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]=0D + ToolDefinitionFile =3D TargetObj.Target.TargetTxtDictionary[=0D + DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]=0D if ToolDefinitionFile =3D=3D '':=0D - ToolDefinitionFile =3D os.path.join('Conf', gDefaultToolsDefF= ile)=0D + ToolDefinitionFile =3D os.path.join('Conf', gDefaultToolsDefFi= le)=0D if os.path.isfile(ToolDefinitionFile):=0D - ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSPACE"= ), "Conf")))=0D + ToolDefObj =3D ToolDefDict(=0D + (os.path.join(os.getenv("WORKSPACE"), "Conf")))=0D ToolDefinition =3D ToolDefObj.ToolDef.ToolsDefTxtDatabase=0D if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition = \=0D and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[Dat= aType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \=0D and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY= ][GenFdsGlobalVariable.ToolChainTag]:=0D - GenFdsGlobalVariable.BuildRuleFamily =3D ToolDefinition[Da= taType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]= =0D + GenFdsGlobalVariable.BuildRuleFamily =3D ToolDefinition[=0D + DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobal= Variable.ToolChainTag]=0D =0D if DataType.TAB_TOD_DEFINES_FAMILY in ToolDefinition \=0D and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[Dat= aType.TAB_TOD_DEFINES_FAMILY] \=0D and ToolDefinition[DataType.TAB_TOD_DEFINES_FAMILY][GenFdsG= lobalVariable.ToolChainTag]:=0D - GenFdsGlobalVariable.ToolChainFamily =3D ToolDefinition[Da= taType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.ToolChainTag]=0D + GenFdsGlobalVariable.ToolChainFamily =3D ToolDefinition[=0D + DataType.TAB_TOD_DEFINES_FAMILY][GenFdsGlobalVariable.= ToolChainTag]=0D return GenFdsGlobalVariable.__BuildRuleDatabase=0D =0D - ## GetBuildRules=0D + # GetBuildRules=0D # @param Inf: object of InfBuildData=0D # @param Arch: current arch=0D #=0D @@ -144,44 +150,48 @@ class GenFdsGlobalVariable: )=0D BinDir =3D os.path.join(GenFdsGlobalVariable.OutputDirDict[Arch], = Arch)=0D Macro =3D {=0D - "WORKSPACE":GenFdsGlobalVariable.WorkSpaceDir,=0D - "MODULE_NAME":Inf.BaseName,=0D - "MODULE_GUID":Inf.Guid,=0D - "MODULE_VERSION":Inf.Version,=0D - "MODULE_TYPE":Inf.ModuleType,=0D - "MODULE_FILE":str(PathClassObj),=0D - "MODULE_FILE_BASE_NAME":PathClassObj.BaseName,=0D - "MODULE_RELATIVE_DIR":PathClassObj.SubDir,=0D - "MODULE_DIR":PathClassObj.SubDir,=0D - "BASE_NAME":Inf.BaseName,=0D - "ARCH":Arch,=0D - "TOOLCHAIN":GenFdsGlobalVariable.ToolChainTag,=0D - "TOOLCHAIN_TAG":GenFdsGlobalVariable.ToolChainTag,=0D - "TOOL_CHAIN_TAG":GenFdsGlobalVariable.ToolChainTag,=0D - "TARGET":GenFdsGlobalVariable.TargetName,=0D - "BUILD_DIR":GenFdsGlobalVariable.OutputDirDict[Arch],=0D - "BIN_DIR":BinDir,=0D - "LIB_DIR":BinDir,=0D - "MODULE_BUILD_DIR":BuildDir,=0D - "OUTPUT_DIR":os.path.join(BuildDir, "OUTPUT"),=0D - "DEBUG_DIR":os.path.join(BuildDir, "DEBUG")=0D + "WORKSPACE": GenFdsGlobalVariable.WorkSpaceDir,=0D + "MODULE_NAME": Inf.BaseName,=0D + "MODULE_GUID": Inf.Guid,=0D + "MODULE_VERSION": Inf.Version,=0D + "MODULE_TYPE": Inf.ModuleType,=0D + "MODULE_FILE": str(PathClassObj),=0D + "MODULE_FILE_BASE_NAME": PathClassObj.BaseName,=0D + "MODULE_RELATIVE_DIR": PathClassObj.SubDir,=0D + "MODULE_DIR": PathClassObj.SubDir,=0D + "BASE_NAME": Inf.BaseName,=0D + "ARCH": Arch,=0D + "TOOLCHAIN": GenFdsGlobalVariable.ToolChainTag,=0D + "TOOLCHAIN_TAG": GenFdsGlobalVariable.ToolChainTag,=0D + "TOOL_CHAIN_TAG": GenFdsGlobalVariable.ToolChainTag,=0D + "TARGET": GenFdsGlobalVariable.TargetName,=0D + "BUILD_DIR": GenFdsGlobalVariable.OutputDirDict[Arch],=0D + "BIN_DIR": BinDir,=0D + "LIB_DIR": BinDir,=0D + "MODULE_BUILD_DIR": BuildDir,=0D + "OUTPUT_DIR": os.path.join(BuildDir, "OUTPUT"),=0D + "DEBUG_DIR": os.path.join(BuildDir, "DEBUG")=0D }=0D =0D BuildRules =3D {}=0D for Type in BuildRuleDatabase.FileTypeList:=0D - #first try getting build rule by BuildRuleFamily=0D - RuleObject =3D BuildRuleDatabase[Type, Inf.BuildType, Arch, Ge= nFdsGlobalVariable.BuildRuleFamily]=0D + # first try getting build rule by BuildRuleFamily=0D + RuleObject =3D BuildRuleDatabase[Type, Inf.BuildType,=0D + Arch, GenFdsGlobalVariable.Buil= dRuleFamily]=0D if not RuleObject:=0D # build type is always module type, but ...=0D if Inf.ModuleType !=3D Inf.BuildType:=0D - RuleObject =3D BuildRuleDatabase[Type, Inf.ModuleType,= Arch, GenFdsGlobalVariable.BuildRuleFamily]=0D - #second try getting build rule by ToolChainFamily=0D + RuleObject =3D BuildRuleDatabase[Type, Inf.ModuleType,= =0D + Arch, GenFdsGlobalVaria= ble.BuildRuleFamily]=0D + # second try getting build rule by ToolChainFamily=0D if not RuleObject:=0D - RuleObject =3D BuildRuleDatabase[Type, Inf.BuildType, Arch= , GenFdsGlobalVariable.ToolChainFamily]=0D + RuleObject =3D BuildRuleDatabase[Type, Inf.BuildType,=0D + Arch, GenFdsGlobalVariable.= ToolChainFamily]=0D if not RuleObject:=0D # build type is always module type, but ...=0D if Inf.ModuleType !=3D Inf.BuildType:=0D - RuleObject =3D BuildRuleDatabase[Type, Inf.ModuleT= ype, Arch, GenFdsGlobalVariable.ToolChainFamily]=0D + RuleObject =3D BuildRuleDatabase[Type, Inf.ModuleT= ype,=0D + Arch, GenFdsGlobalV= ariable.ToolChainFamily]=0D if not RuleObject:=0D continue=0D RuleObject =3D RuleObject.Instantiate(Macro)=0D @@ -190,7 +200,7 @@ class GenFdsGlobalVariable: BuildRules[Ext] =3D RuleObject=0D return BuildRules=0D =0D - ## GetModuleCodaTargetList=0D + # GetModuleCodaTargetList=0D #=0D # @param Inf: object of InfBuildData=0D # @param Arch: current arch=0D @@ -207,7 +217,7 @@ class GenFdsGlobalVariable: if not Inf.IsBinaryModule:=0D for File in Inf.Sources:=0D if File.TagName in {"", DataType.TAB_STAR, GenFdsGlobalVar= iable.ToolChainTag} and \=0D - File.ToolChainFamily in {"", DataType.TAB_STAR, GenFds= GlobalVariable.ToolChainFamily}:=0D + File.ToolChainFamily in {"", DataType.TAB_STAR, Ge= nFdsGlobalVariable.ToolChainFamily}:=0D FileList.append((File, DataType.TAB_UNKNOWN_FILE))=0D =0D for File in Inf.Binaries:=0D @@ -270,7 +280,7 @@ class GenFdsGlobalVariable: =0D return list(TargetList)=0D =0D - ## SetDir()=0D + # SetDir()=0D #=0D # @param OutputDir Output directory=0D # @param FdfParser FDF contents parser=0D @@ -278,21 +288,25 @@ class GenFdsGlobalVariable: # @param ArchList The Arch list of platform=0D #=0D @staticmethod=0D - def SetDir (OutputDir, FdfParser, WorkSpace, ArchList):=0D - GenFdsGlobalVariable.VerboseLogger("GenFdsGlobalVariable.OutputDir= :%s" % OutputDir)=0D + def SetDir(OutputDir, FdfParser, WorkSpace, ArchList):=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "GenFdsGlobalVariable.OutputDir:%s" % OutputDir)=0D GenFdsGlobalVariable.FdfParser =3D FdfParser=0D GenFdsGlobalVariable.WorkSpace =3D WorkSpace=0D - GenFdsGlobalVariable.FvDir =3D os.path.join(GenFdsGlobalVariable.O= utputDirDict[ArchList[0]], DataType.TAB_FV_DIRECTORY)=0D + GenFdsGlobalVariable.FvDir =3D os.path.join(=0D + GenFdsGlobalVariable.OutputDirDict[ArchList[0]], DataType.TAB_= FV_DIRECTORY)=0D if not os.path.exists(GenFdsGlobalVariable.FvDir):=0D os.makedirs(GenFdsGlobalVariable.FvDir)=0D - GenFdsGlobalVariable.FfsDir =3D os.path.join(GenFdsGlobalVariable.= FvDir, 'Ffs')=0D + GenFdsGlobalVariable.FfsDir =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, 'Ffs')=0D if not os.path.exists(GenFdsGlobalVariable.FfsDir):=0D os.makedirs(GenFdsGlobalVariable.FfsDir)=0D =0D #=0D # Create FV Address inf file=0D #=0D - GenFdsGlobalVariable.FvAddressFileName =3D os.path.join(GenFdsGlob= alVariable.FfsDir, 'FvAddress.inf')=0D + GenFdsGlobalVariable.FvAddressFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FfsDir, 'FvAddress.inf')=0D FvAddressFile =3D open(GenFdsGlobalVariable.FvAddressFileName, 'w'= )=0D #=0D # Add [Options]=0D @@ -301,23 +315,25 @@ class GenFdsGlobalVariable: BsAddress =3D '0'=0D for Arch in ArchList:=0D if GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVari= able.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVar= iable.ToolChainTag].BsBaseAddress:=0D - BsAddress =3D GenFdsGlobalVariable.WorkSpace.BuildObject[G= enFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, = GenFdsGlobalVariable.ToolChainTag].BsBaseAddress=0D + BsAddress =3D GenFdsGlobalVariable.WorkSpace.BuildObject[G= enFdsGlobalVariable.ActivePlatform,=0D + Arc= h, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].BsBa= seAddress=0D break=0D =0D - FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS =3D " + \=0D - BsAddress + \=0D - DataType.TAB_LINE_BREAK)=0D + FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS =3D " +=0D + BsAddress +=0D + DataType.TAB_LINE_BREAK)=0D =0D RtAddress =3D '0'=0D for Arch in reversed(ArchList):=0D - temp =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlob= alVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlo= balVariable.ToolChainTag].RtBaseAddress=0D + temp =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlob= alVariable.ActivePlatform,=0D + Arch, GenFds= GlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag].RtBaseAddress= =0D if temp:=0D RtAddress =3D temp=0D break=0D =0D - FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D " + = \=0D - RtAddress + \=0D - DataType.TAB_LINE_BREAK)=0D + FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D " += =0D + RtAddress +=0D + DataType.TAB_LINE_BREAK)=0D =0D FvAddressFile.close()=0D =0D @@ -330,31 +346,34 @@ class GenFdsGlobalVariable: GenFdsGlobalVariable.ToolChainTag =3D GlobalData.gGlobalDefines["T= OOL_CHAIN_TAG"]=0D GenFdsGlobalVariable.TargetName =3D GlobalData.gGlobalDefines["TAR= GET"]=0D GenFdsGlobalVariable.ActivePlatform =3D GlobalData.gActivePlatform= =0D - GenFdsGlobalVariable.ConfDir =3D GlobalData.gConfDirectory=0D + GenFdsGlobalVariable.ConfDir =3D GlobalData.gConfDirectory=0D GenFdsGlobalVariable.EnableGenfdsMultiThread =3D GlobalData.gEnabl= eGenfdsMultiThread=0D for Arch in ArchList:=0D GenFdsGlobalVariable.OutputDirDict[Arch] =3D os.path.normpath(= =0D os.path.join(GlobalData.gWorkspace,=0D WorkSpace.Db.BuildObject[GenFdsGlobalVariable= .ActivePlatform, Arch, GlobalData.gGlobalDefines['TARGET'],=0D - GlobalData.gGlobalDefines['TOOLCHAIN']].Outpu= tDirectory,=0D - GlobalData.gGlobalDefines['TARGET'] +'_' + Gl= obalData.gGlobalDefines['TOOLCHAIN']))=0D + GlobalData.gGlobalDe= fines['TOOLCHAIN']].OutputDirectory,=0D + GlobalData.gGlobalDefines['TARGET'] + '_' + G= lobalData.gGlobalDefines['TOOLCHAIN']))=0D GenFdsGlobalVariable.OutputDirFromDscDict[Arch] =3D os.path.no= rmpath(=0D - WorkSpace.Db.BuildObject[GenFdsGlobalVariable= .ActivePlatform, Arch,=0D - GlobalData.gGlobalDefines['TARGET'], GlobalDa= ta.gGlobalDefines['TOOLCHAIN']].OutputDirectory)=0D + WorkSpace.Db.BuildObject[GenFdsGlobalVariable.ActivePlatfo= rm, Arch,=0D + GlobalData.gGlobalDefines['TARGET= '], GlobalData.gGlobalDefines['TOOLCHAIN']].OutputDirectory)=0D GenFdsGlobalVariable.PlatformName =3D WorkSpace.Db.BuildObject= [GenFdsGlobalVariable.ActivePlatform, Arch,=0D - Glob= alData.gGlobalDefines['TARGET'],=0D - Glob= alData.gGlobalDefines['TOOLCHAIN']].PlatformName=0D - GenFdsGlobalVariable.FvDir =3D os.path.join(GenFdsGlobalVariable.O= utputDirDict[ArchList[0]], DataType.TAB_FV_DIRECTORY)=0D + G= lobalData.gGlobalDefines['TARGET'],=0D + G= lobalData.gGlobalDefines['TOOLCHAIN']].PlatformName=0D + GenFdsGlobalVariable.FvDir =3D os.path.join(=0D + GenFdsGlobalVariable.OutputDirDict[ArchList[0]], DataType.TAB_= FV_DIRECTORY)=0D if not os.path.exists(GenFdsGlobalVariable.FvDir):=0D os.makedirs(GenFdsGlobalVariable.FvDir)=0D - GenFdsGlobalVariable.FfsDir =3D os.path.join(GenFdsGlobalVariable.= FvDir, 'Ffs')=0D + GenFdsGlobalVariable.FfsDir =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, 'Ffs')=0D if not os.path.exists(GenFdsGlobalVariable.FfsDir):=0D os.makedirs(GenFdsGlobalVariable.FfsDir)=0D =0D #=0D # Create FV Address inf file=0D #=0D - GenFdsGlobalVariable.FvAddressFileName =3D os.path.join(GenFdsGlob= alVariable.FfsDir, 'FvAddress.inf')=0D + GenFdsGlobalVariable.FvAddressFileName =3D os.path.join(=0D + GenFdsGlobalVariable.FfsDir, 'FvAddress.inf')=0D FvAddressFile =3D open(GenFdsGlobalVariable.FvAddressFileName, 'w'= )=0D #=0D # Add [Options]=0D @@ -368,8 +387,8 @@ class GenFdsGlobalVariable: if BsAddress:=0D break=0D =0D - FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS =3D " + \=0D - BsAddress + \=0D + FvAddressFile.writelines("EFI_BOOT_DRIVER_BASE_ADDRESS =3D " +=0D + BsAddress +=0D DataType.TAB_LINE_BREAK)=0D =0D RtAddress =3D '0'=0D @@ -381,13 +400,13 @@ class GenFdsGlobalVariable: RtAddress =3D temp=0D break=0D =0D - FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D " + = \=0D - RtAddress + \=0D + FvAddressFile.writelines("EFI_RUNTIME_DRIVER_BASE_ADDRESS =3D " += =0D + RtAddress +=0D DataType.TAB_LINE_BREAK)=0D =0D FvAddressFile.close()=0D =0D - ## ReplaceWorkspaceMacro()=0D + # ReplaceWorkspaceMacro()=0D #=0D # @param String String that may contain macro=0D #=0D @@ -402,7 +421,7 @@ class GenFdsGlobalVariable: Str =3D mws.join(GenFdsGlobalVariable.WorkSpaceDir, String)=0D return os.path.normpath(Str)=0D =0D - ## Check if the input files are newer than output files=0D + # Check if the input files are newer than output files=0D #=0D # @param Output Path of output file=0D # @param Input Path list of input files=0D @@ -446,10 +465,10 @@ class GenFdsGlobalVariable: Cmd +=3D ("--dummy", DummyFile)=0D if GuidHdrLen:=0D Cmd +=3D ("-l", GuidHdrLen)=0D - #Add each guided attribute=0D + # Add each guided attribute=0D for Attr in GuidAttr:=0D Cmd +=3D ("-r", Attr)=0D - #Section Align is only for dummy section without section type=0D + # Section Align is only for dummy section without section type=0D for SecAlign in InputAlign:=0D Cmd +=3D ("--sectionalign", SecAlign)=0D =0D @@ -462,31 +481,36 @@ class GenFdsGlobalVariable: Cmd +=3D ("-n", '"' + Ui + '"')=0D Cmd +=3D ("-o", Output)=0D if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCm= dList:=0D - GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip())=0D + GenFdsGlobalVariable.SecCmdList.append(=0D + ' '.join(Cmd).strip())=0D else:=0D SectionData =3D array('B', [0, 0, 0, 0])=0D - SectionData.fromlist(array('B',Ui.encode('utf-16-le')).tol= ist())=0D + SectionData.fromlist(=0D + array('B', Ui.encode('utf-16-le')).tolist())=0D SectionData.append(0)=0D SectionData.append(0)=0D Len =3D len(SectionData)=0D - GenFdsGlobalVariable.SectionHeader.pack_into(SectionData, = 0, Len & 0xff, (Len >> 8) & 0xff, (Len >> 16) & 0xff, 0x15)=0D -=0D + GenFdsGlobalVariable.SectionHeader.pack_into(=0D + SectionData, 0, Len & 0xff, (Len >> 8) & 0xff, (Len >>= 16) & 0xff, 0x15)=0D =0D DirName =3D os.path.dirname(Output)=0D if not CreateDirectory(DirName):=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, "Could not = create directory %s" % DirName)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + "Could not create directory %s" % DirN= ame)=0D else:=0D if DirName =3D=3D '':=0D DirName =3D os.getcwd()=0D if not os.access(DirName, os.W_OK):=0D - EdkLogger.error(None, PERMISSION_FAILURE, "Do not = have write permission on directory %s" % DirName)=0D + EdkLogger.error(=0D + None, PERMISSION_FAILURE, "Do not have write p= ermission on directory %s" % DirName)=0D =0D try:=0D with open(Output, "wb") as Fd:=0D SectionData.tofile(Fd)=0D Fd.flush()=0D except IOError as X:=0D - EdkLogger.error(None, FILE_CREATE_FAILURE, ExtraData= =3D'IOError %s' % X)=0D + EdkLogger.error(None, FILE_CREATE_FAILURE,=0D + ExtraData=3D'IOError %s' % X)=0D =0D elif Ver:=0D Cmd +=3D ("-n", Ver)=0D @@ -497,11 +521,13 @@ class GenFdsGlobalVariable: SaveFileOnChange(CommandFile, ' '.join(Cmd), False)=0D if IsMakefile:=0D if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCm= dList:=0D - GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip())=0D + GenFdsGlobalVariable.SecCmdList.append(=0D + ' '.join(Cmd).strip())=0D else:=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input= ) + [CommandFile]):=0D return=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to gene= rate section")=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to generate section")=0D else:=0D Cmd +=3D ("-o", Output)=0D Cmd +=3D Input=0D @@ -513,38 +539,42 @@ class GenFdsGlobalVariable: else:=0D Cmd =3D ['-test', '-e', Input[0], "&&"] + Cmd=0D if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCm= dList:=0D - GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).s= trip())=0D + GenFdsGlobalVariable.SecCmdList.append(=0D + ' '.join(Cmd).strip())=0D elif GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [C= ommandFile]):=0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s ne= eds update because of newer %s" % (Output, Input))=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to gene= rate section")=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %= s" % (Output, Input))=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to generate section")=0D if (os.path.getsize(Output) >=3D GenFdsGlobalVariable.LARG= E_FILE_SIZE and=0D - GenFdsGlobalVariable.LargeFileInFvFlags):=0D + GenFdsGlobalVariable.LargeFileInFvFlags):=0D GenFdsGlobalVariable.LargeFileInFvFlags[-1] =3D True=0D =0D @staticmethod=0D - def GetAlignment (AlignString):=0D + def GetAlignment(AlignString):=0D if not AlignString:=0D return 0=0D if AlignString.endswith('K'):=0D - return int (AlignString.rstrip('K')) * 1024=0D + return int(AlignString.rstrip('K')) * 1024=0D if AlignString.endswith('M'):=0D - return int (AlignString.rstrip('M')) * 1024 * 1024=0D + return int(AlignString.rstrip('M')) * 1024 * 1024=0D if AlignString.endswith('G'):=0D - return int (AlignString.rstrip('G')) * 1024 * 1024 * 1024=0D - return int (AlignString)=0D + return int(AlignString.rstrip('G')) * 1024 * 1024 * 1024=0D + return int(AlignString)=0D =0D @staticmethod=0D def GenerateFfs(Output, Input, Type, Guid, Fixed=3DFalse, CheckSum=3DF= alse, Align=3DNone,=0D SectionAlign=3DNone, MakefilePath=3DNone):=0D Cmd =3D ["GenFfs", "-t", Type, "-g", Guid]=0D - mFfsValidAlign =3D ["0", "8", "16", "128", "512", "1K", "4K", "32K= ", "64K", "128K", "256K", "512K", "1M", "2M", "4M", "8M", "16M"]=0D + mFfsValidAlign =3D ["0", "8", "16", "128", "512", "1K", "4K", "32K= ",=0D + "64K", "128K", "256K", "512K", "1M", "2M", "4M",= "8M", "16M"]=0D if Fixed =3D=3D True:=0D Cmd.append("-x")=0D if CheckSum:=0D Cmd.append("-s")=0D if Align:=0D if Align not in mFfsValidAlign:=0D - Align =3D GenFdsGlobalVariable.GetAlignment (Align)=0D + Align =3D GenFdsGlobalVariable.GetAlignment(Align)=0D for index in range(0, len(mFfsValidAlign) - 1):=0D if ((Align > GenFdsGlobalVariable.GetAlignment(mFfsVal= idAlign[index])) and (Align <=3D GenFdsGlobalVariable.GetAlignment(mFfsVali= dAlign[index + 1]))):=0D break=0D @@ -563,23 +593,27 @@ class GenFdsGlobalVariable: CommandFile =3D Output + '.txt'=0D SaveFileOnChange(CommandFile, ' '.join(Cmd), False)=0D =0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, Input))=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Ou= tput, Input))=0D if MakefilePath:=0D if (tuple(Cmd), tuple(GenFdsGlobalVariable.SecCmdList), tuple(= GenFdsGlobalVariable.CopyList)) not in GenFdsGlobalVariable.FfsCmdDict:=0D - GenFdsGlobalVariable.FfsCmdDict[tuple(Cmd), tuple(GenFdsGl= obalVariable.SecCmdList), tuple(GenFdsGlobalVariable.CopyList)] =3D Makefil= ePath=0D + GenFdsGlobalVariable.FfsCmdDict[tuple(Cmd), tuple(=0D + GenFdsGlobalVariable.SecCmdList), tuple(GenFdsGlobalVa= riable.CopyList)] =3D MakefilePath=0D GenFdsGlobalVariable.SecCmdList =3D []=0D GenFdsGlobalVariable.CopyList =3D []=0D else:=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + = [CommandFile]):=0D return=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate= FFS")=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to generate FFS")=0D =0D @staticmethod=0D def GenerateFirmwareVolume(Output, Input, BaseAddress=3DNone, ForceReb= ase=3DNone, Capsule=3DFalse, Dump=3DFalse,=0D AddressFile=3DNone, MapFile=3DNone, FfsList= =3D[], FileSystemGuid=3DNone):=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList):=0D return=0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, Input))=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Ou= tput, Input))=0D =0D Cmd =3D ["GenFv"]=0D if BaseAddress:=0D @@ -612,7 +646,8 @@ class GenFdsGlobalVariable: Align=3DNone, Padding=3DNone, Convert=3DFals= e, IsMakefile=3DFalse):=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, Input) and not IsM= akefile:=0D return=0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, Input))=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Ou= tput, Input))=0D =0D Cmd =3D ["GenFw"]=0D if Type.lower() =3D=3D "te":=0D @@ -641,11 +676,12 @@ class GenFdsGlobalVariable: if " ".join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdLis= t:=0D GenFdsGlobalVariable.SecCmdList.append(" ".join(Cmd).strip= ())=0D else:=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate= firmware image")=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to generate firmware image")=0D =0D @staticmethod=0D def GenerateOptionRom(Output, EfiInput, BinaryInput, Compress=3DFalse,= ClassCode=3DNone,=0D - Revision=3DNone, DeviceId=3DNone, VendorId=3DNone,= IsMakefile=3DFalse):=0D + Revision=3DNone, DeviceId=3DNone, VendorId=3DNon= e, IsMakefile=3DFalse):=0D InputList =3D []=0D Cmd =3D ["EfiRom"]=0D if EfiInput:=0D @@ -657,18 +693,19 @@ class GenFdsGlobalVariable: =0D for EfiFile in EfiInput:=0D Cmd.append(EfiFile)=0D - InputList.append (EfiFile)=0D + InputList.append(EfiFile)=0D =0D if BinaryInput:=0D Cmd.append("-b")=0D for BinFile in BinaryInput:=0D Cmd.append(BinFile)=0D - InputList.append (BinFile)=0D + InputList.append(BinFile)=0D =0D # Check List=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, InputList) and not= IsMakefile:=0D return=0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, InputList))=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Ou= tput, InputList))=0D =0D if ClassCode:=0D Cmd +=3D ("-l", ClassCode)=0D @@ -684,13 +721,15 @@ class GenFdsGlobalVariable: if " ".join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdLis= t:=0D GenFdsGlobalVariable.SecCmdList.append(" ".join(Cmd).strip= ())=0D else:=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate= option rom")=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to generate option rom")=0D =0D @staticmethod=0D def GuidTool(Output, Input, ToolPath, Options=3D'', returnValue=3D[], = IsMakefile=3DFalse):=0D if not GenFdsGlobalVariable.NeedsUpdate(Output, Input) and not IsM= akefile:=0D return=0D - GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs upda= te because of newer %s" % (Output, Input))=0D + GenFdsGlobalVariable.DebugLogger(=0D + EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Ou= tput, Input))=0D =0D Cmd =3D [ToolPath, ]=0D Cmd +=3D Options.split(' ')=0D @@ -700,80 +739,87 @@ class GenFdsGlobalVariable: if " ".join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdLis= t:=0D GenFdsGlobalVariable.SecCmdList.append(" ".join(Cmd).strip= ())=0D else:=0D - GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to call " += ToolPath, returnValue)=0D + GenFdsGlobalVariable.CallExternalTool(=0D + Cmd, "Failed to call " + ToolPath, returnValue)=0D =0D @staticmethod=0D - def CallExternalTool (cmd, errorMess, returnValue=3D[]):=0D + def CallExternalTool(cmd, errorMess, returnValue=3D[]):=0D =0D if type(cmd) not in (tuple, list):=0D - GenFdsGlobalVariable.ErrorLogger("ToolError! Invalid paramete= r type in call to CallExternalTool")=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "ToolError! Invalid parameter type in call to CallExterna= lTool")=0D =0D if GenFdsGlobalVariable.DebugLevel !=3D -1:=0D cmd +=3D ('--debug', str(GenFdsGlobalVariable.DebugLevel))=0D - GenFdsGlobalVariable.InfLogger (cmd)=0D + GenFdsGlobalVariable.InfLogger(cmd)=0D =0D if GenFdsGlobalVariable.VerboseMode:=0D cmd +=3D ('-v',)=0D - GenFdsGlobalVariable.InfLogger (cmd)=0D + GenFdsGlobalVariable.InfLogger(cmd)=0D else:=0D - stdout.write ('#')=0D + stdout.write('#')=0D stdout.flush()=0D GenFdsGlobalVariable.SharpCounter =3D GenFdsGlobalVariable.Sha= rpCounter + 1=0D if GenFdsGlobalVariable.SharpCounter % GenFdsGlobalVariable.Sh= arpNumberPerLine =3D=3D 0:=0D stdout.write('\n')=0D =0D try:=0D - PopenObject =3D Popen(' '.join(cmd), stdout=3DPIPE, stderr=3DP= IPE, shell=3DTrue)=0D + PopenObject =3D Popen(' '.join(cmd), stdout=3DPIPE,=0D + stderr=3DPIPE, shell=3DTrue)=0D except Exception as X:=0D - EdkLogger.error("GenFds", COMMAND_FAILURE, ExtraData=3D"%s: %s= " % (str(X), cmd[0]))=0D + EdkLogger.error("GenFds", COMMAND_FAILURE,=0D + ExtraData=3D"%s: %s" % (str(X), cmd[0]))=0D (out, error) =3D PopenObject.communicate()=0D =0D while PopenObject.returncode is None:=0D PopenObject.wait()=0D if returnValue !=3D [] and returnValue[0] !=3D 0:=0D - #get command return value=0D + # get command return value=0D returnValue[0] =3D PopenObject.returncode=0D return=0D if PopenObject.returncode !=3D 0 or GenFdsGlobalVariable.VerboseMo= de or GenFdsGlobalVariable.DebugLevel !=3D -1:=0D - GenFdsGlobalVariable.InfLogger ("Return Value =3D %d" % PopenO= bject.returncode)=0D - GenFdsGlobalVariable.InfLogger(out.decode(encoding=3D'utf-8', = errors=3D'ignore'))=0D - GenFdsGlobalVariable.InfLogger(error.decode(encoding=3D'utf-8'= , errors=3D'ignore'))=0D + GenFdsGlobalVariable.InfLogger(=0D + "Return Value =3D %d" % PopenObject.returncode)=0D + GenFdsGlobalVariable.InfLogger(=0D + out.decode(encoding=3D'utf-8', errors=3D'ignore'))=0D + GenFdsGlobalVariable.InfLogger(=0D + error.decode(encoding=3D'utf-8', errors=3D'ignore'))=0D if PopenObject.returncode !=3D 0:=0D print("###", cmd)=0D EdkLogger.error("GenFds", COMMAND_FAILURE, errorMess)=0D =0D @staticmethod=0D - def VerboseLogger (msg):=0D + def VerboseLogger(msg):=0D EdkLogger.verbose(msg)=0D =0D @staticmethod=0D - def InfLogger (msg):=0D + def InfLogger(msg):=0D EdkLogger.info(msg)=0D =0D @staticmethod=0D - def ErrorLogger (msg, File=3DNone, Line=3DNone, ExtraData=3DNone):=0D + def ErrorLogger(msg, File=3DNone, Line=3DNone, ExtraData=3DNone):=0D EdkLogger.error('GenFds', GENFDS_ERROR, msg, File, Line, ExtraData= )=0D =0D @staticmethod=0D - def DebugLogger (Level, msg):=0D + def DebugLogger(Level, msg):=0D EdkLogger.debug(Level, msg)=0D =0D - ## MacroExtend()=0D + # MacroExtend()=0D #=0D # @param Str String that may contain macro=0D # @param MacroDict Dictionary that contains macro value pair=0D #=0D @staticmethod=0D - def MacroExtend (Str, MacroDict=3DNone, Arch=3DDataType.TAB_COMMON):=0D + def MacroExtend(Str, MacroDict=3DNone, Arch=3DDataType.TAB_COMMON):=0D if Str is None:=0D return None=0D =0D Dict =3D {'$(WORKSPACE)': GenFdsGlobalVariable.WorkSpaceDir,=0D -# '$(OUTPUT_DIRECTORY)': GenFdsGlobalVariable.OutputDirFrom= Dsc,=0D + # '$(OUTPUT_DIRECTORY)': GenFdsGlobalVariab= le.OutputDirFromDsc,=0D '$(TARGET)': GenFdsGlobalVariable.TargetName,=0D '$(TOOL_CHAIN_TAG)': GenFdsGlobalVariable.ToolChainTag,=0D '$(SPACE)': ' '=0D - }=0D + }=0D =0D if Arch !=3D DataType.TAB_COMMON and Arch in GenFdsGlobalVariable.= ArchList:=0D OutputDir =3D GenFdsGlobalVariable.OutputDirFromDscDict[Arch]= =0D @@ -787,22 +833,23 @@ class GenFdsGlobalVariable: =0D for key in Dict:=0D if Str.find(key) >=3D 0:=0D - Str =3D Str.replace (key, Dict[key])=0D + Str =3D Str.replace(key, Dict[key])=0D =0D if Str.find('$(ARCH)') >=3D 0:=0D if len(GenFdsGlobalVariable.ArchList) =3D=3D 1:=0D Str =3D Str.replace('$(ARCH)', GenFdsGlobalVariable.ArchLi= st[0])=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "No way to determi= ne $(ARCH) for %s" % Str)=0D + EdkLogger.error("GenFds", GENFDS_ERROR,=0D + "No way to determine $(ARCH) for %s" % Str= )=0D =0D return Str=0D =0D - ## GetPcdValue()=0D + # GetPcdValue()=0D #=0D # @param PcdPattern pattern that labels a PCD.=0D #=0D @staticmethod=0D - def GetPcdValue (PcdPattern):=0D + def GetPcdValue(PcdPattern):=0D if PcdPattern is None:=0D return None=0D if PcdPattern.startswith('PCD('):=0D @@ -813,15 +860,18 @@ class GenFdsGlobalVariable: TokenCName =3D PcdPair[1]=0D =0D for Arch in GenFdsGlobalVariable.ArchList:=0D - Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFds= GlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFd= sGlobalVariable.ToolChainTag]=0D + Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFds= GlobalVariable.ActivePlatform,=0D + Arch, Ge= nFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]=0D PcdDict =3D Platform.Pcds=0D for Key in PcdDict:=0D PcdObj =3D PcdDict[Key]=0D if (PcdObj.TokenCName =3D=3D TokenCName) and (PcdObj.Token= SpaceGuidCName =3D=3D TokenSpace):=0D if PcdObj.Type !=3D DataType.TAB_PCDS_FIXED_AT_BUILD:= =0D - EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not= FixedAtBuild type." % PcdPattern)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "%s is not FixedAtBuil= d type." % PcdPattern)=0D if PcdObj.DatumType !=3D DataType.TAB_VOID:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "%s is not= VOID* datum type." % PcdPattern)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "%s is not VOID* datum= type." % PcdPattern)=0D =0D return PcdObj.DefaultValue=0D =0D @@ -834,15 +884,17 @@ class GenFdsGlobalVariable: PcdObj =3D PcdDict[Key]=0D if (PcdObj.TokenCName =3D=3D TokenCName) and (PcdObj.T= okenSpaceGuidCName =3D=3D TokenSpace):=0D if PcdObj.Type !=3D DataType.TAB_PCDS_FIXED_AT_BUI= LD:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "%s is= not FixedAtBuild type." % PcdPattern)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "%s is not FixedAt= Build type." % PcdPattern)=0D if PcdObj.DatumType !=3D DataType.TAB_VOID:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "%s is= not VOID* datum type." % PcdPattern)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "%s is not VOID* d= atum type." % PcdPattern)=0D =0D return PcdObj.DefaultValue=0D =0D return ''=0D =0D -## FindExtendTool()=0D +# FindExtendTool()=0D #=0D # Find location of tools to process data=0D #=0D @@ -850,6 +902,8 @@ class GenFdsGlobalVariable: # @param CurrentArchList Arch list=0D # @param NameGuid The Guid name=0D #=0D +=0D +=0D def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):=0D if GenFdsGlobalVariable.GuidToolDefinition:=0D if NameGuid in GenFdsGlobalVariable.GuidToolDefinition:=0D @@ -863,7 +917,8 @@ def FindExtendTool(KeyStringList, CurrentArchList, Name= Guid): Target =3D GenFdsGlobalVariable.TargetName=0D ToolChain =3D GenFdsGlobalVariable.ToolChainTag=0D if ToolChain not in ToolDb['TOOL_CHAIN_TAG']:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Can not find external= tool because tool tag %s is not defined in tools_def.txt!" % ToolChain)=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "Can not find external tool becaus= e tool tag %s is not defined in tools_def.txt!" % ToolChain)=0D KeyStringList =3D [Target + '_' + ToolChain + '_' + CurrentArchLis= t[0]]=0D for Arch in CurrentArchList:=0D if Target + '_' + ToolChain + '_' + Arch not in KeyStringList:= =0D @@ -876,13 +931,15 @@ def FindExtendTool(KeyStringList, CurrentArchList, Na= meGuid): MatchPathItem =3D None=0D MatchOptionsItem =3D None=0D for KeyString in KeyStringList:=0D - KeyStringBuildTarget, KeyStringToolChain, KeyStringArch =3D Ke= yString.split('_')=0D + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch =3D Ke= yString.split(=0D + '_')=0D if KeyStringArch !=3D Arch:=0D continue=0D for Item in ToolDef.ToolsDefTxtDictionary:=0D if len(Item.split('_')) < 5:=0D continue=0D - ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item.split('_')=0D + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item.split(=0D + '_')=0D if ItemTarget =3D=3D DataType.TAB_STAR:=0D ItemTarget =3D KeyStringBuildTarget=0D if ItemToolChain =3D=3D DataType.TAB_STAR:=0D @@ -915,7 +972,8 @@ def FindExtendTool(KeyStringList, CurrentArchList, Name= Guid): for Item in ToolDef.ToolsDefTxtDictionary:=0D if len(Item.split('_')) < 5:=0D continue=0D - ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item.split('_')=0D + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item.split(=0D + '_')=0D if ItemTarget =3D=3D DataType.TAB_STAR:=0D ItemTarget =3D KeyStringBuildTarget=0D if ItemToolChain =3D=3D DataType.TAB_STAR:=0D @@ -952,14 +1010,17 @@ def FindExtendTool(KeyStringList, CurrentArchList, N= ameGuid): MatchPathItem =3D None=0D MatchOptionsItem =3D None=0D for KeyString in KeyStringList:=0D - KeyStringBuildTarget, KeyStringToolChain, KeyStringArch =3D Ke= yString.split('_')=0D + KeyStringBuildTarget, KeyStringToolChain, KeyStringArch =3D Ke= yString.split(=0D + '_')=0D if KeyStringArch !=3D Arch:=0D continue=0D - Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[GenFds= GlobalVariable.ActivePlatform, Arch, KeyStringBuildTarget, KeyStringToolCha= in]=0D + Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[=0D + GenFdsGlobalVariable.ActivePlatform, Arch, KeyStringBuildT= arget, KeyStringToolChain]=0D for Item in Platform.BuildOptions:=0D if len(Item[1].split('_')) < 5:=0D continue=0D - ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item[1].split('_')=0D + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item[1].split(=0D + '_')=0D if ItemTarget =3D=3D DataType.TAB_STAR:=0D ItemTarget =3D KeyStringBuildTarget=0D if ItemToolChain =3D=3D DataType.TAB_STAR:=0D @@ -992,7 +1053,8 @@ def FindExtendTool(KeyStringList, CurrentArchList, Nam= eGuid): for Item in Platform.BuildOptions:=0D if len(Item[1].split('_')) < 5:=0D continue=0D - ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item[1].split('_')=0D + ItemTarget, ItemToolChain, ItemArch, ItemTool, ItemAttr = =3D Item[1].split(=0D + '_')=0D if ItemTarget =3D=3D DataType.TAB_STAR:=0D ItemTarget =3D KeyStringBuildTarget=0D if ItemToolChain =3D=3D DataType.TAB_STAR:=0D @@ -1023,5 +1085,6 @@ def FindExtendTool(KeyStringList, CurrentArchList, Na= meGuid): ToolPathTmp =3D Platform.BuildOptions[MatchPathItem]=0D if MatchOptionsItem:=0D ToolOption =3D Platform.BuildOptions[MatchOptionsItem]=0D - GenFdsGlobalVariable.GuidToolDefinition[NameGuid] =3D (ToolPathTmp, To= olOption)=0D + GenFdsGlobalVariable.GuidToolDefinition[NameGuid] =3D (=0D + ToolPathTmp, ToolOption)=0D return ToolPathTmp, ToolOption=0D diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Sour= ce/Python/GenFds/GuidSection.py index 8db6e2feb3e4..5efd7c645091 100644 --- a/BaseTools/Source/Python/GenFds/GuidSection.py +++ b/BaseTools/Source/Python/GenFds/GuidSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process GUIDed section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -25,19 +25,21 @@ from .FvImageSection import FvImageSection from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.DataType import *=0D =0D -## generate GUIDed section=0D +# generate GUIDed section=0D #=0D #=0D -class GuidSection(GuidSectionClassObject) :=0D =0D - ## The constructor=0D +=0D +class GuidSection(GuidSectionClassObject):=0D +=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D GuidSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate GUIDed section=0D #=0D @@ -75,10 +77,10 @@ class GuidSection(GuidSectionClassObject) : =0D if self.ProcessRequired in ("TRUE", "1"):=0D if self.FvAddr !=3D []:=0D - #no use FvAddr when the image is processed.=0D + # no use FvAddr when the image is processed.=0D self.FvAddr =3D []=0D if self.FvParentAddr is not None:=0D - #no use Parent Addr when the image is processed.=0D + # no use Parent Addr when the image is processed.=0D self.FvParentAddr =3D None=0D =0D for Sect in self.SectionList:=0D @@ -92,7 +94,8 @@ class GuidSection(GuidSectionClassObject) : elif isinstance(Sect, GuidSection):=0D Sect.FvAddr =3D self.FvAddr=0D Sect.FvParentAddr =3D self.FvParentAddr=0D - ReturnSectList, align =3D Sect.GenSection(OutputPath, ModuleNa= me, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=3DIsMakefile)=0D + ReturnSectList, align =3D Sect.GenSection(=0D + OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, D= ict, IsMakefile=3DIsMakefile)=0D if isinstance(Sect, GuidSection):=0D if Sect.IncludeFvSection:=0D self.IncludeFvSection =3D Sect.IncludeFvSection=0D @@ -100,7 +103,7 @@ class GuidSection(GuidSectionClassObject) : if align is not None:=0D if MaxAlign is None:=0D MaxAlign =3D align=0D - if GenFdsGlobalVariable.GetAlignment (align) > GenFdsGloba= lVariable.GetAlignment (MaxAlign):=0D + if GenFdsGlobalVariable.GetAlignment(align) > GenFdsGlobal= Variable.GetAlignment(MaxAlign):=0D MaxAlign =3D align=0D if ReturnSectList !=3D []:=0D if align is None:=0D @@ -113,50 +116,55 @@ class GuidSection(GuidSectionClassObject) : if self.Alignment is None:=0D self.Alignment =3D MaxAlign=0D else:=0D - if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGl= obalVariable.GetAlignment (self.Alignment):=0D + if GenFdsGlobalVariable.GetAlignment(MaxAlign) > GenFdsGlo= balVariable.GetAlignment(self.Alignment):=0D self.Alignment =3D MaxAlign=0D =0D OutputFile =3D OutputPath + \=0D - os.sep + \=0D - ModuleName + \=0D - SUP_MODULE_SEC + \=0D - SecNum + \=0D - SectionSuffix['GUIDED']=0D + os.sep + \=0D + ModuleName + \=0D + SUP_MODULE_SEC + \=0D + SecNum + \=0D + SectionSuffix['GUIDED']=0D OutputFile =3D os.path.normpath(OutputFile)=0D =0D ExternalTool =3D None=0D ExternalOption =3D None=0D if self.NameGuid is not None:=0D - ExternalTool, ExternalOption =3D FindExtendTool(self.KeyString= List, self.CurrentArchList, self.NameGuid)=0D + ExternalTool, ExternalOption =3D FindExtendTool(=0D + self.KeyStringList, self.CurrentArchList, self.NameGuid)=0D =0D #=0D # If not have GUID , call default=0D # GENCRC32 section=0D #=0D - if self.NameGuid is None :=0D - GenFdsGlobalVariable.VerboseLogger("Use GenSection function Ge= nerate CRC32 Section")=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, SectFile, Sec= tion.Section.SectionType[self.SectionType], InputAlign=3DSectAlign, IsMakef= ile=3DIsMakefile)=0D + if self.NameGuid is None:=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Use GenSection function Generate CRC32 Section")=0D + GenFdsGlobalVariable.GenerateSection(=0D + OutputFile, SectFile, Section.Section.SectionType[self.Sec= tionType], InputAlign=3DSectAlign, IsMakefile=3DIsMakefile)=0D OutputFileList =3D []=0D OutputFileList.append(OutputFile)=0D return OutputFileList, self.Alignment=0D - #or GUID not in External Tool List=0D + # or GUID not in External Tool List=0D elif ExternalTool is None:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "No tool found with GU= ID %s" % self.NameGuid)=0D + EdkLogger.error("GenFds", GENFDS_ERROR,=0D + "No tool found with GUID %s" % self.NameGuid)= =0D else:=0D DummyFile =3D OutputFile + ".dummy"=0D #=0D # Call GenSection with DUMMY section type.=0D #=0D - GenFdsGlobalVariable.GenerateSection(DummyFile, SectFile, Inpu= tAlign=3DSectAlign, IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(=0D + DummyFile, SectFile, InputAlign=3DSectAlign, IsMakefile=3D= IsMakefile)=0D #=0D # Use external tool process the Output=0D #=0D TempFile =3D OutputPath + \=0D - os.sep + \=0D - ModuleName + \=0D - SUP_MODULE_SEC + \=0D - SecNum + \=0D - '.tmp'=0D + os.sep + \=0D + ModuleName + \=0D + SUP_MODULE_SEC + \=0D + SecNum + \=0D + '.tmp'=0D TempFile =3D os.path.normpath(TempFile)=0D #=0D # Remove temp file if its time stamp is older than dummy file= =0D @@ -172,15 +180,16 @@ class GuidSection(GuidSectionClassObject) : CmdOption =3D CmdOption + ' ' + ExternalOption=0D if not GenFdsGlobalVariable.EnableGenfdsMultiThread:=0D if self.ProcessRequired not in ("TRUE", "1") and self.Incl= udeFvSection and not FvAddrIsSet and self.FvParentAddr is not None:=0D - #FirstCall is only set for the encapsulated flash FV i= mage without process required attribute.=0D + # FirstCall is only set for the encapsulated flash FV = image without process required attribute.=0D FirstCall =3D True=0D #=0D # Call external tool=0D #=0D ReturnValue =3D [1]=0D if FirstCall:=0D - #first try to call the guided tool with -z option and = CmdOption for the no process required guided tool.=0D - GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], E= xternalTool, '-z' + ' ' + CmdOption, ReturnValue)=0D + # first try to call the guided tool with -z option and= CmdOption for the no process required guided tool.=0D + GenFdsGlobalVariable.GuidTool(=0D + TempFile, [DummyFile], ExternalTool, '-z' + ' ' + = CmdOption, ReturnValue)=0D =0D #=0D # when no call or first call failed, ReturnValue are not 1= .=0D @@ -189,14 +198,16 @@ class GuidSection(GuidSectionClassObject) : if ReturnValue[0] !=3D 0:=0D FirstCall =3D False=0D ReturnValue[0] =3D 0=0D - GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], E= xternalTool, CmdOption)=0D + GenFdsGlobalVariable.GuidTool(=0D + TempFile, [DummyFile], ExternalTool, CmdOption)=0D #=0D # There is external tool which does not follow standard ru= le which return nonzero if tool fails=0D # The output file has to be checked=0D #=0D =0D - if not os.path.exists(TempFile) :=0D - EdkLogger.error("GenFds", COMMAND_FAILURE, 'Fail to ca= ll %s, no output file was generated' % ExternalTool)=0D + if not os.path.exists(TempFile):=0D + EdkLogger.error(=0D + "GenFds", COMMAND_FAILURE, 'Fail to call %s, no ou= tput file was generated' % ExternalTool)=0D =0D FileHandleIn =3D open(DummyFile, 'rb')=0D FileHandleIn.seek(0, 2)=0D @@ -219,7 +230,7 @@ class GuidSection(GuidSectionClassObject) : BufferOut =3D FileHandleOut.read()=0D if BufferIn =3D=3D BufferOut[TempFileSize - InputF= ileSize:]:=0D HeaderLength =3D str(TempFileSize - InputFileS= ize)=0D - #auto sec guided attribute with process required=0D + # auto sec guided attribute with process required=0D if HeaderLength is None:=0D Attribute.append('PROCESSING_REQUIRED')=0D =0D @@ -228,7 +239,8 @@ class GuidSection(GuidSectionClassObject) : =0D if FirstCall and 'PROCESSING_REQUIRED' in Attribute:=0D # Guided data by -z option on first call is the proces= s required data. Call the guided tool with the real option.=0D - GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], E= xternalTool, CmdOption)=0D + GenFdsGlobalVariable.GuidTool(=0D + TempFile, [DummyFile], ExternalTool, CmdOption)=0D =0D #=0D # Call Gensection Add Section Header=0D @@ -243,8 +255,9 @@ class GuidSection(GuidSectionClassObject) : Guid=3Dself.NameGuid,= GuidAttr=3DAttribute, GuidHdrLen=3DHeaderLength)=0D =0D else:=0D - #add input file for GenSec get PROCESSING_REQUIRED=0D - GenFdsGlobalVariable.GuidTool(TempFile, [DummyFile], Exter= nalTool, CmdOption, IsMakefile=3DIsMakefile)=0D + # add input file for GenSec get PROCESSING_REQUIRED=0D + GenFdsGlobalVariable.GuidTool(=0D + TempFile, [DummyFile], ExternalTool, CmdOption, IsMake= file=3DIsMakefile)=0D Attribute =3D []=0D HeaderLength =3D None=0D if self.ExtraHeaderSize !=3D -1:=0D @@ -273,6 +286,3 @@ class GuidSection(GuidSectionClassObject) : if IsMakefile and self.Alignment is not None and self.Alignmen= t.strip() =3D=3D '0':=0D self.Alignment =3D '1'=0D return OutputFileList, self.Alignment=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py b/BaseTo= ols/Source/Python/GenFds/OptRomFileStatement.py index 1bd4d4572a17..0caa55210af1 100644 --- a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomFileStatement.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process OptionROM generation from FILE statement=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -16,8 +16,10 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable ##=0D #=0D #=0D +=0D +=0D class OptRomFileStatement:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -26,7 +28,7 @@ class OptRomFileStatement: self.FileType =3D None=0D self.OverrideAttribs =3D None=0D =0D - ## GenFfs() method=0D + # GenFfs() method=0D #=0D # Generate FFS=0D #=0D @@ -34,15 +36,13 @@ class OptRomFileStatement: # @param Dict dictionary contains macro and value pair=0D # @retval string Generated FFS file name=0D #=0D - def GenFfs(self, Dict =3D None, IsMakefile=3DFalse):=0D + def GenFfs(self, Dict=3DNone, IsMakefile=3DFalse):=0D =0D if Dict is None:=0D Dict =3D {}=0D =0D if self.FileName is not None:=0D - self.FileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(s= elf.FileName)=0D + self.FileName =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(= =0D + self.FileName)=0D =0D return self.FileName=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py b/BaseToo= ls/Source/Python/GenFds/OptRomInfStatement.py index 8b570ed6bcbc..e4b3328d718b 100644 --- a/BaseTools/Source/Python/GenFds/OptRomInfStatement.py +++ b/BaseTools/Source/Python/GenFds/OptRomInfStatement.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process OptionROM generation from INF statement=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -23,8 +23,10 @@ from .GenFdsGlobalVariable import GenFdsGlobalVariable ##=0D #=0D #=0D +=0D +=0D class OptRomInfStatement (FfsInfStatement):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -32,7 +34,7 @@ class OptRomInfStatement (FfsInfStatement): FfsInfStatement.__init__(self)=0D self.OverrideAttribs =3D None=0D =0D - ## __GetOptRomParams() method=0D + # __GetOptRomParams() method=0D #=0D # Parse inf file to get option ROM related parameters=0D #=0D @@ -43,31 +45,37 @@ class OptRomInfStatement (FfsInfStatement): self.OverrideAttribs =3D OverrideAttribs()=0D =0D if self.OverrideAttribs.NeedCompress is None:=0D - self.OverrideAttribs.NeedCompress =3D self.OptRomDefs.get ('PC= I_COMPRESS')=0D + self.OverrideAttribs.NeedCompress =3D self.OptRomDefs.get(=0D + 'PCI_COMPRESS')=0D if self.OverrideAttribs.NeedCompress is not None:=0D if self.OverrideAttribs.NeedCompress.upper() not in ('TRUE= ', 'FALSE'):=0D - GenFdsGlobalVariable.ErrorLogger( "Expected TRUE/FALSE= for PCI_COMPRESS: %s" %self.InfFileName)=0D + GenFdsGlobalVariable.ErrorLogger(=0D + "Expected TRUE/FALSE for PCI_COMPRESS: %s" % self.= InfFileName)=0D self.OverrideAttribs.NeedCompress =3D \=0D self.OverrideAttribs.NeedCompress.upper() =3D=3D 'TRUE= '=0D =0D if self.OverrideAttribs.PciVendorId is None:=0D - self.OverrideAttribs.PciVendorId =3D self.OptRomDefs.get ('PCI= _VENDOR_ID')=0D + self.OverrideAttribs.PciVendorId =3D self.OptRomDefs.get(=0D + 'PCI_VENDOR_ID')=0D =0D if self.OverrideAttribs.PciClassCode is None:=0D - self.OverrideAttribs.PciClassCode =3D self.OptRomDefs.get ('PC= I_CLASS_CODE')=0D + self.OverrideAttribs.PciClassCode =3D self.OptRomDefs.get(=0D + 'PCI_CLASS_CODE')=0D =0D if self.OverrideAttribs.PciDeviceId is None:=0D - self.OverrideAttribs.PciDeviceId =3D self.OptRomDefs.get ('PCI= _DEVICE_ID')=0D + self.OverrideAttribs.PciDeviceId =3D self.OptRomDefs.get(=0D + 'PCI_DEVICE_ID')=0D =0D if self.OverrideAttribs.PciRevision is None:=0D - self.OverrideAttribs.PciRevision =3D self.OptRomDefs.get ('PCI= _REVISION')=0D + self.OverrideAttribs.PciRevision =3D self.OptRomDefs.get(=0D + 'PCI_REVISION')=0D =0D # InfObj =3D GenFdsGlobalVariable.WorkSpace.BuildObject[self.PathCl= assObj, self.CurrentArch]=0D # RecordList =3D InfObj._RawData[MODEL_META_DATA_HEADER, InfObj._Ar= ch, InfObj._Platform]=0D # for Record in RecordList:=0D # Record =3D ReplaceMacros(Record, GlobalData.gEdkGlobal, False= )=0D # Name =3D Record[0]=0D - ## GenFfs() method=0D + # GenFfs() method=0D #=0D # Generate FFS=0D #=0D @@ -85,21 +93,24 @@ class OptRomInfStatement (FfsInfStatement): # Get the rule of how to generate Ffs file=0D #=0D Rule =3D self.__GetRule__()=0D - GenFdsGlobalVariable.VerboseLogger( "Packing binaries from inf fil= e : %s" %self.InfFileName)=0D + GenFdsGlobalVariable.VerboseLogger(=0D + "Packing binaries from inf file : %s" % self.InfFileName)=0D #=0D # For the rule only has simpleFile=0D #=0D - if isinstance (Rule, RuleSimpleFile.RuleSimpleFile) :=0D - EfiOutputList =3D self.__GenSimpleFileSection__(Rule, IsMakefi= le=3DIsMakefile)=0D + if isinstance(Rule, RuleSimpleFile.RuleSimpleFile):=0D + EfiOutputList =3D self.__GenSimpleFileSection__(=0D + Rule, IsMakefile=3DIsMakefile)=0D return EfiOutputList=0D #=0D # For Rule has ComplexFile=0D #=0D elif isinstance(Rule, RuleComplexFile.RuleComplexFile):=0D - EfiOutputList =3D self.__GenComplexFileSection__(Rule, IsMakef= ile=3DIsMakefile)=0D + EfiOutputList =3D self.__GenComplexFileSection__(=0D + Rule, IsMakefile=3DIsMakefile)=0D return EfiOutputList=0D =0D - ## __GenSimpleFileSection__() method=0D + # __GenSimpleFileSection__() method=0D #=0D # Get .efi files according to simple rule.=0D #=0D @@ -107,7 +118,7 @@ class OptRomInfStatement (FfsInfStatement): # @param Rule The rule object used to generate section=0D # @retval string File name of the generated section file=0D #=0D - def __GenSimpleFileSection__(self, Rule, IsMakefile =3D False):=0D + def __GenSimpleFileSection__(self, Rule, IsMakefile=3DFalse):=0D #=0D # Prepare the parameter of GenSection=0D #=0D @@ -117,12 +128,12 @@ class OptRomInfStatement (FfsInfStatement): GenSecInputFile =3D self.__ExtendMacro__(Rule.FileName)=0D OutputFileList.append(GenSecInputFile)=0D else:=0D - OutputFileList, IsSect =3D Section.Section.GetFileList(self, '= ', Rule.FileExtension)=0D + OutputFileList, IsSect =3D Section.Section.GetFileList(=0D + self, '', Rule.FileExtension)=0D =0D return OutputFileList=0D =0D -=0D - ## __GenComplexFileSection__() method=0D + # __GenComplexFileSection__() method=0D #=0D # Get .efi by sections in complex Rule=0D #=0D @@ -130,6 +141,7 @@ class OptRomInfStatement (FfsInfStatement): # @param Rule The rule object used to generate section=0D # @retval string File name of the generated section file=0D #=0D +=0D def __GenComplexFileSection__(self, Rule, IsMakefile=3DFalse):=0D =0D OutputFileList =3D []=0D @@ -139,14 +151,16 @@ class OptRomInfStatement (FfsInfStatement): GenSecInputFile =3D self.__ExtendMacro__(Sect.FileName= )=0D OutputFileList.append(GenSecInputFile)=0D else:=0D - FileList, IsSect =3D Section.Section.GetFileList(self,= '', Sect.FileExtension)=0D + FileList, IsSect =3D Section.Section.GetFileList(=0D + self, '', Sect.FileExtension)=0D OutputFileList.extend(FileList)=0D =0D return OutputFileList=0D =0D +=0D class OverrideAttribs:=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D diff --git a/BaseTools/Source/Python/GenFds/OptionRom.py b/BaseTools/Source= /Python/GenFds/OptionRom.py index 61d669de8d08..f20c08edaf38 100644 --- a/BaseTools/Source/Python/GenFds/OptionRom.py +++ b/BaseTools/Source/Python/GenFds/OptionRom.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process OptionROM generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -23,16 +23,18 @@ from Common.BuildToolError import * ##=0D #=0D #=0D +=0D +=0D class OPTIONROM (OptionRomClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D - def __init__(self, Name =3D ""):=0D + def __init__(self, Name=3D""):=0D OptionRomClassObject.__init__(self)=0D self.DriverName =3D Name=0D =0D - ## AddToBuffer()=0D + # AddToBuffer()=0D #=0D # Generate Option ROM=0D #=0D @@ -40,26 +42,29 @@ class OPTIONROM (OptionRomClassObject): # @param Buffer The buffer generated OptROM data will be put=0D # @retval string Generated OptROM file path=0D #=0D - def AddToBuffer (self, Buffer, Flag=3DFalse) :=0D + def AddToBuffer(self, Buffer, Flag=3DFalse):=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger( "\nGenerating %s Option ROM ..= ." %self.DriverName)=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nGenerating %s Option ROM ..." % self.DriverName)=0D =0D EfiFileList =3D []=0D BinFileList =3D []=0D =0D # Process Modules in FfsList=0D - for FfsFile in self.FfsList :=0D + for FfsFile in self.FfsList:=0D =0D if isinstance(FfsFile, OptRomInfStatement.OptRomInfStatement):= =0D FilePathNameList =3D FfsFile.GenFfs(IsMakefile=3DFlag)=0D if len(FilePathNameList) =3D=3D 0:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s not= produce .efi files, so NO file could be put into option ROM." % (FfsFile.I= nfFileName))=0D + EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s not= produce .efi files, so NO file could be put into option ROM." % (=0D + FfsFile.InfFileName))=0D if FfsFile.OverrideAttribs is None:=0D EfiFileList.extend(FilePathNameList)=0D else:=0D FileName =3D os.path.basename(FilePathNameList[0])=0D - TmpOutputDir =3D os.path.join(GenFdsGlobalVariable.FvD= ir, self.DriverName, FfsFile.CurrentArch)=0D - if not os.path.exists(TmpOutputDir) :=0D + TmpOutputDir =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.DriverName, FfsFi= le.CurrentArch)=0D + if not os.path.exists(TmpOutputDir):=0D os.makedirs(TmpOutputDir)=0D TmpOutputFile =3D os.path.join(TmpOutputDir, FileName+= '.tmp')=0D =0D @@ -71,14 +76,15 @@ class OPTIONROM (OptionRomClassObject): FfsFile.Overrid= eAttribs.PciRevision,=0D FfsFile.Overrid= eAttribs.PciDeviceId,=0D FfsFile.Overrid= eAttribs.PciVendorId,=0D - IsMakefile =3D = Flag)=0D + IsMakefile=3DFl= ag)=0D BinFileList.append(TmpOutputFile)=0D else:=0D FilePathName =3D FfsFile.GenFfs(IsMakefile=3DFlag)=0D if FfsFile.OverrideAttribs is not None:=0D FileName =3D os.path.basename(FilePathName)=0D - TmpOutputDir =3D os.path.join(GenFdsGlobalVariable.FvD= ir, self.DriverName, FfsFile.CurrentArch)=0D - if not os.path.exists(TmpOutputDir) :=0D + TmpOutputDir =3D os.path.join(=0D + GenFdsGlobalVariable.FvDir, self.DriverName, FfsFi= le.CurrentArch)=0D + if not os.path.exists(TmpOutputDir):=0D os.makedirs(TmpOutputDir)=0D TmpOutputFile =3D os.path.join(TmpOutputDir, FileName+= '.tmp')=0D =0D @@ -105,20 +111,22 @@ class OPTIONROM (OptionRomClassObject): OutputFile =3D OutputFile + '.rom'=0D =0D GenFdsGlobalVariable.GenerateOptionRom(=0D - OutputFile,=0D - EfiFileList,=0D - BinFileList,=0D - IsMakefile=3DFlag)=0D + OutputFile,=0D + EfiFileList,=0D + BinFileList,=0D + IsMakefile=3DFlag)=0D =0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger( "\nGenerate %s Option ROM Succ= essfully" %self.DriverName)=0D + GenFdsGlobalVariable.InfLogger(=0D + "\nGenerate %s Option ROM Successfully" % self.DriverName)= =0D GenFdsGlobalVariable.SharpCounter =3D 0=0D =0D return OutputFile=0D =0D +=0D class OverrideAttribs:=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Py= thon/GenFds/Region.py index e95cfcf965d2..67c8879a4f29 100644 --- a/BaseTools/Source/Python/GenFds/Region.py +++ b/BaseTools/Source/Python/GenFds/Region.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process FD Region generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -22,12 +22,14 @@ from Common.LongFilePathSupport import OpenLongFilePath= as open from Common.MultipleWorkspace import MultipleWorkspace as mws=0D from Common.DataType import BINARY_FILE_TYPE_FV=0D =0D -## generate Region=0D +# generate Region=0D #=0D #=0D +=0D +=0D class Region(object):=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D @@ -40,7 +42,7 @@ class Region(object): self.RegionType =3D None=0D self.RegionDataList =3D []=0D =0D - ## PadBuffer()=0D + # PadBuffer()=0D #=0D # Add padding bytes to the Buffer=0D #=0D @@ -52,14 +54,14 @@ class Region(object): =0D def PadBuffer(self, Buffer, ErasePolarity, Size):=0D if Size > 0:=0D - if (ErasePolarity =3D=3D '1') :=0D + if (ErasePolarity =3D=3D '1'):=0D PadByte =3D pack('B', 0xFF)=0D else:=0D PadByte =3D pack('B', 0)=0D for i in range(0, Size):=0D Buffer.write(PadByte)=0D =0D - ## AddToBuffer()=0D + # AddToBuffer()=0D #=0D # Add region data to the Buffer=0D #=0D @@ -78,7 +80,8 @@ class Region(object): if MacroDict is None:=0D MacroDict =3D {}=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger('\nGenerate Region at Offset 0x= %X' % self.Offset)=0D + GenFdsGlobalVariable.InfLogger(=0D + '\nGenerate Region at Offset 0x%X' % self.Offset)=0D GenFdsGlobalVariable.InfLogger(" Region Size =3D 0x%X" % Siz= e)=0D GenFdsGlobalVariable.SharpCounter =3D 0=0D if Flag and (self.RegionType !=3D BINARY_FILE_TYPE_FV):=0D @@ -94,13 +97,17 @@ class Region(object): for RegionData in self.RegionDataList:=0D FileName =3D None=0D if RegionData.endswith(".fv"):=0D - RegionData =3D GenFdsGlobalVariable.MacroExtend(Region= Data, MacroDict)=0D + RegionData =3D GenFdsGlobalVariable.MacroExtend(=0D + RegionData, MacroDict)=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger(' Region FV File = Name =3D .fv : %s' % RegionData)=0D - if RegionData[1] !=3D ':' :=0D - RegionData =3D mws.join (GenFdsGlobalVariable.Work= SpaceDir, RegionData)=0D + GenFdsGlobalVariable.InfLogger(=0D + ' Region FV File Name =3D .fv : %s' % Region= Data)=0D + if RegionData[1] !=3D ':':=0D + RegionData =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, RegionData)= =0D if not os.path.exists(RegionData):=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraDat= a=3DRegionData)=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + ExtraData=3DRegionData)=0D =0D FileName =3D RegionData=0D elif RegionData.upper() + 'fv' in ImageBinDict:=0D @@ -113,17 +120,20 @@ class Region(object): #=0D FvObj =3D None=0D if RegionData.upper() in GenFdsGlobalVariable.FdfParse= r.Profile.FvDict:=0D - FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.F= vDict[RegionData.upper()]=0D + FvObj =3D GenFdsGlobalVariable.FdfParser.Profile.F= vDict[RegionData.upper(=0D + )]=0D =0D - if FvObj is not None :=0D + if FvObj is not None:=0D if not Flag:=0D - GenFdsGlobalVariable.InfLogger(' Region Name= =3D FV')=0D + GenFdsGlobalVariable.InfLogger(=0D + ' Region Name =3D FV')=0D #=0D # Call GenFv tool=0D #=0D self.BlockInfoOfRegion(BlockSizeList, FvObj)=0D self.FvAddress =3D self.FvAddress + FvOffset=0D - FvAlignValue =3D GenFdsGlobalVariable.GetAlignment= (FvObj.FvAlignment)=0D + FvAlignValue =3D GenFdsGlobalVariable.GetAlignment= (=0D + FvObj.FvAlignment)=0D if self.FvAddress % FvAlignValue !=3D 0:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D "FV (%s) is NOT %s Aligned!" %= (FvObj.UiFvName, FvObj.FvAlignment))=0D @@ -131,7 +141,8 @@ class Region(object): FvBaseAddress =3D '0x%X' % self.FvAddress=0D BlockSize =3D None=0D BlockNum =3D None=0D - FvObj.AddToBuffer(FvBuffer, FvBaseAddress, BlockSi= ze, BlockNum, ErasePolarity, Flag=3DFlag)=0D + FvObj.AddToBuffer(=0D + FvBuffer, FvBaseAddress, BlockSize, BlockNum, = ErasePolarity, Flag=3DFlag)=0D if Flag:=0D continue=0D =0D @@ -149,7 +160,8 @@ class Region(object): Size =3D Size - FvBufferLen=0D continue=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) i= s NOT described in FDF file!" % (RegionData))=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "FV (%s) is NOT descri= bed in FDF file!" % (RegionData))=0D #=0D # Add the exist Fv image into FD buffer=0D #=0D @@ -158,7 +170,7 @@ class Region(object): FileLength =3D os.stat(FileName)[ST_SIZE]=0D if FileLength > Size:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - "Size of FV File (%s) is large= r than Region Size 0x%X specified." \=0D + "Size of FV File (%s) is large= r than Region Size 0x%X specified."=0D % (RegionData, Size))=0D BinFile =3D open(FileName, 'rb')=0D Buffer.write(BinFile.read())=0D @@ -176,12 +188,16 @@ class Region(object): #=0D for RegionData in self.RegionDataList:=0D if RegionData.endswith(".cap"):=0D - RegionData =3D GenFdsGlobalVariable.MacroExtend(Region= Data, MacroDict)=0D - GenFdsGlobalVariable.InfLogger(' Region CAPSULE Imag= e Name =3D .cap : %s' % RegionData)=0D - if RegionData[1] !=3D ':' :=0D - RegionData =3D mws.join (GenFdsGlobalVariable.Work= SpaceDir, RegionData)=0D + RegionData =3D GenFdsGlobalVariable.MacroExtend(=0D + RegionData, MacroDict)=0D + GenFdsGlobalVariable.InfLogger(=0D + ' Region CAPSULE Image Name =3D .cap : %s' % Reg= ionData)=0D + if RegionData[1] !=3D ':':=0D + RegionData =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, RegionData)= =0D if not os.path.exists(RegionData):=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraDat= a=3DRegionData)=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + ExtraData=3DRegionData)=0D =0D FileName =3D RegionData=0D elif RegionData.upper() + 'cap' in ImageBinDict:=0D @@ -193,18 +209,21 @@ class Region(object): #=0D CapsuleObj =3D None=0D if RegionData.upper() in GenFdsGlobalVariable.FdfParse= r.Profile.CapsuleDict:=0D - CapsuleObj =3D GenFdsGlobalVariable.FdfParser.Prof= ile.CapsuleDict[RegionData.upper()]=0D + CapsuleObj =3D GenFdsGlobalVariable.FdfParser.Prof= ile.CapsuleDict[RegionData.upper(=0D + )]=0D =0D - if CapsuleObj is not None :=0D + if CapsuleObj is not None:=0D CapsuleObj.CapsuleName =3D RegionData.upper()=0D - GenFdsGlobalVariable.InfLogger(' Region Name =3D= CAPSULE')=0D + GenFdsGlobalVariable.InfLogger(=0D + ' Region Name =3D CAPSULE')=0D #=0D # Call GenFv tool to generate Capsule Image=0D #=0D FileName =3D CapsuleObj.GenCapsule()=0D CapsuleObj.CapsuleName =3D None=0D else:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Capsule (= %s) is NOT described in FDF file!" % (RegionData))=0D + EdkLogger.error(=0D + "GenFds", GENFDS_ERROR, "Capsule (%s) is NOT d= escribed in FDF file!" % (RegionData))=0D =0D #=0D # Add the capsule image into FD buffer=0D @@ -212,7 +231,7 @@ class Region(object): FileLength =3D os.stat(FileName)[ST_SIZE]=0D if FileLength > Size:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - "Size 0x%X of Capsule File (%s) is lar= ger than Region Size 0x%X specified." \=0D + "Size 0x%X of Capsule File (%s) is lar= ger than Region Size 0x%X specified."=0D % (FileLength, RegionData, Size))=0D BinFile =3D open(FileName, 'rb')=0D Buffer.write(BinFile.read())=0D @@ -228,24 +247,29 @@ class Region(object): if self.RegionType =3D=3D 'INF':=0D RegionData.__InfParse__(None)=0D if len(RegionData.BinFileList) !=3D 1:=0D - EdkLogger.error('GenFds', GENFDS_ERROR, 'INF in FD= region can only contain one binary: %s' % RegionData)=0D + EdkLogger.error(=0D + 'GenFds', GENFDS_ERROR, 'INF in FD region can = only contain one binary: %s' % RegionData)=0D File =3D RegionData.BinFileList[0]=0D RegionData =3D RegionData.PatchEfiFile(File.Path, File= .Type)=0D else:=0D - RegionData =3D GenFdsGlobalVariable.MacroExtend(Region= Data, MacroDict)=0D - if RegionData[1] !=3D ':' :=0D - RegionData =3D mws.join (GenFdsGlobalVariable.Work= SpaceDir, RegionData)=0D + RegionData =3D GenFdsGlobalVariable.MacroExtend(=0D + RegionData, MacroDict)=0D + if RegionData[1] !=3D ':':=0D + RegionData =3D mws.join(=0D + GenFdsGlobalVariable.WorkSpaceDir, RegionData)= =0D if not os.path.exists(RegionData):=0D - EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraDat= a=3DRegionData)=0D + EdkLogger.error("GenFds", FILE_NOT_FOUND,=0D + ExtraData=3DRegionData)=0D #=0D # Add the file image into FD buffer=0D #=0D FileLength =3D os.stat(RegionData)[ST_SIZE]=0D if FileLength > Size:=0D EdkLogger.error("GenFds", GENFDS_ERROR,=0D - "Size of File (%s) is larger than Regi= on Size 0x%X specified." \=0D + "Size of File (%s) is larger than Regi= on Size 0x%X specified."=0D % (RegionData, Size))=0D - GenFdsGlobalVariable.InfLogger(' Region File Name =3D %s= ' % RegionData)=0D + GenFdsGlobalVariable.InfLogger(=0D + ' Region File Name =3D %s' % RegionData)=0D BinFile =3D open(RegionData, 'rb')=0D Buffer.write(BinFile.read())=0D BinFile.close()=0D @@ -255,16 +279,17 @@ class Region(object): #=0D self.PadBuffer(Buffer, ErasePolarity, Size)=0D =0D - if self.RegionType =3D=3D 'DATA' :=0D + if self.RegionType =3D=3D 'DATA':=0D GenFdsGlobalVariable.InfLogger(' Region Name =3D DATA')=0D DataSize =3D 0=0D for RegionData in self.RegionDataList:=0D Data =3D RegionData.split(',')=0D DataSize =3D DataSize + len(Data)=0D if DataSize > Size:=0D - EdkLogger.error("GenFds", GENFDS_ERROR, "Size of DATA i= s larger than Region Size ")=0D + EdkLogger.error("GenFds", GENFDS_ERROR,=0D + "Size of DATA is larger than Region Si= ze ")=0D else:=0D - for item in Data :=0D + for item in Data:=0D Buffer.write(pack('B', int(item, 16)))=0D Size =3D Size - DataSize=0D #=0D @@ -276,7 +301,7 @@ class Region(object): GenFdsGlobalVariable.InfLogger(' Region Name =3D None')=0D self.PadBuffer(Buffer, ErasePolarity, Size)=0D =0D - ## BlockSizeOfRegion()=0D + # BlockSizeOfRegion()=0D #=0D # @param BlockSizeList List of block information=0D # @param FvObj The object for FV=0D @@ -296,7 +321,8 @@ class Region(object): else:=0D # region ended within current blocks=0D if self.Offset + self.Size <=3D End:=0D - ExpectedList.append((BlockSize, (RemindingSize + Block= Size - 1) // BlockSize))=0D + ExpectedList.append(=0D + (BlockSize, (RemindingSize + BlockSize - 1) // Blo= ckSize))=0D break=0D # region not ended yet=0D else:=0D @@ -337,12 +363,9 @@ class Region(object): % FvObj.UiFvName, ExtraData=3DExpected= ListData)=0D elif Item[1] !=3D ExpectedList[Index][1]:=0D if (Item[1] < ExpectedList[Index][1]) and (Index =3D= =3D len(FvObj.BlockSizeList) - 1):=0D - break;=0D + break=0D else:=0D EdkLogger.error("GenFds", GENFDS_ERROR, "BlockStat= ements of FV %s are not align with FD's, suggested FV BlockStatement"=0D % FvObj.UiFvName, ExtraData=3DExpe= ctedListData)=0D else:=0D Index +=3D 1=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/GenFds/Rule.py b/BaseTools/Source/Pyth= on/GenFds/Rule.py index 6561c0efd80f..79ea99441d90 100644 --- a/BaseTools/Source/Python/GenFds/Rule.py +++ b/BaseTools/Source/Python/GenFds/Rule.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Rule object for generating FFS=0D #=0D # Copyright (c) 2007, Intel Corporation. All rights reserved.
        =0D @@ -11,11 +11,13 @@ #=0D from CommonDataClass.FdfClass import RuleClassObject=0D =0D -## Rule base class=0D +# Rule base class=0D #=0D #=0D +=0D +=0D class Rule(RuleClassObject):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D diff --git a/BaseTools/Source/Python/GenFds/RuleComplexFile.py b/BaseTools/= Source/Python/GenFds/RuleComplexFile.py index 198f4f0a9ab3..ed5dd4ee371c 100644 --- a/BaseTools/Source/Python/GenFds/RuleComplexFile.py +++ b/BaseTools/Source/Python/GenFds/RuleComplexFile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Complex Rule object for generating FFS=0D #=0D # Copyright (c) 2007, Intel Corporation. All rights reserved.
        =0D @@ -11,13 +11,15 @@ #=0D from __future__ import absolute_import=0D from . import Rule=0D -from CommonDataClass.FdfClass import RuleComplexFileClassObject=0D +from CommonDataClass.FdfClass import RuleComplexFileClassObject=0D =0D -## complex rule=0D +# complex rule=0D #=0D #=0D -class RuleComplexFile(RuleComplexFileClassObject) :=0D - ## The constructor=0D +=0D +=0D +class RuleComplexFile(RuleComplexFileClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D diff --git a/BaseTools/Source/Python/GenFds/RuleSimpleFile.py b/BaseTools/S= ource/Python/GenFds/RuleSimpleFile.py index 772c768cc982..0b705db8ed1b 100644 --- a/BaseTools/Source/Python/GenFds/RuleSimpleFile.py +++ b/BaseTools/Source/Python/GenFds/RuleSimpleFile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Simple Rule object for generating FFS=0D #=0D # Copyright (c) 2007, Intel Corporation. All rights reserved.
        =0D @@ -13,11 +13,13 @@ from __future__ import absolute_import from . import Rule=0D from CommonDataClass.FdfClass import RuleSimpleFileClassObject=0D =0D -## simple rule=0D +# simple rule=0D #=0D #=0D -class RuleSimpleFile (RuleSimpleFileClassObject) :=0D - ## The constructor=0D +=0D +=0D +class RuleSimpleFile (RuleSimpleFileClassObject):=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/P= ython/GenFds/Section.py index 447828c8e588..9fa4534f0fde 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # section base class=0D #=0D # Copyright (c) 2007-2018, Intel Corporation. All rights reserved.
        =0D @@ -12,75 +12,78 @@ from __future__ import absolute_import=0D from CommonDataClass.FdfClass import SectionClassObject=0D from .GenFdsGlobalVariable import GenFdsGlobalVariable=0D -import Common.LongFilePathOs as os, glob=0D +import Common.LongFilePathOs as os=0D +import glob=0D from Common import EdkLogger=0D from Common.BuildToolError import *=0D from Common.DataType import *=0D =0D -## section base class=0D +# section base class=0D #=0D #=0D +=0D +=0D class Section (SectionClassObject):=0D SectionType =3D {=0D - 'RAW' : 'EFI_SECTION_RAW',=0D - 'FREEFORM' : 'EFI_SECTION_FREEFORM_SUBTYPE_GUID',=0D - BINARY_FILE_TYPE_PE32 : 'EFI_SECTION_PE32',=0D - BINARY_FILE_TYPE_PIC : 'EFI_SECTION_PIC',=0D - BINARY_FILE_TYPE_TE : 'EFI_SECTION_TE',=0D - 'FV_IMAGE' : 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',=0D - BINARY_FILE_TYPE_DXE_DEPEX : 'EFI_SECTION_DXE_DEPEX',=0D - BINARY_FILE_TYPE_PEI_DEPEX : 'EFI_SECTION_PEI_DEPEX',=0D - 'GUIDED' : 'EFI_SECTION_GUID_DEFINED',=0D - 'COMPRESS' : 'EFI_SECTION_COMPRESSION',=0D - BINARY_FILE_TYPE_UI : 'EFI_SECTION_USER_INTERFACE',=0D - BINARY_FILE_TYPE_SMM_DEPEX : 'EFI_SECTION_SMM_DEPEX'=0D + 'RAW': 'EFI_SECTION_RAW',=0D + 'FREEFORM': 'EFI_SECTION_FREEFORM_SUBTYPE_GUID',=0D + BINARY_FILE_TYPE_PE32: 'EFI_SECTION_PE32',=0D + BINARY_FILE_TYPE_PIC: 'EFI_SECTION_PIC',=0D + BINARY_FILE_TYPE_TE: 'EFI_SECTION_TE',=0D + 'FV_IMAGE': 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',=0D + BINARY_FILE_TYPE_DXE_DEPEX: 'EFI_SECTION_DXE_DEPEX',=0D + BINARY_FILE_TYPE_PEI_DEPEX: 'EFI_SECTION_PEI_DEPEX',=0D + 'GUIDED': 'EFI_SECTION_GUID_DEFINED',=0D + 'COMPRESS': 'EFI_SECTION_COMPRESSION',=0D + BINARY_FILE_TYPE_UI: 'EFI_SECTION_USER_INTERFACE',=0D + BINARY_FILE_TYPE_SMM_DEPEX: 'EFI_SECTION_SMM_DEPEX'=0D }=0D =0D BinFileType =3D {=0D - BINARY_FILE_TYPE_GUID : '.guid',=0D - 'ACPI' : '.acpi',=0D - 'ASL' : '.asl' ,=0D - BINARY_FILE_TYPE_UEFI_APP : '.app',=0D - BINARY_FILE_TYPE_LIB : '.lib',=0D - BINARY_FILE_TYPE_PE32 : '.pe32',=0D - BINARY_FILE_TYPE_PIC : '.pic',=0D - BINARY_FILE_TYPE_PEI_DEPEX : '.depex',=0D - 'SEC_PEI_DEPEX' : '.depex',=0D - BINARY_FILE_TYPE_TE : '.te',=0D - BINARY_FILE_TYPE_UNI_VER : '.ver',=0D - BINARY_FILE_TYPE_VER : '.ver',=0D - BINARY_FILE_TYPE_UNI_UI : '.ui',=0D - BINARY_FILE_TYPE_UI : '.ui',=0D - BINARY_FILE_TYPE_BIN : '.bin',=0D - 'RAW' : '.raw',=0D - 'COMPAT16' : '.comp16',=0D - BINARY_FILE_TYPE_FV : '.fv'=0D + BINARY_FILE_TYPE_GUID: '.guid',=0D + 'ACPI': '.acpi',=0D + 'ASL': '.asl',=0D + BINARY_FILE_TYPE_UEFI_APP: '.app',=0D + BINARY_FILE_TYPE_LIB: '.lib',=0D + BINARY_FILE_TYPE_PE32: '.pe32',=0D + BINARY_FILE_TYPE_PIC: '.pic',=0D + BINARY_FILE_TYPE_PEI_DEPEX: '.depex',=0D + 'SEC_PEI_DEPEX': '.depex',=0D + BINARY_FILE_TYPE_TE: '.te',=0D + BINARY_FILE_TYPE_UNI_VER: '.ver',=0D + BINARY_FILE_TYPE_VER: '.ver',=0D + BINARY_FILE_TYPE_UNI_UI: '.ui',=0D + BINARY_FILE_TYPE_UI: '.ui',=0D + BINARY_FILE_TYPE_BIN: '.bin',=0D + 'RAW': '.raw',=0D + 'COMPAT16': '.comp16',=0D + BINARY_FILE_TYPE_FV: '.fv'=0D }=0D =0D SectFileType =3D {=0D - 'SEC_GUID' : '.sec' ,=0D - 'SEC_PE32' : '.sec' ,=0D - 'SEC_PIC' : '.sec',=0D - 'SEC_TE' : '.sec',=0D - 'SEC_VER' : '.sec',=0D - 'SEC_UI' : '.sec',=0D - 'SEC_COMPAT16' : '.sec',=0D - 'SEC_BIN' : '.sec'=0D + 'SEC_GUID': '.sec',=0D + 'SEC_PE32': '.sec',=0D + 'SEC_PIC': '.sec',=0D + 'SEC_TE': '.sec',=0D + 'SEC_VER': '.sec',=0D + 'SEC_UI': '.sec',=0D + 'SEC_COMPAT16': '.sec',=0D + 'SEC_BIN': '.sec'=0D }=0D =0D ToolGuid =3D {=0D - '0xa31280ad-0x481e-0x41b6-0x95e8-0x127f-0x4c984779' : 'TianoCompre= ss',=0D - '0xee4e5898-0x3914-0x4259-0x9d6e-0xdc7b-0xd79403cf' : 'LzmaCompres= s'=0D + '0xa31280ad-0x481e-0x41b6-0x95e8-0x127f-0x4c984779': 'TianoCompres= s',=0D + '0xee4e5898-0x3914-0x4259-0x9d6e-0xdc7b-0xd79403cf': 'LzmaCompress= '=0D }=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D SectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # virtual function=0D #=0D @@ -92,10 +95,10 @@ class Section (SectionClassObject): # @param FfsInf FfsInfStatement object that contains this sect= ion data=0D # @param Dict dictionary contains macro and its value=0D #=0D - def GenSection(self, OutputPath, GuidName, SecNum, keyStringList, FfsI= nf =3D None, Dict =3D None):=0D + def GenSection(self, OutputPath, GuidName, SecNum, keyStringList, FfsI= nf=3DNone, Dict=3DNone):=0D pass=0D =0D - ## GetFileList() method=0D + # GetFileList() method=0D #=0D # Generate compressed section=0D #=0D @@ -106,12 +109,12 @@ class Section (SectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (File list, boolean)=0D #=0D - def GetFileList(FfsInf, FileType, FileExtension, Dict =3D None, IsMake= file=3DFalse, SectionType=3DNone):=0D + def GetFileList(FfsInf, FileType, FileExtension, Dict=3DNone, IsMakefi= le=3DFalse, SectionType=3DNone):=0D IsSect =3D FileType in Section.SectFileType=0D =0D if FileExtension is not None:=0D Suffix =3D FileExtension=0D - elif IsSect :=0D + elif IsSect:=0D Suffix =3D Section.SectionType.get(FileType)=0D else:=0D Suffix =3D Section.BinFileType.get(FileType)=0D @@ -122,17 +125,21 @@ class Section (SectionClassObject): if FileType is not None:=0D for File in FfsInf.BinFileList:=0D if File.Arch =3D=3D TAB_ARCH_COMMON or FfsInf.CurrentArch = =3D=3D File.Arch:=0D - if File.Type =3D=3D FileType or (int(FfsInf.PiSpecVers= ion, 16) >=3D 0x0001000A \=0D + if File.Type =3D=3D FileType or (int(FfsInf.PiSpecVers= ion, 16) >=3D 0x0001000A=0D and FileType =3D=3D 'DXE_= DPEX' and File.Type =3D=3D BINARY_FILE_TYPE_SMM_DEPEX) \=0D - or (FileType =3D=3D BINAR= Y_FILE_TYPE_TE and File.Type =3D=3D BINARY_FILE_TYPE_PE32):=0D + or (FileType =3D=3D BINARY_FILE_TYPE_TE and Fi= le.Type =3D=3D BINARY_FILE_TYPE_PE32):=0D if TAB_STAR in FfsInf.TargetOverrideList or File.T= arget =3D=3D TAB_STAR or File.Target in FfsInf.TargetOverrideList or FfsInf= .TargetOverrideList =3D=3D []:=0D - FileList.append(FfsInf.PatchEfiFile(File.Path,= File.Type))=0D + FileList.append(=0D + FfsInf.PatchEfiFile(File.Path, File.Type))= =0D else:=0D - GenFdsGlobalVariable.InfLogger ("\nBuild Targe= t \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %= (File.Target, File.File, FfsInf.TargetOverrideList, FfsInf.InfFileName))=0D + GenFdsGlobalVariable.InfLogger("\nBuild Target= \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" % = (=0D + File.Target, File.File, FfsInf.TargetOverr= ideList, FfsInf.InfFileName))=0D else:=0D - GenFdsGlobalVariable.VerboseLogger ("\nFile Type \= '%s\' of File %s in %s is not same with file type \'%s\' from Rule in FDF" = %(File.Type, File.File, FfsInf.InfFileName, FileType))=0D + GenFdsGlobalVariable.VerboseLogger("\nFile Type \'= %s\' of File %s in %s is not same with file type \'%s\' from Rule in FDF" %= (=0D + File.Type, File.File, FfsInf.InfFileName, File= Type))=0D else:=0D - GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\'= of File %s is not in the Support Arch Scope of %s specified by INF %s in F= DF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))=0D + GenFdsGlobalVariable.InfLogger("\nCurrent ARCH \'%s\' = of File %s is not in the Support Arch Scope of %s specified by INF %s in FD= F" % (=0D + FfsInf.CurrentArch, File.File, File.Arch, FfsInf.I= nfFileName))=0D =0D elif FileType is None and SectionType =3D=3D BINARY_FILE_TYPE_RAW:= =0D for File in FfsInf.BinFileList:=0D @@ -145,8 +152,8 @@ class Section (SectionClassObject): if Suffix in SuffixMap:=0D FileList.extend(SuffixMap[Suffix])=0D =0D - #Process the file lists is alphabetical for a same section type=0D - if len (FileList) > 1:=0D + # Process the file lists is alphabetical for a same section type=0D + if len(FileList) > 1:=0D FileList.sort()=0D =0D return FileList, IsSect=0D diff --git a/BaseTools/Source/Python/GenFds/UiSection.py b/BaseTools/Source= /Python/GenFds/UiSection.py index f643058bd637..964bf4de9622 100644 --- a/BaseTools/Source/Python/GenFds/UiSection.py +++ b/BaseTools/Source/Python/GenFds/UiSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process UI section generation=0D #=0D # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
        = =0D @@ -19,19 +19,21 @@ from CommonDataClass.FdfClass import UiSectionClassObje= ct from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.DataType import *=0D =0D -## generate UI section=0D +# generate UI section=0D #=0D #=0D +=0D +=0D class UiSection (UiSectionClassObject):=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D UiSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate UI section=0D #=0D @@ -44,7 +46,7 @@ class UiSection (UiSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name, section alignment)=0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D #=0D # Prepare the parameter of GenSection=0D #=0D @@ -53,21 +55,24 @@ class UiSection (UiSectionClassObject): self.StringData =3D FfsInf.__ExtendMacro__(self.StringData)=0D self.FileName =3D FfsInf.__ExtendMacro__(self.FileName)=0D =0D - OutputFile =3D os.path.join(OutputPath, ModuleName + SUP_MODULE_SE= C + SecNum + SectionSuffix.get(BINARY_FILE_TYPE_UI))=0D + OutputFile =3D os.path.join(=0D + OutputPath, ModuleName + SUP_MODULE_SEC + SecNum + SectionSuff= ix.get(BINARY_FILE_TYPE_UI))=0D =0D - if self.StringData is not None :=0D + if self.StringData is not None:=0D NameString =3D self.StringData=0D elif self.FileName is not None:=0D if Dict is None:=0D Dict =3D {}=0D - FileNameStr =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(sel= f.FileName)=0D + FileNameStr =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(=0D + self.FileName)=0D FileNameStr =3D GenFdsGlobalVariable.MacroExtend(FileNameStr, = Dict)=0D FileObj =3D open(FileNameStr, 'r')=0D NameString =3D FileObj.read()=0D FileObj.close()=0D else:=0D NameString =3D ''=0D - GenFdsGlobalVariable.GenerateSection(OutputFile, None, 'EFI_SECTIO= N_USER_INTERFACE', Ui=3DNameString, IsMakefile=3DIsMakefile)=0D + GenFdsGlobalVariable.GenerateSection(=0D + OutputFile, None, 'EFI_SECTION_USER_INTERFACE', Ui=3DNameStrin= g, IsMakefile=3DIsMakefile)=0D =0D OutputFileList =3D []=0D OutputFileList.append(OutputFile)=0D diff --git a/BaseTools/Source/Python/GenFds/VerSection.py b/BaseTools/Sourc= e/Python/GenFds/VerSection.py index 7280e80cb4ef..7cd2e30d4a2b 100644 --- a/BaseTools/Source/Python/GenFds/VerSection.py +++ b/BaseTools/Source/Python/GenFds/VerSection.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # process Version section generation=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -17,19 +17,21 @@ from CommonDataClass.FdfClass import VerSectionClassObj= ect from Common.LongFilePathSupport import OpenLongFilePath as open=0D from Common.DataType import SUP_MODULE_SEC=0D =0D -## generate version section=0D +# generate version section=0D #=0D #=0D +=0D +=0D class VerSection (VerSectionClassObject):=0D =0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D #=0D def __init__(self):=0D VerSectionClassObject.__init__(self)=0D =0D - ## GenSection() method=0D + # GenSection() method=0D #=0D # Generate version section=0D #=0D @@ -42,7 +44,7 @@ class VerSection (VerSectionClassObject): # @param Dict dictionary contains macro and its value=0D # @retval tuple (Generated file name, section alignment)=0D #=0D - def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile =3D False):=0D + def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, Ff= sInf=3DNone, Dict=3DNone, IsMakefile=3DFalse):=0D #=0D # Prepare the parameter of GenSection=0D #=0D @@ -63,7 +65,8 @@ class VerSection (VerSectionClassObject): elif self.FileName:=0D if Dict is None:=0D Dict =3D {}=0D - FileNameStr =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(sel= f.FileName)=0D + FileNameStr =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(=0D + self.FileName)=0D FileNameStr =3D GenFdsGlobalVariable.MacroExtend(FileNameStr, = Dict)=0D FileObj =3D open(FileNameStr, 'r')=0D StringData =3D FileObj.read()=0D diff --git a/BaseTools/Source/Python/GenFds/__init__.py b/BaseTools/Source/= Python/GenFds/__init__.py index 09ea47ea5710..083caeeba2d5 100644 --- a/BaseTools/Source/Python/GenFds/__init__.py +++ b/BaseTools/Source/Python/GenFds/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'GenFds' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py b= /BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py index d962ab0adda7..e589e7e2db64 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Generate PCD table for 'Patchable In Module' type PCD with given .map fi= le.=0D # The Patch PCD table like:=0D #=0D @@ -10,7 +10,7 @@ #=0D #=0D =0D -#=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 External 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=0D +# =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 External 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=0D from __future__ import print_function=0D import optparse=0D import Common.LongFilePathOs as os=0D @@ -28,10 +28,12 @@ __version_number__ =3D ("0.10" + " " + gBUILD_VERSION) __version__ =3D "%prog Version " + __version_number__=0D __copyright__ =3D "Copyright (c) 2008 - 2018, Intel Corporation. All right= s reserved."=0D =0D -#=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=0D +# =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=0D +=0D +# =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=3D=3D=3D=3D=3D=3D Code =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=3D=3D=3D=3D=3D=3D=3D=0D +symRe =3D re.compile(=0D + '^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+) +([\da-fA-F]+)'= , re.UNICODE)=0D =0D -#=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=3D=3D=3D=3D=3D=3D Code =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=3D=3D=3D=3D=3D=3D=3D=0D -symRe =3D re.compile('^([\da-fA-F]+):([\da-fA-F]+) +([\.\-:\\\\\w\?@\$<>]+= ) +([\da-fA-F]+)', re.UNICODE)=0D =0D def parsePcdInfoFromMapFile(mapfilepath, efifilepath):=0D """ Parse map file to get binary patch pcd information=0D @@ -47,25 +49,28 @@ def parsePcdInfoFromMapFile(mapfilepath, efifilepath): except:=0D return None=0D =0D - if len(lines) =3D=3D 0: return None=0D + if len(lines) =3D=3D 0:=0D + return None=0D firstline =3D lines[0].strip()=0D if re.match('^\s*Address\s*Size\s*Align\s*Out\s*In\s*Symbol\s*$', firs= tline):=0D return _parseForXcodeAndClang9(lines, efifilepath)=0D if (firstline.startswith("Archive member included ") and=0D - firstline.endswith(" file (symbol)")):=0D + firstline.endswith(" file (symbol)")):=0D return _parseForGCC(lines, efifilepath)=0D if firstline.startswith("# Path:"):=0D return _parseForXcodeAndClang9(lines, efifilepath)=0D return _parseGeneral(lines, efifilepath)=0D =0D +=0D def _parseForXcodeAndClang9(lines, efifilepath):=0D - valuePattern =3D re.compile('^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_Binar= yPatch_([\w]+))')=0D + valuePattern =3D re.compile(=0D + '^([\da-fA-FxX]+)([\s\S]*)([_]*_gPcd_BinaryPatch_([\w]+))')=0D status =3D 0=0D pcds =3D []=0D for line in lines:=0D line =3D line.strip()=0D - if status =3D=3D 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out= \s*In\s*Symbol\s*$', line) \=0D - or line =3D=3D "# Symbols:"):=0D + if status =3D=3D 0 and (re.match('^\s*Address\s*Size\s*Align\s*Out= \s*In\s*Symbol\s*$', line)=0D + or line =3D=3D "# Symbols:"):=0D status =3D 1=0D continue=0D if status =3D=3D 1 and len(line) !=3D 0:=0D @@ -75,6 +80,7 @@ def _parseForXcodeAndClang9(lines, efifilepath): pcds.append((m.groups(0)[3], int(m.groups(0)[0], 16)))= =0D return pcds=0D =0D +=0D def _parseForGCC(lines, efifilepath):=0D """ Parse map file generated by GCC linker """=0D dataPattern =3D re.compile('^.data._gPcd_BinaryPatch_([\w_\d]+)$')=0D @@ -91,7 +97,7 @@ def _parseForGCC(lines, efifilepath): elif status =3D=3D 1 and line =3D=3D 'Linker script and memory map= ':=0D status =3D 2=0D continue=0D - elif status =3D=3D2 and line =3D=3D 'START GROUP':=0D + elif status =3D=3D 2 and line =3D=3D 'START GROUP':=0D status =3D 3=0D continue=0D =0D @@ -107,13 +113,14 @@ def _parseForGCC(lines, efifilepath): PcdName =3D m.groups(0)[0]=0D m =3D pcdPatternGcc.match(lines[index + 1].strip())=0D if m is not None:=0D - bpcds.append((PcdName, int(m.groups(0)[0], 16), in= t(sections[-1][1], 16), sections[-1][0]))=0D + bpcds.append((PcdName, int(m.groups(0)[0], 16), in= t(=0D + sections[-1][1], 16), sections[-1][0]))=0D =0D # get section information from efi file=0D efisecs =3D PeImageClass(efifilepath).SectionHeaderList=0D if efisecs is None or len(efisecs) =3D=3D 0:=0D return None=0D - #redirection=0D + # redirection=0D redirection =3D 0=0D for efisec in efisecs:=0D for section in sections:=0D @@ -124,16 +131,18 @@ def _parseForGCC(lines, efifilepath): for efisec in efisecs:=0D if pcd[1] >=3D efisec[1] and pcd[1] < efisec[1]+efisec[3]:=0D #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"=0D - pcds.append([pcd[0], efisec[2] + pcd[1] - efisec[1] - redi= rection, efisec[0]])=0D + pcds.append([pcd[0], efisec[2] + pcd[1] -=0D + efisec[1] - redirection, efisec[0]])=0D return pcds=0D =0D +=0D def _parseGeneral(lines, efifilepath):=0D """ For MSFT, ICC, EBC=0D @param lines line array for map file=0D =0D @return a list which element hold (PcdName, Offset, SectionName)=0D """=0D - status =3D 0 #0 - beginning of file; 1 - PE section definition; 2 -= symbol table=0D + status =3D 0 # 0 - beginning of file; 1 - PE section definition; 2 - = symbol table=0D secs =3D [] # key =3D section name=0D bPcds =3D []=0D symPattern =3D re.compile('^[_]+gPcd_BinaryPatch_([\w]+)')=0D @@ -153,7 +162,8 @@ def _parseGeneral(lines, efifilepath): m =3D secReGeneral.match(line)=0D assert m is not None, "Fail to parse the section in map file ,= line is %s" % line=0D sec_no, sec_start, sec_length, sec_name, sec_class =3D m.group= s(0)=0D - secs.append([int(sec_no, 16), int(sec_start, 16), int(sec_leng= th, 16), sec_name, sec_class])=0D + secs.append([int(sec_no, 16), int(sec_start, 16),=0D + int(sec_length, 16), sec_name, sec_class])=0D if status =3D=3D 2 and len(line) !=3D 0:=0D m =3D symRe.match(line)=0D assert m is not None, "Fail to parse the symbol in map file, l= ine is %s" % line=0D @@ -166,9 +176,11 @@ def _parseGeneral(lines, efifilepath): # fond a binary pcd entry in map file=0D for sec in secs:=0D if sec[0] =3D=3D sec_no and (sym_offset >=3D sec[1] an= d sym_offset < sec[1] + sec[2]):=0D - bPcds.append([m2.groups(0)[0], sec[3], sym_offset,= vir_addr, sec_no])=0D + bPcds.append([m2.groups(0)[0], sec[3],=0D + sym_offset, vir_addr, sec_no])=0D =0D - if len(bPcds) =3D=3D 0: return None=0D + if len(bPcds) =3D=3D 0:=0D + return None=0D =0D # get section information from efi file=0D efisecs =3D PeImageClass(efifilepath).SectionHeaderList=0D @@ -186,6 +198,7 @@ def _parseGeneral(lines, efifilepath): pcds.append([pcd[0], efisec[2] + pcd[2], efisec[0]])=0D return pcds=0D =0D +=0D def generatePcdTable(list, pcdpath):=0D try:=0D f =3D open(pcdpath, 'w')=0D @@ -195,15 +208,18 @@ def generatePcdTable(list, pcdpath): f.write('PCD Name Offset Section Name\r\n')=0D =0D for pcditem in list:=0D - f.write('%-30s 0x%-08X %-6s\r\n' % (pcditem[0], pcditem[1], pcdite= m[2]))=0D + f.write('%-30s 0x%-08X %-6s\r\n' %=0D + (pcditem[0], pcditem[1], pcditem[2]))=0D f.close()=0D =0D - #print 'Success to generate Binary Patch PCD table at %s!' % pcdpath=0D + # print 'Success to generate Binary Patch PCD table at %s!' % pcdpath= =0D +=0D =0D if __name__ =3D=3D '__main__':=0D UsageString =3D "%prog -m -e -o "=0D AdditionalNotes =3D "\nPCD table is generated in file name with .Binar= yPcdTable.txt postfix"=0D - parser =3D optparse.OptionParser(description=3D__copyright__, version= =3D__version__, usage=3DUsageString)=0D + parser =3D optparse.OptionParser(=0D + description=3D__copyright__, version=3D__version__, usage=3DUsageS= tring)=0D parser.add_option('-m', '--mapfile', action=3D'store', dest=3D'mapfile= ',=0D help=3D'Absolute path of module map file.')=0D parser.add_option('-e', '--efifile', action=3D'store', dest=3D'efifile= ',=0D @@ -221,7 +237,8 @@ if __name__ =3D=3D '__main__': if options.outfile is not None:=0D generatePcdTable(list, options.outfile)=0D else:=0D - generatePcdTable(list, options.mapfile.replace('.map', '.B= inaryPcdTable.txt'))=0D + generatePcdTable(list, options.mapfile.replace(=0D + '.map', '.BinaryPcdTable.txt'))=0D else:=0D print('Fail to generate Patch PCD Table based on map file and = efi file')=0D else:=0D diff --git a/BaseTools/Source/Python/GenPatchPcdTable/__init__.py b/BaseToo= ls/Source/Python/GenPatchPcdTable/__init__.py index 70b46a525de7..6105f5ed5a9f 100644 --- a/BaseTools/Source/Python/GenPatchPcdTable/__init__.py +++ b/BaseTools/Source/Python/GenPatchPcdTable/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'GenPatchPcdTable' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py b/BaseT= ools/Source/Python/PatchPcdValue/PatchPcdValue.py index d35cd792704c..8ede157c7e5b 100644 --- a/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py +++ b/BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Patch value into the binary file.=0D #=0D # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -25,7 +25,7 @@ __version_number__ =3D ("0.10" + " " + gBUILD_VERSION) __version__ =3D "%prog Version " + __version_number__=0D __copyright__ =3D "Copyright (c) 2010 - 2018, Intel Corporation. All right= s reserved."=0D =0D -## PatchBinaryFile method=0D +# PatchBinaryFile method=0D #=0D # This method mainly patches the data into binary file.=0D #=0D @@ -38,12 +38,14 @@ __copyright__ =3D "Copyright (c) 2010 - 2018, Intel Cor= poration. All rights reserv # @retval 0 File is updated successfully.=0D # @retval not 0 File is updated failed.=0D #=0D +=0D +=0D def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize= =3D0):=0D #=0D # Length of Binary File=0D #=0D FileHandle =3D open(FileName, 'rb')=0D - FileHandle.seek (0, 2)=0D + FileHandle.seek(0, 2)=0D FileLength =3D FileHandle.tell()=0D FileHandle.close()=0D #=0D @@ -104,7 +106,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, Va= lueString, MaxSize=3D0): ValueNumber =3D 1=0D elif ValueString =3D=3D 'FALSE':=0D ValueNumber =3D 0=0D - ValueNumber =3D int (ValueString, 0)=0D + ValueNumber =3D int(ValueString, 0)=0D if ValueNumber !=3D 0:=0D ValueNumber =3D 1=0D except:=0D @@ -118,7 +120,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, Va= lueString, MaxSize=3D0): # Get PCD value for UINT* data type=0D #=0D try:=0D - ValueNumber =3D int (ValueString, 0)=0D + ValueNumber =3D int(ValueString, 0)=0D except:=0D return PARAMETER_INVALID, "PCD Value %s is not valid dec or he= x string." % (ValueString)=0D #=0D @@ -149,7 +151,7 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, Va= lueString, MaxSize=3D0): #=0D # Patch {0x1, 0x2, ...} byte by byte=0D #=0D - ValueList =3D ValueString[1 : len(ValueString) - 1].split(',')= =0D + ValueList =3D ValueString[1: len(ValueString) - 1].split(',')= =0D Index =3D 0=0D try:=0D for ByteString in ValueList:=0D @@ -191,13 +193,15 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, = ValueString, MaxSize=3D0): FileHandle.close()=0D return 0, "Patch Value into File %s successfully." % (FileName)=0D =0D -## Parse command line options=0D +# Parse command line options=0D #=0D # Using standard Python module optparse to parse command line option of th= is tool.=0D #=0D # @retval Options A optparse.Values object containing the parsed options= =0D # @retval InputFile Path of file to be trimmed=0D #=0D +=0D +=0D def Options():=0D OptionList =3D [=0D make_option("-f", "--offset", dest=3D"PcdOffset", action=3D"store"= , type=3D"int",=0D @@ -214,25 +218,28 @@ def Options(): help=3D"Run with debug information"),=0D make_option("-q", "--quiet", dest=3D"LogLevel", action=3D"store_co= nst", const=3DEdkLogger.QUIET,=0D help=3D"Run quietly"),=0D - make_option("-?", action=3D"help", help=3D"show this help message = and exit"),=0D + make_option("-?", action=3D"help",=0D + help=3D"show this help message and exit"),=0D ]=0D =0D # use clearer usage to override default usage message=0D UsageString =3D "%prog -f Offset -u Value -t Type [-s MaxSize] "=0D =0D - Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__, option_list=3DOptionList, usage=3DUsageString)=0D + Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__,=0D + option_list=3DOptionList, usage=3DUsageString)=0D Parser.set_defaults(LogLevel=3DEdkLogger.INFO)=0D =0D Options, Args =3D Parser.parse_args()=0D =0D # error check=0D if len(Args) =3D=3D 0:=0D - EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData=3DPa= rser.get_usage())=0D + EdkLogger.error("PatchPcdValue", PARAMETER_INVALID,=0D + ExtraData=3DParser.get_usage())=0D =0D InputFile =3D Args[len(Args) - 1]=0D return Options, InputFile=0D =0D -## Entrance method=0D +# Entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -241,6 +248,8 @@ def Options(): # @retval 0 Tool was successful=0D # @retval 1 Tool failed=0D #=0D +=0D +=0D def Main():=0D try:=0D #=0D @@ -252,22 +261,27 @@ def Main(): EdkLogger.SetLevel(CommandOptions.LogLevel + 1)=0D else:=0D EdkLogger.SetLevel(CommandOptions.LogLevel)=0D - if not os.path.exists (InputFile):=0D - EdkLogger.error("PatchPcdValue", FILE_NOT_FOUND, ExtraData=3DI= nputFile)=0D + if not os.path.exists(InputFile):=0D + EdkLogger.error("PatchPcdValue", FILE_NOT_FOUND,=0D + ExtraData=3DInputFile)=0D return 1=0D if CommandOptions.PcdOffset is None or CommandOptions.PcdValue is = None or CommandOptions.PcdTypeName is None:=0D - EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData=3D"= PcdOffset or PcdValue of PcdTypeName is not specified.")=0D + EdkLogger.error("PatchPcdValue", OPTION_MISSING,=0D + ExtraData=3D"PcdOffset or PcdValue of PcdTypeN= ame is not specified.")=0D return 1=0D if CommandOptions.PcdTypeName.upper() not in TAB_PCD_NUMERIC_TYPES= _VOID:=0D - EdkLogger.error("PatchPcdValue", PARAMETER_INVALID, ExtraData= =3D"PCD type %s is not valid." % (CommandOptions.PcdTypeName))=0D + EdkLogger.error("PatchPcdValue", PARAMETER_INVALID,=0D + ExtraData=3D"PCD type %s is not valid." % (Com= mandOptions.PcdTypeName))=0D return 1=0D if CommandOptions.PcdTypeName.upper() =3D=3D TAB_VOID and CommandO= ptions.PcdMaxSize is None:=0D - EdkLogger.error("PatchPcdValue", OPTION_MISSING, ExtraData=3D"= PcdMaxSize is not specified for VOID* type PCD.")=0D + EdkLogger.error("PatchPcdValue", OPTION_MISSING,=0D + ExtraData=3D"PcdMaxSize is not specified for V= OID* type PCD.")=0D return 1=0D #=0D # Patch value into binary image.=0D #=0D - ReturnValue, ErrorInfo =3D PatchBinaryFile (InputFile, CommandOpti= ons.PcdOffset, CommandOptions.PcdTypeName, CommandOptions.PcdValue, Command= Options.PcdMaxSize)=0D + ReturnValue, ErrorInfo =3D PatchBinaryFile(=0D + InputFile, CommandOptions.PcdOffset, CommandOptions.PcdTypeNam= e, CommandOptions.PcdValue, CommandOptions.PcdMaxSize)=0D if ReturnValue !=3D 0:=0D EdkLogger.error("PatchPcdValue", ReturnValue, ExtraData=3DErro= rInfo)=0D return 1=0D @@ -275,6 +289,7 @@ def Main(): except:=0D return 1=0D =0D +=0D if __name__ =3D=3D '__main__':=0D r =3D Main()=0D sys.exit(r)=0D diff --git a/BaseTools/Source/Python/PatchPcdValue/__init__.py b/BaseTools/= Source/Python/PatchPcdValue/__init__.py index 08275ed6ed00..eda5835ac31e 100644 --- a/BaseTools/Source/Python/PatchPcdValue/__init__.py +++ b/BaseTools/Source/Python/PatchPcdValue/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'PatchPcdValue' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py b/BaseTools/Sou= rce/Python/Pkcs7Sign/Pkcs7Sign.py index 5d4c3a8599ff..d13091c042ba 100644 --- a/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py +++ b/BaseTools/Source/Python/Pkcs7Sign/Pkcs7Sign.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This tool adds EFI_FIRMWARE_IMAGE_AUTHENTICATION for a binary.=0D #=0D # This tool only support CertType - EFI_CERT_TYPE_PKCS7_GUID=0D @@ -27,15 +27,15 @@ from Common.BuildVersion import gBUILD_VERSION #=0D # Globals for help information=0D #=0D -__prog__ =3D 'Pkcs7Sign'=0D -__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D +__prog__ =3D 'Pkcs7Sign'=0D +__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D __copyright__ =3D 'Copyright (c) 2016, Intel Corporation. All rights reser= ved.'=0D -__usage__ =3D '%s -e|-d [options] ' % (__prog__)=0D +__usage__ =3D '%s -e|-d [options] ' % (__prog__)=0D =0D #=0D # GUID for PKCS7 from UEFI Specification=0D #=0D -WIN_CERT_REVISION =3D 0x0200=0D +WIN_CERT_REVISION =3D 0x0200=0D WIN_CERT_TYPE_EFI_GUID =3D 0x0EF1=0D EFI_CERT_TYPE_PKCS7_GUID =3D uuid.UUID('{4aafd29d-68df-49ee-8aa9-347d37566= 5a7}')=0D =0D @@ -67,214 +67,246 @@ TEST_OTHER_PUBLIC_CERT_FILENAME =3D 'TestSub.pub.pem' TEST_TRUSTED_PUBLIC_CERT_FILENAME =3D 'TestRoot.pub.pem'=0D =0D if __name__ =3D=3D '__main__':=0D - #=0D - # Create command line argument parser object=0D - #=0D - parser =3D argparse.ArgumentParser(prog=3D__prog__, usage=3D__usage__, d= escription=3D__copyright__, conflict_handler=3D'resolve')=0D - group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D - group.add_argument("-e", action=3D"store_true", dest=3D'Encode', help=3D= 'encode file')=0D - group.add_argument("-d", action=3D"store_true", dest=3D'Decode', help=3D= 'decode file')=0D - group.add_argument("--version", action=3D'version', version=3D__version_= _)=0D - parser.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dstr, m= etavar=3D'filename', help=3D"specify the output filename", required=3DTrue)= =0D - parser.add_argument("--signer-private-cert", dest=3D'SignerPrivateCertFi= le', type=3Dargparse.FileType('rb'), help=3D"specify the signer private cer= t filename. If not specified, a test signer private cert is used.")=0D - parser.add_argument("--other-public-cert", dest=3D'OtherPublicCertFile',= type=3Dargparse.FileType('rb'), help=3D"specify the other public cert file= name. If not specified, a test other public cert is used.")=0D - parser.add_argument("--trusted-public-cert", dest=3D'TrustedPublicCertFi= le', type=3Dargparse.FileType('rb'), help=3D"specify the trusted public cer= t filename. If not specified, a test trusted public cert is used.")=0D - parser.add_argument("--monotonic-count", dest=3D'MonotonicCountStr', typ= e=3Dstr, help=3D"specify the MonotonicCount in FMP capsule. If not specifi= ed, 0 is used.")=0D - parser.add_argument("--signature-size", dest=3D'SignatureSizeStr', type= =3Dstr, help=3D"specify the signature size for decode process.")=0D - parser.add_argument("-v", "--verbose", dest=3D'Verbose', action=3D"store= _true", help=3D"increase output messages")=0D - parser.add_argument("-q", "--quiet", dest=3D'Quiet', action=3D"store_tru= e", help=3D"reduce output messages")=0D - parser.add_argument("--debug", dest=3D'Debug', type=3Dint, metavar=3D'[0= -9]', choices=3Drange(0, 10), default=3D0, help=3D"set debug level")=0D - parser.add_argument(metavar=3D"input_file", dest=3D'InputFile', type=3Da= rgparse.FileType('rb'), help=3D"specify the input filename")=0D -=0D - #=0D - # Parse command line arguments=0D - #=0D - args =3D parser.parse_args()=0D -=0D - #=0D - # Generate file path to Open SSL command=0D - #=0D - OpenSslCommand =3D 'openssl'=0D - try:=0D - OpenSslPath =3D os.environ['OPENSSL_PATH']=0D - OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D - if ' ' in OpenSslCommand:=0D - OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D - except:=0D - pass=0D -=0D - #=0D - # Verify that Open SSL command is available=0D - #=0D - try:=0D - Process =3D subprocess.Popen('%s version' % (OpenSslCommand), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D - except:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(1)=0D -=0D - Version =3D Process.communicate()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(Process.returncode)=0D - print(Version[0].decode())=0D -=0D - #=0D - # Read input file into a buffer and save input filename=0D - #=0D - args.InputFileName =3D args.InputFile.name=0D - args.InputFileBuffer =3D args.InputFile.read()=0D - args.InputFile.close()=0D -=0D - #=0D - # Save output filename and check if path exists=0D - #=0D - OutputDir =3D os.path.dirname(args.OutputFile)=0D - if not os.path.exists(OutputDir):=0D - print('ERROR: The output path does not exist: %s' % OutputDir)=0D - sys.exit(1)=0D - args.OutputFileName =3D args.OutputFile=0D -=0D - try:=0D - if args.MonotonicCountStr.upper().startswith('0X'):=0D - args.MonotonicCountValue =3D int(args.MonotonicCountStr, 16)=0D - else:=0D - args.MonotonicCountValue =3D int(args.MonotonicCountStr)=0D - except:=0D - args.MonotonicCountValue =3D int(0)=0D -=0D - if args.Encode:=0D #=0D - # Save signer private cert filename and close private cert file=0D + # Create command line argument parser object=0D #=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__, usage=3D__usage__, description=3D__copyright__, c= onflict_handler=3D'resolve')=0D + group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D + group.add_argument("-e", action=3D"store_true",=0D + dest=3D'Encode', help=3D'encode file')=0D + group.add_argument("-d", action=3D"store_true",=0D + dest=3D'Decode', help=3D'decode file')=0D + group.add_argument("--version", action=3D'version', version=3D__versio= n__)=0D + parser.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dstr,= =0D + metavar=3D'filename', help=3D"specify the output f= ilename", required=3DTrue)=0D + parser.add_argument("--signer-private-cert", dest=3D'SignerPrivateCert= File', type=3Dargparse.FileType('rb'),=0D + help=3D"specify the signer private cert filename. = If not specified, a test signer private cert is used.")=0D + parser.add_argument("--other-public-cert", dest=3D'OtherPublicCertFile= ', type=3Dargparse.FileType('rb'),=0D + help=3D"specify the other public cert filename. I= f not specified, a test other public cert is used.")=0D + parser.add_argument("--trusted-public-cert", dest=3D'TrustedPublicCert= File', type=3Dargparse.FileType('rb'),=0D + help=3D"specify the trusted public cert filename. = If not specified, a test trusted public cert is used.")=0D + parser.add_argument("--monotonic-count", dest=3D'MonotonicCountStr', t= ype=3Dstr,=0D + help=3D"specify the MonotonicCount in FMP capsule.= If not specified, 0 is used.")=0D + parser.add_argument("--signature-size", dest=3D'SignatureSizeStr',=0D + type=3Dstr, help=3D"specify the signature size for= decode process.")=0D + parser.add_argument("-v", "--verbose", dest=3D'Verbose',=0D + action=3D"store_true", help=3D"increase output mes= sages")=0D + parser.add_argument("-q", "--quiet", dest=3D'Quiet',=0D + action=3D"store_true", help=3D"reduce output messa= ges")=0D + parser.add_argument("--debug", dest=3D'Debug', type=3Dint,=0D + metavar=3D'[0-9]', choices=3Drange(0, 10), default= =3D0, help=3D"set debug level")=0D + parser.add_argument(metavar=3D"input_file", dest=3D'InputFile', type= =3Dargparse.FileType(=0D + 'rb'), help=3D"specify the input filename")=0D +=0D + #=0D + # Parse command line arguments=0D + #=0D + args =3D parser.parse_args()=0D +=0D + #=0D + # Generate file path to Open SSL command=0D + #=0D + OpenSslCommand =3D 'openssl'=0D try:=0D - args.SignerPrivateCertFileName =3D args.SignerPrivateCertFile.name=0D - args.SignerPrivateCertFile.close()=0D + OpenSslPath =3D os.environ['OPENSSL_PATH']=0D + OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D + if ' ' in OpenSslCommand:=0D + OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D except:=0D - try:=0D - #=0D - # Get path to currently executing script or executable=0D - #=0D - if hasattr(sys, 'frozen'):=0D - Pkcs7ToolPath =3D sys.executable=0D - else:=0D - Pkcs7ToolPath =3D sys.argv[0]=0D - if Pkcs7ToolPath.startswith('"'):=0D - Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D - if Pkcs7ToolPath.endswith('"'):=0D - Pkcs7ToolPath =3D RsaToolPath[:-1]=0D - args.SignerPrivateCertFileName =3D os.path.join(os.path.dirname(os= .path.realpath(Pkcs7ToolPath)), TEST_SIGNER_PRIVATE_CERT_FILENAME)=0D - args.SignerPrivateCertFile =3D open(args.SignerPrivateCertFileName= , 'rb')=0D - args.SignerPrivateCertFile.close()=0D - except:=0D - print('ERROR: test signer private cert file %s missing' % (args.Si= gnerPrivateCertFileName))=0D - sys.exit(1)=0D + pass=0D =0D #=0D - # Save other public cert filename and close public cert file=0D + # Verify that Open SSL command is available=0D #=0D try:=0D - args.OtherPublicCertFileName =3D args.OtherPublicCertFile.name=0D - args.OtherPublicCertFile.close()=0D + Process =3D subprocess.Popen('%s version' % (=0D + OpenSslCommand), stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess= .PIPE, shell=3DTrue)=0D except:=0D - try:=0D - #=0D - # Get path to currently executing script or executable=0D - #=0D - if hasattr(sys, 'frozen'):=0D - Pkcs7ToolPath =3D sys.executable=0D - else:=0D - Pkcs7ToolPath =3D sys.argv[0]=0D - if Pkcs7ToolPath.startswith('"'):=0D - Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D - if Pkcs7ToolPath.endswith('"'):=0D - Pkcs7ToolPath =3D RsaToolPath[:-1]=0D - args.OtherPublicCertFileName =3D os.path.join(os.path.dirname(os.p= ath.realpath(Pkcs7ToolPath)), TEST_OTHER_PUBLIC_CERT_FILENAME)=0D - args.OtherPublicCertFile =3D open(args.OtherPublicCertFileName, 'r= b')=0D - args.OtherPublicCertFile.close()=0D - except:=0D - print('ERROR: test other public cert file %s missing' % (args.Othe= rPublicCertFileName))=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D sys.exit(1)=0D =0D - format =3D "%dsQ" % len(args.InputFileBuffer)=0D - FullInputFileBuffer =3D struct.pack(format, args.InputFileBuffer, args= .MonotonicCountValue)=0D -=0D - #=0D - # Sign the input file using the specified private key and capture sign= ature from STDOUT=0D - #=0D - Process =3D subprocess.Popen('%s smime -sign -binary -signer "%s" -out= form DER -md sha256 -certfile "%s"' % (OpenSslCommand, args.SignerPrivateCe= rtFileName, args.OtherPublicCertFileName), stdin=3Dsubprocess.PIPE, stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D - Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0]=0D + Version =3D Process.communicate()=0D if Process.returncode !=3D 0:=0D - sys.exit(Process.returncode)=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D + sys.exit(Process.returncode)=0D + print(Version[0].decode())=0D =0D #=0D - # Write output file that contains Signature, and Input data=0D + # Read input file into a buffer and save input filename=0D #=0D - args.OutputFile =3D open(args.OutputFileName, 'wb')=0D - args.OutputFile.write(Signature)=0D - args.OutputFile.write(args.InputFileBuffer)=0D - args.OutputFile.close()=0D + args.InputFileName =3D args.InputFile.name=0D + args.InputFileBuffer =3D args.InputFile.read()=0D + args.InputFile.close()=0D =0D - if args.Decode:=0D #=0D - # Save trusted public cert filename and close public cert file=0D + # Save output filename and check if path exists=0D #=0D + OutputDir =3D os.path.dirname(args.OutputFile)=0D + if not os.path.exists(OutputDir):=0D + print('ERROR: The output path does not exist: %s' % OutputDir)=0D + sys.exit(1)=0D + args.OutputFileName =3D args.OutputFile=0D +=0D try:=0D - args.TrustedPublicCertFileName =3D args.TrustedPublicCertFile.name=0D - args.TrustedPublicCertFile.close()=0D + if args.MonotonicCountStr.upper().startswith('0X'):=0D + args.MonotonicCountValue =3D int(args.MonotonicCountStr, 16)=0D + else:=0D + args.MonotonicCountValue =3D int(args.MonotonicCountStr)=0D except:=0D - try:=0D + args.MonotonicCountValue =3D int(0)=0D +=0D + if args.Encode:=0D #=0D - # Get path to currently executing script or executable=0D + # Save signer private cert filename and close private cert file=0D #=0D - if hasattr(sys, 'frozen'):=0D - Pkcs7ToolPath =3D sys.executable=0D - else:=0D - Pkcs7ToolPath =3D sys.argv[0]=0D - if Pkcs7ToolPath.startswith('"'):=0D - Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D - if Pkcs7ToolPath.endswith('"'):=0D - Pkcs7ToolPath =3D RsaToolPath[:-1]=0D - args.TrustedPublicCertFileName =3D os.path.join(os.path.dirname(os= .path.realpath(Pkcs7ToolPath)), TEST_TRUSTED_PUBLIC_CERT_FILENAME)=0D - args.TrustedPublicCertFile =3D open(args.TrustedPublicCertFileName= , 'rb')=0D - args.TrustedPublicCertFile.close()=0D - except:=0D - print('ERROR: test trusted public cert file %s missing' % (args.Tr= ustedPublicCertFileName))=0D - sys.exit(1)=0D + try:=0D + args.SignerPrivateCertFileName =3D args.SignerPrivateCertFile.= name=0D + args.SignerPrivateCertFile.close()=0D + except:=0D + try:=0D + #=0D + # Get path to currently executing script or executable=0D + #=0D + if hasattr(sys, 'frozen'):=0D + Pkcs7ToolPath =3D sys.executable=0D + else:=0D + Pkcs7ToolPath =3D sys.argv[0]=0D + if Pkcs7ToolPath.startswith('"'):=0D + Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D + if Pkcs7ToolPath.endswith('"'):=0D + Pkcs7ToolPath =3D RsaToolPath[:-1]=0D + args.SignerPrivateCertFileName =3D os.path.join(os.path.di= rname(=0D + os.path.realpath(Pkcs7ToolPath)), TEST_SIGNER_PRIVATE_= CERT_FILENAME)=0D + args.SignerPrivateCertFile =3D open(=0D + args.SignerPrivateCertFileName, 'rb')=0D + args.SignerPrivateCertFile.close()=0D + except:=0D + print('ERROR: test signer private cert file %s missing' %= =0D + (args.SignerPrivateCertFileName))=0D + sys.exit(1)=0D =0D - if not args.SignatureSizeStr:=0D - print("ERROR: please use the option --signature-size to specify the = size of the signature data!")=0D - sys.exit(1)=0D - else:=0D - if args.SignatureSizeStr.upper().startswith('0X'):=0D - SignatureSize =3D int(args.SignatureSizeStr, 16)=0D - else:=0D - SignatureSize =3D int(args.SignatureSizeStr)=0D - if SignatureSize < 0:=0D - print("ERROR: The value of option --signature-size can't be set to= negative value!")=0D - sys.exit(1)=0D - elif SignatureSize > len(args.InputFileBuffer):=0D - print("ERROR: The value of option --signature-size is exceed the s= ize of the input file !")=0D - sys.exit(1)=0D + #=0D + # Save other public cert filename and close public cert file=0D + #=0D + try:=0D + args.OtherPublicCertFileName =3D args.OtherPublicCertFile.name= =0D + args.OtherPublicCertFile.close()=0D + except:=0D + try:=0D + #=0D + # Get path to currently executing script or executable=0D + #=0D + if hasattr(sys, 'frozen'):=0D + Pkcs7ToolPath =3D sys.executable=0D + else:=0D + Pkcs7ToolPath =3D sys.argv[0]=0D + if Pkcs7ToolPath.startswith('"'):=0D + Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D + if Pkcs7ToolPath.endswith('"'):=0D + Pkcs7ToolPath =3D RsaToolPath[:-1]=0D + args.OtherPublicCertFileName =3D os.path.join(os.path.dirn= ame(=0D + os.path.realpath(Pkcs7ToolPath)), TEST_OTHER_PUBLIC_CE= RT_FILENAME)=0D + args.OtherPublicCertFile =3D open(=0D + args.OtherPublicCertFileName, 'rb')=0D + args.OtherPublicCertFile.close()=0D + except:=0D + print('ERROR: test other public cert file %s missing' %=0D + (args.OtherPublicCertFileName))=0D + sys.exit(1)=0D +=0D + format =3D "%dsQ" % len(args.InputFileBuffer)=0D + FullInputFileBuffer =3D struct.pack(=0D + format, args.InputFileBuffer, args.MonotonicCountValue)=0D =0D - args.SignatureBuffer =3D args.InputFileBuffer[0:SignatureSize]=0D - args.InputFileBuffer =3D args.InputFileBuffer[SignatureSize:]=0D + #=0D + # Sign the input file using the specified private key and capture = signature from STDOUT=0D + #=0D + Process =3D subprocess.Popen('%s smime -sign -binary -signer "%s" = -outform DER -md sha256 -certfile "%s"' % (OpenSslCommand,=0D + args.SignerPrivateCertFileName, args.Ot= herPublicCertFileName), stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, = stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0]= =0D + if Process.returncode !=3D 0:=0D + sys.exit(Process.returncode)=0D =0D - format =3D "%dsQ" % len(args.InputFileBuffer)=0D - FullInputFileBuffer =3D struct.pack(format, args.InputFileBuffer, args= .MonotonicCountValue)=0D + #=0D + # Write output file that contains Signature, and Input data=0D + #=0D + args.OutputFile =3D open(args.OutputFileName, 'wb')=0D + args.OutputFile.write(Signature)=0D + args.OutputFile.write(args.InputFileBuffer)=0D + args.OutputFile.close()=0D =0D - #=0D - # Save output file contents from input file=0D - #=0D - open(args.OutputFileName, 'wb').write(FullInputFileBuffer)=0D + if args.Decode:=0D + #=0D + # Save trusted public cert filename and close public cert file=0D + #=0D + try:=0D + args.TrustedPublicCertFileName =3D args.TrustedPublicCertFile.= name=0D + args.TrustedPublicCertFile.close()=0D + except:=0D + try:=0D + #=0D + # Get path to currently executing script or executable=0D + #=0D + if hasattr(sys, 'frozen'):=0D + Pkcs7ToolPath =3D sys.executable=0D + else:=0D + Pkcs7ToolPath =3D sys.argv[0]=0D + if Pkcs7ToolPath.startswith('"'):=0D + Pkcs7ToolPath =3D Pkcs7ToolPath[1:]=0D + if Pkcs7ToolPath.endswith('"'):=0D + Pkcs7ToolPath =3D RsaToolPath[:-1]=0D + args.TrustedPublicCertFileName =3D os.path.join(os.path.di= rname(=0D + os.path.realpath(Pkcs7ToolPath)), TEST_TRUSTED_PUBLIC_= CERT_FILENAME)=0D + args.TrustedPublicCertFile =3D open(=0D + args.TrustedPublicCertFileName, 'rb')=0D + args.TrustedPublicCertFile.close()=0D + except:=0D + print('ERROR: test trusted public cert file %s missing' %= =0D + (args.TrustedPublicCertFileName))=0D + sys.exit(1)=0D +=0D + if not args.SignatureSizeStr:=0D + print(=0D + "ERROR: please use the option --signature-size to specify = the size of the signature data!")=0D + sys.exit(1)=0D + else:=0D + if args.SignatureSizeStr.upper().startswith('0X'):=0D + SignatureSize =3D int(args.SignatureSizeStr, 16)=0D + else:=0D + SignatureSize =3D int(args.SignatureSizeStr)=0D + if SignatureSize < 0:=0D + print(=0D + "ERROR: The value of option --signature-size can't be set = to negative value!")=0D + sys.exit(1)=0D + elif SignatureSize > len(args.InputFileBuffer):=0D + print(=0D + "ERROR: The value of option --signature-size is exceed the= size of the input file !")=0D + sys.exit(1)=0D +=0D + args.SignatureBuffer =3D args.InputFileBuffer[0:SignatureSize]=0D + args.InputFileBuffer =3D args.InputFileBuffer[SignatureSize:]=0D +=0D + format =3D "%dsQ" % len(args.InputFileBuffer)=0D + FullInputFileBuffer =3D struct.pack(=0D + format, args.InputFileBuffer, args.MonotonicCountValue)=0D =0D - #=0D - # Verify signature=0D - #=0D - Process =3D subprocess.Popen('%s smime -verify -inform DER -content %s= -CAfile %s' % (OpenSslCommand, args.OutputFileName, args.TrustedPublicCert= FileName), stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D - Process.communicate(input=3Dargs.SignatureBuffer)[0]=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Verification failed')=0D - os.remove (args.OutputFileName)=0D - sys.exit(Process.returncode)=0D + #=0D + # Save output file contents from input file=0D + #=0D + open(args.OutputFileName, 'wb').write(FullInputFileBuffer)=0D =0D - open(args.OutputFileName, 'wb').write(args.InputFileBuffer)=0D + #=0D + # Verify signature=0D + #=0D + Process =3D subprocess.Popen('%s smime -verify -inform DER -conten= t %s -CAfile %s' % (OpenSslCommand, args.OutputFileName,=0D + args.TrustedPublicCertFileName), stdin= =3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, she= ll=3DTrue)=0D + Process.communicate(input=3Dargs.SignatureBuffer)[0]=0D + if Process.returncode !=3D 0:=0D + print('ERROR: Verification failed')=0D + os.remove(args.OutputFileName)=0D + sys.exit(Process.returncode)=0D +=0D + open(args.OutputFileName, 'wb').write(args.InputFileBuffer)=0D diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Generat= eKeys.py b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateK= eys.py index 6c9b8c464e4d..abdb99ac4083 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256GenerateKeys.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This tool can be used to generate new RSA 2048 bit private/public key pa= irs=0D # in a PEM file format using OpenSSL command line utilities that are insta= lled=0D # on the path specified by the system environment variable OPENSSL_PATH.=0D @@ -27,144 +27,159 @@ from Common.BuildVersion import gBUILD_VERSION #=0D # Globals for help information=0D #=0D -__prog__ =3D 'Rsa2048Sha256GenerateKeys'=0D -__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D +__prog__ =3D 'Rsa2048Sha256GenerateKeys'=0D +__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D __copyright__ =3D 'Copyright (c) 2013 - 2018, Intel Corporation. All right= s reserved.'=0D -__usage__ =3D '%s [options]' % (__prog__)=0D +__usage__ =3D '%s [options]' % (__prog__)=0D =0D =0D if __name__ =3D=3D '__main__':=0D - #=0D - # Create command line argument parser object=0D - #=0D - parser =3D argparse.ArgumentParser(prog=3D__prog__, usage=3D__usage__, d= escription=3D__copyright__, conflict_handler=3D'resolve')=0D - group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D - group.add_argument("--version", action=3D'version', version=3D__version_= _)=0D - 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")=0D - group.add_argument("-i", "--input", dest=3D'InputFile', type=3Dargparse.= FileType('rb'), metavar=3D'filename', nargs=3D'*', help=3D"specify the inpu= t private key filename in PEM format")=0D - parser.add_argument("--public-key-hash", dest=3D'PublicKeyHashFile', typ= e=3Dargparse.FileType('wb'), help=3D"specify the public key hash filename t= hat is SHA 256 hash of 2048 bit RSA public key in binary format")=0D - parser.add_argument("--public-key-hash-c", dest=3D'PublicKeyHashCFile', = type=3Dargparse.FileType('wb'), help=3D"specify the public key hash filenam= e that is SHA 256 hash of 2048 bit RSA public key in C structure format")=0D - parser.add_argument("-v", "--verbose", dest=3D'Verbose', action=3D"store= _true", help=3D"increase output messages")=0D - parser.add_argument("-q", "--quiet", dest=3D'Quiet', action=3D"store_tru= e", help=3D"reduce output messages")=0D - parser.add_argument("--debug", dest=3D'Debug', type=3Dint, metavar=3D'[0= -9]', choices=3Drange(0, 10), default=3D0, help=3D"set debug level")=0D + #=0D + # Create command line argument parser object=0D + #=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__, usage=3D__usage__, description=3D__copyright__, c= onflict_handler=3D'resolve')=0D + group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D + group.add_argument("--version", action=3D'version', version=3D__versio= n__)=0D + group.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dargpa= rse.FileType('wb'),=0D + metavar=3D'filename', nargs=3D'*', help=3D"specify = the output private key filename in PEM format")=0D + group.add_argument("-i", "--input", dest=3D'InputFile', type=3Dargpars= e.FileType('rb'),=0D + metavar=3D'filename', nargs=3D'*', help=3D"specify = the input private key filename in PEM format")=0D + parser.add_argument("--public-key-hash", dest=3D'PublicKeyHashFile', t= ype=3Dargparse.FileType('wb'),=0D + help=3D"specify the public key hash filename that = is SHA 256 hash of 2048 bit RSA public key in binary format")=0D + parser.add_argument("--public-key-hash-c", dest=3D'PublicKeyHashCFile'= , type=3Dargparse.FileType('wb'),=0D + help=3D"specify the public key hash filename that = is SHA 256 hash of 2048 bit RSA public key in C structure format")=0D + parser.add_argument("-v", "--verbose", dest=3D'Verbose',=0D + action=3D"store_true", help=3D"increase output mes= sages")=0D + parser.add_argument("-q", "--quiet", dest=3D'Quiet',=0D + action=3D"store_true", help=3D"reduce output messa= ges")=0D + parser.add_argument("--debug", dest=3D'Debug', type=3Dint,=0D + metavar=3D'[0-9]', choices=3Drange(0, 10), default= =3D0, help=3D"set debug level")=0D =0D - #=0D - # Parse command line arguments=0D - #=0D - args =3D parser.parse_args()=0D + #=0D + # Parse command line arguments=0D + #=0D + args =3D parser.parse_args()=0D =0D - #=0D - # Generate file path to Open SSL command=0D - #=0D - OpenSslCommand =3D 'openssl'=0D - try:=0D - OpenSslPath =3D os.environ['OPENSSL_PATH']=0D - OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D - if ' ' in OpenSslCommand:=0D - OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D - except:=0D - pass=0D + #=0D + # Generate file path to Open SSL command=0D + #=0D + OpenSslCommand =3D 'openssl'=0D + try:=0D + OpenSslPath =3D os.environ['OPENSSL_PATH']=0D + OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D + if ' ' in OpenSslCommand:=0D + OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D + except:=0D + pass=0D =0D - #=0D - # Verify that Open SSL command is available=0D - #=0D - try:=0D - Process =3D subprocess.Popen('%s version' % (OpenSslCommand), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D - except:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(1)=0D + #=0D + # Verify that Open SSL command is available=0D + #=0D + try:=0D + Process =3D subprocess.Popen('%s version' % (=0D + OpenSslCommand), stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess= .PIPE, shell=3DTrue)=0D + except:=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D + sys.exit(1)=0D =0D - Version =3D Process.communicate()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(Process.returncode)=0D - print(Version[0].decode())=0D -=0D - args.PemFileName =3D []=0D -=0D - #=0D - # Check for output file argument=0D - #=0D - if args.OutputFile is not None:=0D - for Item in args.OutputFile:=0D - #=0D - # Save PEM filename and close output file=0D - #=0D - args.PemFileName.append(Item.name)=0D - Item.close()=0D -=0D - #=0D - # Generate private key and save it to output file in a PEM file form= at=0D - #=0D - Process =3D subprocess.Popen('%s genrsa -out %s 2048' % (OpenSslComm= and, Item.name), stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell= =3DTrue)=0D - Process.communicate()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: RSA 2048 key generation failed')=0D + Version =3D Process.communicate()=0D + if Process.returncode !=3D 0:=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D sys.exit(Process.returncode)=0D + print(Version[0].decode())=0D =0D - #=0D - # Check for input file argument=0D - #=0D - if args.InputFile is not None:=0D - for Item in args.InputFile:=0D - #=0D - # Save PEM filename and close input file=0D - #=0D - args.PemFileName.append(Item.name)=0D - Item.close()=0D + args.PemFileName =3D []=0D =0D - PublicKeyHash =3D bytearray()=0D - for Item in args.PemFileName:=0D #=0D - # Extract public key from private key into STDOUT=0D + # Check for output file argument=0D #=0D - Process =3D subprocess.Popen('%s rsa -in %s -modulus -noout' % (OpenSs= lCommand, Item), stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell= =3DTrue)=0D - PublicKeyHexString =3D Process.communicate()[0].decode().split(b'=3D')= [1].strip()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Unable to extract public key from private key')=0D - sys.exit(Process.returncode)=0D - PublicKey =3D bytearray()=0D - for Index in range (0, len(PublicKeyHexString), 2):=0D - PublicKey =3D PublicKey + PublicKeyHexString[Index:Index + 2]=0D + if args.OutputFile is not None:=0D + for Item in args.OutputFile:=0D + #=0D + # Save PEM filename and close output file=0D + #=0D + args.PemFileName.append(Item.name)=0D + Item.close()=0D +=0D + #=0D + # Generate private key and save it to output file in a PEM fil= e format=0D + #=0D + Process =3D subprocess.Popen('%s genrsa -out %s 2048' % (=0D + OpenSslCommand, Item.name), stdout=3Dsubprocess.PIPE, stde= rr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Process.communicate()=0D + if Process.returncode !=3D 0:=0D + print('ERROR: RSA 2048 key generation failed')=0D + sys.exit(Process.returncode)=0D =0D #=0D - # Generate SHA 256 hash of RSA 2048 bit public key into STDOUT=0D + # Check for input file argument=0D #=0D - Process =3D subprocess.Popen('%s dgst -sha256 -binary' % (OpenSslComma= nd), stdin=3Dsubprocess.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess= .PIPE, shell=3DTrue)=0D - Process.stdin.write (PublicKey)=0D - PublicKeyHash =3D PublicKeyHash + Process.communicate()[0].decode()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Unable to extract SHA 256 hash of public key')=0D - sys.exit(Process.returncode)=0D + if args.InputFile is not None:=0D + for Item in args.InputFile:=0D + #=0D + # Save PEM filename and close input file=0D + #=0D + args.PemFileName.append(Item.name)=0D + Item.close()=0D +=0D + PublicKeyHash =3D bytearray()=0D + for Item in args.PemFileName:=0D + #=0D + # Extract public key from private key into STDOUT=0D + #=0D + Process =3D subprocess.Popen('%s rsa -in %s -modulus -noout' % (=0D + OpenSslCommand, Item), stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D + PublicKeyHexString =3D Process.communicate()[0].decode().split(b'= =3D')[=0D + 1].strip()=0D + if Process.returncode !=3D 0:=0D + print('ERROR: Unable to extract public key from private key')= =0D + sys.exit(Process.returncode)=0D + PublicKey =3D bytearray()=0D + for Index in range(0, len(PublicKeyHexString), 2):=0D + PublicKey =3D PublicKey + PublicKeyHexString[Index:Index + 2]= =0D =0D - #=0D - # Write SHA 256 hash of 2048 bit binary public key to public key hash fi= le=0D - #=0D - try:=0D - args.PublicKeyHashFile.write (PublicKeyHash)=0D - args.PublicKeyHashFile.close ()=0D - except:=0D - pass=0D + #=0D + # Generate SHA 256 hash of RSA 2048 bit public key into STDOUT=0D + #=0D + Process =3D subprocess.Popen('%s dgst -sha256 -binary' % (OpenSslC= ommand),=0D + stdin=3Dsubprocess.PIPE, stdout=3Dsubpr= ocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Process.stdin.write(PublicKey)=0D + PublicKeyHash =3D PublicKeyHash + Process.communicate()[0].decode(= )=0D + if Process.returncode !=3D 0:=0D + print('ERROR: Unable to extract SHA 256 hash of public key')=0D + sys.exit(Process.returncode)=0D =0D - #=0D - # Convert public key hash to a C structure string=0D - #=0D - PublicKeyHashC =3D '{'=0D - for Item in PublicKeyHash:=0D - PublicKeyHashC =3D PublicKeyHashC + '0x%02x, ' % (Item)=0D - PublicKeyHashC =3D PublicKeyHashC[:-2] + '}'=0D + #=0D + # Write SHA 256 hash of 2048 bit binary public key to public key hash = file=0D + #=0D + try:=0D + args.PublicKeyHashFile.write(PublicKeyHash)=0D + args.PublicKeyHashFile.close()=0D + except:=0D + pass=0D =0D - #=0D - # Write SHA 256 of 2048 bit binary public key to public key hash C struc= ture file=0D - #=0D - try:=0D - args.PublicKeyHashCFile.write (bytes(PublicKeyHashC))=0D - args.PublicKeyHashCFile.close ()=0D - except:=0D - pass=0D + #=0D + # Convert public key hash to a C structure string=0D + #=0D + PublicKeyHashC =3D '{'=0D + for Item in PublicKeyHash:=0D + PublicKeyHashC =3D PublicKeyHashC + '0x%02x, ' % (Item)=0D + PublicKeyHashC =3D PublicKeyHashC[:-2] + '}'=0D =0D - #=0D - # If verbose is enabled display the public key in C structure format=0D - #=0D - if args.Verbose:=0D - print('PublicKeySha256 =3D ' + PublicKeyHashC)=0D + #=0D + # Write SHA 256 of 2048 bit binary public key to public key hash C str= ucture file=0D + #=0D + try:=0D + args.PublicKeyHashCFile.write(bytes(PublicKeyHashC))=0D + args.PublicKeyHashCFile.close()=0D + except:=0D + pass=0D +=0D + #=0D + # If verbose is enabled display the public key in C structure format=0D + #=0D + if args.Verbose:=0D + print('PublicKeySha256 =3D ' + PublicKeyHashC)=0D diff --git a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py= b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py index df05826282eb..fb224cb83dac 100644 --- a/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py +++ b/BaseTools/Source/Python/Rsa2048Sha256Sign/Rsa2048Sha256Sign.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This tool encodes and decodes GUIDed FFS sections or FMP capsule for a G= UID type of=0D # EFI_CERT_TYPE_RSA2048_SHA256_GUID defined in the UEFI 2.4 Specification = as=0D # {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35= , 0xbf}}=0D @@ -25,15 +25,16 @@ from Common.BuildVersion import gBUILD_VERSION #=0D # Globals for help information=0D #=0D -__prog__ =3D 'Rsa2048Sha256Sign'=0D -__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D +__prog__ =3D 'Rsa2048Sha256Sign'=0D +__version__ =3D '%s Version %s' % (__prog__, '0.9 ' + gBUILD_VERSION)=0D __copyright__ =3D 'Copyright (c) 2013 - 2018, Intel Corporation. All right= s reserved.'=0D -__usage__ =3D '%s -e|-d [options] ' % (__prog__)=0D +__usage__ =3D '%s -e|-d [options] ' % (__prog__)=0D =0D #=0D # GUID for SHA 256 Hash Algorithm from UEFI Specification=0D #=0D -EFI_HASH_ALGORITHM_SHA256_GUID =3D uuid.UUID('{51aa59de-fdf2-4ea3-bc63-875= fb7842ee9}')=0D +EFI_HASH_ALGORITHM_SHA256_GUID =3D uuid.UUID(=0D + '{51aa59de-fdf2-4ea3-bc63-875fb7842ee9}')=0D =0D #=0D # Structure definition to unpack EFI_CERT_BLOCK_RSA_2048_SHA256 from UEFI = 2.4 Specification=0D @@ -44,7 +45,8 @@ EFI_HASH_ALGORITHM_SHA256_GUID =3D uuid.UUID('{51aa59de-f= df2-4ea3-bc63-875fb7842ee # UINT8 Signature[256];=0D # } EFI_CERT_BLOCK_RSA_2048_SHA256;=0D #=0D -EFI_CERT_BLOCK_RSA_2048_SHA256 =3D collections.namedtuple('EFI_CERT= _BLOCK_RSA_2048_SHA256', ['HashType', 'PublicKey', 'Signature'])=0D +EFI_CERT_BLOCK_RSA_2048_SHA256 =3D collections.namedtuple(=0D + 'EFI_CERT_BLOCK_RSA_2048_SHA256', ['HashType', 'PublicKey', 'Signature= '])=0D EFI_CERT_BLOCK_RSA_2048_SHA256_STRUCT =3D struct.Struct('16s256s256s')=0D =0D #=0D @@ -53,183 +55,205 @@ EFI_CERT_BLOCK_RSA_2048_SHA256_STRUCT =3D struct.Stru= ct('16s256s256s') TEST_SIGNING_PRIVATE_KEY_FILENAME =3D 'TestSigningPrivateKey.pem'=0D =0D if __name__ =3D=3D '__main__':=0D - #=0D - # Create command line argument parser object=0D - #=0D - parser =3D argparse.ArgumentParser(prog=3D__prog__, usage=3D__usage__, d= escription=3D__copyright__, conflict_handler=3D'resolve')=0D - group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D - group.add_argument("-e", action=3D"store_true", dest=3D'Encode', help=3D= 'encode file')=0D - group.add_argument("-d", action=3D"store_true", dest=3D'Decode', help=3D= 'decode file')=0D - group.add_argument("--version", action=3D'version', version=3D__version_= _)=0D - parser.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dstr, m= etavar=3D'filename', help=3D"specify the output filename", required=3DTrue)= =0D - parser.add_argument("--monotonic-count", dest=3D'MonotonicCountStr', typ= e=3Dstr, help=3D"specify the MonotonicCount in FMP capsule.")=0D - parser.add_argument("--private-key", dest=3D'PrivateKeyFile', type=3Darg= parse.FileType('rb'), help=3D"specify the private key filename. If not spe= cified, a test signing key is used.")=0D - parser.add_argument("-v", "--verbose", dest=3D'Verbose', action=3D"store= _true", help=3D"increase output messages")=0D - parser.add_argument("-q", "--quiet", dest=3D'Quiet', action=3D"store_tru= e", help=3D"reduce output messages")=0D - parser.add_argument("--debug", dest=3D'Debug', type=3Dint, metavar=3D'[0= -9]', choices=3Drange(0, 10), default=3D0, help=3D"set debug level")=0D - parser.add_argument(metavar=3D"input_file", dest=3D'InputFile', type=3Da= rgparse.FileType('rb'), help=3D"specify the input filename")=0D -=0D - #=0D - # Parse command line arguments=0D - #=0D - args =3D parser.parse_args()=0D -=0D - #=0D - # Generate file path to Open SSL command=0D - #=0D - OpenSslCommand =3D 'openssl'=0D - try:=0D - OpenSslPath =3D os.environ['OPENSSL_PATH']=0D - OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D - if ' ' in OpenSslCommand:=0D - OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D - except:=0D - pass=0D -=0D - #=0D - # Verify that Open SSL command is available=0D - #=0D - try:=0D - Process =3D subprocess.Popen('%s version' % (OpenSslCommand), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D - except:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(1)=0D -=0D - Version =3D Process.communicate()=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Open SSL command not available. Please verify PATH or s= et OPENSSL_PATH')=0D - sys.exit(Process.returncode)=0D - print(Version[0].decode('utf-8'))=0D -=0D - #=0D - # Read input file into a buffer and save input filename=0D - #=0D - args.InputFileName =3D args.InputFile.name=0D - args.InputFileBuffer =3D args.InputFile.read()=0D - args.InputFile.close()=0D -=0D - #=0D - # Save output filename and check if path exists=0D - #=0D - OutputDir =3D os.path.dirname(args.OutputFile)=0D - if not os.path.exists(OutputDir):=0D - print('ERROR: The output path does not exist: %s' % OutputDir)=0D - sys.exit(1)=0D - args.OutputFileName =3D args.OutputFile=0D -=0D - #=0D - # Save private key filename and close private key file=0D - #=0D - try:=0D - args.PrivateKeyFileName =3D args.PrivateKeyFile.name=0D - args.PrivateKeyFile.close()=0D - except:=0D - try:=0D - #=0D - # Get path to currently executing script or executable=0D - #=0D - if hasattr(sys, 'frozen'):=0D - RsaToolPath =3D sys.executable=0D - else:=0D - RsaToolPath =3D sys.argv[0]=0D - if RsaToolPath.startswith('"'):=0D - RsaToolPath =3D RsaToolPath[1:]=0D - if RsaToolPath.endswith('"'):=0D - RsaToolPath =3D RsaToolPath[:-1]=0D - args.PrivateKeyFileName =3D os.path.join(os.path.dirname(os.path.rea= lpath(RsaToolPath)), TEST_SIGNING_PRIVATE_KEY_FILENAME)=0D - args.PrivateKeyFile =3D open(args.PrivateKeyFileName, 'rb')=0D - args.PrivateKeyFile.close()=0D - except:=0D - print('ERROR: test signing private key file %s missing' % (args.Priv= ateKeyFileName))=0D - sys.exit(1)=0D -=0D - #=0D - # Extract public key from private key into STDOUT=0D - #=0D - Process =3D subprocess.Popen('%s rsa -in "%s" -modulus -noout' % (OpenSs= lCommand, args.PrivateKeyFileName), stdout=3Dsubprocess.PIPE, stderr=3Dsubp= rocess.PIPE, shell=3DTrue)=0D - PublicKeyHexString =3D Process.communicate()[0].split(b'=3D')[1].strip()= =0D - PublicKeyHexString =3D PublicKeyHexString.decode('utf-8')=0D - PublicKey =3D ''=0D - while len(PublicKeyHexString) > 0:=0D - PublicKey =3D PublicKey + PublicKeyHexString[0:2]=0D - PublicKeyHexString=3DPublicKeyHexString[2:]=0D - if Process.returncode !=3D 0:=0D - sys.exit(Process.returncode)=0D -=0D - if args.MonotonicCountStr:=0D + #=0D + # Create command line argument parser object=0D + #=0D + parser =3D argparse.ArgumentParser(=0D + prog=3D__prog__, usage=3D__usage__, description=3D__copyright__, c= onflict_handler=3D'resolve')=0D + group =3D parser.add_mutually_exclusive_group(required=3DTrue)=0D + group.add_argument("-e", action=3D"store_true",=0D + dest=3D'Encode', help=3D'encode file')=0D + group.add_argument("-d", action=3D"store_true",=0D + dest=3D'Decode', help=3D'decode file')=0D + group.add_argument("--version", action=3D'version', version=3D__versio= n__)=0D + parser.add_argument("-o", "--output", dest=3D'OutputFile', type=3Dstr,= =0D + metavar=3D'filename', help=3D"specify the output f= ilename", required=3DTrue)=0D + parser.add_argument("--monotonic-count", dest=3D'MonotonicCountStr',=0D + type=3Dstr, help=3D"specify the MonotonicCount in = FMP capsule.")=0D + parser.add_argument("--private-key", dest=3D'PrivateKeyFile', type=3Da= rgparse.FileType('rb'),=0D + help=3D"specify the private key filename. If not = specified, a test signing key is used.")=0D + parser.add_argument("-v", "--verbose", dest=3D'Verbose',=0D + action=3D"store_true", help=3D"increase output mes= sages")=0D + parser.add_argument("-q", "--quiet", dest=3D'Quiet',=0D + action=3D"store_true", help=3D"reduce output messa= ges")=0D + parser.add_argument("--debug", dest=3D'Debug', type=3Dint,=0D + metavar=3D'[0-9]', choices=3Drange(0, 10), default= =3D0, help=3D"set debug level")=0D + parser.add_argument(metavar=3D"input_file", dest=3D'InputFile', type= =3Dargparse.FileType(=0D + 'rb'), help=3D"specify the input filename")=0D +=0D + #=0D + # Parse command line arguments=0D + #=0D + args =3D parser.parse_args()=0D +=0D + #=0D + # Generate file path to Open SSL command=0D + #=0D + OpenSslCommand =3D 'openssl'=0D try:=0D - if args.MonotonicCountStr.upper().startswith('0X'):=0D - args.MonotonicCountValue =3D int(args.MonotonicCountStr, 16)=0D - else:=0D - args.MonotonicCountValue =3D int(args.MonotonicCountStr)=0D + OpenSslPath =3D os.environ['OPENSSL_PATH']=0D + OpenSslCommand =3D os.path.join(OpenSslPath, OpenSslCommand)=0D + if ' ' in OpenSslCommand:=0D + OpenSslCommand =3D '"' + OpenSslCommand + '"'=0D except:=0D pass=0D =0D - if args.Encode:=0D - FullInputFileBuffer =3D args.InputFileBuffer=0D - if args.MonotonicCountStr:=0D - format =3D "%dsQ" % len(args.InputFileBuffer)=0D - FullInputFileBuffer =3D struct.pack(format, args.InputFileBuffer, ar= gs.MonotonicCountValue)=0D #=0D - # Sign the input file using the specified private key and capture sign= ature from STDOUT=0D + # Verify that Open SSL command is available=0D #=0D - 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)=0D - Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0]=0D + try:=0D + Process =3D subprocess.Popen('%s version' % (=0D + OpenSslCommand), stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess= .PIPE, shell=3DTrue)=0D + except:=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D + sys.exit(1)=0D +=0D + Version =3D Process.communicate()=0D if Process.returncode !=3D 0:=0D - sys.exit(Process.returncode)=0D + print(=0D + 'ERROR: Open SSL command not available. Please verify PATH or= set OPENSSL_PATH')=0D + sys.exit(Process.returncode)=0D + print(Version[0].decode('utf-8'))=0D =0D #=0D - # Write output file that contains hash GUID, Public Key, Signature, an= d Input data=0D + # Read input file into a buffer and save input filename=0D #=0D - args.OutputFile =3D open(args.OutputFileName, 'wb')=0D - args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.bytes_le)=0D - args.OutputFile.write(bytearray.fromhex(str(PublicKey)))=0D - args.OutputFile.write(Signature)=0D - args.OutputFile.write(args.InputFileBuffer)=0D - args.OutputFile.close()=0D + args.InputFileName =3D args.InputFile.name=0D + args.InputFileBuffer =3D args.InputFile.read()=0D + args.InputFile.close()=0D =0D - if args.Decode:=0D #=0D - # Parse Hash Type, Public Key, and Signature from the section header=0D + # Save output filename and check if path exists=0D #=0D - Header =3D EFI_CERT_BLOCK_RSA_2048_SHA256._make(EFI_CERT_BLOCK_RSA_204= 8_SHA256_STRUCT.unpack_from(args.InputFileBuffer))=0D - args.InputFileBuffer =3D args.InputFileBuffer[EFI_CERT_BLOCK_RSA_2048_= SHA256_STRUCT.size:]=0D + OutputDir =3D os.path.dirname(args.OutputFile)=0D + if not os.path.exists(OutputDir):=0D + print('ERROR: The output path does not exist: %s' % OutputDir)=0D + sys.exit(1)=0D + args.OutputFileName =3D args.OutputFile=0D =0D #=0D - # Verify that the Hash Type matches the expected SHA256 type=0D - #=0D - if uuid.UUID(bytes_le =3D Header.HashType) !=3D EFI_HASH_ALGORITHM_SHA= 256_GUID:=0D - print('ERROR: unsupport hash GUID')=0D - sys.exit(1)=0D + # Save private key filename and close private key file=0D + #=0D + try:=0D + args.PrivateKeyFileName =3D args.PrivateKeyFile.name=0D + args.PrivateKeyFile.close()=0D + except:=0D + try:=0D + #=0D + # Get path to currently executing script or executable=0D + #=0D + if hasattr(sys, 'frozen'):=0D + RsaToolPath =3D sys.executable=0D + else:=0D + RsaToolPath =3D sys.argv[0]=0D + if RsaToolPath.startswith('"'):=0D + RsaToolPath =3D RsaToolPath[1:]=0D + if RsaToolPath.endswith('"'):=0D + RsaToolPath =3D RsaToolPath[:-1]=0D + args.PrivateKeyFileName =3D os.path.join(os.path.dirname(=0D + os.path.realpath(RsaToolPath)), TEST_SIGNING_PRIVATE_KEY_F= ILENAME)=0D + args.PrivateKeyFile =3D open(args.PrivateKeyFileName, 'rb')=0D + args.PrivateKeyFile.close()=0D + except:=0D + print('ERROR: test signing private key file %s missing' %=0D + (args.PrivateKeyFileName))=0D + sys.exit(1)=0D =0D #=0D - # Verify the public key=0D + # Extract public key from private key into STDOUT=0D #=0D - if Header.PublicKey !=3D bytearray.fromhex(PublicKey):=0D - print('ERROR: Public key in input file does not match public key fro= m private key file')=0D - sys.exit(1)=0D + Process =3D subprocess.Popen('%s rsa -in "%s" -modulus -noout' % (Open= SslCommand,=0D + args.PrivateKeyFileName), stdout=3Dsubproce= ss.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + PublicKeyHexString =3D Process.communicate()[0].split(b'=3D')[1].strip= ()=0D + PublicKeyHexString =3D PublicKeyHexString.decode('utf-8')=0D + PublicKey =3D ''=0D + while len(PublicKeyHexString) > 0:=0D + PublicKey =3D PublicKey + PublicKeyHexString[0:2]=0D + PublicKeyHexString =3D PublicKeyHexString[2:]=0D + if Process.returncode !=3D 0:=0D + sys.exit(Process.returncode)=0D =0D - FullInputFileBuffer =3D args.InputFileBuffer=0D if args.MonotonicCountStr:=0D - format =3D "%dsQ" % len(args.InputFileBuffer)=0D - FullInputFileBuffer =3D struct.pack(format, args.InputFileBuffer, ar= gs.MonotonicCountValue)=0D + try:=0D + if args.MonotonicCountStr.upper().startswith('0X'):=0D + args.MonotonicCountValue =3D int(args.MonotonicCountStr, 1= 6)=0D + else:=0D + args.MonotonicCountValue =3D int(args.MonotonicCountStr)=0D + except:=0D + pass=0D =0D - #=0D - # Write Signature to output file=0D - #=0D - open(args.OutputFileName, 'wb').write(Header.Signature)=0D + if args.Encode:=0D + FullInputFileBuffer =3D args.InputFileBuffer=0D + if args.MonotonicCountStr:=0D + format =3D "%dsQ" % len(args.InputFileBuffer)=0D + FullInputFileBuffer =3D struct.pack(=0D + format, args.InputFileBuffer, args.MonotonicCountValue)=0D + #=0D + # Sign the input file using the specified private key and capture = signature from STDOUT=0D + #=0D + Process =3D subprocess.Popen('%s dgst -sha256 -sign "%s"' % (OpenS= slCommand, args.PrivateKeyFileName),=0D + stdin=3Dsubprocess.PIPE, stdout=3Dsubpr= ocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Signature =3D Process.communicate(input=3DFullInputFileBuffer)[0]= =0D + if Process.returncode !=3D 0:=0D + sys.exit(Process.returncode)=0D =0D - #=0D - # Verify signature=0D - #=0D - 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)=0D - Process.communicate(input=3DFullInputFileBuffer)=0D - if Process.returncode !=3D 0:=0D - print('ERROR: Verification failed')=0D - os.remove (args.OutputFileName)=0D - sys.exit(Process.returncode)=0D + #=0D + # Write output file that contains hash GUID, Public Key, Signature= , and Input data=0D + #=0D + args.OutputFile =3D open(args.OutputFileName, 'wb')=0D + args.OutputFile.write(EFI_HASH_ALGORITHM_SHA256_GUID.bytes_le)=0D + args.OutputFile.write(bytearray.fromhex(str(PublicKey)))=0D + args.OutputFile.write(Signature)=0D + args.OutputFile.write(args.InputFileBuffer)=0D + args.OutputFile.close()=0D =0D - #=0D - # Save output file contents from input file=0D - #=0D - open(args.OutputFileName, 'wb').write(args.InputFileBuffer)=0D + if args.Decode:=0D + #=0D + # Parse Hash Type, Public Key, and Signature from the section head= er=0D + #=0D + Header =3D EFI_CERT_BLOCK_RSA_2048_SHA256._make(=0D + EFI_CERT_BLOCK_RSA_2048_SHA256_STRUCT.unpack_from(args.InputFi= leBuffer))=0D + args.InputFileBuffer =3D args.InputFileBuffer[EFI_CERT_BLOCK_RSA_2= 048_SHA256_STRUCT.size:]=0D +=0D + #=0D + # Verify that the Hash Type matches the expected SHA256 type=0D + #=0D + if uuid.UUID(bytes_le=3DHeader.HashType) !=3D EFI_HASH_ALGORITHM_S= HA256_GUID:=0D + print('ERROR: unsupport hash GUID')=0D + sys.exit(1)=0D +=0D + #=0D + # Verify the public key=0D + #=0D + if Header.PublicKey !=3D bytearray.fromhex(PublicKey):=0D + print(=0D + 'ERROR: Public key in input file does not match public key= from private key file')=0D + sys.exit(1)=0D +=0D + FullInputFileBuffer =3D args.InputFileBuffer=0D + if args.MonotonicCountStr:=0D + format =3D "%dsQ" % len(args.InputFileBuffer)=0D + FullInputFileBuffer =3D struct.pack(=0D + format, args.InputFileBuffer, args.MonotonicCountValue)=0D +=0D + #=0D + # Write Signature to output file=0D + #=0D + open(args.OutputFileName, 'wb').write(Header.Signature)=0D +=0D + #=0D + # Verify signature=0D + #=0D + Process =3D subprocess.Popen('%s dgst -sha256 -prverify "%s" -sign= ature %s' % (OpenSslCommand, args.PrivateKeyFileName,=0D + args.OutputFileName), stdin=3Dsubproces= s.PIPE, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Process.communicate(input=3DFullInputFileBuffer)=0D + if Process.returncode !=3D 0:=0D + print('ERROR: Verification failed')=0D + os.remove(args.OutputFileName)=0D + sys.exit(Process.returncode)=0D +=0D + #=0D + # Save output file contents from input file=0D + #=0D + open(args.OutputFileName, 'wb').write(args.InputFileBuffer)=0D diff --git a/BaseTools/Source/Python/Split/Split.py b/BaseTools/Source/Pyth= on/Split/Split.py index e70d5c22c468..92d3ada0850e 100644 --- a/BaseTools/Source/Python/Split/Split.py +++ b/BaseTools/Source/Python/Split/Split.py @@ -92,16 +92,20 @@ def getFileSize(filename): =0D return length=0D =0D -def getoutputfileabs(inputfile, prefix, outputfile,index):=0D +=0D +def getoutputfileabs(inputfile, prefix, outputfile, index):=0D inputfile =3D os.path.abspath(inputfile)=0D if outputfile is None:=0D if prefix is None:=0D - outputfileabs =3D os.path.join(os.path.dirname(inputfile), "{}= {}".format(os.path.basename(inputfile),index))=0D + outputfileabs =3D os.path.join(os.path.dirname(=0D + inputfile), "{}{}".format(os.path.basename(inputfile), ind= ex))=0D else:=0D if os.path.isabs(prefix):=0D - outputfileabs =3D os.path.join(prefix, "{}{}".format(os.pa= th.basename(inputfile),index))=0D + outputfileabs =3D os.path.join(prefix, "{}{}".format(=0D + os.path.basename(inputfile), index))=0D else:=0D - outputfileabs =3D os.path.join(os.getcwd(), prefix, "{}{}"= .format(os.path.basename(inputfile),index))=0D + outputfileabs =3D os.path.join(os.getcwd(), prefix, "{}{}"= .format(=0D + os.path.basename(inputfile), index))=0D elif not os.path.isabs(outputfile):=0D if prefix is None:=0D outputfileabs =3D os.path.join(os.getcwd(), outputfile)=0D @@ -114,6 +118,7 @@ def getoutputfileabs(inputfile, prefix, outputfile,inde= x): outputfileabs =3D outputfile=0D return outputfileabs=0D =0D +=0D def splitFile(inputfile, position, outputdir=3DNone, outputfile1=3DNone, o= utputfile2=3DNone):=0D '''=0D Split the inputfile into outputfile1 and outputfile2 from the position= .=0D @@ -132,12 +137,12 @@ def splitFile(inputfile, position, outputdir=3DNone, = outputfile1=3DNone, outputfile2 # Create dir for the output files=0D try:=0D =0D - outputfile1 =3D getoutputfileabs(inputfile, outputdir, outputfile1= ,1)=0D + outputfile1 =3D getoutputfileabs(inputfile, outputdir, outputfile1= , 1)=0D outputfolder =3D os.path.dirname(outputfile1)=0D if not os.path.exists(outputfolder):=0D os.makedirs(outputfolder)=0D =0D - outputfile2 =3D getoutputfileabs(inputfile, outputdir, outputfile2= ,2)=0D + outputfile2 =3D getoutputfileabs(inputfile, outputdir, outputfile2= , 2)=0D outputfolder =3D os.path.dirname(outputfile2)=0D if not os.path.exists(outputfolder):=0D os.makedirs(outputfolder)=0D diff --git a/BaseTools/Source/Python/Table/Table.py b/BaseTools/Source/Pyth= on/Table/Table.py index 7a60313e9524..c179334d8fc5 100644 --- a/BaseTools/Source/Python/Table/Table.py +++ b/BaseTools/Source/Python/Table/Table.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase a common table=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,7 @@ #=0D import Common.EdkLogger as EdkLogger=0D =0D -## TableFile=0D +# TableFile=0D #=0D # This class defined a common table=0D #=0D @@ -19,13 +19,15 @@ import Common.EdkLogger as EdkLogger # @param Cursor: Cursor of the database=0D # @param TableName: Name of the table=0D #=0D +=0D +=0D class Table(object):=0D def __init__(self, Cursor):=0D self.Cur =3D Cursor=0D self.Table =3D ''=0D self.ID =3D 0=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create a table=0D #=0D @@ -34,14 +36,14 @@ class Table(object): self.ID =3D 0=0D EdkLogger.verbose(SqlCommand + " ... DONE!")=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into a table=0D #=0D def Insert(self, SqlCommand):=0D self.Exec(SqlCommand)=0D =0D - ## Query table=0D + # Query table=0D #=0D # Query all records of the table=0D #=0D @@ -53,10 +55,11 @@ class Table(object): EdkLogger.verbose(str(Rs))=0D =0D TotalCount =3D self.GetCount()=0D - EdkLogger.verbose("*** Total %s records in table %s ***" % (TotalC= ount, self.Table) )=0D + EdkLogger.verbose("*** Total %s records in table %s ***" %=0D + (TotalCount, self.Table))=0D EdkLogger.verbose("Query tabel %s DONE!" % self.Table)=0D =0D - ## Drop a table=0D + # Drop a table=0D #=0D # Drop the table=0D #=0D @@ -65,7 +68,7 @@ class Table(object): self.Cur.execute(SqlCommand)=0D EdkLogger.verbose("Drop tabel %s ... DONE!" % self.Table)=0D =0D - ## Get count=0D + # Get count=0D #=0D # Get a count of all records of the table=0D #=0D @@ -77,7 +80,7 @@ class Table(object): for Item in self.Cur:=0D return Item[0]=0D =0D - ## Generate ID=0D + # Generate ID=0D #=0D # Generate an ID if input ID is -1=0D #=0D @@ -91,14 +94,14 @@ class Table(object): =0D return self.ID=0D =0D - ## Init the ID of the table=0D + # Init the ID of the table=0D #=0D # Init the ID of the table=0D #=0D def InitID(self):=0D self.ID =3D self.GetCount()=0D =0D - ## Exec=0D + # Exec=0D #=0D # Exec Sql Command, return result=0D #=0D diff --git a/BaseTools/Source/Python/Table/TableDataModel.py b/BaseTools/So= urce/Python/Table/TableDataModel.py index 3855807452f7..8b609fa2c99b 100644 --- a/BaseTools/Source/Python/Table/TableDataModel.py +++ b/BaseTools/Source/Python/Table/TableDataModel.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for data models=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,19 +14,21 @@ import CommonDataClass.DataClass as DataClass from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableDataModel=0D +# TableDataModel=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableDataModel(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'DataModel'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table DataModel=0D #=0D @@ -43,7 +45,7 @@ class TableDataModel(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table DataModel=0D #=0D @@ -55,12 +57,13 @@ class TableDataModel(Table): def Insert(self, CrossIndex, Name, Description):=0D self.ID =3D self.ID + 1=0D (Name, Description) =3D ConvertToSqlString((Name, Description))=0D - SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s')""" % (= self.Table, self.ID, CrossIndex, Name, Description)=0D + SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s')""" % (= =0D + self.Table, self.ID, CrossIndex, Name, Description)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D =0D - ## Init table=0D + # Init table=0D #=0D # Create all default records of table DataModel=0D #=0D @@ -73,7 +76,7 @@ class TableDataModel(Table): self.Insert(CrossIndex, Name, Description)=0D EdkLogger.verbose("Initialize table DataModel ... DONE!")=0D =0D - ## Get CrossIndex=0D + # Get CrossIndex=0D #=0D # Get a model's cross index from its name=0D #=0D diff --git a/BaseTools/Source/Python/Table/TableDec.py b/BaseTools/Source/P= ython/Table/TableDec.py index 04aa7aaad8b1..c155034a69c7 100644 --- a/BaseTools/Source/Python/Table/TableDec.py +++ b/BaseTools/Source/Python/Table/TableDec.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for dec datas=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,19 +14,21 @@ import CommonDataClass.DataClass as DataClass from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableDec=0D +# TableDec=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableDec(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Dec'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Dec=0D #=0D @@ -61,7 +63,7 @@ class TableDec(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dec=0D #=0D @@ -81,14 +83,15 @@ class TableDec(Table): #=0D def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, = BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, E= nabled):=0D self.ID =3D self.ID + 1=0D - (Value1, Value2, Value3, Arch) =3D ConvertToSqlString((Value1, Val= ue2, Value3, Arch))=0D + (Value1, Value2, Value3, Arch) =3D ConvertToSqlString(=0D + (Value1, Value2, Value3, Arch))=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', %s, %s, %s, %s, %s, %s, %s)""" \=0D % (self.Table, self.ID, Model, Value1, Value2, Value3= , Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D #=0D diff --git a/BaseTools/Source/Python/Table/TableDsc.py b/BaseTools/Source/P= ython/Table/TableDsc.py index deda001ca47b..b58c8ccb8a4b 100644 --- a/BaseTools/Source/Python/Table/TableDsc.py +++ b/BaseTools/Source/Python/Table/TableDsc.py @@ -1,5 +1,5 @@ from __future__ import absolute_import=0D -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for dsc datas=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,19 +14,21 @@ import CommonDataClass.DataClass as DataClass from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableDsc=0D +# TableDsc=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableDsc(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Dsc'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Dsc=0D #=0D @@ -61,7 +63,7 @@ class TableDsc(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dsc=0D #=0D @@ -81,14 +83,15 @@ class TableDsc(Table): #=0D def Insert(self, Model, Value1, Value2, Value3, Arch, BelongsToItem, B= elongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled):=0D self.ID =3D self.ID + 1=0D - (Value1, Value2, Value3, Arch) =3D ConvertToSqlString((Value1, Val= ue2, Value3, Arch))=0D + (Value1, Value2, Value3, Arch) =3D ConvertToSqlString(=0D + (Value1, Value2, Value3, Arch))=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', %s, %s, %s, %s, %s, %s, %s)""" \=0D % (self.Table, self.ID, Model, Value1, Value2, Value3= , Arch, BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndC= olumn, Enabled)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D #=0D diff --git a/BaseTools/Source/Python/Table/TableEotReport.py b/BaseTools/So= urce/Python/Table/TableEotReport.py index 72bc11f6dbc2..ff23ef108c69 100644 --- a/BaseTools/Source/Python/Table/TableEotReport.py +++ b/BaseTools/Source/Python/Table/TableEotReport.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for ECC reports=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,25 +10,28 @@ #=0D from __future__ import absolute_import=0D import Common.EdkLogger as EdkLogger=0D -import Common.LongFilePathOs as os, time=0D +import Common.LongFilePathOs as os=0D +import time=0D from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString2=0D import Eot.EotToolError as EotToolError=0D import Eot.EotGlobalData as EotGlobalData=0D =0D -## TableReport=0D +# TableReport=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableEotReport(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Report'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table report=0D #=0D @@ -51,16 +54,16 @@ class TableEotReport(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table report=0D #=0D #=0D - def Insert(self, ModuleID =3D -1, ModuleName =3D '', ModuleGuid =3D ''= , SourceFileID =3D -1, SourceFileFullPath =3D '', \=0D - ItemName =3D '', ItemType =3D '', ItemMode =3D '', GuidName= =3D '', GuidMacro =3D '', GuidValue =3D '', BelongsToFunction =3D '', Enab= led =3D 0):=0D + def Insert(self, ModuleID=3D-1, ModuleName=3D'', ModuleGuid=3D'', Sour= ceFileID=3D-1, SourceFileFullPath=3D'',=0D + ItemName=3D'', ItemType=3D'', ItemMode=3D'', GuidName=3D'',= GuidMacro=3D'', GuidValue=3D'', BelongsToFunction=3D'', Enabled=3D0):=0D self.ID =3D self.ID + 1=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', %s, '%= s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %s)""" \=0D - % (self.Table, self.ID, ModuleID, ModuleName, ModuleG= uid, SourceFileID, SourceFileFullPath, \=0D + % (self.Table, self.ID, ModuleID, ModuleName, ModuleG= uid, SourceFileID, SourceFileFullPath,=0D ItemName, ItemType, ItemMode, GuidName, GuidMacro,= GuidValue, BelongsToFunction, Enabled)=0D Table.Insert(self, SqlCommand)=0D =0D diff --git a/BaseTools/Source/Python/Table/TableFdf.py b/BaseTools/Source/P= ython/Table/TableFdf.py index 964ddd7a683c..08fcd0c1ef46 100644 --- a/BaseTools/Source/Python/Table/TableFdf.py +++ b/BaseTools/Source/Python/Table/TableFdf.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for fdf datas=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,19 +14,21 @@ import CommonDataClass.DataClass as DataClass from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableFdf=0D +# TableFdf=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableFdf(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Fdf'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Fdf=0D #=0D @@ -62,7 +64,7 @@ class TableFdf(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Fdf=0D #=0D @@ -82,14 +84,15 @@ class TableFdf(Table): #=0D def Insert(self, Model, Value1, Value2, Value3, Scope1, Scope2, Belong= sToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, Enabled= ):=0D self.ID =3D self.ID + 1=0D - (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString((V= alue1, Value2, Value3, Scope1, Scope2))=0D + (Value1, Value2, Value3, Scope1, Scope2) =3D ConvertToSqlString(=0D + (Value1, Value2, Value3, Scope1, Scope2))=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \=0D % (self.Table, self.ID, Model, Value1, Value2, Value3= , Scope1, Scope2, BelongsToItem, BelongsToFile, StartLine, StartColumn, End= Line, EndColumn, Enabled)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D #=0D diff --git a/BaseTools/Source/Python/Table/TableFile.py b/BaseTools/Source/= Python/Table/TableFile.py index c54c389872bd..8fbff54a0973 100644 --- a/BaseTools/Source/Python/Table/TableFile.py +++ b/BaseTools/Source/Python/Table/TableFile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for files=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -15,18 +15,20 @@ from Common.StringUtils import ConvertToSqlString import Common.LongFilePathOs as os=0D from CommonDataClass.DataClass import FileClass=0D =0D -## TableFile=0D +# TableFile=0D #=0D # This class defined a table used for file=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class TableFile(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'File'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table File=0D #=0D @@ -49,7 +51,7 @@ class TableFile(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table File=0D #=0D @@ -63,13 +65,14 @@ class TableFile(Table): #=0D def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp):=0D self.ID =3D self.ID + 1=0D - (Name, ExtName, Path, FullPath) =3D ConvertToSqlString((Name, ExtN= ame, Path, FullPath))=0D + (Name, ExtName, Path, FullPath) =3D ConvertToSqlString(=0D + (Name, ExtName, Path, FullPath))=0D SqlCommand =3D """insert into %s values(%s, '%s', '%s', '%s', '%s'= , %s, '%s')""" \=0D - % (self.Table, self.ID, Name, E= xtName, Path, FullPath, Model, TimeStamp)=0D + % (self.Table, self.ID, Name, ExtName, Path, FullPath, Model, = TimeStamp)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D - ## InsertFile=0D + # InsertFile=0D #=0D # Insert one file to table=0D #=0D @@ -78,21 +81,24 @@ class TableFile(Table): #=0D # @retval FileID: The ID after record is inserted=0D #=0D +=0D def InsertFile(self, FileFullPath, Model):=0D (Filepath, Name) =3D os.path.split(FileFullPath)=0D (Root, Ext) =3D os.path.splitext(FileFullPath)=0D TimeStamp =3D os.stat(FileFullPath)[8]=0D - File =3D FileClass(-1, Name, Ext, Filepath, FileFullPath, Model, '= ', [], [], [])=0D + File =3D FileClass(-1, Name, Ext, Filepath,=0D + FileFullPath, Model, '', [], [], [])=0D return self.Insert(File.Name, File.ExtName, File.Path, File.FullPa= th, File.Model, TimeStamp)=0D =0D - ## Get ID of a given file=0D + # Get ID of a given file=0D #=0D # @param FilePath Path of file=0D #=0D # @retval ID ID value of given file in the table=0D #=0D def GetFileId(self, File):=0D - QueryScript =3D "select ID from %s where FullPath =3D '%s'" % (sel= f.Table, str(File))=0D + QueryScript =3D "select ID from %s where FullPath =3D '%s'" % (=0D + self.Table, str(File))=0D RecordList =3D self.Exec(QueryScript)=0D if len(RecordList) =3D=3D 0:=0D return None=0D diff --git a/BaseTools/Source/Python/Table/TableFunction.py b/BaseTools/Sou= rce/Python/Table/TableFunction.py index 69d240b9a7d6..429769b426a4 100644 --- a/BaseTools/Source/Python/Table/TableFunction.py +++ b/BaseTools/Source/Python/Table/TableFunction.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for functions=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,18 +13,20 @@ import Common.EdkLogger as EdkLogger from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableFunction=0D +# TableFunction=0D #=0D # This class defined a table used for function=0D #=0D # @param Table: Inherited from Table class=0D #=0D +=0D +=0D class TableFunction(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Function'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Function=0D #=0D @@ -61,7 +63,7 @@ class TableFunction(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Function=0D #=0D @@ -82,9 +84,10 @@ class TableFunction(Table): #=0D def Insert(self, Header, Modifier, Name, ReturnStatement, StartLine, S= tartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFi= le, FunNameStartLine, FunNameStartColumn):=0D self.ID =3D self.ID + 1=0D - (Header, Modifier, Name, ReturnStatement) =3D ConvertToSqlString((= Header, Modifier, Name, ReturnStatement))=0D + (Header, Modifier, Name, ReturnStatement) =3D ConvertToSqlString(= =0D + (Header, Modifier, Name, ReturnStatement))=0D SqlCommand =3D """insert into %s values(%s, '%s', '%s', '%s', '%s'= , %s, %s, %s, %s, %s, %s, %s, %s, %s)""" \=0D - % (self.Table, self.ID, Header, Modifi= er, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, Body= StartLine, BodyStartColumn, BelongsToFile, FunNameStartLine, FunNameStartCo= lumn)=0D + % (self.Table, self.ID, Header, Modifier, Name, ReturnStatemen= t, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColu= mn, BelongsToFile, FunNameStartLine, FunNameStartColumn)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D diff --git a/BaseTools/Source/Python/Table/TableIdentifier.py b/BaseTools/S= ource/Python/Table/TableIdentifier.py index 99f5023e965e..a34e1b5a76ba 100644 --- a/BaseTools/Source/Python/Table/TableIdentifier.py +++ b/BaseTools/Source/Python/Table/TableIdentifier.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for Identifiers=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,19 +13,21 @@ import Common.EdkLogger as EdkLogger from Common.StringUtils import ConvertToSqlString=0D from Table.Table import Table=0D =0D -## TableIdentifier=0D +# TableIdentifier=0D #=0D # This class defined a table used for Identifier=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableIdentifier(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Identifier'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Identifier=0D #=0D @@ -58,7 +60,7 @@ class TableIdentifier(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Identifier=0D #=0D @@ -77,9 +79,10 @@ class TableIdentifier(Table): #=0D def Insert(self, Modifier, Type, Name, Value, Model, BelongsToFile, Be= longsToFunction, StartLine, StartColumn, EndLine, EndColumn):=0D self.ID =3D self.ID + 1=0D - (Modifier, Type, Name, Value) =3D ConvertToSqlString((Modifier, Ty= pe, Name, Value))=0D + (Modifier, Type, Name, Value) =3D ConvertToSqlString(=0D + (Modifier, Type, Name, Value))=0D SqlCommand =3D """insert into %s values(%s, '%s', '%s', '%s', '%s'= , %s, %s, %s, %s, %s, %s, %s)""" \=0D - % (self.Table, self.ID, Modifie= r, Type, Name, Value, Model, BelongsToFile, BelongsToFunction, StartLine, S= tartColumn, EndLine, EndColumn)=0D + % (self.Table, self.ID, Modifier, Type, Name, Value, Model, Be= longsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColumn)= =0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D diff --git a/BaseTools/Source/Python/Table/TableInf.py b/BaseTools/Source/P= ython/Table/TableInf.py index 54af88c37da5..9a38cf68ba0f 100644 --- a/BaseTools/Source/Python/Table/TableInf.py +++ b/BaseTools/Source/Python/Table/TableInf.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for inf datas=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,19 +14,21 @@ import CommonDataClass.DataClass as DataClass from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TableInf=0D +# TableInf=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableInf(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Inf'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Inf=0D #=0D @@ -65,7 +67,7 @@ class TableInf(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Inf=0D #=0D @@ -87,14 +89,15 @@ class TableInf(Table): #=0D def Insert(self, Model, Value1, Value2, Value3, Value4, Value5, Arch, = BelongsToItem, BelongsToFile, StartLine, StartColumn, EndLine, EndColumn, E= nabled):=0D self.ID =3D self.ID + 1=0D - (Value1, Value2, Value3, Value4, Value5, Arch) =3D ConvertToSqlStr= ing((Value1, Value2, Value3, Value4, Value5, Arch))=0D + (Value1, Value2, Value3, Value4, Value5, Arch) =3D ConvertToSqlStr= ing(=0D + (Value1, Value2, Value3, Value4, Value5, Arch))=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', '%s', = '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \=0D % (self.Table, self.ID, Model, Value1, Value2, Value3= , Value4, Value5, Arch, BelongsToItem, BelongsToFile, StartLine, StartColum= n, EndLine, EndColumn, Enabled)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D #=0D diff --git a/BaseTools/Source/Python/Table/TablePcd.py b/BaseTools/Source/P= ython/Table/TablePcd.py index f1e9f578173e..2966e8f0d622 100644 --- a/BaseTools/Source/Python/Table/TablePcd.py +++ b/BaseTools/Source/Python/Table/TablePcd.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for pcds=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -13,19 +13,21 @@ import Common.EdkLogger as EdkLogger from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString=0D =0D -## TablePcd=0D +# TablePcd=0D #=0D # This class defined a table used for pcds=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TablePcd(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Pcd'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Pcd=0D #=0D @@ -58,7 +60,7 @@ class TablePcd(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Pcd=0D #=0D @@ -77,9 +79,10 @@ class TablePcd(Table): #=0D def Insert(self, CName, TokenSpaceGuidCName, Token, DatumType, Model, = BelongsToFile, BelongsToFunction, StartLine, StartColumn, EndLine, EndColum= n):=0D self.ID =3D self.ID + 1=0D - (CName, TokenSpaceGuidCName, DatumType) =3D ConvertToSqlString((CN= ame, TokenSpaceGuidCName, DatumType))=0D + (CName, TokenSpaceGuidCName, DatumType) =3D ConvertToSqlString(=0D + (CName, TokenSpaceGuidCName, DatumType))=0D SqlCommand =3D """insert into %s values(%s, '%s', '%s', %s, '%s', = %s, %s, %s, %s, %s, %s, %s)""" \=0D - % (self.Table, self.ID, CName, = TokenSpaceGuidCName, Token, DatumType, Model, BelongsToFile, BelongsToFunct= ion, StartLine, StartColumn, EndLine, EndColumn)=0D + % (self.Table, self.ID, CName, TokenSpaceGuidCName, Token, Dat= umType, Model, BelongsToFile, BelongsToFunction, StartLine, StartColumn, En= dLine, EndColumn)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D diff --git a/BaseTools/Source/Python/Table/TableQuery.py b/BaseTools/Source= /Python/Table/TableQuery.py index 3e66fbfc9da8..ca4844e0f034 100644 --- a/BaseTools/Source/Python/Table/TableQuery.py +++ b/BaseTools/Source/Python/Table/TableQuery.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for Queries=0D #=0D # Copyright (c) 2008, Intel Corporation. All rights reserved.
        =0D @@ -13,19 +13,21 @@ import Common.EdkLogger as EdkLogger from Common.StringUtils import ConvertToSqlString=0D from Table.Table import Table=0D =0D -## TableQuery=0D +# TableQuery=0D #=0D # This class defined a table used for Query=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableQuery(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Query'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table Query=0D #=0D @@ -44,7 +46,7 @@ class TableQuery(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Query=0D #=0D @@ -57,7 +59,7 @@ class TableQuery(Table): def Insert(self, Name, Modifier, Value, Model):=0D self.ID =3D self.ID + 1=0D SqlCommand =3D """insert into %s values(%s, '%s', '%s', '%s', %s)"= "" \=0D - % (self.Table, self.ID, Name, M= odifier, Value, Model)=0D + % (self.Table, self.ID, Name, Modifier, Value, Model)=0D Table.Insert(self, SqlCommand)=0D =0D return self.ID=0D diff --git a/BaseTools/Source/Python/Table/TableReport.py b/BaseTools/Sourc= e/Python/Table/TableReport.py index 0a77787d8f48..da32bb89094c 100644 --- a/BaseTools/Source/Python/Table/TableReport.py +++ b/BaseTools/Source/Python/Table/TableReport.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for ECC reports=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,26 +10,29 @@ #=0D from __future__ import absolute_import=0D import Common.EdkLogger as EdkLogger=0D -import Common.LongFilePathOs as os, time=0D +import Common.LongFilePathOs as os=0D +import time=0D from Table.Table import Table=0D from Common.StringUtils import ConvertToSqlString2=0D import Ecc.EccToolError as EccToolError=0D import Ecc.EccGlobalData as EccGlobalData=0D from Common.LongFilePathSupport import OpenLongFilePath as open=0D =0D -## TableReport=0D +# TableReport=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableReport(Table):=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor)=0D self.Table =3D 'Report'=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create table report=0D #=0D @@ -51,7 +54,7 @@ class TableReport(Table): )""" % self.Table=0D Table.Create(self, SqlCommand)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table report=0D #=0D @@ -63,7 +66,7 @@ class TableReport(Table): # @param Enabled: If this error enabled=0D # @param Corrected: if this error corrected=0D #=0D - def Insert(self, ErrorID, OtherMsg=3D'', BelongsToTable=3D'', BelongsT= oItem=3D -1, Enabled=3D0, Corrected=3D -1):=0D + def Insert(self, ErrorID, OtherMsg=3D'', BelongsToTable=3D'', BelongsT= oItem=3D-1, Enabled=3D0, Corrected=3D-1):=0D self.ID =3D self.ID + 1=0D SqlCommand =3D """insert into %s values(%s, %s, '%s', '%s', %s, %s= , %s)""" \=0D % (self.Table, self.ID, ErrorID, ConvertToSqlString2(= OtherMsg), BelongsToTable, BelongsToItem, Enabled, Corrected)=0D @@ -71,7 +74,7 @@ class TableReport(Table): =0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @retval: A recordSet of all found records=0D #=0D @@ -80,14 +83,14 @@ class TableReport(Table): where Enabled > -1 order by ErrorID, BelongsToItem= """ % (self.Table)=0D return self.Exec(SqlCommand)=0D =0D - ## Update table=0D + # Update table=0D #=0D def UpdateBelongsToItemByFile(self, ItemID=3D-1, File=3D""):=0D SqlCommand =3D """update Report set BelongsToItem=3D%s where Belon= gsToTable=3D'File' and BelongsToItem=3D-2=0D and OtherMsg like '%%%s%%'""" % (ItemID, File)=0D return self.Exec(SqlCommand)=0D =0D - ## Convert to CSV=0D + # Convert to CSV=0D #=0D # Get all enabled records from table report and save them to a .csv fi= le=0D #=0D @@ -96,7 +99,8 @@ class TableReport(Table): def ToCSV(self, Filename=3D'Report.csv'):=0D try:=0D File =3D open(Filename, 'w+')=0D - File.write("""No, Error Code, Error Message, File, LineNo, Oth= er Error Message\n""")=0D + File.write(=0D + """No, Error Code, Error Message, File, LineNo, Other Erro= r Message\n""")=0D RecordSet =3D self.Query()=0D Index =3D 0=0D for Record in RecordSet:=0D @@ -116,12 +120,15 @@ class TableReport(Table): """ % (BelongsToTable, BelongsToItem)=0D NewRecord =3D self.Exec(SqlCommand)=0D if NewRecord !=3D []:=0D - File.write("""%s,%s,"%s",%s,%s,"%s"\n""" % (Index, Err= orID, EccToolError.gEccErrorMessage[ErrorID], NewRecord[0][1], NewRecord[0]= [0], OtherMsg))=0D - EdkLogger.quiet("%s(%s): [%s]%s %s" % (NewRecord[0][1]= , NewRecord[0][0], ErrorID, EccToolError.gEccErrorMessage[ErrorID], OtherMs= g))=0D + File.write("""%s,%s,"%s",%s,%s,"%s"\n""" % (=0D + Index, ErrorID, EccToolError.gEccErrorMessage[Erro= rID], NewRecord[0][1], NewRecord[0][0], OtherMsg))=0D + EdkLogger.quiet("%s(%s): [%s]%s %s" % (=0D + NewRecord[0][1], NewRecord[0][0], ErrorID, EccTool= Error.gEccErrorMessage[ErrorID], OtherMsg))=0D =0D File.close()=0D except IOError:=0D - NewFilename =3D 'Report_' + time.strftime("%Y%m%d_%H%M%S.csv",= time.localtime())=0D - EdkLogger.warn("ECC", "The report file %s is locked by other p= rogress, use %s instead!" % (Filename, NewFilename))=0D + NewFilename =3D 'Report_' + \=0D + time.strftime("%Y%m%d_%H%M%S.csv", time.localtime())=0D + EdkLogger.warn("ECC", "The report file %s is locked by other p= rogress, use %s instead!" % (=0D + Filename, NewFilename))=0D self.ToCSV(NewFilename)=0D -=0D diff --git a/BaseTools/Source/Python/Table/__init__.py b/BaseTools/Source/P= ython/Table/__init__.py index e901914f30a8..caa82844e967 100644 --- a/BaseTools/Source/Python/Table/__init__.py +++ b/BaseTools/Source/Python/Table/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Table' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/S= ource/Python/TargetTool/TargetTool.py index 7f2479f0f0ac..61276661b647 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Target Tool Parser=0D #=0D # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
        = =0D @@ -21,23 +21,25 @@ from Common.TargetTxtClassObject import gDefaultTargetT= xtFile =0D # To Do 1.set clean, 2. add item, if the line is disabled.=0D =0D +=0D class TargetTool():=0D def __init__(self, opt, args):=0D self.WorkSpace =3D os.path.normpath(os.getenv('WORKSPACE'))=0D - self.Opt =3D opt=0D - self.Arg =3D args[0]=0D - self.FileName =3D os.path.normpath(os.path.join(self.WorkSpace, '= Conf', gDefaultTargetTxtFile))=0D + self.Opt =3D opt=0D + self.Arg =3D args[0]=0D + self.FileName =3D os.path.normpath(os.path.join(=0D + self.WorkSpace, 'Conf', gDefaultTargetTxtFile))=0D if os.path.isfile(self.FileName) =3D=3D False:=0D print("%s does not exist." % self.FileName)=0D sys.exit(1)=0D self.TargetTxtDictionary =3D {=0D - TAB_TAT_DEFINES_ACTIVE_PLATFORM : N= one,=0D - TAB_TAT_DEFINES_TOOL_CHAIN_CONF : N= one,=0D - TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER : N= one,=0D - TAB_TAT_DEFINES_TARGET : N= one,=0D - TAB_TAT_DEFINES_TOOL_CHAIN_TAG : N= one,=0D - TAB_TAT_DEFINES_TARGET_ARCH : N= one,=0D - TAB_TAT_DEFINES_BUILD_RULE_CONF : N= one,=0D + TAB_TAT_DEFINES_ACTIVE_PLATFORM: None,=0D + TAB_TAT_DEFINES_TOOL_CHAIN_CONF: None,=0D + TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER: None,=0D + TAB_TAT_DEFINES_TARGET: None,=0D + TAB_TAT_DEFINES_TOOL_CHAIN_TAG: None,=0D + TAB_TAT_DEFINES_TARGET_ARCH: None,=0D + TAB_TAT_DEFINES_BUILD_RULE_CONF: None,=0D }=0D self.LoadTargetTxtFile(self.FileName)=0D =0D @@ -45,7 +47,8 @@ class TargetTool(): if os.path.exists(filename) and os.path.isfile(filename):=0D return self.ConvertTextFileToDict(filename, '#', '=3D')=0D else:=0D - raise ParseError('LoadTargetTxtFile() : No Target.txt file exi= sts.')=0D + raise ParseError(=0D + 'LoadTargetTxtFile() : No Target.txt file exists.')=0D return 1=0D =0D #=0D @@ -63,11 +66,12 @@ class TargetTool(): Key =3D LineList[0].strip()=0D if Key.startswith(CommentCharacter) =3D=3D False and K= ey in self.TargetTxtDictionary:=0D if Key =3D=3D TAB_TAT_DEFINES_ACTIVE_PLATFORM or K= ey =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_CONF \=0D - or Key =3D=3D TAB_TAT_DEFINES_MAX_CONCURRENT_THR= EAD_NUMBER \=0D - or Key =3D=3D TAB_TAT_DEFINES_ACTIVE_MODULE:=0D - self.TargetTxtDictionary[Key] =3D LineList[1].= replace('\\', '/').strip()=0D + or Key =3D=3D TAB_TAT_DEFINES_MAX_CONCURRE= NT_THREAD_NUMBER \=0D + or Key =3D=3D TAB_TAT_DEFINES_ACTIVE_MODUL= E:=0D + self.TargetTxtDictionary[Key] =3D LineList[1].= replace(=0D + '\\', '/').strip()=0D elif Key =3D=3D TAB_TAT_DEFINES_TARGET or Key =3D= =3D TAB_TAT_DEFINES_TARGET_ARCH \=0D - or Key =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_TAG or = Key =3D=3D TAB_TAT_DEFINES_BUILD_RULE_CONF:=0D + or Key =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_T= AG or Key =3D=3D TAB_TAT_DEFINES_BUILD_RULE_CONF:=0D self.TargetTxtDictionary[Key] =3D LineList[1].= split()=0D f.close()=0D return 0=0D @@ -76,10 +80,11 @@ class TargetTool(): traceback.print_exception(last_type, last_value, last_tb)=0D =0D def Print(self):=0D - errMsg =3D ''=0D + errMsg =3D ''=0D for Key in self.TargetTxtDictionary:=0D if isinstance(self.TargetTxtDictionary[Key], type([])):=0D - print("%-30s =3D %s" % (Key, ''.join(elem + ' ' for elem i= n self.TargetTxtDictionary[Key])))=0D + print("%-30s =3D %s" % (Key, ''.join(elem +=0D + ' ' for elem in self.TargetTxtDictionary[Key])))=0D elif self.TargetTxtDictionary[Key] is None:=0D errMsg +=3D " Missing %s configuration information, pleas= e use TargetTool to set value!" % Key + os.linesep=0D else:=0D @@ -91,7 +96,8 @@ class TargetTool(): def RWFile(self, CommentCharacter, KeySplitCharacter, Num):=0D try:=0D fr =3D open(self.FileName, 'r')=0D - fw =3D open(os.path.normpath(os.path.join(self.WorkSpace, 'Con= f\\targetnew.txt')), 'w')=0D + fw =3D open(os.path.normpath(os.path.join(=0D + self.WorkSpace, 'Conf\\targetnew.txt')), 'w')=0D =0D existKeys =3D []=0D for Line in fr:=0D @@ -105,7 +111,8 @@ class TargetTool(): if Key not in existKeys:=0D existKeys.append(Key)=0D else:=0D - print("Warning: Found duplicate key item i= n original configuration files!")=0D + print(=0D + "Warning: Found duplicate key item in = original configuration files!")=0D =0D if Num =3D=3D 0:=0D Line =3D "%-30s =3D \n" % Key=0D @@ -116,7 +123,8 @@ class TargetTool(): fw.write(Line)=0D for key in self.TargetTxtDictionary:=0D if key not in existKeys:=0D - print("Warning: %s does not exist in original configur= ation file" % key)=0D + print(=0D + "Warning: %s does not exist in original configurat= ion file" % key)=0D Line =3D GetConfigureKeyValue(self, key)=0D if Line is None:=0D Line =3D "%-30s =3D " % key=0D @@ -125,12 +133,14 @@ class TargetTool(): fr.close()=0D fw.close()=0D os.remove(self.FileName)=0D - os.rename(os.path.normpath(os.path.join(self.WorkSpace, 'Conf\= \targetnew.txt')), self.FileName)=0D + os.rename(os.path.normpath(os.path.join(=0D + self.WorkSpace, 'Conf\\targetnew.txt')), self.FileName)=0D =0D except:=0D last_type, last_value, last_tb =3D sys.exc_info()=0D traceback.print_exception(last_type, last_value, last_tb)=0D =0D +=0D def GetConfigureKeyValue(self, Key):=0D Line =3D None=0D if Key =3D=3D TAB_TAT_DEFINES_ACTIVE_PLATFORM and self.Opt.DSCFILE is = not None:=0D @@ -141,7 +151,8 @@ def GetConfigureKeyValue(self, Key): EdkLogger.error("TargetTool", BuildToolError.FILE_NOT_FOUND,=0D "DSC file %s does not exist!" % self.Opt.DSCFI= LE, RaiseError=3DFalse)=0D elif Key =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_CONF and self.Opt.TOOL_DEFI= NITION_FILE is not None:=0D - tooldefFullPath =3D os.path.join(self.WorkSpace, self.Opt.TOOL_DEF= INITION_FILE)=0D + tooldefFullPath =3D os.path.join(=0D + self.WorkSpace, self.Opt.TOOL_DEFINITION_FILE)=0D if os.path.exists(tooldefFullPath):=0D Line =3D "%-30s =3D %s\n" % (Key, self.Opt.TOOL_DEFINITION_FIL= E)=0D else:=0D @@ -155,13 +166,16 @@ def GetConfigureKeyValue(self, Key): elif Key =3D=3D TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER and self.= Opt.NUM is not None:=0D Line =3D "%-30s =3D %s\n" % (Key, str(self.Opt.NUM))=0D elif Key =3D=3D TAB_TAT_DEFINES_TARGET and self.Opt.TARGET is not None= :=0D - Line =3D "%-30s =3D %s\n" % (Key, ''.join(elem + ' ' for elem in s= elf.Opt.TARGET))=0D + Line =3D "%-30s =3D %s\n" % (Key, ''.join(elem +=0D + ' ' for elem in self.Opt.TARGET))=0D elif Key =3D=3D TAB_TAT_DEFINES_TARGET_ARCH and self.Opt.TARGET_ARCH i= s not None:=0D - Line =3D "%-30s =3D %s\n" % (Key, ''.join(elem + ' ' for elem in s= elf.Opt.TARGET_ARCH))=0D + Line =3D "%-30s =3D %s\n" % (Key, ''.join(elem +=0D + ' ' for elem in self.Opt.TARGET_ARCH))=0D elif Key =3D=3D TAB_TAT_DEFINES_TOOL_CHAIN_TAG and self.Opt.TOOL_CHAIN= _TAG is not None:=0D Line =3D "%-30s =3D %s\n" % (Key, self.Opt.TOOL_CHAIN_TAG)=0D elif Key =3D=3D TAB_TAT_DEFINES_BUILD_RULE_CONF and self.Opt.BUILD_RUL= E_FILE is not None:=0D - buildruleFullPath =3D os.path.join(self.WorkSpace, self.Opt.BUILD_= RULE_FILE)=0D + buildruleFullPath =3D os.path.join(=0D + self.WorkSpace, self.Opt.BUILD_RULE_FILE)=0D if os.path.exists(buildruleFullPath):=0D Line =3D "%-30s =3D %s\n" % (Key, self.Opt.BUILD_RULE_FILE)=0D else:=0D @@ -169,6 +183,7 @@ def GetConfigureKeyValue(self, Key): "Build rule file %s does not exist!" % self.Op= t.BUILD_RULE_FILE, RaiseError=3DFalse)=0D return Line=0D =0D +=0D VersionNumber =3D ("0.01" + " " + gBUILD_VERSION)=0D __version__ =3D "%prog Version " + VersionNumber=0D __copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s reserved."=0D @@ -179,42 +194,51 @@ __usage__ =3D "%prog [options] {args} \ \n Set replace the default configuration with expected value specified = by option."=0D =0D gParamCheck =3D []=0D +=0D +=0D def SingleCheckCallback(option, opt_str, value, parser):=0D if option not in gParamCheck:=0D setattr(parser.values, option.dest, value)=0D gParamCheck.append(option)=0D else:=0D - parser.error("Option %s only allows one instance in command line!"= % option)=0D + parser.error(=0D + "Option %s only allows one instance in command line!" % option= )=0D +=0D =0D def RangeCheckCallback(option, opt_str, value, parser):=0D if option not in gParamCheck:=0D gParamCheck.append(option)=0D if value < 1 or value > 8:=0D - parser.error("The count of multi-thread is not in valid range = of 1 ~ 8.")=0D + parser.error(=0D + "The count of multi-thread is not in valid range of 1 ~ 8.= ")=0D else:=0D setattr(parser.values, option.dest, value)=0D else:=0D - parser.error("Option %s only allows one instance in command line!"= % option)=0D + parser.error(=0D + "Option %s only allows one instance in command line!" % option= )=0D +=0D =0D def MyOptionParser():=0D - parser =3D OptionParser(version=3D__version__, prog=3D"TargetTool.exe"= , usage=3D__usage__, description=3D__copyright__)=0D + parser =3D OptionParser(version=3D__version__, prog=3D"TargetTool.exe"= ,=0D + usage=3D__usage__, description=3D__copyright__)= =0D parser.add_option("-a", "--arch", action=3D"append", dest=3D"TARGET_AR= CH",=0D - help=3D"ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, whic= h replaces target.txt's TARGET_ARCH definition. To specify more archs, plea= se repeat this option. 0 will clear this setting in target.txt and can't co= mbine with other value.")=0D + help=3D"ARCHS is one of list: IA32, X64, ARM, AARCH6= 4 or EBC, which replaces target.txt's TARGET_ARCH definition. To specify mo= re archs, please repeat this option. 0 will clear this setting in target.tx= t and can't combine with other value.")=0D parser.add_option("-p", "--platform", action=3D"callback", type=3D"str= ing", dest=3D"DSCFILE", callback=3DSingleCheckCallback,=0D - help=3D"Specify a DSC file, which replace target.txt's ACTIVE_PLAT= FORM definition. 0 will clear this setting in target.txt and can't combine = with other value.")=0D + help=3D"Specify a DSC file, which replace target.txt= 's ACTIVE_PLATFORM definition. 0 will clear this setting in target.txt and = can't combine with other value.")=0D parser.add_option("-c", "--tooldef", action=3D"callback", type=3D"stri= ng", dest=3D"TOOL_DEFINITION_FILE", callback=3DSingleCheckCallback,=0D - help=3D"Specify the WORKSPACE relative path of tool_def.txt file, = which replace target.txt's TOOL_CHAIN_CONF definition. 0 will clear this se= tting in target.txt and can't combine with other value.")=0D + help=3D"Specify the WORKSPACE relative path of tool_= def.txt file, which replace target.txt's TOOL_CHAIN_CONF definition. 0 will= clear this setting in target.txt and can't combine with other value.")=0D parser.add_option("-t", "--target", action=3D"append", type=3D"choice"= , choices=3D['DEBUG', 'RELEASE', '0'], dest=3D"TARGET",=0D - help=3D"TARGET is one of list: DEBUG, RELEASE, which replaces targ= et.txt's TARGET definition. To specify more TARGET, please repeat this opti= on. 0 will clear this setting in target.txt and can't combine with other va= lue.")=0D + help=3D"TARGET is one of list: DEBUG, RELEASE, which= replaces target.txt's TARGET definition. To specify more TARGET, please re= peat this option. 0 will clear this setting in target.txt and can't combine= with other value.")=0D parser.add_option("-n", "--tagname", action=3D"callback", type=3D"stri= ng", dest=3D"TOOL_CHAIN_TAG", callback=3DSingleCheckCallback,=0D - help=3D"Specify the Tool Chain Tagname, which replaces target.txt'= s TOOL_CHAIN_TAG definition. 0 will clear this setting in target.txt and ca= n't combine with other value.")=0D + help=3D"Specify the Tool Chain Tagname, which replac= es target.txt's TOOL_CHAIN_TAG definition. 0 will clear this setting in tar= get.txt and can't combine with other value.")=0D parser.add_option("-r", "--buildrule", action=3D"callback", type=3D"st= ring", dest=3D"BUILD_RULE_FILE", callback=3DSingleCheckCallback,=0D - help=3D"Specify the build rule configure file, which replaces targ= et.txt's BUILD_RULE_CONF definition. If not specified, the default value Co= nf/build_rule.txt will be set.")=0D + help=3D"Specify the build rule configure file, which= replaces target.txt's BUILD_RULE_CONF definition. If not specified, the de= fault value Conf/build_rule.txt will be set.")=0D parser.add_option("-m", "--multithreadnum", action=3D"callback", type= =3D"int", dest=3D"NUM", callback=3DRangeCheckCallback,=0D - help=3D"Specify the multi-thread number which replace target.txt's= MAX_CONCURRENT_THREAD_NUMBER. If the value is less than 2, MULTIPLE_THREAD= will be disabled. If the value is larger than 1, MULTIPLE_THREAD will be e= nabled.")=0D - (opt, args)=3Dparser.parse_args()=0D + help=3D"Specify the multi-thread number which replac= e target.txt's MAX_CONCURRENT_THREAD_NUMBER. If the value is less than 2, M= ULTIPLE_THREAD will be disabled. If the value is larger than 1, MULTIPLE_TH= READ will be enabled.")=0D + (opt, args) =3D parser.parse_args()=0D return (opt, args)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D EdkLogger.Initialize()=0D EdkLogger.SetLevel(EdkLogger.QUIET)=0D @@ -232,12 +256,14 @@ if __name__ =3D=3D '__main__': if opt.TARGET is not None and len(opt.TARGET) > 1:=0D for elem in opt.TARGET:=0D if elem =3D=3D '0':=0D - print("0 will clear the TARGET setting in target.txt and c= an't combine with other value.")=0D + print(=0D + "0 will clear the TARGET setting in target.txt and can= 't combine with other value.")=0D sys.exit(1)=0D if opt.TARGET_ARCH is not None and len(opt.TARGET_ARCH) > 1:=0D for elem in opt.TARGET_ARCH:=0D if elem =3D=3D '0':=0D - print("0 will clear the TARGET_ARCH setting in target.txt = and can't combine with other value.")=0D + print(=0D + "0 will clear the TARGET_ARCH setting in target.txt an= d can't combine with other value.")=0D sys.exit(1)=0D =0D try:=0D @@ -252,4 +278,3 @@ if __name__ =3D=3D '__main__': except Exception as e:=0D last_type, last_value, last_tb =3D sys.exc_info()=0D traceback.print_exception(last_type, last_value, last_tb)=0D -=0D diff --git a/BaseTools/Source/Python/TargetTool/__init__.py b/BaseTools/Sou= rce/Python/TargetTool/__init__.py index ae712b44aa9c..48b55bd4f367 100644 --- a/BaseTools/Source/Python/TargetTool/__init__.py +++ b/BaseTools/Source/Python/TargetTool/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'TargetTool' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Trim/Trim.py b/BaseTools/Source/Python= /Trim/Trim.py index c479f7d2b2e7..cffca972d219 100644 --- a/BaseTools/Source/Python/Trim/Trim.py +++ b/BaseTools/Source/Python/Trim/Trim.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Trim files preprocessed by compiler=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -27,43 +27,51 @@ __version_number__ =3D ("0.10" + " " + gBUILD_VERSION) __version__ =3D "%prog Version " + __version_number__=0D __copyright__ =3D "Copyright (c) 2007-2018, Intel Corporation. All rights = reserved."=0D =0D -## Regular expression for matching Line Control directive like "#line xxx"= =0D +# Regular expression for matching Line Control directive like "#line xxx"= =0D gLineControlDirective =3D re.compile('^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*= )"')=0D -## Regular expression for matching "typedef struct"=0D -gTypedefPattern =3D re.compile("^\s*typedef\s+struct(\s+\w+)?\s*[{]*$", re= .MULTILINE)=0D -## Regular expression for matching "#pragma pack"=0D +# Regular expression for matching "typedef struct"=0D +gTypedefPattern =3D re.compile(=0D + "^\s*typedef\s+struct(\s+\w+)?\s*[{]*$", re.MULTILINE)=0D +# Regular expression for matching "#pragma pack"=0D gPragmaPattern =3D re.compile("^\s*#pragma\s+pack", re.MULTILINE)=0D -## Regular expression for matching "typedef"=0D +# Regular expression for matching "typedef"=0D gTypedef_SinglePattern =3D re.compile("^\s*typedef", re.MULTILINE)=0D -## Regular expression for matching "typedef struct, typedef union, struct,= union"=0D -gTypedef_MulPattern =3D re.compile("^\s*(typedef)?\s+(struct|union)(\s+\w+= )?\s*[{]*$", re.MULTILINE)=0D +# Regular expression for matching "typedef struct, typedef union, struct, = union"=0D +gTypedef_MulPattern =3D re.compile(=0D + "^\s*(typedef)?\s+(struct|union)(\s+\w+)?\s*[{]*$", re.MULTILINE)=0D =0D #=0D # The following number pattern match will only match if following criteria= is met:=0D # There is leading non-(alphanumeric or _) character, and no following alp= hanumeric or _=0D # as the pattern is greedily match, so it is ok for the gDecNumberPattern = or gHexNumberPattern to grab the maximum match=0D #=0D -## Regular expression for matching HEX number=0D -gHexNumberPattern =3D re.compile("(?<=3D[^a-zA-Z0-9_])(0[xX])([0-9a-fA-F]+= )(U(?=3D$|[^a-zA-Z0-9_]))?")=0D -## Regular expression for matching decimal number with 'U' postfix=0D -gDecNumberPattern =3D re.compile("(?<=3D[^a-zA-Z0-9_])([0-9]+)U(?=3D$|[^a-= zA-Z0-9_])")=0D -## Regular expression for matching constant with 'ULL' 'LL' postfix=0D -gLongNumberPattern =3D re.compile("(?<=3D[^a-zA-Z0-9_])(0[xX][0-9a-fA-F]+|= [0-9]+)U?LL(?=3D$|[^a-zA-Z0-9_])")=0D +# Regular expression for matching HEX number=0D +gHexNumberPattern =3D re.compile(=0D + "(?<=3D[^a-zA-Z0-9_])(0[xX])([0-9a-fA-F]+)(U(?=3D$|[^a-zA-Z0-9_]))?")= =0D +# Regular expression for matching decimal number with 'U' postfix=0D +gDecNumberPattern =3D re.compile(=0D + "(?<=3D[^a-zA-Z0-9_])([0-9]+)U(?=3D$|[^a-zA-Z0-9_])")=0D +# Regular expression for matching constant with 'ULL' 'LL' postfix=0D +gLongNumberPattern =3D re.compile(=0D + "(?<=3D[^a-zA-Z0-9_])(0[xX][0-9a-fA-F]+|[0-9]+)U?LL(?=3D$|[^a-zA-Z0-9_= ])")=0D =0D -## Regular expression for matching "Include ()" in asl file=0D -gAslIncludePattern =3D re.compile("^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\= )", re.MULTILINE)=0D -## Regular expression for matching C style #include "XXX.asl" in asl file= =0D -gAslCIncludePattern =3D re.compile(r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\= s*([>"])', re.MULTILINE)=0D -## Patterns used to convert EDK conventions to EDK2 ECP conventions=0D +# Regular expression for matching "Include ()" in asl file=0D +gAslIncludePattern =3D re.compile(=0D + "^(\s*)[iI]nclude\s*\(\"?([^\"\(\)]+)\"\)", re.MULTILINE)=0D +# Regular expression for matching C style #include "XXX.asl" in asl file=0D +gAslCIncludePattern =3D re.compile(=0D + r'^(\s*)#include\s*[<"]\s*([-\\/\w.]+)\s*([>"])', re.MULTILINE)=0D +# Patterns used to convert EDK conventions to EDK2 ECP conventions=0D =0D -## Regular expression for finding header file inclusions=0D -gIncludePattern =3D re.compile(r"^[ \t]*[%]?[ \t]*include(?:[ \t]*(?:\\(?:= \r\n|\r|\n))*[ \t]*)*(?:\(?[\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?= )", re.MULTILINE | re.UNICODE | re.IGNORECASE)=0D +# Regular expression for finding header file inclusions=0D +gIncludePattern =3D re.compile(=0D + r"^[ \t]*[%]?[ \t]*include(?:[ \t]*(?:\\(?:\r\n|\r|\n))*[ \t]*)*(?:\(?= [\"<]?[ \t]*)([-\w.\\/() \t]+)(?:[ \t]*[\">]?\)?)", re.MULTILINE | re.UNICO= DE | re.IGNORECASE)=0D =0D =0D -## file cache to avoid circular include in ASL file=0D +# file cache to avoid circular include in ASL file=0D gIncludedAslFile =3D []=0D =0D -## Trim preprocessed source code=0D +# Trim preprocessed source code=0D #=0D # Remove extra content made by preprocessor. The preprocessor must enable = the=0D # line number generation option when preprocessing.=0D @@ -72,6 +80,8 @@ gIncludedAslFile =3D [] # @param Target File to store the trimmed content=0D # @param Convert If True, convert standard HEX format to MASM format=0D #=0D +=0D +=0D def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):=0D CreateDirectory(os.path.dirname(Target))=0D try:=0D @@ -80,7 +90,8 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, Trim= Long): except IOError:=0D EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DSource)=0D except:=0D - EdkLogger.error("Trim", AUTOGEN_ERROR, "TrimPreprocessedFile: Erro= r while processing file", File=3DSource)=0D + EdkLogger.error("Trim", AUTOGEN_ERROR,=0D + "TrimPreprocessedFile: Error while processing file= ", File=3DSource)=0D =0D PreprocessedFile =3D ""=0D InjectedFile =3D ""=0D @@ -183,7 +194,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, Tr= imLong): except:=0D EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DTarget)=0D =0D -## Trim preprocessed VFR file=0D +# Trim preprocessed VFR file=0D #=0D # Remove extra content made by preprocessor. The preprocessor doesn't need= to=0D # enable line number generation option when preprocessing.=0D @@ -191,6 +202,8 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, Tr= imLong): # @param Source File to be trimmed=0D # @param Target File to store the trimmed content=0D #=0D +=0D +=0D def TrimPreprocessedVfr(Source, Target):=0D CreateDirectory(os.path.dirname(Target))=0D =0D @@ -248,7 +261,7 @@ def TrimPreprocessedVfr(Source, Target): except:=0D EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DTarget)=0D =0D -## Read the content ASL file, including ASL included, recursively=0D +# Read the content ASL file, including ASL included, recursively=0D #=0D # @param Source File to be read=0D # @param Indent Spaces before the Include() statement=0D @@ -257,7 +270,9 @@ def TrimPreprocessedVfr(Source, Target): # first for the included file; otherwise, only t= he path specified=0D # in the IncludePathList will be searched.=0D #=0D -def DoInclude(Source, Indent=3D'', IncludePathList=3D[], LocalSearchPath= =3DNone, IncludeFileList =3D None, filetype=3DNone):=0D +=0D +=0D +def DoInclude(Source, Indent=3D'', IncludePathList=3D[], LocalSearchPath= =3DNone, IncludeFileList=3DNone, filetype=3DNone):=0D NewFileContent =3D []=0D if IncludeFileList is None:=0D IncludeFileList =3D []=0D @@ -287,12 +302,11 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D= [], LocalSearchPath=3DNone, Inclu EdkLogger.warn("Trim", FILE_OPEN_FAILURE, ExtraData=3DSource)=0D return []=0D =0D -=0D # avoid A "include" B and B "include" A=0D IncludeFile =3D os.path.abspath(os.path.normpath(IncludeFile))=0D if IncludeFile in gIncludedAslFile:=0D EdkLogger.warn("Trim", "Circular include",=0D - ExtraData=3D "%s -> %s" % (" -> ".join(gIncludedAsl= File), IncludeFile))=0D + ExtraData=3D"%s -> %s" % (" -> ".join(gIncludedAslF= ile), IncludeFile))=0D return []=0D gIncludedAslFile.append(IncludeFile)=0D IncludeFileList.append(IncludeFile.strip())=0D @@ -312,7 +326,8 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone, Inclu LocalSearchPath =3D os.path.dirname(IncludeFile)=0D CurrentIndent =3D Indent + Result[0][0]=0D IncludedFile =3D Result[0][1]=0D - NewFileContent.extend(DoInclude(IncludedFile, CurrentIndent, I= ncludePathList, LocalSearchPath,IncludeFileList,filetype))=0D + NewFileContent.extend(DoInclude(=0D + IncludedFile, CurrentIndent, IncludePathList, LocalSearchP= ath, IncludeFileList, filetype))=0D NewFileContent.append("\n")=0D elif filetype =3D=3D "ASM":=0D Result =3D gIncludePattern.findall(Line)=0D @@ -324,7 +339,8 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone, Inclu =0D IncludedFile =3D IncludedFile.strip()=0D IncludedFile =3D os.path.normpath(IncludedFile)=0D - NewFileContent.extend(DoInclude(IncludedFile, '', IncludePathL= ist, LocalSearchPath,IncludeFileList,filetype))=0D + NewFileContent.extend(DoInclude(=0D + IncludedFile, '', IncludePathList, LocalSearchPath, Includ= eFileList, filetype))=0D NewFileContent.append("\n")=0D =0D gIncludedAslFile.pop()=0D @@ -332,7 +348,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone, Inclu return NewFileContent=0D =0D =0D -## Trim ASL file=0D +# Trim ASL file=0D #=0D # Replace ASL include statement with the content the included file=0D #=0D @@ -340,7 +356,7 @@ def DoInclude(Source, Indent=3D'', IncludePathList=3D[]= , LocalSearchPath=3DNone, Inclu # @param Target File to store the trimmed content=0D # @param IncludePathFile The file to log the external include path=0D #=0D -def TrimAslFile(Source, Target, IncludePathFile,AslDeps =3D False):=0D +def TrimAslFile(Source, Target, IncludePathFile, AslDeps=3DFalse):=0D CreateDirectory(os.path.dirname(Target))=0D =0D SourceDir =3D os.path.dirname(Source)=0D @@ -363,16 +379,20 @@ def TrimAslFile(Source, Target, IncludePathFile,AslDe= ps =3D False): FileLines =3D File.readlines()=0D for Line in FileLines:=0D LineNum +=3D 1=0D - if Line.startswith("/I") or Line.startswith ("-I"):=0D + if Line.startswith("/I") or Line.startswith("-I"):=0D IncludePathList.append(Line[2:].strip())=0D else:=0D - EdkLogger.warn("Trim", "Invalid include line in includ= e list file.", IncludePathFile, LineNum)=0D + EdkLogger.warn(=0D + "Trim", "Invalid include line in include list file= .", IncludePathFile, LineNum)=0D except:=0D - EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DInclude= PathFile)=0D + EdkLogger.error("Trim", FILE_OPEN_FAILURE,=0D + ExtraData=3DIncludePathFile)=0D AslIncludes =3D []=0D - Lines =3D DoInclude(Source, '', IncludePathList,IncludeFileList=3DAslI= ncludes,filetype=3D'ASL')=0D - AslIncludes =3D [item for item in AslIncludes if item !=3DSource]=0D - SaveFileOnChange(os.path.join(os.path.dirname(Target),os.path.basename= (Source))+".trim.deps", " \\\n".join([Source+":"] +AslIncludes),False)=0D + Lines =3D DoInclude(Source, '', IncludePathList,=0D + IncludeFileList=3DAslIncludes, filetype=3D'ASL')=0D + AslIncludes =3D [item for item in AslIncludes if item !=3D Source]=0D + SaveFileOnChange(os.path.join(os.path.dirname(Target), os.path.basenam= e(=0D + Source))+".trim.deps", " \\\n".join([Source+":"] + AslIncludes), F= alse)=0D =0D #=0D # Undef MIN and MAX to avoid collision in ASL source code=0D @@ -386,7 +406,7 @@ def TrimAslFile(Source, Target, IncludePathFile,AslDeps= =3D False): except:=0D EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DTarget)=0D =0D -## Trim ASM file=0D +# Trim ASM file=0D #=0D # Output ASM include statement with the content the included file=0D #=0D @@ -394,6 +414,8 @@ def TrimAslFile(Source, Target, IncludePathFile,AslDeps= =3D False): # @param Target File to store the trimmed content=0D # @param IncludePathFile The file to log the external include path=0D #=0D +=0D +=0D def TrimAsmFile(Source, Target, IncludePathFile):=0D CreateDirectory(os.path.dirname(Target))=0D =0D @@ -416,17 +438,21 @@ def TrimAsmFile(Source, Target, IncludePathFile): FileLines =3D File.readlines()=0D for Line in FileLines:=0D LineNum +=3D 1=0D - if Line.startswith("/I") or Line.startswith ("-I"):=0D + if Line.startswith("/I") or Line.startswith("-I"):=0D IncludePathList.append(Line[2:].strip())=0D else:=0D - EdkLogger.warn("Trim", "Invalid include line in includ= e list file.", IncludePathFile, LineNum)=0D + EdkLogger.warn(=0D + "Trim", "Invalid include line in include list file= .", IncludePathFile, LineNum)=0D except:=0D - EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DInclude= PathFile)=0D + EdkLogger.error("Trim", FILE_OPEN_FAILURE,=0D + ExtraData=3DIncludePathFile)=0D AsmIncludes =3D []=0D - Lines =3D DoInclude(Source, '', IncludePathList,IncludeFileList=3DAsmI= ncludes,filetype=3D'ASM')=0D + Lines =3D DoInclude(Source, '', IncludePathList,=0D + IncludeFileList=3DAsmIncludes, filetype=3D'ASM')=0D AsmIncludes =3D [item for item in AsmIncludes if item !=3D Source]=0D if AsmIncludes:=0D - SaveFileOnChange(os.path.join(os.path.dirname(Target),os.path.base= name(Source))+".trim.deps", " \\\n".join([Source+":"] +AsmIncludes),False)= =0D + SaveFileOnChange(os.path.join(os.path.dirname(Target), os.path.bas= ename(=0D + Source))+".trim.deps", " \\\n".join([Source+":"] + AsmIncludes= ), False)=0D # save all lines trimmed=0D try:=0D with open(Target, 'w') as File:=0D @@ -434,6 +460,7 @@ def TrimAsmFile(Source, Target, IncludePathFile): except:=0D EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=3DTarget)=0D =0D +=0D def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile):=0D VfrNameList =3D []=0D if os.path.isdir(DebugDir):=0D @@ -441,9 +468,9 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile): for FileName in Files:=0D Name, Ext =3D os.path.splitext(FileName)=0D if Ext =3D=3D '.c' and Name !=3D 'AutoGen':=0D - VfrNameList.append (Name + 'Bin')=0D + VfrNameList.append(Name + 'Bin')=0D =0D - VfrNameList.append (ModuleName + 'Strings')=0D + VfrNameList.append(ModuleName + 'Strings')=0D =0D EfiFileName =3D os.path.join(DebugDir, ModuleName + '.efi')=0D MapFileName =3D os.path.join(DebugDir, ModuleName + '.map')=0D @@ -455,7 +482,8 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile): try:=0D fInputfile =3D open(OutputFile, "wb+")=0D except:=0D - EdkLogger.error("Trim", FILE_OPEN_FAILURE, "File open failed for %= s" %OutputFile, None)=0D + EdkLogger.error("Trim", FILE_OPEN_FAILURE,=0D + "File open failed for %s" % OutputFile, None)=0D =0D # Use a instance of BytesIO to cache data=0D fStringIO =3D BytesIO()=0D @@ -469,8 +497,8 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFile): #=0D UniGuid =3D b'\xe0\xc5\x13\x89\xf63\x86M\x9b\xf1C\xef\x89\xfc\= x06f'=0D fStringIO.write(UniGuid)=0D - UniValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (UniValue)=0D + UniValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(UniValue)=0D else:=0D #=0D # VFR binary offset in image.=0D @@ -479,23 +507,24 @@ def GenerateVfrBinSec(ModuleName, DebugDir, OutputFil= e): #=0D VfrGuid =3D b'\xb4|\xbc\xd0Gj_I\xaa\x11q\x07F\xda\x06\xa2'=0D fStringIO.write(VfrGuid)=0D - type (Item[1])=0D - VfrValue =3D pack ('Q', int (Item[1], 16))=0D - fStringIO.write (VfrValue)=0D + type(Item[1])=0D + VfrValue =3D pack('Q', int(Item[1], 16))=0D + fStringIO.write(VfrValue)=0D =0D #=0D # write data into file.=0D #=0D - try :=0D - fInputfile.write (fStringIO.getvalue())=0D + try:=0D + fInputfile.write(fStringIO.getvalue())=0D except:=0D - EdkLogger.error("Trim", FILE_WRITE_FAILURE, "Write data to file %s= failed, please check whether the file been locked or using by other applic= ations." %OutputFile, None)=0D + EdkLogger.error("Trim", FILE_WRITE_FAILURE,=0D + "Write data to file %s failed, please check whethe= r the file been locked or using by other applications." % OutputFile, None)= =0D =0D - fStringIO.close ()=0D - fInputfile.close ()=0D + fStringIO.close()=0D + fInputfile.close()=0D =0D =0D -## Parse command line options=0D +# Parse command line options=0D #=0D # Using standard Python module optparse to parse command line option of th= is tool.=0D #=0D @@ -509,13 +538,13 @@ def Options(): make_option("-r", "--vfr-file", dest=3D"FileType", const=3D"Vfr", = action=3D"store_const",=0D help=3D"The input file is preprocessed VFR file"= ),=0D make_option("--Vfr-Uni-Offset", dest=3D"FileType", const=3D"VfrOff= setBin", action=3D"store_const",=0D - help=3D"The input file is EFI image"),=0D + help=3D"The input file is EFI image"),=0D make_option("--asl-deps", dest=3D"AslDeps", const=3D"True", action= =3D"store_const",=0D - help=3D"Generate Asl dependent files."),=0D + help=3D"Generate Asl dependent files."),=0D make_option("-a", "--asl-file", dest=3D"FileType", const=3D"Asl", = action=3D"store_const",=0D help=3D"The input file is ASL file"),=0D - make_option( "--asm-file", dest=3D"FileType", const=3D"Asm", actio= n=3D"store_const",=0D - help=3D"The input file is asm file"),=0D + make_option("--asm-file", dest=3D"FileType", const=3D"Asm", action= =3D"store_const",=0D + help=3D"The input file is asm file"),=0D make_option("-c", "--convert-hex", dest=3D"ConvertHex", action=3D"= store_true",=0D help=3D"Convert standard hex format (0xabcd) to = MASM format (abcdh)"),=0D =0D @@ -525,22 +554,25 @@ def Options(): help=3D"The input file is include path list to s= earch for ASL include file"),=0D make_option("-o", "--output", dest=3D"OutputFile",=0D help=3D"File to store the trimmed content"),=0D - make_option("--ModuleName", dest=3D"ModuleName", help=3D"The modul= e's BASE_NAME"),=0D + make_option("--ModuleName", dest=3D"ModuleName",=0D + help=3D"The module's BASE_NAME"),=0D make_option("--DebugDir", dest=3D"DebugDir",=0D - help=3D"Debug Output directory to store the outp= ut files"),=0D + help=3D"Debug Output directory to store the output fil= es"),=0D make_option("-v", "--verbose", dest=3D"LogLevel", action=3D"store_= const", const=3DEdkLogger.VERBOSE,=0D help=3D"Run verbosely"),=0D make_option("-d", "--debug", dest=3D"LogLevel", type=3D"int",=0D help=3D"Run with debug information"),=0D make_option("-q", "--quiet", dest=3D"LogLevel", action=3D"store_co= nst", const=3DEdkLogger.QUIET,=0D help=3D"Run quietly"),=0D - make_option("-?", action=3D"help", help=3D"show this help message = and exit"),=0D + make_option("-?", action=3D"help",=0D + help=3D"show this help message and exit"),=0D ]=0D =0D # use clearer usage to override default usage message=0D UsageString =3D "%prog [-s|-r|-a|--Vfr-Uni-Offset] [-c] [-v|-d |-q] [-i ] [-o ] [--ModuleName ] [--DebugDir ] []"=0D =0D - Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__, option_list=3DOptionList, usage=3DUsageString)=0D + Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__,=0D + option_list=3DOptionList, usage=3DUsageString)=0D Parser.set_defaults(FileType=3D"Vfr")=0D Parser.set_defaults(ConvertHex=3DFalse)=0D Parser.set_defaults(LogLevel=3DEdkLogger.INFO)=0D @@ -552,16 +584,18 @@ def Options(): if len(Args) =3D=3D 0:=0D return Options, ''=0D elif len(Args) > 1:=0D - EdkLogger.error("Trim", OPTION_NOT_SUPPORTED, ExtraData=3DPars= er.get_usage())=0D + EdkLogger.error("Trim", OPTION_NOT_SUPPORTED,=0D + ExtraData=3DParser.get_usage())=0D if len(Args) =3D=3D 0:=0D EdkLogger.error("Trim", OPTION_MISSING, ExtraData=3DParser.get_usa= ge())=0D if len(Args) > 1:=0D - EdkLogger.error("Trim", OPTION_NOT_SUPPORTED, ExtraData=3DParser.g= et_usage())=0D + EdkLogger.error("Trim", OPTION_NOT_SUPPORTED,=0D + ExtraData=3DParser.get_usage())=0D =0D InputFile =3D Args[0]=0D return Options, InputFile=0D =0D -## Entrance method=0D +# Entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -570,6 +604,8 @@ def Options(): # @retval 0 Tool was successful=0D # @retval 1 Tool failed=0D #=0D +=0D +=0D def Main():=0D try:=0D EdkLogger.Initialize()=0D @@ -584,44 +620,54 @@ def Main(): try:=0D if CommandOptions.FileType =3D=3D "Vfr":=0D if CommandOptions.OutputFile is None:=0D - CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= 0] + '.iii'=0D + CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= =0D + 0] + '.iii'=0D TrimPreprocessedVfr(InputFile, CommandOptions.OutputFile)=0D elif CommandOptions.FileType =3D=3D "Asl":=0D if CommandOptions.OutputFile is None:=0D - CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= 0] + '.iii'=0D - TrimAslFile(InputFile, CommandOptions.OutputFile, CommandOptio= ns.IncludePathFile,CommandOptions.AslDeps)=0D + CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= =0D + 0] + '.iii'=0D + TrimAslFile(InputFile, CommandOptions.OutputFile,=0D + CommandOptions.IncludePathFile, CommandOptions.Asl= Deps)=0D elif CommandOptions.FileType =3D=3D "VfrOffsetBin":=0D - GenerateVfrBinSec(CommandOptions.ModuleName, CommandOptions.De= bugDir, CommandOptions.OutputFile)=0D + GenerateVfrBinSec(CommandOptions.ModuleName,=0D + CommandOptions.DebugDir, CommandOptions.Outp= utFile)=0D elif CommandOptions.FileType =3D=3D "Asm":=0D - TrimAsmFile(InputFile, CommandOptions.OutputFile, CommandOptio= ns.IncludePathFile)=0D - else :=0D + TrimAsmFile(InputFile, CommandOptions.OutputFile,=0D + CommandOptions.IncludePathFile)=0D + else:=0D if CommandOptions.OutputFile is None:=0D - CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= 0] + '.iii'=0D - TrimPreprocessedFile(InputFile, CommandOptions.OutputFile, Com= mandOptions.ConvertHex, CommandOptions.TrimLong)=0D + CommandOptions.OutputFile =3D os.path.splitext(InputFile)[= =0D + 0] + '.iii'=0D + TrimPreprocessedFile(InputFile, CommandOptions.OutputFile,=0D + CommandOptions.ConvertHex, CommandOptions= .TrimLong)=0D except FatalError as X:=0D import platform=0D import traceback=0D if CommandOptions is not None and CommandOptions.LogLevel <=3D Edk= Logger.DEBUG_9:=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_versio= n(), sys.platform) + traceback.format_exc())=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.forma= t_exc())=0D return 1=0D except:=0D import traceback=0D import platform=0D EdkLogger.error(=0D - "\nTrim",=0D - CODE_ERROR,=0D - "Unknown fatal error when trimming [%s]" % InputFile,= =0D - ExtraData=3D"\n(Please send email to %s for help, atta= ching following call stack trace!)\n" % MSG_EDKII_MAIL_ADDR,=0D - RaiseError=3DFalse=0D - )=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(),= sys.platform) + traceback.format_exc())=0D + "\nTrim",=0D + CODE_ERROR,=0D + "Unknown fatal error when trimming [%s]" % InputFile,=0D + ExtraData=3D"\n(Please send email to %s for help, attaching fo= llowing call stack trace!)\n" % MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.format_ex= c())=0D return 1=0D =0D return 0=0D =0D +=0D if __name__ =3D=3D '__main__':=0D r =3D Main()=0D - ## 0-127 is a safe return range, and 1 is a standard default error=0D - if r < 0 or r > 127: r =3D 1=0D + # 0-127 is a safe return range, and 1 is a standard default error=0D + if r < 0 or r > 127:=0D + r =3D 1=0D sys.exit(r)=0D -=0D diff --git a/BaseTools/Source/Python/UPT/BuildVersion.py b/BaseTools/Source= /Python/UPT/BuildVersion.py index 1b144dc1b666..de0225985950 100644 --- a/BaseTools/Source/Python/UPT/BuildVersion.py +++ b/BaseTools/Source/Python/UPT/BuildVersion.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This file is for build version number auto generation=0D #=0D diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTool= s/Source/Python/UPT/Core/DependencyRules.py index 0c801c72d614..2b6b088b4809 100644 --- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py +++ b/BaseTools/Source/Python/UPT/Core/DependencyRules.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is for installed package information database operations=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -26,11 +26,11 @@ from Library import GlobalData from Logger.ToolError import FatalError=0D from Logger.ToolError import EDK1_INF_ERROR=0D from Logger.ToolError import UNKNOWN_ERROR=0D -(DEPEX_CHECK_SUCCESS, DEPEX_CHECK_MODULE_NOT_FOUND, \=0D -DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) =3D (0, 1, 2, 3)= =0D +(DEPEX_CHECK_SUCCESS, DEPEX_CHECK_MODULE_NOT_FOUND,=0D + DEPEX_CHECK_PACKAGE_NOT_FOUND, DEPEX_CHECK_DP_NOT_FOUND) =3D (0, 1, 2, 3)= =0D =0D =0D -## DependencyRules=0D +# DependencyRules=0D #=0D # This class represents the dependency rule check mechanism=0D #=0D @@ -42,10 +42,12 @@ class DependencyRules(object): self.WsPkgList =3D GetWorkspacePackage()=0D self.WsModuleList =3D GetWorkspaceModule()=0D =0D - self.PkgsToBeDepend =3D [(PkgInfo[1], PkgInfo[2]) for PkgInfo in s= elf.WsPkgList]=0D + self.PkgsToBeDepend =3D [(PkgInfo[1], PkgInfo[2])=0D + for PkgInfo in self.WsPkgList]=0D =0D # Add package info from the DIST to be installed.=0D - self.PkgsToBeDepend.extend(self.GenToBeInstalledPkgList(ToBeInstal= ledPkgList))=0D + self.PkgsToBeDepend.extend(=0D + self.GenToBeInstalledPkgList(ToBeInstalledPkgList))=0D =0D def GenToBeInstalledPkgList(self, ToBeInstalledPkgList):=0D if not ToBeInstalledPkgList:=0D @@ -57,7 +59,7 @@ class DependencyRules(object): =0D return RtnList=0D =0D - ## Check whether a module exists by checking the Guid+Version+Name+Pat= h combination=0D + # Check whether a module exists by checking the Guid+Version+Name+Path= combination=0D #=0D # @param Guid: Guid of a module=0D # @param Version: Version of a module=0D @@ -68,14 +70,15 @@ class DependencyRules(object): def CheckModuleExists(self, Guid, Version, Name, Path):=0D Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST)=0D ModuleList =3D self.IpiDb.GetModInPackage(Guid, Version, Name, Pat= h)=0D - ModuleList.extend(self.IpiDb.GetStandaloneModule(Guid, Version, Na= me, Path))=0D + ModuleList.extend(self.IpiDb.GetStandaloneModule(=0D + Guid, Version, Name, Path))=0D Logger.Verbose(ST.MSG_CHECK_MODULE_EXIST_FINISH)=0D if len(ModuleList) > 0:=0D return True=0D else:=0D return False=0D =0D - ## Check whether a module depex satisfied.=0D + # Check whether a module depex satisfied.=0D #=0D # @param ModuleObj: A module object=0D # @param DpObj: A distribution object=0D @@ -103,7 +106,7 @@ class DependencyRules(object): for GuidVerPair in DpObj.PackageSurfaceArea.keys():=0D if Dep.GetGuid() =3D=3D GuidVerPair[0]:=0D if Dep.GetVersion() is None or \=0D - len(Dep.GetVersion()) =3D=3D 0:=0D + len(Dep.GetVersion()) =3D=3D 0:=0D Result =3D True=0D break=0D if Dep.GetVersion() =3D=3D GuidVerPair[1]:=0D @@ -114,14 +117,14 @@ class DependencyRules(object): break=0D =0D if not Result:=0D - Logger.Error("CheckModuleDepex", UNKNOWN_ERROR, \=0D - ST.ERR_DEPENDENCY_NOT_MATCH % (ModuleObj.GetName(= ), \=0D - Dep.GetPackageFile= Path(), \=0D - Dep.GetGuid(), \=0D + Logger.Error("CheckModuleDepex", UNKNOWN_ERROR,=0D + ST.ERR_DEPENDENCY_NOT_MATCH % (ModuleObj.GetName(= ),=0D + Dep.GetPackageFile= Path(),=0D + Dep.GetGuid(),=0D Dep.GetVersion()))= =0D return Result=0D =0D - ## Check whether a package exists in a package list specified by PkgsT= oBeDepend.=0D + # Check whether a package exists in a package list specified by PkgsTo= BeDepend.=0D #=0D # @param Guid: Guid of a package=0D # @param Version: Version of a package=0D @@ -148,7 +151,7 @@ class DependencyRules(object): Logger.Verbose(ST.MSG_CHECK_PACKAGE_FINISH)=0D return Found=0D =0D - ## Check whether a package depex satisfied.=0D + # Check whether a package depex satisfied.=0D #=0D # @param PkgObj: A package object=0D # @param DpObj: A distribution object=0D @@ -165,7 +168,7 @@ class DependencyRules(object): return False=0D return True=0D =0D - ## Check whether a DP exists.=0D + # Check whether a DP exists.=0D #=0D # @param Guid: Guid of a Distribution=0D # @param Version: Version of a Distribution=0D @@ -182,7 +185,7 @@ class DependencyRules(object): Logger.Verbose(ST.MSG_CHECK_DP_FINISH)=0D return Found=0D =0D - ## Check whether a DP depex satisfied by current workspace for Install= =0D + # Check whether a DP depex satisfied by current workspace for Install= =0D #=0D # @param DpObj: A distribution object=0D # @return: True if distribution depex satisfied=0D @@ -208,24 +211,26 @@ class DependencyRules(object): =0D return True, DpObj=0D =0D -=0D - ## Check whether a DP depex satisfied by current workspace=0D + # Check whether a DP depex satisfied by current workspace=0D # (excluding the original distribution's packages to be replaced) for= Replace=0D #=0D # @param DpObj: A distribution object=0D # @param OrigDpGuid: The original distribution's Guid=0D # @param OrigDpVersion: The original distribution's Version=0D #=0D +=0D def ReplaceCheckNewDpDepex(self, DpObj, OrigDpGuid, OrigDpVersion):=0D - self.PkgsToBeDepend =3D [(PkgInfo[1], PkgInfo[2]) for PkgInfo in s= elf.WsPkgList]=0D - OrigDpPackageList =3D self.IpiDb.GetPackageListFromDp(OrigDpGuid, = OrigDpVersion)=0D + self.PkgsToBeDepend =3D [(PkgInfo[1], PkgInfo[2])=0D + for PkgInfo in self.WsPkgList]=0D + OrigDpPackageList =3D self.IpiDb.GetPackageListFromDp(=0D + OrigDpGuid, OrigDpVersion)=0D for OrigPkgInfo in OrigDpPackageList:=0D Guid, Version =3D OrigPkgInfo[0], OrigPkgInfo[1]=0D if (Guid, Version) in self.PkgsToBeDepend:=0D self.PkgsToBeDepend.remove((Guid, Version))=0D return self.CheckDpDepexSatisfied(DpObj)=0D =0D - ## Check whether a DP depex satisfied by current workspace.=0D + # Check whether a DP depex satisfied by current workspace.=0D #=0D # @param DpObj: A distribution object=0D #=0D @@ -246,7 +251,7 @@ class DependencyRules(object): =0D return True=0D =0D - ## Check whether a DP could be removed from current workspace.=0D + # Check whether a DP could be removed from current workspace.=0D #=0D # @param DpGuid: File's guid=0D # @param DpVersion: File's version=0D @@ -293,7 +298,7 @@ class DependencyRules(object): #=0D for (PkgGuid, PkgVersion, InstallPath) in DpPackageList:=0D Logger.Warn("UPT",=0D - ST.WARN_INSTALLED_PACKAGE_NOT_FOUND%(PkgGuid, PkgV= ersion, InstallPath))=0D + ST.WARN_INSTALLED_PACKAGE_NOT_FOUND % (PkgGuid, Pk= gVersion, InstallPath))=0D =0D #=0D # check modules to see if has dependency on package of current DP= =0D @@ -304,8 +309,7 @@ class DependencyRules(object): DependModuleList.append(Module)=0D return (Removable, DependModuleList)=0D =0D -=0D - ## Check whether a DP could be replaced by a distribution containing N= ewDpPkgList=0D + # Check whether a DP could be replaced by a distribution containing Ne= wDpPkgList=0D # from current workspace.=0D #=0D # @param OrigDpGuid: original Dp's Guid=0D @@ -314,6 +318,7 @@ class DependencyRules(object): # @retval Replaceable: True if distribution could be replaced, False E= lse=0D # @retval DependModuleList: the list of modules that make distribution= can not be replaced=0D #=0D +=0D def CheckDpDepexForReplace(self, OrigDpGuid, OrigDpVersion, NewDpPkgLi= st):=0D Replaceable =3D True=0D DependModuleList =3D []=0D @@ -333,7 +338,8 @@ class DependencyRules(object): #=0D # get packages in current Dp and find the install path=0D # List of item (PkgGuid, PkgVersion, InstallPath)=0D - DpPackageList =3D self.IpiDb.GetPackageListFromDp(OrigDpGuid, Orig= DpVersion)=0D + DpPackageList =3D self.IpiDb.GetPackageListFromDp(=0D + OrigDpGuid, OrigDpVersion)=0D DpPackagePathList =3D []=0D WorkSP =3D GlobalData.gWORKSPACE=0D for (PkgName, PkgGuid, PkgVersion, DecFile) in self.WsPkgList:=0D @@ -358,7 +364,7 @@ class DependencyRules(object): #=0D for (PkgGuid, PkgVersion, InstallPath) in DpPackageList:=0D Logger.Warn("UPT",=0D - ST.WARN_INSTALLED_PACKAGE_NOT_FOUND%(PkgGuid, PkgV= ersion, InstallPath))=0D + ST.WARN_INSTALLED_PACKAGE_NOT_FOUND % (PkgGuid, Pk= gVersion, InstallPath))=0D =0D #=0D # check modules to see if it can be satisfied by package not belon= g to removed DP=0D @@ -370,7 +376,7 @@ class DependencyRules(object): return (Replaceable, DependModuleList)=0D =0D =0D -## check whether module depends on packages in DpPackagePathList, return T= rue=0D +# check whether module depends on packages in DpPackagePathList, return Tr= ue=0D # if found, False else=0D #=0D # @param Path: a module path=0D @@ -382,7 +388,8 @@ def VerifyRemoveModuleDep(Path, DpPackagePathList): try:=0D for Item in GetPackagePath(Path):=0D if Item in DpPackagePathList:=0D - DecPath =3D os.path.normpath(os.path.join(GlobalData.gWORK= SPACE, Item))=0D + DecPath =3D os.path.normpath(=0D + os.path.join(GlobalData.gWORKSPACE, Item))=0D Logger.Info(ST.MSG_MODULE_DEPEND_ON % (Path, DecPath))=0D return False=0D else:=0D @@ -390,7 +397,7 @@ def VerifyRemoveModuleDep(Path, DpPackagePathList): except FatalError as ErrCode:=0D if ErrCode.message =3D=3D EDK1_INF_ERROR:=0D Logger.Warn("UPT",=0D - ST.WRN_EDK1_INF_FOUND%Path)=0D + ST.WRN_EDK1_INF_FOUND % Path)=0D return True=0D else:=0D return True=0D @@ -399,6 +406,8 @@ def VerifyRemoveModuleDep(Path, DpPackagePathList): #=0D # Get Dependency package path from an Inf file path=0D #=0D +=0D +=0D def GetPackagePath(InfPath):=0D PackagePath =3D []=0D if os.path.exists(InfPath):=0D @@ -419,7 +428,7 @@ def GetPackagePath(InfPath): =0D return PackagePath=0D =0D -## check whether module depends on packages in DpPackagePathList and can n= ot be satisfied by OtherPkgList=0D +# check whether module depends on packages in DpPackagePathList and can no= t be satisfied by OtherPkgList=0D #=0D # @param Path: a module path=0D # @param DpPackagePathList: a list of Package Paths=0D @@ -428,11 +437,14 @@ def GetPackagePath(InfPath): # True: either module doesn't depend on DpPackagePathList or mo= dule depends on DpPackagePathList=0D # but can be satisfied by OtherPkgList=0D #=0D +=0D +=0D def VerifyReplaceModuleDep(Path, DpPackagePathList, OtherPkgList):=0D try:=0D for Item in GetPackagePath(Path):=0D if Item in DpPackagePathList:=0D - DecPath =3D os.path.normpath(os.path.join(GlobalData.gWORK= SPACE, Item))=0D + DecPath =3D os.path.normpath(=0D + os.path.join(GlobalData.gWORKSPACE, Item))=0D Name, Guid, Version =3D GetPkgInfoFromDec(DecPath)=0D if (Guid, Version) not in OtherPkgList:=0D Logger.Info(ST.MSG_MODULE_DEPEND_ON % (Path, DecPath))= =0D @@ -442,7 +454,7 @@ def VerifyReplaceModuleDep(Path, DpPackagePathList, Oth= erPkgList): except FatalError as ErrCode:=0D if ErrCode.message =3D=3D EDK1_INF_ERROR:=0D Logger.Warn("UPT",=0D - ST.WRN_EDK1_INF_FOUND%Path)=0D + ST.WRN_EDK1_INF_FOUND % Path)=0D return True=0D else:=0D return True=0D diff --git a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py b= /BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py index 5ee79b6317bc..5fa211c9088a 100644 --- a/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py +++ b/BaseTools/Source/Python/UPT/Core/DistributionPackageClass.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define a class object to describe a distribution pa= ckage=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -28,12 +28,14 @@ from Object.POM.CommonObject import CommonHeaderObject from Object.POM.CommonObject import MiscFileObject=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## DistributionPackageHeaderClass=0D +# DistributionPackageHeaderClass=0D #=0D # @param IdentificationObject: Identification Object=0D # @param CommonHeaderObject: Common Header Object=0D #=0D -class DistributionPackageHeaderObject(IdentificationObject, \=0D +=0D +=0D +class DistributionPackageHeaderObject(IdentificationObject,=0D CommonHeaderObject):=0D def __init__(self):=0D IdentificationObject.__init__(self)=0D @@ -78,10 +80,12 @@ class DistributionPackageHeaderObject(IdentificationObj= ect, \ def GetXmlSpecification(self):=0D return self.XmlSpecification=0D =0D -## DistributionPackageClass=0D +# DistributionPackageClass=0D #=0D # @param object: DistributionPackageClass=0D #=0D +=0D +=0D class DistributionPackageClass(object):=0D def __init__(self):=0D self.Header =3D DistributionPackageHeaderObject()=0D @@ -98,7 +102,7 @@ class DistributionPackageClass(object): self.UserExtensions =3D []=0D self.FileList =3D []=0D =0D - ## Get all included packages and modules for a distribution package=0D + # Get all included packages and modules for a distribution package=0D #=0D # @param WorkspaceDir: WorkspaceDir=0D # @param PackageList: A list of all packages=0D @@ -115,7 +119,8 @@ class DistributionPackageClass(object): for PackageFile in PackageList:=0D PackageFileFullPath =3D mws.join(Root, PackageFile)=0D WorkspaceDir =3D mws.getWs(Root, PackageFile)=0D - DecObj =3D DecPomAlignment(PackageFileFullPath, WorkspaceD= ir, CheckMulDec=3DTrue)=0D + DecObj =3D DecPomAlignment(=0D + PackageFileFullPath, WorkspaceDir, CheckMulDec=3DTrue)= =0D PackageObj =3D DecObj=0D #=0D # Parser inf file one bye one=0D @@ -127,10 +132,10 @@ class DistributionPackageClass(object): if ModuleList and WsRelPath in ModuleList:=0D Logger.Error("UPT",=0D OPTION_VALUE_INVALID,=0D - ST.ERR_NOT_STANDALONE_MODULE_ERROR%\= =0D + ST.ERR_NOT_STANDALONE_MODULE_ERROR %= =0D (WsRelPath, PackageFile))=0D - Filename =3D os.path.normpath\=0D - (os.path.join(PackageObj.GetRelaPath(), File))=0D + Filename =3D os.path.normpath(=0D + os.path.join(PackageObj.GetRelaPath(), File))=0D os.path.splitext(Filename)=0D #=0D # Call INF parser to generate Inf Object.=0D @@ -138,27 +143,27 @@ class DistributionPackageClass(object): # Inf class in InfPomAlignment.=0D #=0D try:=0D - ModuleObj =3D InfPomAlignment(Filename, WorkspaceD= ir, PackageObj.GetPackagePath())=0D + ModuleObj =3D InfPomAlignment(=0D + Filename, WorkspaceDir, PackageObj.GetPackageP= ath())=0D =0D #=0D # Add module to package=0D #=0D ModuleDict =3D PackageObj.GetModuleDict()=0D - ModuleDict[(ModuleObj.GetGuid(), \=0D - ModuleObj.GetVersion(), \=0D - ModuleObj.GetName(), \=0D + ModuleDict[(ModuleObj.GetGuid(),=0D + ModuleObj.GetVersion(),=0D + ModuleObj.GetName(),=0D ModuleObj.GetCombinePath())] =3D Modul= eObj=0D PackageObj.SetModuleDict(ModuleDict)=0D except FatalError as ErrCode:=0D if ErrCode.message =3D=3D EDK1_INF_ERROR:=0D Logger.Warn("UPT",=0D - ST.WRN_EDK1_INF_FOUND%Filename)=0D + ST.WRN_EDK1_INF_FOUND % Filename)= =0D else:=0D raise=0D =0D - self.PackageSurfaceArea\=0D - [(PackageObj.GetGuid(), PackageObj.GetVersion(), \=0D - PackageObj.GetCombinePath())] =3D PackageObj=0D + self.PackageSurfaceArea[(PackageObj.GetGuid(), PackageObj.= GetVersion(),=0D + PackageObj.GetCombinePath())] =3D= PackageObj=0D =0D #=0D # Get Modules=0D @@ -169,7 +174,8 @@ class DistributionPackageClass(object): WorkspaceDir =3D mws.getWs(Root, ModuleFile)=0D =0D try:=0D - ModuleObj =3D InfPomAlignment(ModuleFileFullPath, Work= spaceDir)=0D + ModuleObj =3D InfPomAlignment(=0D + ModuleFileFullPath, WorkspaceDir)=0D ModuleKey =3D (ModuleObj.GetGuid(),=0D ModuleObj.GetVersion(),=0D ModuleObj.GetName(),=0D @@ -179,7 +185,7 @@ class DistributionPackageClass(object): if ErrCode.message =3D=3D EDK1_INF_ERROR:=0D Logger.Error("UPT",=0D EDK1_INF_ERROR,=0D - ST.WRN_EDK1_INF_FOUND%ModuleFileFullP= ath,=0D + ST.WRN_EDK1_INF_FOUND % ModuleFileFul= lPath,=0D ExtraData=3DST.ERR_NOT_SUPPORTED_SA_M= ODULE)=0D else:=0D raise=0D @@ -187,7 +193,7 @@ class DistributionPackageClass(object): # Recover WorkspaceDir=0D WorkspaceDir =3D Root=0D =0D - ## Get all files included for a distribution package, except tool/misc= of=0D + # Get all files included for a distribution package, except tool/misc = of=0D # distribution level=0D #=0D # @retval DistFileList A list of filepath for NonMetaDataFile, relati= ve to workspace=0D @@ -204,15 +210,19 @@ class DistributionPackageClass(object): MetaDataFileList.append(Path)=0D IncludePathList =3D Package.GetIncludePathList()=0D for IncludePath in IncludePathList:=0D - SearchPath =3D os.path.normpath(os.path.join(os.path.dirna= me(FullPath), IncludePath))=0D - AddPath =3D os.path.normpath(os.path.join(PackagePath, Inc= ludePath))=0D - self.FileList +=3D GetNonMetaDataFiles(SearchPath, ['CVS',= '.svn'], False, AddPath)=0D + SearchPath =3D os.path.normpath(os.path.join(=0D + os.path.dirname(FullPath), IncludePath))=0D + AddPath =3D os.path.normpath(=0D + os.path.join(PackagePath, IncludePath))=0D + self.FileList +=3D GetNonMetaDataFiles(=0D + SearchPath, ['CVS', '.svn'], False, AddPath)=0D #=0D # Add the miscellaneous files on DEC file=0D #=0D for MiscFileObj in Package.GetMiscFileList():=0D for FileObj in MiscFileObj.GetFileList():=0D - MiscFileFullPath =3D os.path.normpath(os.path.join(Pac= kagePath, FileObj.GetURI()))=0D + MiscFileFullPath =3D os.path.normpath(=0D + os.path.join(PackagePath, FileObj.GetURI()))=0D if MiscFileFullPath not in self.FileList:=0D self.FileList.append(MiscFileFullPath)=0D =0D @@ -222,20 +232,23 @@ class DistributionPackageClass(object): Module =3D ModuleDict[Guid, Version, Name, Path]=0D ModulePath =3D Module.GetModulePath()=0D FullPath =3D Module.GetFullPath()=0D - PkgRelPath =3D os.path.normpath(os.path.join(PackagePath, = ModulePath))=0D + PkgRelPath =3D os.path.normpath(=0D + os.path.join(PackagePath, ModulePath))=0D MetaDataFileList.append(Path)=0D SkipList =3D ['CVS', '.svn']=0D NonMetaDataFileList =3D []=0D if Module.UniFileClassObject:=0D for UniFile in Module.UniFileClassObject.IncFileList:= =0D OriPath =3D os.path.normpath(os.path.dirname(FullP= ath))=0D - UniFilePath =3D os.path.normpath(os.path.join(PkgR= elPath, UniFile.Path[len(OriPath) + 1:]))=0D + UniFilePath =3D os.path.normpath(os.path.join(=0D + PkgRelPath, UniFile.Path[len(OriPath) + 1:]))= =0D if UniFilePath not in SkipModulesUniList:=0D SkipModulesUniList.append(UniFilePath)=0D for IncludeFile in Module.UniFileClassObject.IncludePa= thList:=0D if IncludeFile not in SkipModulesUniList:=0D SkipModulesUniList.append(IncludeFile)=0D - NonMetaDataFileList =3D GetNonMetaDataFiles(os.path.dirnam= e(FullPath), SkipList, False, PkgRelPath)=0D + NonMetaDataFileList =3D GetNonMetaDataFiles(=0D + os.path.dirname(FullPath), SkipList, False, PkgRelPath= )=0D for NonMetaDataFile in NonMetaDataFileList:=0D if NonMetaDataFile not in self.FileList:=0D self.FileList.append(NonMetaDataFile)=0D @@ -249,10 +262,12 @@ class DistributionPackageClass(object): if Module.UniFileClassObject:=0D for UniFile in Module.UniFileClassObject.IncFileList:=0D OriPath =3D os.path.normpath(os.path.dirname(FullPath)= )=0D - UniFilePath =3D os.path.normpath(os.path.join(ModulePa= th, UniFile.Path[len(OriPath) + 1:]))=0D + UniFilePath =3D os.path.normpath(os.path.join(=0D + ModulePath, UniFile.Path[len(OriPath) + 1:]))=0D if UniFilePath not in SkipModulesUniList:=0D SkipModulesUniList.append(UniFilePath)=0D - NonMetaDataFileList =3D GetNonMetaDataFiles(os.path.dirname(Fu= llPath), SkipList, False, ModulePath)=0D + NonMetaDataFileList =3D GetNonMetaDataFiles(=0D + os.path.dirname(FullPath), SkipList, False, ModulePath)=0D for NonMetaDataFile in NonMetaDataFileList:=0D if NonMetaDataFile not in self.FileList:=0D self.FileList.append(NonMetaDataFile)=0D @@ -261,7 +276,4 @@ class DistributionPackageClass(object): if SkipModuleUni in self.FileList:=0D self.FileList.remove(SkipModuleUni)=0D =0D - return self.FileList, MetaDataFileList=0D -=0D -=0D -=0D + return self.FileList, MetaDataFileList=0D diff --git a/BaseTools/Source/Python/UPT/Core/FileHook.py b/BaseTools/Sourc= e/Python/UPT/Core/FileHook.py index 20712065f742..0de02b6a19be 100644 --- a/BaseTools/Source/Python/UPT/Core/FileHook.py +++ b/BaseTools/Source/Python/UPT/Core/FileHook.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file hooks file and directory creation and removal=0D #=0D # Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -18,19 +18,21 @@ from time import sleep from Library import GlobalData=0D =0D __built_in_remove__ =3D os.remove=0D -__built_in_mkdir__ =3D os.mkdir=0D -__built_in_rmdir__ =3D os.rmdir=0D -__built_in_chmod__ =3D os.chmod=0D -__built_in_open__ =3D open=0D +__built_in_mkdir__ =3D os.mkdir=0D +__built_in_rmdir__ =3D os.rmdir=0D +__built_in_chmod__ =3D os.chmod=0D +__built_in_open__ =3D open=0D =0D -_RMFILE =3D 0=0D -_MKFILE =3D 1=0D -_RMDIR =3D 2=0D -_MKDIR =3D 3=0D -_CHMOD =3D 4=0D +_RMFILE =3D 0=0D +_MKFILE =3D 1=0D +_RMDIR =3D 2=0D +_MKDIR =3D 3=0D +_CHMOD =3D 4=0D =0D gBACKUPFILE =3D 'file.backup'=0D -gEXCEPTION_LIST =3D ['Conf'+os.sep+'DistributionPackageDatabase.db', '.tmp= ', gBACKUPFILE]=0D +gEXCEPTION_LIST =3D ['Conf'+os.sep +=0D + 'DistributionPackageDatabase.db', '.tmp', gBACKUPFILE]= =0D +=0D =0D class _PathInfo:=0D def __init__(self, action, path, mode=3D-1):=0D @@ -38,6 +40,7 @@ class _PathInfo: self.path =3D path=0D self.mode =3D mode=0D =0D +=0D class RecoverMgr:=0D def __init__(self, workspace):=0D self.rlist =3D []=0D @@ -101,12 +104,13 @@ class RecoverMgr: item =3D self.rlist[index]=0D exist =3D os.path.exists(item.path)=0D if item.action =3D=3D _MKFILE and exist:=0D - #if not os.access(item.path, os.W_OK):=0D + # if not os.access(item.path, os.W_OK):=0D # os.chmod(item.path, S_IWUSR)=0D __built_in_remove__(item.path)=0D elif item.action =3D=3D _RMFILE and not exist:=0D if not self.zip:=0D - self.zip =3D zipfile.ZipFile(self.zipfile, 'r', zipfil= e.ZIP_DEFLATED)=0D + self.zip =3D zipfile.ZipFile(=0D + self.zipfile, 'r', zipfile.ZIP_DEFLATED)=0D arcname =3D os.path.normpath(item.path)=0D arcname =3D arcname[len(self.workspace)+1:].encode('utf_8'= )=0D if os.sep !=3D "/" and os.sep in arcname:=0D @@ -145,7 +149,8 @@ class RecoverMgr: # Check if path needs to be hooked=0D def _tryhook(self, path):=0D path =3D os.path.normpath(path)=0D - works =3D self.workspace if str(self.workspace).endswith(os.sep) e= lse (self.workspace + os.sep)=0D + works =3D self.workspace if str(self.workspace).endswith(=0D + os.sep) else (self.workspace + os.sep)=0D if not path.startswith(works):=0D return ''=0D for exceptdir in gEXCEPTION_LIST:=0D @@ -154,40 +159,47 @@ class RecoverMgr: return ''=0D return path[len(self.workspace)+1:]=0D =0D +=0D def _hookrm(path):=0D if GlobalData.gRECOVERMGR:=0D GlobalData.gRECOVERMGR.bkrmfile(path)=0D else:=0D __built_in_remove__(path)=0D =0D +=0D def _hookmkdir(path, mode=3D0o777):=0D if GlobalData.gRECOVERMGR:=0D GlobalData.gRECOVERMGR.bkmkdir(path, mode)=0D else:=0D __built_in_mkdir__(path, mode)=0D =0D +=0D def _hookrmdir(path):=0D if GlobalData.gRECOVERMGR:=0D GlobalData.gRECOVERMGR.bkrmdir(path)=0D else:=0D __built_in_rmdir__(path)=0D =0D +=0D def _hookmkfile(path, mode=3D'r', bufsize=3D-1):=0D if GlobalData.gRECOVERMGR:=0D return GlobalData.gRECOVERMGR.bkmkfile(path, mode, bufsize)=0D return __built_in_open__(path, mode, bufsize)=0D =0D +=0D def _hookchmod(path, mode):=0D if GlobalData.gRECOVERMGR:=0D GlobalData.gRECOVERMGR.bkchmod(path, mode)=0D else:=0D __built_in_chmod__(path, mode)=0D =0D +=0D def SetRecoverMgr(mgr):=0D GlobalData.gRECOVERMGR =3D mgr=0D =0D -os.remove =3D _hookrm=0D -os.mkdir =3D _hookmkdir=0D -os.rmdir =3D _hookrmdir=0D -os.chmod =3D _hookchmod=0D -__FileHookOpen__ =3D _hookmkfile=0D +=0D +os.remove =3D _hookrm=0D +os.mkdir =3D _hookmkdir=0D +os.rmdir =3D _hookrmdir=0D +os.chmod =3D _hookchmod=0D +__FileHookOpen__ =3D _hookmkfile=0D diff --git a/BaseTools/Source/Python/UPT/Core/IpiDb.py b/BaseTools/Source/P= ython/UPT/Core/IpiDb.py index 69895e11cd04..feb81e49aad6 100644 --- a/BaseTools/Source/Python/UPT/Core/IpiDb.py +++ b/BaseTools/Source/Python/UPT/Core/IpiDb.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is for installed package information database operations=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,7 +23,7 @@ from Logger.ToolError import UPT_ALREADY_RUNNING_ERROR from Logger.ToolError import UPT_DB_UPDATE_ERROR=0D import platform as pf=0D =0D -## IpiDb=0D +# IpiDb=0D #=0D # This class represents the installed package information database=0D # Add/Remove/Get installed distribution package information here.=0D @@ -33,12 +33,15 @@ import platform as pf # @param DbPath: A string for the path of the database=0D #=0D #=0D +=0D +=0D class IpiDatabase(object):=0D def __init__(self, DbPath, Workspace):=0D Dir =3D os.path.dirname(DbPath)=0D if not os.path.isdir(Dir):=0D os.mkdir(Dir)=0D - self.Conn =3D sqlite3.connect(u''.join(DbPath), isolation_level=3D= 'DEFERRED')=0D + self.Conn =3D sqlite3.connect(=0D + u''.join(DbPath), isolation_level=3D'DEFERRED')=0D self.Conn.execute("PRAGMA page_size=3D4096")=0D self.Conn.execute("PRAGMA synchronous=3DOFF")=0D self.Cur =3D self.Conn.cursor()=0D @@ -51,10 +54,10 @@ class IpiDatabase(object): self.DummyTable =3D 'Dummy'=0D self.Workspace =3D os.path.normpath(Workspace)=0D =0D - ## Initialize build database=0D + # Initialize build database=0D #=0D #=0D - def InitDatabase(self, SkipLock =3D False):=0D + def InitDatabase(self, SkipLock=3DFalse):=0D Logger.Verbose(ST.MSG_INIT_IPI_START)=0D if not SkipLock:=0D try:=0D @@ -158,7 +161,7 @@ class IpiDatabase(object): def Commit(self):=0D self.Conn.commit()=0D =0D - ## Add a distribution install information from DpObj=0D + # Add a distribution install information from DpObj=0D #=0D # @param DpObj:=0D # @param NewDpPkgFileName: New DpPkg File Name=0D @@ -171,7 +174,7 @@ class IpiDatabase(object): PkgGuid =3D PkgKey[0]=0D PkgVersion =3D PkgKey[1]=0D PkgInstallPath =3D PkgKey[2]=0D - self._AddPackage(PkgGuid, PkgVersion, DpObj.Header.GetGuid= (), \=0D + self._AddPackage(PkgGuid, PkgVersion, DpObj.Header.GetGuid= (),=0D DpObj.Header.GetVersion(), PkgInstallPath= )=0D PkgObj =3D DpObj.PackageSurfaceArea[PkgKey]=0D for ModKey in PkgObj.GetModuleDict().keys():=0D @@ -180,18 +183,19 @@ class IpiDatabase(object): ModName =3D ModKey[2]=0D ModInstallPath =3D ModKey[3]=0D ModInstallPath =3D \=0D - os.path.normpath(os.path.join(PkgInstallPath, ModInsta= llPath))=0D - self._AddModuleInPackage(ModGuid, ModVersion, ModName,= PkgGuid, \=0D + os.path.normpath(os.path.join(=0D + PkgInstallPath, ModInstallPath))=0D + self._AddModuleInPackage(ModGuid, ModVersion, ModName,= PkgGuid,=0D PkgVersion, ModInstallPath)=0D ModObj =3D PkgObj.GetModuleDict()[ModKey]=0D for Dep in ModObj.GetPackageDependencyList():=0D DepexGuid =3D Dep.GetGuid()=0D DepexVersion =3D Dep.GetVersion()=0D - self._AddModuleDepex(ModGuid, ModVersion, ModName,= ModInstallPath, \=0D + self._AddModuleDepex(ModGuid, ModVersion, ModName,= ModInstallPath,=0D DepexGuid, DepexVersion)=0D for (FilePath, Md5Sum) in PkgObj.FileList:=0D - self._AddDpFilePathList(DpObj.Header.GetGuid(), \=0D - DpObj.Header.GetVersion(), Fil= ePath, \=0D + self._AddDpFilePathList(DpObj.Header.GetGuid(),=0D + DpObj.Header.GetVersion(), Fil= ePath,=0D Md5Sum)=0D =0D for ModKey in DpObj.ModuleSurfaceArea.keys():=0D @@ -199,46 +203,46 @@ class IpiDatabase(object): ModVersion =3D ModKey[1]=0D ModName =3D ModKey[2]=0D ModInstallPath =3D ModKey[3]=0D - self._AddStandaloneModule(ModGuid, ModVersion, ModName, \= =0D - DpObj.Header.GetGuid(), \=0D - DpObj.Header.GetVersion(), \=0D + self._AddStandaloneModule(ModGuid, ModVersion, ModName,=0D + DpObj.Header.GetGuid(),=0D + DpObj.Header.GetVersion(),=0D ModInstallPath)=0D ModObj =3D DpObj.ModuleSurfaceArea[ModKey]=0D for Dep in ModObj.GetPackageDependencyList():=0D DepexGuid =3D Dep.GetGuid()=0D DepexVersion =3D Dep.GetVersion()=0D - self._AddModuleDepex(ModGuid, ModVersion, ModName, Mod= InstallPath, \=0D + self._AddModuleDepex(ModGuid, ModVersion, ModName, Mod= InstallPath,=0D DepexGuid, DepexVersion)=0D for (Path, Md5Sum) in ModObj.FileList:=0D - self._AddDpFilePathList(DpObj.Header.GetGuid(), \=0D - DpObj.Header.GetVersion(), \=0D + self._AddDpFilePathList(DpObj.Header.GetGuid(),=0D + DpObj.Header.GetVersion(),=0D Path, Md5Sum)=0D =0D #=0D # add tool/misc files=0D #=0D for (Path, Md5Sum) in DpObj.FileList:=0D - self._AddDpFilePathList(DpObj.Header.GetGuid(), \=0D + self._AddDpFilePathList(DpObj.Header.GetGuid(),=0D DpObj.Header.GetVersion(), Path, M= d5Sum)=0D =0D - self._AddDp(DpObj.Header.GetGuid(), DpObj.Header.GetVersion(),= \=0D + self._AddDp(DpObj.Header.GetGuid(), DpObj.Header.GetVersion(),= =0D NewDpPkgFileName, DpPkgFileName, RePackage)=0D =0D except sqlite3.IntegrityError as DetailMsg:=0D Logger.Error("UPT",=0D UPT_DB_UPDATE_ERROR,=0D ST.ERR_UPT_DB_UPDATE_ERROR,=0D - ExtraData =3D DetailMsg=0D + ExtraData=3DDetailMsg=0D )=0D =0D - ## Add a distribution install information=0D + # Add a distribution install information=0D #=0D # @param Guid Guid of the distribution package=0D # @param Version Version of the distribution package=0D # @param NewDpFileName the saved filename of distribution package file= =0D # @param DistributionFileName the filename of distribution package fil= e=0D #=0D - def _AddDp(self, Guid, Version, NewDpFileName, DistributionFileName, \= =0D + def _AddDp(self, Guid, Version, NewDpFileName, DistributionFileName,=0D RePackage):=0D =0D if Version is None or len(Version.strip()) =3D=3D 0:=0D @@ -253,19 +257,19 @@ class IpiDatabase(object): PkgFileName =3D NewDpFileName=0D CurrentTime =3D time.time()=0D SqlCommand =3D \=0D - """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \= =0D - (self.DpTable, Guid, Version, CurrentTime, PkgFileName, \=0D - DistributionFileName, str(RePackage).upper())=0D + """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" = % \=0D + (self.DpTable, Guid, Version, CurrentTime, PkgFileName,=0D + DistributionFileName, str(RePackage).upper())=0D self.Cur.execute(SqlCommand)=0D =0D -=0D - ## Add a file list from DP=0D + # Add a file list from DP=0D #=0D # @param DpGuid: A DpGuid=0D # @param DpVersion: A DpVersion=0D # @param Path: A Path=0D # @param Path: A Md5Sum=0D #=0D +=0D def _AddDpFilePathList(self, DpGuid, DpVersion, Path, Md5Sum):=0D Path =3D os.path.normpath(Path)=0D if pf.system() =3D=3D 'Windows':=0D @@ -275,11 +279,11 @@ class IpiDatabase(object): if Path.startswith(self.Workspace + os.sep):=0D Path =3D Path[len(self.Workspace)+1:]=0D SqlCommand =3D """insert into %s values('%s', '%s', '%s', '%s')"""= % \=0D - (self.DpFileListTable, Path, DpGuid, DpVersion, Md5Sum)=0D + (self.DpFileListTable, Path, DpGuid, DpVersion, Md5Sum)=0D =0D self.Cur.execute(SqlCommand)=0D =0D - ## Add a package install information=0D + # Add a package install information=0D #=0D # @param Guid: A package guid=0D # @param Version: A package version=0D @@ -303,11 +307,11 @@ class IpiDatabase(object): #=0D CurrentTime =3D time.time()=0D SqlCommand =3D \=0D - """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" % \= =0D - (self.PkgTable, Guid, Version, CurrentTime, DpGuid, DpVersion, Pat= h)=0D + """insert into %s values('%s', '%s', %s, '%s', '%s', '%s')""" = % \=0D + (self.PkgTable, Guid, Version, CurrentTime, DpGuid, DpVersion,= Path)=0D self.Cur.execute(SqlCommand)=0D =0D - ## Add a module that from a package install information=0D + # Add a module that from a package install information=0D #=0D # @param Guid: Module Guid=0D # @param Version: Module version=0D @@ -316,7 +320,7 @@ class IpiDatabase(object): # @param PkgVersion: Package version=0D # @param Path: Package relative path that module installs=0D #=0D - def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=3DNone, \=0D + def _AddModuleInPackage(self, Guid, Version, Name, PkgGuid=3DNone,=0D PkgVersion=3DNone, Path=3D''):=0D =0D if Version is None or len(Version.strip()) =3D=3D 0:=0D @@ -338,12 +342,12 @@ class IpiDatabase(object): #=0D CurrentTime =3D time.time()=0D SqlCommand =3D \=0D - """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""= " % \=0D - (self.ModInPkgTable, Guid, Version, Name, CurrentTime, PkgGuid, Pk= gVersion, \=0D - Path)=0D + """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s= ')""" % \=0D + (self.ModInPkgTable, Guid, Version, Name, CurrentTime, PkgGuid= , PkgVersion,=0D + Path)=0D self.Cur.execute(SqlCommand)=0D =0D - ## Add a module that is standalone install information=0D + # Add a module that is standalone install information=0D #=0D # @param Guid: a module Guid=0D # @param Version: a module Version=0D @@ -352,7 +356,7 @@ class IpiDatabase(object): # @param DpVersion: a DpVersion=0D # @param Path: path=0D #=0D - def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=3DNone, \=0D + def _AddStandaloneModule(self, Guid, Version, Name, DpGuid=3DNone,=0D DpVersion=3DNone, Path=3D''):=0D =0D if Version is None or len(Version.strip()) =3D=3D 0:=0D @@ -369,12 +373,12 @@ class IpiDatabase(object): #=0D CurrentTime =3D time.time()=0D SqlCommand =3D \=0D - """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s')""= " % \=0D - (self.StandaloneModTable, Guid, Version, Name, CurrentTime, DpGuid= , \=0D - DpVersion, Path)=0D + """insert into %s values('%s', '%s', '%s', %s, '%s', '%s', '%s= ')""" % \=0D + (self.StandaloneModTable, Guid, Version, Name, CurrentTime, Dp= Guid,=0D + DpVersion, Path)=0D self.Cur.execute(SqlCommand)=0D =0D - ## Add a module depex=0D + # Add a module depex=0D #=0D # @param Guid: a module Guid=0D # @param Version: a module Version=0D @@ -382,7 +386,7 @@ class IpiDatabase(object): # @param DepexGuid: a module DepexGuid=0D # @param DepexVersion: a module DepexVersion=0D #=0D - def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=3DNone,= \=0D + def _AddModuleDepex(self, Guid, Version, Name, Path, DepexGuid=3DNone,= =0D DepexVersion=3DNone):=0D =0D if DepexGuid is None or len(DepexGuid.strip()) =3D=3D 0:=0D @@ -400,10 +404,10 @@ class IpiDatabase(object): # Add module depex information to DB.=0D #=0D SqlCommand =3D """insert into %s values('%s', '%s', '%s', '%s', '%= s', '%s')"""\=0D - % (self.ModDepexTable, Guid, Version, Name, Path, DepexGuid, Depe= xVersion)=0D + % (self.ModDepexTable, Guid, Version, Name, Path, DepexGuid, D= epexVersion)=0D self.Cur.execute(SqlCommand)=0D =0D - ## Remove a distribution install information, if no version specified,= =0D + # Remove a distribution install information, if no version specified,= =0D # remove all DPs with this Guid.=0D #=0D # @param DpGuid: guid of dpex=0D @@ -416,7 +420,7 @@ class IpiDatabase(object): # delete from ModDepex the standalone module's dependency=0D #=0D SqlCommand =3D \=0D - """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in=0D + """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in=0D (select ModuleGuid from StandaloneModInfo as B where B.DpGuid =3D = '%s'=0D and B.DpVersion =3D '%s')=0D and ModDepexInfo.ModuleVersion in=0D @@ -428,7 +432,8 @@ class IpiDatabase(object): and ModDepexInfo.InstallPath in=0D (select InstallPath from StandaloneModInfo as B=0D where B.DpGuid =3D '%s' and B.DpVersion =3D '%s') """ % \=0D - (DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, DpVersion, DpGuid, = DpVersion)=0D + (DpGuid, DpVersion, DpGuid, DpVersion,=0D + DpGuid, DpVersion, DpGuid, DpVersion)=0D =0D self.Cur.execute(SqlCommand)=0D #=0D @@ -437,7 +442,7 @@ class IpiDatabase(object): for Pkg in PkgList:=0D =0D SqlCommand =3D \=0D - """delete from ModDepexInfo where ModDepexInfo.ModuleGuid in=0D + """delete from ModDepexInfo where ModDepexInfo.ModuleGuid = in=0D (select ModuleGuid from ModInPkgInfo=0D where ModInPkgInfo.PackageGuid =3D'%s' and=0D ModInPkgInfo.PackageVersion =3D '%s')=0D @@ -460,44 +465,44 @@ class IpiDatabase(object): # delete the standalone module=0D #=0D SqlCommand =3D \=0D - """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'""" %= \=0D - (self.StandaloneModTable, DpGuid, DpVersion)=0D + """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'"= "" % \=0D + (self.StandaloneModTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D #=0D # delete the from pkg module=0D #=0D for Pkg in PkgList:=0D SqlCommand =3D \=0D - """delete from %s where %s.PackageGuid =3D'%s'=0D + """delete from %s where %s.PackageGuid =3D'%s'=0D and %s.PackageVersion =3D '%s'""" % \=0D - (self.ModInPkgTable, self.ModInPkgTable, Pkg[0], \=0D - self.ModInPkgTable, Pkg[1])=0D + (self.ModInPkgTable, self.ModInPkgTable, Pkg[0],=0D + self.ModInPkgTable, Pkg[1])=0D self.Cur.execute(SqlCommand)=0D #=0D # delete packages=0D #=0D SqlCommand =3D \=0D - """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'""" %= \=0D - (self.PkgTable, DpGuid, DpVersion)=0D + """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'"= "" % \=0D + (self.PkgTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D #=0D # delete file list from DP=0D #=0D SqlCommand =3D \=0D - """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'""" %= \=0D - (self.DpFileListTable, DpGuid, DpVersion)=0D + """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'"= "" % \=0D + (self.DpFileListTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D #=0D # delete DP=0D #=0D SqlCommand =3D \=0D - """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'""" %= \=0D - (self.DpTable, DpGuid, DpVersion)=0D + """delete from %s where DpGuid =3D'%s' and DpVersion =3D '%s'"= "" % \=0D + (self.DpTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D =0D - #self.Conn.commit()=0D + # self.Conn.commit()=0D =0D - ## Get a list of distribution install information.=0D + # Get a list of distribution install information.=0D #=0D # @param Guid: distribution package guid=0D # @param Version: distribution package version=0D @@ -509,15 +514,15 @@ class IpiDatabase(object): Logger.Verbose(ST.MSG_GET_DP_INSTALL_LIST)=0D (DpGuid, DpVersion) =3D (Guid, Version)=0D SqlCommand =3D """select * from %s where DpGuid =3D'%s'""" % \= =0D - (self.DpTable, DpGuid)=0D + (self.DpTable, DpGuid)=0D self.Cur.execute(SqlCommand)=0D =0D else:=0D Logger.Verbose(ST.MSG_GET_DP_INSTALL_INFO_START)=0D (DpGuid, DpVersion) =3D (Guid, Version)=0D SqlCommand =3D \=0D - """select * from %s where DpGuid =3D'%s' and DpVersion =3D '%s= '""" % \=0D - (self.DpTable, DpGuid, DpVersion)=0D + """select * from %s where DpGuid =3D'%s' and DpVersion =3D= '%s'""" % \=0D + (self.DpTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D =0D DpList =3D []=0D @@ -531,13 +536,14 @@ class IpiDatabase(object): Logger.Verbose(ST.MSG_GET_DP_INSTALL_INFO_FINISH)=0D return DpList=0D =0D - ## Get a list of distribution install dirs=0D + # Get a list of distribution install dirs=0D #=0D # @param Guid: distribution package guid=0D # @param Version: distribution package version=0D #=0D def GetDpInstallDirList(self, Guid, Version):=0D - SqlCommand =3D """select InstallPath from PkgInfo where DpGuid =3D= '%s' and DpVersion =3D '%s'""" % (Guid, Version)=0D + SqlCommand =3D """select InstallPath from PkgInfo where DpGuid =3D= '%s' and DpVersion =3D '%s'""" % (=0D + Guid, Version)=0D self.Cur.execute(SqlCommand)=0D DirList =3D []=0D for Result in self.Cur:=0D @@ -553,18 +559,18 @@ class IpiDatabase(object): =0D return DirList=0D =0D -=0D - ## Get a list of distribution install file path information.=0D + # Get a list of distribution install file path information.=0D #=0D # @param Guid: distribution package guid=0D # @param Version: distribution package version=0D #=0D +=0D def GetDpFileList(self, Guid, Version):=0D =0D (DpGuid, DpVersion) =3D (Guid, Version)=0D SqlCommand =3D \=0D - """select * from %s where DpGuid =3D'%s' and DpVersion =3D '%s'"""= % \=0D - (self.DpFileListTable, DpGuid, DpVersion)=0D + """select * from %s where DpGuid =3D'%s' and DpVersion =3D '%s= '""" % \=0D + (self.DpFileListTable, DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D =0D PathList =3D []=0D @@ -575,7 +581,7 @@ class IpiDatabase(object): =0D return PathList=0D =0D - ## Get files' repackage attribute if present that are installed into c= urrent workspace=0D + # Get files' repackage attribute if present that are installed into cu= rrent workspace=0D #=0D # @retval FileDict: a Dict of file, key is file path, value is (DpGui= d, DpVersion, NewDpFileName, RePackage)=0D #=0D @@ -603,13 +609,13 @@ class IpiDatabase(object): =0D return FileDict=0D =0D - ## Get (Guid, Version) from distribution file name information.=0D + # Get (Guid, Version) from distribution file name information.=0D #=0D # @param DistributionFile: Distribution File=0D #=0D def GetDpByName(self, DistributionFile):=0D SqlCommand =3D """select * from %s where NewPkgFileName =3D '%s'""= " % \=0D - (self.DpTable, DistributionFile)=0D + (self.DpTable, DistributionFile)=0D self.Cur.execute(SqlCommand)=0D =0D for Result in self.Cur:=0D @@ -621,7 +627,7 @@ class IpiDatabase(object): else:=0D return (None, None, None)=0D =0D - ## Get a list of package information.=0D + # Get a list of package information.=0D #=0D # @param Guid: package guid=0D # @param Version: package version=0D @@ -632,22 +638,22 @@ class IpiDatabase(object): =0D (PackageGuid, PackageVersion) =3D (Guid, Version)=0D SqlCommand =3D """select * from %s where PackageGuid =3D'%s'=0D - and PackageVersion =3D '%s'""" % (self.PkgTable, PackageGuid, = \=0D + and PackageVersion =3D '%s'""" % (self.PkgTable, PackageGuid,= =0D PackageVersion)=0D self.Cur.execute(SqlCommand)=0D =0D elif Version is None or len(Version.strip()) =3D=3D 0:=0D =0D SqlCommand =3D """select * from %s where PackageGuid =3D'%s'""= " % \=0D - (self.PkgTable, Guid)=0D + (self.PkgTable, Guid)=0D self.Cur.execute(SqlCommand)=0D else:=0D (PackageGuid, PackageVersion) =3D (Guid, Version)=0D SqlCommand =3D """select * from %s where PackageGuid =3D'%s' a= nd=0D PackageVersion =3D '%s'=0D and DpGuid =3D '%s' and DpVersion =3D '%s'""" = % \=0D - (self.PkgTable, PackageGuid, PackageVersion, \= =0D - DpGuid, DpVersion)=0D + (self.PkgTable, PackageGuid, PackageVersion,=0D + DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D =0D PkgList =3D []=0D @@ -656,31 +662,32 @@ class IpiDatabase(object): PkgVersion =3D PkgInfo[1]=0D InstallTime =3D PkgInfo[2]=0D InstallPath =3D PkgInfo[5]=0D - PkgList.append((PkgGuid, PkgVersion, InstallTime, DpGuid, \=0D + PkgList.append((PkgGuid, PkgVersion, InstallTime, DpGuid,=0D DpVersion, InstallPath))=0D =0D return PkgList=0D =0D -=0D - ## Get a list of module in package information.=0D + # Get a list of module in package information.=0D #=0D # @param Guid: A module guid=0D # @param Version: A module version=0D #=0D +=0D def GetModInPackage(self, Guid, Version, Name, Path, PkgGuid=3D'', Pkg= Version=3D''):=0D - (ModuleGuid, ModuleVersion, ModuleName, InstallPath) =3D (Guid, Ve= rsion, Name, Path)=0D + (ModuleGuid, ModuleVersion, ModuleName,=0D + InstallPath) =3D (Guid, Version, Name, Path)=0D if PkgVersion =3D=3D '' or PkgGuid =3D=3D '':=0D SqlCommand =3D """select * from %s where ModuleGuid =3D'%s' an= d=0D ModuleVersion =3D '%s' and InstallPath =3D '%s'=0D - and ModuleName =3D '%s'""" % (self.ModInPkgTable, ModuleGuid, = \=0D - ModuleVersion, InstallPath, ModuleN= ame)=0D + and ModuleName =3D '%s'""" % (self.ModInPkgTable, ModuleGuid,= =0D + ModuleVersion, InstallPath, Module= Name)=0D self.Cur.execute(SqlCommand)=0D else:=0D SqlCommand =3D """select * from %s where ModuleGuid =3D'%s' an= d=0D ModuleVersion =3D '%s' and InstallPath =3D '%s'=0D and ModuleName =3D '%s' and PackageGuid =3D'%s'=0D and PackageVersion =3D '%s'=0D - """ % (self.ModInPkgTable, ModuleGuid, \=0D + """ % (self.ModInPkgTable, ModuleGuid,=0D ModuleVersion, InstallPath, ModuleName,= PkgGuid, PkgVersion)=0D self.Cur.execute(SqlCommand)=0D =0D @@ -690,29 +697,30 @@ class IpiDatabase(object): ModVersion =3D ModInfo[1]=0D InstallTime =3D ModInfo[2]=0D InstallPath =3D ModInfo[5]=0D - ModList.append((ModGuid, ModVersion, InstallTime, PkgGuid, \=0D + ModList.append((ModGuid, ModVersion, InstallTime, PkgGuid,=0D PkgVersion, InstallPath))=0D =0D return ModList=0D =0D - ## Get a list of module standalone.=0D + # Get a list of module standalone.=0D #=0D # @param Guid: A module guid=0D # @param Version: A module version=0D #=0D def GetStandaloneModule(self, Guid, Version, Name, Path, DpGuid=3D'', = DpVersion=3D''):=0D - (ModuleGuid, ModuleVersion, ModuleName, InstallPath) =3D (Guid, Ve= rsion, Name, Path)=0D + (ModuleGuid, ModuleVersion, ModuleName,=0D + InstallPath) =3D (Guid, Version, Name, Path)=0D if DpGuid =3D=3D '':=0D SqlCommand =3D """select * from %s where ModuleGuid =3D'%s' an= d=0D ModuleVersion =3D '%s' and InstallPath =3D '%s'=0D - and ModuleName =3D '%s'""" % (self.StandaloneModTable, ModuleG= uid, \=0D - ModuleVersion, InstallPath, ModuleN= ame)=0D + and ModuleName =3D '%s'""" % (self.StandaloneModTable, ModuleG= uid,=0D + ModuleVersion, InstallPath, Module= Name)=0D self.Cur.execute(SqlCommand)=0D =0D else:=0D SqlCommand =3D """select * from %s where ModuleGuid =3D'%s' an= d=0D ModuleVersion =3D '%s' and InstallPath =3D '%s' and ModuleName= =3D '%s' and DpGuid =3D'%s' and DpVersion =3D '%s'=0D - """ % (self.StandaloneModTable, ModuleGuid, \= =0D + """ % (self.StandaloneModTable, ModuleGuid,=0D ModuleVersion, ModuleName, InstallPath,= DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D =0D @@ -722,12 +730,12 @@ class IpiDatabase(object): ModVersion =3D ModInfo[1]=0D InstallTime =3D ModInfo[2]=0D InstallPath =3D ModInfo[5]=0D - ModList.append((ModGuid, ModVersion, InstallTime, DpGuid, \=0D + ModList.append((ModGuid, ModVersion, InstallTime, DpGuid,=0D DpVersion, InstallPath))=0D =0D return ModList=0D =0D - ## Get a list of module information that comes from DP.=0D + # Get a list of module information that comes from DP.=0D #=0D # @param DpGuid: A Distribution Guid=0D # @param DpVersion: A Distribution version=0D @@ -746,7 +754,7 @@ class IpiDatabase(object): =0D return PathList=0D =0D - ## Get a list of package information.=0D + # Get a list of package information.=0D #=0D # @param DpGuid: A Distribution Guid=0D # @param DpVersion: A Distribution version=0D @@ -766,7 +774,7 @@ class IpiDatabase(object): =0D return PkgList=0D =0D - ## Get a list of modules that depends on package information from a DP= .=0D + # Get a list of modules that depends on package information from a DP.= =0D #=0D # @param DpGuid: A Distribution Guid=0D # @param DpVersion: A Distribution version=0D @@ -790,8 +798,8 @@ class IpiDatabase(object): t1.ModuleVersion =3D t2.ModuleVersion and t2.DepexGuid =3D'%s'= =0D and (t2.DepexVersion =3D '%s' or t2.DepexVersion =3D 'N/A') an= d=0D t1.PackageGuid !=3D '%s' and t1.PackageVersion !=3D '%s'=0D - """ % (self.ModInPkgTable, \=0D - self.ModDepexTable, Pkg[0], Pkg[1], Pkg[0],= \=0D + """ % (self.ModInPkgTable,=0D + self.ModDepexTable, Pkg[0], Pkg[1], Pkg[0],= =0D Pkg[1])=0D self.Cur.execute(SqlCommand)=0D for ModInfo in self.Cur:=0D @@ -802,17 +810,17 @@ class IpiDatabase(object): =0D #=0D # get all modules from standalone modules that depends on curr= ent=0D - #Pkg (Guid match, Version match or NA) but not in current dp=0D + # Pkg (Guid match, Version match or NA) but not in current dp= =0D #=0D SqlCommand =3D \=0D - """select t1.ModuleGuid, t1.ModuleVersion, t1.InstallPath=0D + """select t1.ModuleGuid, t1.ModuleVersion, t1.InstallPath= =0D from %s as t1, %s as t2 where t1.ModuleGuid =3D t2.ModuleGuid = and=0D t1.ModuleVersion =3D t2.ModuleVersion and t2.DepexGuid =3D'%s'= =0D and (t2.DepexVersion =3D '%s' or t2.DepexVersion =3D 'N/A') an= d=0D t1.DpGuid !=3D '%s' and t1.DpVersion !=3D '%s'= =0D """ % \=0D - (self.StandaloneModTable, self.ModDepexTable, Pkg[= 0], \=0D - Pkg[1], DpGuid, DpVersion)=0D + (self.StandaloneModTable, self.ModDepexTable, Pkg[0],=0D + Pkg[1], DpGuid, DpVersion)=0D self.Cur.execute(SqlCommand)=0D for ModInfo in self.Cur:=0D ModGuid =3D ModInfo[0]=0D @@ -820,10 +828,9 @@ class IpiDatabase(object): InstallPath =3D ModInfo[2]=0D ModList.append((ModGuid, ModVersion, InstallPath))=0D =0D -=0D return ModList=0D =0D - ## Get Dp's list of modules.=0D + # Get Dp's list of modules.=0D #=0D # @param DpGuid: A Distribution Guid=0D # @param DpVersion: A Distribution version=0D @@ -845,13 +852,13 @@ class IpiDatabase(object): =0D return ModList=0D =0D -=0D - ## Get a module depex=0D + # Get a module depex=0D #=0D # @param DpGuid: A module Guid=0D # @param DpVersion: A module version=0D # @param Path:=0D #=0D +=0D def GetModuleDepex(self, Guid, Version, Path):=0D =0D #=0D @@ -862,7 +869,6 @@ class IpiDatabase(object): """ % (self.ModDepexTable, Guid, Version, Path= )=0D self.Cur.execute(SqlCommand)=0D =0D -=0D DepexList =3D []=0D for DepInfo in self.Cur:=0D DepexGuid =3D DepInfo[3]=0D @@ -871,7 +877,7 @@ class IpiDatabase(object): =0D return DepexList=0D =0D - ## Inventory the distribution installed to current workspace=0D + # Inventory the distribution installed to current workspace=0D #=0D # Inventory the distribution installed to current workspace=0D #=0D @@ -889,7 +895,7 @@ class IpiDatabase(object): =0D return DpInfoList=0D =0D - ## Close entire database=0D + # Close entire database=0D #=0D # Close the connection and cursor=0D #=0D @@ -906,7 +912,7 @@ class IpiDatabase(object): self.Cur.close()=0D self.Conn.close()=0D =0D - ## Convert To Sql String=0D + # Convert To Sql String=0D #=0D # 1. Replace "'" with "''" in each item of StringList=0D #=0D @@ -916,7 +922,3 @@ class IpiDatabase(object): if self.DpTable:=0D pass=0D return list(map(lambda s: s.replace("'", "''"), StringList))=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Core/PackageFile.py b/BaseTools/So= urce/Python/UPT/Core/PackageFile.py index c9157e84d6ff..79b287cdb093 100644 --- a/BaseTools/Source/Python/UPT/Core/PackageFile.py +++ b/BaseTools/Source/Python/UPT/Core/PackageFile.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # PackageFile class represents the zip file of a distribution package.=0D #=0D @@ -40,29 +40,29 @@ class PackageFile: if Mode not in ["r", "w", "a"]:=0D Mode =3D "r"=0D try:=0D - self._ZipFile =3D zipfile.ZipFile(FileName, Mode, \=0D + self._ZipFile =3D zipfile.ZipFile(FileName, Mode,=0D zipfile.ZIP_DEFLATED)=0D self._Files =3D {}=0D for Filename in self._ZipFile.namelist():=0D self._Files[os.path.normpath(Filename)] =3D Filename=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_OPEN_FAILURE,=0D - ExtraData=3D"%s (%s)" % (FileName, str(Xstr)))= =0D + ExtraData=3D"%s (%s)" % (FileName, str(Xstr)))=0D =0D BadFile =3D self._ZipFile.testzip()=0D if BadFile is not None:=0D Logger.Error("PackagingTool", FILE_CHECKSUM_FAILURE,=0D - ExtraData=3D"[%s] in %s" % (BadFile, FileName)= )=0D + ExtraData=3D"[%s] in %s" % (BadFile, FileName))=0D =0D def GetZipFile(self):=0D return self._ZipFile=0D =0D - ## Get file name=0D + # Get file name=0D #=0D def __str__(self):=0D return self._FileName=0D =0D - ## Extract the file=0D + # Extract the file=0D #=0D # @param To: the destination file=0D #=0D @@ -73,7 +73,7 @@ class PackageFile: Logger.Info(Msg)=0D self.Extract(FileN, ToFile)=0D =0D - ## Extract the file=0D + # Extract the file=0D #=0D # @param File: the extracted file=0D # @param ToFile: the destination file=0D @@ -88,7 +88,7 @@ class PackageFile: =0D return ''=0D =0D - ## Extract the file=0D + # Extract the file=0D #=0D # @param Which: the source path=0D # @param ToDest: the destination path=0D @@ -97,34 +97,34 @@ class PackageFile: Which =3D os.path.normpath(Which)=0D if Which not in self._Files:=0D Logger.Error("PackagingTool", FILE_NOT_FOUND,=0D - ExtraData=3D"[%s] in %s" % (Which, self._FileN= ame))=0D + ExtraData=3D"[%s] in %s" % (Which, self._FileName= ))=0D try:=0D FileContent =3D self._ZipFile.read(self._Files[Which])=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_DECOMPRESS_FAILURE,=0D - ExtraData=3D"[%s] in %s (%s)" % (Which, \=0D - self._FileName,= \=0D - str(Xstr)))=0D + ExtraData=3D"[%s] in %s (%s)" % (Which,=0D + self._FileName,=0D + str(Xstr)))=0D try:=0D CreateDirectory(os.path.dirname(ToDest))=0D if os.path.exists(ToDest) and not os.access(ToDest, os.W_OK):= =0D - Logger.Warn("PackagingTool", \=0D + Logger.Warn("PackagingTool",=0D ST.WRN_FILE_NOT_OVERWRITTEN % ToDest)=0D return=0D else:=0D ToFile =3D __FileHookOpen__(ToDest, 'wb')=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_OPEN_FAILURE,=0D - ExtraData=3D"%s (%s)" % (ToDest, str(Xstr)))=0D + ExtraData=3D"%s (%s)" % (ToDest, str(Xstr)))=0D =0D try:=0D ToFile.write(FileContent)=0D ToFile.close()=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_WRITE_FAILURE,=0D - ExtraData=3D"%s (%s)" % (ToDest, str(Xstr)))=0D + ExtraData=3D"%s (%s)" % (ToDest, str(Xstr)))=0D =0D - ## Remove the file=0D + # Remove the file=0D #=0D # @param Files: the removed files=0D #=0D @@ -139,12 +139,12 @@ class PackageFile: SinF =3D os.path.normpath(SinF)=0D if SinF not in self._Files:=0D Logger.Error("PackagingTool", FILE_NOT_FOUND,=0D - ExtraData=3D"%s is not in %s!" % \=0D - (SinF, self._FileName))=0D + ExtraData=3D"%s is not in %s!" %=0D + (SinF, self._FileName))=0D self._Files.pop(SinF)=0D self._ZipFile.close()=0D =0D - self._ZipFile =3D zipfile.ZipFile(self._FileName, "w", \=0D + self._ZipFile =3D zipfile.ZipFile(self._FileName, "w",=0D zipfile.ZIP_DEFLATED)=0D Cwd =3D os.getcwd()=0D os.chdir(TmpDir)=0D @@ -152,7 +152,7 @@ class PackageFile: os.chdir(Cwd)=0D RemoveDirectory(TmpDir, True)=0D =0D - ## Pack the files under Top directory, the directory shown in the zipF= ile start from BaseDir,=0D + # Pack the files under Top directory, the directory shown in the zipFi= le start from BaseDir,=0D # BaseDir should be the parent directory of the Top directory, for exa= mple,=0D # Pack(Workspace\Dir1, Workspace) will pack files under Dir1, and the = path in the zipfile will=0D # start from Workspace=0D @@ -162,13 +162,13 @@ class PackageFile: #=0D def Pack(self, Top, BaseDir):=0D if not os.path.isdir(Top):=0D - Logger.Error("PackagingTool", FILE_UNKNOWN_ERROR, \=0D - "%s is not a directory!" %Top)=0D + Logger.Error("PackagingTool", FILE_UNKNOWN_ERROR,=0D + "%s is not a directory!" % Top)=0D =0D FilesToPack =3D []=0D Cwd =3D os.getcwd()=0D os.chdir(BaseDir)=0D - RelaDir =3D Top[Top.upper().find(BaseDir.upper()).\=0D + RelaDir =3D Top[Top.upper().find(BaseDir.upper()).=0D join(len(BaseDir).join(1)):]=0D =0D for Root, Dirs, Files in os.walk(RelaDir):=0D @@ -193,7 +193,7 @@ class PackageFile: self.PackFiles(FilesToPack)=0D os.chdir(Cwd)=0D =0D - ## Pack the file=0D + # Pack the file=0D #=0D # @param Files: the files to pack=0D #=0D @@ -204,7 +204,7 @@ class PackageFile: self.PackFile(File)=0D os.chdir(Cwd)=0D =0D - ## Pack the file=0D + # Pack the file=0D #=0D # @param File: the files to pack=0D # @param ArcName: the Arc Name=0D @@ -224,9 +224,9 @@ class PackageFile: self._ZipFile.write(File, ArcName)=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,=0D - ExtraData=3D"%s (%s)" % (File, str(Xstr)))=0D + ExtraData=3D"%s (%s)" % (File, str(Xstr)))=0D =0D - ## Write data to the packed file=0D + # Write data to the packed file=0D #=0D # @param Data: data to write=0D # @param ArcName: the Arc Name=0D @@ -238,13 +238,10 @@ class PackageFile: self._ZipFile.writestr(ArcName, Data)=0D except BaseException as Xstr:=0D Logger.Error("PackagingTool", FILE_COMPRESS_FAILURE,=0D - ExtraData=3D"%s (%s)" % (ArcName, str(Xstr)))= =0D + ExtraData=3D"%s (%s)" % (ArcName, str(Xstr)))=0D =0D - ## Close file=0D + # Close file=0D #=0D #=0D def Close(self):=0D self._ZipFile.close()=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Core/__init__.py b/BaseTools/Sourc= e/Python/UPT/Core/__init__.py index 9af96f9c3c13..201bcf236305 100644 --- a/BaseTools/Source/Python/UPT/Core/__init__.py +++ b/BaseTools/Source/Python/UPT/Core/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTo= ols/Source/Python/UPT/GenMetaFile/GenDecFile.py index 91952a5feec7..14360fe7e1e8 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py @@ -1,4 +1,4 @@ -## @file GenDecFile.py=0D +# @file GenDecFile.py=0D #=0D # This file contained the logical of transfer package object to DEC files.= =0D #=0D @@ -61,6 +61,7 @@ import Library.DataType as DT from Library.UniClassObject import FormatUniEntry=0D from Library.StringUtils import GetUniFileName=0D =0D +=0D def GenPcd(Package, Content):=0D #=0D # generate [Pcd] section=0D @@ -121,15 +122,17 @@ def GenPcd(Package, Content): SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [Statement]=0D + NewSectionDict[SortedArch] + [Statement]=0D else:=0D NewSectionDict[SortedArch] =3D [Statement]=0D =0D for ValidUsage in ValidUsageDict:=0D - Content +=3D GenSection(ValidUsage, ValidUsageDict[ValidUsage], Tr= ue, True)=0D + Content +=3D GenSection(ValidUsage,=0D + ValidUsageDict[ValidUsage], True, True)=0D =0D return Content=0D =0D +=0D def GenPcdErrorMsgSection(Package, Content):=0D if not Package.PcdErrorCommentDict:=0D return Content=0D @@ -139,7 +142,8 @@ def GenPcdErrorMsgSection(Package, Content): #=0D Content +=3D END_OF_LINE + END_OF_LINE=0D SectionComment =3D TAB_COMMENT_SPLIT + END_OF_LINE=0D - SectionComment +=3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_ERRO= R_SECTION_COMMENT + END_OF_LINE=0D + SectionComment +=3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + \=0D + TAB_PCD_ERROR_SECTION_COMMENT + END_OF_LINE=0D SectionComment +=3D TAB_COMMENT_SPLIT + END_OF_LINE=0D TokenSpcCNameList =3D []=0D =0D @@ -152,20 +156,22 @@ def GenPcdErrorMsgSection(Package, Content): =0D for TokenSpcCNameItem in TokenSpcCNameList:=0D SectionName =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_SECTION_= START + TAB_PCD_ERROR + \=0D - TAB_SPLIT + TokenSpcCNameItem + TAB_SECTION_END + EN= D_OF_LINE=0D + TAB_SPLIT + TokenSpcCNameItem + TAB_SECTION_END + END_OF_LINE= =0D Content +=3D SectionComment=0D Content +=3D SectionName=0D for (TokenSpcCName, ErrorNumber) in Package.PcdErrorCommentDict:=0D if TokenSpcCNameItem =3D=3D TokenSpcCName:=0D - PcdErrorMsg =3D GetLocalValue(Package.PcdErrorCommentDict[= (TokenSpcCName, ErrorNumber)])=0D + PcdErrorMsg =3D GetLocalValue(=0D + Package.PcdErrorCommentDict[(TokenSpcCName, ErrorNumbe= r)])=0D SectionItem =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_= SPACE_SPLIT + \=0D - ErrorNumber + TAB_SPACE_SPLIT + TAB_VALUE_SP= LIT + TAB_SPACE_SPLIT + \=0D - PcdErrorMsg + END_OF_LINE=0D + ErrorNumber + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT + TAB_= SPACE_SPLIT + \=0D + PcdErrorMsg + END_OF_LINE=0D Content +=3D SectionItem=0D =0D Content +=3D TAB_COMMENT_SPLIT=0D return Content=0D =0D +=0D def GenGuidProtocolPpi(Package, Content):=0D #=0D # generate [Guids] section=0D @@ -202,7 +208,7 @@ def GenGuidProtocolPpi(Package, Content): SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [Statement]=0D + NewSectionDict[SortedArch] + [Statement]=0D else:=0D NewSectionDict[SortedArch] =3D [Statement]=0D =0D @@ -242,7 +248,7 @@ def GenGuidProtocolPpi(Package, Content): SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [Statement]=0D + NewSectionDict[SortedArch] + [Statement]=0D else:=0D NewSectionDict[SortedArch] =3D [Statement]=0D =0D @@ -282,7 +288,7 @@ def GenGuidProtocolPpi(Package, Content): SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [Statement]=0D + NewSectionDict[SortedArch] + [Statement]=0D else:=0D NewSectionDict[SortedArch] =3D [Statement]=0D =0D @@ -290,13 +296,15 @@ def GenGuidProtocolPpi(Package, Content): =0D return Content=0D =0D -## Transfer Package Object to Dec files=0D +# Transfer Package Object to Dec files=0D #=0D # Transfer all contents of a standard Package Object to a Dec file=0D #=0D # @param Package: A Package=0D #=0D -def PackageToDec(Package, DistHeader =3D None):=0D +=0D +=0D +def PackageToDec(Package, DistHeader=3DNone):=0D #=0D # Init global information for the file=0D #=0D @@ -333,9 +341,9 @@ def PackageToDec(Package, DistHeader =3D None): #=0D # Generate header comment section of DEC file=0D #=0D - Content +=3D GenHeaderCommentSection(PackageAbstract, \=0D - PackageDescription, \=0D - PackageCopyright, \=0D + Content +=3D GenHeaderCommentSection(PackageAbstract,=0D + PackageDescription,=0D + PackageCopyright,=0D PackageLicense).replace('\r\n', '\n= ')=0D =0D #=0D @@ -343,9 +351,11 @@ def PackageToDec(Package, DistHeader =3D None): #=0D for UserExtension in Package.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D TAB_BINARY_HEADER_USERID \=0D - and UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER_IDENTIF= IER:=0D - PackageBinaryAbstract =3D GetLocalValue(UserExtension.GetBinar= yAbstract())=0D - PackageBinaryDescription =3D GetLocalValue(UserExtension.GetBi= naryDescription())=0D + and UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER= _IDENTIFIER:=0D + PackageBinaryAbstract =3D GetLocalValue(=0D + UserExtension.GetBinaryAbstract())=0D + PackageBinaryDescription =3D GetLocalValue(=0D + UserExtension.GetBinaryDescription())=0D PackageBinaryCopyright =3D ''=0D PackageBinaryLicense =3D ''=0D for (Lang, Copyright) in UserExtension.GetBinaryCopyright():=0D @@ -353,23 +363,23 @@ def PackageToDec(Package, DistHeader =3D None): for (Lang, License) in UserExtension.GetBinaryLicense():=0D PackageBinaryLicense =3D License=0D if PackageBinaryAbstract and PackageBinaryDescription and \=0D - PackageBinaryCopyright and PackageBinaryLicense:=0D + PackageBinaryCopyright and PackageBinaryLicense:=0D Content +=3D GenHeaderCommentSection(PackageBinaryAbstract= ,=0D - PackageBinaryDescription,=0D - PackageBinaryCopyright,=0D - PackageBinaryLicense,=0D - True)=0D + PackageBinaryDescriptio= n,=0D + PackageBinaryCopyright,= =0D + PackageBinaryLicense,=0D + True)=0D =0D #=0D # Generate PACKAGE_UNI_FILE for the Package=0D #=0D - FileHeader =3D GenHeaderCommentSection(PackageAbstract, PackageDescrip= tion, PackageCopyright, PackageLicense, False, \=0D + FileHeader =3D GenHeaderCommentSection(PackageAbstract, PackageDescrip= tion, PackageCopyright, PackageLicense, False,=0D TAB_COMMENT_EDK1_SPLIT)=0D GenPackageUNIEncodeFile(Package, FileHeader)=0D =0D #=0D # for each section, maintain a dict, sorted arch will be its key,=0D - #statement list will be its data=0D + # statement list will be its data=0D # { 'Arch1 Arch2 Arch3': [statement1, statement2],=0D # 'Arch1' : [statement1, statement3]=0D # }=0D @@ -379,31 +389,36 @@ def PackageToDec(Package, DistHeader =3D None): # generate [Defines] section=0D #=0D LeftOffset =3D 31=0D - NewSectionDict =3D {TAB_ARCH_COMMON : []}=0D + NewSectionDict =3D {TAB_ARCH_COMMON: []}=0D SpecialItemList =3D []=0D =0D - Statement =3D (u'%s ' % TAB_DEC_DEFINES_DEC_SPECIFICATION).ljust(LeftO= ffset) + u'=3D %s' % '0x00010017'=0D + Statement =3D (u'%s ' % TAB_DEC_DEFINES_DEC_SPECIFICATION).ljust(=0D + LeftOffset) + u'=3D %s' % '0x00010017'=0D SpecialItemList.append(Statement)=0D =0D BaseName =3D Package.GetBaseName()=0D if BaseName.startswith('.') or BaseName.startswith('-'):=0D BaseName =3D '_' + BaseName=0D - Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_NAME).ljust(LeftOffset= ) + u'=3D %s' % BaseName=0D + Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_NAME).ljust(=0D + LeftOffset) + u'=3D %s' % BaseName=0D SpecialItemList.append(Statement)=0D =0D - Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_VERSION).ljust(LeftOff= set) + u'=3D %s' % Package.GetVersion()=0D + Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_VERSION).ljust(=0D + LeftOffset) + u'=3D %s' % Package.GetVersion()=0D SpecialItemList.append(Statement)=0D =0D - Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_GUID).ljust(LeftOffset= ) + u'=3D %s' % Package.GetGuid()=0D + Statement =3D (u'%s ' % TAB_DEC_DEFINES_PACKAGE_GUID).ljust(=0D + LeftOffset) + u'=3D %s' % Package.GetGuid()=0D SpecialItemList.append(Statement)=0D =0D if Package.UNIFlag:=0D - Statement =3D (u'%s ' % TAB_DEC_DEFINES_PKG_UNI_FILE).ljust(LeftOf= fset) + u'=3D %s' % Package.GetBaseName() + '.uni'=0D + Statement =3D (u'%s ' % TAB_DEC_DEFINES_PKG_UNI_FILE).ljust(=0D + LeftOffset) + u'=3D %s' % Package.GetBaseName() + '.uni'=0D SpecialItemList.append(Statement)=0D =0D for SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + SpecialItemList=0D + NewSectionDict[SortedArch] + SpecialItemList=0D Content +=3D GenSection('Defines', NewSectionDict)=0D =0D #=0D @@ -418,7 +433,7 @@ def PackageToDec(Package, DistHeader =3D None): SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [ConvertPath(Statement)]=0D + NewSectionDict[SortedArch] + [ConvertPath(Statement)]= =0D else:=0D NewSectionDict[SortedArch] =3D [ConvertPath(Statement)]=0D =0D @@ -452,12 +467,12 @@ def PackageToDec(Package, DistHeader =3D None): #=0D if LibraryClass.GetSupModuleList():=0D Statement +=3D \=0D - GenDecTailComment(LibraryClass.GetSupModuleList())=0D + GenDecTailComment(LibraryClass.GetSupModuleList())=0D ArchList =3D sorted(LibraryClass.GetSupArchList())=0D SortedArch =3D ' '.join(ArchList)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D \=0D - NewSectionDict[SortedArch] + [Statement]=0D + NewSectionDict[SortedArch] + [Statement]=0D else:=0D NewSectionDict[SortedArch] =3D [Statement]=0D =0D @@ -476,7 +491,7 @@ def PackageToDec(Package, DistHeader =3D None): NewSectionDict =3D {}=0D for UserExtension in Package.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D TAB_BINARY_HEADER_USERID and \= =0D - UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER_IDENTIF= IER:=0D + UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER_IDE= NTIFIER:=0D continue=0D =0D # Generate Private Section first=0D @@ -513,15 +528,18 @@ def PackageToDec(Package, DistHeader =3D None): =0D SaveFileOnChange(ContainerFile, Content, False)=0D if DistHeader.ReadOnly:=0D - os.chmod(ContainerFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)=0D + os.chmod(ContainerFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH= )=0D else:=0D - os.chmod(ContainerFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|sta= t.S_IWUSR|stat.S_IWGRP|stat.S_IWOTH)=0D + os.chmod(ContainerFile, stat.S_IRUSR | stat.S_IRGRP |=0D + stat.S_IROTH | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH= )=0D return ContainerFile=0D =0D -## GenPackageUNIEncodeFile=0D +# GenPackageUNIEncodeFile=0D # GenPackageUNIEncodeFile, default is a UCS-2LE encode file=0D #=0D -def GenPackageUNIEncodeFile(PackageObject, UniFileHeader =3D '', Encoding= =3DTAB_ENCODING_UTF16LE):=0D +=0D +=0D +def GenPackageUNIEncodeFile(PackageObject, UniFileHeader=3D'', Encoding=3D= TAB_ENCODING_UTF16LE):=0D GenUNIFlag =3D False=0D OnlyLANGUAGE_EN_X =3D True=0D BinaryAbstract =3D []=0D @@ -538,7 +556,7 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeade= r =3D '', Encoding=3DTAB_ENCO =0D for UserExtension in PackageObject.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D TAB_BINARY_HEADER_USERID \=0D - and UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER_IDENTIF= IER:=0D + and UserExtension.GetIdentifier() =3D=3D TAB_BINARY_HEADER= _IDENTIFIER:=0D for (Key, Value) in UserExtension.GetBinaryAbstract():=0D if Key =3D=3D TAB_LANGUAGE_EN_X:=0D GenUNIFlag =3D True=0D @@ -577,25 +595,30 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHea= der =3D '', Encoding=3DTAB_ENCO if not os.path.exists(os.path.dirname(PackageObject.GetFullPath())):=0D os.makedirs(os.path.dirname(PackageObject.GetFullPath()))=0D =0D - ContainerFile =3D GetUniFileName(os.path.dirname(PackageObject.GetFull= Path()), PackageObject.GetBaseName())=0D + ContainerFile =3D GetUniFileName(os.path.dirname(=0D + PackageObject.GetFullPath()), PackageObject.GetBaseName())=0D =0D Content =3D UniFileHeader + '\r\n'=0D Content +=3D '\r\n'=0D =0D - Content +=3D FormatUniEntry('#string ' + TAB_DEC_PACKAGE_ABSTRACT, Pac= kageObject.GetAbstract(), ContainerFile) + '\r\n'=0D + Content +=3D FormatUniEntry('#string ' + TAB_DEC_PACKAGE_ABSTRACT,=0D + PackageObject.GetAbstract(), ContainerFile) = + '\r\n'=0D =0D Content +=3D FormatUniEntry('#string ' + TAB_DEC_PACKAGE_DESCRIPTION, = PackageObject.GetDescription(), ContainerFile) \=0D - + '\r\n'=0D + + '\r\n'=0D =0D - Content +=3D FormatUniEntry('#string ' + TAB_DEC_BINARY_ABSTRACT, Bina= ryAbstract, ContainerFile) + '\r\n'=0D + Content +=3D FormatUniEntry('#string ' + TAB_DEC_BINARY_ABSTRACT,=0D + BinaryAbstract, ContainerFile) + '\r\n'=0D =0D - Content +=3D FormatUniEntry('#string ' + TAB_DEC_BINARY_DESCRIPTION, B= inaryDescription, ContainerFile) + '\r\n'=0D + Content +=3D FormatUniEntry('#string ' + TAB_DEC_BINARY_DESCRIPTION,=0D + BinaryDescription, ContainerFile) + '\r\n'=0D =0D PromptGenList =3D []=0D HelpTextGenList =3D []=0D for Pcd in PackageObject.GetPcdList():=0D # Generate Prompt for each Pcd=0D - PcdPromptStrName =3D '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCN= ame() + '_' + Pcd.GetCName() + '_PROMPT '=0D + PcdPromptStrName =3D '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCN= ame() + '_' + \=0D + Pcd.GetCName() + '_PROMPT '=0D TokenValueList =3D []=0D for TxtObj in Pcd.GetPromptList():=0D Lang =3D TxtObj.GetLang()=0D @@ -606,12 +629,14 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHea= der =3D '', Encoding=3DTAB_ENCO if (PcdPromptStrName, Lang) not in PromptGenList:=0D TokenValueList.append((Lang, PromptStr))=0D PromptGenList.append((PcdPromptStrName, Lang))=0D - PromptString =3D FormatUniEntry(PcdPromptStrName, TokenValueList, = ContainerFile) + '\r\n'=0D + PromptString =3D FormatUniEntry(=0D + PcdPromptStrName, TokenValueList, ContainerFile) + '\r\n'=0D if PromptString not in Content:=0D Content +=3D PromptString=0D =0D # Generate Help String for each Pcd=0D - PcdHelpStrName =3D '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCNam= e() + '_' + Pcd.GetCName() + '_HELP '=0D + PcdHelpStrName =3D '#string ' + 'STR_' + Pcd.GetTokenSpaceGuidCNam= e() + '_' + \=0D + Pcd.GetCName() + '_HELP '=0D TokenValueList =3D []=0D for TxtObj in Pcd.GetHelpTextList():=0D Lang =3D TxtObj.GetLang()=0D @@ -622,7 +647,8 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeade= r =3D '', Encoding=3DTAB_ENCO if (PcdHelpStrName, Lang) not in HelpTextGenList:=0D TokenValueList.append((Lang, HelpStr))=0D HelpTextGenList.append((PcdHelpStrName, Lang))=0D - HelpTextString =3D FormatUniEntry(PcdHelpStrName, TokenValueList, = ContainerFile) + '\r\n'=0D + HelpTextString =3D FormatUniEntry(=0D + PcdHelpStrName, TokenValueList, ContainerFile) + '\r\n'=0D if HelpTextString not in Content:=0D Content +=3D HelpTextString=0D =0D @@ -633,7 +659,8 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeade= r =3D '', Encoding=3DTAB_ENCO PcdErrStrName =3D '#string ' + TAB_STR_TOKENCNAME + TAB_UN= DERLINE_SPLIT + Pcd.GetTokenSpaceGuidCName() \=0D + TAB_UNDERLINE_SPLIT + TAB_STR_TOKENERR \=0D + TAB_UNDERLINE_SPLIT + ErrorNo[2:]=0D - PcdErrString =3D FormatUniEntry(PcdErrStrName, PcdError.Ge= tErrorMessageList(), ContainerFile) + '\r\n'=0D + PcdErrString =3D FormatUniEntry(=0D + PcdErrStrName, PcdError.GetErrorMessageList(), Contain= erFile) + '\r\n'=0D if PcdErrString not in Content:=0D Content +=3D PcdErrString=0D =0D @@ -647,18 +674,21 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHea= der =3D '', Encoding=3DTAB_ENCO =0D return ContainerFile=0D =0D -## GenPcdErrComment=0D +# GenPcdErrComment=0D #=0D # @param PcdErrObject: PcdErrorObject=0D #=0D # @retval CommentStr: Generated comment lines, with prefix "#"=0D #=0D -def GenPcdErrComment (PcdErrObject):=0D +=0D +=0D +def GenPcdErrComment(PcdErrObject):=0D CommentStr =3D ''=0D ErrorCode =3D PcdErrObject.GetErrorNumber()=0D ValidValueRange =3D PcdErrObject.GetValidValueRange()=0D if ValidValueRange:=0D - CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_VALID= RANGE + TAB_SPACE_SPLIT=0D + CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + \=0D + TAB_PCD_VALIDRANGE + TAB_SPACE_SPLIT=0D if ErrorCode:=0D CommentStr +=3D ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT = + TAB_SPACE_SPLIT=0D CommentStr +=3D ValidValueRange + END_OF_LINE=0D @@ -666,18 +696,19 @@ def GenPcdErrComment (PcdErrObject): ValidValue =3D PcdErrObject.GetValidValue()=0D if ValidValue:=0D ValidValueList =3D \=0D - [Value for Value in ValidValue.split(TAB_SPACE_SPLIT) if Value]=0D - CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_VALID= LIST + TAB_SPACE_SPLIT=0D + [Value for Value in ValidValue.split(TAB_SPACE_SPLIT) if Value= ]=0D + CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + \=0D + TAB_PCD_VALIDLIST + TAB_SPACE_SPLIT=0D if ErrorCode:=0D CommentStr +=3D ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT = + TAB_SPACE_SPLIT=0D CommentStr +=3D TAB_COMMA_SPLIT.join(ValidValueList) + END_OF_LINE= =0D =0D Expression =3D PcdErrObject.GetExpression()=0D if Expression:=0D - CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + TAB_PCD_EXPRE= SSION + TAB_SPACE_SPLIT=0D + CommentStr =3D TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT + \=0D + TAB_PCD_EXPRESSION + TAB_SPACE_SPLIT=0D if ErrorCode:=0D CommentStr +=3D ErrorCode + TAB_SPACE_SPLIT + TAB_VALUE_SPLIT = + TAB_SPACE_SPLIT=0D CommentStr +=3D Expression + END_OF_LINE=0D =0D return CommentStr=0D -=0D diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTo= ols/Source/Python/UPT/GenMetaFile/GenInfFile.py index dd6184e0471e..fec699e2d22d 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -1,4 +1,4 @@ -## @file GenInfFile.py=0D +# @file GenInfFile.py=0D #=0D # This file contained the logical of transfer package object to INF files.= =0D #=0D @@ -38,7 +38,7 @@ from Library.UniClassObject import FormatUniEntry from Library.StringUtils import GetUniFileName=0D =0D =0D -## Transfer Module Object to Inf files=0D +# Transfer Module Object to Inf files=0D #=0D # Transfer all contents of a standard Module Object to an Inf file=0D # @param ModuleObject: A Module Object=0D @@ -112,9 +112,11 @@ def ModuleToInf(ModuleObject, PackageObject=3DNone, Di= stHeader=3DNone): #=0D for UserExtension in ModuleObject.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D DT.TAB_BINARY_HEADER_USERID \= =0D - and UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEADER_IDEN= TIFIER:=0D - ModuleBinaryAbstract =3D GetLocalValue(UserExtension.GetBinary= Abstract())=0D - ModuleBinaryDescription =3D GetLocalValue(UserExtension.GetBin= aryDescription())=0D + and UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEA= DER_IDENTIFIER:=0D + ModuleBinaryAbstract =3D GetLocalValue(=0D + UserExtension.GetBinaryAbstract())=0D + ModuleBinaryDescription =3D GetLocalValue(=0D + UserExtension.GetBinaryDescription())=0D ModuleBinaryCopyright =3D ''=0D ModuleBinaryLicense =3D ''=0D for (Lang, Copyright) in UserExtension.GetBinaryCopyright():=0D @@ -122,17 +124,17 @@ def ModuleToInf(ModuleObject, PackageObject=3DNone, D= istHeader=3DNone): for (Lang, License) in UserExtension.GetBinaryLicense():=0D ModuleBinaryLicense =3D License=0D if ModuleBinaryAbstract and ModuleBinaryDescription and \=0D - ModuleBinaryCopyright and ModuleBinaryLicense:=0D + ModuleBinaryCopyright and ModuleBinaryLicense:=0D Content +=3D GenHeaderCommentSection(ModuleBinaryAbstract,= =0D - ModuleBinaryDescription,=0D - ModuleBinaryCopyright,=0D - ModuleBinaryLicense,=0D - True)=0D + ModuleBinaryDescription= ,=0D + ModuleBinaryCopyright,= =0D + ModuleBinaryLicense,=0D + True)=0D =0D #=0D # Generate MODULE_UNI_FILE for module=0D #=0D - FileHeader =3D GenHeaderCommentSection(ModuleAbstract, ModuleDescripti= on, ModuleCopyright, ModuleLicense, False, \=0D + FileHeader =3D GenHeaderCommentSection(ModuleAbstract, ModuleDescripti= on, ModuleCopyright, ModuleLicense, False,=0D DT.TAB_COMMENT_EDK1_SPLIT)=0D ModuleUniFile =3D GenModuleUNIEncodeFile(ModuleObject, FileHeader)=0D if ModuleUniFile:=0D @@ -172,19 +174,25 @@ def ModuleToInf(ModuleObject, PackageObject=3DNone, D= istHeader=3DNone): #=0D # generate [Event], [BootMode], [Hob] section=0D #=0D - Content +=3D GenSpecialSections(ModuleObject.GetEventList(), 'Event', = __UserExtensionsContent)=0D - Content +=3D GenSpecialSections(ModuleObject.GetBootModeList(), 'BootM= ode', __UserExtensionsContent)=0D - Content +=3D GenSpecialSections(ModuleObject.GetHobList(), 'Hob', __Us= erExtensionsContent)=0D + Content +=3D GenSpecialSections(ModuleObject.GetEventList(),=0D + 'Event', __UserExtensionsContent)=0D + Content +=3D GenSpecialSections(ModuleObject.GetBootModeList(),=0D + 'BootMode', __UserExtensionsContent)=0D + Content +=3D GenSpecialSections(ModuleObject.GetHobList(),=0D + 'Hob', __UserExtensionsContent)=0D SaveFileOnChange(ContainerFile, Content, False)=0D if DistHeader.ReadOnly:=0D - os.chmod(ContainerFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)=0D + os.chmod(ContainerFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH= )=0D else:=0D - os.chmod(ContainerFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|sta= t.S_IWUSR|stat.S_IWGRP|stat.S_IWOTH)=0D + os.chmod(ContainerFile, stat.S_IRUSR | stat.S_IRGRP |=0D + stat.S_IROTH | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH= )=0D return ContainerFile=0D =0D -## GenModuleUNIEncodeFile=0D +# GenModuleUNIEncodeFile=0D # GenModuleUNIEncodeFile, default is a UCS-2LE encode file=0D #=0D +=0D +=0D def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader=3D'', Encoding=3DDT= .TAB_ENCODING_UTF16LE):=0D GenUNIFlag =3D False=0D OnlyLANGUAGE_EN_X =3D True=0D @@ -202,7 +210,7 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader= =3D'', Encoding=3DDT.TAB_ENCOD =0D for UserExtension in ModuleObject.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D DT.TAB_BINARY_HEADER_USERID \= =0D - and UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEADER_IDEN= TIFIER:=0D + and UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEA= DER_IDENTIFIER:=0D for (Key, Value) in UserExtension.GetBinaryAbstract():=0D if Key =3D=3D DT.TAB_LANGUAGE_EN_X:=0D GenUNIFlag =3D True=0D @@ -216,14 +224,14 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeade= r=3D'', Encoding=3DDT.TAB_ENCOD OnlyLANGUAGE_EN_X =3D False=0D BinaryDescription.append((Key, Value))=0D =0D -=0D if not GenUNIFlag:=0D return=0D elif OnlyLANGUAGE_EN_X:=0D return=0D else:=0D ModuleObject.UNIFlag =3D True=0D - ContainerFile =3D GetUniFileName(os.path.dirname(ModuleObject.GetFullP= ath()), ModuleObject.GetBaseName())=0D + ContainerFile =3D GetUniFileName(os.path.dirname(=0D + ModuleObject.GetFullPath()), ModuleObject.GetBaseName())=0D =0D if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):=0D os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))=0D @@ -231,16 +239,18 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeade= r=3D'', Encoding=3DDT.TAB_ENCOD Content =3D UniFileHeader + '\r\n'=0D Content +=3D '\r\n'=0D =0D - Content +=3D FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT, ModuleOb= ject.GetAbstract(), ContainerFile) + '\r\n'=0D + Content +=3D FormatUniEntry('#string ' + DT.TAB_INF_ABSTRACT,=0D + ModuleObject.GetAbstract(), ContainerFile) += '\r\n'=0D =0D Content +=3D FormatUniEntry('#string ' + DT.TAB_INF_DESCRIPTION, Modul= eObject.GetDescription(), ContainerFile) \=0D - + '\r\n'=0D + + '\r\n'=0D =0D - BinaryAbstractString =3D FormatUniEntry('#string ' + DT.TAB_INF_BINARY= _ABSTRACT, BinaryAbstract, ContainerFile)=0D + BinaryAbstractString =3D FormatUniEntry(=0D + '#string ' + DT.TAB_INF_BINARY_ABSTRACT, BinaryAbstract, Container= File)=0D if BinaryAbstractString:=0D Content +=3D BinaryAbstractString + '\r\n'=0D =0D - BinaryDescriptionString =3D FormatUniEntry('#string ' + DT.TAB_INF_BIN= ARY_DESCRIPTION, BinaryDescription, \=0D + BinaryDescriptionString =3D FormatUniEntry('#string ' + DT.TAB_INF_BIN= ARY_DESCRIPTION, BinaryDescription,=0D ContainerFile)=0D if BinaryDescriptionString:=0D Content +=3D BinaryDescriptionString + '\r\n'=0D @@ -255,6 +265,8 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader= =3D'', Encoding=3DDT.TAB_ENCOD ModuleObject.FileList.append((ContainerFile, Md5Sum))=0D =0D return ContainerFile=0D +=0D +=0D def GenDefines(ModuleObject):=0D #=0D # generate [Defines] section=0D @@ -270,7 +282,7 @@ def GenDefines(ModuleObject): for Statement in DefinesDict:=0D if len(Statement.split(DT.TAB_EQUAL_SPLIT)) > 1:=0D Statement =3D (u'%s ' % Statement.split(DT.TAB_EQUAL_SPLIT= , 1)[0]).ljust(LeftOffset) \=0D - + u'=3D %s' % Statement.split(DT.TAB_EQUAL_SP= LIT, 1)[1].lstrip()=0D + + u'=3D %s' % Statement.split(DT.TAB_EQUAL_SPLIT, 1)[1= ].lstrip()=0D SortedArch =3D DT.TAB_ARCH_COMMON=0D if Statement.strip().startswith(DT.TAB_INF_DEFINES_CUSTOM_MAKE= FILE):=0D pos =3D Statement.find(DT.TAB_VALUE_SPLIT)=0D @@ -285,51 +297,56 @@ def GenDefines(ModuleObject): SpecialStatementList =3D []=0D =0D # TAB_INF_DEFINES_INF_VERSION=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_INF_VERSION).ljust(LeftOffs= et) + u'=3D %s' % '0x00010017'=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_INF_VERSION).ljust(=0D + LeftOffset) + u'=3D %s' % '0x00010017'=0D SpecialStatementList.append(Statement)=0D =0D # BaseName=0D BaseName =3D ModuleObject.GetBaseName()=0D if BaseName.startswith('.') or BaseName.startswith('-'):=0D BaseName =3D '_' + BaseName=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_BASE_NAME).ljust(LeftOffset= ) + u'=3D %s' % BaseName=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_BASE_NAME).ljust(=0D + LeftOffset) + u'=3D %s' % BaseName=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_FILE_GUID=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_FILE_GUID).ljust(LeftOffset= ) + u'=3D %s' % ModuleObject.GetGuid()=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_FILE_GUID).ljust(=0D + LeftOffset) + u'=3D %s' % ModuleObject.GetGuid()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_VERSION_STRING=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_VERSION_STRING).ljust(LeftO= ffset) + u'=3D %s' % ModuleObject.GetVersion()=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_VERSION_STRING).ljust(=0D + LeftOffset) + u'=3D %s' % ModuleObject.GetVersion()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_VERSION_STRING=0D if ModuleObject.UNIFlag:=0D Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_MODULE_UNI_FILE).ljust(= LeftOffset) + \=0D - u'=3D %s' % ModuleObject.GetModuleUniFile()=0D + u'=3D %s' % ModuleObject.GetModuleUniFile()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_MODULE_TYPE=0D if ModuleObject.GetModuleType():=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_MODULE_TYPE).ljust(Left= Offset) + u'=3D %s' % ModuleObject.GetModuleType()=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_MODULE_TYPE).ljust(=0D + LeftOffset) + u'=3D %s' % ModuleObject.GetModuleType()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_PCD_IS_DRIVER=0D if ModuleObject.GetPcdIsDriver():=0D Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_PCD_IS_DRIVER).ljust(Le= ftOffset) + \=0D - u'=3D %s' % ModuleObject.GetPcdIsDriver()=0D + u'=3D %s' % ModuleObject.GetPcdIsDriver()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION=0D if ModuleObject.GetUefiSpecificationVersion():=0D Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERS= ION).ljust(LeftOffset) + \=0D - u'=3D %s' % ModuleObject.GetUefiSpecificationVersion()= =0D + u'=3D %s' % ModuleObject.GetUefiSpecificationVersion()=0D SpecialStatementList.append(Statement)=0D =0D # TAB_INF_DEFINES_PI_SPECIFICATION_VERSION=0D if ModuleObject.GetPiSpecificationVersion():=0D Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSIO= N).ljust(LeftOffset) + \=0D - u'=3D %s' % ModuleObject.GetPiSpecificationVersion()=0D + u'=3D %s' % ModuleObject.GetPiSpecificationVersion()=0D SpecialStatementList.append(Statement)=0D =0D # LibraryClass=0D @@ -337,9 +354,11 @@ def GenDefines(ModuleObject): if LibraryClass.GetUsage() =3D=3D DT.USAGE_ITEM_PRODUCES or \=0D LibraryClass.GetUsage() =3D=3D DT.USAGE_ITEM_SOMETIMES_PRODUCES= :=0D Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_LIBRARY_CLASS).ljus= t(LeftOffset) + \=0D - u'=3D %s' % LibraryClass.GetLibraryClass()=0D + u'=3D %s' % LibraryClass.GetLibraryClass()=0D if LibraryClass.GetSupModuleList():=0D - Statement +=3D '|' + DT.TAB_SPACE_SPLIT.join(l for l in Li= braryClass.GetSupModuleList())=0D + Statement +=3D '|' + \=0D + DT.TAB_SPACE_SPLIT.join(=0D + l for l in LibraryClass.GetSupModuleList())=0D SpecialStatementList.append(Statement)=0D =0D # Spec Item=0D @@ -359,7 +378,8 @@ def GenDefines(ModuleObject): Destructor =3D Extern.GetDestructor()=0D HelpStringList =3D Extern.GetHelpTextList()=0D FFE =3D Extern.GetFeatureFlag()=0D - ExternList.append([ArchList, EntryPoint, UnloadImage, Constructor,= Destructor, FFE, HelpStringList])=0D + ExternList.append([ArchList, EntryPoint, UnloadImage,=0D + Constructor, Destructor, FFE, HelpStringList])=0D #=0D # Add VALID_ARCHITECTURES information=0D #=0D @@ -368,17 +388,22 @@ def GenDefines(ModuleObject): ValidArchStatement =3D '\n' + '# ' + '\n'=0D ValidArchStatement +=3D '# The following information is for refere= nce only and not required by the build tools.\n'=0D ValidArchStatement +=3D '# ' + '\n'=0D - ValidArchStatement +=3D '# VALID_ARCHITECTURES =3D %s' % (' '.join= (ModuleObject.SupArchList)) + '\n'=0D + ValidArchStatement +=3D '# VALID_ARCHITECTURES =3D %s' % (=0D + ' '.join(ModuleObject.SupArchList)) + '\n'=0D ValidArchStatement +=3D '# '=0D if DT.TAB_ARCH_COMMON not in NewSectionDict:=0D NewSectionDict[DT.TAB_ARCH_COMMON] =3D []=0D - NewSectionDict[DT.TAB_ARCH_COMMON] =3D NewSectionDict[DT.TAB_ARCH_COMM= ON] + SpecialStatementList=0D - GenMetaFileMisc.AddExternToDefineSec(NewSectionDict, DT.TAB_ARCH_COMMO= N, ExternList)=0D + NewSectionDict[DT.TAB_ARCH_COMMON] =3D NewSectionDict[DT.TAB_ARCH_COMM= ON] + \=0D + SpecialStatementList=0D + GenMetaFileMisc.AddExternToDefineSec(=0D + NewSectionDict, DT.TAB_ARCH_COMMON, ExternList)=0D if ValidArchStatement is not None:=0D - NewSectionDict[DT.TAB_ARCH_COMMON] =3D NewSectionDict[DT.TAB_ARCH_= COMMON] + [ValidArchStatement]=0D + NewSectionDict[DT.TAB_ARCH_COMMON] =3D NewSectionDict[DT.TAB_ARCH_= COMMON] + \=0D + [ValidArchStatement]=0D Content +=3D GenSection('Defines', NewSectionDict)=0D return Content=0D =0D +=0D def GenLibraryClasses(ModuleObject):=0D #=0D # generate [LibraryClasses] section=0D @@ -451,6 +476,7 @@ def GenLibraryClasses(ModuleObject): =0D return Content=0D =0D +=0D def GenPackages(ModuleObject):=0D Content =3D ''=0D #=0D @@ -496,6 +522,7 @@ def GenPackages(ModuleObject): Content +=3D GenSection('Packages', NewSectionDict)=0D return Content=0D =0D +=0D def GenSources(ModuleObject):=0D #=0D # generate [Sources] section=0D @@ -508,7 +535,8 @@ def GenSources(ModuleObject): FeatureFlag =3D Source.GetFeatureFlag()=0D SupArchList =3D sorted(Source.GetSupArchList())=0D SortedArch =3D ' '.join(SupArchList)=0D - Statement =3D GenSourceStatement(ConvertPath(SourceFile), Family, = FeatureFlag)=0D + Statement =3D GenSourceStatement(=0D + ConvertPath(SourceFile), Family, FeatureFlag)=0D if SortedArch in NewSectionDict:=0D NewSectionDict[SortedArch] =3D NewSectionDict[SortedArch] + [S= tatement]=0D else:=0D @@ -517,6 +545,7 @@ def GenSources(ModuleObject): =0D return Content=0D =0D +=0D def GenDepex(ModuleObject):=0D #=0D # generate [Depex] section=0D @@ -540,7 +569,8 @@ def GenDepex(ModuleObject): else:=0D for ModuleType in SupModList:=0D for Arch in SupArchList:=0D - KeyList.append(ConvertArchForInstall(Arch) + '.' + Mod= uleType)=0D + KeyList.append(ConvertArchForInstall(=0D + Arch) + '.' + ModuleType)=0D for Key in KeyList:=0D if Key in NewSectionDict:=0D NewSectionDict[Key] =3D NewSectionDict[Key] + [Statement]= =0D @@ -549,15 +579,17 @@ def GenDepex(ModuleObject): Content +=3D GenSection('Depex', NewSectionDict, False)=0D =0D return Content=0D -## GenUserExtensions=0D +# GenUserExtensions=0D #=0D # GenUserExtensions=0D #=0D +=0D +=0D def GenUserExtensions(ModuleObject):=0D NewSectionDict =3D {}=0D for UserExtension in ModuleObject.GetUserExtensionList():=0D if UserExtension.GetUserID() =3D=3D DT.TAB_BINARY_HEADER_USERID an= d \=0D - UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEADER_IDEN= TIFIER:=0D + UserExtension.GetIdentifier() =3D=3D DT.TAB_BINARY_HEADER_= IDENTIFIER:=0D continue=0D if UserExtension.GetIdentifier() =3D=3D 'Depex':=0D continue=0D @@ -601,6 +633,8 @@ def GenUserExtensions(ModuleObject): #=0D # @retval Statement: The generated statement for source=0D #=0D +=0D +=0D def GenSourceStatement(SourceFile, Family, FeatureFlag, TagName=3DNone,=0D ToolCode=3DNone, HelpStr=3DNone):=0D Statement =3D ''=0D @@ -632,6 +666,8 @@ def GenSourceStatement(SourceFile, Family, FeatureFlag,= TagName=3DNone, # @param Value: (Target, Family, TagName, Comment)=0D #=0D #=0D +=0D +=0D def GenBinaryStatement(Key, Value, SubTypeGuidValue=3DNone):=0D (FileName, FileType, FFE, SortedArch) =3D Key=0D if SortedArch:=0D @@ -666,11 +702,13 @@ def GenBinaryStatement(Key, Value, SubTypeGuidValue= =3DNone): elif Target:=0D Statement +=3D '|' + Target=0D return Statement=0D -## GenGuidSections=0D +# GenGuidSections=0D #=0D # @param GuidObjList: List of GuidObject=0D # @retVal Content: The generated section contents=0D #=0D +=0D +=0D def GenGuidSections(GuidObjList):=0D #=0D # generate [Guids] section=0D @@ -729,11 +767,13 @@ def GenGuidSections(GuidObjList): =0D return Content=0D =0D -## GenProtocolPPiSections=0D +# GenProtocolPPiSections=0D #=0D # @param ObjList: List of ProtocolObject or Ppi Object=0D # @retVal Content: The generated section contents=0D #=0D +=0D +=0D def GenProtocolPPiSections(ObjList, IsProtocol):=0D Content =3D ''=0D Dict =3D Sdict()=0D @@ -791,9 +831,11 @@ def GenProtocolPPiSections(ObjList, IsProtocol): =0D return Content=0D =0D -## GenPcdSections=0D +# GenPcdSections=0D #=0D #=0D +=0D +=0D def GenPcdSections(ModuleObject):=0D Content =3D ''=0D if not GlobalData.gIS_BINARY_INF:=0D @@ -868,9 +910,11 @@ def GenPcdSections(ModuleObject): =0D return Content=0D =0D -## GenPcdSections=0D +# GenPcdSections=0D #=0D #=0D +=0D +=0D def GenAsBuiltPacthPcdSections(ModuleObject):=0D PatchPcdDict =3D {}=0D for BinaryFile in ModuleObject.GetBinaryFileList():=0D @@ -894,10 +938,11 @@ def GenAsBuiltPacthPcdSections(ModuleObject): if TokenSpaceName =3D=3D '' or PcdCName =3D=3D '':=0D Logger.Error("Upt",=0D ToolError.RESOURCE_NOT_AVAILABLE,=0D - ST.ERR_INSTALL_FILE_DEC_FILE_ERROR % (TokenSp= aceGuidValue, Token),=0D + ST.ERR_INSTALL_FILE_DEC_FILE_ERROR % (=0D + TokenSpaceGuidValue, Token),=0D File=3DModuleObject.GetFullPath())=0D Statement =3D HelpString + TokenSpaceName + '.' + PcdCName + '= | ' + PcdValue + ' | ' + \=0D - PcdOffset + DT.TAB_SPACE_SPLIT=0D + PcdOffset + DT.TAB_SPACE_SPLIT=0D #=0D # Use binary file's Arch to be Pcd's Arch=0D #=0D @@ -919,9 +964,11 @@ def GenAsBuiltPacthPcdSections(ModuleObject): else:=0D PatchPcdDict[Arch] =3D [Statement]=0D return GenSection(DT.TAB_INF_PATCH_PCD, PatchPcdDict)=0D -## GenPcdSections=0D +# GenPcdSections=0D #=0D #=0D +=0D +=0D def GenAsBuiltPcdExSections(ModuleObject):=0D PcdExDict =3D {}=0D for BinaryFile in ModuleObject.GetBinaryFileList():=0D @@ -942,10 +989,12 @@ def GenAsBuiltPcdExSections(ModuleObject): if TokenSpaceName =3D=3D '' or PcdCName =3D=3D '':=0D Logger.Error("Upt",=0D ToolError.RESOURCE_NOT_AVAILABLE,=0D - ST.ERR_INSTALL_FILE_DEC_FILE_ERROR % (TokenSp= aceGuidValue, Token),=0D + ST.ERR_INSTALL_FILE_DEC_FILE_ERROR % (=0D + TokenSpaceGuidValue, Token),=0D File=3DModuleObject.GetFullPath())=0D =0D - Statement =3D HelpString + TokenSpaceName + DT.TAB_SPLIT + Pcd= CName + DT.TAB_SPACE_SPLIT=0D + Statement =3D HelpString + TokenSpaceName + \=0D + DT.TAB_SPLIT + PcdCName + DT.TAB_SPACE_SPLIT=0D =0D #=0D # Use binary file's Arch to be Pcd's Arch=0D @@ -969,9 +1018,11 @@ def GenAsBuiltPcdExSections(ModuleObject): PcdExDict[Arch] =3D [Statement]=0D return GenSection('PcdEx', PcdExDict)=0D =0D -## GenSpecialSections=0D +# GenSpecialSections=0D # generate special sections for Event/BootMode/Hob=0D #=0D +=0D +=0D def GenSpecialSections(ObjectList, SectionName, UserExtensionsContent=3D''= ):=0D #=0D # generate section=0D @@ -1017,13 +1068,15 @@ def GenSpecialSections(ObjectList, SectionName, Use= rExtensionsContent=3D''): SupArch =3D sorted(Obj.GetSupArchList())=0D SortedArch =3D ' '.join(SupArch)=0D if SortedArch in NewSectionDict:=0D - NewSectionDict[SortedArch] =3D NewSectionDict[SortedArch] + [N= ewStateMent]=0D + NewSectionDict[SortedArch] =3D NewSectionDict[SortedArch] + \= =0D + [NewStateMent]=0D else:=0D NewSectionDict[SortedArch] =3D [NewStateMent]=0D SectionContent =3D GenSection(SectionName, NewSectionDict)=0D SectionContent =3D SectionContent.strip()=0D if SectionContent:=0D - Content =3D '# ' + ('\n' + '# ').join(GetSplitValueList(SectionCon= tent, '\n'))=0D + Content =3D '# ' + \=0D + ('\n' + '# ').join(GetSplitValueList(SectionContent, '\n'))=0D Content =3D Content.lstrip()=0D #=0D # add a return to differentiate it between other possible sections=0D @@ -1031,9 +1084,11 @@ def GenSpecialSections(ObjectList, SectionName, User= ExtensionsContent=3D''): if Content:=0D Content +=3D '\n'=0D return Content=0D -## GenBuildOptions=0D +# GenBuildOptions=0D #=0D #=0D +=0D +=0D def GenBuildOptions(ModuleObject):=0D Content =3D ''=0D if not ModuleObject.BinaryModule:=0D @@ -1047,7 +1102,8 @@ def GenBuildOptions(ModuleObject): continue=0D for Arch in BuildOptionDict:=0D if Arch in NewSectionDict:=0D - NewSectionDict[Arch] =3D NewSectionDict[Arch] + [Build= OptionDict[Arch]]=0D + NewSectionDict[Arch] =3D NewSectionDict[Arch] + \=0D + [BuildOptionDict[Arch]]=0D else:=0D NewSectionDict[Arch] =3D [BuildOptionDict[Arch]]=0D Content =3D GenSection('BuildOptions', NewSectionDict)=0D @@ -1076,9 +1132,11 @@ def GenBuildOptions(ModuleObject): Content =3D GenSection('BuildOptions', BuildOptionDict)=0D =0D return Content=0D -## GenBinaries=0D +# GenBinaries=0D #=0D #=0D +=0D +=0D def GenBinaries(ModuleObject):=0D NewSectionDict =3D {}=0D BinariesDict =3D []=0D @@ -1110,7 +1168,8 @@ def GenBinaries(ModuleObject): BinariesDict[Key] =3D []=0D else:=0D if FileType =3D=3D 'SUBTYPE_GUID' and FileNameObj.GetGuidV= alue():=0D - Statement =3D GenBinaryStatement(Key, None, FileNameOb= j.GetGuidValue())=0D + Statement =3D GenBinaryStatement(=0D + Key, None, FileNameObj.GetGuidValue())=0D else:=0D Statement =3D GenBinaryStatement(Key, None)=0D if SortedArch in NewSectionDict:=0D diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py b/B= aseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py index c7146977dc84..7dcea267bf4c 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py @@ -1,4 +1,4 @@ -## @file GenMetaFileMisc.py=0D +# @file GenMetaFileMisc.py=0D #=0D # This file contained the miscellaneous routines for GenMetaFile usage.=0D #=0D @@ -21,57 +21,69 @@ from Parser.DecParser import Dec # @param Arch: string of source file family field=0D # @param ExternList: string of source file FeatureFlag field=0D #=0D +=0D +=0D def AddExternToDefineSec(SectionDict, Arch, ExternList):=0D LeftOffset =3D 31=0D for ArchList, EntryPoint, UnloadImage, Constructor, Destructor, FFE, H= elpStringList in ExternList:=0D if Arch or ArchList:=0D if EntryPoint:=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_ENTRY_POINT).lj= ust(LeftOffset) + u'=3D %s' % EntryPoint=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_ENTRY_POINT).lj= ust(=0D + LeftOffset) + u'=3D %s' % EntryPoint=0D if FFE:=0D Statement +=3D ' | %s' % FFE=0D if len(HelpStringList) > 0:=0D - Statement =3D HelpStringList[0].GetString() + '\n' + S= tatement=0D + Statement =3D HelpStringList[0].GetString(=0D + ) + '\n' + Statement=0D if len(HelpStringList) > 1:=0D Statement =3D Statement + HelpStringList[1].GetString(= )=0D SectionDict[Arch] =3D SectionDict[Arch] + [Statement]=0D =0D if UnloadImage:=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_UNLOAD_IMAGE).l= just(LeftOffset) + u'=3D %s' % UnloadImage=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_UNLOAD_IMAGE).l= just(=0D + LeftOffset) + u'=3D %s' % UnloadImage=0D if FFE:=0D Statement +=3D ' | %s' % FFE=0D =0D if len(HelpStringList) > 0:=0D - Statement =3D HelpStringList[0].GetString() + '\n' + S= tatement=0D + Statement =3D HelpStringList[0].GetString(=0D + ) + '\n' + Statement=0D if len(HelpStringList) > 1:=0D Statement =3D Statement + HelpStringList[1].GetString(= )=0D SectionDict[Arch] =3D SectionDict[Arch] + [Statement]=0D =0D if Constructor:=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_CONSTRUCTOR).lj= ust(LeftOffset) + u'=3D %s' % Constructor=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_CONSTRUCTOR).lj= ust(=0D + LeftOffset) + u'=3D %s' % Constructor=0D if FFE:=0D Statement +=3D ' | %s' % FFE=0D =0D if len(HelpStringList) > 0:=0D - Statement =3D HelpStringList[0].GetString() + '\n' + S= tatement=0D + Statement =3D HelpStringList[0].GetString(=0D + ) + '\n' + Statement=0D if len(HelpStringList) > 1:=0D Statement =3D Statement + HelpStringList[1].GetString(= )=0D SectionDict[Arch] =3D SectionDict[Arch] + [Statement]=0D =0D if Destructor:=0D - Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_DESTRUCTOR).lju= st(LeftOffset) + u'=3D %s' % Destructor=0D + Statement =3D (u'%s ' % DT.TAB_INF_DEFINES_DESTRUCTOR).lju= st(=0D + LeftOffset) + u'=3D %s' % Destructor=0D if FFE:=0D Statement +=3D ' | %s' % FFE=0D =0D if len(HelpStringList) > 0:=0D - Statement =3D HelpStringList[0].GetString() + '\n' + S= tatement=0D + Statement =3D HelpStringList[0].GetString(=0D + ) + '\n' + Statement=0D if len(HelpStringList) > 1:=0D Statement =3D Statement + HelpStringList[1].GetString(= )=0D SectionDict[Arch] =3D SectionDict[Arch] + [Statement]=0D =0D -## ObtainPcdName=0D +# ObtainPcdName=0D #=0D # Using TokenSpaceGuidValue and Token to obtain PcdName from DEC file=0D #=0D +=0D +=0D def ObtainPcdName(Packages, TokenSpaceGuidValue, Token):=0D TokenSpaceGuidName =3D ''=0D PcdCName =3D ''=0D @@ -149,11 +161,13 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue, Toke= n): =0D return TokenSpaceGuidName, PcdCName=0D =0D -## _TransferDict=0D +# _TransferDict=0D # transfer dict that using (Statement, SortedArch) as key,=0D # (GenericComment, UsageComment) as value into a dict that using SortedAr= ch as=0D # key and NewStatement as value=0D #=0D +=0D +=0D def TransferDict(OrigDict, Type=3DNone):=0D NewDict =3D {}=0D LeftOffset =3D 0=0D @@ -175,7 +189,8 @@ def TransferDict(OrigDict, Type=3DNone): NewStateMent =3D Comment + Statement=0D else:=0D if LeftOffset:=0D - NewStateMent =3D Statement.ljust(LeftOffset) + ' ' + Comme= nt.rstrip('\n')=0D + NewStateMent =3D Statement.ljust(=0D + LeftOffset) + ' ' + Comment.rstrip('\n')=0D else:=0D NewStateMent =3D Statement + ' ' + Comment.rstrip('\n')=0D =0D @@ -185,4 +200,3 @@ def TransferDict(OrigDict, Type=3DNone): NewDict[SortedArch] =3D [NewStateMent]=0D =0D return NewDict=0D -=0D diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py b/BaseTo= ols/Source/Python/UPT/GenMetaFile/GenXmlFile.py index 50d79973b948..94fc35b1101f 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py @@ -1,4 +1,4 @@ -## @file GenXmlFile.py=0D +# @file GenXmlFile.py=0D #=0D # This file contained the logical of generate XML files.=0D #=0D diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py b/BaseTool= s/Source/Python/UPT/GenMetaFile/__init__.py index 508c6d060045..1b771c1edf87 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/InstallPkg.py b/BaseTools/Source/P= ython/UPT/InstallPkg.py index e4c7565441ba..576b0ab38358 100644 --- a/BaseTools/Source/Python/UPT/InstallPkg.py +++ b/BaseTools/Source/Python/UPT/InstallPkg.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Install distribution package.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -51,15 +51,17 @@ from Core.PackageFile import CreateDirectory from Core.DependencyRules import DependencyRules=0D from Library import GlobalData=0D =0D -## InstallNewPackage=0D +# InstallNewPackage=0D #=0D # @param WorkspaceDir: Workspace Directory=0D # @param Path: Package Path=0D # @param CustomPath: whether need to customize path at first=0D #=0D -def InstallNewPackage(WorkspaceDir, Path, CustomPath =3D False):=0D +=0D +=0D +def InstallNewPackage(WorkspaceDir, Path, CustomPath=3DFalse):=0D if os.path.isabs(Path):=0D - Logger.Info(ST.MSG_RELATIVE_PATH_ONLY%Path)=0D + Logger.Info(ST.MSG_RELATIVE_PATH_ONLY % Path)=0D elif CustomPath:=0D Logger.Info(ST.MSG_NEW_PKG_PATH)=0D else:=0D @@ -67,7 +69,7 @@ def InstallNewPackage(WorkspaceDir, Path, CustomPath =3D = False): Path =3D os.path.normpath(Path)=0D FullPath =3D os.path.normpath(os.path.join(WorkspaceDir, Path))=0D if os.path.exists(FullPath):=0D - Logger.Info(ST.ERR_DIR_ALREADY_EXIST%FullPath)=0D + Logger.Info(ST.ERR_DIR_ALREADY_EXIST % FullPath)=0D else:=0D return Path=0D =0D @@ -78,22 +80,24 @@ def InstallNewPackage(WorkspaceDir, Path, CustomPath = =3D False): Input =3D Input.replace('\r', '').replace('\n', '')=0D return InstallNewPackage(WorkspaceDir, Input, False)=0D =0D -## InstallNewModule=0D +# InstallNewModule=0D #=0D # @param WorkspaceDir: Workspace Directory=0D # @param Path: Standalone Module Path=0D # @param PathList: The already installed standalone module Path list= =0D #=0D -def InstallNewModule(WorkspaceDir, Path, PathList =3D None):=0D +=0D +=0D +def InstallNewModule(WorkspaceDir, Path, PathList=3DNone):=0D if PathList is None:=0D PathList =3D []=0D Path =3D ConvertPath(Path)=0D Path =3D os.path.normpath(Path)=0D FullPath =3D os.path.normpath(os.path.join(WorkspaceDir, Path))=0D if os.path.exists(FullPath) and FullPath not in PathList:=0D - Logger.Info(ST.ERR_DIR_ALREADY_EXIST%Path)=0D + Logger.Info(ST.ERR_DIR_ALREADY_EXIST % Path)=0D elif Path =3D=3D FullPath:=0D - Logger.Info(ST.MSG_RELATIVE_PATH_ONLY%FullPath)=0D + Logger.Info(ST.MSG_RELATIVE_PATH_ONLY % FullPath)=0D else:=0D return Path=0D =0D @@ -105,7 +109,7 @@ def InstallNewModule(WorkspaceDir, Path, PathList =3D N= one): return InstallNewModule(WorkspaceDir, Input, PathList)=0D =0D =0D -## InstallNewFile=0D +# InstallNewFile=0D #=0D # @param WorkspaceDir: Workspace Direction=0D # @param File: File=0D @@ -113,7 +117,7 @@ def InstallNewModule(WorkspaceDir, Path, PathList =3D N= one): def InstallNewFile(WorkspaceDir, File):=0D FullPath =3D os.path.normpath(os.path.join(WorkspaceDir, File))=0D if os.path.exists(FullPath):=0D - Logger.Info(ST.ERR_FILE_ALREADY_EXIST %File)=0D + Logger.Info(ST.ERR_FILE_ALREADY_EXIST % File)=0D Input =3D stdin.readline()=0D Input =3D Input.replace('\r', '').replace('\n', '')=0D if Input =3D=3D '':=0D @@ -123,10 +127,12 @@ def InstallNewFile(WorkspaceDir, File): else:=0D return File=0D =0D -## UnZipDp=0D +# UnZipDp=0D #=0D # UnZipDp=0D #=0D +=0D +=0D def UnZipDp(WorkspaceDir, DpPkgFileName, Index=3D1):=0D ContentZipFile =3D None=0D Logger.Quiet(ST.MSG_UZIP_PARSE_XML)=0D @@ -134,11 +140,14 @@ def UnZipDp(WorkspaceDir, DpPkgFileName, Index=3D1): =0D DpDescFileName, ContentFileName =3D GetDPFile(DistFile.GetZipFile())=0D =0D - TempDir =3D os.path.normpath(os.path.join(WorkspaceDir, "Conf/.tmp%s" = % str(Index)))=0D + TempDir =3D os.path.normpath(os.path.join(=0D + WorkspaceDir, "Conf/.tmp%s" % str(Index)))=0D GlobalData.gUNPACK_DIR.append(TempDir)=0D - DistPkgFile =3D DistFile.UnpackFile(DpDescFileName, os.path.normpath(o= s.path.join(TempDir, DpDescFileName)))=0D + DistPkgFile =3D DistFile.UnpackFile(=0D + DpDescFileName, os.path.normpath(os.path.join(TempDir, DpDescFileN= ame)))=0D if not DistPkgFile:=0D - Logger.Error("InstallPkg", FILE_NOT_FOUND, ST.ERR_FILE_BROKEN %DpD= escFileName)=0D + Logger.Error("InstallPkg", FILE_NOT_FOUND,=0D + ST.ERR_FILE_BROKEN % DpDescFileName)=0D =0D #=0D # Generate distpkg=0D @@ -153,10 +162,11 @@ def UnZipDp(WorkspaceDir, DpPkgFileName, Index=3D1): #=0D # unzip contents.zip file=0D #=0D - ContentFile =3D DistFile.UnpackFile(ContentFileName, os.path.normpath(= os.path.join(TempDir, ContentFileName)))=0D + ContentFile =3D DistFile.UnpackFile(=0D + ContentFileName, os.path.normpath(os.path.join(TempDir, ContentFil= eName)))=0D if not ContentFile:=0D Logger.Error("InstallPkg", FILE_NOT_FOUND,=0D - ST.ERR_FILE_BROKEN % ContentFileName)=0D + ST.ERR_FILE_BROKEN % ContentFileName)=0D =0D #=0D # Get file size=0D @@ -174,14 +184,16 @@ def UnZipDp(WorkspaceDir, DpPkgFileName, Index=3D1): if DistPkg.Header.Signature !=3D Md5Signature.hexdigest():=0D ContentZipFile.Close()=0D Logger.Error("InstallPkg", FILE_CHECKSUM_FAILURE,=0D - ExtraData=3DContentFile)=0D + ExtraData=3DContentFile)=0D =0D return DistPkg, ContentZipFile, DpPkgFileName, DistFile=0D =0D -## GetPackageList=0D +# GetPackageList=0D #=0D # GetPackageList=0D #=0D +=0D +=0D def GetPackageList(DistPkg, Dep, WorkspaceDir, Options, ContentZipFile, Mo= duleList, PackageList):=0D NewDict =3D Sdict()=0D for Guid, Version, Path in DistPkg.PackageSurfaceArea:=0D @@ -192,9 +204,11 @@ def GetPackageList(DistPkg, Dep, WorkspaceDir, Options= , ContentZipFile, ModuleLi # Logger.Info(ST.WRN_PACKAGE_EXISTED %(Guid, Version))=0D if Options.UseGuidedPkgPath:=0D GuidedPkgPath =3D "%s_%s_%s" % (Package.GetName(), Guid, Versi= on)=0D - NewPackagePath =3D InstallNewPackage(WorkspaceDir, GuidedPkgPa= th, Options.CustomPath)=0D + NewPackagePath =3D InstallNewPackage(=0D + WorkspaceDir, GuidedPkgPath, Options.CustomPath)=0D else:=0D - NewPackagePath =3D InstallNewPackage(WorkspaceDir, PackagePath= , Options.CustomPath)=0D + NewPackagePath =3D InstallNewPackage(=0D + WorkspaceDir, PackagePath, Options.CustomPath)=0D InstallPackageContent(PackagePath, NewPackagePath, Package, Conten= tZipFile, Dep, WorkspaceDir, ModuleList,=0D DistPkg.Header.ReadOnly)=0D PackageList.append(Package)=0D @@ -216,10 +230,12 @@ def GetPackageList(DistPkg, Dep, WorkspaceDir, Option= s, ContentZipFile, ModuleLi =0D return NewDict=0D =0D -## GetModuleList=0D +# GetModuleList=0D #=0D # GetModuleList=0D #=0D +=0D +=0D def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList):= =0D #=0D # ModulePathList will keep track of the standalone module path that=0D @@ -240,16 +256,18 @@ def GetModuleList(DistPkg, Dep, WorkspaceDir, Content= ZipFile, ModuleList): Module =3D DistPkg.ModuleSurfaceArea[Guid, Version, Name, Path]=0D Logger.Info(ST.MSG_INSTALL_MODULE % Module.GetName())=0D if Dep.CheckModuleExists(Guid, Version, Name, Path):=0D - Logger.Quiet(ST.WRN_MODULE_EXISTED %Path)=0D + Logger.Quiet(ST.WRN_MODULE_EXISTED % Path)=0D #=0D # here check for the multiple inf share the same module path cases= :=0D # they should be installed into the same directory=0D #=0D ModuleFullPath =3D \=0D - os.path.normpath(os.path.join(WorkspaceDir, ModulePath))=0D + os.path.normpath(os.path.join(WorkspaceDir, ModulePath))=0D if ModuleFullPath not in ModulePathList:=0D - NewModulePath =3D InstallNewModule(WorkspaceDir, ModulePath, M= odulePathList)=0D - NewModuleFullPath =3D os.path.normpath(os.path.join(WorkspaceD= ir, NewModulePath))=0D + NewModulePath =3D InstallNewModule(=0D + WorkspaceDir, ModulePath, ModulePathList)=0D + NewModuleFullPath =3D os.path.normpath(=0D + os.path.join(WorkspaceDir, NewModulePath))=0D ModulePathList.append(NewModuleFullPath)=0D else:=0D NewModulePath =3D ModulePath=0D @@ -259,7 +277,8 @@ def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZi= pFile, ModuleList): #=0D # Update module=0D #=0D - Module.SetModulePath(Module.GetModulePath().replace(Path, NewModul= ePath, 1))=0D + Module.SetModulePath(=0D + Module.GetModulePath().replace(Path, NewModulePath, 1))=0D =0D NewDict[Guid, Version, Name, Module.GetModulePath()] =3D Module=0D =0D @@ -289,6 +308,8 @@ def GetModuleList(DistPkg, Dep, WorkspaceDir, ContentZi= pFile, ModuleList): ##=0D # Get all protocol/ppi/guid CNames and pcd name from all dependent DEC fil= e=0D #=0D +=0D +=0D def GetDepProtocolPpiGuidPcdNames(DePackageObjList):=0D #=0D # [[Dec1Protocol1, Dec1Protocol2...], [Dec2Protocols...],...]=0D @@ -340,12 +361,13 @@ def GetDepProtocolPpiGuidPcdNames(DePackageObjList): =0D DependentPcdNames.append(PcdNames)=0D =0D -=0D return DependentProtocolCNames, DependentPpiCNames, DependentGuidCName= s, DependentPcdNames=0D =0D ##=0D # Check if protocol CName is redefined=0D #=0D +=0D +=0D def CheckProtoclCNameRedefined(Module, DependentProtocolCNames):=0D for ProtocolInModule in Module.GetProtocolList():=0D IsCNameDefined =3D False=0D @@ -353,15 +375,16 @@ def CheckProtoclCNameRedefined(Module, DependentProto= colCNames): if ProtocolInModule.GetCName() in PackageProtocolCNames:=0D if IsCNameDefined:=0D Logger.Error("\nUPT", FORMAT_INVALID,=0D - File =3D Module.GetFullPath(),=0D - ExtraData =3D \=0D - ST.ERR_INF_PARSER_ITEM_DUPLICATE_IN_DEC %= ProtocolInModule.GetCName())=0D + File=3DModule.GetFullPath(),=0D + ExtraData=3DST.ERR_INF_PARSER_ITEM_DUPLIC= ATE_IN_DEC % ProtocolInModule.GetCName())=0D else:=0D IsCNameDefined =3D True=0D =0D ##=0D # Check if Ppi CName is redefined=0D #=0D +=0D +=0D def CheckPpiCNameRedefined(Module, DependentPpiCNames):=0D for PpiInModule in Module.GetPpiList():=0D IsCNameDefined =3D False=0D @@ -369,14 +392,16 @@ def CheckPpiCNameRedefined(Module, DependentPpiCNames= ): if PpiInModule.GetCName() in PackagePpiCNames:=0D if IsCNameDefined:=0D Logger.Error("\nUPT", FORMAT_INVALID,=0D - File =3D Module.GetFullPath(),=0D - ExtraData =3D ST.ERR_INF_PARSER_ITEM_DUPL= ICATE_IN_DEC % PpiInModule.GetCName())=0D + File=3DModule.GetFullPath(),=0D + ExtraData=3DST.ERR_INF_PARSER_ITEM_DUPLIC= ATE_IN_DEC % PpiInModule.GetCName())=0D else:=0D IsCNameDefined =3D True=0D =0D ##=0D # Check if Guid CName is redefined=0D #=0D +=0D +=0D def CheckGuidCNameRedefined(Module, DependentGuidCNames):=0D for GuidInModule in Module.GetGuidList():=0D IsCNameDefined =3D False=0D @@ -384,15 +409,16 @@ def CheckGuidCNameRedefined(Module, DependentGuidCNam= es): if GuidInModule.GetCName() in PackageGuidCNames:=0D if IsCNameDefined:=0D Logger.Error("\nUPT", FORMAT_INVALID,=0D - File =3D Module.GetFullPath(),=0D - ExtraData =3D \=0D - ST.ERR_INF_PARSER_ITEM_DUPLICATE_IN_DEC %= GuidInModule.GetCName())=0D + File=3DModule.GetFullPath(),=0D + ExtraData=3DST.ERR_INF_PARSER_ITEM_DUPLIC= ATE_IN_DEC % GuidInModule.GetCName())=0D else:=0D IsCNameDefined =3D True=0D =0D ##=0D # Check if PcdName is redefined=0D #=0D +=0D +=0D def CheckPcdNameRedefined(Module, DependentPcdNames):=0D PcdObjs =3D []=0D if not Module.GetBinaryFileList():=0D @@ -403,20 +429,23 @@ def CheckPcdNameRedefined(Module, DependentPcdNames): PcdObjs +=3D AsBuild.GetPatchPcdList() + AsBuild.GetPcdExList(= )=0D =0D for PcdObj in PcdObjs:=0D - PcdName =3D '.'.join([PcdObj.GetTokenSpaceGuidCName(), PcdObj.GetC= Name()])=0D + PcdName =3D '.'.join(=0D + [PcdObj.GetTokenSpaceGuidCName(), PcdObj.GetCName()])=0D IsPcdNameDefined =3D False=0D for PcdNames in DependentPcdNames:=0D if PcdName in PcdNames:=0D if IsPcdNameDefined:=0D Logger.Error("\nUPT", FORMAT_INVALID,=0D - File =3D Module.GetFullPath(),=0D - ExtraData =3D ST.ERR_INF_PARSER_ITEM_DUPL= ICATE_IN_DEC % PcdName)=0D + File=3DModule.GetFullPath(),=0D + ExtraData=3DST.ERR_INF_PARSER_ITEM_DUPLIC= ATE_IN_DEC % PcdName)=0D else:=0D IsPcdNameDefined =3D True=0D =0D ##=0D # Check if any Protocol/Ppi/Guid and Pcd name is redefined in its dependen= t DEC files=0D #=0D +=0D +=0D def CheckCNameInModuleRedefined(Module, DistPkg):=0D DePackageObjList =3D []=0D #=0D @@ -431,18 +460,20 @@ def CheckCNameInModuleRedefined(Module, DistPkg): DePackageObjList.append(DistPkg.PackageSurfaceArea[Key= ])=0D =0D DependentProtocolCNames, DependentPpiCNames, DependentGuidCNames, Depe= ndentPcdNames =3D \=0D - GetDepProtocolPpiGuidPcdNames(DePackageObjList)=0D + GetDepProtocolPpiGuidPcdNames(DePackageObjList)=0D =0D CheckProtoclCNameRedefined(Module, DependentProtocolCNames)=0D CheckPpiCNameRedefined(Module, DependentPpiCNames)=0D CheckGuidCNameRedefined(Module, DependentGuidCNames)=0D CheckPcdNameRedefined(Module, DependentPcdNames)=0D =0D -## GenToolMisc=0D +# GenToolMisc=0D #=0D # GenToolMisc=0D #=0D #=0D +=0D +=0D def GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile):=0D ToolObject =3D DistPkg.Tools=0D MiscObject =3D DistPkg.MiscellaneousFiles=0D @@ -473,20 +504,21 @@ def GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile= ): File =3D ConvertPath(FileObject.GetURI())=0D ToFile =3D os.path.normpath(os.path.join(RootDir, File))=0D if os.path.exists(ToFile):=0D - Logger.Info( ST.WRN_FILE_EXISTED % ToFile )=0D + Logger.Info(ST.WRN_FILE_EXISTED % ToFile)=0D #=0D # ask for user input the new file name=0D #=0D - Logger.Info( ST.MSG_NEW_FILE_NAME)=0D + Logger.Info(ST.MSG_NEW_FILE_NAME)=0D Input =3D stdin.readline()=0D Input =3D Input.replace('\r', '').replace('\n', '')=0D OrigPath =3D os.path.split(ToFile)[0]=0D ToFile =3D os.path.normpath(os.path.join(OrigPath, Input))=0D FromFile =3D os.path.join(FileObject.GetURI())=0D - Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, DistPkg.H= eader.ReadOnly, FileObject.GetExecutable())=0D + Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile,=0D + DistPkg.Header.ReadOnly, FileObject.GetExecut= able())=0D DistPkg.FileList.append((ToFile, Md5Sum))=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -494,12 +526,15 @@ def GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile= ): #=0D # @param Options: command Options=0D #=0D -def Main(Options =3D None):=0D +=0D +=0D +def Main(Options=3DNone):=0D try:=0D DataBase =3D GlobalData.gDB=0D WorkspaceDir =3D GlobalData.gWORKSPACE=0D if not Options.PackageFile:=0D - Logger.Error("InstallPkg", OPTION_MISSING, ExtraData=3DST.ERR_= SPECIFY_PACKAGE)=0D + Logger.Error("InstallPkg", OPTION_MISSING,=0D + ExtraData=3DST.ERR_SPECIFY_PACKAGE)=0D =0D # Get all Dist Info=0D DistInfoList =3D []=0D @@ -509,7 +544,8 @@ def Main(Options =3D None): #=0D # unzip dist.pkg file=0D #=0D - DistInfoList.append(UnZipDp(WorkspaceDir, ToBeInstalledDist, I= ndex))=0D + DistInfoList.append(=0D + UnZipDp(WorkspaceDir, ToBeInstalledDist, Index))=0D DistPkgList.append(DistInfoList[-1][0])=0D Index +=3D 1=0D =0D @@ -534,24 +570,26 @@ def Main(Options =3D None): except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D =0D except KeyboardInterrupt:=0D ReturnCode =3D ABORT_ERROR=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D =0D except:=0D ReturnCode =3D CODE_ERROR=0D Logger.Error(=0D - "\nInstallPkg",=0D - CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.PackageFile= ,=0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D + "\nInstallPkg",=0D + CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.PackageFile,=0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),=0D - platform) + format_exc())=0D + platform) + format_exc())=0D finally:=0D Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)=0D for ToBeInstalledDist in DistInfoList:=0D @@ -578,6 +616,8 @@ def Main(Options =3D None): # @param WorkspaceDir: The workspace directory=0D # @retval NewDpPkgFileName: The exact backup file name=0D #=0D +=0D +=0D def BackupDist(DpPkgFileName, Guid, Version, WorkspaceDir):=0D DistFileName =3D os.path.split(DpPkgFileName)[1]=0D DestDir =3D os.path.normpath(os.path.join(WorkspaceDir, GlobalData.gUP= T_DIR))=0D @@ -591,7 +631,7 @@ def BackupDist(DpPkgFileName, Guid, Version, WorkspaceD= ir): #=0D # ask for user input the new file name=0D #=0D - Logger.Info( ST.MSG_NEW_FILE_NAME_FOR_DIST)=0D + Logger.Info(ST.MSG_NEW_FILE_NAME_FOR_DIST)=0D Input =3D stdin.readline()=0D Input =3D Input.replace('\r', '').replace('\n', '')=0D DestFile =3D os.path.normpath(os.path.join(DestDir, Input))=0D @@ -599,19 +639,21 @@ def BackupDist(DpPkgFileName, Guid, Version, Workspac= eDir): NewDpPkgFileName =3D DestFile[DestFile.find(DestDir) + len(DestDir) + = 1:]=0D return NewDpPkgFileName=0D =0D -## CheckInstallDpx method=0D +# CheckInstallDpx method=0D #=0D # check whether distribution could be installed=0D #=0D # @param Dep: the DependencyRules instance that used to check dependenc= y=0D # @param DistPkg: the distribution object=0D #=0D +=0D +=0D def CheckInstallDpx(Dep, DistPkg, DistPkgFileName):=0D #=0D # Check distribution package installed or not=0D #=0D if Dep.CheckDpExists(DistPkg.Header.GetGuid(),=0D - DistPkg.Header.GetVersion()):=0D + DistPkg.Header.GetVersion()):=0D Logger.Error("InstallPkg",=0D UPT_ALREADY_INSTALLED_ERROR,=0D ST.WRN_DIST_PKG_INSTALLED % os.path.basename(DistPkgF= ileName))=0D @@ -621,10 +663,10 @@ def CheckInstallDpx(Dep, DistPkg, DistPkgFileName): #=0D if not Dep.CheckInstallDpDepexSatisfied(DistPkg):=0D Logger.Error("InstallPkg", UNKNOWN_ERROR,=0D - ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY,=0D - ExtraData=3DDistPkg.Header.Name)=0D + ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY,=0D + ExtraData=3DDistPkg.Header.Name)=0D =0D -## InstallModuleContent method=0D +# InstallModuleContent method=0D #=0D # If this is standalone module, then Package should be none,=0D # ModulePath should be ''=0D @@ -637,19 +679,22 @@ def CheckInstallDpx(Dep, DistPkg, DistPkgFileName): # @param ModuleList: ModuleList=0D # @param Package: Package=0D #=0D +=0D +=0D def InstallModuleContent(FromPath, NewPath, ModulePath, Module, ContentZip= File,=0D - WorkspaceDir, ModuleList, Package =3D None, ReadOnly =3D False):=0D + WorkspaceDir, ModuleList, Package=3DNone, ReadOnl= y=3DFalse):=0D =0D if NewPath.startswith("\\") or NewPath.startswith("/"):=0D NewPath =3D NewPath[1:]=0D =0D if not IsValidInstallPath(NewPath):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%NewP= ath)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % NewPath)=0D =0D NewModuleFullPath =3D os.path.normpath(os.path.join(WorkspaceDir, NewP= ath,=0D - ConvertPath(ModulePath)))=0D + ConvertPath(ModulePa= th)))=0D Module.SetFullPath(os.path.normpath(os.path.join(NewModuleFullPath,=0D - ConvertPath(Module.GetName()) + '.inf')))=0D + ConvertPath(Module.Ge= tName()) + '.inf')))=0D Module.FileList =3D []=0D =0D for MiscFile in Module.GetMiscFileList():=0D @@ -661,12 +706,15 @@ def InstallModuleContent(FromPath, NewPath, ModulePat= h, Module, ContentZipFile, File =3D File[1:]=0D =0D if not IsValidInstallPath(File):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVAL= IDE%File)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % File)=0D =0D FromFile =3D os.path.join(FromPath, ModulePath, File)=0D Executable =3D Item.GetExecutable()=0D - ToFile =3D os.path.normpath(os.path.join(NewModuleFullPath, Co= nvertPath(File)))=0D - Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, ReadO= nly, Executable)=0D + ToFile =3D os.path.normpath(os.path.join(=0D + NewModuleFullPath, ConvertPath(File)))=0D + Md5Sum =3D InstallFile(ContentZipFile, FromFile,=0D + ToFile, ReadOnly, Executable)=0D if Package and ((ToFile, Md5Sum) not in Package.FileList):=0D Package.FileList.append((ToFile, Md5Sum))=0D elif Package:=0D @@ -679,10 +727,12 @@ def InstallModuleContent(FromPath, NewPath, ModulePat= h, Module, ContentZipFile, File =3D File[1:]=0D =0D if not IsValidInstallPath(File):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%= File)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % File)=0D =0D FromFile =3D os.path.join(FromPath, ModulePath, File)=0D - ToFile =3D os.path.normpath(os.path.join(NewModuleFullPath, Conver= tPath(File)))=0D + ToFile =3D os.path.normpath(os.path.join(=0D + NewModuleFullPath, ConvertPath(File)))=0D Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)= =0D if Package and ((ToFile, Md5Sum) not in Package.FileList):=0D Package.FileList.append((ToFile, Md5Sum))=0D @@ -698,10 +748,12 @@ def InstallModuleContent(FromPath, NewPath, ModulePat= h, Module, ContentZipFile, File =3D File[1:]=0D =0D if not IsValidInstallPath(File):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVAL= IDE%File)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % File)=0D =0D FromFile =3D os.path.join(FromPath, ModulePath, File)=0D - ToFile =3D os.path.normpath(os.path.join(NewModuleFullPath, Co= nvertPath(File)))=0D + ToFile =3D os.path.normpath(os.path.join(=0D + NewModuleFullPath, ConvertPath(File)))=0D Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, ReadO= nly)=0D if Package and ((ToFile, Md5Sum) not in Package.FileList):=0D Package.FileList.append((ToFile, Md5Sum))=0D @@ -713,10 +765,12 @@ def InstallModuleContent(FromPath, NewPath, ModulePat= h, Module, ContentZipFile, InstallModuleContentZipFile(ContentZipFile, FromPath, ModulePath, Work= spaceDir, NewPath, Module, Package, ReadOnly,=0D ModuleList)=0D =0D -## InstallModuleContentZipFile=0D +# InstallModuleContentZipFile=0D #=0D # InstallModuleContentZipFile=0D #=0D +=0D +=0D def InstallModuleContentZipFile(ContentZipFile, FromPath, ModulePath, Work= spaceDir, NewPath, Module, Package, ReadOnly,=0D ModuleList):=0D #=0D @@ -731,11 +785,12 @@ def InstallModuleContentZipFile(ContentZipFile, FromP= ath, ModulePath, WorkspaceD FileName =3D FileName[1:]=0D =0D if not IsValidInstallPath(FileName):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_I= NVALIDE%FileName)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % FileName)=0D =0D FromFile =3D FileName=0D ToFile =3D os.path.normpath(os.path.join(WorkspaceDir,=0D - ConvertPath(FileName.replace(FromPath, NewPath, 1)= )))=0D + ConvertPath(FileNam= e.replace(FromPath, NewPath, 1))))=0D CheckList =3D copy.copy(Module.FileList)=0D if Package:=0D CheckList +=3D Package.FileList=0D @@ -743,7 +798,8 @@ def InstallModuleContentZipFile(ContentZipFile, FromPat= h, ModulePath, WorkspaceD if Item[0] =3D=3D ToFile:=0D break=0D else:=0D - Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFil= e, ReadOnly)=0D + Md5Sum =3D InstallFile(=0D + ContentZipFile, FromFile, ToFile, ReadOnly)=0D if Package and ((ToFile, Md5Sum) not in Package.FileLi= st):=0D Package.FileList.append((ToFile, Md5Sum))=0D elif Package:=0D @@ -753,13 +809,15 @@ def InstallModuleContentZipFile(ContentZipFile, FromP= ath, ModulePath, WorkspaceD =0D ModuleList.append((Module, Package))=0D =0D -## FileUnderPath=0D +# FileUnderPath=0D # Check whether FileName started with directory specified by CheckPath=0D #=0D # @param FileName: the FileName need to be checked=0D # @param CheckPath: the path need to be checked against=0D # @return: True or False=0D #=0D +=0D +=0D def FileUnderPath(FileName, CheckPath):=0D FileName =3D FileName.replace('\\', '/')=0D FileName =3D os.path.normpath(FileName)=0D @@ -774,35 +832,40 @@ def FileUnderPath(FileName, CheckPath): =0D return False=0D =0D -## InstallFile=0D +# InstallFile=0D # Extract File from Zipfile, set file attribute, and return the Md5Sum=0D #=0D # @return: True or False=0D #=0D +=0D +=0D def InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly, Executable=3DF= alse):=0D if os.path.exists(os.path.normpath(ToFile)):=0D pass=0D else:=0D if not ContentZipFile or not ContentZipFile.UnpackFile(FromFile, T= oFile):=0D - Logger.Error("UPT", FILE_NOT_FOUND, ST.ERR_INSTALL_FILE_FROM_E= MPTY_CONTENT % FromFile)=0D + Logger.Error("UPT", FILE_NOT_FOUND,=0D + ST.ERR_INSTALL_FILE_FROM_EMPTY_CONTENT % FromFile= )=0D =0D if ReadOnly:=0D if not Executable:=0D chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)= =0D else:=0D - chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |= stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)=0D + chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |= =0D + stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)=0D elif Executable:=0D chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | sta= t.S_IWUSR | stat.S_IWGRP |=0D stat.S_IWOTH | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOT= H)=0D else:=0D - chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | sta= t.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)=0D + chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |=0D + stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)=0D =0D Md5Signature =3D md5(__FileHookOpen__(str(ToFile), 'rb').read())=0D Md5Sum =3D Md5Signature.hexdigest()=0D =0D return Md5Sum=0D =0D -## InstallPackageContent method=0D +# InstallPackageContent method=0D #=0D # @param FromPath: FromPath=0D # @param ToPath: ToPath=0D @@ -812,8 +875,10 @@ def InstallFile(ContentZipFile, FromFile, ToFile, Read= Only, Executable=3DFalse): # @param WorkspaceDir: WorkspaceDir=0D # @param ModuleList: ModuleList=0D #=0D +=0D +=0D def InstallPackageContent(FromPath, ToPath, Package, ContentZipFile, Dep,= =0D - WorkspaceDir, ModuleList, ReadOnly =3D False):=0D + WorkspaceDir, ModuleList, ReadOnly=3DFalse):=0D if Dep:=0D pass=0D Package.FileList =3D []=0D @@ -822,13 +887,14 @@ def InstallPackageContent(FromPath, ToPath, Package, = ContentZipFile, Dep, ToPath =3D ToPath[1:]=0D =0D if not IsValidInstallPath(ToPath):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%ToPa= th)=0D + Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE % To= Path)=0D =0D if FromPath.startswith("\\") or FromPath.startswith("/"):=0D FromPath =3D FromPath[1:]=0D =0D if not IsValidInstallPath(FromPath):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%From= Path)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % FromPath)=0D =0D PackageFullPath =3D os.path.normpath(os.path.join(WorkspaceDir, ToPath= ))=0D for MiscFile in Package.GetMiscFileList():=0D @@ -838,12 +904,14 @@ def InstallPackageContent(FromPath, ToPath, Package, = ContentZipFile, Dep, FileName =3D FileName[1:]=0D =0D if not IsValidInstallPath(FileName):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVAL= IDE%FileName)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % FileName)=0D =0D FromFile =3D os.path.join(FromPath, FileName)=0D Executable =3D Item.GetExecutable()=0D - ToFile =3D (os.path.join(PackageFullPath, ConvertPath(FileNam= e)))=0D - Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, ReadO= nly, Executable)=0D + ToFile =3D (os.path.join(PackageFullPath, ConvertPath(FileName= )))=0D + Md5Sum =3D InstallFile(ContentZipFile, FromFile,=0D + ToFile, ReadOnly, Executable)=0D if (ToFile, Md5Sum) not in Package.FileList:=0D Package.FileList.append((ToFile, Md5Sum))=0D PackageIncludeArchList =3D []=0D @@ -853,23 +921,27 @@ def InstallPackageContent(FromPath, ToPath, Package, = ContentZipFile, Dep, FileName =3D FileName[1:]=0D =0D if not IsValidInstallPath(FileName):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%= FileName)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % FileName)=0D =0D FromFile =3D os.path.join(FromPath, FileName)=0D - ToFile =3D os.path.normpath(os.path.join(PackageFullPath, ConvertP= ath(FileName)))=0D + ToFile =3D os.path.normpath(os.path.join(=0D + PackageFullPath, ConvertPath(FileName)))=0D RetFile =3D ContentZipFile.UnpackFile(FromFile, ToFile)=0D if RetFile =3D=3D '':=0D #=0D # a non-exist path in Zipfile will return '', which means an i= nclude directory in our case=0D # save the information for later DEC creation usage and also c= reate the directory=0D #=0D - PackageIncludeArchList.append([Item.GetFilePath(), Item.GetSup= ArchList()])=0D + PackageIncludeArchList.append(=0D + [Item.GetFilePath(), Item.GetSupArchList()])=0D CreateDirectory(ToFile)=0D continue=0D if ReadOnly:=0D - chmod(ToFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH)=0D + chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)=0D else:=0D - chmod(ToFile, stat.S_IRUSR|stat.S_IRGRP|stat.S_IROTH|stat.S_IW= USR|stat.S_IWGRP|stat.S_IWOTH)=0D + chmod(ToFile, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |=0D + stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)=0D Md5Signature =3D md5(__FileHookOpen__(str(ToFile), 'rb').read())=0D Md5Sum =3D Md5Signature.hexdigest()=0D if (ToFile, Md5Sum) not in Package.FileList:=0D @@ -882,10 +954,12 @@ def InstallPackageContent(FromPath, ToPath, Package, = ContentZipFile, Dep, FileName =3D FileName[1:]=0D =0D if not IsValidInstallPath(FileName):=0D - Logger.Error("UPT", FORMAT_INVALID, ST.ERR_FILE_NAME_INVALIDE%= FileName)=0D + Logger.Error("UPT", FORMAT_INVALID,=0D + ST.ERR_FILE_NAME_INVALIDE % FileName)=0D =0D FromFile =3D os.path.join(FromPath, FileName)=0D - ToFile =3D os.path.normpath(os.path.join(PackageFullPath, ConvertP= ath(FileName)))=0D + ToFile =3D os.path.normpath(os.path.join(=0D + PackageFullPath, ConvertPath(FileName)))=0D Md5Sum =3D InstallFile(ContentZipFile, FromFile, ToFile, ReadOnly)= =0D if (ToFile, Md5Sum) not in Package.FileList:=0D Package.FileList.append((ToFile, Md5Sum))=0D @@ -894,9 +968,9 @@ def InstallPackageContent(FromPath, ToPath, Package, Co= ntentZipFile, Dep, # Update package=0D #=0D Package.SetPackagePath(Package.GetPackagePath().replace(FromPath,=0D - ToPath, 1))=0D + ToPath, 1))=0D Package.SetFullPath(os.path.normpath(os.path.join(PackageFullPath,=0D - ConvertPath(Package.GetName()) + '.dec')))=0D + ConvertPath(Package.= GetName()) + '.dec')))=0D =0D #=0D # Install files in module=0D @@ -906,12 +980,14 @@ def InstallPackageContent(FromPath, ToPath, Package, = ContentZipFile, Dep, for ModuleGuid, ModuleVersion, ModuleName, ModulePath in ModuleDict:=0D Module =3D ModuleDict[ModuleGuid, ModuleVersion, ModuleName, Modul= ePath]=0D InstallModuleContent(FromPath, ToPath, ModulePath, Module,=0D - ContentZipFile, WorkspaceDir, ModuleList, Package, ReadOnly)=0D + ContentZipFile, WorkspaceDir, ModuleList, Pac= kage, ReadOnly)=0D =0D -## GetDPFile method=0D +# GetDPFile method=0D #=0D # @param ZipFile: A ZipFile=0D #=0D +=0D +=0D def GetDPFile(ZipFile):=0D ContentFile =3D ''=0D DescFile =3D ''=0D @@ -928,16 +1004,18 @@ def GetDPFile(ZipFile): continue=0D =0D Logger.Error("PackagingTool", FILE_TYPE_MISMATCH,=0D - ExtraData=3DST.ERR_DIST_FILE_TOOMANY)=0D + ExtraData=3DST.ERR_DIST_FILE_TOOMANY)=0D if not DescFile or not ContentFile:=0D Logger.Error("PackagingTool", FILE_UNKNOWN_ERROR,=0D - ExtraData=3DST.ERR_DIST_FILE_TOOFEW)=0D + ExtraData=3DST.ERR_DIST_FILE_TOOFEW)=0D return DescFile, ContentFile=0D =0D -## InstallDp method=0D +# InstallDp method=0D #=0D # Install the distribution to current workspace=0D #=0D +=0D +=0D def InstallDp(DistPkg, DpPkgFileName, ContentZipFile, Options, Dep, Worksp= aceDir, DataBase):=0D #=0D # PackageList, ModuleList record the information for the meta-data=0D @@ -948,7 +1026,8 @@ def InstallDp(DistPkg, DpPkgFileName, ContentZipFile, = Options, Dep, WorkspaceDir DistPkg.PackageSurfaceArea =3D GetPackageList(DistPkg, Dep, WorkspaceD= ir, Options,=0D ContentZipFile, ModuleList= , PackageList)=0D =0D - DistPkg.ModuleSurfaceArea =3D GetModuleList(DistPkg, Dep, WorkspaceDir= , ContentZipFile, ModuleList)=0D + DistPkg.ModuleSurfaceArea =3D GetModuleList(=0D + DistPkg, Dep, WorkspaceDir, ContentZipFile, ModuleList)=0D =0D GenToolMisc(DistPkg, WorkspaceDir, ContentZipFile)=0D =0D @@ -956,12 +1035,12 @@ def InstallDp(DistPkg, DpPkgFileName, ContentZipFile= , Options, Dep, WorkspaceDir # copy "Distribution File" to directory $(WORKSPACE)/conf/upt=0D #=0D DistFileName =3D os.path.split(DpPkgFileName)[1]=0D - NewDpPkgFileName =3D BackupDist(DpPkgFileName, DistPkg.Header.GetGuid(= ), DistPkg.Header.GetVersion(), WorkspaceDir)=0D + NewDpPkgFileName =3D BackupDist(DpPkgFileName, DistPkg.Header.GetGuid(= =0D + ), DistPkg.Header.GetVersion(), WorkspaceDir)=0D =0D #=0D # update database=0D #=0D Logger.Quiet(ST.MSG_UPDATE_PACKAGE_DATABASE)=0D DataBase.AddDPObject(DistPkg, NewDpPkgFileName, DistFileName,=0D - DistPkg.Header.RePackage)=0D -=0D + DistPkg.Header.RePackage)=0D diff --git a/BaseTools/Source/Python/UPT/InventoryWs.py b/BaseTools/Source/= Python/UPT/InventoryWs.py index 955b2e510eb2..438af59454b5 100644 --- a/BaseTools/Source/Python/UPT/InventoryWs.py +++ b/BaseTools/Source/Python/UPT/InventoryWs.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Inventory workspace's distribution package information.=0D #=0D # Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,12 +23,14 @@ import Logger.Log as Logger =0D from Library import GlobalData=0D =0D -## InventoryDistInstalled=0D +# InventoryDistInstalled=0D #=0D # This method retrieves the installed distribution information from the in= ternal UPT database=0D #=0D # @param DataBase: the UPT database=0D #=0D +=0D +=0D def InventoryDistInstalled(DataBase):=0D DistInstalled =3D DataBase.InventoryDistInstalled()=0D =0D @@ -47,7 +49,8 @@ def InventoryDistInstalled(DataBase): for (DpGuid, DpVersion, DpOriginalName, DpAliasFileName) in DistInstal= led:=0D MaxGuidlen =3D max(MaxGuidlen, len(DpGuid))=0D MaxVerlen =3D max(MaxVerlen, len(DpVersion))=0D - MaxDpAliasFileNameLen =3D max(MaxDpAliasFileNameLen, len(DpAliasFi= leName))=0D + MaxDpAliasFileNameLen =3D max(=0D + MaxDpAliasFileNameLen, len(DpAliasFileName))=0D MaxDpOrigFileNamelen =3D max(MaxDpOrigFileNamelen, len(DpOriginalN= ame))=0D =0D OutMsgFmt =3D "%-*s\t%-*s\t%-*s\t%-s"=0D @@ -62,15 +65,15 @@ def InventoryDistInstalled(DataBase): =0D for (DpGuid, DpVersion, DpFileName, DpAliasFileName) in DistInstalled:= =0D OutMsg =3D OutMsgFmt % (MaxDpAliasFileNameLen,=0D - DpAliasFileName,=0D - MaxGuidlen,=0D - DpGuid,=0D - MaxVerlen,=0D - DpVersion,=0D - DpFileName)=0D + DpAliasFileName,=0D + MaxGuidlen,=0D + DpGuid,=0D + MaxVerlen,=0D + DpVersion,=0D + DpFileName)=0D Logger.Info(OutMsg)=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -78,7 +81,9 @@ def InventoryDistInstalled(DataBase): #=0D # @param Options: command Options=0D #=0D -def Main(Options =3D None):=0D +=0D +=0D +def Main(Options=3DNone):=0D if Options:=0D pass=0D =0D @@ -89,21 +94,23 @@ def Main(Options =3D None): except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D except KeyboardInterrupt:=0D ReturnCode =3D ABORT_ERROR=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D except:=0D ReturnCode =3D CODE_ERROR=0D Logger.Error("\nInventoryWs",=0D - CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_INVENTORYWS_ERR,=0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D + CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_INVENTORYWS_ERR,=0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAI= L_ADDR,=0D + RaiseError=3DFalse=0D + )=0D Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),=0D - platform) + format_exc())=0D + platform) + format_exc())=0D =0D if ReturnCode =3D=3D 0:=0D Logger.Quiet(ST.MSG_FINISH)=0D diff --git a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py b/Bas= eTools/Source/Python/UPT/Library/CommentGenerating.py index bded508f565a..2666a8c4e9aa 100644 --- a/BaseTools/Source/Python/UPT/Library/CommentGenerating.py +++ b/BaseTools/Source/Python/UPT/Library/CommentGenerating.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define comment generating interface=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -30,33 +30,38 @@ from Library.DataType import TAB_STAR from Library.DataType import TAB_PCD_PROMPT=0D from Library.UniClassObject import ConvertSpecialUnicodes=0D from Library.Misc import GetLocalValue=0D -## GenTailCommentLines=0D +# GenTailCommentLines=0D #=0D # @param TailCommentLines: the tail comment lines that need to be generat= ed=0D # @param LeadingSpaceNum: the number of leading space needed for non-fir= st=0D # line tail comment=0D #=0D -def GenTailCommentLines (TailCommentLines, LeadingSpaceNum =3D 0):=0D +=0D +=0D +def GenTailCommentLines(TailCommentLines, LeadingSpaceNum=3D0):=0D TailCommentLines =3D TailCommentLines.rstrip(END_OF_LINE)=0D CommentStr =3D TAB_SPACE_SPLIT*2 + TAB_SPECIAL_COMMENT + TAB_SPACE_SPL= IT + \=0D - (END_OF_LINE + LeadingSpaceNum * TAB_SPACE_SPLIT + TAB_SPACE_SPLIT*2 += TAB_SPECIAL_COMMENT + \=0D - TAB_SPACE_SPLIT).join(GetSplitValueList(TailCommentLines, END_OF_LINE= ))=0D + (END_OF_LINE + LeadingSpaceNum * TAB_SPACE_SPLIT + TAB_SPACE_SPLIT= *2 + TAB_SPECIAL_COMMENT +=0D + TAB_SPACE_SPLIT).join(GetSplitValueList(TailCommentLines, END_OF_= LINE))=0D =0D return CommentStr=0D =0D -## GenGenericComment=0D +# GenGenericComment=0D #=0D # @param CommentLines: Generic comment Text, maybe Multiple Lines=0D #=0D -def GenGenericComment (CommentLines):=0D +=0D +=0D +def GenGenericComment(CommentLines):=0D if not CommentLines:=0D return ''=0D CommentLines =3D CommentLines.rstrip(END_OF_LINE)=0D - CommentStr =3D TAB_SPECIAL_COMMENT + TAB_SPACE_SPLIT + (END_OF_LINE + = TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT).join\=0D - (GetSplitValueList(CommentLines, END_OF_LINE)) + END_OF_LINE=0D + CommentStr =3D TAB_SPECIAL_COMMENT + TAB_SPACE_SPLIT + \=0D + (END_OF_LINE + TAB_COMMENT_SPLIT + TAB_SPACE_SPLIT).join(=0D + GetSplitValueList(CommentLines, END_OF_LINE)) + END_OF_LINE=0D return CommentStr=0D =0D -## GenGenericCommentF=0D +# GenGenericCommentF=0D #=0D # similar to GenGenericComment but will remove at end of comment on= ce,=0D # and for line with only , '#\n' will be generated instead of '# \n'= =0D @@ -64,7 +69,9 @@ def GenGenericComment (CommentLines): # @param CommentLines: Generic comment Text, maybe Multiple Lines=0D # @return CommentStr: Generated comment line=0D #=0D -def GenGenericCommentF (CommentLines, NumOfPound=3D1, IsPrompt=3DFalse, Is= InfLibraryClass=3DFalse):=0D +=0D +=0D +def GenGenericCommentF(CommentLines, NumOfPound=3D1, IsPrompt=3DFalse, IsI= nfLibraryClass=3DFalse):=0D if not CommentLines:=0D return ''=0D #=0D @@ -76,7 +83,7 @@ def GenGenericCommentF (CommentLines, NumOfPound=3D1, IsP= rompt=3DFalse, IsInfLibrary CommentStr =3D ''=0D if IsPrompt:=0D CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + TAB_SPACE_SPLIT += TAB_PCD_PROMPT + TAB_SPACE_SPLIT + \=0D - CommentLines.replace(END_OF_LINE, '') + END_OF_LINE=0D + CommentLines.replace(END_OF_LINE, '') + END_OF_LINE=0D else:=0D CommentLineList =3D GetSplitValueList(CommentLines, END_OF_LINE)=0D FindLibraryClass =3D False=0D @@ -93,16 +100,19 @@ def GenGenericCommentF (CommentLines, NumOfPound=3D1, = IsPrompt=3DFalse, IsInfLibrary CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + END_OF_LI= NE=0D else:=0D if FindLibraryClass and Line.find(u'@libraryclass ') > -1:= =0D - CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + TAB_S= PACE_SPLIT + Line + END_OF_LINE=0D + CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + \=0D + TAB_SPACE_SPLIT + Line + END_OF_LINE=0D elif FindLibraryClass:=0D - CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + TAB_S= PACE_SPLIT * 16 + Line + END_OF_LINE=0D + CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + \=0D + TAB_SPACE_SPLIT * 16 + Line + END_OF_LINE=0D else:=0D - CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + TAB_S= PACE_SPLIT + Line + END_OF_LINE=0D + CommentStr +=3D TAB_COMMENT_SPLIT * NumOfPound + \=0D + TAB_SPACE_SPLIT + Line + END_OF_LINE=0D =0D return CommentStr=0D =0D =0D -## GenHeaderCommentSection=0D +# GenHeaderCommentSection=0D #=0D # Generate Header comment sections=0D #=0D @@ -111,7 +121,7 @@ def GenGenericCommentF (CommentLines, NumOfPound=3D1, I= sPrompt=3DFalse, IsInfLibrary # @param Copyright possible multiple copyright lines=0D # @param License possible multiple license lines=0D #=0D -def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsB= inaryHeader=3DFalse, \=0D +def GenHeaderCommentSection(Abstract, Description, Copyright, License, IsB= inaryHeader=3DFalse,=0D CommChar=3DTAB_COMMENT_SPLIT):=0D Content =3D ''=0D =0D @@ -124,21 +134,21 @@ def GenHeaderCommentSection(Abstract, Description, Co= pyright, License, IsBinaryH Content +=3D CommChar * 2 + TAB_SPACE_SPLIT + TAB_BINARY_HEADER_CO= MMENT + '\r\n'=0D elif CommChar =3D=3D TAB_COMMENT_EDK1_SPLIT:=0D Content +=3D CommChar + TAB_SPACE_SPLIT + TAB_COMMENT_EDK1_START += TAB_STAR + TAB_SPACE_SPLIT +\=0D - TAB_HEADER_COMMENT + '\r\n'=0D + TAB_HEADER_COMMENT + '\r\n'=0D else:=0D Content +=3D CommChar * 2 + TAB_SPACE_SPLIT + TAB_HEADER_COMMENT += '\r\n'=0D if Abstract:=0D Abstract =3D Abstract.rstrip('\r\n')=0D - Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList\=0D - = (Abstract, '\n'))=0D + Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList=0D + = (Abstract, '\n'))=0D Content +=3D '\r\n' + CommChar + '\r\n'=0D else:=0D Content +=3D CommChar + '\r\n'=0D =0D if Description:=0D Description =3D Description.rstrip('\r\n')=0D - Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList\=0D - (Description, '\n'))=0D + Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList=0D + = (Description, '\n'))=0D Content +=3D '\r\n' + CommChar + '\r\n'=0D =0D #=0D @@ -146,14 +156,14 @@ def GenHeaderCommentSection(Abstract, Description, Co= pyright, License, IsBinaryH #=0D if Copyright:=0D Copyright =3D Copyright.rstrip('\r\n')=0D - Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join\=0D - (GetSplitValueList(Copyright, '\n'))=0D + Content +=3D CommChar + TAB_SPACE_SPLIT + \=0D + ('\r\n' + CommChar + TAB_SPACE_SPLIT).join(GetSplitValueList(C= opyright, '\n'))=0D Content +=3D '\r\n' + CommChar + '\r\n'=0D =0D if License:=0D License =3D License.rstrip('\r\n')=0D - Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList\=0D - (License, '\n'))=0D + Content +=3D CommChar + TAB_SPACE_SPLIT + ('\r\n' + CommChar + TAB= _SPACE_SPLIT).join(GetSplitValueList=0D + = (License, '\n'))=0D Content +=3D '\r\n' + CommChar + '\r\n'=0D =0D if CommChar =3D=3D TAB_COMMENT_EDK1_SPLIT:=0D @@ -164,26 +174,28 @@ def GenHeaderCommentSection(Abstract, Description, Co= pyright, License, IsBinaryH return Content=0D =0D =0D -## GenInfPcdTailComment=0D +# GenInfPcdTailComment=0D # Generate Pcd tail comment for Inf, this would be one line comment=0D #=0D # @param Usage: Usage type=0D # @param TailCommentText: Comment text for tail comment=0D #=0D -def GenInfPcdTailComment (Usage, TailCommentText):=0D +def GenInfPcdTailComment(Usage, TailCommentText):=0D if (Usage =3D=3D ITEM_UNDEFINED) and (not TailCommentText):=0D return ''=0D =0D CommentLine =3D TAB_SPACE_SPLIT.join([Usage, TailCommentText])=0D return GenTailCommentLines(CommentLine)=0D =0D -## GenInfProtocolPPITailComment=0D +# GenInfProtocolPPITailComment=0D # Generate Protocol/PPI tail comment for Inf=0D #=0D # @param Usage: Usage type=0D # @param TailCommentText: Comment text for tail comment=0D #=0D -def GenInfProtocolPPITailComment (Usage, Notify, TailCommentText):=0D +=0D +=0D +def GenInfProtocolPPITailComment(Usage, Notify, TailCommentText):=0D if (not Notify) and (Usage =3D=3D ITEM_UNDEFINED) and (not TailComment= Text):=0D return ''=0D =0D @@ -195,16 +207,18 @@ def GenInfProtocolPPITailComment (Usage, Notify, Tail= CommentText): CommentLine +=3D TAB_SPACE_SPLIT.join([Usage, TailCommentText])=0D return GenTailCommentLines(CommentLine)=0D =0D -## GenInfGuidTailComment=0D +# GenInfGuidTailComment=0D # Generate Guid tail comment for Inf=0D #=0D # @param Usage: Usage type=0D # @param TailCommentText: Comment text for tail comment=0D #=0D -def GenInfGuidTailComment (Usage, GuidTypeList, VariableName, TailCommentT= ext):=0D +=0D +=0D +def GenInfGuidTailComment(Usage, GuidTypeList, VariableName, TailCommentTe= xt):=0D GuidType =3D GuidTypeList[0]=0D if (Usage =3D=3D ITEM_UNDEFINED) and (GuidType =3D=3D ITEM_UNDEFINED) = and \=0D - (not TailCommentText):=0D + (not TailCommentText):=0D return ''=0D =0D FirstLine =3D Usage + " ## " + GuidType=0D @@ -214,16 +228,18 @@ def GenInfGuidTailComment (Usage, GuidTypeList, Varia= bleName, TailCommentText): CommentLine =3D TAB_SPACE_SPLIT.join([FirstLine, TailCommentText])=0D return GenTailCommentLines(CommentLine)=0D =0D -## GenDecGuidTailComment=0D +# GenDecGuidTailComment=0D #=0D # @param SupModuleList: Supported module type list=0D #=0D -def GenDecTailComment (SupModuleList):=0D +=0D +=0D +def GenDecTailComment(SupModuleList):=0D CommentLine =3D TAB_SPACE_SPLIT.join(SupModuleList)=0D return GenTailCommentLines(CommentLine)=0D =0D =0D -## _GetHelpStr=0D +# _GetHelpStr=0D # get HelpString from a list of HelpTextObject, the priority refer to=0D # related HLD=0D #=0D diff --git a/BaseTools/Source/Python/UPT/Library/CommentParsing.py b/BaseTo= ols/Source/Python/UPT/Library/CommentParsing.py index 7ba9830d34ac..511b2861a8d7 100644 --- a/BaseTools/Source/Python/UPT/Library/CommentParsing.py +++ b/BaseTools/Source/Python/UPT/Library/CommentParsing.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define comment parsing interface=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -44,7 +44,7 @@ from Logger.ToolError import FORMAT_INVALID from Logger.ToolError import FORMAT_NOT_SUPPORTED=0D from Logger import StringTable as ST=0D =0D -## ParseHeaderCommentSection=0D +# ParseHeaderCommentSection=0D #=0D # Parse Header comment section lines, extract Abstract, Description, Copyr= ight=0D # , License lines=0D @@ -52,7 +52,9 @@ from Logger import StringTable as ST # @param CommentList: List of (Comment, LineNumber)=0D # @param FileName: FileName of the comment=0D #=0D -def ParseHeaderCommentSection(CommentList, FileName =3D None, IsBinaryHead= er =3D False):=0D +=0D +=0D +def ParseHeaderCommentSection(CommentList, FileName=3DNone, IsBinaryHeader= =3DFalse):=0D Abstract =3D ''=0D Description =3D ''=0D Copyright =3D ''=0D @@ -79,7 +81,8 @@ def ParseHeaderCommentSection(CommentList, FileName =3D N= one, IsBinaryHeader =3D Fal LineNo =3D Item[1]=0D =0D if not Line.startswith(TAB_COMMENT_SPLIT) and Line:=0D - Logger.Error("\nUPT", FORMAT_INVALID, ST.ERR_INVALID_COMMENT_F= ORMAT, FileName, Item[1])=0D + Logger.Error("\nUPT", FORMAT_INVALID,=0D + ST.ERR_INVALID_COMMENT_FORMAT, FileName, Item[1])= =0D Comment =3D CleanString2(Line)[1]=0D Comment =3D Comment.strip()=0D #=0D @@ -87,7 +90,7 @@ def ParseHeaderCommentSection(CommentList, FileName =3D N= one, IsBinaryHeader =3D Fal # indication of different block; or in the position that Abstract = should be, also keep it=0D # as it indicates that no abstract=0D #=0D - if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICEN= SE, \=0D + if not Comment and HeaderCommentStage not in [HEADER_COMMENT_LICEN= SE,=0D HEADER_COMMENT_DESCR= IPTION, HEADER_COMMENT_ABSTRACT]:=0D continue=0D =0D @@ -105,7 +108,8 @@ def ParseHeaderCommentSection(CommentList, FileName =3D= None, IsBinaryHeader =3D Fal HeaderCommentStage =3D HEADER_COMMENT_DESCRIPTION=0D elif _IsCopyrightLine(Comment):=0D Result, ErrMsg =3D _ValidateCopyright(Comment)=0D - ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, Fi= leName, LineNo, ErrMsg)=0D + ValidateCopyright(=0D + Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo= , ErrMsg)=0D Copyright +=3D Comment + EndOfLine=0D HeaderCommentStage =3D HEADER_COMMENT_COPYRIGHT=0D else:=0D @@ -117,7 +121,8 @@ def ParseHeaderCommentSection(CommentList, FileName =3D= None, IsBinaryHeader =3D Fal #=0D if _IsCopyrightLine(Comment):=0D Result, ErrMsg =3D _ValidateCopyright(Comment)=0D - ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, Fi= leName, LineNo, ErrMsg)=0D + ValidateCopyright(=0D + Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo= , ErrMsg)=0D Copyright +=3D Comment + EndOfLine=0D HeaderCommentStage =3D HEADER_COMMENT_COPYRIGHT=0D else:=0D @@ -125,7 +130,8 @@ def ParseHeaderCommentSection(CommentList, FileName =3D= None, IsBinaryHeader =3D Fal elif HeaderCommentStage =3D=3D HEADER_COMMENT_COPYRIGHT:=0D if _IsCopyrightLine(Comment):=0D Result, ErrMsg =3D _ValidateCopyright(Comment)=0D - ValidateCopyright(Result, ST.WRN_INVALID_COPYRIGHT, Fi= leName, LineNo, ErrMsg)=0D + ValidateCopyright(=0D + Result, ST.WRN_INVALID_COPYRIGHT, FileName, LineNo= , ErrMsg)=0D Copyright +=3D Comment + EndOfLine=0D else:=0D #=0D @@ -144,14 +150,16 @@ def ParseHeaderCommentSection(CommentList, FileName = =3D None, IsBinaryHeader =3D Fal =0D return Abstract.strip(), Description.strip(), Copyright.strip(), Licen= se.strip()=0D =0D -## _IsCopyrightLine=0D +# _IsCopyrightLine=0D # check whether current line is copyright line, the criteria is whether th= ere is case insensitive keyword "Copyright"=0D # followed by zero or more white space characters followed by a "(" charac= ter=0D #=0D # @param LineContent: the line need to be checked=0D # @return: True if current line is copyright line, False else=0D #=0D -def _IsCopyrightLine (LineContent):=0D +=0D +=0D +def _IsCopyrightLine(LineContent):=0D LineContent =3D LineContent.upper()=0D Result =3D False=0D =0D @@ -161,13 +169,15 @@ def _IsCopyrightLine (LineContent): =0D return Result=0D =0D -## ParseGenericComment=0D +# ParseGenericComment=0D #=0D # @param GenericComment: Generic comment list, element of=0D # (CommentLine, LineNum)=0D # @param ContainerFile: Input value for filename of Dec file=0D #=0D -def ParseGenericComment (GenericComment, ContainerFile=3DNone, SkipTag=3DN= one):=0D +=0D +=0D +def ParseGenericComment(GenericComment, ContainerFile=3DNone, SkipTag=3DNo= ne):=0D if ContainerFile:=0D pass=0D HelpTxt =3D None=0D @@ -188,13 +198,15 @@ def ParseGenericComment (GenericComment, ContainerFil= e=3DNone, SkipTag=3DNone): =0D return HelpTxt=0D =0D -## ParsePcdErrorCode=0D +# ParsePcdErrorCode=0D #=0D # @param Value: original ErrorCode value=0D # @param ContainerFile: Input value for filename of Dec file=0D # @param LineNum: Line Num=0D #=0D -def ParsePcdErrorCode (Value =3D None, ContainerFile =3D None, LineNum =3D= None):=0D +=0D +=0D +def ParsePcdErrorCode(Value=3DNone, ContainerFile=3DNone, LineNum=3DNone):= =0D try:=0D if Value.strip().startswith((TAB_HEX_START, TAB_CAPHEX_START)):=0D Base =3D 16=0D @@ -203,28 +215,30 @@ def ParsePcdErrorCode (Value =3D None, ContainerFile = =3D None, LineNum =3D None): ErrorCode =3D int(Value, Base)=0D if ErrorCode > PCD_ERR_CODE_MAX_SIZE or ErrorCode < 0:=0D Logger.Error('Parser',=0D - FORMAT_NOT_SUPPORTED,=0D - "The format %s of ErrorCode is not valid, should b= e UNIT32 type or long type" % Value,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + FORMAT_NOT_SUPPORTED,=0D + "The format %s of ErrorCode is not valid, should = be UNIT32 type or long type" % Value,=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D ErrorCode =3D '0x%x' % ErrorCode=0D return ErrorCode=0D except ValueError as XStr:=0D if XStr:=0D pass=0D Logger.Error('Parser',=0D - FORMAT_NOT_SUPPORTED,=0D - "The format %s of ErrorCode is not valid, should be UN= IT32 type or long type" % Value,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + FORMAT_NOT_SUPPORTED,=0D + "The format %s of ErrorCode is not valid, should be U= NIT32 type or long type" % Value,=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D =0D -## ParseDecPcdGenericComment=0D +# ParseDecPcdGenericComment=0D #=0D # @param GenericComment: Generic comment list, element of (CommentLine,=0D # LineNum)=0D # @param ContainerFile: Input value for filename of Dec file=0D #=0D -def ParseDecPcdGenericComment (GenericComment, ContainerFile, TokenSpaceGu= idCName, CName, MacroReplaceDict):=0D +=0D +=0D +def ParseDecPcdGenericComment(GenericComment, ContainerFile, TokenSpaceGui= dCName, CName, MacroReplaceDict):=0D HelpStr =3D ''=0D PromptStr =3D ''=0D PcdErr =3D None=0D @@ -239,19 +253,20 @@ def ParseDecPcdGenericComment (GenericComment, Contai= nerFile, TokenSpaceGuidCNam # To replace Macro=0D #=0D MACRO_PATTERN =3D '[\t\s]*\$\([A-Z][_A-Z0-9]*\)'=0D - MatchedStrs =3D re.findall(MACRO_PATTERN, Comment)=0D + MatchedStrs =3D re.findall(MACRO_PATTERN, Comment)=0D for MatchedStr in MatchedStrs:=0D if MatchedStr:=0D Macro =3D MatchedStr.strip().lstrip('$(').rstrip(')').stri= p()=0D if Macro in MacroReplaceDict:=0D - Comment =3D Comment.replace(MatchedStr, MacroReplaceDi= ct[Macro])=0D + Comment =3D Comment.replace(=0D + MatchedStr, MacroReplaceDict[Macro])=0D if Comment.startswith(TAB_PCD_VALIDRANGE):=0D if ValidValueNum > 0 or ExpressionNum > 0:=0D Logger.Error('Parser',=0D FORMAT_NOT_SUPPORTED,=0D ST.WRN_MULTI_PCD_RANGES,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D else:=0D PcdErr =3D PcdErrorObject()=0D PcdErr.SetTokenSpaceGuidCName(TokenSpaceGuidCName)=0D @@ -264,30 +279,32 @@ def ParseDecPcdGenericComment (GenericComment, Contai= nerFile, TokenSpaceGuidCNam if Valid:=0D ValueList =3D ValidRange.split(TAB_VALUE_SPLIT)=0D if len(ValueList) > 1:=0D - PcdErr.SetValidValueRange((TAB_VALUE_SPLIT.join(ValueL= ist[1:])).strip())=0D - PcdErr.SetErrorNumber(ParsePcdErrorCode(ValueList[0], = ContainerFile, LineNum))=0D + PcdErr.SetValidValueRange(=0D + (TAB_VALUE_SPLIT.join(ValueList[1:])).strip())=0D + PcdErr.SetErrorNumber(ParsePcdErrorCode(=0D + ValueList[0], ContainerFile, LineNum))=0D else:=0D PcdErr.SetValidValueRange(ValidRange)=0D PcdErrList.append(PcdErr)=0D else:=0D Logger.Error("Parser",=0D - FORMAT_NOT_SUPPORTED,=0D - Cause,=0D - ContainerFile,=0D - LineNum)=0D + FORMAT_NOT_SUPPORTED,=0D + Cause,=0D + ContainerFile,=0D + LineNum)=0D elif Comment.startswith(TAB_PCD_VALIDLIST):=0D if ValidRangeNum > 0 or ExpressionNum > 0:=0D Logger.Error('Parser',=0D FORMAT_NOT_SUPPORTED,=0D ST.WRN_MULTI_PCD_RANGES,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D elif ValidValueNum > 0:=0D Logger.Error('Parser',=0D FORMAT_NOT_SUPPORTED,=0D ST.WRN_MULTI_PCD_VALIDVALUE,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D else:=0D PcdErr =3D PcdErrorObject()=0D PcdErr.SetTokenSpaceGuidCName(TokenSpaceGuidCName)=0D @@ -295,30 +312,34 @@ def ParseDecPcdGenericComment (GenericComment, Contai= nerFile, TokenSpaceGuidCNam PcdErr.SetFileLine(Comment)=0D PcdErr.SetLineNum(LineNum)=0D ValidValueNum +=3D 1=0D - ValidValueExpr =3D Comment.replace(TAB_PCD_VALIDLIST, "", = 1).strip()=0D + ValidValueExpr =3D Comment.replace(=0D + TAB_PCD_VALIDLIST, "", 1).strip()=0D Valid, Cause =3D _CheckListExpression(ValidValueExpr)=0D if Valid:=0D - ValidValue =3D Comment.replace(TAB_PCD_VALIDLIST, "", 1).r= eplace(TAB_COMMA_SPLIT, TAB_SPACE_SPLIT)=0D + ValidValue =3D Comment.replace(TAB_PCD_VALIDLIST, "", 1).r= eplace(=0D + TAB_COMMA_SPLIT, TAB_SPACE_SPLIT)=0D ValueList =3D ValidValue.split(TAB_VALUE_SPLIT)=0D if len(ValueList) > 1:=0D - PcdErr.SetValidValue((TAB_VALUE_SPLIT.join(ValueList[1= :])).strip())=0D - PcdErr.SetErrorNumber(ParsePcdErrorCode(ValueList[0], = ContainerFile, LineNum))=0D + PcdErr.SetValidValue(=0D + (TAB_VALUE_SPLIT.join(ValueList[1:])).strip())=0D + PcdErr.SetErrorNumber(ParsePcdErrorCode(=0D + ValueList[0], ContainerFile, LineNum))=0D else:=0D PcdErr.SetValidValue(ValidValue)=0D PcdErrList.append(PcdErr)=0D else:=0D Logger.Error("Parser",=0D - FORMAT_NOT_SUPPORTED,=0D - Cause,=0D - ContainerFile,=0D - LineNum)=0D + FORMAT_NOT_SUPPORTED,=0D + Cause,=0D + ContainerFile,=0D + LineNum)=0D elif Comment.startswith(TAB_PCD_EXPRESSION):=0D if ValidRangeNum > 0 or ValidValueNum > 0:=0D Logger.Error('Parser',=0D FORMAT_NOT_SUPPORTED,=0D ST.WRN_MULTI_PCD_RANGES,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D else:=0D PcdErr =3D PcdErrorObject()=0D PcdErr.SetTokenSpaceGuidCName(TokenSpaceGuidCName)=0D @@ -331,24 +352,26 @@ def ParseDecPcdGenericComment (GenericComment, Contai= nerFile, TokenSpaceGuidCNam if Valid:=0D ValueList =3D Expression.split(TAB_VALUE_SPLIT)=0D if len(ValueList) > 1:=0D - PcdErr.SetExpression((TAB_VALUE_SPLIT.join(ValueList[1= :])).strip())=0D - PcdErr.SetErrorNumber(ParsePcdErrorCode(ValueList[0], = ContainerFile, LineNum))=0D + PcdErr.SetExpression(=0D + (TAB_VALUE_SPLIT.join(ValueList[1:])).strip())=0D + PcdErr.SetErrorNumber(ParsePcdErrorCode(=0D + ValueList[0], ContainerFile, LineNum))=0D else:=0D PcdErr.SetExpression(Expression)=0D PcdErrList.append(PcdErr)=0D else:=0D Logger.Error("Parser",=0D - FORMAT_NOT_SUPPORTED,=0D - Cause,=0D - ContainerFile,=0D - LineNum)=0D + FORMAT_NOT_SUPPORTED,=0D + Cause,=0D + ContainerFile,=0D + LineNum)=0D elif Comment.startswith(TAB_PCD_PROMPT):=0D if PromptStr:=0D Logger.Error('Parser',=0D FORMAT_NOT_SUPPORTED,=0D ST.WRN_MULTI_PCD_PROMPT,=0D - File =3D ContainerFile,=0D - Line =3D LineNum)=0D + File=3DContainerFile,=0D + Line=3DLineNum)=0D PromptStr =3D Comment.replace(TAB_PCD_PROMPT, "", 1).strip()=0D else:=0D if Comment:=0D @@ -363,14 +386,16 @@ def ParseDecPcdGenericComment (GenericComment, Contai= nerFile, TokenSpaceGuidCNam =0D return HelpStr, PcdErrList, PromptStr=0D =0D -## ParseDecPcdTailComment=0D +# ParseDecPcdTailComment=0D #=0D # @param TailCommentList: Tail comment list of Pcd, item of format (Com= ment, LineNum)=0D # @param ContainerFile: Input value for filename of Dec file=0D # @retVal SupModuleList: The supported module type list detected=0D # @retVal HelpStr: The generic help text string detected=0D #=0D -def ParseDecPcdTailComment (TailCommentList, ContainerFile):=0D +=0D +=0D +def ParseDecPcdTailComment(TailCommentList, ContainerFile):=0D assert(len(TailCommentList) =3D=3D 1)=0D TailComment =3D TailCommentList[0][0]=0D LineNum =3D TailCommentList[0][1]=0D @@ -399,7 +424,7 @@ def ParseDecPcdTailComment (TailCommentList, ContainerF= ile): elif Mod not in SUP_MODULE_LIST:=0D Logger.Error("UPT",=0D FORMAT_INVALID,=0D - ST.WRN_INVALID_MODULE_TYPE%Mod,=0D + ST.WRN_INVALID_MODULE_TYPE % Mod,=0D ContainerFile,=0D LineNum)=0D else:=0D @@ -407,10 +432,12 @@ def ParseDecPcdTailComment (TailCommentList, Containe= rFile): =0D return SupModuleList, HelpStr=0D =0D -## _CheckListExpression=0D +# _CheckListExpression=0D #=0D # @param Expression: Pcd value list expression=0D #=0D +=0D +=0D def _CheckListExpression(Expression):=0D ListExpr =3D ''=0D if TAB_VALUE_SPLIT in Expression:=0D @@ -420,10 +447,12 @@ def _CheckListExpression(Expression): =0D return IsValidListExpr(ListExpr)=0D =0D -## _CheckExpression=0D +# _CheckExpression=0D #=0D # @param Expression: Pcd value expression=0D #=0D +=0D +=0D def _CheckExpression(Expression):=0D Expr =3D ''=0D if TAB_VALUE_SPLIT in Expression:=0D @@ -432,10 +461,12 @@ def _CheckExpression(Expression): Expr =3D Expression=0D return IsValidLogicalExpr(Expr, True)=0D =0D -## _CheckRangeExpression=0D +# _CheckRangeExpression=0D #=0D # @param Expression: Pcd range expression=0D #=0D +=0D +=0D def _CheckRangeExpression(Expression):=0D RangeExpr =3D ''=0D if TAB_VALUE_SPLIT in Expression:=0D @@ -445,21 +476,25 @@ def _CheckRangeExpression(Expression): =0D return IsValidRangeExpr(RangeExpr)=0D =0D -## ValidateCopyright=0D +# ValidateCopyright=0D #=0D #=0D #=0D +=0D +=0D def ValidateCopyright(Result, ErrType, FileName, LineNo, ErrMsg):=0D if not Result:=0D Logger.Warn("\nUPT", ErrType, FileName, LineNo, ErrMsg)=0D =0D -## _ValidateCopyright=0D +# _ValidateCopyright=0D #=0D # @param Line: Line that contains copyright information, # stripped=0D #=0D # @retval Result: True if line is conformed to Spec format, False else=0D # @retval ErrMsg: the detailed error description=0D #=0D +=0D +=0D def _ValidateCopyright(Line):=0D if Line:=0D pass=0D @@ -468,14 +503,16 @@ def _ValidateCopyright(Line): =0D return Result, ErrMsg=0D =0D -def GenerateTokenList (Comment):=0D +=0D +def GenerateTokenList(Comment):=0D #=0D # Tokenize Comment using '#' and ' ' as token separators=0D #=0D ReplacedComment =3D None=0D while Comment !=3D ReplacedComment:=0D ReplacedComment =3D Comment=0D - Comment =3D Comment.replace('##', '#').replace(' ', ' ').replace(= ' ', '#').strip('# ')=0D + Comment =3D Comment.replace('##', '#').replace(=0D + ' ', ' ').replace(' ', '#').strip('# ')=0D return Comment.split('#')=0D =0D =0D @@ -485,7 +522,7 @@ def GenerateTokenList (Comment): # RemoveTokens - A list of tokens to remove from help text=0D # ParseVariable - True for parsing [Guids]. Otherwise False=0D #=0D -def ParseComment (Comment, UsageTokens, TypeTokens, RemoveTokens, ParseVar= iable):=0D +def ParseComment(Comment, UsageTokens, TypeTokens, RemoveTokens, ParseVari= able):=0D #=0D # Initialize return values=0D #=0D @@ -503,7 +540,7 @@ def ParseComment (Comment, UsageTokens, TypeTokens, Rem= oveTokens, ParseVariable) #=0D List =3D Comment.split(':', 1)=0D if len(List) > 1:=0D - SubList =3D GenerateTokenList (List[0].strip())=0D + SubList =3D GenerateTokenList(List[0].strip())=0D if len(SubList) in [1, 2] and SubList[-1] =3D=3D 'Variable':=0D if List[1].strip().find('L"') =3D=3D 0:=0D Comment =3D List[0].strip() + ':' + List[1].strip()=0D @@ -524,7 +561,7 @@ def ParseComment (Comment, UsageTokens, TypeTokens, Rem= oveTokens, ParseVariable) String =3D Comment[Start:]=0D End =3D String[2:].find('"')=0D if End >=3D 0:=0D - SubList =3D GenerateTokenList (Comment[:Start])=0D + SubList =3D GenerateTokenList(Comment[:Start])=0D if len(SubList) < 2:=0D Comment =3D Comment[:Start] + String[End + 3:]=0D String =3D String[:End + 3]=0D @@ -540,7 +577,7 @@ def ParseComment (Comment, UsageTokens, TypeTokens, Rem= oveTokens, ParseVariable) #=0D # Tokenize Comment using '#' and ' ' as token separators=0D #=0D - List =3D GenerateTokenList (Comment)=0D + List =3D GenerateTokenList(Comment)=0D =0D #=0D # Search first two tokens for Usage and Type and remove any matching t= okens=0D diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py b/BaseTools/So= urce/Python/UPT/Library/DataType.py index 2033149aa6dc..a5e0bb154e33 100644 --- a/BaseTools/Source/Python/UPT/Library/DataType.py +++ b/BaseTools/Source/Python/UPT/Library/DataType.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class for data type structure=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -42,18 +42,18 @@ USAGE_LIST =3D ["CONSUMES", "SOMETIMES_PRODUCES"]=0D =0D TAB_LANGUAGE_EN_US =3D 'en-US'=0D -TAB_LANGUAGE_ENG =3D 'eng'=0D -TAB_LANGUAGE_EN =3D 'en'=0D -TAB_LANGUAGE_EN_X =3D 'en-x-tianocore'=0D +TAB_LANGUAGE_ENG =3D 'eng'=0D +TAB_LANGUAGE_EN =3D 'en'=0D +TAB_LANGUAGE_EN_X =3D 'en-x-tianocore'=0D =0D -USAGE_ITEM_PRODUCES =3D 'PRODUCES'=0D +USAGE_ITEM_PRODUCES =3D 'PRODUCES'=0D USAGE_ITEM_SOMETIMES_PRODUCES =3D 'SOMETIMES_PRODUCES'=0D -USAGE_ITEM_CONSUMES =3D 'CONSUMES'=0D +USAGE_ITEM_CONSUMES =3D 'CONSUMES'=0D USAGE_ITEM_SOMETIMES_CONSUMES =3D 'SOMETIMES_CONSUMES'=0D -USAGE_ITEM_TO_START =3D 'TO_START'=0D -USAGE_ITEM_BY_START =3D 'BY_START'=0D -USAGE_ITEM_NOTIFY =3D 'NOTIFY'=0D -USAGE_ITEM_UNDEFINED =3D 'UNDEFINED'=0D +USAGE_ITEM_TO_START =3D 'TO_START'=0D +USAGE_ITEM_BY_START =3D 'BY_START'=0D +USAGE_ITEM_NOTIFY =3D 'NOTIFY'=0D +USAGE_ITEM_UNDEFINED =3D 'UNDEFINED'=0D =0D USAGE_CONSUMES_LIST =3D [USAGE_ITEM_CONSUMES,=0D 'CONSUMED',=0D @@ -90,103 +90,103 @@ TAB_STR_TOKENERR =3D 'ERR' # Dictionary of usage tokens and their synonyms=0D #=0D ALL_USAGE_TOKENS =3D {=0D - "PRODUCES" : "PRODUCES",=0D - "PRODUCED" : "PRODUCES",=0D - "ALWAYS_PRODUCES" : "PRODUCES",=0D - "ALWAYS_PRODUCED" : "PRODUCES",=0D - "SOMETIMES_PRODUCES" : "SOMETIMES_PRODUCES",=0D - "SOMETIMES_PRODUCED" : "SOMETIMES_PRODUCES",=0D - "CONSUMES" : "CONSUMES",=0D - "CONSUMED" : "CONSUMES",=0D - "ALWAYS_CONSUMES" : "CONSUMES",=0D - "ALWAYS_CONSUMED" : "CONSUMES",=0D - "SOMETIMES_CONSUMES" : "SOMETIMES_CONSUMES",=0D - "SOMETIMES_CONSUMED" : "SOMETIMES_CONSUMES",=0D - "SOMETIME_CONSUMES" : "SOMETIMES_CONSUMES",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "PRODUCES": "PRODUCES",=0D + "PRODUCED": "PRODUCES",=0D + "ALWAYS_PRODUCES": "PRODUCES",=0D + "ALWAYS_PRODUCED": "PRODUCES",=0D + "SOMETIMES_PRODUCES": "SOMETIMES_PRODUCES",=0D + "SOMETIMES_PRODUCED": "SOMETIMES_PRODUCES",=0D + "CONSUMES": "CONSUMES",=0D + "CONSUMED": "CONSUMES",=0D + "ALWAYS_CONSUMES": "CONSUMES",=0D + "ALWAYS_CONSUMED": "CONSUMES",=0D + "SOMETIMES_CONSUMES": "SOMETIMES_CONSUMES",=0D + "SOMETIMES_CONSUMED": "SOMETIMES_CONSUMES",=0D + "SOMETIME_CONSUMES": "SOMETIMES_CONSUMES",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D PROTOCOL_USAGE_TOKENS =3D {=0D - "TO_START" : "TO_START",=0D - "BY_START" : "BY_START"=0D - }=0D + "TO_START": "TO_START",=0D + "BY_START": "BY_START"=0D +}=0D =0D -PROTOCOL_USAGE_TOKENS.update (ALL_USAGE_TOKENS)=0D +PROTOCOL_USAGE_TOKENS.update(ALL_USAGE_TOKENS)=0D =0D #=0D # Dictionary of GUID type tokens=0D #=0D GUID_TYPE_TOKENS =3D {=0D - "Event" : "Event",=0D - "File" : "File",=0D - "FV" : "FV",=0D - "GUID" : "GUID",=0D - "Guid" : "GUID",=0D - "HII" : "HII",=0D - "HOB" : "HOB",=0D - "Hob" : "HOB",=0D - "Hob:" : "HOB",=0D - "SystemTable" : "SystemTable",=0D - "TokenSpaceGuid" : "TokenSpaceGuid",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "Event": "Event",=0D + "File": "File",=0D + "FV": "FV",=0D + "GUID": "GUID",=0D + "Guid": "GUID",=0D + "HII": "HII",=0D + "HOB": "HOB",=0D + "Hob": "HOB",=0D + "Hob:": "HOB",=0D + "SystemTable": "SystemTable",=0D + "TokenSpaceGuid": "TokenSpaceGuid",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D #=0D # Dictionary of Protocol Notify tokens and their synonyms=0D #=0D PROTOCOL_NOTIFY_TOKENS =3D {=0D - "NOTIFY" : "NOTIFY",=0D - "PROTOCOL_NOTIFY" : "NOTIFY",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "NOTIFY": "NOTIFY",=0D + "PROTOCOL_NOTIFY": "NOTIFY",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D #=0D # Dictionary of PPI Notify tokens and their synonyms=0D #=0D PPI_NOTIFY_TOKENS =3D {=0D - "NOTIFY" : "NOTIFY",=0D - "PPI_NOTIFY" : "NOTIFY",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "NOTIFY": "NOTIFY",=0D + "PPI_NOTIFY": "NOTIFY",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D EVENT_TOKENS =3D {=0D - "EVENT_TYPE_PERIODIC_TIMER" : "EVENT_TYPE_PERIODIC_TIMER",=0D - "EVENT_TYPE_RELATIVE_TIMER" : "EVENT_TYPE_RELATIVE_TIMER",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "EVENT_TYPE_PERIODIC_TIMER": "EVENT_TYPE_PERIODIC_TIMER",=0D + "EVENT_TYPE_RELATIVE_TIMER": "EVENT_TYPE_RELATIVE_TIMER",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D BOOTMODE_TOKENS =3D {=0D - "FULL" : "FULL",=0D - "MINIMAL" : "MINIMAL",=0D - "NO_CHANGE" : "NO_CHANGE",=0D - "DIAGNOSTICS" : "DIAGNOSTICS",=0D - "DEFAULT" : "DEFAULT",=0D - "S2_RESUME" : "S2_RESUME",=0D - "S3_RESUME" : "S3_RESUME",=0D - "S4_RESUME" : "S4_RESUME",=0D - "S5_RESUME" : "S5_RESUME",=0D - "FLASH_UPDATE" : "FLASH_UPDATE",=0D - "RECOVERY_FULL" : "RECOVERY_FULL",=0D - "RECOVERY_MINIMAL" : "RECOVERY_MINIMAL",=0D - "RECOVERY_NO_CHANGE" : "RECOVERY_NO_CHANGE",=0D - "RECOVERY_DIAGNOSTICS" : "RECOVERY_DIAGNOSTICS",=0D - "RECOVERY_DEFAULT" : "RECOVERY_DEFAULT",=0D - "RECOVERY_S2_RESUME" : "RECOVERY_S2_RESUME",=0D - "RECOVERY_S3_RESUME" : "RECOVERY_S3_RESUME",=0D - "RECOVERY_S4_RESUME" : "RECOVERY_S4_RESUME",=0D - "RECOVERY_S5_RESUME" : "RECOVERY_S5_RESUME",=0D - "RECOVERY_FLASH_UPDATE" : "RECOVERY_FLASH_UPDATE",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "FULL": "FULL",=0D + "MINIMAL": "MINIMAL",=0D + "NO_CHANGE": "NO_CHANGE",=0D + "DIAGNOSTICS": "DIAGNOSTICS",=0D + "DEFAULT": "DEFAULT",=0D + "S2_RESUME": "S2_RESUME",=0D + "S3_RESUME": "S3_RESUME",=0D + "S4_RESUME": "S4_RESUME",=0D + "S5_RESUME": "S5_RESUME",=0D + "FLASH_UPDATE": "FLASH_UPDATE",=0D + "RECOVERY_FULL": "RECOVERY_FULL",=0D + "RECOVERY_MINIMAL": "RECOVERY_MINIMAL",=0D + "RECOVERY_NO_CHANGE": "RECOVERY_NO_CHANGE",=0D + "RECOVERY_DIAGNOSTICS": "RECOVERY_DIAGNOSTICS",=0D + "RECOVERY_DEFAULT": "RECOVERY_DEFAULT",=0D + "RECOVERY_S2_RESUME": "RECOVERY_S2_RESUME",=0D + "RECOVERY_S3_RESUME": "RECOVERY_S3_RESUME",=0D + "RECOVERY_S4_RESUME": "RECOVERY_S4_RESUME",=0D + "RECOVERY_S5_RESUME": "RECOVERY_S5_RESUME",=0D + "RECOVERY_FLASH_UPDATE": "RECOVERY_FLASH_UPDATE",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D HOB_TOKENS =3D {=0D - "PHIT" : "PHIT",=0D - "MEMORY_ALLOCATION" : "MEMORY_ALLOCATION",=0D - "LOAD_PEIM" : "LOAD_PEIM",=0D - "RESOURCE_DESCRIPTOR" : "RESOURCE_DESCRIPTOR",=0D - "FIRMWARE_VOLUME" : "FIRMWARE_VOLUME",=0D - "UNDEFINED" : "UNDEFINED"=0D - }=0D + "PHIT": "PHIT",=0D + "MEMORY_ALLOCATION": "MEMORY_ALLOCATION",=0D + "LOAD_PEIM": "LOAD_PEIM",=0D + "RESOURCE_DESCRIPTOR": "RESOURCE_DESCRIPTOR",=0D + "FIRMWARE_VOLUME": "FIRMWARE_VOLUME",=0D + "UNDEFINED": "UNDEFINED"=0D +}=0D =0D ##=0D # Usage List Items for Protocol=0D @@ -260,12 +260,13 @@ GUID_TYPE_LIST =3D ["Event", "File", "FV", "GUID", "H= II", "HOB", # PCD Usage Type List of Package=0D #=0D PCD_USAGE_TYPE_LIST_OF_PACKAGE =3D ["FeatureFlag", "PatchableInModule",=0D - "FixedAtBuild", "Dynamic", "DynamicEx"]=0D + "FixedAtBuild", "Dynamic", "DynamicEx"]= =0D =0D ##=0D # PCD Usage Type List of Module=0D #=0D -PCD_USAGE_TYPE_LIST_OF_MODULE =3D ["FEATUREPCD", "PATCHPCD", "FIXEDPCD", "= PCD", "PCDEX"]=0D +PCD_USAGE_TYPE_LIST_OF_MODULE =3D ["FEATUREPCD",=0D + "PATCHPCD", "FIXEDPCD", "PCD", "PCDEX"]=0D ##=0D # PCD Usage Type List of UPT=0D #=0D @@ -282,14 +283,14 @@ BINARY_FILE_TYPE_LIST =3D ["PE32", "PIC", "TE", "DXE_= DEPEX", "VER", "UI", "COMPAT1 "DISPOSABLE"=0D ]=0D BINARY_FILE_TYPE_LIST_IN_UDP =3D \=0D - ["GUID", "FREEFORM",=0D - "UEFI_IMAGE", "PE32", "PIC",=0D - "PEI_DEPEX",=0D - "DXE_DEPEX",=0D - "SMM_DEPEX",=0D - "FV", "TE",=0D - "BIN", "VER", "UI"=0D - ]=0D + ["GUID", "FREEFORM",=0D + "UEFI_IMAGE", "PE32", "PIC",=0D + "PEI_DEPEX",=0D + "DXE_DEPEX",=0D + "SMM_DEPEX",=0D + "FV", "TE",=0D + "BIN", "VER", "UI"=0D + ]=0D =0D SUBTYPE_GUID_BINARY_FILE_TYPE =3D "FREEFORM"=0D ##=0D @@ -300,28 +301,28 @@ SUBTYPE_GUID_BINARY_FILE_TYPE =3D "FREEFORM" # are required. The COMPONENT_TYPE definition is case sensitive.=0D #=0D COMPONENT_TYPE_LIST =3D [=0D - "APPLICATION",=0D - "ACPITABLE",=0D - "APRIORI",=0D - "BINARY",=0D - "BS_DRIVER",=0D - "CONFIG",=0D - "FILE",=0D - "FVIMAGEFILE",=0D - "LIBRARY",=0D - "LOGO",=0D - "LEGACY16",=0D - "MICROCODE",=0D - "PE32_PEIM",=0D - "PEI_CORE",=0D - "RAWFILE",=0D - "RT_DRIVER",=0D - "SAL_RT_DRIVER",=0D - "SECURITY_CORE",=0D - "COMBINED_PEIM_DRIVER",=0D - "PIC_PEIM",=0D - "RELOCATABLE_PEIM"=0D - ]=0D + "APPLICATION",=0D + "ACPITABLE",=0D + "APRIORI",=0D + "BINARY",=0D + "BS_DRIVER",=0D + "CONFIG",=0D + "FILE",=0D + "FVIMAGEFILE",=0D + "LIBRARY",=0D + "LOGO",=0D + "LEGACY16",=0D + "MICROCODE",=0D + "PE32_PEIM",=0D + "PEI_CORE",=0D + "RAWFILE",=0D + "RT_DRIVER",=0D + "SAL_RT_DRIVER",=0D + "SECURITY_CORE",=0D + "COMBINED_PEIM_DRIVER",=0D + "PIC_PEIM",=0D + "RELOCATABLE_PEIM"=0D +]=0D =0D ##=0D # Common Definitions=0D @@ -343,7 +344,7 @@ TAB_COLON_SPLIT =3D ':' TAB_SECTION_START =3D '['=0D TAB_SECTION_END =3D ']'=0D TAB_OPTION_START =3D '<'=0D -TAB_OPTION_END =3D '>'=0D +TAB_OPTION_END =3D '>'=0D TAB_SLASH =3D '\\'=0D TAB_BACK_SLASH =3D '/'=0D TAB_SPECIAL_COMMENT =3D '##'=0D @@ -370,7 +371,7 @@ TAB_ARCH_ARM =3D 'ARM' TAB_ARCH_EBC =3D 'EBC'=0D =0D ARCH_LIST =3D \=0D -[TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC]=0D + [TAB_ARCH_IA32, TAB_ARCH_X64, TAB_ARCH_IPF, TAB_ARCH_ARM, TAB_ARCH_EBC= ]=0D =0D SUP_MODULE_BASE =3D 'BASE'=0D SUP_MODULE_SEC =3D 'SEC'=0D @@ -387,12 +388,12 @@ SUP_MODULE_USER_DEFINED =3D 'USER_DEFINED' SUP_MODULE_SMM_CORE =3D 'SMM_CORE'=0D =0D SUP_MODULE_LIST =3D \=0D -[SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM, \= =0D -SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER, \=0D - SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVE= R, \=0D - SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER, \=0D - SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED, \= =0D - SUP_MODULE_SMM_CORE]=0D + [SUP_MODULE_BASE, SUP_MODULE_SEC, SUP_MODULE_PEI_CORE, SUP_MODULE_PEIM= ,=0D + SUP_MODULE_DXE_CORE, SUP_MODULE_DXE_DRIVER,=0D + SUP_MODULE_DXE_RUNTIME_DRIVER, SUP_MODULE_DXE_SAL_DRIVER,=0D + SUP_MODULE_DXE_SMM_DRIVER, SUP_MODULE_UEFI_DRIVER,=0D + SUP_MODULE_UEFI_APPLICATION, SUP_MODULE_USER_DEFINED,=0D + SUP_MODULE_SMM_CORE]=0D SUP_MODULE_LIST_STRING =3D TAB_VALUE_SPLIT.join(l for l in SUP_MODULE_LIST= )=0D =0D EDK_COMPONENT_TYPE_LIBRARY =3D 'LIBRARY'=0D @@ -405,7 +406,7 @@ EDK_COMPONENT_TYPE_BS_DRIVER =3D 'BS_DRIVER' EDK_COMPONENT_TYPE_RT_DRIVER =3D 'RT_DRIVER'=0D EDK_COMPONENT_TYPE_SAL_RT_DRIVER =3D 'SAL_RT_DRIVER'=0D EDK_COMPONENT_TYPE_APPLICATION =3D 'APPLICATION'=0D -EDK_NAME =3D 'EDK'=0D +EDK_NAME =3D 'EDK'=0D EDKII_NAME =3D 'EDKII'=0D =0D BINARY_FILE_TYPE_FW =3D 'FW'=0D @@ -432,9 +433,9 @@ BINARY_FILE_TYPE_UI_LIST =3D [BINARY_FILE_TYPE_UNI_UI, BINARY_FILE_TYPE_UI=0D ]=0D BINARY_FILE_TYPE_VER_LIST =3D [BINARY_FILE_TYPE_UNI_VER,=0D - BINARY_FILE_TYPE_SEC_VER,=0D - BINARY_FILE_TYPE_VER=0D - ]=0D + BINARY_FILE_TYPE_SEC_VER,=0D + BINARY_FILE_TYPE_VER=0D + ]=0D =0D DEPEX_SECTION_LIST =3D ['',=0D '',=0D @@ -527,117 +528,117 @@ TAB_PCDS_DYNAMIC_HII =3D 'DynamicHii' =0D TAB_PTR_TYPE_PCD =3D 'VOID*'=0D =0D -PCD_DYNAMIC_TYPE_LIST =3D [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT, \=0D +PCD_DYNAMIC_TYPE_LIST =3D [TAB_PCDS_DYNAMIC, TAB_PCDS_DYNAMIC_DEFAULT,=0D TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_HII]=0D -PCD_DYNAMIC_EX_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEF= AULT, \=0D +PCD_DYNAMIC_EX_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEF= AULT,=0D TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_H= II]=0D =0D -## Dynamic-ex PCD types=0D +# Dynamic-ex PCD types=0D #=0D -gDYNAMIC_EX_PCD =3D [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT, \=0D - TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]=0D +gDYNAMIC_EX_PCD =3D [TAB_PCDS_DYNAMIC_EX, TAB_PCDS_DYNAMIC_EX_DEFAULT,=0D + TAB_PCDS_DYNAMIC_EX_VPD, TAB_PCDS_DYNAMIC_EX_HII]=0D =0D TAB_PCDS_FIXED_AT_BUILD_NULL =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD=0D TAB_PCDS_FIXED_AT_BUILD_COMMON =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \= =0D -TAB_SPLIT + TAB_ARCH_COMMON=0D + TAB_SPLIT + TAB_ARCH_COMMON=0D TAB_PCDS_FIXED_AT_BUILD_IA32 =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \=0D -TAB_SPLIT + TAB_ARCH_IA32=0D + TAB_SPLIT + TAB_ARCH_IA32=0D TAB_PCDS_FIXED_AT_BUILD_X64 =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \=0D -TAB_SPLIT + TAB_ARCH_X64=0D + TAB_SPLIT + TAB_ARCH_X64=0D TAB_PCDS_FIXED_AT_BUILD_IPF =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \=0D -TAB_SPLIT + TAB_ARCH_IPF=0D + TAB_SPLIT + TAB_ARCH_IPF=0D TAB_PCDS_FIXED_AT_BUILD_ARM =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \=0D -TAB_SPLIT + TAB_ARCH_ARM=0D + TAB_SPLIT + TAB_ARCH_ARM=0D TAB_PCDS_FIXED_AT_BUILD_EBC =3D TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + \=0D -TAB_SPLIT + TAB_ARCH_EBC=0D + TAB_SPLIT + TAB_ARCH_EBC=0D =0D TAB_PCDS_PATCHABLE_IN_MODULE_NULL =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MOD= ULE=0D TAB_PCDS_PATCHABLE_IN_MODULE_COMMON =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_M= ODULE \=0D -+ TAB_SPLIT + TAB_ARCH_COMMON=0D + + TAB_SPLIT + TAB_ARCH_COMMON=0D TAB_PCDS_PATCHABLE_IN_MODULE_IA32 =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MOD= ULE + \=0D -TAB_SPLIT + TAB_ARCH_IA32=0D + TAB_SPLIT + TAB_ARCH_IA32=0D TAB_PCDS_PATCHABLE_IN_MODULE_X64 =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + \=0D -TAB_SPLIT + TAB_ARCH_X64=0D + TAB_SPLIT + TAB_ARCH_X64=0D TAB_PCDS_PATCHABLE_IN_MODULE_IPF =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + \=0D -TAB_SPLIT + TAB_ARCH_IPF=0D + TAB_SPLIT + TAB_ARCH_IPF=0D TAB_PCDS_PATCHABLE_IN_MODULE_ARM =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + \=0D -TAB_SPLIT + TAB_ARCH_ARM=0D + TAB_SPLIT + TAB_ARCH_ARM=0D TAB_PCDS_PATCHABLE_IN_MODULE_EBC =3D TAB_PCDS + TAB_PCDS_PATCHABLE_IN_MODU= LE + \=0D -TAB_SPLIT + TAB_ARCH_EBC=0D + TAB_SPLIT + TAB_ARCH_EBC=0D =0D TAB_PCDS_FEATURE_FLAG_NULL =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG=0D TAB_PCDS_FEATURE_FLAG_COMMON =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SP= LIT \=0D -+ TAB_ARCH_COMMON=0D + + TAB_ARCH_COMMON=0D TAB_PCDS_FEATURE_FLAG_IA32 =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLI= T + \=0D -TAB_ARCH_IA32=0D + TAB_ARCH_IA32=0D TAB_PCDS_FEATURE_FLAG_X64 =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + \=0D -TAB_ARCH_X64=0D + TAB_ARCH_X64=0D TAB_PCDS_FEATURE_FLAG_IPF =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + \=0D -TAB_ARCH_IPF=0D + TAB_ARCH_IPF=0D TAB_PCDS_FEATURE_FLAG_ARM =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + \=0D -TAB_ARCH_ARM=0D + TAB_ARCH_ARM=0D TAB_PCDS_FEATURE_FLAG_EBC =3D TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT= + \=0D -TAB_ARCH_EBC=0D + TAB_ARCH_EBC=0D =0D TAB_PCDS_DYNAMIC_EX_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX=0D TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAUL= T=0D TAB_PCDS_DYNAMIC_EX_HII_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII=0D TAB_PCDS_DYNAMIC_EX_VPD_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD=0D TAB_PCDS_DYNAMIC_EX_COMMON =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT = + \=0D -TAB_ARCH_COMMON=0D + TAB_ARCH_COMMON=0D TAB_PCDS_DYNAMIC_EX_IA32 =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + = \=0D -TAB_ARCH_IA32=0D + TAB_ARCH_IA32=0D TAB_PCDS_DYNAMIC_EX_X64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \= =0D -TAB_ARCH_X64=0D + TAB_ARCH_X64=0D TAB_PCDS_DYNAMIC_EX_IPF =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \= =0D -TAB_ARCH_IPF=0D + TAB_ARCH_IPF=0D TAB_PCDS_DYNAMIC_EX_ARM =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \= =0D -TAB_ARCH_ARM=0D + TAB_ARCH_ARM=0D TAB_PCDS_DYNAMIC_EX_EBC =3D TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + \= =0D -TAB_ARCH_EBC=0D + TAB_ARCH_EBC=0D =0D TAB_PCDS_DYNAMIC_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC=0D TAB_PCDS_DYNAMIC_DEFAULT_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT=0D TAB_PCDS_DYNAMIC_HII_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_HII=0D TAB_PCDS_DYNAMIC_VPD_NULL =3D TAB_PCDS + TAB_PCDS_DYNAMIC_VPD=0D TAB_PCDS_DYNAMIC_COMMON =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + \=0D -TAB_ARCH_COMMON=0D + TAB_ARCH_COMMON=0D TAB_PCDS_DYNAMIC_IA32 =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_AR= CH_IA32=0D TAB_PCDS_DYNAMIC_X64 =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_X64=0D TAB_PCDS_DYNAMIC_IPF =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_IPF=0D TAB_PCDS_DYNAMIC_ARM =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_ARM=0D TAB_PCDS_DYNAMIC_EBC =3D TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARC= H_EBC=0D =0D -TAB_PCD_DYNAMIC_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_DEFAULT_NULL, \=0D - TAB_PCDS_DYNAMIC_VPD_NULL, \=0D +TAB_PCD_DYNAMIC_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_DEFAULT_NULL,=0D + TAB_PCDS_DYNAMIC_VPD_NULL,=0D TAB_PCDS_DYNAMIC_HII_NULL]=0D -TAB_PCD_DYNAMIC_EX_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, \=0D - TAB_PCDS_DYNAMIC_EX_VPD_NULL, \=0D +TAB_PCD_DYNAMIC_EX_TYPE_LIST =3D [TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL,=0D + TAB_PCDS_DYNAMIC_EX_VPD_NULL,=0D TAB_PCDS_DYNAMIC_EX_HII_NULL]=0D =0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE =3D \=0D -'PcdLoadFixAddressPeiCodePageNumber'=0D + 'PcdLoadFixAddressPeiCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE =3D 'UINT32'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE =3D \=0D -'PcdLoadFixAddressBootTimeCodePageNumber'=0D + 'PcdLoadFixAddressBootTimeCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE =3D 'UINT32'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE =3D \=0D -'PcdLoadFixAddressRuntimeCodePageNumber'=0D + 'PcdLoadFixAddressRuntimeCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE =3D 'UINT3= 2'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE =3D \=0D -'PcdLoadFixAddressSmmCodePageNumber'=0D + 'PcdLoadFixAddressSmmCodePageNumber'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE =3D 'UINT32'=0D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_LIST =3D \=0D -[TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE, \=0D -TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE, \=0D -TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE, \=0D -TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE]=0D -PCD_SECTION_LIST =3D [TAB_PCDS_FIXED_AT_BUILD_NULL.upper(), \=0D - TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(), \=0D - TAB_PCDS_FEATURE_FLAG_NULL.upper(), \=0D - TAB_PCDS_DYNAMIC_EX_NULL.upper(), \=0D + [TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE,=0D + TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE]=0D +PCD_SECTION_LIST =3D [TAB_PCDS_FIXED_AT_BUILD_NULL.upper(),=0D + TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(),=0D + TAB_PCDS_FEATURE_FLAG_NULL.upper(),=0D + TAB_PCDS_DYNAMIC_EX_NULL.upper(),=0D TAB_PCDS_DYNAMIC_NULL.upper()]=0D -INF_PCD_SECTION_LIST =3D ["FixedPcd".upper(), "FeaturePcd".upper(), \=0D +INF_PCD_SECTION_LIST =3D ["FixedPcd".upper(), "FeaturePcd".upper(),=0D "PatchPcd".upper(), "Pcd".upper(), "PcdEx".upper()= ]=0D =0D TAB_DEPEX =3D 'Depex'=0D @@ -692,7 +693,7 @@ TAB_INF_DEFINES_EFI_SPECIFICATION_VERSION =3D 'EFI_SPEC= IFICATION_VERSION' TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION =3D 'UEFI_SPECIFICATION_VERSION= '=0D TAB_INF_DEFINES_PI_SPECIFICATION_VERSION =3D 'PI_SPECIFICATION_VERSION'=0D TAB_INF_DEFINES_EDK_RELEASE_VERSION =3D 'EDK_RELEASE_VERSION'=0D -TAB_INF_DEFINES_MODULE_UNI_FILE =3D 'MODULE_UNI_FILE'=0D +TAB_INF_DEFINES_MODULE_UNI_FILE =3D 'MODULE_UNI_FILE'=0D TAB_INF_DEFINES_BINARY_MODULE =3D 'BINARY_MODULE'=0D TAB_INF_DEFINES_LIBRARY_CLASS =3D 'LIBRARY_CLASS'=0D TAB_INF_DEFINES_COMPONENT_TYPE =3D 'COMPONENT_TYPE'=0D @@ -702,7 +703,7 @@ TAB_INF_DEFINES_BUILD_TYPE =3D 'BUILD_TYPE' TAB_INF_DEFINES_FFS_EXT =3D 'FFS_EXT'=0D TAB_INF_DEFINES_FV_EXT =3D 'FV_EXT'=0D TAB_INF_DEFINES_SOURCE_FV =3D 'SOURCE_FV'=0D -TAB_INF_DEFINES_PACKAGE =3D 'PACKAGE'=0D +TAB_INF_DEFINES_PACKAGE =3D 'PACKAGE'=0D TAB_INF_DEFINES_VERSION_NUMBER =3D 'VERSION_NUMBER'=0D TAB_INF_DEFINES_VERSION =3D 'VERSION'=0D TAB_INF_DEFINES_VERSION_STRING =3D 'VERSION_STRING'=0D @@ -712,11 +713,11 @@ TAB_INF_DEFINES_ENTRY_POINT =3D 'ENTRY_POINT' TAB_INF_DEFINES_UNLOAD_IMAGE =3D 'UNLOAD_IMAGE'=0D TAB_INF_DEFINES_CONSTRUCTOR =3D 'CONSTRUCTOR'=0D TAB_INF_DEFINES_DESTRUCTOR =3D 'DESTRUCTOR'=0D -TAB_INF_DEFINES_PCI_VENDOR_ID =3D 'PCI_VENDOR_ID'=0D -TAB_INF_DEFINES_PCI_DEVICE_ID =3D 'PCI_DEVICE_ID'=0D +TAB_INF_DEFINES_PCI_VENDOR_ID =3D 'PCI_VENDOR_ID'=0D +TAB_INF_DEFINES_PCI_DEVICE_ID =3D 'PCI_DEVICE_ID'=0D TAB_INF_DEFINES_PCI_CLASS_CODE =3D 'PCI_CLASS_CODE'=0D -TAB_INF_DEFINES_PCI_REVISION =3D 'PCI_REVISION'=0D -TAB_INF_DEFINES_PCI_COMPRESS =3D 'PCI_COMPRESS'=0D +TAB_INF_DEFINES_PCI_REVISION =3D 'PCI_REVISION'=0D +TAB_INF_DEFINES_PCI_COMPRESS =3D 'PCI_COMPRESS'=0D TAB_INF_DEFINES_DEFINE =3D 'DEFINE'=0D TAB_INF_DEFINES_SPEC =3D 'SPEC'=0D TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION =3D 'UEFI_HII_RESOURCE_SECTION'= =0D @@ -744,7 +745,7 @@ TAB_DEC_DEFINES_DEC_SPECIFICATION =3D 'DEC_SPECIFICATIO= N' TAB_DEC_DEFINES_PACKAGE_NAME =3D 'PACKAGE_NAME'=0D TAB_DEC_DEFINES_PACKAGE_GUID =3D 'PACKAGE_GUID'=0D TAB_DEC_DEFINES_PACKAGE_VERSION =3D 'PACKAGE_VERSION'=0D -TAB_DEC_DEFINES_PKG_UNI_FILE =3D 'PACKAGE_UNI_FILE'=0D +TAB_DEC_DEFINES_PKG_UNI_FILE =3D 'PACKAGE_UNI_FILE'=0D TAB_DEC_PACKAGE_ABSTRACT =3D 'STR_PACKAGE_ABSTRACT'=0D TAB_DEC_PACKAGE_DESCRIPTION =3D 'STR_PACKAGE_DESCRIPTION'=0D TAB_DEC_PACKAGE_LICENSE =3D 'STR_PACKAGE_LICENSE'=0D @@ -829,12 +830,12 @@ DATABASE_PATH =3D ":memory:" #=0D # used by ECC=0D #=0D -MODIFIER_LIST =3D ['IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVI= CE', \=0D +MODIFIER_LIST =3D ['IN', 'OUT', 'OPTIONAL', 'UNALIGNED', 'EFI_RUNTIMESERVI= CE',=0D 'EFI_BOOTSERVICE', 'EFIAPI']=0D #=0D # Dependency Expression=0D #=0D -DEPEX_SUPPORTED_OPCODE =3D ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT",= \=0D +DEPEX_SUPPORTED_OPCODE =3D ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT",= =0D "END", "SOR", "TRUE", "FALSE", '(', ')']=0D =0D TAB_STATIC_LIBRARY =3D "STATIC-LIBRARY-FILE"=0D @@ -851,13 +852,13 @@ TAB_DEFAULT_BINARY_FILE =3D "_BINARY_FILE_" # inf files=0D #=0D HEADER_COMMENT_NOT_STARTED =3D -1=0D -HEADER_COMMENT_STARTED =3D 0=0D -HEADER_COMMENT_FILE =3D 1=0D -HEADER_COMMENT_ABSTRACT =3D 2=0D +HEADER_COMMENT_STARTED =3D 0=0D +HEADER_COMMENT_FILE =3D 1=0D +HEADER_COMMENT_ABSTRACT =3D 2=0D HEADER_COMMENT_DESCRIPTION =3D 3=0D -HEADER_COMMENT_COPYRIGHT =3D 4=0D -HEADER_COMMENT_LICENSE =3D 5=0D -HEADER_COMMENT_END =3D 6=0D +HEADER_COMMENT_COPYRIGHT =3D 4=0D +HEADER_COMMENT_LICENSE =3D 5=0D +HEADER_COMMENT_END =3D 6=0D =0D #=0D # Static values for data models=0D diff --git a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py b/Ba= seTools/Source/Python/UPT/Library/ExpressionValidate.py index 7718ca12e5cf..da2d2da73d73 100644 --- a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py +++ b/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to check PCD logical expression=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -16,13 +16,15 @@ from __future__ import print_function import re=0D from Logger import StringTable as ST=0D =0D -## IsValidBareCString=0D +# IsValidBareCString=0D #=0D # Check if String is comprised by whitespace(0x20), !(0x21), 0x23 - 0x7E=0D # or '\n', '\t', '\f', '\r', '\b', '\0', '\\'=0D #=0D # @param String: string to be checked=0D #=0D +=0D +=0D def IsValidBareCString(String):=0D EscapeList =3D ['n', 't', 'f', 'r', 'b', '0', '\\', '"']=0D PreChar =3D ''=0D @@ -38,7 +40,7 @@ def IsValidBareCString(String): else:=0D IntChar =3D ord(Char)=0D if IntChar !=3D 0x20 and IntChar !=3D 0x09 and IntChar !=3D 0x= 21 \=0D - and (IntChar < 0x23 or IntChar > 0x7e):=0D + and (IntChar < 0x23 or IntChar > 0x7e):=0D return False=0D PreChar =3D Char=0D =0D @@ -47,6 +49,7 @@ def IsValidBareCString(String): return False=0D return True=0D =0D +=0D def _ValidateToken(Token):=0D Token =3D Token.strip()=0D Index =3D Token.find("\"")=0D @@ -54,31 +57,36 @@ def _ValidateToken(Token): return IsValidBareCString(Token[Index+1:-1])=0D return True=0D =0D -## _ExprError=0D +# _ExprError=0D #=0D # @param Exception: Exception=0D #=0D +=0D +=0D class _ExprError(Exception):=0D - def __init__(self, Error =3D ''):=0D + def __init__(self, Error=3D''):=0D Exception.__init__(self)=0D self.Error =3D Error=0D =0D -## _ExprBase=0D +# _ExprBase=0D #=0D +=0D +=0D class _ExprBase:=0D HEX_PATTERN =3D '[\t\s]*0[xX][a-fA-F0-9]+'=0D INT_PATTERN =3D '[\t\s]*[0-9]+'=0D MACRO_PATTERN =3D '[\t\s]*\$\(([A-Z][_A-Z0-9]*)\)'=0D PCD_PATTERN =3D \=0D - '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*'= =0D + '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_= ]*'=0D QUOTED_PATTERN =3D '[\t\s]*L?"[^"]*"'=0D BOOL_PATTERN =3D '[\t\s]*(true|True|TRUE|false|False|FALSE)'=0D +=0D def __init__(self, Token):=0D self.Token =3D Token=0D self.Index =3D 0=0D self.Len =3D len(Token)=0D =0D - ## SkipWhitespace=0D + # SkipWhitespace=0D #=0D def SkipWhitespace(self):=0D for Char in self.Token[self.Index:]:=0D @@ -86,7 +94,7 @@ class _ExprBase: break=0D self.Index +=3D 1=0D =0D - ## IsCurrentOp=0D + # IsCurrentOp=0D #=0D # @param OpList: option list=0D #=0D @@ -95,11 +103,11 @@ class _ExprBase: LetterOp =3D ["EQ", "NE", "GE", "LE", "GT", "LT", "NOT", "and", "A= ND",=0D "or", "OR", "XOR"]=0D OpMap =3D {=0D - '|' : '|',=0D - '&' : '&',=0D - '!' : '=3D',=0D - '>' : '=3D',=0D - '<' : '=3D'=0D + '|': '|',=0D + '&': '&',=0D + '!': '=3D',=0D + '>': '=3D',=0D + '<': '=3D'=0D }=0D =0D for Operator in OpList:=0D @@ -107,10 +115,10 @@ class _ExprBase: continue=0D =0D self.Index +=3D len(Operator)=0D - Char =3D self.Token[self.Index : self.Index + 1]=0D + Char =3D self.Token[self.Index: self.Index + 1]=0D =0D if (Operator in LetterOp and (Char =3D=3D '_' or Char.isalnum(= ))) \=0D - or (Operator in OpMap and OpMap[Operator] =3D=3D Char):=0D + or (Operator in OpMap and OpMap[Operator] =3D=3D Char)= :=0D self.Index -=3D len(Operator)=0D break=0D =0D @@ -118,10 +126,12 @@ class _ExprBase: =0D return False=0D =0D -## _LogicalExpressionParser=0D +# _LogicalExpressionParser=0D #=0D # @param _ExprBase: _ExprBase object=0D #=0D +=0D +=0D class _LogicalExpressionParser(_ExprBase):=0D #=0D # STRINGITEM can only be logical field according to spec=0D @@ -147,21 +157,21 @@ class _LogicalExpressionParser(_ExprBase): for Match in MatchList:=0D if Match and Match.start() =3D=3D 0:=0D if not _ValidateToken(=0D - self.Token[self.Index:self.Index+Match.end()]= =0D - ):=0D + self.Token[self.Index:self.Index+Match.end()]=0D + ):=0D return False=0D =0D self.Index +=3D Match.end()=0D if self.Token[self.Index - 1] =3D=3D '"':=0D return True=0D if self.Token[self.Index:self.Index+1] =3D=3D '_' or \=0D - self.Token[self.Index:self.Index+1].isalnum():=0D + self.Token[self.Index:self.Index+1].isalnum():=0D self.Index -=3D Match.end()=0D return False=0D =0D Token =3D self.Token[self.Index - Match.end():self.Index]= =0D if Token.strip() in ["EQ", "NE", "GE", "LE", "GT", "LT",=0D - "NOT", "and", "AND", "or", "OR", "XOR"]:=0D + "NOT", "and", "AND", "or", "OR", "XOR= "]:=0D self.Index -=3D Match.end()=0D return False=0D =0D @@ -192,7 +202,6 @@ class _LogicalExpressionParser(_ExprBase): =0D return self._CheckToken([Match1, Match2, Match3, Match4])=0D =0D -=0D def IsAtomicItem(self):=0D #=0D # Macro=0D @@ -208,18 +217,18 @@ class _LogicalExpressionParser(_ExprBase): # Quoted string=0D #=0D Match3 =3D re.compile(self.QUOTED_PATTERN).\=0D - match(self.Token[self.Index:].replace('\\\\', '//').\=0D + match(self.Token[self.Index:].replace('\\\\', '//').=0D replace('\\\"', '\\\''))=0D =0D return self._CheckToken([Match1, Match2, Match3])=0D =0D - ## A || B=0D + # A || B=0D #=0D def LogicalExpression(self):=0D Ret =3D self.SpecNot()=0D while self.IsCurrentOp(['||', 'OR', 'or', '&&', 'AND', 'and', 'XOR= ', 'xor', '^']):=0D if self.Token[self.Index-1] =3D=3D '|' and self.Parens <=3D 0:= =0D - raise _ExprError(ST.ERR_EXPR_OR % self.Token)=0D + raise _ExprError(ST.ERR_EXPR_OR % self.Token)=0D if Ret not in [self.ARITH, self.LOGICAL, self.REALLOGICAL, sel= f.STRINGITEM]:=0D raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)=0D Ret =3D self.SpecNot()=0D @@ -253,7 +262,7 @@ class _LogicalExpressionParser(_ExprBase): Ret =3D self.Factor()=0D while self.IsCurrentOp(["+", "-", "&", "|", "^", "XOR", "xor"]):=0D if self.Token[self.Index-1] =3D=3D '|' and self.Parens <=3D 0:= =0D - raise _ExprError(ST.ERR_EXPR_OR)=0D + raise _ExprError(ST.ERR_EXPR_OR)=0D if Ret =3D=3D self.STRINGITEM or Ret =3D=3D self.REALLOGICAL:= =0D raise _ExprError(ST.ERR_EXPR_LOGICAL % self.Token)=0D Ret =3D self.Factor()=0D @@ -262,14 +271,14 @@ class _LogicalExpressionParser(_ExprBase): Ret =3D self.ARITH=0D return Ret=0D =0D - ## Factor=0D + # Factor=0D #=0D def Factor(self):=0D if self.IsCurrentOp(["("]):=0D self.Parens +=3D 1=0D Ret =3D self.LogicalExpression()=0D if not self.IsCurrentOp([")"]):=0D - raise _ExprError(ST.ERR_EXPR_RIGHT_PAREN % \=0D + raise _ExprError(ST.ERR_EXPR_RIGHT_PAREN %=0D (self.Token, self.Token[self.Index:]))=0D self.Parens -=3D 1=0D return Ret=0D @@ -281,10 +290,10 @@ class _LogicalExpressionParser(_ExprBase): elif self.IsAtomicNumVal():=0D return self.ARITH=0D else:=0D - raise _ExprError(ST.ERR_EXPR_FACTOR % \=0D + raise _ExprError(ST.ERR_EXPR_FACTOR %=0D (self.Token[self.Index:], self.Token))=0D =0D - ## IsValidLogicalExpression=0D + # IsValidLogicalExpression=0D #=0D def IsValidLogicalExpression(self):=0D if self.Len =3D=3D 0:=0D @@ -296,16 +305,19 @@ class _LogicalExpressionParser(_ExprBase): return False, XExcept.Error=0D self.SkipWhitespace()=0D if self.Index !=3D self.Len:=0D - return False, (ST.ERR_EXPR_BOOLEAN % \=0D + return False, (ST.ERR_EXPR_BOOLEAN %=0D (self.Token[self.Index:], self.Token))=0D return True, ''=0D =0D -## _ValidRangeExpressionParser=0D +# _ValidRangeExpressionParser=0D #=0D +=0D +=0D class _ValidRangeExpressionParser(_ExprBase):=0D INT_RANGE_PATTERN =3D '[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+'=0D HEX_RANGE_PATTERN =3D \=0D '[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+'=0D +=0D def __init__(self, Token):=0D _ExprBase.__init__(self, Token)=0D self.Parens =3D 0=0D @@ -314,7 +326,7 @@ class _ValidRangeExpressionParser(_ExprBase): self.IsParenHappen =3D False=0D self.IsLogicalOpHappen =3D False=0D =0D - ## IsValidRangeExpression=0D + # IsValidRangeExpression=0D #=0D def IsValidRangeExpression(self):=0D if self.Len =3D=3D 0:=0D @@ -330,7 +342,7 @@ class _ValidRangeExpressionParser(_ExprBase): return False, (ST.ERR_EXPR_RANGE % self.Token)=0D return True, ''=0D =0D - ## RangeExpression=0D + # RangeExpression=0D #=0D def RangeExpression(self):=0D Ret =3D self.Unary()=0D @@ -346,7 +358,7 @@ class _ValidRangeExpressionParser(_ExprBase): =0D return Ret=0D =0D - ## Unary=0D + # Unary=0D #=0D def Unary(self):=0D if self.IsCurrentOp(["NOT"]):=0D @@ -354,7 +366,7 @@ class _ValidRangeExpressionParser(_ExprBase): =0D return self.ValidRange()=0D =0D - ## ValidRange=0D + # ValidRange=0D #=0D def ValidRange(self):=0D Ret =3D -1=0D @@ -363,7 +375,8 @@ class _ValidRangeExpressionParser(_ExprBase): self.IsParenHappen =3D True=0D self.Parens +=3D 1=0D if self.Parens > 1:=0D - raise _ExprError(ST.ERR_EXPR_RANGE_DOUBLE_PAREN_NESTED % s= elf.Token)=0D + raise _ExprError(=0D + ST.ERR_EXPR_RANGE_DOUBLE_PAREN_NESTED % self.Token)=0D Ret =3D self.RangeExpression()=0D if not self.IsCurrentOp([")"]):=0D raise _ExprError(ST.ERR_EXPR_RIGHT_PAREN % self.Token)=0D @@ -385,14 +398,15 @@ class _ValidRangeExpressionParser(_ExprBase): self.Index +=3D IntMatch.end()=0D Ret =3D self.INT=0D else:=0D - raise _ExprError(ST.ERR_EXPR_RANGE_FACTOR % (self.Token[se= lf.Index:], self.Token))=0D + raise _ExprError(ST.ERR_EXPR_RANGE_FACTOR %=0D + (self.Token[self.Index:], self.Token))=0D else:=0D IntRangeMatch =3D re.compile(=0D self.INT_RANGE_PATTERN).match(self.Token[self.Index:]=0D - )=0D + )=0D HexRangeMatch =3D re.compile(=0D self.HEX_RANGE_PATTERN).match(self.Token[self.Index:]=0D - )=0D + )=0D if HexRangeMatch and HexRangeMatch.start() =3D=3D 0:=0D self.Index +=3D HexRangeMatch.end()=0D Ret =3D self.HEX=0D @@ -404,10 +418,13 @@ class _ValidRangeExpressionParser(_ExprBase): =0D return Ret=0D =0D -## _ValidListExpressionParser=0D +# _ValidListExpressionParser=0D #=0D +=0D +=0D class _ValidListExpressionParser(_ExprBase):=0D VALID_LIST_PATTERN =3D '(0[xX][0-9a-fA-F]+|[0-9]+)([\t\s]*,[\t\s]*(0[x= X][0-9a-fA-F]+|[0-9]+))*'=0D +=0D def __init__(self, Token):=0D _ExprBase.__init__(self, Token)=0D self.NUM =3D 1=0D @@ -430,7 +447,8 @@ class _ValidListExpressionParser(_ExprBase): def ListExpression(self):=0D Ret =3D -1=0D self.SkipWhitespace()=0D - ListMatch =3D re.compile(self.VALID_LIST_PATTERN).match(self.Token= [self.Index:])=0D + ListMatch =3D re.compile(self.VALID_LIST_PATTERN).match(=0D + self.Token[self.Index:])=0D if ListMatch and ListMatch.start() =3D=3D 0:=0D self.Index +=3D ListMatch.end()=0D Ret =3D self.NUM=0D @@ -439,13 +457,15 @@ class _ValidListExpressionParser(_ExprBase): =0D return Ret=0D =0D -## _StringTestParser=0D +# _StringTestParser=0D #=0D +=0D +=0D class _StringTestParser(_ExprBase):=0D def __init__(self, Token):=0D _ExprBase.__init__(self, Token)=0D =0D - ## IsValidStringTest=0D + # IsValidStringTest=0D #=0D def IsValidStringTest(self):=0D if self.Len =3D=3D 0:=0D @@ -456,11 +476,11 @@ class _StringTestParser(_ExprBase): return False, XExcept.Error=0D return True, ''=0D =0D - ## StringItem=0D + # StringItem=0D #=0D def StringItem(self):=0D Match1 =3D re.compile(self.QUOTED_PATTERN)\=0D - .match(self.Token[self.Index:].replace('\\\\', '//')\=0D + .match(self.Token[self.Index:].replace('\\\\', '//')=0D .replace('\\\"', '\\\''))=0D Match2 =3D re.compile(self.MACRO_PATTERN).match(self.Token[self.In= dex:])=0D Match3 =3D re.compile(self.PCD_PATTERN).match(self.Token[self.Inde= x:])=0D @@ -468,30 +488,30 @@ class _StringTestParser(_ExprBase): for Match in MatchList:=0D if Match and Match.start() =3D=3D 0:=0D if not _ValidateToken(=0D - self.Token[self.Index:self.Index+Match.end()]= =0D - ):=0D - raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \=0D + self.Token[self.Index:self.Index+Match.end()]=0D + ):=0D + raise _ExprError(ST.ERR_EXPR_STRING_ITEM %=0D (self.Token, self.Token[self.Index:])= )=0D self.Index +=3D Match.end()=0D Token =3D self.Token[self.Index - Match.end():self.Index]= =0D if Token.strip() in ["EQ", "NE"]:=0D - raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \=0D - (self.Token, self.Token[self.Index:]))=0D + raise _ExprError(ST.ERR_EXPR_STRING_ITEM %=0D + (self.Token, self.Token[self.Index:])= )=0D return=0D else:=0D - raise _ExprError(ST.ERR_EXPR_STRING_ITEM % \=0D + raise _ExprError(ST.ERR_EXPR_STRING_ITEM %=0D (self.Token, self.Token[self.Index:]))=0D =0D - ## StringTest=0D + # StringTest=0D #=0D def StringTest(self):=0D self.StringItem()=0D if not self.IsCurrentOp(["=3D=3D", "EQ", "!=3D", "NE"]):=0D - raise _ExprError(ST.ERR_EXPR_EQUALITY % \=0D + raise _ExprError(ST.ERR_EXPR_EQUALITY %=0D (self.Token[self.Index:], self.Token))=0D self.StringItem()=0D if self.Index !=3D self.Len:=0D - raise _ExprError(ST.ERR_EXPR_BOOLEAN % \=0D + raise _ExprError(ST.ERR_EXPR_BOOLEAN %=0D (self.Token[self.Index:], self.Token))=0D =0D ##=0D @@ -499,6 +519,8 @@ class _StringTestParser(_ExprBase): #=0D # @param Token: string test token=0D #=0D +=0D +=0D def IsValidStringTest(Token, Flag=3DFalse):=0D #=0D # Not do the check right now, keep the implementation for future enhan= cement.=0D @@ -526,6 +548,8 @@ def IsValidLogicalExpr(Token, Flag=3DFalse): #=0D # @param Token: range expression token=0D #=0D +=0D +=0D def IsValidRangeExpr(Token):=0D return _ValidRangeExpressionParser(Token).IsValidRangeExpression()=0D =0D @@ -534,6 +558,8 @@ def IsValidRangeExpr(Token): #=0D # @param Token: value list expression token=0D #=0D +=0D +=0D def IsValidListExpr(Token):=0D return _ValidListExpressionParser(Token).IsValidListExpression()=0D =0D @@ -542,6 +568,8 @@ def IsValidListExpr(Token): #=0D # @param Token: feature flag expression=0D #=0D +=0D +=0D def IsValidFeatureFlagExp(Token, Flag=3DFalse):=0D #=0D # Not do the check right now, keep the implementation for future enhan= cement.=0D @@ -559,9 +587,8 @@ def IsValidFeatureFlagExp(Token, Flag=3DFalse): return False, Cause=0D return True, ""=0D =0D +=0D if __name__ =3D=3D '__main__':=0D -# print IsValidRangeExpr('LT 9')=0D - print(_LogicalExpressionParser('gCrownBayTokenSpaceGuid.PcdPciDevice1B= ridgeAddressLE0').IsValidLogicalExpression())=0D -=0D -=0D -=0D + # print IsValidRangeExpr('LT 9')=0D + print(_LogicalExpressionParser(=0D + 'gCrownBayTokenSpaceGuid.PcdPciDevice1BridgeAddressLE0').IsValidLo= gicalExpression())=0D diff --git a/BaseTools/Source/Python/UPT/Library/GlobalData.py b/BaseTools/= Source/Python/UPT/Library/GlobalData.py index 8e88fb1e3fde..ae76425f20d9 100644 --- a/BaseTools/Source/Python/UPT/Library/GlobalData.py +++ b/BaseTools/Source/Python/UPT/Library/GlobalData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common static strings and global data used b= y UPT=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source= /Python/UPT/Library/Misc.py index 77ba3584e000..f6880e02b450 100644 --- a/BaseTools/Source/Python/UPT/Library/Misc.py +++ b/BaseTools/Source/Python/UPT/Library/Misc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Common routines used by all tools=0D #=0D # Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
        =0D @@ -46,11 +46,13 @@ from Object.POM.CommonObject import TextObject from Core.FileHook import __FileHookOpen__=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C= =0D +# Convert GUID string in xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx style to C=0D # structure style=0D #=0D # @param Guid: The GUID string=0D #=0D +=0D +=0D def GuidStringToGuidStructureString(Guid):=0D GuidList =3D Guid.split('-')=0D Result =3D '{'=0D @@ -62,18 +64,20 @@ def GuidStringToGuidStructureString(Guid): Result +=3D '}}'=0D return Result=0D =0D -## Check whether GUID string is of format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx= xxxx=0D +# Check whether GUID string is of format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx= xxx=0D #=0D # @param GuidValue: The GUID value=0D #=0D +=0D +=0D def CheckGuidRegFormat(GuidValue):=0D - ## Regular expression used to find out register format of GUID=0D + # Regular expression used to find out register format of GUID=0D #=0D RegFormatGuidPattern =3D re.compile("^\s*([0-9a-fA-F]){8}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){12}\s*$")=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){12}\s*$")=0D =0D if RegFormatGuidPattern.match(GuidValue):=0D return True=0D @@ -81,38 +85,40 @@ def CheckGuidRegFormat(GuidValue): return False=0D =0D =0D -## Convert GUID string in C structure style to=0D +# Convert GUID string in C structure style to=0D # xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx=0D #=0D # @param GuidValue: The GUID value in C structure format=0D #=0D def GuidStructureStringToGuidString(GuidValue):=0D GuidValueString =3D GuidValue.lower().replace("{", "").replace("}", ""= ).\=0D - replace(" ", "").replace(";", "")=0D + replace(" ", "").replace(";", "")=0D GuidValueList =3D GuidValueString.split(",")=0D if len(GuidValueList) !=3D 11:=0D return ''=0D try:=0D return "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x" % (=0D - int(GuidValueList[0], 16),=0D - int(GuidValueList[1], 16),=0D - int(GuidValueList[2], 16),=0D - int(GuidValueList[3], 16),=0D - int(GuidValueList[4], 16),=0D - int(GuidValueList[5], 16),=0D - int(GuidValueList[6], 16),=0D - int(GuidValueList[7], 16),=0D - int(GuidValueList[8], 16),=0D - int(GuidValueList[9], 16),=0D - int(GuidValueList[10], 16)=0D - )=0D + int(GuidValueList[0], 16),=0D + int(GuidValueList[1], 16),=0D + int(GuidValueList[2], 16),=0D + int(GuidValueList[3], 16),=0D + int(GuidValueList[4], 16),=0D + int(GuidValueList[5], 16),=0D + int(GuidValueList[6], 16),=0D + int(GuidValueList[7], 16),=0D + int(GuidValueList[8], 16),=0D + int(GuidValueList[9], 16),=0D + int(GuidValueList[10], 16)=0D + )=0D except BaseException:=0D return ''=0D =0D -## Create directories=0D +# Create directories=0D #=0D # @param Directory: The directory name=0D #=0D +=0D +=0D def CreateDirectory(Directory):=0D if Directory is None or Directory.strip() =3D=3D "":=0D return True=0D @@ -123,13 +129,15 @@ def CreateDirectory(Directory): return False=0D return True=0D =0D -## Remove directories, including files and sub-directories in it=0D +# Remove directories, including files and sub-directories in it=0D #=0D # @param Directory: The directory name=0D #=0D +=0D +=0D def RemoveDirectory(Directory, Recursively=3DFalse):=0D if Directory is None or Directory.strip() =3D=3D "" or not \=0D - os.path.exists(Directory):=0D + os.path.exists(Directory):=0D return=0D if Recursively:=0D CurrentDirectory =3D getcwd()=0D @@ -142,7 +150,7 @@ def RemoveDirectory(Directory, Recursively=3DFalse): chdir(CurrentDirectory)=0D rmdir(Directory)=0D =0D -## Store content in file=0D +# Store content in file=0D #=0D # This method is used to save file only when its content is changed. This = is=0D # quite useful for "make" system to decide what will be re-built and what= =0D @@ -153,6 +161,8 @@ def RemoveDirectory(Directory, Recursively=3DFalse): # @param IsBinaryFile: The flag indicating if the file is binary f= ile=0D # or not=0D #=0D +=0D +=0D def SaveFileOnChange(File, Content, IsBinaryFile=3DTrue):=0D if os.path.exists(File):=0D if IsBinaryFile:=0D @@ -186,11 +196,13 @@ def SaveFileOnChange(File, Content, IsBinaryFile=3DTr= ue): =0D return True=0D =0D -## Get all files of a directory=0D +# Get all files of a directory=0D #=0D # @param Root: Root dir=0D # @param SkipList : The files need be skipped=0D #=0D +=0D +=0D def GetFiles(Root, SkipList=3DNone, FullPath=3DTrue):=0D OriPath =3D os.path.normpath(Root)=0D FileList =3D []=0D @@ -215,7 +227,7 @@ def GetFiles(Root, SkipList=3DNone, FullPath=3DTrue): =0D return FileList=0D =0D -## Get all non-metadata files of a directory=0D +# Get all non-metadata files of a directory=0D #=0D # @param Root: Root Dir=0D # @param SkipList : List of path need be skipped=0D @@ -223,6 +235,8 @@ def GetFiles(Root, SkipList=3DNone, FullPath=3DTrue): # @param PrefixPath: the path that need to be added to the files found=0D # @return: the list of files found=0D #=0D +=0D +=0D def GetNonMetaDataFiles(Root, SkipList, FullPath, PrefixPath):=0D FileList =3D GetFiles(Root, SkipList, FullPath)=0D NewFileList =3D []=0D @@ -232,15 +246,18 @@ def GetNonMetaDataFiles(Root, SkipList, FullPath, Pre= fixPath): # skip '.dec', '.inf', '.dsc', '.fdf' files=0D #=0D if ExtName.lower() not in ['.dec', '.inf', '.dsc', '.fdf']:=0D - NewFileList.append(os.path.normpath(os.path.join(PrefixPath, F= ile)))=0D + NewFileList.append(os.path.normpath(=0D + os.path.join(PrefixPath, File)))=0D =0D return NewFileList=0D =0D -## Check if given file exists or not=0D +# Check if given file exists or not=0D #=0D # @param File: File name or path to be checked=0D # @param Dir: The directory the file is relative to=0D #=0D +=0D +=0D def ValidFile(File, Ext=3DNone):=0D File =3D File.replace('\\', '/')=0D if Ext is not None:=0D @@ -251,12 +268,14 @@ def ValidFile(File, Ext=3DNone): return False=0D return True=0D =0D -## RealPath=0D +# RealPath=0D #=0D # @param File: File name or path to be checked=0D # @param Dir: The directory the file is relative to=0D # @param OverrideDir: The override directory=0D #=0D +=0D +=0D def RealPath(File, Dir=3D'', OverrideDir=3D''):=0D NewFile =3D os.path.normpath(os.path.join(Dir, File))=0D NewFile =3D GlobalData.gALL_FILES[NewFile]=0D @@ -265,22 +284,24 @@ def RealPath(File, Dir=3D'', OverrideDir=3D''): NewFile =3D GlobalData.gALL_FILES[NewFile]=0D return NewFile=0D =0D -## RealPath2=0D +# RealPath2=0D #=0D # @param File: File name or path to be checked=0D # @param Dir: The directory the file is relative to=0D # @param OverrideDir: The override directory=0D #=0D +=0D +=0D def RealPath2(File, Dir=3D'', OverrideDir=3D''):=0D if OverrideDir:=0D - NewFile =3D GlobalData.gALL_FILES[os.path.normpath(os.path.join\=0D - (OverrideDir, File= ))]=0D + NewFile =3D GlobalData.gALL_FILES[os.path.normpath(os.path.join=0D + (OverrideDir, Fil= e))]=0D if NewFile:=0D if OverrideDir[-1] =3D=3D os.path.sep:=0D return NewFile[len(OverrideDir):], NewFile[0:len(OverrideD= ir)]=0D else:=0D return NewFile[len(OverrideDir) + 1:], \=0D - NewFile[0:len(OverrideDir)]=0D + NewFile[0:len(OverrideDir)]=0D =0D NewFile =3D GlobalData.gALL_FILES[os.path.normpath(os.path.join(Dir, F= ile))]=0D if NewFile:=0D @@ -294,10 +315,12 @@ def RealPath2(File, Dir=3D'', OverrideDir=3D''): =0D return None, None=0D =0D -## CommonPath=0D +# CommonPath=0D #=0D # @param PathList: PathList=0D #=0D +=0D +=0D def CommonPath(PathList):=0D Path1 =3D min(PathList).split(os.path.sep)=0D Path2 =3D max(PathList).split(os.path.sep)=0D @@ -306,11 +329,13 @@ def CommonPath(PathList): return os.path.sep.join(Path1[:Index])=0D return os.path.sep.join(Path1)=0D =0D -## PathClass=0D +# PathClass=0D #=0D +=0D +=0D class PathClass(object):=0D def __init__(self, File=3D'', Root=3D'', AlterRoot=3D'', Type=3D'', Is= Binary=3DFalse,=0D - Arch=3D'COMMON', ToolChainFamily=3D'', Target=3D'', TagNa= me=3D'', \=0D + Arch=3D'COMMON', ToolChainFamily=3D'', Target=3D'', TagNa= me=3D'',=0D ToolCode=3D''):=0D self.Arch =3D Arch=0D self.File =3D str(File)=0D @@ -366,14 +391,14 @@ class PathClass(object): =0D self._Key =3D None=0D =0D - ## Convert the object of this class to a string=0D + # Convert the object of this class to a string=0D #=0D # Convert member Path of the class to a string=0D #=0D def __str__(self):=0D return self.Path=0D =0D - ## Override __eq__ function=0D + # Override __eq__ function=0D #=0D # Check whether PathClass are the same=0D #=0D @@ -383,27 +408,28 @@ class PathClass(object): else:=0D return self.Path =3D=3D str(Other)=0D =0D - ## Override __hash__ function=0D + # Override __hash__ function=0D #=0D # Use Path as key in hash table=0D #=0D def __hash__(self):=0D return hash(self.Path)=0D =0D - ## _GetFileKey=0D + # _GetFileKey=0D #=0D def _GetFileKey(self):=0D if self._Key is None:=0D self._Key =3D self.Path.upper()=0D return self._Key=0D - ## Validate=0D + # Validate=0D #=0D +=0D def Validate(self, Type=3D'', CaseSensitive=3DTrue):=0D if GlobalData.gCASE_INSENSITIVE:=0D CaseSensitive =3D False=0D if Type and Type.lower() !=3D self.Type:=0D return ToolError.FILE_TYPE_MISMATCH, '%s (expect %s but got %s= )' % \=0D - (self.File, Type, self.Type)=0D + (self.File, Type, self.Type)=0D =0D RealFile, RealRoot =3D RealPath2(self.File, self.Root, self.AlterR= oot)=0D if not RealRoot and not RealFile:=0D @@ -417,12 +443,12 @@ class PathClass(object): ErrorCode =3D 0=0D ErrorInfo =3D ''=0D if RealRoot !=3D self.Root or RealFile !=3D self.File:=0D - if CaseSensitive and (RealFile !=3D self.File or \=0D - (RealRoot !=3D self.Root and RealRoot != =3D \=0D + if CaseSensitive and (RealFile !=3D self.File or=0D + (RealRoot !=3D self.Root and RealRoot != =3D=0D self.AlterRoot)):=0D ErrorCode =3D ToolError.FILE_CASE_MISMATCH=0D ErrorInfo =3D self.File + '\n\t' + RealFile + \=0D - " [in file system]"=0D + " [in file system]"=0D =0D self.SubDir, self.Name =3D os.path.split(RealFile)=0D self.BaseName, self.Ext =3D os.path.splitext(self.Name)=0D @@ -437,10 +463,12 @@ class PathClass(object): =0D Key =3D property(_GetFileKey)=0D =0D -## Get current workspace=0D +# Get current workspace=0D #=0D # get WORKSPACE from environment variable if present,if not use current w= orking directory as WORKSPACE=0D #=0D +=0D +=0D def GetWorkspace():=0D #=0D # check WORKSPACE=0D @@ -463,7 +491,7 @@ def GetWorkspace(): =0D return WorkspaceDir, mws.PACKAGES_PATH=0D =0D -## Get relative path=0D +# Get relative path=0D #=0D # use full path and workspace to get relative path=0D # the destination of this function is mainly to resolve the root path iss= ue(like c: or c:\)=0D @@ -471,22 +499,28 @@ def GetWorkspace(): # @param Fullpath: a string of fullpath=0D # @param Workspace: a string of workspace=0D #=0D +=0D +=0D def GetRelativePath(Fullpath, Workspace):=0D =0D RelativePath =3D ''=0D if Workspace.endswith(os.sep):=0D - RelativePath =3D Fullpath[Fullpath.upper().find(Workspace.upper())= +len(Workspace):]=0D + RelativePath =3D Fullpath[Fullpath.upper().find(=0D + Workspace.upper())+len(Workspace):]=0D else:=0D - RelativePath =3D Fullpath[Fullpath.upper().find(Workspace.upper())= +len(Workspace)+1:]=0D + RelativePath =3D Fullpath[Fullpath.upper().find(=0D + Workspace.upper())+len(Workspace)+1:]=0D =0D return RelativePath=0D =0D -## Check whether all module types are in list=0D +# Check whether all module types are in list=0D #=0D # check whether all module types (SUP_MODULE_LIST) are in list=0D #=0D # @param ModuleList: a list of ModuleType=0D #=0D +=0D +=0D def IsAllModuleList(ModuleList):=0D NewModuleList =3D [Module.upper() for Module in ModuleList]=0D for Module in SUP_MODULE_LIST:=0D @@ -495,12 +529,14 @@ def IsAllModuleList(ModuleList): else:=0D return True=0D =0D -## Dictionary that use comment(GenericComment, TailComment) as value,=0D +# Dictionary that use comment(GenericComment, TailComment) as value,=0D # if a new comment which key already in the dic is inserted, then the=0D # comment will be merged.=0D # Key is (Statement, SupArch), when TailComment is added, it will ident=0D # according to Statement=0D #=0D +=0D +=0D class MergeCommentDict(dict):=0D ## []=3D operator=0D #=0D @@ -509,18 +545,18 @@ class MergeCommentDict(dict): if Key in self:=0D OrigVal1, OrigVal2 =3D dict.__getitem__(self, Key)=0D Statement =3D Key[0]=0D - dict.__setitem__(self, Key, (OrigVal1 + GenericComment, OrigVa= l2 \=0D + dict.__setitem__(self, Key, (OrigVal1 + GenericComment, OrigVa= l2=0D + len(Statement) * ' ' + TailComm= ent))=0D else:=0D dict.__setitem__(self, Key, (GenericComment, TailComment))=0D =0D - ## =3D[] operator=0D + # =3D[] operator=0D #=0D def __getitem__(self, Key):=0D return dict.__getitem__(self, Key)=0D =0D =0D -## GenDummyHelpTextObj=0D +# GenDummyHelpTextObj=0D #=0D # @retval HelpTxt: Generated dummy help text object=0D #=0D @@ -530,7 +566,7 @@ def GenDummyHelpTextObj(): HelpTxt.SetString(' ')=0D return HelpTxt=0D =0D -## ConvertVersionToDecimal, the minor version should be within 0 - 99=0D +# ConvertVersionToDecimal, the minor version should be within 0 - 99=0D # ::=3D "0x" =0D # ::=3D (a-fA-F0-9){4}=0D # ::=3D (a-fA-F0-9){4}=0D @@ -539,6 +575,8 @@ def GenDummyHelpTextObj(): # @param StringIn: The string contains version defined in INF file.=0D # It can be Decimal or Hex=0D #=0D +=0D +=0D def ConvertVersionToDecimal(StringIn):=0D if IsValidHexVersion(StringIn):=0D Value =3D int(StringIn, 16)=0D @@ -559,12 +597,14 @@ def ConvertVersionToDecimal(StringIn): #=0D return StringIn=0D =0D -## GetHelpStringByRemoveHashKey=0D +# GetHelpStringByRemoveHashKey=0D #=0D # Remove hash key at the header of string and return the remain.=0D #=0D # @param String: The string need to be processed.=0D #=0D +=0D +=0D def GetHelpStringByRemoveHashKey(String):=0D ReturnString =3D ''=0D PattenRemoveHashKey =3D re.compile(r"^[#+\s]+", re.DOTALL)=0D @@ -585,7 +625,7 @@ def GetHelpStringByRemoveHashKey(String): =0D return ReturnString=0D =0D -## ConvPathFromAbsToRel=0D +# ConvPathFromAbsToRel=0D #=0D # Get relative file path from absolute path.=0D #=0D @@ -593,6 +633,8 @@ def GetHelpStringByRemoveHashKey(String): # @param Root: The string contain the parent path of Path in.=0D #=0D #=0D +=0D +=0D def ConvPathFromAbsToRel(Path, Root):=0D Path =3D os.path.normpath(Path)=0D Root =3D os.path.normpath(Root)=0D @@ -608,13 +650,15 @@ def ConvPathFromAbsToRel(Path, Root): else:=0D return Path=0D =0D -## ConvertPath=0D +# ConvertPath=0D #=0D # Convert special characters to '_', '\' to '/'=0D # return converted path: Test!1.inf -> Test_1.inf=0D #=0D # @param Path: Path to be converted=0D #=0D +=0D +=0D def ConvertPath(Path):=0D RetPath =3D ''=0D for Char in Path.strip():=0D @@ -626,7 +670,7 @@ def ConvertPath(Path): RetPath =3D RetPath + '_'=0D return RetPath=0D =0D -## ConvertSpec=0D +# ConvertSpec=0D #=0D # during install, convert the Spec string extract from UPD into INF allowa= ble definition,=0D # the difference is period is allowed in the former (not the first letter)= but not in the latter.=0D @@ -634,6 +678,8 @@ def ConvertPath(Path): #=0D # @param SpecStr: SpecStr to be converted=0D #=0D +=0D +=0D def ConvertSpec(SpecStr):=0D RetStr =3D ''=0D for Char in SpecStr:=0D @@ -645,7 +691,7 @@ def ConvertSpec(SpecStr): return RetStr=0D =0D =0D -## IsEqualList=0D +# IsEqualList=0D #=0D # Judge two lists are identical(contain same item).=0D # The rule is elements in List A are in List B and elements in List B are = in List A.=0D @@ -669,7 +715,7 @@ def IsEqualList(ListA, ListB): =0D return True=0D =0D -## ConvertArchList=0D +# ConvertArchList=0D #=0D # Convert item in ArchList if the start character is lower case.=0D # In UDP spec, Arch is only allowed as: [A-Z]([a-zA-Z0-9])*=0D @@ -678,6 +724,8 @@ def IsEqualList(ListA, ListB): #=0D # @return NewList The ArchList been converted.=0D #=0D +=0D +=0D def ConvertArchList(ArchList):=0D NewArchList =3D []=0D if not ArchList:=0D @@ -693,7 +741,7 @@ def ConvertArchList(ArchList): =0D return NewArchList=0D =0D -## ProcessLineExtender=0D +# ProcessLineExtender=0D #=0D # Process the LineExtender of Line in LineList.=0D # If one line ends with a line extender, then it will be combined together= with next line.=0D @@ -702,6 +750,8 @@ def ConvertArchList(ArchList): #=0D # @return NewList The ArchList been processed.=0D #=0D +=0D +=0D def ProcessLineExtender(LineList):=0D NewList =3D []=0D Count =3D 0=0D @@ -716,7 +766,7 @@ def ProcessLineExtender(LineList): =0D return NewList=0D =0D -## ProcessEdkComment=0D +# ProcessEdkComment=0D #=0D # Process EDK style comment in LineList: c style /* */ comment or cpp styl= e // comment=0D #=0D @@ -726,6 +776,8 @@ def ProcessLineExtender(LineList): # @return LineList The LineList been processed.=0D # @return FirstPos Where Edk comment is first found, -1 if not found=0D #=0D +=0D +=0D def ProcessEdkComment(LineList):=0D FindEdkBlockComment =3D False=0D Count =3D 0=0D @@ -769,7 +821,7 @@ def ProcessEdkComment(LineList): =0D return LineList, FirstPos=0D =0D -## GetLibInstanceInfo=0D +# GetLibInstanceInfo=0D #=0D # Get the information from Library Instance INF file.=0D #=0D @@ -777,6 +829,8 @@ def ProcessEdkComment(LineList): # @param WorkSpace. The WorkSpace directory used to combined with INF file= path.=0D #=0D # @return GUID, Version=0D +=0D +=0D def GetLibInstanceInfo(String, WorkSpace, LineNo):=0D =0D FileGuidString =3D ""=0D @@ -795,7 +849,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo): #=0D # Validate file name exist.=0D #=0D - FullFileName =3D os.path.normpath(os.path.realpath(os.path.join(WorkSp= ace, String)))=0D + FullFileName =3D os.path.normpath(=0D + os.path.realpath(os.path.join(WorkSpace, String)))=0D if not (ValidFile(FullFileName)):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D @@ -812,7 +867,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (S= tring),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (= =0D + String),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DLineNo,=0D ExtraData=3DOriginalString)=0D @@ -855,7 +911,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo): =0D return FileGuidString, VerString=0D =0D -## GetLocalValue=0D +# GetLocalValue=0D #=0D # Generate the local value for INF and DEC file. If Lang attribute not pre= sent, then use this value.=0D # If present, and there is no element without the Lang attribute, and one = of the elements has the rfc1766 code is=0D @@ -867,6 +923,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo): # @param UseFirstValue: True to use the first value, False to use the last= value=0D #=0D # @return LocalValue=0D +=0D +=0D def GetLocalValue(ValueList, UseFirstValue=3DFalse):=0D Value1 =3D ''=0D Value2 =3D ''=0D @@ -919,7 +977,7 @@ def GetLocalValue(ValueList, UseFirstValue=3DFalse): return ''=0D =0D =0D -## GetCharIndexOutStr=0D +# GetCharIndexOutStr=0D #=0D # Get comment character index outside a string=0D #=0D @@ -941,19 +999,21 @@ def GetCharIndexOutStr(CommentCharacter, Line): for Index in range(0, len(Line)):=0D if Line[Index] =3D=3D '"':=0D InString =3D not InString=0D - elif Line[Index] =3D=3D CommentCharacter and InString :=0D + elif Line[Index] =3D=3D CommentCharacter and InString:=0D pass=0D - elif Line[Index] =3D=3D CommentCharacter and (Index +1) < len(Line= ) and Line[Index+1] =3D=3D CommentCharacter \=0D - and not InString :=0D + elif Line[Index] =3D=3D CommentCharacter and (Index + 1) < len(Lin= e) and Line[Index+1] =3D=3D CommentCharacter \=0D + and not InString:=0D return Index=0D return -1=0D =0D -## ValidateUNIFilePath=0D +# ValidateUNIFilePath=0D #=0D # Check the UNI file path=0D #=0D # @param FilePath: The UNI file path=0D #=0D +=0D +=0D def ValidateUNIFilePath(Path):=0D Suffix =3D Path[Path.rfind(TAB_SPLIT):]=0D =0D @@ -962,18 +1022,18 @@ def ValidateUNIFilePath(Path): #=0D if Suffix not in TAB_UNI_FILE_SUFFIXS:=0D Logger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - Message=3DST.ERR_UNI_FILE_SUFFIX_WRONG,=0D - ExtraData=3DPath)=0D + ToolError.FORMAT_INVALID,=0D + Message=3DST.ERR_UNI_FILE_SUFFIX_WRONG,=0D + ExtraData=3DPath)=0D =0D #=0D # Check if '..' in the file name(without suffix)=0D #=0D if (TAB_SPLIT + TAB_SPLIT) in Path:=0D Logger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - Message=3DST.ERR_UNI_FILE_NAME_INVALID,=0D - ExtraData=3DPath)=0D + ToolError.FORMAT_INVALID,=0D + Message=3DST.ERR_UNI_FILE_NAME_INVALID,=0D + ExtraData=3DPath)=0D =0D #=0D # Check if the file name is valid according to the DEC and INF specifi= cation=0D @@ -983,7 +1043,6 @@ def ValidateUNIFilePath(Path): InvalidCh =3D re.sub(Pattern, '', FileName)=0D if InvalidCh:=0D Logger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - Message=3DST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME= _INVALID,=0D - ExtraData=3DPath)=0D -=0D + ToolError.FORMAT_INVALID,=0D + Message=3DST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_IN= VALID,=0D + ExtraData=3DPath)=0D diff --git a/BaseTools/Source/Python/UPT/Library/ParserValidate.py b/BaseTo= ols/Source/Python/UPT/Library/ParserValidate.py index 62f406141cc6..202466adf5de 100644 --- a/BaseTools/Source/Python/UPT/Library/ParserValidate.py +++ b/BaseTools/Source/Python/UPT/Library/ParserValidate.py @@ -1,4 +1,4 @@ -## @file ParserValidate.py=0D +# @file ParserValidate.py=0D # Functions for parser validation=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,26 +23,30 @@ from Library.ExpressionValidate import IsValidBareCStri= ng from Library.ExpressionValidate import IsValidFeatureFlagExp=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## __HexDigit() method=0D +# __HexDigit() method=0D #=0D # Whether char input is a Hex data bit=0D #=0D # @param TempChar: The char to test=0D #=0D +=0D +=0D def __HexDigit(TempChar):=0D if (TempChar >=3D 'a' and TempChar <=3D 'f') or \=0D - (TempChar >=3D 'A' and TempChar <=3D 'F') \=0D + (TempChar >=3D 'A' and TempChar <=3D 'F') \=0D or (TempChar >=3D '0' and TempChar <=3D '9'):=0D return True=0D else:=0D return False=0D =0D -## IsValidHex() method=0D +# IsValidHex() method=0D #=0D # Whether char input is a Hex data.=0D #=0D # @param TempChar: The char to test=0D #=0D +=0D +=0D def IsValidHex(HexStr):=0D if not HexStr.upper().startswith("0X"):=0D return False=0D @@ -52,7 +56,7 @@ def IsValidHex(HexStr): else:=0D return False=0D =0D -## Judge the input string is valid bool type or not.=0D +# Judge the input string is valid bool type or not.=0D #=0D # ::=3D {"TRUE"} {"true"} {"True"} {"0x1"} {"0x01= "}=0D # ::=3D {"FALSE"} {"false"} {"False"} {"0x0"} {"0= x00"}=0D @@ -60,6 +64,8 @@ def IsValidHex(HexStr): #=0D # @param BoolString: A string contained the value need to be judged.= =0D #=0D +=0D +=0D def IsValidBoolType(BoolString):=0D #=0D # Valid True=0D @@ -74,10 +80,10 @@ def IsValidBoolType(BoolString): # Valid False=0D #=0D elif BoolString =3D=3D 'FALSE' or \=0D - BoolString =3D=3D 'False' or \=0D - BoolString =3D=3D 'false' or \=0D - BoolString =3D=3D '0x0' or \=0D - BoolString =3D=3D '0x00':=0D + BoolString =3D=3D 'False' or \=0D + BoolString =3D=3D 'false' or \=0D + BoolString =3D=3D '0x0' or \=0D + BoolString =3D=3D '0x00':=0D return True=0D #=0D # Invalid bool type=0D @@ -85,29 +91,35 @@ def IsValidBoolType(BoolString): else:=0D return False=0D =0D -## Is Valid Module Type List or not=0D +# Is Valid Module Type List or not=0D #=0D # @param ModuleTypeList: A list contain ModuleType strings need to b= e=0D # judged.=0D #=0D +=0D +=0D def IsValidInfMoudleTypeList(ModuleTypeList):=0D for ModuleType in ModuleTypeList:=0D return IsValidInfMoudleType(ModuleType)=0D =0D -## Is Valid Module Type or not=0D +# Is Valid Module Type or not=0D #=0D # @param ModuleType: A string contain ModuleType need to be judged.= =0D #=0D +=0D +=0D def IsValidInfMoudleType(ModuleType):=0D if ModuleType in MODULE_LIST:=0D return True=0D else:=0D return False=0D =0D -## Is Valid Component Type or not=0D +# Is Valid Component Type or not=0D #=0D # @param ComponentType: A string contain ComponentType need to be ju= dged.=0D #=0D +=0D +=0D def IsValidInfComponentType(ComponentType):=0D if ComponentType.upper() in COMPONENT_TYPE_LIST:=0D return True=0D @@ -115,7 +127,7 @@ def IsValidInfComponentType(ComponentType): return False=0D =0D =0D -## Is valid Tool Family or not=0D +# Is valid Tool Family or not=0D #=0D # @param ToolFamily: A string contain Tool Family need to be judged.=0D # Family :=3D [A-Z]([a-zA-Z0-9])*=0D @@ -126,12 +138,14 @@ def IsValidToolFamily(ToolFamily): return False=0D return True=0D =0D -## Is valid Tool TagName or not=0D +# Is valid Tool TagName or not=0D #=0D # The TagName sample is MYTOOLS and VS2005.=0D #=0D # @param TagName: A string contain Tool TagName need to be judged.=0D #=0D +=0D +=0D def IsValidToolTagName(TagName):=0D if TagName.strip() =3D=3D '':=0D return True=0D @@ -141,7 +155,7 @@ def IsValidToolTagName(TagName): return False=0D return True=0D =0D -## Is valid arch or not=0D +# Is valid arch or not=0D #=0D # @param Arch The arch string need to be validated=0D # ::=3D (a-zA-Z)(A-Za-z0-9){0,}=0D @@ -149,6 +163,8 @@ def IsValidToolTagName(TagName): # {"common"}=0D # @param Arch: Input arch=0D #=0D +=0D +=0D def IsValidArch(Arch):=0D if Arch =3D=3D 'common':=0D return True=0D @@ -157,13 +173,15 @@ def IsValidArch(Arch): return False=0D return True=0D =0D -## Is valid family or not=0D +# Is valid family or not=0D #=0D # ::=3D {"MSFT"} {"GCC"} {"INTEL"} {} {"*"}=0D # ::=3D [A-Z][A-Za-z0-9]{0,}=0D #=0D # @param family: The family string need to be validated=0D #=0D +=0D +=0D def IsValidFamily(Family):=0D Family =3D Family.strip()=0D if Family =3D=3D '*':=0D @@ -177,10 +195,12 @@ def IsValidFamily(Family): return False=0D return True=0D =0D -## Is valid build option name or not=0D +# Is valid build option name or not=0D #=0D # @param BuildOptionName: The BuildOptionName string need to be validate= d=0D #=0D +=0D +=0D def IsValidBuildOptionName(BuildOptionName):=0D if not BuildOptionName:=0D return False=0D @@ -207,24 +227,28 @@ def IsValidBuildOptionName(BuildOptionName): =0D return True=0D =0D -## IsValidToken=0D +# IsValidToken=0D #=0D # Check if pattern string matches total token=0D #=0D # @param ReString: regular string=0D # @param Token: Token to be matched=0D #=0D +=0D +=0D def IsValidToken(ReString, Token):=0D Match =3D re.compile(ReString).match(Token)=0D return Match and Match.start() =3D=3D 0 and Match.end() =3D=3D len(Tok= en)=0D =0D -## IsValidPath=0D +# IsValidPath=0D #=0D # Check if path exist=0D #=0D # @param Path: Absolute path or relative path to be checked=0D # @param Root: Root path=0D #=0D +=0D +=0D def IsValidPath(Path, Root):=0D Path =3D Path.strip()=0D OrigPath =3D Path.replace('\\', '/')=0D @@ -269,7 +293,7 @@ def IsValidPath(Path, Root): =0D return True=0D =0D -## IsValidInstallPath=0D +# IsValidInstallPath=0D #=0D # Check if an install path valid or not.=0D #=0D @@ -277,6 +301,8 @@ def IsValidPath(Path, Root): #=0D # @param Path: path to be checked=0D #=0D +=0D +=0D def IsValidInstallPath(Path):=0D if platform.platform().find("Windows") >=3D 0:=0D if os.path.isabs(Path):=0D @@ -295,7 +321,7 @@ def IsValidInstallPath(Path): return True=0D =0D =0D -## IsValidCFormatGuid=0D +# IsValidCFormatGuid=0D #=0D # Check if GUID format has the from of {8,4,4,{2,2,2,2,2,2,2,2}}=0D #=0D @@ -356,19 +382,21 @@ def IsValidCFormatGuid(Guid): =0D return SepValue =3D=3D '}}' and Value =3D=3D ''=0D =0D -## IsValidPcdType=0D +# IsValidPcdType=0D #=0D # Check whether the PCD type is valid=0D #=0D # @param PcdTypeString: The PcdType string need to be checked.=0D #=0D +=0D +=0D def IsValidPcdType(PcdTypeString):=0D if PcdTypeString.upper() in PCD_USAGE_TYPE_LIST_OF_MODULE:=0D return True=0D else:=0D return False=0D =0D -## IsValidWord=0D +# IsValidWord=0D #=0D # Check whether the word is valid.=0D # ::=3D (a-zA-Z0-9_)(a-zA-Z0-9_-){0,} Alphanumeric characters wi= th=0D @@ -378,6 +406,8 @@ def IsValidPcdType(PcdTypeString): #=0D # @param Word: The word string need to be checked.=0D #=0D +=0D +=0D def IsValidWord(Word):=0D if not Word:=0D return False=0D @@ -404,7 +434,7 @@ def IsValidWord(Word): return True=0D =0D =0D -## IsValidSimpleWord=0D +# IsValidSimpleWord=0D #=0D # Check whether the SimpleWord is valid.=0D # ::=3D (a-zA-Z0-9)(a-zA-Z0-9_-){0,}=0D @@ -424,13 +454,15 @@ def IsValidSimpleWord(Word): =0D return True=0D =0D -## IsValidDecVersion=0D +# IsValidDecVersion=0D #=0D # Check whether the decimal version is valid.=0D # ::=3D (0-9){1,} ["." (0-9){1,}]=0D #=0D # @param Word: The word string need to be checked.=0D #=0D +=0D +=0D def IsValidDecVersion(Word):=0D if Word.find('.') > -1:=0D ReIsValidDecVersion =3D re.compile(r"[0-9]+\.?[0-9]+$")=0D @@ -440,7 +472,7 @@ def IsValidDecVersion(Word): return False=0D return True=0D =0D -## IsValidHexVersion=0D +# IsValidHexVersion=0D #=0D # Check whether the hex version is valid.=0D # ::=3D "0x" =0D @@ -449,6 +481,8 @@ def IsValidDecVersion(Word): #=0D # @param Word: The word string need to be checked.=0D #=0D +=0D +=0D def IsValidHexVersion(Word):=0D ReIsValidHexVersion =3D re.compile(r"[0][xX][0-9A-Fa-f]{8}$", re.DOTAL= L)=0D if ReIsValidHexVersion.match(Word) is None:=0D @@ -456,13 +490,15 @@ def IsValidHexVersion(Word): =0D return True=0D =0D -## IsValidBuildNumber=0D +# IsValidBuildNumber=0D #=0D # Check whether the BUILD_NUMBER is valid.=0D # ["BUILD_NUMBER" "=3D" {1,4} ]=0D #=0D # @param Word: The BUILD_NUMBER string need to be checked.=0D #=0D +=0D +=0D def IsValidBuildNumber(Word):=0D ReIsValieBuildNumber =3D re.compile(r"[0-9]{1,4}$", re.DOTALL)=0D if ReIsValieBuildNumber.match(Word) is None:=0D @@ -470,12 +506,14 @@ def IsValidBuildNumber(Word): =0D return True=0D =0D -## IsValidDepex=0D +# IsValidDepex=0D #=0D # Check whether the Depex is valid.=0D #=0D # @param Word: The Depex string need to be checked.=0D #=0D +=0D +=0D def IsValidDepex(Word):=0D Index =3D Word.upper().find("PUSH")=0D if Index > -1:=0D @@ -487,7 +525,7 @@ def IsValidDepex(Word): =0D return True=0D =0D -## IsValidNormalizedString=0D +# IsValidNormalizedString=0D #=0D # Check=0D # ::=3D [{} {}]{1,} =0D @@ -495,6 +533,8 @@ def IsValidDepex(Word): #=0D # @param String: string to be checked=0D #=0D +=0D +=0D def IsValidNormalizedString(String):=0D if String =3D=3D '':=0D return True=0D @@ -513,12 +553,14 @@ def IsValidNormalizedString(String): =0D return True=0D =0D -## IsValidIdString=0D +# IsValidIdString=0D #=0D # Check whether the IdString is valid.=0D #=0D # @param IdString: The IdString need to be checked.=0D #=0D +=0D +=0D def IsValidIdString(String):=0D if IsValidSimpleWord(String.strip()):=0D return True=0D @@ -533,7 +575,7 @@ def IsValidIdString(String): =0D return False=0D =0D -## IsValidVersionString=0D +# IsValidVersionString=0D #=0D # Check whether the VersionString is valid.=0D # ::=3D [ []{0,} []{0,} ]= {0,}=0D @@ -544,6 +586,8 @@ def IsValidIdString(String): #=0D # @param VersionString: The VersionString need to be checked.=0D #=0D +=0D +=0D def IsValidVersionString(VersionString):=0D VersionString =3D VersionString.strip()=0D for Char in VersionString:=0D @@ -552,12 +596,14 @@ def IsValidVersionString(VersionString): =0D return True=0D =0D -## IsValidPcdValue=0D +# IsValidPcdValue=0D #=0D # Check whether the PcdValue is valid.=0D #=0D # @param VersionString: The PcdValue need to be checked.=0D #=0D +=0D +=0D def IsValidPcdValue(PcdValue):=0D for Char in PcdValue:=0D if Char =3D=3D '\n' or Char =3D=3D '\t' or Char =3D=3D '\f':=0D @@ -615,7 +661,7 @@ def IsValidPcdValue(PcdValue): return True=0D =0D ReIsValidByteHex =3D re.compile(r"^\s*0x[0-9a-fA-F]{1,2}\s*$", re.DOTA= LL)=0D - if PcdValue.strip().startswith('{') and PcdValue.strip().endswith('}')= :=0D + if PcdValue.strip().startswith('{') and PcdValue.strip().endswith('}')= :=0D StringValue =3D PcdValue.strip().lstrip('{').rstrip('}')=0D ValueList =3D StringValue.split(',')=0D AllValidFlag =3D True=0D @@ -640,12 +686,14 @@ def IsValidPcdValue(PcdValue): =0D return False=0D =0D -## IsValidCVariableName=0D +# IsValidCVariableName=0D #=0D # Check whether the PcdValue is valid.=0D #=0D # @param VersionString: The PcdValue need to be checked.=0D #=0D +=0D +=0D def IsValidCVariableName(CName):=0D ReIsValidCName =3D re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)= =0D if ReIsValidCName.match(CName) is None:=0D @@ -653,7 +701,7 @@ def IsValidCVariableName(CName): =0D return True=0D =0D -## IsValidIdentifier=0D +# IsValidIdentifier=0D #=0D # ::=3D {0,}=0D # ::=3D (a-zA-Z0-9_)=0D @@ -661,6 +709,8 @@ def IsValidCVariableName(CName): #=0D # @param Ident: identifier to be checked=0D #=0D +=0D +=0D def IsValidIdentifier(Ident):=0D ReIdent =3D re.compile(r"^[A-Za-z_][0-9A-Za-z_]*$", re.DOTALL)=0D if ReIdent.match(Ident) is None:=0D @@ -668,12 +718,14 @@ def IsValidIdentifier(Ident): =0D return True=0D =0D -## IsValidDecVersionVal=0D +# IsValidDecVersionVal=0D #=0D # {(0-9){1,} "." (0-99)}=0D #=0D # @param Ver: version to be checked=0D #=0D +=0D +=0D def IsValidDecVersionVal(Ver):=0D ReVersion =3D re.compile(r"[0-9]+(\.[0-9]{1,2})$")=0D =0D @@ -683,7 +735,7 @@ def IsValidDecVersionVal(Ver): return True=0D =0D =0D -## IsValidLibName=0D +# IsValidLibName=0D #=0D # (A-Z)(a-zA-Z0-9){0,} and could not be "NULL"=0D #=0D @@ -701,6 +753,8 @@ def IsValidLibName(LibName): # ::=3D (a-zA-Z)(a-zA-Z0-9_.){0,}=0D # Words that contain period "." must be encapsulated in double quotation m= arks.=0D #=0D +=0D +=0D def IsValidUserId(UserId):=0D UserId =3D UserId.strip()=0D Quoted =3D False=0D @@ -719,6 +773,8 @@ def IsValidUserId(UserId): #=0D # Check if a UTF16-LE file has a BOM header=0D #=0D +=0D +=0D def CheckUTF16FileHeader(File):=0D FileIn =3D open(File, 'rb').read(2)=0D if FileIn !=3D b'\xff\xfe':=0D diff --git a/BaseTools/Source/Python/UPT/Library/Parsing.py b/BaseTools/Sou= rce/Python/UPT/Library/Parsing.py index 6fb133745e36..2ac5ae82e0cd 100644 --- a/BaseTools/Source/Python/UPT/Library/Parsing.py +++ b/BaseTools/Source/Python/UPT/Library/Parsing.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common parsing related functions used in par= sing=0D # INF/DEC/DSC process=0D #=0D @@ -41,7 +41,7 @@ from . import GlobalData =0D gPKG_INFO_DICT =3D {}=0D =0D -## GetBuildOption=0D +# GetBuildOption=0D #=0D # Parse a string with format "[:]=3DFlag"=0D # Return (Family, ToolFlag, Flag)=0D @@ -49,22 +49,24 @@ gPKG_INFO_DICT =3D {} # @param String: String with BuildOption statement=0D # @param File: The file which defines build option, used in error repor= t=0D #=0D -def GetBuildOption(String, File, LineNo=3D -1):=0D +=0D +=0D +def GetBuildOption(String, File, LineNo=3D-1):=0D (Family, ToolChain, Flag) =3D ('', '', '')=0D if String.find(DataType.TAB_EQUAL_SPLIT) < 0:=0D - RaiseParserError(String, 'BuildOptions', File, \=0D + RaiseParserError(String, 'BuildOptions', File,=0D '[:]=3DFlag', LineNo)=0D else:=0D List =3D GetSplitValueList(String, DataType.TAB_EQUAL_SPLIT, MaxSp= lit=3D1)=0D if List[0].find(':') > -1:=0D - Family =3D List[0][ : List[0].find(':')].strip()=0D - ToolChain =3D List[0][List[0].find(':') + 1 : ].strip()=0D + Family =3D List[0][: List[0].find(':')].strip()=0D + ToolChain =3D List[0][List[0].find(':') + 1:].strip()=0D else:=0D ToolChain =3D List[0].strip()=0D Flag =3D List[1].strip()=0D return (Family, ToolChain, Flag)=0D =0D -## Get Library Class=0D +# Get Library Class=0D #=0D # Get Library of Dsc as |=0D #=0D @@ -72,23 +74,25 @@ def GetBuildOption(String, File, LineNo=3D -1): # @param ContainerFile: The file which describes the library class, used = for=0D # error report=0D #=0D -def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo=3D -1):=0D +=0D +=0D +def GetLibraryClass(Item, ContainerFile, WorkspaceDir, LineNo=3D-1):=0D List =3D GetSplitValueList(Item[0])=0D SupMod =3D DataType.SUP_MODULE_LIST_STRING=0D if len(List) !=3D 2:=0D - RaiseParserError(Item[0], 'LibraryClasses', ContainerFile, \=0D + RaiseParserError(Item[0], 'LibraryClasses', ContainerFile,=0D '|')=0D else:=0D - CheckFileType(List[1], '.Inf', ContainerFile, \=0D + CheckFileType(List[1], '.Inf', ContainerFile,=0D 'library class instance', Item[0], LineNo)=0D - CheckFileExist(WorkspaceDir, List[1], ContainerFile, \=0D + CheckFileExist(WorkspaceDir, List[1], ContainerFile,=0D 'LibraryClasses', Item[0], LineNo)=0D if Item[1] !=3D '':=0D SupMod =3D Item[1]=0D =0D return (List[0], List[1], SupMod)=0D =0D -## Get Library Class=0D +# Get Library Class=0D #=0D # Get Library of Dsc as [|]=0D # [|.]=0D @@ -97,29 +101,30 @@ def GetLibraryClass(Item, ContainerFile, WorkspaceDir,= LineNo=3D -1): # @param ContainerFile: The file which describes the library class, used = for=0D # error report=0D #=0D -def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo=3D -1):= =0D +=0D +=0D +def GetLibraryClassOfInf(Item, ContainerFile, WorkspaceDir, LineNo=3D-1):= =0D ItemList =3D GetSplitValueList((Item[0] + DataType.TAB_VALUE_SPLIT * 2= ))=0D SupMod =3D DataType.SUP_MODULE_LIST_STRING=0D =0D if len(ItemList) > 5:=0D - RaiseParserError\=0D - (Item[0], 'LibraryClasses', ContainerFile, \=0D - '[|]\=0D + RaiseParserError(Item[0], 'LibraryClasses', ContainerFile,=0D + '[|]\=0D [|.]')=0D else:=0D - CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses'= , \=0D + CheckFileType(ItemList[1], '.Inf', ContainerFile, 'LibraryClasses'= ,=0D Item[0], LineNo)=0D - CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile, \=0D + CheckFileExist(WorkspaceDir, ItemList[1], ContainerFile,=0D 'LibraryClasses', Item[0], LineNo)=0D if ItemList[2] !=3D '':=0D - CheckPcdTokenInfo(ItemList[2], 'LibraryClasses', \=0D + CheckPcdTokenInfo(ItemList[2], 'LibraryClasses',=0D ContainerFile, LineNo)=0D if Item[1] !=3D '':=0D SupMod =3D Item[1]=0D =0D return (ItemList[0], ItemList[1], ItemList[2], SupMod)=0D =0D -## CheckPcdTokenInfo=0D +# CheckPcdTokenInfo=0D #=0D # Check if PcdTokenInfo is following .=0D #=0D @@ -127,7 +132,9 @@ def GetLibraryClassOfInf(Item, ContainerFile, Workspace= Dir, LineNo=3D -1): # @param Section: Used for error report=0D # @param File: Used for error report=0D #=0D -def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo=3D -1):=0D +=0D +=0D +def CheckPcdTokenInfo(TokenInfoString, Section, File, LineNo=3D-1):=0D Format =3D '.'=0D if TokenInfoString !=3D '' and TokenInfoString is not None:=0D TokenInfoList =3D GetSplitValueList(TokenInfoString, DataType.TAB_= SPLIT)=0D @@ -136,7 +143,7 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File, L= ineNo=3D -1): =0D RaiseParserError(TokenInfoString, Section, File, Format, LineNo)=0D =0D -## Get Pcd=0D +# Get Pcd=0D #=0D # Get Pcd of Dsc as .|=0D # [||]=0D @@ -147,12 +154,14 @@ def CheckPcdTokenInfo(TokenInfoString, Section, File,= LineNo=3D -1): # report=0D =0D #=0D -def GetPcd(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value, MaximumDatumSize, Token =3D '', '', '', '= ', ''=0D List =3D GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)=0D =0D if len(List) < 4 or len(List) > 6:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D '.|\=0D [||]', LineNo)=0D else:=0D @@ -165,7 +174,7 @@ def GetPcd(Item, Type, ContainerFile, LineNo=3D -1): =0D return (TokenName, TokenGuid, Value, MaximumDatumSize, Token, Type)=0D =0D -## Get FeatureFlagPcd=0D +# Get FeatureFlagPcd=0D #=0D # Get FeatureFlagPcd of Dsc as .|TRUE/= FALSE=0D #=0D @@ -174,12 +183,14 @@ def GetPcd(Item, Type, ContainerFile, LineNo=3D -1): # @param ContainerFile: The file which describes the pcd, used for error= =0D # report=0D #=0D -def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value =3D '', '', ''=0D List =3D GetSplitValueList(Item)=0D if len(List) !=3D 2:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \=0D - '.|TRUE/FALSE= ', \=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D + '.|TRUE/FALSE= ',=0D LineNo)=0D else:=0D Value =3D List[1]=0D @@ -188,7 +199,7 @@ def GetFeatureFlagPcd(Item, Type, ContainerFile, LineNo= =3D -1): =0D return (TokenName, TokenGuid, Value, Type)=0D =0D -## Get DynamicDefaultPcd=0D +# Get DynamicDefaultPcd=0D #=0D # Get DynamicDefaultPcd of Dsc as .=0D # |[|[|]]=0D @@ -198,11 +209,13 @@ def GetFeatureFlagPcd(Item, Type, ContainerFile, Line= No=3D -1): # @param ContainerFile: The file which describes the pcd, used for error= =0D # report=0D #=0D -def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetDynamicDefaultPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, Value, DatumTyp, MaxDatumSize =3D '', '', '', ''= , ''=0D List =3D GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)=0D if len(List) < 4 or len(List) > 8:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D '.|\=0D [|[|]]', LineNo)=0D else:=0D @@ -214,7 +227,7 @@ def GetDynamicDefaultPcd(Item, Type, ContainerFile, Lin= eNo=3D -1): =0D return (TokenName, TokenGuid, Value, DatumTyp, MaxDatumSize, Type)=0D =0D -## Get DynamicHiiPcd=0D +# Get DynamicHiiPcd=0D #=0D # Get DynamicHiiPcd of Dsc as .||=0D # |[|[|= ]]=0D @@ -224,24 +237,26 @@ def GetDynamicDefaultPcd(Item, Type, ContainerFile, L= ineNo=3D -1): # @param ContainerFile: The file which describes the pcd, used for error= =0D # report=0D #=0D -def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetDynamicHiiPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, List1, List2, List3, List4, List5 =3D \=0D - '', '', '', '', '', '', ''=0D + '', '', '', '', '', '', ''=0D List =3D GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT * 2)=0D if len(List) < 6 or len(List) > 8:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D '.||\= =0D |[|\=0D [|]]', LineNo)=0D else:=0D List1, List2, List3, List4, List5 =3D \=0D - List[1], List[2], List[3], List[4], List[5]=0D + List[1], List[2], List[3], List[4], List[5]=0D if CheckPcdTokenInfo(List[0], 'Pcds' + Type, ContainerFile, LineNo):=0D (TokenGuid, TokenName) =3D GetSplitValueList(List[0], DataType.TAB= _SPLIT)=0D =0D return (TokenName, TokenGuid, List1, List2, List3, List4, List5, Type)= =0D =0D -## Get DynamicVpdPcd=0D +# Get DynamicVpdPcd=0D #=0D # Get DynamicVpdPcd of Dsc as .|=0D # [|]=0D @@ -251,11 +266,13 @@ def GetDynamicHiiPcd(Item, Type, ContainerFile, LineN= o=3D -1): # @param ContainerFile: The file which describes the pcd, used for error= =0D # report=0D #=0D -def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo=3D-1):=0D TokenGuid, TokenName, List1, List2 =3D '', '', '', ''=0D List =3D GetSplitValueList(Item + DataType.TAB_VALUE_SPLIT)=0D if len(List) < 3 or len(List) > 4:=0D - RaiseParserError(Item, 'Pcds' + Type, ContainerFile, \=0D + RaiseParserError(Item, 'Pcds' + Type, ContainerFile,=0D '.|\=0D [|]', LineNo)=0D else:=0D @@ -265,7 +282,7 @@ def GetDynamicVpdPcd(Item, Type, ContainerFile, LineNo= =3D -1): =0D return (TokenName, TokenGuid, List1, List2, Type)=0D =0D -## GetComponent=0D +# GetComponent=0D #=0D # Parse block of the components defined in dsc file=0D # Set KeyValues as [ ['component name', [lib1, lib2, lib3],=0D @@ -274,10 +291,12 @@ def GetDynamicVpdPcd(Item, Type, ContainerFile, LineN= o=3D -1): # @param Lines: The content to be parsed=0D # @param KeyValues: To store data after parsing=0D #=0D +=0D +=0D def GetComponent(Lines, KeyValues):=0D - (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \=0D - FindPcdsDynamicEx) =3D (False, False, False, False, False, False, Fal= se, \=0D + (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic,=0D + FindPcdsDynamicEx) =3D (False, False, False, False, False, False, Fal= se,=0D False)=0D ListItem =3D None=0D LibraryClassItem =3D []=0D @@ -290,7 +309,7 @@ def GetComponent(Lines, KeyValues): # Ignore !include statement=0D #=0D if Line.upper().find(DataType.TAB_INCLUDE.upper() + ' ') > -1 or \= =0D - Line.upper().find(DataType.TAB_DEFINE + ' ') > -1:=0D + Line.upper().find(DataType.TAB_DEFINE + ' ') > -1:=0D continue=0D =0D if FindBlock =3D=3D False:=0D @@ -300,7 +319,7 @@ def GetComponent(Lines, KeyValues): #=0D if Line.endswith('{'):=0D FindBlock =3D True=0D - ListItem =3D CleanString(Line.rsplit('{', 1)[0], \=0D + ListItem =3D CleanString(Line.rsplit('{', 1)[0],=0D DataType.TAB_COMMENT_SPLIT)=0D =0D #=0D @@ -308,57 +327,57 @@ def GetComponent(Lines, KeyValues): #=0D if FindBlock:=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (True, False, False, False, False, False, False)=0D + (True, False, False, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, True, False, False, False, False, False)=0D + (False, True, False, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, True, False, False, False, False)=0D + (False, False, True, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, True, False, False, False)=0D + (False, False, False, True, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, True, False, False)=0D + (False, False, False, False, True, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, False, True, False)=0D + (False, False, False, False, False, True, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, False, False, True)=0D + (False, False, False, False, False, False, True)=0D continue=0D if Line.endswith('}'):=0D #=0D # find '}' at line tail=0D #=0D - KeyValues.append([ListItem, LibraryClassItem, \=0D + KeyValues.append([ListItem, LibraryClassItem,=0D BuildOption, Pcd])=0D - (FindBlock, FindLibraryClass, FindBuildOption, \=0D - FindPcdsFeatureFlag, FindPcdsPatchableInModule, \=0D + (FindBlock, FindLibraryClass, FindBuildOption,=0D + FindPcdsFeatureFlag, FindPcdsPatchableInModule,=0D FindPcdsFixedAtBuild, FindPcdsDynamic, FindPcdsDynamicEx)= =3D \=0D - (False, False, False, False, False, False, False, False)= =0D + (False, False, False, False, False, False, False, Fals= e)=0D LibraryClassItem, BuildOption, Pcd =3D [], [], []=0D continue=0D =0D @@ -382,25 +401,27 @@ def GetComponent(Lines, KeyValues): =0D return True=0D =0D -## GetExec=0D +# GetExec=0D #=0D # Parse a string with format "InfFilename [EXEC =3D ExecFilename]"=0D # Return (InfFilename, ExecFilename)=0D #=0D # @param String: String with EXEC statement=0D #=0D +=0D +=0D def GetExec(String):=0D InfFilename =3D ''=0D ExecFilename =3D ''=0D if String.find('EXEC') > -1:=0D - InfFilename =3D String[ : String.find('EXEC')].strip()=0D - ExecFilename =3D String[String.find('EXEC') + len('EXEC') : ].stri= p()=0D + InfFilename =3D String[: String.find('EXEC')].strip()=0D + ExecFilename =3D String[String.find('EXEC') + len('EXEC'):].strip(= )=0D else:=0D InfFilename =3D String.strip()=0D =0D return (InfFilename, ExecFilename)=0D =0D -## GetComponents=0D +# GetComponents=0D #=0D # Parse block of the components defined in dsc file=0D # Set KeyValues as [ ['component name', [lib1, lib2, lib3], [bo1, bo2, bo3= ],=0D @@ -413,13 +434,15 @@ def GetExec(String): #=0D # @retval True Get component successfully=0D #=0D +=0D +=0D def GetComponents(Lines, KeyValues, CommentCharacter):=0D if Lines.find(DataType.TAB_SECTION_END) > -1:=0D Lines =3D Lines.split(DataType.TAB_SECTION_END, 1)[1]=0D - (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic, \=0D + (FindBlock, FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild, FindPcdsDynamic,=0D FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, False, False, False, False)=0D + (False, False, False, False, False, False, False, False)=0D ListItem =3D None=0D LibraryClassItem =3D []=0D BuildOption =3D []=0D @@ -438,64 +461,65 @@ def GetComponents(Lines, KeyValues, CommentCharacter): #=0D if Line.endswith('{'):=0D FindBlock =3D True=0D - ListItem =3D CleanString(Line.rsplit('{', 1)[0], CommentCh= aracter)=0D + ListItem =3D CleanString(Line.rsplit('{', 1)[=0D + 0], CommentCharacter)=0D =0D #=0D # Parse a block content=0D #=0D if FindBlock:=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (True, False, False, False, False, False, False)=0D + (True, False, False, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, True, False, False, False, False, False)=0D + (False, True, False, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, True, False, False, False, False)=0D + (False, False, True, False, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, True, False, False, False)=0D + (False, False, False, True, False, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, True, False, False)=0D + (False, False, False, False, True, False, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, False, True, False)=0D + (False, False, False, False, False, True, False)=0D continue=0D if Line.find('') !=3D -1:=0D - (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag, \= =0D - FindPcdsPatchableInModule, FindPcdsFixedAtBuild, \=0D + (FindLibraryClass, FindBuildOption, FindPcdsFeatureFlag,=0D + FindPcdsPatchableInModule, FindPcdsFixedAtBuild,=0D FindPcdsDynamic, FindPcdsDynamicEx) =3D \=0D - (False, False, False, False, False, False, True)=0D + (False, False, False, False, False, False, True)=0D continue=0D if Line.endswith('}'):=0D #=0D # find '}' at line tail=0D #=0D - KeyValues.append([ListItem, LibraryClassItem, BuildOption,= \=0D + KeyValues.append([ListItem, LibraryClassItem, BuildOption,= =0D Pcd])=0D - (FindBlock, FindLibraryClass, FindBuildOption, \=0D - FindPcdsFeatureFlag, FindPcdsPatchableInModule, \=0D + (FindBlock, FindLibraryClass, FindBuildOption,=0D + FindPcdsFeatureFlag, FindPcdsPatchableInModule,=0D FindPcdsFixedAtBuild, FindPcdsDynamic, FindPcdsDynamicEx)= =3D \=0D - (False, False, False, False, False, False, False, False)= =0D + (False, False, False, False, False, False, False, Fals= e)=0D LibraryClassItem, BuildOption, Pcd =3D [], [], []=0D continue=0D =0D @@ -519,7 +543,7 @@ def GetComponents(Lines, KeyValues, CommentCharacter): =0D return True=0D =0D -## Get Source=0D +# Get Source=0D #=0D # Get Source of Inf as [|[|[|=0D # [|]]]]=0D @@ -529,22 +553,24 @@ def GetComponents(Lines, KeyValues, CommentCharacter): # @param ContainerFile: The file which describes the library class, used= =0D # for error report=0D #=0D -def GetSource(Item, ContainerFile, FileRelativePath, LineNo=3D -1):=0D +=0D +=0D +def GetSource(Item, ContainerFile, FileRelativePath, LineNo=3D-1):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT * 4=0D List =3D GetSplitValueList(ItemNew)=0D if len(List) < 5 or len(List) > 9:=0D - RaiseParserError(Item, 'Sources', ContainerFile, \=0D + RaiseParserError(Item, 'Sources', ContainerFile,=0D '[|[|[|\=0D [|]]]]', LineNo)=0D List[0] =3D NormPath(List[0])=0D - CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Sources', \= =0D + CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Sources',=0D Item, LineNo)=0D if List[4] !=3D '':=0D CheckPcdTokenInfo(List[4], 'Sources', ContainerFile, LineNo)=0D =0D return (List[0], List[1], List[2], List[3], List[4])=0D =0D -## Get Binary=0D +# Get Binary=0D #=0D # Get Binary of Inf as [|[|[|=0D # [|]]]]=0D @@ -554,11 +580,13 @@ def GetSource(Item, ContainerFile, FileRelativePath, = LineNo=3D -1): # @param ContainerFile: The file which describes the library class,=0D # used for error report=0D #=0D -def GetBinary(Item, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetBinary(Item, ContainerFile, LineNo=3D-1):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D if len(List) < 3 or len(List) > 5:=0D - RaiseParserError(Item, 'Binaries', ContainerFile, \=0D + RaiseParserError(Item, 'Binaries', ContainerFile,=0D "|[|\=0D [|.]]", LineNo)=0D =0D @@ -569,7 +597,7 @@ def GetBinary(Item, ContainerFile, LineNo=3D -1): elif len(List) =3D=3D 3:=0D return (List[0], List[1], List[2], '')=0D =0D -## Get Guids/Protocols/Ppis=0D +# Get Guids/Protocols/Ppis=0D #=0D # Get Guids/Protocols/Ppis of Inf as [|]=0D #=0D @@ -578,12 +606,14 @@ def GetBinary(Item, ContainerFile, LineNo=3D -1): # @param ContainerFile: The file which describes the library class,=0D # used for error report=0D #=0D +=0D +=0D def GetGuidsProtocolsPpisOfInf(Item):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D return (List[0], List[1])=0D =0D -## Get Guids/Protocols/Ppis=0D +# Get Guids/Protocols/Ppis=0D #=0D # Get Guids/Protocols/Ppis of Dec as =3D=0D #=0D @@ -592,29 +622,31 @@ def GetGuidsProtocolsPpisOfInf(Item): # @param ContainerFile: The file which describes the library class,=0D # used for error report=0D #=0D -def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo=3D -1):=0D +=0D +=0D +def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerFile, LineNo=3D-1):=0D List =3D GetSplitValueList(Item, DataType.TAB_EQUAL_SPLIT)=0D if len(List) !=3D 2:=0D - RaiseParserError(Item, Type, ContainerFile, '=3D= ', \=0D + RaiseParserError(Item, Type, ContainerFile, '=3D= ',=0D LineNo)=0D #=0D - #convert C-Format Guid to Register Format=0D + # convert C-Format Guid to Register Format=0D #=0D if List[1][0] =3D=3D '{' and List[1][-1] =3D=3D '}':=0D RegisterFormatGuid =3D GuidStructureStringToGuidString(List[1])=0D if RegisterFormatGuid =3D=3D '':=0D - RaiseParserError(Item, Type, ContainerFile, \=0D + RaiseParserError(Item, Type, ContainerFile,=0D 'CFormat or RegisterFormat', LineNo)=0D else:=0D if CheckGuidRegFormat(List[1]):=0D RegisterFormatGuid =3D List[1]=0D else:=0D - RaiseParserError(Item, Type, ContainerFile, \=0D + RaiseParserError(Item, Type, ContainerFile,=0D 'CFormat or RegisterFormat', LineNo)=0D =0D return (List[0], RegisterFormatGuid)=0D =0D -## GetPackage=0D +# GetPackage=0D #=0D # Get Package of Inf as [|]=0D #=0D @@ -623,18 +655,20 @@ def GetGuidsProtocolsPpisOfDec(Item, Type, ContainerF= ile, LineNo=3D -1): # @param ContainerFile: The file which describes the library class,=0D # used for error report=0D #=0D -def GetPackage(Item, ContainerFile, FileRelativePath, LineNo=3D -1):=0D +=0D +=0D +def GetPackage(Item, ContainerFile, FileRelativePath, LineNo=3D-1):=0D ItemNew =3D Item + DataType.TAB_VALUE_SPLIT=0D List =3D GetSplitValueList(ItemNew)=0D CheckFileType(List[0], '.Dec', ContainerFile, 'package', List[0], Line= No)=0D - CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages', \= =0D + CheckFileExist(FileRelativePath, List[0], ContainerFile, 'Packages',=0D List[0], LineNo)=0D if List[1] !=3D '':=0D CheckPcdTokenInfo(List[1], 'Packages', ContainerFile, LineNo)=0D =0D return (List[0], List[1])=0D =0D -## Get Pcd Values of Inf=0D +# Get Pcd Values of Inf=0D #=0D # Get Pcd of Inf as .[|]=0D #=0D @@ -642,6 +676,8 @@ def GetPackage(Item, ContainerFile, FileRelativePath, L= ineNo=3D -1): # @param Type: The type of Pcd=0D # @param File: The file which describes the pcd, used for error report=0D #=0D +=0D +=0D def GetPcdOfInf(Item, Type, File, LineNo):=0D Format =3D '.[|]'=0D TokenGuid, TokenName, Value, InfType =3D '', '', '', ''=0D @@ -671,7 +707,7 @@ def GetPcdOfInf(Item, Type, File, LineNo): return (TokenGuid, TokenName, Value, InfType)=0D =0D =0D -## Get Pcd Values of Dec=0D +# Get Pcd Values of Dec=0D #=0D # Get Pcd of Dec as .|||=0D # @param Item: Pcd item=0D @@ -679,7 +715,7 @@ def GetPcdOfInf(Item, Type, File, LineNo): # @param File: Dec file=0D # @param LineNo: Line number=0D #=0D -def GetPcdOfDec(Item, Type, File, LineNo=3D -1):=0D +def GetPcdOfDec(Item, Type, File, LineNo=3D-1):=0D Format =3D '.|||'=0D TokenGuid, TokenName, Value, DatumType, Token =3D '', '', '', '', ''=0D List =3D GetSplitValueList(Item)=0D @@ -698,7 +734,7 @@ def GetPcdOfDec(Item, Type, File, LineNo=3D -1): =0D return (TokenGuid, TokenName, Value, DatumType, Token, Type)=0D =0D -## Parse DEFINE statement=0D +# Parse DEFINE statement=0D #=0D # Get DEFINE macros=0D #=0D @@ -711,21 +747,23 @@ def GetPcdOfDec(Item, Type, File, LineNo=3D -1): # @param SectionModel: DEFINE section model=0D # @param Arch: DEFINE arch=0D #=0D -def ParseDefine(LineValue, StartLine, Table, FileID, SectionName, \=0D +=0D +=0D +def ParseDefine(LineValue, StartLine, Table, FileID, SectionName,=0D SectionModel, Arch):=0D - Logger.Debug(Logger.DEBUG_2, ST.MSG_DEFINE_STATEMENT_FOUND % (LineValu= e, \=0D + Logger.Debug(Logger.DEBUG_2, ST.MSG_DEFINE_STATEMENT_FOUND % (LineValu= e,=0D SectionN= ame))=0D Define =3D \=0D - GetSplitValueList(CleanString\=0D - (LineValue[LineValue.upper().\=0D - find(DataType.TAB_DEFINE.upper() + ' ') += \=0D - len(DataType.TAB_DEFINE + ' ') : ]), \=0D - DataType.TAB_EQUAL_SPLIT, 1)=0D - Table.Insert(DataType.MODEL_META_DATA_DEFINE, Define[0], Define[1], ''= , \=0D - '', '', Arch, SectionModel, FileID, StartLine, -1, \=0D + GetSplitValueList(CleanString=0D + (LineValue[LineValue.upper().=0D + find(DataType.TAB_DEFINE.upper() + ' = ') +=0D + len(DataType.TAB_DEFINE + ' '):]),=0D + DataType.TAB_EQUAL_SPLIT, 1)=0D + Table.Insert(DataType.MODEL_META_DATA_DEFINE, Define[0], Define[1], ''= ,=0D + '', '', Arch, SectionModel, FileID, StartLine, -1,=0D StartLine, -1, 0)=0D =0D -## InsertSectionItems=0D +# InsertSectionItems=0D #=0D # Insert item data of a section to a dict=0D #=0D @@ -736,7 +774,9 @@ def ParseDefine(LineValue, StartLine, Table, FileID, Se= ctionName, \ # @param ThirdList: Third list=0D # @param RecordSet: Record set=0D #=0D -def InsertSectionItems(Model, SectionItemList, ArchList, \=0D +=0D +=0D +def InsertSectionItems(Model, SectionItemList, ArchList,=0D ThirdList, RecordSet):=0D #=0D # Insert each item data of a section=0D @@ -750,7 +790,7 @@ def InsertSectionItems(Model, SectionItemList, ArchList= , \ Records =3D RecordSet[Model]=0D for SectionItem in SectionItemList:=0D LineValue, StartLine, Comment =3D SectionItem[0], \=0D - SectionItem[1], SectionItem[2]=0D + SectionItem[1], SectionItem[2]=0D =0D Logger.Debug(4, ST.MSG_PARSING % LineValue)=0D #=0D @@ -767,24 +807,28 @@ def InsertSectionItems(Model, SectionItemList, ArchLi= st, \ if RecordSet !=3D {}:=0D RecordSet[Model] =3D Records=0D =0D -## GenMetaDatSectionItem=0D +# GenMetaDatSectionItem=0D #=0D # @param Key: A key=0D # @param Value: A value=0D # @param List: A list=0D #=0D +=0D +=0D def GenMetaDatSectionItem(Key, Value, List):=0D if Key not in List:=0D List[Key] =3D [Value]=0D else:=0D List[Key].append(Value)=0D =0D -## GetPkgInfoFromDec=0D +# GetPkgInfoFromDec=0D #=0D # get package name, guid, version info from dec files=0D #=0D # @param Path: File path=0D #=0D +=0D +=0D def GetPkgInfoFromDec(Path):=0D PkgName =3D None=0D PkgGuid =3D None=0D @@ -815,7 +859,7 @@ def GetPkgInfoFromDec(Path): return None, None, None=0D =0D =0D -## GetWorkspacePackage=0D +# GetWorkspacePackage=0D #=0D # Get a list of workspace package information.=0D #=0D @@ -837,8 +881,8 @@ def GetWorkspacePackage(): continue=0D Ext =3D os.path.splitext(FileSp)[1]=0D if Ext.lower() in ['.dec']:=0D - DecFileList.append\=0D - (os.path.normpath(os.path.join(Root, FileSp)))=0D + DecFileList.append(os.path.normpath(=0D + os.path.join(Root, FileSp)))=0D #=0D # abstract package guid, version info from DecFile List=0D #=0D @@ -850,10 +894,12 @@ def GetWorkspacePackage(): =0D return PkgList=0D =0D -## GetWorkspaceModule=0D +# GetWorkspaceModule=0D #=0D # Get a list of workspace modules.=0D #=0D +=0D +=0D def GetWorkspaceModule():=0D InfFileList =3D []=0D WorkspaceDir =3D GlobalData.gWORKSPACE=0D @@ -872,18 +918,20 @@ def GetWorkspaceModule(): continue=0D Ext =3D os.path.splitext(FileSp)[1]=0D if Ext.lower() in ['.inf']:=0D - InfFileList.append\=0D - (os.path.normpath(os.path.join(Root, FileSp)))=0D + InfFileList.append(os.path.normpath(=0D + os.path.join(Root, FileSp)))=0D =0D return InfFileList=0D =0D -## MacroParser used to parse macro definition=0D +# MacroParser used to parse macro definition=0D #=0D # @param Line: The content contain linestring and line number=0D # @param FileName: The meta-file file name=0D # @param SectionType: Section for the Line belong to=0D # @param FileLocalMacros: A list contain Macro defined in [Defines] sectio= n.=0D #=0D +=0D +=0D def MacroParser(Line, FileName, SectionType, FileLocalMacros):=0D MacroDefPattern =3D re.compile("^(DEFINE)[ \t]+")=0D LineContent =3D Line[0]=0D @@ -895,17 +943,17 @@ def MacroParser(Line, FileName, SectionType, FileLoca= lMacros): #=0D return None, None=0D =0D - TokenList =3D GetSplitValueList(LineContent[Match.end(1):], \=0D + TokenList =3D GetSplitValueList(LineContent[Match.end(1):],=0D DataType.TAB_EQUAL_SPLIT, 1)=0D #=0D # Syntax check=0D #=0D if not TokenList[0]:=0D Logger.Error('Parser', FORMAT_INVALID, ST.ERR_MACRONAME_NOGIVEN,=0D - ExtraData=3DLineContent, File=3DFileName, Line=3DL= ineNo)=0D + ExtraData=3DLineContent, File=3DFileName, Line=3DLine= No)=0D if len(TokenList) < 2:=0D Logger.Error('Parser', FORMAT_INVALID, ST.ERR_MACROVALUE_NOGIVEN,= =0D - ExtraData=3DLineContent, File=3DFileName, Line=3DL= ineNo)=0D + ExtraData=3DLineContent, File=3DFileName, Line=3DLine= No)=0D =0D Name, Value =3D TokenList=0D =0D @@ -945,7 +993,7 @@ def MacroParser(Line, FileName, SectionType, FileLocalM= acros): =0D return Name, Value=0D =0D -## GenSection=0D +# GenSection=0D #=0D # generate section contents=0D #=0D @@ -956,21 +1004,26 @@ def MacroParser(Line, FileName, SectionType, FileLoc= alMacros): # separated by space,=0D # value is statement=0D #=0D +=0D +=0D def GenSection(SectionName, SectionDict, SplitArch=3DTrue, NeedBlankLine= =3DFalse):=0D Content =3D ''=0D for SectionAttrs in SectionDict:=0D StatementList =3D SectionDict[SectionAttrs]=0D if SectionAttrs and SectionName !=3D 'Defines' and SectionAttrs.st= rip().upper() !=3D DataType.TAB_ARCH_COMMON:=0D if SplitArch:=0D - ArchList =3D GetSplitValueList(SectionAttrs, DataType.TAB_= SPACE_SPLIT)=0D + ArchList =3D GetSplitValueList(=0D + SectionAttrs, DataType.TAB_SPACE_SPLIT)=0D else:=0D if SectionName !=3D 'UserExtensions':=0D - ArchList =3D GetSplitValueList(SectionAttrs, DataType.= TAB_COMMENT_SPLIT)=0D + ArchList =3D GetSplitValueList(=0D + SectionAttrs, DataType.TAB_COMMENT_SPLIT)=0D else:=0D ArchList =3D [SectionAttrs]=0D for Index in range(0, len(ArchList)):=0D ArchList[Index] =3D ConvertArchForInstall(ArchList[Index])= =0D - Section =3D '[' + SectionName + '.' + (', ' + SectionName + '.= ').join(ArchList) + ']'=0D + Section =3D '[' + SectionName + '.' + \=0D + (', ' + SectionName + '.').join(ArchList) + ']'=0D else:=0D Section =3D '[' + SectionName + ']'=0D Content +=3D '\n' + Section + '\n'=0D @@ -998,16 +1051,18 @@ def GenSection(SectionName, SectionDict, SplitArch= =3DTrue, NeedBlankLine=3DFalse): return ''=0D return Content=0D =0D -## ConvertArchForInstall=0D +# ConvertArchForInstall=0D # if Arch.upper() is in "IA32", "X64", "IPF", and "EBC", it must be upper = case. "common" must be lower case.=0D # Anything else, the case must be preserved=0D #=0D # @param Arch: the arch string that need to be converted, it should be str= ipped before pass in=0D # @return: the arch string that get converted=0D #=0D +=0D +=0D def ConvertArchForInstall(Arch):=0D if Arch.upper() in [DataType.TAB_ARCH_IA32, DataType.TAB_ARCH_X64,=0D - DataType.TAB_ARCH_IPF, DataType.TAB_ARC= H_EBC]:=0D + DataType.TAB_ARCH_IPF, DataType.TAB_ARCH_EBC]:=0D Arch =3D Arch.upper()=0D elif Arch.upper() =3D=3D DataType.TAB_ARCH_COMMON:=0D Arch =3D Arch.lower()=0D diff --git a/BaseTools/Source/Python/UPT/Library/StringUtils.py b/BaseTools= /Source/Python/UPT/Library/StringUtils.py index fbc5177caf5a..df9d10b0bb83 100644 --- a/BaseTools/Source/Python/UPT/Library/StringUtils.py +++ b/BaseTools/Source/Python/UPT/Library/StringUtils.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common string related functions used in pars= ing=0D # process=0D #=0D @@ -25,7 +25,7 @@ from Logger import StringTable as ST #=0D gMACRO_PATTERN =3D re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)=0D =0D -## GetSplitValueList=0D +# GetSplitValueList=0D #=0D # Get a value list from a string with multiple values split with SplitTag= =0D # The default SplitTag is DataType.TAB_VALUE_SPLIT=0D @@ -36,10 +36,12 @@ gMACRO_PATTERN =3D re.compile("\$\(([_A-Z][_A-Z0-9]*)\)= ", re.UNICODE) # @param MaxSplit: The max number of split values, default is -1=0D #=0D #=0D -def GetSplitValueList(String, SplitTag=3DDataType.TAB_VALUE_SPLIT, MaxSpli= t=3D -1):=0D +=0D +=0D +def GetSplitValueList(String, SplitTag=3DDataType.TAB_VALUE_SPLIT, MaxSpli= t=3D-1):=0D return list(map(lambda l: l.strip(), String.split(SplitTag, MaxSplit))= )=0D =0D -## MergeArches=0D +# MergeArches=0D #=0D # Find a key's all arches in dict, add the new arch to the list=0D # If not exist any arch, set the arch directly=0D @@ -48,13 +50,15 @@ def GetSplitValueList(String, SplitTag=3DDataType.TAB_V= ALUE_SPLIT, MaxSplit=3D -1): # @param Key: The input value for Key=0D # @param Arch: The Arch to be added or merged=0D #=0D +=0D +=0D def MergeArches(Dict, Key, Arch):=0D if Key in Dict.keys():=0D Dict[Key].append(Arch)=0D else:=0D Dict[Key] =3D Arch.split()=0D =0D -## GenDefines=0D +# GenDefines=0D #=0D # Parse a string with format "DEFINE =3D "=0D # Generate a map Defines[VarName] =3D PATH=0D @@ -64,10 +68,12 @@ def MergeArches(Dict, Key, Arch): # @param Arch: Supported Arch=0D # @param Defines: DEFINE statement to be parsed=0D #=0D +=0D +=0D def GenDefines(String, Arch, Defines):=0D if String.find(DataType.TAB_DEFINE + ' ') > -1:=0D List =3D String.replace(DataType.TAB_DEFINE + ' ', '').\=0D - split(DataType.TAB_EQUAL_SPLIT)=0D + split(DataType.TAB_EQUAL_SPLIT)=0D if len(List) =3D=3D 2:=0D Defines[(CleanString(List[0]), Arch)] =3D CleanString(List[1])= =0D return 0=0D @@ -75,7 +81,7 @@ def GenDefines(String, Arch, Defines): return -1=0D return 1=0D =0D -## GetLibraryClassesWithModuleType=0D +# GetLibraryClassesWithModuleType=0D #=0D # Get Library Class definition when no module type defined=0D #=0D @@ -84,6 +90,8 @@ def GenDefines(String, Arch, Defines): # @param KeyValues: To store data after parsing=0D # @param CommentCharacter: Comment char, used to ignore comment content=0D #=0D +=0D +=0D def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacte= r):=0D NewKey =3D SplitModuleType(Key)=0D Lines =3D Lines.split(DataType.TAB_SECTION_END, 1)[1]=0D @@ -95,7 +103,7 @@ def GetLibraryClassesWithModuleType(Lines, Key, KeyValue= s, CommentCharacter): =0D return True=0D =0D -## GetDynamics=0D +# GetDynamics=0D #=0D # Get Dynamic Pcds=0D #=0D @@ -104,6 +112,8 @@ def GetLibraryClassesWithModuleType(Lines, Key, KeyValu= es, CommentCharacter): # @param KeyValues: To store data after parsing=0D # @param CommentCharacter: Comment char, used to ignore comment content=0D #=0D +=0D +=0D def GetDynamics(Lines, Key, KeyValues, CommentCharacter):=0D #=0D # Get SkuId Name List=0D @@ -115,11 +125,12 @@ def GetDynamics(Lines, Key, KeyValues, CommentCharact= er): for Line in LineList:=0D Line =3D CleanString(Line, CommentCharacter)=0D if Line !=3D '' and Line[0] !=3D CommentCharacter:=0D - KeyValues.append([CleanString(Line, CommentCharacter), SkuIdNa= meList[1]])=0D + KeyValues.append(=0D + [CleanString(Line, CommentCharacter), SkuIdNameList[1]])=0D =0D return True=0D =0D -## SplitModuleType=0D +# SplitModuleType=0D #=0D # Split ModuleType out of section defien to get key=0D # [LibraryClass.Arch.ModuleType|ModuleType|ModuleType] -> [=0D @@ -127,6 +138,8 @@ def GetDynamics(Lines, Key, KeyValues, CommentCharacter= ): #=0D # @param Key: String to be parsed=0D #=0D +=0D +=0D def SplitModuleType(Key):=0D KeyList =3D Key.split(DataType.TAB_SPLIT)=0D #=0D @@ -146,7 +159,7 @@ def SplitModuleType(Key): =0D return ReturnValue=0D =0D -## Replace macro in string=0D +# Replace macro in string=0D #=0D # This method replace macros used in given string. The macros are given in= a=0D # dictionary.=0D @@ -157,6 +170,8 @@ def SplitModuleType(Key): # @param Line: The content contain line string and line numbe= r=0D # @param FileName: The meta-file file name=0D #=0D +=0D +=0D def ReplaceMacro(String, MacroDefinitions=3DNone, SelfReplacement=3DFalse,= Line=3DNone, FileName=3DNone, Flag=3DFalse):=0D LastString =3D String=0D if MacroDefinitions is None:=0D @@ -191,20 +206,22 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, Sel= fReplacement=3DFalse, Line=3DNone if Macro not in MacroDefinitions:=0D if SelfReplacement:=0D String =3D String.replace("$(%s)" % Macro, '')=0D - Logger.Debug(5, "Delete undefined MACROs in file %s li= ne %d: %s!" % (FileName, Line[1], Line[0]))=0D + Logger.Debug(5, "Delete undefined MACROs in file %s li= ne %d: %s!" % (=0D + FileName, Line[1], Line[0]))=0D continue=0D if not HaveQuotedMacroFlag:=0D - String =3D String.replace("$(%s)" % Macro, MacroDefinition= s[Macro])=0D + String =3D String.replace(=0D + "$(%s)" % Macro, MacroDefinitions[Macro])=0D else:=0D Count =3D 0=0D for QuotedStringItem in QuotedStringList:=0D Count +=3D 1=0D if Count % 2 !=3D 0:=0D QuotedStringList[Count - 1] =3D QuotedStringList[C= ount - 1].replace("$(%s)" % Macro,=0D - Ma= croDefinitions[Macro])=0D + = MacroDefinitions[Macro])=0D elif Count =3D=3D len(QuotedStringList) and Count % 2 = =3D=3D 0:=0D QuotedStringList[Count - 1] =3D QuotedStringList[C= ount - 1].replace("$(%s)" % Macro,=0D - Ma= croDefinitions[Macro])=0D + = MacroDefinitions[Macro])=0D =0D RetString =3D ''=0D if HaveQuotedMacroFlag:=0D @@ -227,7 +244,7 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, SelfR= eplacement=3DFalse, Line=3DNone =0D return String=0D =0D -## NormPath=0D +# NormPath=0D #=0D # Create a normal path=0D # And replace DEFINE in the path=0D @@ -235,6 +252,8 @@ def ReplaceMacro(String, MacroDefinitions=3DNone, SelfR= eplacement=3DFalse, Line=3DNone # @param Path: The input value for Path to be converted=0D # @param Defines: A set for DEFINE statement=0D #=0D +=0D +=0D def NormPath(Path, Defines=3DNone):=0D IsRelativePath =3D False=0D if Defines is None:=0D @@ -256,7 +275,7 @@ def NormPath(Path, Defines=3DNone): Path =3D os.path.join('.', Path)=0D return Path=0D =0D -## CleanString=0D +# CleanString=0D #=0D # Remove comments in a string=0D # Remove spaces=0D @@ -265,6 +284,8 @@ def NormPath(Path, Defines=3DNone): # @param CommentCharacter: Comment char, used to ignore comment content,= =0D # default is DataType.TAB_COMMENT_SPLIT=0D #=0D +=0D +=0D def CleanString(Line, CommentCharacter=3DDataType.TAB_COMMENT_SPLIT, Allow= CppStyleComment=3DFalse):=0D #=0D # remove whitespace=0D @@ -292,7 +313,7 @@ def CleanString(Line, CommentCharacter=3DDataType.TAB_C= OMMENT_SPLIT, AllowCppStyle =0D return Line=0D =0D -## CleanString2=0D +# CleanString2=0D #=0D # Split comments in a string=0D # Remove spaces=0D @@ -301,6 +322,8 @@ def CleanString(Line, CommentCharacter=3DDataType.TAB_C= OMMENT_SPLIT, AllowCppStyle # @param CommentCharacter: Comment char, used to ignore comment content,= =0D # default is DataType.TAB_COMMENT_SPLIT=0D #=0D +=0D +=0D def CleanString2(Line, CommentCharacter=3DDataType.TAB_COMMENT_SPLIT, Allo= wCppStyleComment=3DFalse):=0D #=0D # remove whitespace=0D @@ -337,7 +360,7 @@ def CleanString2(Line, CommentCharacter=3DDataType.TAB_= COMMENT_SPLIT, AllowCppStyl =0D return Line, Comment=0D =0D -## GetMultipleValuesOfKeyFromLines=0D +# GetMultipleValuesOfKeyFromLines=0D #=0D # Parse multiple strings to clean comment and spaces=0D # The result is saved to KeyValues=0D @@ -347,6 +370,8 @@ def CleanString2(Line, CommentCharacter=3DDataType.TAB_= COMMENT_SPLIT, AllowCppStyl # @param KeyValues: To store data after parsing=0D # @param CommentCharacter: Comment char, used to ignore comment content=0D #=0D +=0D +=0D def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValues, CommentCharacte= r):=0D if Key:=0D pass=0D @@ -360,7 +385,7 @@ def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyValu= es, CommentCharacter): KeyValues +=3D [Line]=0D return True=0D =0D -## GetDefineValue=0D +# GetDefineValue=0D #=0D # Parse a DEFINE statement to get defined value=0D # DEFINE Key Value=0D @@ -369,13 +394,15 @@ def GetMultipleValuesOfKeyFromLines(Lines, Key, KeyVa= lues, CommentCharacter): # @param Key: The key of DEFINE statement=0D # @param CommentCharacter: Comment char, used to ignore comment content=0D #=0D +=0D +=0D def GetDefineValue(String, Key, CommentCharacter):=0D if CommentCharacter:=0D pass=0D String =3D CleanString(String)=0D - return String[String.find(Key + ' ') + len(Key + ' ') : ]=0D + return String[String.find(Key + ' ') + len(Key + ' '):]=0D =0D -## GetSingleValueOfKeyFromLines=0D +# GetSingleValueOfKeyFromLines=0D #=0D # Parse multiple strings as below to get value of each definition line=0D # Key1 =3D Value1=0D @@ -393,7 +420,9 @@ def GetDefineValue(String, Key, CommentCharacter): # values. Key1 =3D Value1|Value2, '|' is the = value=0D # split char=0D #=0D -def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeyS= plitCharacter, \=0D +=0D +=0D +def GetSingleValueOfKeyFromLines(Lines, Dictionary, CommentCharacter, KeyS= plitCharacter,=0D ValueSplitFlag, ValueSplitCharacter):=0D Lines =3D Lines.split('\n')=0D Keys =3D []=0D @@ -408,12 +437,14 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, C= ommentCharacter, KeySplitCh if Line.find(DataType.TAB_INF_DEFINES_DEFINE + ' ') > -1:=0D if '' in DefineValues:=0D DefineValues.remove('')=0D - DefineValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFI= NES_DEFINE, CommentCharacter))=0D + DefineValues.append(GetDefineValue(=0D + Line, DataType.TAB_INF_DEFINES_DEFINE, CommentCharacter))= =0D continue=0D if Line.find(DataType.TAB_INF_DEFINES_SPEC + ' ') > -1:=0D if '' in SpecValues:=0D SpecValues.remove('')=0D - SpecValues.append(GetDefineValue(Line, DataType.TAB_INF_DEFINE= S_SPEC, CommentCharacter))=0D + SpecValues.append(GetDefineValue(=0D + Line, DataType.TAB_INF_DEFINES_SPEC, CommentCharacter))=0D continue=0D =0D #=0D @@ -428,9 +459,11 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Co= mmentCharacter, KeySplitCh #=0D LineList[1] =3D CleanString(LineList[1], CommentCharacter)= =0D if ValueSplitFlag:=0D - Value =3D list(map(lambda x: x.strip(), LineList[1].sp= lit(ValueSplitCharacter)))=0D + Value =3D list(=0D + map(lambda x: x.strip(), LineList[1].split(ValueSp= litCharacter)))=0D else:=0D - Value =3D CleanString(LineList[1], CommentCharacter).s= plitlines()=0D + Value =3D CleanString(=0D + LineList[1], CommentCharacter).splitlines()=0D =0D if Key[0] in Dictionary:=0D if Key[0] not in Keys:=0D @@ -450,7 +483,7 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Com= mentCharacter, KeySplitCh =0D return True=0D =0D -## The content to be parsed=0D +# The content to be parsed=0D #=0D # Do pre-check for a file before it is parsed=0D # Check $()=0D @@ -460,6 +493,8 @@ def GetSingleValueOfKeyFromLines(Lines, Dictionary, Com= mentCharacter, KeySplitCh # @param FileContent: File content to be parsed=0D # @param SupSectionTag: Used for error report=0D #=0D +=0D +=0D def PreCheck(FileName, FileContent, SupSectionTag):=0D if SupSectionTag:=0D pass=0D @@ -482,7 +517,8 @@ def PreCheck(FileName, FileContent, SupSectionTag): #=0D if Line.find('$') > -1:=0D if Line.find('$(') < 0 or Line.find(')') < 0:=0D - Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo, File= =3DFileName, RaiseError=3DLogger.IS_RAISE_ERROR)=0D + Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DLogger.IS_RAISE= _ERROR)=0D #=0D # Check []=0D #=0D @@ -491,18 +527,20 @@ def PreCheck(FileName, FileContent, SupSectionTag): # Only get one '[' or one ']'=0D #=0D if not (Line.find('[') > -1 and Line.find(']') > -1):=0D - Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo, File= =3DFileName, RaiseError=3DLogger.IS_RAISE_ERROR)=0D + Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DLogger.IS_RAISE= _ERROR)=0D #=0D # Regenerate FileContent=0D #=0D NewFileContent =3D NewFileContent + Line + '\r\n'=0D =0D if IsFailed:=0D - Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo, File=3DFileN= ame, RaiseError=3DLogger.IS_RAISE_ERROR)=0D + Logger.Error("Parser", FORMAT_INVALID, Line=3DLineNo,=0D + File=3DFileName, RaiseError=3DLogger.IS_RAISE_ERROR)= =0D =0D return NewFileContent=0D =0D -## CheckFileType=0D +# CheckFileType=0D #=0D # Check if the Filename is including ExtName=0D # Return True if it exists=0D @@ -516,20 +554,23 @@ def PreCheck(FileName, FileContent, SupSectionTag): # @param Line: The line in container file which defines the = file=0D # to be checked=0D #=0D -def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, = Line, LineNo=3D -1):=0D +=0D +=0D +def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, = Line, LineNo=3D-1):=0D if CheckFilename !=3D '' and CheckFilename is not None:=0D (Root, Ext) =3D os.path.splitext(CheckFilename)=0D if Ext.upper() !=3D ExtName.upper() and Root:=0D ContainerFile =3D open(ContainerFilename, 'r').read()=0D if LineNo =3D=3D -1:=0D LineNo =3D GetLineNo(ContainerFile, Line)=0D - ErrorMsg =3D ST.ERR_SECTIONNAME_INVALID % (SectionName, CheckF= ilename, ExtName)=0D - Logger.Error("Parser", PARSER_ERROR, ErrorMsg, Line=3DLineNo, = \=0D + ErrorMsg =3D ST.ERR_SECTIONNAME_INVALID % (=0D + SectionName, CheckFilename, ExtName)=0D + Logger.Error("Parser", PARSER_ERROR, ErrorMsg, Line=3DLineNo,= =0D File=3DContainerFilename, RaiseError=3DLogger.IS_= RAISE_ERROR)=0D =0D return True=0D =0D -## CheckFileExist=0D +# CheckFileExist=0D #=0D # Check if the file exists=0D # Return True if it exists=0D @@ -543,7 +584,9 @@ def CheckFileType(CheckFilename, ExtName, ContainerFile= name, SectionName, Line, # @param Line: The line in container file which defines the= =0D # file to be checked=0D #=0D -def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, Section= Name, Line, LineNo=3D -1):=0D +=0D +=0D +def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, Section= Name, Line, LineNo=3D-1):=0D CheckFile =3D ''=0D if CheckFilename !=3D '' and CheckFilename is not None:=0D CheckFile =3D WorkspaceFile(WorkspaceDir, CheckFilename)=0D @@ -553,16 +596,18 @@ def CheckFileExist(WorkspaceDir, CheckFilename, Conta= inerFilename, SectionName, LineNo =3D GetLineNo(ContainerFile, Line)=0D ErrorMsg =3D ST.ERR_CHECKFILE_NOTFOUND % (CheckFile, SectionNa= me)=0D Logger.Error("Parser", PARSER_ERROR, ErrorMsg,=0D - File=3DContainerFilename, Line=3DLineNo, Raise= Error=3DLogger.IS_RAISE_ERROR)=0D + File=3DContainerFilename, Line=3DLineNo, RaiseErr= or=3DLogger.IS_RAISE_ERROR)=0D return CheckFile=0D =0D -## GetLineNo=0D +# GetLineNo=0D #=0D # Find the index of a line in a file=0D #=0D # @param FileContent: Search scope=0D # @param Line: Search key=0D #=0D +=0D +=0D def GetLineNo(FileContent, Line, IsIgnoreComment=3DTrue):=0D LineList =3D FileContent.splitlines()=0D for Index in range(len(LineList)):=0D @@ -577,7 +622,7 @@ def GetLineNo(FileContent, Line, IsIgnoreComment=3DTrue= ): =0D return -1=0D =0D -## RaiseParserError=0D +# RaiseParserError=0D #=0D # Raise a parser error=0D #=0D @@ -586,31 +631,37 @@ def GetLineNo(FileContent, Line, IsIgnoreComment=3DTr= ue): # @param File: File which has the string=0D # @param Format: Correct format=0D #=0D -def RaiseParserError(Line, Section, File, Format=3D'', LineNo=3D -1):=0D +=0D +=0D +def RaiseParserError(Line, Section, File, Format=3D'', LineNo=3D-1):=0D if LineNo =3D=3D -1:=0D LineNo =3D GetLineNo(open(os.path.normpath(File), 'r').read(), Lin= e)=0D ErrorMsg =3D ST.ERR_INVALID_NOTFOUND % (Line, Section)=0D if Format !=3D '':=0D Format =3D "Correct format is " + Format=0D - Logger.Error("Parser", PARSER_ERROR, ErrorMsg, File=3DFile, Line=3DLin= eNo, \=0D + Logger.Error("Parser", PARSER_ERROR, ErrorMsg, File=3DFile, Line=3DLin= eNo,=0D ExtraData=3DFormat, RaiseError=3DLogger.IS_RAISE_ERROR)=0D =0D -## WorkspaceFile=0D +# WorkspaceFile=0D #=0D # Return a full path with workspace dir=0D #=0D # @param WorkspaceDir: Workspace dir=0D # @param Filename: Relative file name=0D #=0D +=0D +=0D def WorkspaceFile(WorkspaceDir, Filename):=0D return os.path.join(NormPath(WorkspaceDir), NormPath(Filename))=0D =0D -## Split string=0D +# Split string=0D #=0D # Remove '"' which startswith and endswith string=0D #=0D # @param String: The string need to be split=0D #=0D +=0D +=0D def SplitString(String):=0D if String.startswith('\"'):=0D String =3D String[1:]=0D @@ -618,31 +669,37 @@ def SplitString(String): String =3D String[:-1]=0D return String=0D =0D -## Convert To Sql String=0D +# Convert To Sql String=0D #=0D # Replace "'" with "''" in each item of StringList=0D #=0D # @param StringList: A list for strings to be converted=0D #=0D +=0D +=0D def ConvertToSqlString(StringList):=0D return list(map(lambda s: s.replace("'", "''"), StringList))=0D =0D -## Convert To Sql String=0D +# Convert To Sql String=0D #=0D # Replace "'" with "''" in the String=0D #=0D # @param String: A String to be converted=0D #=0D +=0D +=0D def ConvertToSqlString2(String):=0D return String.replace("'", "''")=0D =0D -## GetStringOfList=0D +# GetStringOfList=0D #=0D # Get String of a List=0D #=0D # @param Lines: string list=0D # @param Split: split character=0D #=0D +=0D +=0D def GetStringOfList(List, Split=3D' '):=0D if not isinstance(List, type([])):=0D return List=0D @@ -651,27 +708,32 @@ def GetStringOfList(List, Split=3D' '): Str =3D Str + Item + Split=0D return Str.strip()=0D =0D -## Get HelpTextList=0D +# Get HelpTextList=0D #=0D # Get HelpTextList from HelpTextClassList=0D #=0D # @param HelpTextClassList: Help Text Class List=0D #=0D +=0D +=0D def GetHelpTextList(HelpTextClassList):=0D List =3D []=0D if HelpTextClassList:=0D for HelpText in HelpTextClassList:=0D if HelpText.String.endswith('\n'):=0D - HelpText.String =3D HelpText.String[0: len(HelpText.String= ) - len('\n')]=0D + HelpText.String =3D HelpText.String[0: len(=0D + HelpText.String) - len('\n')]=0D List.extend(HelpText.String.split('\n'))=0D return List=0D =0D -## Get String Array Length=0D +# Get String Array Length=0D #=0D # Get String Array Length=0D #=0D # @param String: the source string=0D #=0D +=0D +=0D def StringArrayLength(String):=0D if String.startswith('L"'):=0D return (len(String) - 3 + 1) * 2=0D @@ -680,7 +742,7 @@ def StringArrayLength(String): else:=0D return len(String.split()) + 1=0D =0D -## RemoveDupOption=0D +# RemoveDupOption=0D #=0D # Remove Dup Option=0D #=0D @@ -688,6 +750,8 @@ def StringArrayLength(String): # @param Which: Which flag=0D # @param Against: Against flag=0D #=0D +=0D +=0D def RemoveDupOption(OptionString, Which=3D"/I", Against=3DNone):=0D OptionList =3D OptionString.split()=0D ValueList =3D []=0D @@ -707,7 +771,7 @@ def RemoveDupOption(OptionString, Which=3D"/I", Against= =3DNone): ValueList.append(Val)=0D return " ".join(OptionList)=0D =0D -## Check if the string is HexDgit=0D +# Check if the string is HexDgit=0D #=0D # Return true if all characters in the string are digits and there is at=0D # least one character=0D @@ -715,6 +779,8 @@ def RemoveDupOption(OptionString, Which=3D"/I", Against= =3DNone): # , false otherwise.=0D # @param string: input string=0D #=0D +=0D +=0D def IsHexDigit(Str):=0D try:=0D int(Str, 10)=0D @@ -728,7 +794,7 @@ def IsHexDigit(Str): return False=0D return False=0D =0D -## Check if the string is HexDgit and its integer value within limit of UI= NT32=0D +# Check if the string is HexDgit and its integer value within limit of UIN= T32=0D #=0D # Return true if all characters in the string are digits and there is at=0D # least one character=0D @@ -736,6 +802,8 @@ def IsHexDigit(Str): # , false otherwise.=0D # @param string: input string=0D #=0D +=0D +=0D def IsHexDigitUINT32(Str):=0D try:=0D Value =3D int(Str, 10)=0D @@ -751,7 +819,7 @@ def IsHexDigitUINT32(Str): return False=0D return False=0D =0D -## CleanSpecialChar=0D +# CleanSpecialChar=0D #=0D # The ASCII text files of type INF, DEC, INI are edited by developers,=0D # and may contain characters that cannot be directly translated to strings= that=0D @@ -759,20 +827,25 @@ def IsHexDigitUINT32(Str): # (0x00-0x08, TAB [0x09], 0x0B, 0x0C, 0x0E-0x1F, 0x80-0xFF)=0D # must be converted to a space character[0x20] as part of the parsing proc= ess.=0D #=0D +=0D +=0D def ConvertSpecialChar(Lines):=0D RetLines =3D []=0D for line in Lines:=0D - ReMatchSpecialChar =3D re.compile(r"[\x00-\x08]|\x09|\x0b|\x0c|[\x= 0e-\x1f]|[\x7f-\xff]")=0D + ReMatchSpecialChar =3D re.compile(=0D + r"[\x00-\x08]|\x09|\x0b|\x0c|[\x0e-\x1f]|[\x7f-\xff]")=0D RetLines.append(ReMatchSpecialChar.sub(' ', line))=0D =0D return RetLines=0D =0D -## __GetTokenList=0D +# __GetTokenList=0D #=0D # Assume Str is a valid feature flag expression.=0D # Return a list which contains tokens: alpha numeric token and other token= =0D # Whitespace are not stripped=0D #=0D +=0D +=0D def __GetTokenList(Str):=0D InQuote =3D False=0D Token =3D ''=0D @@ -819,13 +892,15 @@ def __GetTokenList(Str): List.append(TokenOP)=0D return List=0D =0D -## ConvertNEToNOTEQ=0D +# ConvertNEToNOTEQ=0D #=0D # Convert NE operator to NOT EQ=0D # For example: 1 NE 2 -> 1 NOT EQ 2=0D #=0D # @param Expr: Feature flag expression to be converted=0D #=0D +=0D +=0D def ConvertNEToNOTEQ(Expr):=0D List =3D __GetTokenList(Expr)=0D for Index in range(len(List)):=0D @@ -833,13 +908,15 @@ def ConvertNEToNOTEQ(Expr): List[Index] =3D 'NOT EQ'=0D return ''.join(List)=0D =0D -## ConvertNOTEQToNE=0D +# ConvertNOTEQToNE=0D #=0D # Convert NOT EQ operator to NE=0D # For example: 1 NOT NE 2 -> 1 NE 2=0D #=0D # @param Expr: Feature flag expression to be converted=0D #=0D +=0D +=0D def ConvertNOTEQToNE(Expr):=0D List =3D __GetTokenList(Expr)=0D HasNOT =3D False=0D @@ -860,7 +937,7 @@ def ConvertNOTEQToNE(Expr): =0D return ''.join(RetList)=0D =0D -## SplitPcdEntry=0D +# SplitPcdEntry=0D #=0D # Split an PCD entry string to Token.CName and PCD value and FFE.=0D # NOTE: PCD Value and FFE can contain "|" in its expression. And in INF sp= ecification, have below rule.=0D @@ -871,6 +948,8 @@ def ConvertNOTEQToNE(Expr): #=0D # @return List [PcdTokenCName, Value, FFE]=0D #=0D +=0D +=0D def SplitPcdEntry(String):=0D if not String:=0D return ['', '', ''], False=0D @@ -923,11 +1002,13 @@ def SplitPcdEntry(String): =0D return ['', '', ''], False=0D =0D -## Check if two arches matched?=0D +# Check if two arches matched?=0D #=0D # @param Arch1=0D # @param Arch2=0D #=0D +=0D +=0D def IsMatchArch(Arch1, Arch2):=0D if 'COMMON' in Arch1 or 'COMMON' in Arch2:=0D return True=0D @@ -953,6 +1034,8 @@ def IsMatchArch(Arch1, Arch2): # Search all files in FilePath to find the FileName with the largest index= =0D # Return the FileName with index +1 under the FilePath=0D #=0D +=0D +=0D def GetUniFileName(FilePath, FileName):=0D Files =3D []=0D try:=0D diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTo= ols/Source/Python/UPT/Library/UniClassObject.py index 8c44dc225277..c06799ed66d1 100644 --- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py +++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Collect all defined strings in multiple uni files.=0D #=0D # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
        =0D @@ -13,7 +13,9 @@ from __future__ import print_function ##=0D # Import Modules=0D #=0D -import os, codecs, re=0D +import os=0D +import codecs=0D +import re=0D import shlex=0D from Logger import ToolError=0D from Logger import Log as EdkLogger=0D @@ -42,40 +44,40 @@ NULL =3D u'\u0000' TAB =3D u'\t'=0D BACK_SPLASH =3D u'\\'=0D =0D -gLANG_CONV_TABLE =3D {'eng':'en', 'fra':'fr', \=0D - 'aar':'aa', 'abk':'ab', 'ave':'ae', 'afr':'af', 'aka':'ak= ', 'amh':'am', \=0D - 'arg':'an', 'ara':'ar', 'asm':'as', 'ava':'av', 'aym':'ay= ', 'aze':'az', \=0D - 'bak':'ba', 'bel':'be', 'bul':'bg', 'bih':'bh', 'bis':'bi= ', 'bam':'bm', \=0D - 'ben':'bn', 'bod':'bo', 'bre':'br', 'bos':'bs', 'cat':'ca= ', 'che':'ce', \=0D - 'cha':'ch', 'cos':'co', 'cre':'cr', 'ces':'cs', 'chu':'cu= ', 'chv':'cv', \=0D - 'cym':'cy', 'dan':'da', 'deu':'de', 'div':'dv', 'dzo':'dz= ', 'ewe':'ee', \=0D - 'ell':'el', 'epo':'eo', 'spa':'es', 'est':'et', 'eus':'eu= ', 'fas':'fa', \=0D - 'ful':'ff', 'fin':'fi', 'fij':'fj', 'fao':'fo', 'fry':'fy= ', 'gle':'ga', \=0D - 'gla':'gd', 'glg':'gl', 'grn':'gn', 'guj':'gu', 'glv':'gv= ', 'hau':'ha', \=0D - 'heb':'he', 'hin':'hi', 'hmo':'ho', 'hrv':'hr', 'hat':'ht= ', 'hun':'hu', \=0D - 'hye':'hy', 'her':'hz', 'ina':'ia', 'ind':'id', 'ile':'ie= ', 'ibo':'ig', \=0D - 'iii':'ii', 'ipk':'ik', 'ido':'io', 'isl':'is', 'ita':'it= ', 'iku':'iu', \=0D - 'jpn':'ja', 'jav':'jv', 'kat':'ka', 'kon':'kg', 'kik':'ki= ', 'kua':'kj', \=0D - 'kaz':'kk', 'kal':'kl', 'khm':'km', 'kan':'kn', 'kor':'ko= ', 'kau':'kr', \=0D - 'kas':'ks', 'kur':'ku', 'kom':'kv', 'cor':'kw', 'kir':'ky= ', 'lat':'la', \=0D - 'ltz':'lb', 'lug':'lg', 'lim':'li', 'lin':'ln', 'lao':'lo= ', 'lit':'lt', \=0D - 'lub':'lu', 'lav':'lv', 'mlg':'mg', 'mah':'mh', 'mri':'mi= ', 'mkd':'mk', \=0D - 'mal':'ml', 'mon':'mn', 'mar':'mr', 'msa':'ms', 'mlt':'mt= ', 'mya':'my', \=0D - 'nau':'na', 'nob':'nb', 'nde':'nd', 'nep':'ne', 'ndo':'ng= ', 'nld':'nl', \=0D - 'nno':'nn', 'nor':'no', 'nbl':'nr', 'nav':'nv', 'nya':'ny= ', 'oci':'oc', \=0D - 'oji':'oj', 'orm':'om', 'ori':'or', 'oss':'os', 'pan':'pa= ', 'pli':'pi', \=0D - 'pol':'pl', 'pus':'ps', 'por':'pt', 'que':'qu', 'roh':'rm= ', 'run':'rn', \=0D - 'ron':'ro', 'rus':'ru', 'kin':'rw', 'san':'sa', 'srd':'sc= ', 'snd':'sd', \=0D - 'sme':'se', 'sag':'sg', 'sin':'si', 'slk':'sk', 'slv':'sl= ', 'smo':'sm', \=0D - 'sna':'sn', 'som':'so', 'sqi':'sq', 'srp':'sr', 'ssw':'ss= ', 'sot':'st', \=0D - 'sun':'su', 'swe':'sv', 'swa':'sw', 'tam':'ta', 'tel':'te= ', 'tgk':'tg', \=0D - 'tha':'th', 'tir':'ti', 'tuk':'tk', 'tgl':'tl', 'tsn':'tn= ', 'ton':'to', \=0D - 'tur':'tr', 'tso':'ts', 'tat':'tt', 'twi':'tw', 'tah':'ty= ', 'uig':'ug', \=0D - 'ukr':'uk', 'urd':'ur', 'uzb':'uz', 'ven':'ve', 'vie':'vi= ', 'vol':'vo', \=0D - 'wln':'wa', 'wol':'wo', 'xho':'xh', 'yid':'yi', 'yor':'yo= ', 'zha':'za', \=0D - 'zho':'zh', 'zul':'zu'}=0D +gLANG_CONV_TABLE =3D {'eng': 'en', 'fra': 'fr',=0D + 'aar': 'aa', 'abk': 'ab', 'ave': 'ae', 'afr': 'af', 'a= ka': 'ak', 'amh': 'am',=0D + 'arg': 'an', 'ara': 'ar', 'asm': 'as', 'ava': 'av', 'a= ym': 'ay', 'aze': 'az',=0D + 'bak': 'ba', 'bel': 'be', 'bul': 'bg', 'bih': 'bh', 'b= is': 'bi', 'bam': 'bm',=0D + 'ben': 'bn', 'bod': 'bo', 'bre': 'br', 'bos': 'bs', 'c= at': 'ca', 'che': 'ce',=0D + 'cha': 'ch', 'cos': 'co', 'cre': 'cr', 'ces': 'cs', 'c= hu': 'cu', 'chv': 'cv',=0D + 'cym': 'cy', 'dan': 'da', 'deu': 'de', 'div': 'dv', 'd= zo': 'dz', 'ewe': 'ee',=0D + 'ell': 'el', 'epo': 'eo', 'spa': 'es', 'est': 'et', 'e= us': 'eu', 'fas': 'fa',=0D + 'ful': 'ff', 'fin': 'fi', 'fij': 'fj', 'fao': 'fo', 'f= ry': 'fy', 'gle': 'ga',=0D + 'gla': 'gd', 'glg': 'gl', 'grn': 'gn', 'guj': 'gu', 'g= lv': 'gv', 'hau': 'ha',=0D + 'heb': 'he', 'hin': 'hi', 'hmo': 'ho', 'hrv': 'hr', 'h= at': 'ht', 'hun': 'hu',=0D + 'hye': 'hy', 'her': 'hz', 'ina': 'ia', 'ind': 'id', 'i= le': 'ie', 'ibo': 'ig',=0D + 'iii': 'ii', 'ipk': 'ik', 'ido': 'io', 'isl': 'is', 'i= ta': 'it', 'iku': 'iu',=0D + 'jpn': 'ja', 'jav': 'jv', 'kat': 'ka', 'kon': 'kg', 'k= ik': 'ki', 'kua': 'kj',=0D + 'kaz': 'kk', 'kal': 'kl', 'khm': 'km', 'kan': 'kn', 'k= or': 'ko', 'kau': 'kr',=0D + 'kas': 'ks', 'kur': 'ku', 'kom': 'kv', 'cor': 'kw', 'k= ir': 'ky', 'lat': 'la',=0D + 'ltz': 'lb', 'lug': 'lg', 'lim': 'li', 'lin': 'ln', 'l= ao': 'lo', 'lit': 'lt',=0D + 'lub': 'lu', 'lav': 'lv', 'mlg': 'mg', 'mah': 'mh', 'm= ri': 'mi', 'mkd': 'mk',=0D + 'mal': 'ml', 'mon': 'mn', 'mar': 'mr', 'msa': 'ms', 'm= lt': 'mt', 'mya': 'my',=0D + 'nau': 'na', 'nob': 'nb', 'nde': 'nd', 'nep': 'ne', 'n= do': 'ng', 'nld': 'nl',=0D + 'nno': 'nn', 'nor': 'no', 'nbl': 'nr', 'nav': 'nv', 'n= ya': 'ny', 'oci': 'oc',=0D + 'oji': 'oj', 'orm': 'om', 'ori': 'or', 'oss': 'os', 'p= an': 'pa', 'pli': 'pi',=0D + 'pol': 'pl', 'pus': 'ps', 'por': 'pt', 'que': 'qu', 'r= oh': 'rm', 'run': 'rn',=0D + 'ron': 'ro', 'rus': 'ru', 'kin': 'rw', 'san': 'sa', 's= rd': 'sc', 'snd': 'sd',=0D + 'sme': 'se', 'sag': 'sg', 'sin': 'si', 'slk': 'sk', 's= lv': 'sl', 'smo': 'sm',=0D + 'sna': 'sn', 'som': 'so', 'sqi': 'sq', 'srp': 'sr', 's= sw': 'ss', 'sot': 'st',=0D + 'sun': 'su', 'swe': 'sv', 'swa': 'sw', 'tam': 'ta', 't= el': 'te', 'tgk': 'tg',=0D + 'tha': 'th', 'tir': 'ti', 'tuk': 'tk', 'tgl': 'tl', 't= sn': 'tn', 'ton': 'to',=0D + 'tur': 'tr', 'tso': 'ts', 'tat': 'tt', 'twi': 'tw', 't= ah': 'ty', 'uig': 'ug',=0D + 'ukr': 'uk', 'urd': 'ur', 'uzb': 'uz', 'ven': 've', 'v= ie': 'vi', 'vol': 'vo',=0D + 'wln': 'wa', 'wol': 'wo', 'xho': 'xh', 'yid': 'yi', 'y= or': 'yo', 'zha': 'za',=0D + 'zho': 'zh', 'zul': 'zu'}=0D =0D -## Convert a python unicode string to a normal string=0D +# Convert a python unicode string to a normal string=0D #=0D # Convert a python unicode string to a normal string=0D # UniToStr(u'I am a string') is 'I am a string'=0D @@ -84,10 +86,12 @@ gLANG_CONV_TABLE =3D {'eng':'en', 'fra':'fr', \ #=0D # @retval: The formatted normal string=0D #=0D +=0D +=0D def UniToStr(Uni):=0D return repr(Uni)[2:-1]=0D =0D -## Convert a unicode string to a Hex list=0D +# Convert a unicode string to a Hex list=0D #=0D # Convert a unicode string to a Hex list=0D # UniToHexList('ABC') is ['0x41', '0x00', '0x42', '0x00', '0x43', '0x00']= =0D @@ -96,6 +100,8 @@ def UniToStr(Uni): #=0D # @retval List: The formatted hex list=0D #=0D +=0D +=0D def UniToHexList(Uni):=0D List =3D []=0D for Item in Uni:=0D @@ -104,7 +110,7 @@ def UniToHexList(Uni): List.append('0x' + Temp[0:2])=0D return List=0D =0D -## Convert special unicode characters=0D +# Convert special unicode characters=0D #=0D # Convert special characters to (c), (r) and (tm).=0D #=0D @@ -112,6 +118,8 @@ def UniToHexList(Uni): #=0D # @retval NewUni: The converted unicode string=0D #=0D +=0D +=0D def ConvertSpecialUnicodes(Uni):=0D OldUni =3D NewUni =3D Uni=0D NewUni =3D NewUni.replace(u'\u00A9', '(c)')=0D @@ -121,7 +129,7 @@ def ConvertSpecialUnicodes(Uni): NewUni =3D OldUni=0D return NewUni=0D =0D -## GetLanguageCode1766=0D +# GetLanguageCode1766=0D #=0D # Check the language code read from .UNI file and convert RFC 4646 codes t= o RFC 1766 codes=0D # RFC 1766 language codes supported in compatibility mode=0D @@ -131,6 +139,8 @@ def ConvertSpecialUnicodes(Uni): #=0D # @retval LangName: Valid language code in RFC 1766 format or None=0D #=0D +=0D +=0D def GetLanguageCode1766(LangName, File=3DNone):=0D return LangName=0D =0D @@ -145,9 +155,9 @@ def GetLanguageCode1766(LangName, File=3DNone): return LangName=0D else:=0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - "Invalid RFC 1766 language code : %s" % LangN= ame,=0D - File)=0D + ToolError.FORMAT_INVALID,=0D + "Invalid RFC 1766 language code : %s" % LangNa= me,=0D + File)=0D elif length =3D=3D 5:=0D if LangName[0:2].isalpha() and LangName[2] =3D=3D '-':=0D for Key in gLANG_CONV_TABLE.keys():=0D @@ -164,11 +174,11 @@ def GetLanguageCode1766(LangName, File=3DNone): return Key=0D =0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - "Invalid RFC 4646 language code : %s" % LangN= ame,=0D - File)=0D + ToolError.FORMAT_INVALID,=0D + "Invalid RFC 4646 language code : %s" % LangName,=0D + File)=0D =0D -## GetLanguageCode=0D +# GetLanguageCode=0D #=0D # Check the language code read from .UNI file and convert RFC 1766 codes t= o RFC 4646 codes if appropriate=0D # RFC 1766 language codes supported in compatibility mode=0D @@ -178,6 +188,8 @@ def GetLanguageCode1766(LangName, File=3DNone): #=0D # @retval LangName: Valid lanugage code in RFC 4646 format or None=0D #=0D +=0D +=0D def GetLanguageCode(LangName, IsCompatibleMode, File):=0D length =3D len(LangName)=0D if IsCompatibleMode:=0D @@ -188,9 +200,9 @@ def GetLanguageCode(LangName, IsCompatibleMode, File): return LangName=0D else:=0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - "Invalid RFC 1766 language code : %s" % LangN= ame,=0D - File)=0D + ToolError.FORMAT_INVALID,=0D + "Invalid RFC 1766 language code : %s" % LangNa= me,=0D + File)=0D if (LangName[0] =3D=3D 'X' or LangName[0] =3D=3D 'x') and LangName[1] = =3D=3D '-':=0D return LangName=0D if length =3D=3D 2:=0D @@ -209,11 +221,11 @@ def GetLanguageCode(LangName, IsCompatibleMode, File): return LangName=0D =0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - "Invalid RFC 4646 language code : %s" % LangN= ame,=0D - File)=0D + ToolError.FORMAT_INVALID,=0D + "Invalid RFC 4646 language code : %s" % LangName,=0D + File)=0D =0D -## FormatUniEntry=0D +# FormatUniEntry=0D #=0D # Formatted the entry in Uni file.=0D #=0D @@ -222,6 +234,8 @@ def GetLanguageCode(LangName, IsCompatibleMode, File): # @param ContainerFile ContainerFile.=0D #=0D # @return formatted entry=0D +=0D +=0D def FormatUniEntry(StrTokenName, TokenValueList, ContainerFile):=0D SubContent =3D ''=0D PreFormatLength =3D 40=0D @@ -243,21 +257,24 @@ def FormatUniEntry(StrTokenName, TokenValueList, Cont= ainerFile): for SubValue in ValueList:=0D if SubValue.strip():=0D SubValueContent +=3D \=0D - ' ' * (PreFormatLength + len('#language en-US ')) + '\"%s\= \n\"' % SubValue.strip() + '\r\n'=0D + ' ' * (PreFormatLength + len('#language en-US ')) + \= =0D + '\"%s\\n\"' % SubValue.strip() + '\r\n'=0D SubValueContent =3D SubValueContent[(PreFormatLength + len('#langu= age en-US ')):SubValueContent.rfind('\\n')] \=0D - + '\"' + '\r\n'=0D + + '\"' + '\r\n'=0D SubContent +=3D ' '*PreFormatLength + '#language %-5s ' % Lang + S= ubValueContent=0D if SubContent:=0D - SubContent =3D StrTokenName + ' '*(PreFormatLength - len(StrTokenN= ame)) + SubContent[PreFormatLength:]=0D + SubContent =3D StrTokenName + ' ' * \=0D + (PreFormatLength - len(StrTokenName)) + \=0D + SubContent[PreFormatLength:]=0D return SubContent=0D =0D =0D -## StringDefClassObject=0D +# StringDefClassObject=0D #=0D # A structure for language definition=0D #=0D class StringDefClassObject(object):=0D - def __init__(self, Name =3D None, Value =3D None, Referenced =3D False= , Token =3D None, UseOtherLangDef =3D ''):=0D + def __init__(self, Name=3DNone, Value=3DNone, Referenced=3DFalse, Toke= n=3DNone, UseOtherLangDef=3D''):=0D self.StringName =3D ''=0D self.StringNameByteList =3D []=0D self.StringValue =3D ''=0D @@ -279,12 +296,12 @@ class StringDefClassObject(object): =0D def __str__(self):=0D return repr(self.StringName) + ' ' + \=0D - repr(self.Token) + ' ' + \=0D - repr(self.Referenced) + ' ' + \=0D - repr(self.StringValue) + ' ' + \=0D - repr(self.UseOtherLangDef)=0D + repr(self.Token) + ' ' + \=0D + repr(self.Referenced) + ' ' + \=0D + repr(self.StringValue) + ' ' + \=0D + repr(self.UseOtherLangDef)=0D =0D - def UpdateValue(self, Value =3D None):=0D + def UpdateValue(self, Value=3DNone):=0D if Value is not None:=0D if self.StringValue:=0D self.StringValue =3D self.StringValue + '\r\n' + Value=0D @@ -293,21 +310,26 @@ class StringDefClassObject(object): self.StringValueByteList =3D UniToHexList(self.StringValue)=0D self.Length =3D len(self.StringValueByteList)=0D =0D -## UniFileClassObject=0D +# UniFileClassObject=0D #=0D # A structure for .uni file definition=0D #=0D +=0D +=0D class UniFileClassObject(object):=0D - def __init__(self, FileList =3D None, IsCompatibleMode =3D False, Incl= udePathList =3D None):=0D + def __init__(self, FileList=3DNone, IsCompatibleMode=3DFalse, IncludeP= athList=3DNone):=0D self.FileList =3D FileList=0D self.File =3D None=0D self.IncFileList =3D FileList=0D self.UniFileHeader =3D ''=0D self.Token =3D 2=0D - self.LanguageDef =3D [] #[ [u'LanguageIdentifier= ', u'PrintableName'], ... ]=0D - self.OrderedStringList =3D {} #{ u'LanguageIdentifier'= : [StringDefClassObject] }=0D - self.OrderedStringDict =3D {} #{ u'LanguageIdentifier'= : {StringName:(IndexInList)} }=0D - self.OrderedStringListByToken =3D {} #{ u'LanguageIdentifier'= : {Token: StringDefClassObject} }=0D + self.LanguageDef =3D [] # [ [u'LanguageIdentifier', u'PrintableNa= me'], ... ]=0D + # { u'LanguageIdentifier' : [StringDefClassObject] }=0D + self.OrderedStringList =3D {}=0D + # { u'LanguageIdentifier' : {StringName:(IndexInList)} }=0D + self.OrderedStringDict =3D {}=0D + # { u'LanguageIdentifier' : {Token: StringDefClassObject} }=0D + self.OrderedStringListByToken =3D {}=0D self.IsCompatibleMode =3D IsCompatibleMode=0D if not IncludePathList:=0D self.IncludePathList =3D []=0D @@ -323,11 +345,14 @@ class UniFileClassObject(object): Lang =3D shlex.split(Line.split(u"//")[0])=0D if len(Lang) !=3D 3:=0D try:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D= 'utf_8').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_8').readlines()=0D except UnicodeError as Xstr:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D= 'utf_16').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_16').readlines()=0D except UnicodeError as Xstr:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D= 'utf_16_le').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_16_le').readlines()=0D except:=0D EdkLogger.Error("Unicode File Parser",=0D ToolError.FILE_OPEN_FAILURE,=0D @@ -335,12 +360,13 @@ class UniFileClassObject(object): ExtraData=3DFile)=0D LineNo =3D GetLineNo(FileIn, Line, False)=0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.PARSER_ERROR,=0D - "Wrong language definition",=0D - ExtraData=3D"""%s\n\t*Correct format is like = '#langdef en-US "English"'""" % Line,=0D - File =3D File, Line =3D LineNo)=0D + ToolError.PARSER_ERROR,=0D + "Wrong language definition",=0D + ExtraData=3D"""%s\n\t*Correct format is like '= #langdef en-US "English"'""" % Line,=0D + File=3DFile, Line=3DLineNo)=0D else:=0D - LangName =3D GetLanguageCode(Lang[1], self.IsCompatibleMode, s= elf.File)=0D + LangName =3D GetLanguageCode(=0D + Lang[1], self.IsCompatibleMode, self.File)=0D LangPrintName =3D Lang[2]=0D =0D IsLangInDef =3D False=0D @@ -355,8 +381,10 @@ class UniFileClassObject(object): #=0D # Add language string=0D #=0D - self.AddStringToList(u'$LANGUAGE_NAME', LangName, LangName, 0, Tru= e, Index=3D0)=0D - self.AddStringToList(u'$PRINTABLE_LANGUAGE_NAME', LangName, LangPr= intName, 1, True, Index=3D1)=0D + self.AddStringToList(u'$LANGUAGE_NAME', LangName,=0D + LangName, 0, True, Index=3D0)=0D + self.AddStringToList(u'$PRINTABLE_LANGUAGE_NAME',=0D + LangName, LangPrintName, 1, True, Index=3D1)= =0D =0D if not IsLangInDef:=0D #=0D @@ -365,18 +393,19 @@ class UniFileClassObject(object): #=0D FirstLangName =3D self.LanguageDef[0][0]=0D if LangName !=3D FirstLangName:=0D - for Index in range (2, len (self.OrderedStringList[FirstLa= ngName])):=0D + for Index in range(2, len(self.OrderedStringList[FirstLang= Name])):=0D Item =3D self.OrderedStringList[FirstLangName][Index]= =0D if Item.UseOtherLangDef !=3D '':=0D OtherLang =3D Item.UseOtherLangDef=0D else:=0D OtherLang =3D FirstLangName=0D - self.OrderedStringList[LangName].append (StringDefClas= sObject(Item.StringName,=0D - = '',=0D - = Item.Referenced,=0D - = Item.Token,=0D - = OtherLang))=0D - self.OrderedStringDict[LangName][Item.StringName] =3D = len(self.OrderedStringList[LangName]) - 1=0D + self.OrderedStringList[LangName].append(StringDefClass= Object(Item.StringName,=0D + = '',=0D + = Item.Referenced,=0D + = Item.Token,=0D + = OtherLang))=0D + self.OrderedStringDict[LangName][Item.StringName] =3D = len(=0D + self.OrderedStringList[LangName]) - 1=0D return True=0D =0D #=0D @@ -392,27 +421,30 @@ class UniFileClassObject(object): MatchString =3D re.match('[A-Z0-9_]+', Name, re.UNICODE)=0D if MatchString is None or MatchString.end(0) !=3D len(Name):=0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FORMAT_INVALID,=0D - 'The string token name %s in UNI file %s must= be upper case character.' %(Name, self.File))=0D + ToolError.FORMAT_INVALID,=0D + 'The string token name %s in UNI file %s m= ust be upper case character.' % (Name, self.File))=0D LanguageList =3D Item.split(u'#language ')=0D for IndexI in range(len(LanguageList)):=0D if IndexI =3D=3D 0:=0D continue=0D else:=0D Language =3D LanguageList[IndexI].split()[0]=0D - #.replace(u'\r\n', u'')=0D + # .replace(u'\r\n', u'')=0D Value =3D \=0D - LanguageList[IndexI][LanguageList[IndexI].find(u'\"') + le= n(u'\"') : LanguageList[IndexI].rfind(u'\"')]=0D - Language =3D GetLanguageCode(Language, self.IsCompatibleMo= de, self.File)=0D + LanguageList[IndexI][LanguageList[IndexI].find(=0D + u'\"') + len(u'\"'): LanguageList[IndexI].rfind(u'= \"')]=0D + Language =3D GetLanguageCode(=0D + Language, self.IsCompatibleMode, self.File)=0D self.AddStringToList(Name, Language, Value)=0D =0D #=0D # Get include file list and load them=0D #=0D - def GetIncludeFile(self, Item, Dir =3D None):=0D + def GetIncludeFile(self, Item, Dir=3DNone):=0D if Dir:=0D pass=0D - FileName =3D Item[Item.find(u'!include ') + len(u'!include ') :Ite= m.find(u' ', len(u'!include '))][1:-1]=0D + FileName =3D Item[Item.find(=0D + u'!include ') + len(u'!include '):Item.find(u' ', len(u'!inclu= de '))][1:-1]=0D self.LoadUniFile(FileName)=0D =0D #=0D @@ -421,8 +453,8 @@ class UniFileClassObject(object): def PreProcess(self, File, IsIncludeFile=3DFalse):=0D if not os.path.exists(File.Path) or not os.path.isfile(File.Path):= =0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FILE_NOT_FOUND,=0D - ExtraData=3DFile.Path)=0D + ToolError.FILE_NOT_FOUND,=0D + ExtraData=3DFile.Path)=0D =0D #=0D # Check file header of the Uni file=0D @@ -432,14 +464,17 @@ class UniFileClassObject(object): # ExtraData=3D'The file %s is either invalid U= TF-16LE or it is missing the BOM.' % File.Path)=0D =0D try:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D'utf= _8').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_8').readlines()=0D except UnicodeError as Xstr:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D'utf= _16').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_16').readlines()=0D except UnicodeError:=0D - FileIn =3D codecs.open(File.Path, mode=3D'rb', encoding=3D'utf= _16_le').readlines()=0D + FileIn =3D codecs.open(File.Path, mode=3D'rb',=0D + encoding=3D'utf_16_le').readlines()=0D except:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FILE_OPEN_FAI= LURE, ExtraData=3DFile.Path)=0D -=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FILE_OPEN_FAILURE, ExtraData=3DFile.= Path)=0D =0D #=0D # get the file header=0D @@ -456,7 +491,7 @@ class UniFileClassObject(object): if Line =3D=3D u'':=0D continue=0D if Line.startswith(DT.TAB_COMMENT_EDK1_SPLIT) and (Line.find(D= T.TAB_HEADER_COMMENT) > -1) \=0D - and not HeaderEnd and not HeaderStart:=0D + and not HeaderEnd and not HeaderStart:=0D HeaderStart =3D True=0D if not Line.startswith(DT.TAB_COMMENT_EDK1_SPLIT) and HeaderSt= art and not HeaderEnd:=0D HeaderEnd =3D True=0D @@ -494,7 +529,8 @@ class UniFileClassObject(object): # there should be only one line feed character between the= m=0D #=0D if MultiLineFeedExits:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D continue=0D =0D MultiLineFeedExits =3D False=0D @@ -509,8 +545,8 @@ class UniFileClassObject(object): FileIn[LineCount-1] =3D Line=0D FileIn[LineCount] =3D '\r\n'=0D LineCount -=3D 1=0D - for Index in range (LineCount + 1, len (FileIn) - 1):= =0D - if (Index =3D=3D len(FileIn) -1):=0D + for Index in range(LineCount + 1, len(FileIn) - 1):=0D + if (Index =3D=3D len(FileIn) - 1):=0D FileIn[Index] =3D '\r\n'=0D else:=0D FileIn[Index] =3D FileIn[Index + 1]=0D @@ -521,9 +557,11 @@ class UniFileClassObject(object): if Line[CommIndex+1] =3D=3D u'/':=0D Line =3D Line[:CommIndex].strip()=0D else:=0D - EdkLogger.Error("Unicode File Parser", ToolError.F= ORMAT_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error(=0D + "Unicode File Parser", ToolError.FORMAT_INVALI= D, ExtraData=3DFile.Path)=0D else:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D =0D Line =3D Line.replace(UNICODE_WIDE_CHAR, WIDE_CHAR)=0D Line =3D Line.replace(UNICODE_NARROW_CHAR, NARROW_CHAR)=0D @@ -545,7 +583,7 @@ class UniFileClassObject(object): if not Line.endswith('"'):=0D EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID,=0D ExtraData=3D'''The line %s misses '"' = at the end of it in file %s'''=0D - % (LineCount, File.Path))= =0D + % (LineCount, File.Path))=0D =0D #=0D # Between Name entry and Language entry can not contain line f= eed=0D @@ -624,31 +662,34 @@ class UniFileClassObject(object): #=0D =0D if not IsIncludeFile and not Lines:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D, \=0D - Message=3DST.ERR_UNIPARSE_NO_SECTION_EXIST, \=0D - ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D,=0D + Message=3DST.ERR_UNIPARSE_NO_SECTION_EXIST,=0D + ExtraData=3DFile.Path)=0D =0D NewLines =3D []=0D StrName =3D u''=0D ExistStrNameList =3D []=0D for Line in Lines:=0D if StrName and not StrName.split()[1].startswith(DT.TAB_STR_TO= KENCNAME + DT.TAB_UNDERLINE_SPLIT):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, \=0D - Message=3DST.ERR_UNIPARSE_STRNAME_FORMAT_E= RROR % StrName.split()[1], \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID,=0D + Message=3DST.ERR_UNIPARSE_STRNAME_FORMAT_E= RROR % StrName.split()[=0D + 1],=0D ExtraData=3DFile.Path)=0D =0D if StrName and len(StrName.split()[1].split(DT.TAB_UNDERLINE_S= PLIT)) =3D=3D 4:=0D - StringTokenList =3D StrName.split()[1].split(DT.TAB_UNDERL= INE_SPLIT)=0D - if (StringTokenList[3].upper() in [DT.TAB_STR_TOKENPROMPT,= DT.TAB_STR_TOKENHELP] and \=0D - StringTokenList[3] not in [DT.TAB_STR_TOKENPROMPT, DT.= TAB_STR_TOKENHELP]) or \=0D - (StringTokenList[2].upper() =3D=3D DT.TAB_STR_TOKENERR= and StringTokenList[2] !=3D DT.TAB_STR_TOKENERR):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, \=0D - Message=3DST.ERR_UNIPARSE_STRTOKEN_FORMAT_= ERROR % StrName.split()[1], \=0D - ExtraData=3DFile.Path)=0D + StringTokenList =3D StrName.split()[1].split(=0D + DT.TAB_UNDERLINE_SPLIT)=0D + if (StringTokenList[3].upper() in [DT.TAB_STR_TOKENPROMPT,= DT.TAB_STR_TOKENHELP] and=0D + StringTokenList[3] not in [DT.TAB_STR_TOKENPROMPT,= DT.TAB_STR_TOKENHELP]) or \=0D + (StringTokenList[2].upper() =3D=3D DT.TAB_STR_TOKE= NERR and StringTokenList[2] !=3D DT.TAB_STR_TOKENERR):=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID,=0D + Message=3DST.ERR_UNIPARSE_STRTOKEN_FOR= MAT_ERROR % StrName.split()[=0D + 1],=0D + ExtraData=3DFile.Path)=0D =0D if Line.count(u'#language') > 1:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, \=0D - Message=3DST.ERR_UNIPARSE_SEP_LANGENTRY_LI= NE % Line, \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID,=0D + Message=3DST.ERR_UNIPARSE_SEP_LANGENTRY_LI= NE % Line,=0D ExtraData=3DFile.Path)=0D =0D if Line.startswith(u'//'):=0D @@ -661,74 +702,88 @@ class UniFileClassObject(object): NewLines.append(Line[:Line.find(u'"')].strip())=0D NewLines.append(Line[Line.find(u'"'):])=0D else:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D elif Line.startswith(u'#string'):=0D if len(Line.split()) =3D=3D 2:=0D StrName =3D Line=0D if StrName:=0D if StrName.split()[1] not in ExistStrNameList:=0D ExistStrNameList.append(StrName.split()[1].str= ip())=0D - elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION, \=0D - DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION, \=0D - DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION, \=0D + elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION,=0D + DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION,=0D + DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION,=0D DT.TAB_DEC_BINARY_ABST= RACT, DT.TAB_DEC_BINARY_DESCRIPTION]:=0D - EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID, \=0D - Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[1], \=0D + EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID,=0D + Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[=0D + 1],=0D ExtraData=3DFile.Path)=0D continue=0D elif len(Line.split()) =3D=3D 4 and Line.find(u'#language'= ) > 0:=0D if Line[Line.find(u'#language')-1] !=3D ' ' or \=0D Line[Line.find(u'#language')+len(u'#language')] != =3D u' ':=0D - EdkLogger.Error("Unicode File Parser", ToolError.F= ORMAT_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error(=0D + "Unicode File Parser", ToolError.FORMAT_INVALI= D, ExtraData=3DFile.Path)=0D =0D if Line.find(u'"') > 0:=0D - EdkLogger.Error("Unicode File Parser", ToolError.F= ORMAT_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error(=0D + "Unicode File Parser", ToolError.FORMAT_INVALI= D, ExtraData=3DFile.Path)=0D =0D StrName =3D Line.split()[0] + u' ' + Line.split()[1]=0D if StrName:=0D if StrName.split()[1] not in ExistStrNameList:=0D ExistStrNameList.append(StrName.split()[1].str= ip())=0D - elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION, \=0D - DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION, \=0D - DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION, \=0D + elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION,=0D + DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION,=0D + DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION,=0D DT.TAB_DEC_BINARY_ABST= RACT, DT.TAB_DEC_BINARY_DESCRIPTION]:=0D - EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID, \=0D - Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[1], \=0D + EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID,=0D + Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[=0D + 1],=0D ExtraData=3DFile.Path)=0D if IsIncludeFile:=0D if StrName not in NewLines:=0D - NewLines.append((Line[:Line.find(u'#language')= ]).strip())=0D + NewLines.append(=0D + (Line[:Line.find(u'#language')]).strip())= =0D else:=0D - NewLines.append((Line[:Line.find(u'#language')]).s= trip())=0D + NewLines.append(=0D + (Line[:Line.find(u'#language')]).strip())=0D NewLines.append((Line[Line.find(u'#language'):]).strip= ())=0D elif len(Line.split()) > 4 and Line.find(u'#language') > 0= and Line.find(u'"') > 0:=0D if Line[Line.find(u'#language')-1] !=3D u' ' or \=0D Line[Line.find(u'#language')+len(u'#language')] != =3D u' ':=0D - EdkLogger.Error("Unicode File Parser", ToolError.F= ORMAT_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error(=0D + "Unicode File Parser", ToolError.FORMAT_INVALI= D, ExtraData=3DFile.Path)=0D =0D if Line[Line.find(u'"')-1] !=3D u' ':=0D - EdkLogger.Error("Unicode File Parser", ToolError.F= ORMAT_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error(=0D + "Unicode File Parser", ToolError.FORMAT_INVALI= D, ExtraData=3DFile.Path)=0D =0D StrName =3D Line.split()[0] + u' ' + Line.split()[1]=0D if StrName:=0D if StrName.split()[1] not in ExistStrNameList:=0D ExistStrNameList.append(StrName.split()[1].str= ip())=0D - elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION, \=0D - DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION, \=0D - DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION, \=0D + elif StrName.split()[1] in [DT.TAB_INF_ABSTRACT, D= T.TAB_INF_DESCRIPTION,=0D + DT.TAB_INF_BINARY_ABST= RACT, DT.TAB_INF_BINARY_DESCRIPTION,=0D + DT.TAB_DEC_PACKAGE_ABS= TRACT, DT.TAB_DEC_PACKAGE_DESCRIPTION,=0D DT.TAB_DEC_BINARY_ABST= RACT, DT.TAB_DEC_BINARY_DESCRIPTION]:=0D - EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID, \=0D - Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[1], \=0D + EdkLogger.Error("Unicode File Parser", ToolErr= or.FORMAT_INVALID,=0D + Message=3DST.ERR_UNIPARSE_MULT= I_ENTRY_EXIST % StrName.split()[=0D + 1],=0D ExtraData=3DFile.Path)=0D if IsIncludeFile:=0D if StrName not in NewLines:=0D - NewLines.append((Line[:Line.find(u'#language')= ]).strip())=0D + NewLines.append(=0D + (Line[:Line.find(u'#language')]).strip())= =0D else:=0D - NewLines.append((Line[:Line.find(u'#language')]).s= trip())=0D - NewLines.append((Line[Line.find(u'#language'):Line.fin= d(u'"')]).strip())=0D + NewLines.append(=0D + (Line[:Line.find(u'#language')]).strip())=0D + NewLines.append(=0D + (Line[Line.find(u'#language'):Line.find(u'"')]).st= rip())=0D NewLines.append((Line[Line.find(u'"'):]).strip())=0D else:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D elif Line.startswith(u'#language'):=0D if len(Line.split()) =3D=3D 2:=0D if IsIncludeFile:=0D @@ -746,23 +801,27 @@ class UniFileClassObject(object): NewLines.append((Line[:Line.find(u'"')]).strip())=0D NewLines.append((Line[Line.find(u'"'):]).strip())=0D else:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D elif Line.startswith(u'"'):=0D - if u'#string' in Line or u'#language' in Line:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID, ExtraData=3DFile.Path)=0D + if u'#string' in Line or u'#language' in Line:=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3D= File.Path)=0D NewLines.append(Line)=0D else:=0D print(Line)=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FORMAT_INVALID, ExtraData=3DFile= .Path)=0D =0D if StrName and not StrName.split()[1].startswith(u'STR_'):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D, \=0D - Message=3DST.ERR_UNIPARSE_STRNAME_FORMAT_E= RROR % StrName.split()[1], \=0D - ExtraData=3DFile.Path)=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D,=0D + Message=3DST.ERR_UNIPARSE_STRNAME_FORMAT_ERROR= % StrName.split()[=0D + 1],=0D + ExtraData=3DFile.Path)=0D =0D if StrName and not NewLines:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D, \=0D - Message=3DST.ERR_UNI_MISS_LANGENTRY % StrName,= \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D,=0D + Message=3DST.ERR_UNI_MISS_LANGENTRY % StrName,= =0D ExtraData=3DFile.Path)=0D =0D #=0D @@ -785,33 +844,34 @@ class UniFileClassObject(object): DescriptionPosition =3D ExistStrNameList.index(StrName= )=0D =0D OrderList =3D sorted([AbstractPosition, DescriptionPosition])=0D - BinaryOrderList =3D sorted([BinaryAbstractPosition, BinaryDescript= ionPosition])=0D + BinaryOrderList =3D sorted(=0D + [BinaryAbstractPosition, BinaryDescriptionPosition])=0D Min =3D OrderList[0]=0D Max =3D OrderList[1]=0D BinaryMin =3D BinaryOrderList[0]=0D BinaryMax =3D BinaryOrderList[1]=0D if BinaryDescriptionPosition > -1:=0D - if not(BinaryDescriptionPosition =3D=3D BinaryMax and BinaryAb= stractPosition =3D=3D BinaryMin and \=0D + if not(BinaryDescriptionPosition =3D=3D BinaryMax and BinaryAb= stractPosition =3D=3D BinaryMin and=0D BinaryMax > Max):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, \=0D - Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G, \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID,=0D + Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G,=0D ExtraData=3DFile.Path)=0D elif BinaryAbstractPosition > -1:=0D if not(BinaryAbstractPosition > Max):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, \=0D - Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G, \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID,=0D + Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G,=0D ExtraData=3DFile.Path)=0D =0D - if DescriptionPosition > -1:=0D - if not(DescriptionPosition =3D=3D Max and AbstractPosition =3D= =3D Min and \=0D + if DescriptionPosition > -1:=0D + if not(DescriptionPosition =3D=3D Max and AbstractPosition =3D= =3D Min and=0D DescriptionPosition > AbstractPosition):=0D - EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID, \=0D - Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G, \=0D + EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_IN= VALID,=0D + Message=3DST.ERR_UNIPARSE_ENTRY_ORDER_WRON= G,=0D ExtraData=3DFile.Path)=0D =0D if not self.UniFileHeader:=0D EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALI= D,=0D - Message =3D ST.ERR_NO_SOURCE_HEADER,=0D + Message=3DST.ERR_NO_SOURCE_HEADER,=0D ExtraData=3DFile.Path)=0D =0D return NewLines=0D @@ -819,7 +879,7 @@ class UniFileClassObject(object): #=0D # Load a .uni file=0D #=0D - def LoadUniFile(self, File =3D None):=0D + def LoadUniFile(self, File=3DNone):=0D if File is None:=0D EdkLogger.Error("Unicode File Parser",=0D ToolError.PARSER_ERROR,=0D @@ -867,34 +927,39 @@ class UniFileClassObject(object): # "Mi segunda secuencia 2"=0D #=0D if Line.find(u'#string ') >=3D 0 and Line.find(u'#language ') = < 0 and \=0D - SecondLine.find(u'#string ') < 0 and SecondLine.find(u'#la= nguage ') >=3D 0 and \=0D - ThirdLine.find(u'#string ') < 0 and ThirdLine.find(u'#lang= uage ') < 0:=0D + SecondLine.find(u'#string ') < 0 and SecondLine.find(u= '#language ') >=3D 0 and \=0D + ThirdLine.find(u'#string ') < 0 and ThirdLine.find(u'#= language ') < 0:=0D if Line.find('"') > 0 or SecondLine.find('"') > 0:=0D EdkLogger.Error("Unicode File Parser", ToolError.FORMA= T_INVALID,=0D - Message=3DST.ERR_UNIPARSE_DBLQUOTE_UNMATCH= ED,=0D - ExtraData=3DFile.Path)=0D + Message=3DST.ERR_UNIPARSE_DBLQUOTE_UNM= ATCHED,=0D + ExtraData=3DFile.Path)=0D =0D - Name =3D Line[Line.find(u'#string ') + len(u'#string ') : = ].strip(' ')=0D - Language =3D SecondLine[SecondLine.find(u'#language ') + l= en(u'#language ') : ].strip(' ')=0D + Name =3D Line[Line.find(u'#string ') +=0D + len(u'#string '):].strip(' ')=0D + Language =3D SecondLine[SecondLine.find(=0D + u'#language ') + len(u'#language '):].strip(' ')=0D for IndexJ in range(IndexI + 2, len(Lines)):=0D if Lines[IndexJ].find(u'#string ') < 0 and Lines[Index= J].find(u'#language ') < 0 and \=0D - Lines[IndexJ].strip().startswith(u'"') and Lines[Index= J].strip().endswith(u'"'):=0D + Lines[IndexJ].strip().startswith(u'"') and Lin= es[IndexJ].strip().endswith(u'"'):=0D if Lines[IndexJ][-2] =3D=3D ' ':=0D CombineToken =3D True=0D if CombineToken:=0D if Lines[IndexJ].strip()[1:-1].strip():=0D - Value =3D Value + Lines[IndexJ].strip()[1:= -1].rstrip() + ' '=0D + Value =3D Value + \=0D + Lines[IndexJ].strip()[1:-1].rstrip() += ' '=0D else:=0D Value =3D Value + Lines[IndexJ].strip()[1:= -1]=0D CombineToken =3D False=0D else:=0D - Value =3D Value + Lines[IndexJ].strip()[1:-1] = + '\r\n'=0D + Value =3D Value + \=0D + Lines[IndexJ].strip()[1:-1] + '\r\n'=0D else:=0D IndexI =3D IndexJ=0D break=0D if Value.endswith('\r\n'):=0D Value =3D Value[: Value.rfind('\r\n')]=0D - Language =3D GetLanguageCode(Language, self.IsCompatibleMo= de, self.File)=0D + Language =3D GetLanguageCode(=0D + Language, self.IsCompatibleMode, self.File)=0D self.AddStringToList(Name, Language, Value)=0D continue=0D =0D @@ -911,7 +976,7 @@ class UniFileClassObject(object): #=0D # Add a string to list=0D #=0D - def AddStringToList(self, Name, Language, Value, Token =3D 0, Referenc= ed =3D False, UseOtherLangDef =3D '', Index =3D -1):=0D + def AddStringToList(self, Name, Language, Value, Token=3D0, Referenced= =3DFalse, UseOtherLangDef=3D'', Index=3D-1):=0D for LangNameItem in self.LanguageDef:=0D if Language =3D=3D LangNameItem[0]:=0D break=0D @@ -953,7 +1018,8 @@ class UniFileClassObject(object): = Referenced,=0D = Token,=0D = OtherLangDef))=0D - self.OrderedStringDict[LangName[0]][Name] =3D len(= self.OrderedStringList[LangName[0]]) - 1=0D + self.OrderedStringDict[LangName[0]][Name] =3D len(= =0D + self.OrderedStringList[LangName[0]]) - 1=0D else:=0D self.OrderedStringList[Language].insert(Index, StringDefCl= assObject(Name,=0D = Value,=0D @@ -1015,7 +1081,7 @@ class UniFileClassObject(object): # Use small token for all referred string stoken.=0D #=0D RefToken =3D 0=0D - for Index in range (0, len (self.OrderedStringList[FirstLangName])= ):=0D + for Index in range(0, len(self.OrderedStringList[FirstLangName])):= =0D FirstLangItem =3D self.OrderedStringList[FirstLangName][Index]= =0D if FirstLangItem.Referenced =3D=3D True:=0D for LangNameItem in self.LanguageDef:=0D @@ -1030,7 +1096,7 @@ class UniFileClassObject(object): # Use big token for all unreferred string stoken.=0D #=0D UnRefToken =3D 0=0D - for Index in range (0, len (self.OrderedStringList[FirstLangName])= ):=0D + for Index in range(0, len(self.OrderedStringList[FirstLangName])):= =0D FirstLangItem =3D self.OrderedStringList[FirstLangName][Index]= =0D if FirstLangItem.Referenced =3D=3D False:=0D for LangNameItem in self.LanguageDef:=0D @@ -1045,7 +1111,7 @@ class UniFileClassObject(object): #=0D def ShowMe(self):=0D print(self.LanguageDef)=0D - #print self.OrderedStringList=0D + # print self.OrderedStringList=0D for Item in self.OrderedStringList:=0D print(Item)=0D for Member in self.OrderedStringList[Item]:=0D @@ -1060,15 +1126,18 @@ class UniFileClassObject(object): =0D if not os.path.exists(FilaPath) or not os.path.isfile(FilaPath):=0D EdkLogger.Error("Unicode File Parser",=0D - ToolError.FILE_NOT_FOUND,=0D - ExtraData=3DFilaPath)=0D + ToolError.FILE_NOT_FOUND,=0D + ExtraData=3DFilaPath)=0D try:=0D - FileIn =3D codecs.open(FilaPath, mode=3D'rb', encoding=3D'utf_= 8').readlines()=0D + FileIn =3D codecs.open(FilaPath, mode=3D'rb',=0D + encoding=3D'utf_8').readlines()=0D except UnicodeError as Xstr:=0D - FileIn =3D codecs.open(FilaPath, mode=3D'rb', encoding=3D'utf_= 16').readlines()=0D + FileIn =3D codecs.open(FilaPath, mode=3D'rb',=0D + encoding=3D'utf_16').readlines()=0D except UnicodeError:=0D - FileIn =3D codecs.open(FilaPath, mode=3D'rb', encoding=3D'utf_= 16_le').readlines()=0D + FileIn =3D codecs.open(FilaPath, mode=3D'rb',=0D + encoding=3D'utf_16_le').readlines()=0D except:=0D - EdkLogger.Error("Unicode File Parser", ToolError.FILE_OPEN_FAI= LURE, ExtraData=3DFilaPath)=0D + EdkLogger.Error("Unicode File Parser",=0D + ToolError.FILE_OPEN_FAILURE, ExtraData=3DFilaP= ath)=0D return FileIn=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py b/BaseT= ools/Source/Python/UPT/Library/Xml/XmlRoutines.py index 94e97fa45c12..8cbf8aa6b76a 100644 --- a/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py +++ b/BaseTools/Source/Python/UPT/Library/Xml/XmlRoutines.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This is an XML API that uses a syntax similar to XPath, but it is writte= n in=0D # standard python so that no extra python packages are required to use it.= =0D #=0D @@ -20,13 +20,15 @@ import codecs from Logger.ToolError import PARSER_ERROR=0D import Logger.Log as Logger=0D =0D -## Create a element of XML=0D +# Create a element of XML=0D #=0D # @param Name=0D # @param String=0D # @param NodeList=0D # @param AttributeList=0D #=0D +=0D +=0D def CreateXmlElement(Name, String, NodeList, AttributeList):=0D Doc =3D xml.dom.minidom.Document()=0D Element =3D Doc.createElement(Name)=0D @@ -51,7 +53,7 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): =0D return Element=0D =0D -## Get a list of XML nodes using XPath style syntax.=0D +# Get a list of XML nodes using XPath style syntax.=0D #=0D # Return a list of XML DOM nodes from the root Dom specified by XPath Stri= ng.=0D # If the input Dom or String is not valid, then an empty list is returned.= =0D @@ -59,6 +61,8 @@ def CreateXmlElement(Name, String, NodeList, AttributeLis= t): # @param Dom The root XML DOM node.=0D # @param String A XPath style path.=0D #=0D +=0D +=0D def XmlList(Dom, String):=0D if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D "":= =0D return []=0D @@ -74,7 +78,7 @@ def XmlList(Dom, String): ChildNodes =3D []=0D for Node in Nodes:=0D if Node.nodeType =3D=3D Node.ELEMENT_NODE and Node.tagName =3D= =3D \=0D - TagList[Index]:=0D + TagList[Index]:=0D if Index < End:=0D ChildNodes.extend(Node.childNodes)=0D else:=0D @@ -86,7 +90,7 @@ def XmlList(Dom, String): return Nodes=0D =0D =0D -## Get a single XML node using XPath style syntax.=0D +# Get a single XML node using XPath style syntax.=0D #=0D # Return a single XML DOM node from the root Dom specified by XPath String= .=0D # If the input Dom or String is not valid, then an empty string is returne= d.=0D @@ -95,7 +99,7 @@ def XmlList(Dom, String): # @param String A XPath style path.=0D #=0D def XmlNode(Dom, String):=0D - if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D ""= :=0D + if String is None or String =3D=3D "" or Dom is None or Dom =3D=3D "":= =0D return None=0D if Dom.nodeType =3D=3D Dom.DOCUMENT_NODE:=0D Dom =3D Dom.documentElement=0D @@ -118,7 +122,7 @@ def XmlNode(Dom, String): return None=0D =0D =0D -## Get a single XML element using XPath style syntax.=0D +# Get a single XML element using XPath style syntax.=0D #=0D # Return a single XML element from the root Dom specified by XPath String.= =0D # If the input Dom or String is not valid, then an empty string is returne= d.=0D @@ -132,7 +136,7 @@ def XmlElement(Dom, String): except BaseException:=0D return ""=0D =0D -## Get a single XML element using XPath style syntax.=0D +# Get a single XML element using XPath style syntax.=0D #=0D # Similar with XmlElement, but do not strip all the leading and tailing sp= ace=0D # and newline, instead just remove the newline and spaces introduced by=0D @@ -141,6 +145,8 @@ def XmlElement(Dom, String): # @param Dom The root XML DOM object.=0D # @param Strin A XPath style path.=0D #=0D +=0D +=0D def XmlElement2(Dom, String):=0D try:=0D HelpStr =3D XmlNode(Dom, String).firstChild.data=0D @@ -151,7 +157,7 @@ def XmlElement2(Dom, String): return ""=0D =0D =0D -## Get a single XML element of the current node.=0D +# Get a single XML element of the current node.=0D #=0D # Return a single XML element specified by the current root Dom.=0D # If the input Dom is not valid, then an empty string is returned.=0D @@ -165,7 +171,7 @@ def XmlElementData(Dom): return ""=0D =0D =0D -## Get a list of XML elements using XPath style syntax.=0D +# Get a list of XML elements using XPath style syntax.=0D #=0D # Return a list of XML elements from the root Dom specified by XPath Strin= g.=0D # If the input Dom or String is not valid, then an empty list is returned.= =0D @@ -177,7 +183,7 @@ def XmlElementList(Dom, String): return list(map(XmlElementData, XmlList(Dom, String)))=0D =0D =0D -## Get the XML attribute of the current node.=0D +# Get the XML attribute of the current node.=0D #=0D # Return a single XML attribute named Attribute from the current root Dom.= =0D # If the input Dom or Attribute is not valid, then an empty string is retu= rned.=0D @@ -192,7 +198,7 @@ def XmlAttribute(Dom, Attribute): return ''=0D =0D =0D -## Get the XML node name of the current node.=0D +# Get the XML node name of the current node.=0D #=0D # Return a single XML node name from the current root Dom.=0D # If the input Dom is not valid, then an empty string is returned.=0D @@ -205,13 +211,15 @@ def XmlNodeName(Dom): except BaseException:=0D return ''=0D =0D -## Parse an XML file.=0D +# Parse an XML file.=0D #=0D # Parse the input XML file named FileName and return a XML DOM it stands f= or.=0D # If the input File is not a valid XML file, then an empty string is retur= ned.=0D #=0D # @param FileName The XML file name.=0D #=0D +=0D +=0D def XmlParseFile(FileName):=0D try:=0D XmlFile =3D codecs.open(FileName, 'rb')=0D @@ -220,4 +228,5 @@ def XmlParseFile(FileName): return Dom=0D except BaseException as XExcept:=0D XmlFile.close()=0D - Logger.Error('\nUPT', PARSER_ERROR, XExcept, File=3DFileName, Rais= eError=3DTrue)=0D + Logger.Error('\nUPT', PARSER_ERROR, XExcept,=0D + File=3DFileName, RaiseError=3DTrue)=0D diff --git a/BaseTools/Source/Python/UPT/Library/Xml/__init__.py b/BaseTool= s/Source/Python/UPT/Library/Xml/__init__.py index 172e498451b8..03dedeed636e 100644 --- a/BaseTools/Source/Python/UPT/Library/Xml/__init__.py +++ b/BaseTools/Source/Python/UPT/Library/Xml/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/Library/__init__.py b/BaseTools/So= urce/Python/UPT/Library/__init__.py index 07b5b75dd51e..bb3ceeeb7572 100644 --- a/BaseTools/Source/Python/UPT/Library/__init__.py +++ b/BaseTools/Source/Python/UPT/Library/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/Logger/Log.py b/BaseTools/Source/P= ython/UPT/Logger/Log.py index a2e32a6236ac..425bcc7c45a4 100644 --- a/BaseTools/Source/Python/UPT/Logger/Log.py +++ b/BaseTools/Source/Python/UPT/Logger/Log.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file implements the log mechanism for Python tools.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,7 @@ Logger=0D '''=0D =0D -## Import modules=0D +# Import modules=0D from sys import argv=0D from sys import stdout=0D from sys import stderr=0D @@ -42,12 +42,12 @@ DEBUG_7 =3D 8 DEBUG_8 =3D 9=0D DEBUG_9 =3D 10=0D VERBOSE =3D 15=0D -INFO =3D 20=0D -WARN =3D 30=0D -QUIET =3D 40=0D +INFO =3D 20=0D +WARN =3D 30=0D +QUIET =3D 40=0D QUIET_1 =3D 41=0D -ERROR =3D 50=0D -SILENT =3D 60=0D +ERROR =3D 50=0D +SILENT =3D 60=0D =0D IS_RAISE_ERROR =3D True=0D SUPRESS_ERROR =3D False=0D @@ -59,15 +59,15 @@ _TOOL_NAME =3D os.path.basename(argv[0]) #=0D # For validation purpose=0D #=0D -_LOG_LEVELS =3D [DEBUG_0, DEBUG_1, DEBUG_2, DEBUG_3, DEBUG_4, DEBUG_5, DEB= UG_6, \=0D - DEBUG_7, DEBUG_8, DEBUG_9, VERBOSE, WARN, INFO, ERROR, QUIET= , \=0D - QUIET_1, SILENT]=0D +_LOG_LEVELS =3D [DEBUG_0, DEBUG_1, DEBUG_2, DEBUG_3, DEBUG_4, DEBUG_5, DEB= UG_6,=0D + DEBUG_7, DEBUG_8, DEBUG_9, VERBOSE, WARN, INFO, ERROR, QUIE= T,=0D + QUIET_1, SILENT]=0D #=0D # For DEBUG level (All DEBUG_0~9 are applicable)=0D #=0D _DEBUG_LOGGER =3D getLogger("tool_debug")=0D -_DEBUG_FORMATTER =3D Formatter("[%(asctime)s.%(msecs)d]: %(message)s", \=0D - datefmt=3D"%H:%M:%S")=0D +_DEBUG_FORMATTER =3D Formatter("[%(asctime)s.%(msecs)d]: %(message)s",=0D + datefmt=3D"%H:%M:%S")=0D #=0D # For VERBOSE, INFO, WARN level=0D #=0D @@ -83,10 +83,10 @@ _ERROR_FORMATTER =3D Formatter("%(message)s") # String templates for ERROR/WARN/DEBUG log message=0D #=0D _ERROR_MESSAGE_TEMPLATE =3D \=0D -('\n\n%(tool)s...\n%(file)s(%(line)s): error %(errorcode)04X: %(msg)s\n\t%= (extra)s')=0D + ('\n\n%(tool)s...\n%(file)s(%(line)s): error %(errorcode)04X: %(msg)s\= n\t%(extra)s')=0D =0D __ERROR_MESSAGE_TEMPLATE_WITHOUT_FILE =3D \=0D -'\n\n%(tool)s...\n : error %(errorcode)04X: %(msg)s\n\t%(extra)s'=0D + '\n\n%(tool)s...\n : error %(errorcode)04X: %(msg)s\n\t%(extra)s'=0D =0D _WARNING_MESSAGE_TEMPLATE =3D '%(tool)s...\n%(file)s(%(line)s): warning: %= (msg)s'=0D _WARNING_MESSAGE_TEMPLATE_WITHOUT_FILE =3D '%(tool)s: : warning: %(msg)s'= =0D @@ -104,15 +104,19 @@ def Info(msg, *args, **kwargs): #=0D # Log information which should be always put out=0D #=0D +=0D +=0D def Quiet(msg, *args, **kwargs):=0D _ERROR_LOGGER.error(msg, *args, **kwargs)=0D =0D -## Log debug message=0D +# Log debug message=0D #=0D # @param Level DEBUG level (DEBUG0~9)=0D # @param Message Debug information=0D # @param ExtraData More information associated with "Message"=0D #=0D +=0D +=0D def Debug(Level, Message, ExtraData=3DNone):=0D if _DEBUG_LOGGER.level > Level:=0D return=0D @@ -123,9 +127,9 @@ def Debug(Level, Message, ExtraData=3DNone): #=0D CallerStack =3D extract_stack()[-2]=0D TemplateDict =3D {=0D - "file" : CallerStack[0],=0D - "line" : CallerStack[1],=0D - "msg" : Message,=0D + "file": CallerStack[0],=0D + "line": CallerStack[1],=0D + "msg": Message,=0D }=0D =0D if ExtraData is not None:=0D @@ -135,14 +139,16 @@ def Debug(Level, Message, ExtraData=3DNone): =0D _DEBUG_LOGGER.log(Level, LogText)=0D =0D -## Log verbose message=0D +# Log verbose message=0D #=0D # @param Message Verbose information=0D #=0D +=0D +=0D def Verbose(Message):=0D return _INFO_LOGGER.log(VERBOSE, Message)=0D =0D -## Log warning message=0D +# Log warning message=0D #=0D # Warning messages are those which might be wrong but won't fail the too= l.=0D #=0D @@ -153,6 +159,8 @@ def Verbose(Message): # @param Line The line number in the "File" which caused the war= ning.=0D # @param ExtraData More information associated with "Message"=0D #=0D +=0D +=0D def Warn(ToolName, Message, File=3DNone, Line=3DNone, ExtraData=3DNone):=0D if _INFO_LOGGER.level > WARN:=0D return=0D @@ -168,10 +176,10 @@ def Warn(ToolName, Message, File=3DNone, Line=3DNone,= ExtraData=3DNone): Line =3D "%d" % Line=0D =0D TemplateDict =3D {=0D - "tool" : ToolName,=0D - "file" : File,=0D - "line" : Line,=0D - "msg" : Message,=0D + "tool": ToolName,=0D + "file": File,=0D + "line": Line,=0D + "msg": Message,=0D }=0D =0D if File is not None:=0D @@ -189,7 +197,7 @@ def Warn(ToolName, Message, File=3DNone, Line=3DNone, E= xtraData=3DNone): if GlobalData.gWARNING_AS_ERROR =3D=3D True:=0D raise FatalError(WARNING_AS_ERROR)=0D =0D -## Log ERROR message=0D +# Log ERROR message=0D #=0D # Once an error messages is logged, the tool's execution will be broken by= =0D # raising an exception. If you don't want to break the execution later, yo= u=0D @@ -205,7 +213,9 @@ def Warn(ToolName, Message, File=3DNone, Line=3DNone, E= xtraData=3DNone): # @param RaiseError Raise an exception to break the tool's execution i= f=0D # it's True. This is the default behavior.=0D #=0D -def Error(ToolName, ErrorCode, Message=3DNone, File=3DNone, Line=3DNone, \= =0D +=0D +=0D +def Error(ToolName, ErrorCode, Message=3DNone, File=3DNone, Line=3DNone,=0D ExtraData=3DNone, RaiseError=3DIS_RAISE_ERROR):=0D if ToolName:=0D pass=0D @@ -224,16 +234,16 @@ def Error(ToolName, ErrorCode, Message=3DNone, File= =3DNone, Line=3DNone, \ ExtraData =3D ""=0D =0D TemplateDict =3D {=0D - "tool" : _TOOL_NAME,=0D - "file" : File,=0D - "line" : Line,=0D - "errorcode" : ErrorCode,=0D - "msg" : Message,=0D - "extra" : ExtraData=0D + "tool": _TOOL_NAME,=0D + "file": File,=0D + "line": Line,=0D + "errorcode": ErrorCode,=0D + "msg": Message,=0D + "extra": ExtraData=0D }=0D =0D if File is not None:=0D - LogText =3D _ERROR_MESSAGE_TEMPLATE % TemplateDict=0D + LogText =3D _ERROR_MESSAGE_TEMPLATE % TemplateDict=0D else:=0D LogText =3D __ERROR_MESSAGE_TEMPLATE_WITHOUT_FILE % TemplateDict=0D =0D @@ -243,7 +253,7 @@ def Error(ToolName, ErrorCode, Message=3DNone, File=3DN= one, Line=3DNone, \ raise FatalError(ErrorCode)=0D =0D =0D -## Initialize log system=0D +# Initialize log system=0D #=0D def Initialize():=0D #=0D @@ -272,33 +282,39 @@ def Initialize(): _ERROR_LOGGER.addHandler(_ErrorCh)=0D =0D =0D -## Set log level=0D +# Set log level=0D #=0D # @param Level One of log level in _LogLevel=0D #=0D def SetLevel(Level):=0D if Level not in _LOG_LEVELS:=0D - Info("Not supported log level (%d). Use default level instead." % = \=0D + Info("Not supported log level (%d). Use default level instead." %= =0D Level)=0D Level =3D INFO=0D _DEBUG_LOGGER.setLevel(Level)=0D _INFO_LOGGER.setLevel(Level)=0D _ERROR_LOGGER.setLevel(Level)=0D =0D -## Get current log level=0D +# Get current log level=0D #=0D +=0D +=0D def GetLevel():=0D return _INFO_LOGGER.getEffectiveLevel()=0D =0D -## Raise up warning as error=0D +# Raise up warning as error=0D #=0D +=0D +=0D def SetWarningAsError():=0D GlobalData.gWARNING_AS_ERROR =3D True=0D =0D -## Specify a file to store the log message as well as put on console=0D +# Specify a file to store the log message as well as put on console=0D #=0D # @param LogFile The file path used to store the log message=0D #=0D +=0D +=0D def SetLogFile(LogFile):=0D if os.path.exists(LogFile):=0D remove(LogFile)=0D @@ -314,6 +330,3 @@ def SetLogFile(LogFile): _Ch =3D FileHandler(LogFile)=0D _Ch.setFormatter(_ERROR_FORMATTER)=0D _ERROR_LOGGER.addHandler(_Ch)=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/= Source/Python/UPT/Logger/StringTable.py index 13c015844ea0..317885048dfb 100644 --- a/BaseTools/Source/Python/UPT/Logger/StringTable.py +++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define strings used in the UPT tool=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -16,7 +16,7 @@ import gettext # string table starts here...=0D #=0D =0D -## strings are classified as following types=0D +# strings are classified as following types=0D # MSG_...: it is a message string=0D # ERR_...: it is a error string=0D # WRN_...: it is a warning string=0D @@ -26,24 +26,25 @@ import gettext _ =3D gettext.gettext=0D =0D MSG_USAGE_STRING =3D _("\n"=0D - "UEFI Packaging Tool (UEFIPT)\n"=0D - "%prog [options]"=0D - )=0D + "UEFI Packaging Tool (UEFIPT)\n"=0D + "%prog [options]"=0D + )=0D =0D ##=0D # Version and Copyright=0D #=0D MSG_VERSION_NUMBER =3D _("1.1")=0D -MSG_VERSION =3D _("UEFI Packaging Tool (UEFIPT) - Revision " + \=0D +MSG_VERSION =3D _("UEFI Packaging Tool (UEFIPT) - Revision " +=0D MSG_VERSION_NUMBER)=0D -MSG_COPYRIGHT =3D _("Copyright (c) 2011 - 2018 Intel Corporation All Right= s Reserved.")=0D +MSG_COPYRIGHT =3D _(=0D + "Copyright (c) 2011 - 2018 Intel Corporation All Rights Reserved.")=0D MSG_VERSION_COPYRIGHT =3D _("\n %s\n %s" % (MSG_VERSION, MSG_COPYRIGHT))= =0D MSG_USAGE =3D _("%s [options]\n%s" % ("UPT", MSG_VERSION_COPYRIGHT))=0D -MSG_DESCRIPTION =3D _("The UEFIPT is used to create, " + \=0D - "install or remove a UEFI Distribution Package. " + \= =0D - "If WORKSPACE environment variable is present, " + \=0D - "then UPT will install packages to the location specif= ied by WORKSPACE, " + \=0D - "otherwise UPT will install packages to the current di= rectory. " + \=0D +MSG_DESCRIPTION =3D _("The UEFIPT is used to create, " +=0D + "install or remove a UEFI Distribution Package. " +=0D + "If WORKSPACE environment variable is present, " +=0D + "then UPT will install packages to the location specif= ied by WORKSPACE, " +=0D + "otherwise UPT will install packages to the current di= rectory. " +=0D "Option -n will override this default installation loc= ation")=0D =0D #=0D @@ -56,23 +57,23 @@ ERR_INF_PARSER_HEADER_MISSGING =3D _( ERR_INF_PARSER_UNKNOWN_SECTION =3D _("An unknown section was found. "=0D "It must be corrected before continuing= . ")=0D ERR_INF_PARSER_NO_SECTION_ERROR =3D _("No section was found. "=0D - "A section must be included before continuing.= ")=0D + "A section must be included before con= tinuing.")=0D ERR_INF_PARSER_BUILD_OPTION_FORMAT_INVALID =3D \=0D _("Build Option format incorrect.")=0D ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID =3D _(=0D - "The format of binary %s item is incorrect. "=0D - "It should contain at least %d elements.")=0D + "The format of binary %s item is incorrect. "=0D + "It should contain at least %d elements.")=0D ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX =3D _(=0D - "The format of binary %s item is invalid, "=0D - "it should contain not more than %d elements.")=0D + "The format of binary %s item is invalid, "=0D + "it should contain not more than %d elements.")=0D ERR_INF_PARSER_BINARY_ITEM_INVALID_FILETYPE =3D _(=0D - "The Binary FileType is incorrect. It should in %s")=0D + "The Binary FileType is incorrect. It should in %s")=0D ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST =3D _(=0D - "The Binary File: %s not exist.")=0D + "The Binary File: %s not exist.")=0D ERR_INF_PARSER_BINARY_ITEM_FILENAME_NOT_EXIST =3D _(=0D - "The Binary File Name item not exist")=0D + "The Binary File Name item not exist")=0D ERR_INF_PARSER_BINARY_VER_TYPE =3D _(=0D - "Only this type is allowed: \"%s\".")=0D + "Only this type is allowed: \"%s\".")=0D ERR_INF_PARSER_MULTI_DEFINE_SECTION =3D \=0D _("Multiple define sections found. "=0D "It must be corrected before continuing.")=0D @@ -91,8 +92,8 @@ ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID =3D \ "or has an incorrect file name of the directory containing the INF o= r DEC file: %s. "=0D "It must be corrected before continuing")=0D ERR_INF_PARSER_DEFINE_SHADOW_INVALID =3D \=0D - _("The SHADOW keyword is only valid for"=0D - " SEC, PEI_CORE and PEIM module typ= es.")=0D + _("The SHADOW keyword is only valid for"=0D + " SEC, PEI_CORE and PEIM module types.")=0D ERR_INF_PARSER_DEFINE_SECTION_HEADER_INVALID =3D \=0D _("The format of the section header is incorrect")=0D ERR_INF_PARSER_DEPEX_SECTION_INVALID =3D \=0D @@ -103,15 +104,15 @@ ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_LIBRARY_CLAS= S =3D \ _("A library class can't have a Depex section when its supported modul= e type list is not defined.")=0D ERR_INF_PARSER_DEPEX_SECTION_INVALID_FOR_DRIVER =3D \=0D _("A driver can't have a Depex section when its module type is UEFI_DR= IVER.")=0D -ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED =3D \=0D +ERR_INF_PARSER_DEPEX_SECTION_NOT_DETERMINED =3D \=0D _("Cannot determine the module's Depex type. The Depex's module types = are conflict")=0D ERR_INF_PARSER_DEFINE_SECTION_MUST_ITEM_NOT_EXIST =3D _(=0D - "No %s found in INF file, please check it.")=0D + "No %s found in INF file, please check it.")=0D ERR_INF_PARSER_DEPEX_SECTION_MODULE_TYPE_ERROR =3D \=0D _("The module type of [Depex] section is invalid, not support type of = %s")=0D ERR_INF_PARSER_DEPEX_SECTION_CONTENT_MISSING =3D \=0D _("Missing content in: %s")=0D -ERR_INF_PARSER_DEPEX_SECTION_CONTENT_ERROR =3D \=0D +ERR_INF_PARSER_DEPEX_SECTION_CONTENT_ERROR =3D \=0D _("The [Depex] section contains invalid content: %s")=0D ERR_INF_PARSER_DEPEX_SECTION_SEC_TYPE_ERROR =3D \=0D _("The format is incorrect. The section type keyword of the content in= the"=0D @@ -186,7 +187,7 @@ ERR_INF_PARSER_CNAME_MISSING =3D \ _("Missing CName. Specify a valid C variable name.")=0D ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID =3D \=0D _("The Define section contains an invalid keyword: \"%s\"."=0D - "It must be corrected before continuing.")=0D + "It must be corrected before continuing.")=0D ERR_INF_PARSER_FILE_MISS_DEFINE =3D \=0D _("The following file listed in the module "=0D "directory is not listed in the INF: %s")=0D @@ -197,66 +198,75 @@ ERR_INF_PARSER_VER_EXIST_BOTH_NUM_STR =3D \ _("The INF file %s defines both VERSION_NUMBER and VERSION_STRING, "=0D "using VERSION_STRING")=0D ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF =3D _("EDKI INF is not supported")=0D -ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII =3D _("The EDKI style comment is not = supported in EDKII modules")=0D +ERR_INF_PARSER_EDKI_COMMENT_IN_EDKII =3D _(=0D + "The EDKI style comment is not supported in EDKII modules")=0D =0D ERR_INF_PARSER_FEATUREPCD_USAGE_INVALID =3D _("The usage for FeaturePcd ca= n only"=0D - " be type of \"CONSUMES\".")=0D + " be type of \"CONSUMES\".")=0D =0D ERR_INF_PARSER_DEFINE_ITEM_NO_NAME =3D _("No name specified")=0D ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE =3D _("No value specified")=0D =0D ERR_INF_PARSER_MODULETYPE_INVALID =3D _("Drivers and applications are not = allowed to have a MODULE_TYPE of \"BASE\". "=0D -"Only libraries are permitted to a have a MODULE_TYPE of \"BASE\".")=0D -ERR_INF_GET_PKG_DEPENDENCY_FAIL =3D _("Failed to get PackageDependencies i= nformation from file %s")=0D -ERR_INF_NO_PKG_DEPENDENCY_INFO =3D _("There are no packages defined that u= se the AsBuilt PCD information.")=0D + "Only libraries are permitted to a h= ave a MODULE_TYPE of \"BASE\".")=0D +ERR_INF_GET_PKG_DEPENDENCY_FAIL =3D _(=0D + "Failed to get PackageDependencies information from file %s")=0D +ERR_INF_NO_PKG_DEPENDENCY_INFO =3D _(=0D + "There are no packages defined that use the AsBuilt PCD information.")= =0D =0D #=0D # Item duplicate=0D #=0D ERR_INF_PARSER_ITEM_DUPLICATE_IN_DEC =3D \=0D -_('"%s" is redefined in its dependent DEC files')=0D + _('"%s" is redefined in its dependent DEC files')=0D ERR_INF_PARSER_ITEM_DUPLICATE =3D _("%s define duplicated! "=0D "It must be corrected before continuing.= ")=0D ERR_INF_PARSER_ITEM_DUPLICATE_COMMON =3D _("%s define duplicated! Item lis= ted"=0D -"in an architectural section must not be listed in the common architectura= l"=0D -"section.It must be corrected before continuing.")=0D + "in an architectural section must= not be listed in the common architectural"=0D + "section.It must be corrected bef= ore continuing.")=0D ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR =3D \=0D -_("%s define duplicated! Each UserExtensions section header must have a "= =0D - "unique set of UserId, IdString and Arch values. "=0D - "It must be corrected before continuing.")=0D + _("%s define duplicated! Each UserExtensions section header must have = a "=0D + "unique set of UserId, IdString and Arch values. "=0D + "It must be corrected before continuing.")=0D =0D ERR_INF_PARSER_DEFINE_LIB_NAME_INVALID =3D \=0D -_("The name 'NULL' for LibraryClass is a reserved word."=0D -"Please don't use it.")=0D + _("The name 'NULL' for LibraryClass is a reserved word."=0D + "Please don't use it.")=0D =0D ERR_GLOBAL_MARCO_INVALID =3D \=0D -_("Using global MACRO in INF/DEC is not permitted: %s . "=0D -"It must be corrected before continuing.")=0D + _("Using global MACRO in INF/DEC is not permitted: %s . "=0D + "It must be corrected before continuing.")=0D =0D ERR_MARCO_DEFINITION_MISS_ERROR =3D \=0D -_("MACRO expand incorrectly, can not find the MACRO definition. "=0D -"It must be corrected before continuing.")=0D + _("MACRO expand incorrectly, can not find the MACRO definition. "=0D + "It must be corrected before continuing.")=0D =0D #=0D # AsBuilt related=0D #=0D ERR_LIB_CONTATIN_ASBUILD_AND_COMMON =3D _("A binary INF file should not co= ntain both AsBuilt LIB_INSTANCES information "=0D "and a common library entry.")=0D -ERR_LIB_INSTANCE_MISS_GUID =3D _("Could not get FILE_GUID definition from = instance INF file.")=0D +ERR_LIB_INSTANCE_MISS_GUID =3D _(=0D + "Could not get FILE_GUID definition from instance INF file.")=0D =0D ERR_BO_CONTATIN_ASBUILD_AND_COMMON =3D _("A binary INF file should contain= either AsBuilt information "=0D "or a common build option entry, no= t both.")=0D =0D -ERR_ASBUILD_PCD_SECTION_TYPE =3D _("The AsBuilt INF file contains a PCD se= ction type that is not permitted: %s.")=0D -ERR_ASBUILD_PATCHPCD_FORMAT_INVALID =3D _("The AsBuilt PatchPcd entry must= contain 3 elements: PcdName|Value|Offset")=0D -ERR_ASBUILD_PCDEX_FORMAT_INVALID =3D _("The AsBuilt PcdEx entry must conta= in one element: PcdName")=0D +ERR_ASBUILD_PCD_SECTION_TYPE =3D _(=0D + "The AsBuilt INF file contains a PCD section type that is not permitte= d: %s.")=0D +ERR_ASBUILD_PATCHPCD_FORMAT_INVALID =3D _(=0D + "The AsBuilt PatchPcd entry must contain 3 elements: PcdName|Value|Off= set")=0D +ERR_ASBUILD_PCDEX_FORMAT_INVALID =3D _(=0D + "The AsBuilt PcdEx entry must contain one element: PcdName")=0D ERR_ASBUILD_PCD_VALUE_INVALID =3D \=0D _("The AsBuilt PCD value %s is incorrect or not align with its datum t= ype %s. "=0D "It must be corrected before continuing.")=0D -ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_MISS =3D _("Package file value could= not be retrieved for %s.")=0D -ERR_ASBUILD_PCD_DECLARITION_MISS =3D _("PCD Declaration in DEC files could= not be found for: %s.")=0D +ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_MISS =3D _(=0D + "Package file value could not be retrieved for %s.")=0D +ERR_ASBUILD_PCD_DECLARITION_MISS =3D _(=0D + "PCD Declaration in DEC files could not be found for: %s.")=0D ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID =3D _("PCD offset format invalid, nu= mber of (0-4294967295) or"=0D -"Hex number of UINT32 allowed : %s.")=0D + "Hex number of UINT32 allowed : = %s.")=0D =0D #=0D # XML parser related strings=0D @@ -267,13 +277,13 @@ ERR_XML_INVALID_VARIABLENAME =3D \ _("The VariableName of the GUID in the XML tree does not conform to th= e packaging specification. "=0D "Only a Hex Byte Array of UCS-2 format or L\"string\" is allowed): %= s %s %s")=0D ERR_XML_INVALID_LIB_SUPMODLIST =3D _("The LIBRARY_CLASS entry %s must have= the list appended using the format as: \n"=0D -"BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER SMM_CORE DXE_SMM_DRIVER DXE_RU= NTIME_DRIVER "=0D -"DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION USER_DEFINED\n Current is %s.= ")=0D + "BASE SEC PEI_CORE PEIM DXE_CORE DXE_DR= IVER SMM_CORE DXE_SMM_DRIVER DXE_RUNTIME_DRIVER "=0D + "DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLIC= ATION USER_DEFINED\n Current is %s.")=0D ERR_XML_INVALID_EXTERN_SUPARCHLIST =3D \=0D _("There is a mismatch of SupArchList %s between the EntryPoint, Unloa= dImage, Constructor, "=0D "and Destructor elements in the ModuleSurfaceArea.ModuleProperties: = SupArchList: %s. ")=0D ERR_XML_INVALID_EXTERN_SUPMODLIST =3D _("The SupModList attribute of the C= ONSTRUCTOR or DESTRUCTOR element: %s does not "=0D -"match the Supported Module Types listed after LIBRARY_CLASS =3D = | %s")=0D + "match the Supported Module Types li= sted after LIBRARY_CLASS =3D | %s")=0D ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB =3D _("The module is not a libra= ry module. "=0D "The MODULE_TYPE : %s listed= in the ModuleSurfaceArea.Header "=0D "must match the SupModList a= ttribute %s")=0D @@ -285,76 +295,79 @@ ERR_XML_INVALID_BINARY_FILE_TYPE =3D _("Invalid binar= y file type %s.") MSG_DISTRIBUTION_PACKAGE_FILE_EXISTS =3D _(=0D "The distribution package file %s already exists.\nPress Y to override= it."=0D " To exit the application, press any other key.")=0D -MSG_CHECK_MODULE_EXIST =3D _(=0D +MSG_CHECK_MODULE_EXIST =3D _(=0D "\nChecking to see if module exists in workspace started ...")=0D -MSG_CHECK_MODULE_EXIST_FINISH =3D \=0D +MSG_CHECK_MODULE_EXIST_FINISH =3D \=0D _("Checking to see if module exists in workspace ... Done.")=0D -MSG_CHECK_MODULE_DEPEX_START =3D _(=0D +MSG_CHECK_MODULE_DEPEX_START =3D _(=0D "\nChecking to see if module depex met by workspace started ...")=0D -MSG_CHECK_MODULE_DEPEX_FINISH =3D _(=0D +MSG_CHECK_MODULE_DEPEX_FINISH =3D _(=0D "Checking to see if module depex met by workspace ... Done.")=0D -MSG_CHECK_PACKAGE_START =3D _(=0D +MSG_CHECK_PACKAGE_START =3D _(=0D "\nChecking to see if package exists in workspace started ...")=0D -MSG_CHECK_PACKAGE_FINISH =3D _(=0D +MSG_CHECK_PACKAGE_FINISH =3D _(=0D "Checking to see if package exists in workspace ... Done.")=0D -MSG_CHECK_DP_START =3D \=0D +MSG_CHECK_DP_START =3D \=0D _("\nChecking to see if DP exists in workspace ... Done.")=0D -MSG_CHECK_DP_FINISH =3D _("Check DP exists in workspace ... Don= e.")=0D -MSG_MODULE_DEPEND_ON =3D _("Module %s depends on Package %s")=0D -MSG_INIT_IPI_START =3D _("\nInitialize IPI database started ..= .")=0D -MSG_INIT_IPI_FINISH =3D _("Initialize IPI database ... Done.")= =0D -MSG_GET_DP_INSTALL_LIST =3D _(=0D +MSG_CHECK_DP_FINISH =3D _("Check DP exists in workspace ... Done.")=0D +MSG_MODULE_DEPEND_ON =3D _("Module %s depends on Package %s")=0D +MSG_INIT_IPI_START =3D _("\nInitialize IPI database started ...")=0D +MSG_INIT_IPI_FINISH =3D _("Initialize IPI database ... Done.")=0D +MSG_GET_DP_INSTALL_LIST =3D _(=0D "\nGetting list of DP install information started ...")=0D -MSG_GET_DP_INSTALL_INFO_START =3D _(=0D +MSG_GET_DP_INSTALL_INFO_START =3D _(=0D "\nGetting list of DP install information started ...")=0D MSG_GET_DP_INSTALL_INFO_FINISH =3D _("Getting DP install information ... D= one.")=0D -MSG_UZIP_PARSE_XML =3D _(=0D +MSG_UZIP_PARSE_XML =3D _(=0D "Unzipping and parsing distribution package XML file ... ")=0D -MSG_INSTALL_PACKAGE =3D _("Installing package ... %s")=0D -MSG_INSTALL_MODULE =3D _("Installing module ... %s")=0D -MSG_NEW_FILE_NAME_FOR_DIST =3D _(=0D +MSG_INSTALL_PACKAGE =3D _("Installing package ... %s")=0D +MSG_INSTALL_MODULE =3D _("Installing module ... %s")=0D +MSG_NEW_FILE_NAME_FOR_DIST =3D _(=0D "Provide new filename for distribution file to be saved:\n")=0D -MSG_UPDATE_PACKAGE_DATABASE =3D _("Update Distribution Package Database= ...")=0D -MSG_PYTHON_ON =3D _("(Python %s on %s) ")=0D -MSG_EDKII_MAIL_ADDR =3D 'devel@edk2.groups.io'=0D -MSG_SEARCH_FOR_HELP =3D _(=0D +MSG_UPDATE_PACKAGE_DATABASE =3D _("Update Distribution Package Database ..= .")=0D +MSG_PYTHON_ON =3D _("(Python %s on %s) ")=0D +MSG_EDKII_MAIL_ADDR =3D 'devel@edk2.groups.io'=0D +MSG_SEARCH_FOR_HELP =3D _(=0D "\n(Please send email to %s for\n"=0D " help, attach the following call stack trace.)\n")=0D -MSG_REMOVE_TEMP_FILE_STARTED =3D _("Removing temp files started ... ")=0D -MSG_REMOVE_TEMP_FILE_DONE =3D _("Removing temp files ... Done.")=0D -MSG_FINISH =3D _("Successfully Done.")=0D -MSG_COMPRESS_DISTRIBUTION_PKG =3D _("Compressing Distribution Package Fil= e ...")=0D -MSG_CONFIRM_REMOVE =3D _(=0D +MSG_REMOVE_TEMP_FILE_STARTED =3D _("Removing temp files started ... ")=0D +MSG_REMOVE_TEMP_FILE_DONE =3D _("Removing temp files ... Done.")=0D +MSG_FINISH =3D _("Successfully Done.")=0D +MSG_COMPRESS_DISTRIBUTION_PKG =3D _("Compressing Distribution Package File= ...")=0D +MSG_CONFIRM_REMOVE =3D _(=0D "Some packages or modules depend on this distribution package.\n"=0D "Do you really want to remove it?")=0D -MSG_CONFIRM_REMOVE2 =3D _(=0D +MSG_CONFIRM_REMOVE2 =3D _(=0D "This file has been modified: %s. Do you want to remove it?"=0D "Press Y to remove or other key to keep it")=0D -MSG_CONFIRM_REMOVE3 =3D _(=0D +MSG_CONFIRM_REMOVE3 =3D _(=0D "This is a newly created file: %s. Are you sure you want to remove it= ? "=0D "Press Y to remove or any other key to keep it")=0D -MSG_USER_DELETE_OP =3D _(=0D +MSG_USER_DELETE_OP =3D _(=0D "Press Y to delete all files or press any other key to quit:")=0D -MSG_REMOVE_FILE =3D _("Removing file: %s ...")=0D +MSG_REMOVE_FILE =3D _("Removing file: %s ...")=0D =0D -MSG_INITIALIZE_ECC_STARTED =3D _("\nInitialize ECC database started ..= .")=0D -MSG_INITIALIZE_ECC_DONE =3D _("Initialize ECC database ... Done.")= =0D -MSG_DEFINE_STATEMENT_FOUND =3D _("DEFINE statement '%s' found in secti= on %s")=0D -MSG_PARSING =3D _("Parsing %s ...")=0D +MSG_INITIALIZE_ECC_STARTED =3D _("\nInitialize ECC database started ...")= =0D +MSG_INITIALIZE_ECC_DONE =3D _("Initialize ECC database ... Done.")=0D +MSG_DEFINE_STATEMENT_FOUND =3D _("DEFINE statement '%s' found in section %= s")=0D +MSG_PARSING =3D _("Parsing %s ...")=0D =0D -MSG_REPKG_CONFLICT =3D \=0D -_("Repackaging is not allowed on this file: %s. "=0D - "It was installed from distribution %s(Guid %s Version %s).")=0D +MSG_REPKG_CONFLICT =3D \=0D + _("Repackaging is not allowed on this file: %s. "=0D + "It was installed from distribution %s(Guid %s Version %s).")=0D =0D -MSG_INVALID_MODULE_INTRODUCED =3D _("Some modules are not valid after rem= oval.")=0D -MSG_CHECK_LOG_FILE =3D _("Please check log file %s for full li= st")=0D -MSG_NEW_FILE_NAME =3D _(=0D +MSG_INVALID_MODULE_INTRODUCED =3D _("Some modules are not valid after remo= val.")=0D +MSG_CHECK_LOG_FILE =3D _("Please check log file %s for full list")=0D +MSG_NEW_FILE_NAME =3D _(=0D "Provide new filename:\n")=0D -MSG_RELATIVE_PATH_ONLY =3D _("Please specify a relative path, full path is= not allowed: %s")=0D -MSG_NEW_PKG_PATH =3D _(=0D +MSG_RELATIVE_PATH_ONLY =3D _(=0D + "Please specify a relative path, full path is not allowed: %s")=0D +MSG_NEW_PKG_PATH =3D _(=0D "Select package location. To quit with no input, press [Enter].")=0D -MSG_CHECK_DP_FOR_REPLACE =3D _("Verifying the dependency rule for replacem= ent of distributions:\n %s replaces %s")=0D -MSG_CHECK_DP_FOR_INSTALL =3D _("Verifying the dependency rule for installa= tion of distribution:\n %s")=0D +MSG_CHECK_DP_FOR_REPLACE =3D _(=0D + "Verifying the dependency rule for replacement of distributions:\n %s = replaces %s")=0D +MSG_CHECK_DP_FOR_INSTALL =3D _(=0D + "Verifying the dependency rule for installation of distribution:\n %s"= )=0D MSG_REPLACE_ALREADY_INSTALLED_DP =3D _("Distribution with the same GUID/Ve= rsion is already installed, "=0D "replace would result in two instance= s, which is not allowed")=0D MSG_RECOVER_START =3D _('An error was detected, recovery started ...')=0D @@ -364,398 +377,416 @@ MSG_RECOVER_FAIL =3D _('Recovery failed.') # Error related strings.=0D #=0D =0D -ERR_DEPENDENCY_NOT_MATCH =3D _(=0D +ERR_DEPENDENCY_NOT_MATCH =3D _(=0D "Module %s's dependency on package %s (GUID %s Version %s) "=0D "cannot be satisfied")=0D -ERR_MODULE_NOT_INSTALLED =3D _(=0D +ERR_MODULE_NOT_INSTALLED =3D _(=0D "This module is not installed in the workspace: %s\n")=0D -ERR_DIR_ALREADY_EXIST =3D _(=0D +ERR_DIR_ALREADY_EXIST =3D _(=0D "This directory already exists: %s.\n"=0D "Select another location. Press [Enter] with no input to quit:")=0D -ERR_USER_INTERRUPT =3D _("The user has paused the applicatio= n")=0D -ERR_DIST_FILE_TOOMANY =3D _(=0D +ERR_USER_INTERRUPT =3D _("The user has paused the application")=0D +ERR_DIST_FILE_TOOMANY =3D _(=0D "Only one .content and one .pkg file in ZIP file are allowed.")=0D -ERR_DIST_FILE_TOOFEW =3D _(=0D +ERR_DIST_FILE_TOOFEW =3D _(=0D "Must have one .content and one .pkg file in the ZIP file.")=0D -ERR_FILE_ALREADY_EXIST =3D _(=0D +ERR_FILE_ALREADY_EXIST =3D _(=0D "This file already exists: %s.\n"=0D "Select another path to continue. To quit with no input press [Enter]:= ")=0D -ERR_SPECIFY_PACKAGE =3D _(=0D +ERR_SPECIFY_PACKAGE =3D _(=0D "One distribution package must be specified")=0D -ERR_FILE_BROKEN =3D _(=0D +ERR_FILE_BROKEN =3D _(=0D "This file is invalid in the distribution package: %s")=0D ERR_PACKAGE_NOT_MATCH_DEPENDENCY =3D _(=0D "This distribution package does not meet the dependency requirements")= =0D -ERR_UNKNOWN_FATAL_INSTALL_ERR =3D \=0D -_("Unknown unrecoverable error when installing: %s")=0D -ERR_UNKNOWN_FATAL_REPLACE_ERR =3D \=0D -_("Unknown unrecoverable error during replacement of distributions: %s rep= laces %s")=0D -ERR_OPTION_NOT_FOUND =3D _("Options not found")=0D -ERR_INVALID_PACKAGE_NAME =3D _("Incorrect package name: %s. ")=0D -ERR_INVALID_PACKAGE_PATH =3D \=0D -_("Incorrect package path: %s. The path must be a relative path.")=0D -ERR_NOT_FOUND =3D _("This was not found: %s")=0D -ERR_INVALID_MODULE_NAME =3D _("This is not a valid module name: %= s")=0D -ERR_INVALID_METAFILE_PATH =3D _('This file must be in sub-directory= of WORKSPACE: %s.')=0D -ERR_INVALID_MODULE_PATH =3D \=0D -_("Incorrect module path: %s. The path must be a relative path.")=0D -ERR_UNKNOWN_FATAL_CREATING_ERR =3D _("Unknown error when creating: %s")= =0D -ERR_PACKAGE_NOT_INSTALLED =3D _(=0D +ERR_UNKNOWN_FATAL_INSTALL_ERR =3D \=0D + _("Unknown unrecoverable error when installing: %s")=0D +ERR_UNKNOWN_FATAL_REPLACE_ERR =3D \=0D + _("Unknown unrecoverable error during replacement of distributions: %s= replaces %s")=0D +ERR_OPTION_NOT_FOUND =3D _("Options not found")=0D +ERR_INVALID_PACKAGE_NAME =3D _("Incorrect package name: %s. ")=0D +ERR_INVALID_PACKAGE_PATH =3D \=0D + _("Incorrect package path: %s. The path must be a relative path.")=0D +ERR_NOT_FOUND =3D _("This was not found: %s")=0D +ERR_INVALID_MODULE_NAME =3D _("This is not a valid module name: %s")=0D +ERR_INVALID_METAFILE_PATH =3D _(=0D + 'This file must be in sub-directory of WORKSPACE: %s.')=0D +ERR_INVALID_MODULE_PATH =3D \=0D + _("Incorrect module path: %s. The path must be a relative path.")=0D +ERR_UNKNOWN_FATAL_CREATING_ERR =3D _("Unknown error when creating: %s")=0D +ERR_PACKAGE_NOT_INSTALLED =3D _(=0D "This distribution package not installed: %s")=0D -ERR_DISTRIBUTION_NOT_INSTALLED =3D _(=0D +ERR_DISTRIBUTION_NOT_INSTALLED =3D _(=0D "The distribution package is not installed.")=0D -ERR_UNKNOWN_FATAL_REMOVING_ERR =3D _("Unknown error when removing packag= e")=0D -ERR_UNKNOWN_FATAL_INVENTORYWS_ERR =3D _("Unknown error when inventorying= WORKSPACE")=0D -ERR_NOT_CONFIGURE_WORKSPACE_ENV =3D _(=0D +ERR_UNKNOWN_FATAL_REMOVING_ERR =3D _("Unknown error when removing package"= )=0D +ERR_UNKNOWN_FATAL_INVENTORYWS_ERR =3D _(=0D + "Unknown error when inventorying WORKSPACE")=0D +ERR_NOT_CONFIGURE_WORKSPACE_ENV =3D _(=0D "The WORKSPACE environment variable must be configured.")=0D -ERR_NO_TEMPLATE_FILE =3D _("This package information data file= is not found: %s")=0D -ERR_DEBUG_LEVEL =3D _(=0D +ERR_NO_TEMPLATE_FILE =3D _("This package information data file is not foun= d: %s")=0D +ERR_DEBUG_LEVEL =3D _(=0D "Not supported debug level. Use default level instead.")=0D -ERR_REQUIRE_T_OPTION =3D _(=0D +ERR_REQUIRE_T_OPTION =3D _(=0D "Option -t is required during distribution creation.")=0D -ERR_REQUIRE_O_OPTION =3D _(=0D +ERR_REQUIRE_O_OPTION =3D _(=0D "Option -o is required during distribution replacement.")=0D -ERR_REQUIRE_U_OPTION =3D _(=0D +ERR_REQUIRE_U_OPTION =3D _(=0D "Option -u is required during distribution replacement.")=0D -ERR_REQUIRE_I_C_R_OPTION =3D _(=0D +ERR_REQUIRE_I_C_R_OPTION =3D _(=0D "Options -i, -c and -r are mutually exclusive.")=0D -ERR_I_C_EXCLUSIVE =3D \=0D -_("Option -c and -i are mutually exclusive.")=0D -ERR_I_R_EXCLUSIVE =3D \=0D -_("Option -i and -r are mutually exclusive.")=0D -ERR_C_R_EXCLUSIVE =3D \=0D -_("Option -c and -r are mutually exclusive.")=0D -ERR_U_ICR_EXCLUSIVE =3D \=0D -_("Option -u and -c/-i/-r are mutually exclusive.")=0D +ERR_I_C_EXCLUSIVE =3D \=0D + _("Option -c and -i are mutually exclusive.")=0D +ERR_I_R_EXCLUSIVE =3D \=0D + _("Option -i and -r are mutually exclusive.")=0D +ERR_C_R_EXCLUSIVE =3D \=0D + _("Option -c and -r are mutually exclusive.")=0D +ERR_U_ICR_EXCLUSIVE =3D \=0D + _("Option -u and -c/-i/-r are mutually exclusive.")=0D =0D -ERR_L_OA_EXCLUSIVE =3D \=0D -_("Option -l and -c/-i/-r/-u are mutually exclusive.")=0D +ERR_L_OA_EXCLUSIVE =3D \=0D + _("Option -l and -c/-i/-r/-u are mutually exclusive.")=0D =0D -ERR_FAILED_LOAD =3D _("Failed to load %s\n\t%s")=0D +ERR_FAILED_LOAD =3D _("Failed to load %s\n\t%s")=0D ERR_PLACEHOLDER_DIFFERENT_REPEAT =3D _(=0D "${%s} has different repeat time from others.")=0D -ERR_KEY_NOTALLOWED =3D _("This keyword is not allowed: %s")= =0D -ERR_NOT_FOUND_ENVIRONMENT =3D _("Environment variable not found")=0D -ERR_WORKSPACE_NOTEXIST =3D _("WORKSPACE doesn't exist")=0D -ERR_SPACE_NOTALLOWED =3D _(=0D +ERR_KEY_NOTALLOWED =3D _("This keyword is not allowed: %s")=0D +ERR_NOT_FOUND_ENVIRONMENT =3D _("Environment variable not found")=0D +ERR_WORKSPACE_NOTEXIST =3D _("WORKSPACE doesn't exist")=0D +ERR_SPACE_NOTALLOWED =3D _(=0D "Whitespace characters are not allowed in the WORKSPACE path. ")=0D -ERR_MACRONAME_NOGIVEN =3D _("No MACRO name given")=0D -ERR_MACROVALUE_NOGIVEN =3D _("No MACRO value given")=0D -ERR_MACRONAME_INVALID =3D _("Incorrect MACRO name: %s")=0D -ERR_MACROVALUE_INVALID =3D _("Incorrect MACRO value: %s")=0D -ERR_NAME_ONLY_DEFINE =3D _(=0D +ERR_MACRONAME_NOGIVEN =3D _("No MACRO name given")=0D +ERR_MACROVALUE_NOGIVEN =3D _("No MACRO value given")=0D +ERR_MACRONAME_INVALID =3D _("Incorrect MACRO name: %s")=0D +ERR_MACROVALUE_INVALID =3D _("Incorrect MACRO value: %s")=0D +ERR_NAME_ONLY_DEFINE =3D _(=0D "This variable can only be defined via environment variable: %s")=0D -ERR_EDK_GLOBAL_SAMENAME =3D _(=0D +ERR_EDK_GLOBAL_SAMENAME =3D _(=0D "EDK_GLOBAL defined a macro with the same name as one defined by 'DEFI= NE'")=0D -ERR_SECTIONNAME_INVALID =3D _(=0D +ERR_SECTIONNAME_INVALID =3D _(=0D "An incorrect section name was found: %s. 'The correct file is '%s' ."= )=0D -ERR_CHECKFILE_NOTFOUND =3D _(=0D +ERR_CHECKFILE_NOTFOUND =3D _(=0D "Can't find file '%s' defined in section '%s'")=0D -ERR_INVALID_NOTFOUND =3D _(=0D +ERR_INVALID_NOTFOUND =3D _(=0D "Incorrect statement '%s' was found in section '%s'")=0D -ERR_TEMPLATE_NOTFOUND =3D _("This package information data file= is not found: %s")=0D -ERR_SECTION_NAME_INVALID =3D _('Incorrect section name: %s')=0D -ERR_SECTION_REDEFINE =3D _(=0D +ERR_TEMPLATE_NOTFOUND =3D _(=0D + "This package information data file is not found: %s")=0D +ERR_SECTION_NAME_INVALID =3D _('Incorrect section name: %s')=0D +ERR_SECTION_REDEFINE =3D _(=0D "This section already defined: %s.")=0D -ERR_SECTION_NAME_NONE =3D \=0D +ERR_SECTION_NAME_NONE =3D \=0D _('The section needs to be specified first.')=0D -ERR_KEYWORD_INVALID =3D _('Invalid keyword: %s')=0D -ERR_VALUE_INVALID =3D _("Invalid \"%s\" value in section [%= s].")=0D -ERR_FILELIST_LOCATION =3D _(=0D +ERR_KEYWORD_INVALID =3D _('Invalid keyword: %s')=0D +ERR_VALUE_INVALID =3D _("Invalid \"%s\" value in section [%s].")=0D +ERR_FILELIST_LOCATION =3D _(=0D 'The directory "%s" must contain this file: "%s".')=0D -ERR_KEYWORD_REDEFINE =3D _(=0D +ERR_KEYWORD_REDEFINE =3D _(=0D "Keyword in this section can only be used once: %s.")=0D -ERR_FILELIST_EXIST =3D _(=0D +ERR_FILELIST_EXIST =3D _(=0D 'This file does not exist: %s.')=0D -ERR_COPYRIGHT_CONTENT =3D _(=0D +ERR_COPYRIGHT_CONTENT =3D _(=0D "The copyright content must contain the word \"Copyright\" (case insen= sitive).")=0D -ERR_WRONG_FILELIST_FORMAT =3D \=0D -_('File list format is incorrect.'=0D - 'The correct format is: filename|key=3Dvalue[|key=3Dvalue]')=0D -ERR_FILELIST_ATTR =3D _(=0D +ERR_WRONG_FILELIST_FORMAT =3D \=0D + _('File list format is incorrect.'=0D + 'The correct format is: filename|key=3Dvalue[|key=3Dvalue]')=0D +ERR_FILELIST_ATTR =3D _(=0D "The value of attribute \"%s\" includes illegal character.")=0D -ERR_UNKNOWN_FILELIST_ATTR =3D _(=0D +ERR_UNKNOWN_FILELIST_ATTR =3D _(=0D 'Unknown attribute name: %s.')=0D -ERR_EMPTY_VALUE =3D _("Empty value is not allowed")=0D -ERR_KEYWORD_MANDATORY =3D _('This keyword is mandatory: %s')=0D -ERR_BOOLEAN_VALUE =3D _(=0D +ERR_EMPTY_VALUE =3D _("Empty value is not allowed")=0D +ERR_KEYWORD_MANDATORY =3D _('This keyword is mandatory: %s')=0D +ERR_BOOLEAN_VALUE =3D _(=0D 'Value of key [%s] must be true or false, current: [%s]')=0D -ERR_GUID_VALUE =3D _(=0D +ERR_GUID_VALUE =3D _(=0D 'GUID must have the format of 8-4-4-4-12 with HEX value. '=0D 'Current value: [%s]')=0D -ERR_VERSION_VALUE =3D _(=0D +ERR_VERSION_VALUE =3D _(=0D 'The value of key [%s] must be a decimal number. Found: [%s]')=0D -ERR_VERSION_XMLSPEC =3D _(=0D +ERR_VERSION_XMLSPEC =3D _(=0D 'XmlSpecification value must be 1.1, current: %s.')=0D =0D -ERR_INVALID_GUID =3D _("Incorrect GUID value string: %s")= =0D +ERR_INVALID_GUID =3D _("Incorrect GUID value string: %s")=0D =0D -ERR_FILE_NOT_FOUND =3D \=0D +ERR_FILE_NOT_FOUND =3D \=0D _("File or directory not found in workspace")=0D -ERR_FILE_OPEN_FAILURE =3D _("Could not open file")=0D -ERR_FILE_WRITE_FAILURE =3D _("Could not write file.")=0D -ERR_FILE_PARSE_FAILURE =3D _("Could not parse file")=0D -ERR_FILE_READ_FAILURE =3D _("Could not read file")=0D -ERR_FILE_CREATE_FAILURE =3D _("Could not create file")=0D -ERR_FILE_CHECKSUM_FAILURE =3D _("Checksum of file is incorrect")=0D -ERR_FILE_COMPRESS_FAILURE =3D _("File compression did not correctly= ")=0D -ERR_FILE_DECOMPRESS_FAILURE =3D \=0D +ERR_FILE_OPEN_FAILURE =3D _("Could not open file")=0D +ERR_FILE_WRITE_FAILURE =3D _("Could not write file.")=0D +ERR_FILE_PARSE_FAILURE =3D _("Could not parse file")=0D +ERR_FILE_READ_FAILURE =3D _("Could not read file")=0D +ERR_FILE_CREATE_FAILURE =3D _("Could not create file")=0D +ERR_FILE_CHECKSUM_FAILURE =3D _("Checksum of file is incorrect")=0D +ERR_FILE_COMPRESS_FAILURE =3D _("File compression did not correctly")=0D +ERR_FILE_DECOMPRESS_FAILURE =3D \=0D _("File decompression did not complete correctly")=0D -ERR_FILE_MOVE_FAILURE =3D _("Move file did not complete success= fully")=0D -ERR_FILE_DELETE_FAILURE =3D _("File could not be deleted")=0D -ERR_FILE_COPY_FAILURE =3D _("File did not copy correctly")=0D -ERR_FILE_POSITIONING_FAILURE =3D _("Could not find file seek position"= )=0D -ERR_FILE_TYPE_MISMATCH =3D _("Incorrect file type")=0D -ERR_FILE_CASE_MISMATCH =3D _("File name case mismatch")=0D -ERR_FILE_DUPLICATED =3D _("Duplicate file found")=0D -ERR_FILE_UNKNOWN_ERROR =3D _("Unknown error encountered on file"= )=0D -ERR_FILE_NAME_INVALIDE =3D _("This file name is invalid, it must= not be an absolute path or "=0D - "contain a period \".\" or \"..\": %= s.")=0D -ERR_OPTION_UNKNOWN =3D _("Unknown option")=0D -ERR_OPTION_MISSING =3D _("Missing option")=0D -ERR_OPTION_CONFLICT =3D _("Options conflict")=0D -ERR_OPTION_VALUE_INVALID =3D _("Invalid option value")=0D -ERR_OPTION_DEPRECATED =3D _("Deprecated option")=0D -ERR_OPTION_NOT_SUPPORTED =3D _("Unsupported option")=0D -ERR_OPTION_UNKNOWN_ERROR =3D _("Unknown error when processing opti= ons")=0D -ERR_PARAMETER_INVALID =3D _("Invalid parameter")=0D -ERR_PARAMETER_MISSING =3D _("Missing parameter")=0D -ERR_PARAMETER_UNKNOWN_ERROR =3D _("Unknown error in parameters")=0D -ERR_FORMAT_INVALID =3D _("Invalid syntax/format")=0D -ERR_FORMAT_NOT_SUPPORTED =3D _("Syntax/format not supported")=0D -ERR_FORMAT_UNKNOWN =3D _("Unknown format")=0D -ERR_FORMAT_UNKNOWN_ERROR =3D _("Unknown error in syntax/format ")= =0D -ERR_RESOURCE_NOT_AVAILABLE =3D _("Not available")=0D -ERR_RESOURCE_ALLOCATE_FAILURE =3D _("A resource allocation has failed")= =0D -ERR_RESOURCE_FULL =3D _("Full")=0D -ERR_RESOURCE_OVERFLOW =3D _("Overflow")=0D -ERR_RESOURCE_UNDERRUN =3D _("Underrun")=0D -ERR_RESOURCE_UNKNOWN_ERROR =3D _("Unknown error")=0D -ERR_ATTRIBUTE_NOT_AVAILABLE =3D _("Not available")=0D -ERR_ATTRIBUTE_RETRIEVE_FAILURE =3D _("Unable to retrieve")=0D -ERR_ATTRIBUTE_SET_FAILURE =3D _("Unable to set")=0D -ERR_ATTRIBUTE_UPDATE_FAILURE =3D _("Unable to update")=0D -ERR_ATTRIBUTE_ACCESS_DENIED =3D _("Access denied")=0D -ERR_ATTRIBUTE_UNKNOWN_ERROR =3D _("Unknown error when accessing")=0D -ERR_COMMAND_FAILURE =3D _("Unable to execute command")=0D -ERR_IO_NOT_READY =3D _("Not ready")=0D -ERR_IO_BUSY =3D _("Busy")=0D -ERR_IO_TIMEOUT =3D _("Timeout")=0D -ERR_IO_UNKNOWN_ERROR =3D _("Unknown error in IO operation")=0D -ERR_UNKNOWN_ERROR =3D _("Unknown error")=0D -ERR_UPT_ALREADY_INSTALLED_ERROR =3D _("Already installed")=0D -ERR_UPT_ENVIRON_MISSING_ERROR =3D _("Environ missing")=0D -ERR_UPT_REPKG_ERROR =3D _("File not allowed for RePackage")=0D -ERR_UPT_DB_UPDATE_ERROR =3D _("Update database did not complete s= uccessfully")=0D -ERR_UPT_INI_PARSE_ERROR =3D _("INI file parse error")=0D -ERR_COPYRIGHT_MISSING =3D \=0D -_("Header comment section must have copyright information")=0D -ERR_LICENSE_MISSING =3D \=0D -_("Header comment section must have license information")=0D -ERR_INVALID_BINARYHEADER_FORMAT =3D \=0D -_("Binary Header comment section must have abstract,description,copyright,= license information")=0D +ERR_FILE_MOVE_FAILURE =3D _("Move file did not complete successfully")=0D +ERR_FILE_DELETE_FAILURE =3D _("File could not be deleted")=0D +ERR_FILE_COPY_FAILURE =3D _("File did not copy correctly")=0D +ERR_FILE_POSITIONING_FAILURE =3D _("Could not find file seek position")=0D +ERR_FILE_TYPE_MISMATCH =3D _("Incorrect file type")=0D +ERR_FILE_CASE_MISMATCH =3D _("File name case mismatch")=0D +ERR_FILE_DUPLICATED =3D _("Duplicate file found")=0D +ERR_FILE_UNKNOWN_ERROR =3D _("Unknown error encountered on file")=0D +ERR_FILE_NAME_INVALIDE =3D _("This file name is invalid, it must not be an= absolute path or "=0D + "contain a period \".\" or \"..\": %s.")=0D +ERR_OPTION_UNKNOWN =3D _("Unknown option")=0D +ERR_OPTION_MISSING =3D _("Missing option")=0D +ERR_OPTION_CONFLICT =3D _("Options conflict")=0D +ERR_OPTION_VALUE_INVALID =3D _("Invalid option value")=0D +ERR_OPTION_DEPRECATED =3D _("Deprecated option")=0D +ERR_OPTION_NOT_SUPPORTED =3D _("Unsupported option")=0D +ERR_OPTION_UNKNOWN_ERROR =3D _("Unknown error when processing options")=0D +ERR_PARAMETER_INVALID =3D _("Invalid parameter")=0D +ERR_PARAMETER_MISSING =3D _("Missing parameter")=0D +ERR_PARAMETER_UNKNOWN_ERROR =3D _("Unknown error in parameters")=0D +ERR_FORMAT_INVALID =3D _("Invalid syntax/format")=0D +ERR_FORMAT_NOT_SUPPORTED =3D _("Syntax/format not supported")=0D +ERR_FORMAT_UNKNOWN =3D _("Unknown format")=0D +ERR_FORMAT_UNKNOWN_ERROR =3D _("Unknown error in syntax/format ")=0D +ERR_RESOURCE_NOT_AVAILABLE =3D _("Not available")=0D +ERR_RESOURCE_ALLOCATE_FAILURE =3D _("A resource allocation has failed")=0D +ERR_RESOURCE_FULL =3D _("Full")=0D +ERR_RESOURCE_OVERFLOW =3D _("Overflow")=0D +ERR_RESOURCE_UNDERRUN =3D _("Underrun")=0D +ERR_RESOURCE_UNKNOWN_ERROR =3D _("Unknown error")=0D +ERR_ATTRIBUTE_NOT_AVAILABLE =3D _("Not available")=0D +ERR_ATTRIBUTE_RETRIEVE_FAILURE =3D _("Unable to retrieve")=0D +ERR_ATTRIBUTE_SET_FAILURE =3D _("Unable to set")=0D +ERR_ATTRIBUTE_UPDATE_FAILURE =3D _("Unable to update")=0D +ERR_ATTRIBUTE_ACCESS_DENIED =3D _("Access denied")=0D +ERR_ATTRIBUTE_UNKNOWN_ERROR =3D _("Unknown error when accessing")=0D +ERR_COMMAND_FAILURE =3D _("Unable to execute command")=0D +ERR_IO_NOT_READY =3D _("Not ready")=0D +ERR_IO_BUSY =3D _("Busy")=0D +ERR_IO_TIMEOUT =3D _("Timeout")=0D +ERR_IO_UNKNOWN_ERROR =3D _("Unknown error in IO operation")=0D +ERR_UNKNOWN_ERROR =3D _("Unknown error")=0D +ERR_UPT_ALREADY_INSTALLED_ERROR =3D _("Already installed")=0D +ERR_UPT_ENVIRON_MISSING_ERROR =3D _("Environ missing")=0D +ERR_UPT_REPKG_ERROR =3D _("File not allowed for RePackage")=0D +ERR_UPT_DB_UPDATE_ERROR =3D _("Update database did not complete successful= ly")=0D +ERR_UPT_INI_PARSE_ERROR =3D _("INI file parse error")=0D +ERR_COPYRIGHT_MISSING =3D \=0D + _("Header comment section must have copyright information")=0D +ERR_LICENSE_MISSING =3D \=0D + _("Header comment section must have license information")=0D +ERR_INVALID_BINARYHEADER_FORMAT =3D \=0D + _("Binary Header comment section must have abstract,description,copyri= ght,license information")=0D ERR_MULTIPLE_BINARYHEADER_EXIST =3D \=0D -_("the inf file at most support one BinaryHeader at the fileheader section= .")=0D -ERR_INVALID_COMMENT_FORMAT =3D _("Comment must start with #")=0D -ERR_USER_ABORT =3D _("User has stopped the application")= =0D -ERR_DIST_EXT_ERROR =3D \=0D -_("Distribution file extension should be '.dist'. Current given: '%s'.")=0D -ERR_DIST_FILENAME_ONLY_FOR_REMOVE =3D \=0D -_("Only distribution filename without path allowed during remove. Current = given: '%s'.")=0D -ERR_NOT_STANDALONE_MODULE_ERROR =3D \=0D + _("the inf file at most support one BinaryHeader at the fileheader sec= tion.")=0D +ERR_INVALID_COMMENT_FORMAT =3D _("Comment must start with #")=0D +ERR_USER_ABORT =3D _("User has stopped the application")=0D +ERR_DIST_EXT_ERROR =3D \=0D + _("Distribution file extension should be '.dist'. Current given: '%s'.= ")=0D +ERR_DIST_FILENAME_ONLY_FOR_REMOVE =3D \=0D + _("Only distribution filename without path allowed during remove. Curr= ent given: '%s'.")=0D +ERR_NOT_STANDALONE_MODULE_ERROR =3D \=0D _("Module %s is not a standalone module (found in Package %s)")=0D -ERR_UPT_ALREADY_RUNNING_ERROR =3D \=0D +ERR_UPT_ALREADY_RUNNING_ERROR =3D \=0D _("UPT is already running, only one instance is allowed")=0D -ERR_MUL_DEC_ERROR =3D _("Multiple DEC files found within one package direc= tory tree %s: %s, %s")=0D -ERR_INSTALL_FILE_FROM_EMPTY_CONTENT =3D _("Error file to be installed is n= ot found in content file: %s")=0D +ERR_MUL_DEC_ERROR =3D _(=0D + "Multiple DEC files found within one package directory tree %s: %s, %s= ")=0D +ERR_INSTALL_FILE_FROM_EMPTY_CONTENT =3D _(=0D + "Error file to be installed is not found in content file: %s")=0D ERR_INSTALL_FILE_DEC_FILE_ERROR =3D _("Could not obtain the TokenSpaceGuid= CName and the PcdCName from the DEC files "=0D -"that the package depends on for this pcd entry: TokenValue: %s Token: %s"= )=0D -ERR_NOT_SUPPORTED_SA_MODULE =3D _("Stand-alone module distribution does no= t allow EDK 1 INF")=0D -ERR_INSTALL_DIST_NOT_FOUND =3D \=0D -_("Distribution file to be installed is not found in current working direc= tory or workspace: %s")=0D -ERR_REPLACE_DIST_NOT_FOUND =3D \=0D -_("Distribution file for replace function was not found in the current wor= king directory or workspace: %s")=0D -ERR_DIST_FILENAME_ONLY_FOR_REPLACE_ORIG =3D \=0D -_("Only a distribution file name without a path is allowed for "=0D - "the distribution to be replaced during replace. Current given: '%s'.")= =0D + "that the package depends on for this = pcd entry: TokenValue: %s Token: %s")=0D +ERR_NOT_SUPPORTED_SA_MODULE =3D _(=0D + "Stand-alone module distribution does not allow EDK 1 INF")=0D +ERR_INSTALL_DIST_NOT_FOUND =3D \=0D + _("Distribution file to be installed is not found in current working d= irectory or workspace: %s")=0D +ERR_REPLACE_DIST_NOT_FOUND =3D \=0D + _("Distribution file for replace function was not found in the current= working directory or workspace: %s")=0D +ERR_DIST_FILENAME_ONLY_FOR_REPLACE_ORIG =3D \=0D + _("Only a distribution file name without a path is allowed for "=0D + "the distribution to be replaced during replace. Current given: '%s'= .")=0D ERR_UNIPARSE_DBLQUOTE_UNMATCHED =3D \=0D -_("Only Language entry can contain a couple of matched quote in one line")= =0D -ERR_UNIPARSE_NO_SECTION_EXIST =3D _("No PackageDef or ModuleDef section ex= ists in the UNI file.")=0D -ERR_UNIPARSE_STRNAME_FORMAT_ERROR =3D _("The String Token Name %s must sta= rt with \"STR_\"")=0D -ERR_UNIPARSE_SEP_LANGENTRY_LINE =3D _("Each should be in a sep= arate line :%s.")=0D + _("Only Language entry can contain a couple of matched quote in one li= ne")=0D +ERR_UNIPARSE_NO_SECTION_EXIST =3D _(=0D + "No PackageDef or ModuleDef section exists in the UNI file.")=0D +ERR_UNIPARSE_STRNAME_FORMAT_ERROR =3D _(=0D + "The String Token Name %s must start with \"STR_\"")=0D +ERR_UNIPARSE_SEP_LANGENTRY_LINE =3D _(=0D + "Each should be in a separate line :%s.")=0D ERR_UNIPARSE_MULTI_ENTRY_EXIST =3D \=0D -_("There are same entries : %s in the UNI file, every kind of entry should= be only one.")=0D + _("There are same entries : %s in the UNI file, every kind of entry sh= ould be only one.")=0D ERR_UNIPARSE_ENTRY_ORDER_WRONG =3D \=0D -_("The string entry order in UNI file should be , , \=0D + _("The string entry order in UNI file should be , , \=0D , .")=0D -ERR_UNIPARSE_STRTOKEN_FORMAT_ERROR =3D _("The String Token Type %s must be= one of the '_PROMPT', '_HELP' and '_ERR_'.")=0D -ERR_UNIPARSE_LINEFEED_UNDER_EXIST =3D _("Line feed should not exist under = this line: %s.")=0D -ERR_UNIPARSE_LINEFEED_UP_EXIST =3D _("Line feed should not exist up this l= ine: %s.")=0D +ERR_UNIPARSE_STRTOKEN_FORMAT_ERROR =3D _(=0D + "The String Token Type %s must be one of the '_PROMPT', '_HELP' and '_= ERR_'.")=0D +ERR_UNIPARSE_LINEFEED_UNDER_EXIST =3D _(=0D + "Line feed should not exist under this line: %s.")=0D +ERR_UNIPARSE_LINEFEED_UP_EXIST =3D _(=0D + "Line feed should not exist up this line: %s.")=0D ERR_UNI_MISS_STRING_ENTRY =3D _("String entry missed in this Entry, %s.")= =0D ERR_UNI_MISS_LANGENTRY =3D _("Language entry missed in this Entry, %s.")=0D -ERR_BINARY_HEADER_ORDER =3D _("Binary header must follow the fil= e header.")=0D -ERR_NO_SOURCE_HEADER =3D _("File header statement \"## @file\= " must exist at the first place.")=0D -ERR_UNI_FILE_SUFFIX_WRONG =3D _("The UNI file must have an extension of '.= uni', '.UNI' or '.Uni'")=0D -ERR_UNI_FILE_NAME_INVALID =3D _("The use of '..', '../' and './' in the UN= I file is prohibited.")=0D +ERR_BINARY_HEADER_ORDER =3D _("Binary header must follow the file header."= )=0D +ERR_NO_SOURCE_HEADER =3D _(=0D + "File header statement \"## @file\" must exist at the first place.")=0D +ERR_UNI_FILE_SUFFIX_WRONG =3D _(=0D + "The UNI file must have an extension of '.uni', '.UNI' or '.Uni'")=0D +ERR_UNI_FILE_NAME_INVALID =3D _(=0D + "The use of '..', '../' and './' in the UNI file is prohibited.")=0D ERR_UNI_SUBGUID_VALUE_DEFINE_DEC_NOT_FOUND =3D _("There are no DEC file to= define the GUID value for \=0D this GUID CName: '%s'.")=0D =0D #=0D # Expression error message=0D #=0D -ERR_EXPR_RIGHT_PAREN =3D \=0D -_('Missing ")" in expression "%s".')=0D -ERR_EXPR_FACTOR =3D \=0D -_('"%s" is expected to be HEX, integer, macro, quoted string or PcdName in= '=0D - 'expression "%s".')=0D -ERR_EXPR_STRING_ITEM =3D \=0D -_('"%s" is expected to be HEX, integer, macro, quoted string or PcdName in= '=0D - 'expression [%s].')=0D -ERR_EXPR_EQUALITY =3D \=0D -_('"%s" is expected to be =3D=3D, EQ, !=3D or NE in expression "%s".')=0D -ERR_EXPR_BOOLEAN =3D \=0D -_('The string "%s" in expression "%s" can not be recognized as a part of t= he logical expression.')=0D -ERR_EXPR_EMPTY =3D _('Boolean value cannot be empty.')=0D -ERR_EXPRESS_EMPTY =3D _('Expression can not be empty.')=0D -ERR_EXPR_LOGICAL =3D \=0D -_('The following is not a valid logical expression: "%s".')=0D -ERR_EXPR_OR =3D _('The expression: "%s" must be encaps= ulated in open "(" and close ")" '=0D - 'parenthesis when using | or ||.')=0D -ERR_EXPR_RANGE =3D \=0D -_('The following is not a valid range expression: "%s".')=0D -ERR_EXPR_RANGE_FACTOR =3D \=0D -_('"%s" is expected to be HEX, integer in valid range expression "%s".')=0D +ERR_EXPR_RIGHT_PAREN =3D \=0D + _('Missing ")" in expression "%s".')=0D +ERR_EXPR_FACTOR =3D \=0D + _('"%s" is expected to be HEX, integer, macro, quoted string or PcdNam= e in '=0D + 'expression "%s".')=0D +ERR_EXPR_STRING_ITEM =3D \=0D + _('"%s" is expected to be HEX, integer, macro, quoted string or PcdNam= e in '=0D + 'expression [%s].')=0D +ERR_EXPR_EQUALITY =3D \=0D + _('"%s" is expected to be =3D=3D, EQ, !=3D or NE in expression "%s".'= )=0D +ERR_EXPR_BOOLEAN =3D \=0D + _('The string "%s" in expression "%s" can not be recognized as a part = of the logical expression.')=0D +ERR_EXPR_EMPTY =3D _('Boolean value cannot be empty.')=0D +ERR_EXPRESS_EMPTY =3D _('Expression can not be empty.')=0D +ERR_EXPR_LOGICAL =3D \=0D + _('The following is not a valid logical expression: "%s".')=0D +ERR_EXPR_OR =3D _('The expression: "%s" must be encapsulated in open "(" a= nd close ")" '=0D + 'parenthesis when using | or ||.')=0D +ERR_EXPR_RANGE =3D \=0D + _('The following is not a valid range expression: "%s".')=0D +ERR_EXPR_RANGE_FACTOR =3D \=0D + _('"%s" is expected to be HEX, integer in valid range expression "%s".= ')=0D ERR_EXPR_RANGE_DOUBLE_PAREN_NESTED =3D \=0D -_('Double parentheses nested is not allowed in valid range expression: "%s= ".')=0D -ERR_EXPR_RANGE_EMPTY =3D _('Valid range can not be empty.')=0D -ERR_EXPR_LIST_EMPTY =3D _('Valid list can not be empty.')=0D -ERR_PAREN_NOT_USED =3D _('Parenthesis must be used on both si= des of "OR", "AND" in valid range : %s.')=0D -ERR_EXPR_LIST =3D \=0D -_('The following is not a valid list expression: "%s".')=0D + _('Double parentheses nested is not allowed in valid range expression:= "%s".')=0D +ERR_EXPR_RANGE_EMPTY =3D _('Valid range can not be empty.')=0D +ERR_EXPR_LIST_EMPTY =3D _('Valid list can not be empty.')=0D +ERR_PAREN_NOT_USED =3D _(=0D + 'Parenthesis must be used on both sides of "OR", "AND" in valid range = : %s.')=0D +ERR_EXPR_LIST =3D \=0D + _('The following is not a valid list expression: "%s".')=0D =0D =0D # DEC parser error message=0D #=0D -ERR_DECPARSE_STATEMENT_EMPTY =3D \=0D -_('Must have at least one statement in section %s.')=0D -ERR_DECPARSE_DEFINE_DEFINED =3D \=0D -_('%s already defined in define section.')=0D -ERR_DECPARSE_DEFINE_SECNAME =3D \=0D -_('No arch and others can be followed for define section.')=0D -ERR_DECPARSE_DEFINE_MULTISEC =3D \=0D -_('The DEC file does not allow multiple define sections.')=0D -ERR_DECPARSE_DEFINE_REQUIRED =3D \=0D -_("Field [%s] is required in define section.")=0D -ERR_DECPARSE_DEFINE_FORMAT =3D \=0D -_("Wrong define section format, must be KEY =3D Value.")=0D -ERR_DECPARSE_DEFINE_UNKNOWKEY =3D \=0D -_("Unknown key [%s] in define section.")=0D -ERR_DECPARSE_DEFINE_SPEC =3D \=0D -_("Specification value must be HEX numbers or decimal numbers.")=0D -ERR_DECPARSE_DEFINE_PKGNAME =3D \=0D -_("Package name must be AlphaNumeric characters.")=0D -ERR_DECPARSE_DEFINE_PKGGUID =3D \=0D -_("GUID format error, must be HEX value with form 8-4-4-4-12.")=0D -ERR_DECPARSE_DEFINE_PKGVERSION =3D \=0D -_("Version number must be decimal number.")=0D -ERR_DECPARSE_DEFINE_PKGVUNI =3D \=0D -_("UNI file name format error or file does not exist.")=0D -ERR_DECPARSE_INCLUDE =3D \=0D -_("Incorrect path: [%s].")=0D -ERR_DECPARSE_LIBCLASS_SPLIT =3D \=0D -_("Library class format error, must be Libraryclass|Headerpath.")=0D -ERR_DECPARSE_LIBCLASS_EMPTY =3D \=0D -_("Class name or file name must not be empty.")=0D -ERR_DECPARSE_LIBCLASS_LIB =3D \=0D -_("Class name format error, must start with upper case letter followed wit= h "=0D - "zero or more alphanumeric characters.")=0D -ERR_DECPARSE_LIBCLASS_PATH_EXT =3D _("File name must be end with .h."= )=0D -ERR_DECPARSE_LIBCLASS_PATH_DOT =3D _("Path must not include '..'.")=0D -ERR_DECPARSE_LIBCLASS_PATH_EXIST =3D _("File name [%s] does not exist."= )=0D -ERR_DECPARSE_PCD_CVAR_GUID =3D \=0D -_("TokenSpaceGuidCName must be valid C variable format.")=0D -ERR_DECPARSE_PCD_SPLIT =3D \=0D -_("Incorrect PcdName. The format must be TokenSpaceGuidCName.PcdCName"=0D - "|PcdData|PcdType|Token.")=0D -ERR_DECPARSE_PCD_NAME =3D \=0D -_("Incorrect PCD name. The correct format must be "=0D - "..")=0D -ERR_DECPARSE_PCD_CVAR_PCDCNAME =3D \=0D -_("PcdCName must be valid C variable format.")=0D -ERR_DECPARSE_PCD_TYPE =3D \=0D -_('Incorrect PCD data type. A PCD data type must be one of '=0D - '"UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLEAN".')=0D -ERR_DECPARSE_PCD_VOID =3D \=0D -_("Incorrect value [%s] of type [%s]. Value must be printable and in th= e "=0D - "form of{...} for array, or ""..."" for string, or L""..."""=0D - "for unicode string.")=0D -ERR_DECPARSE_PCD_VALUE_EMPTY =3D \=0D -_("Pcd value can not be empty.")=0D -ERR_DECPARSE_PCD_BOOL =3D \=0D -_("Invalid value [%s] of type [%s]; must be expression, TRUE, FALSE, 0 or = 1.")=0D -ERR_DECPARSE_PCD_INT =3D _("Incorrect value [%s] of type [%= s]."\=0D -" Value must be a hexadecimal, decimal or octal in C language format.")=0D -ERR_DECPARSE_PCD_INT_NEGTIVE =3D _("Incorrect value [%s] of type [%= s];"=0D - " must not be signed number.")=0D -ERR_DECPARSE_PCD_INT_EXCEED =3D _("Incorrect value [%s] of type [%= s]; "=0D - "the number is too long for this type.= ")=0D -ERR_DECPARSE_PCD_FEATUREFLAG =3D \=0D -_("PcdFeatureFlag only allow BOOLEAN type.")=0D -ERR_DECPARSE_PCD_TOKEN =3D \=0D -_("An incorrect PCD token found: [%s]. "=0D - "It must start with 0x followed by 1 - 8 hexadecimal. ")=0D -ERR_DECPARSE_PCD_TOKEN_INT =3D _("Incorrect token number [%s]. "= =0D - "This token number exceeds the maximal value of unsigned 32.")=0D -ERR_DECPARSE_PCD_TOKEN_UNIQUE =3D _("Token number must be unique to = the token space: %s.")=0D -ERR_DECPARSE_CGUID =3D \=0D -_("No GUID name or value specified, must be =3D .")=0D -ERR_DECPARSE_CGUID_NAME =3D \=0D -_("No GUID name specified, must be =3D .")=0D -ERR_DECPARSE_CGUID_GUID =3D \=0D -_("No GUID value specified, must be =3D .")=0D -ERR_DECPARSE_CGUID_GUIDFORMAT =3D \=0D -_("Incorrect GUID value format, must be .")=0D -ERR_DECPARSE_CGUID_NOT_FOUND =3D _("Unable to find the GUID value of this = GUID CName : '%s'.")=0D -ERR_DECPARSE_FILEOPEN =3D _("Unable to open: [%s].")=0D -ERR_DECPARSE_SECTION_EMPTY =3D _("Empty sections are not allowed.= ")=0D -ERR_DECPARSE_SECTION_UE =3D _("Incorrect UserExtensions format= . "=0D +ERR_DECPARSE_STATEMENT_EMPTY =3D \=0D + _('Must have at least one statement in section %s.')=0D +ERR_DECPARSE_DEFINE_DEFINED =3D \=0D + _('%s already defined in define section.')=0D +ERR_DECPARSE_DEFINE_SECNAME =3D \=0D + _('No arch and others can be followed for define section.')=0D +ERR_DECPARSE_DEFINE_MULTISEC =3D \=0D + _('The DEC file does not allow multiple define sections.')=0D +ERR_DECPARSE_DEFINE_REQUIRED =3D \=0D + _("Field [%s] is required in define section.")=0D +ERR_DECPARSE_DEFINE_FORMAT =3D \=0D + _("Wrong define section format, must be KEY =3D Value.")=0D +ERR_DECPARSE_DEFINE_UNKNOWKEY =3D \=0D + _("Unknown key [%s] in define section.")=0D +ERR_DECPARSE_DEFINE_SPEC =3D \=0D + _("Specification value must be HEX numbers or decimal numbers.")=0D +ERR_DECPARSE_DEFINE_PKGNAME =3D \=0D + _("Package name must be AlphaNumeric characters.")=0D +ERR_DECPARSE_DEFINE_PKGGUID =3D \=0D + _("GUID format error, must be HEX value with form 8-4-4-4-12.")=0D +ERR_DECPARSE_DEFINE_PKGVERSION =3D \=0D + _("Version number must be decimal number.")=0D +ERR_DECPARSE_DEFINE_PKGVUNI =3D \=0D + _("UNI file name format error or file does not exist.")=0D +ERR_DECPARSE_INCLUDE =3D \=0D + _("Incorrect path: [%s].")=0D +ERR_DECPARSE_LIBCLASS_SPLIT =3D \=0D + _("Library class format error, must be Libraryclass|Headerpath.")=0D +ERR_DECPARSE_LIBCLASS_EMPTY =3D \=0D + _("Class name or file name must not be empty.")=0D +ERR_DECPARSE_LIBCLASS_LIB =3D \=0D + _("Class name format error, must start with upper case letter followed= with "=0D + "zero or more alphanumeric characters.")=0D +ERR_DECPARSE_LIBCLASS_PATH_EXT =3D _("File name must be end with .h.")=0D +ERR_DECPARSE_LIBCLASS_PATH_DOT =3D _("Path must not include '..'.")=0D +ERR_DECPARSE_LIBCLASS_PATH_EXIST =3D _("File name [%s] does not exist.")=0D +ERR_DECPARSE_PCD_CVAR_GUID =3D \=0D + _("TokenSpaceGuidCName must be valid C variable format.")=0D +ERR_DECPARSE_PCD_SPLIT =3D \=0D + _("Incorrect PcdName. The format must be TokenSpaceGuidCName.PcdCName"= =0D + "|PcdData|PcdType|Token.")=0D +ERR_DECPARSE_PCD_NAME =3D \=0D + _("Incorrect PCD name. The correct format must be "=0D + "..")=0D +ERR_DECPARSE_PCD_CVAR_PCDCNAME =3D \=0D + _("PcdCName must be valid C variable format.")=0D +ERR_DECPARSE_PCD_TYPE =3D \=0D + _('Incorrect PCD data type. A PCD data type must be one of '=0D + '"UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLEAN".')=0D +ERR_DECPARSE_PCD_VOID =3D \=0D + _("Incorrect value [%s] of type [%s]. Value must be printable and i= n the "=0D + "form of{...} for array, or ""..."" for string, or L""..."""=0D + "for unicode string.")=0D +ERR_DECPARSE_PCD_VALUE_EMPTY =3D \=0D + _("Pcd value can not be empty.")=0D +ERR_DECPARSE_PCD_BOOL =3D \=0D + _("Invalid value [%s] of type [%s]; must be expression, TRUE, FALSE, 0= or 1.")=0D +ERR_DECPARSE_PCD_INT =3D _("Incorrect value [%s] of type [%s]."=0D + " Value must be a hexadecimal, decimal or octal i= n C language format.")=0D +ERR_DECPARSE_PCD_INT_NEGTIVE =3D _("Incorrect value [%s] of type [%s];"=0D + " must not be signed number.")=0D +ERR_DECPARSE_PCD_INT_EXCEED =3D _("Incorrect value [%s] of type [%s]; "=0D + "the number is too long for this type.")=0D +ERR_DECPARSE_PCD_FEATUREFLAG =3D \=0D + _("PcdFeatureFlag only allow BOOLEAN type.")=0D +ERR_DECPARSE_PCD_TOKEN =3D \=0D + _("An incorrect PCD token found: [%s]. "=0D + "It must start with 0x followed by 1 - 8 hexadecimal. ")=0D +ERR_DECPARSE_PCD_TOKEN_INT =3D _("Incorrect token number [%s]. "=0D + "This token number exceeds the maximal valu= e of unsigned 32.")=0D +ERR_DECPARSE_PCD_TOKEN_UNIQUE =3D _(=0D + "Token number must be unique to the token space: %s.")=0D +ERR_DECPARSE_CGUID =3D \=0D + _("No GUID name or value specified, must be =3D .")=0D +ERR_DECPARSE_CGUID_NAME =3D \=0D + _("No GUID name specified, must be =3D .")= =0D +ERR_DECPARSE_CGUID_GUID =3D \=0D + _("No GUID value specified, must be =3D ."= )=0D +ERR_DECPARSE_CGUID_GUIDFORMAT =3D \=0D + _("Incorrect GUID value format, must be .")=0D +ERR_DECPARSE_CGUID_NOT_FOUND =3D _(=0D + "Unable to find the GUID value of this GUID CName : '%s'.")=0D +ERR_DECPARSE_FILEOPEN =3D _("Unable to open: [%s].")=0D +ERR_DECPARSE_SECTION_EMPTY =3D _("Empty sections are not allowed.")=0D +ERR_DECPARSE_SECTION_UE =3D _("Incorrect UserExtensions format. "=0D "Must be UserExtenxions.UserId.IdString[.Arch]= +.")=0D -ERR_DECPARSE_SECTION_UE_USERID =3D _("Invalid UserId, must be undersc= ore"=0D - "or alphanumeric characters.")=0D -ERR_DECPARSE_SECTION_UE_IDSTRING =3D \=0D +ERR_DECPARSE_SECTION_UE_USERID =3D _("Invalid UserId, must be underscore"= =0D + "or alphanumeric characters.")=0D +ERR_DECPARSE_SECTION_UE_IDSTRING =3D \=0D _("Incorrect IdString, must be \" ... \".")=0D -ERR_DECPARSE_ARCH =3D \=0D -_("Unknown arch, must be 'common' or start with upper case letter followed= by"=0D - " zero or more upper case letters and numbers.= ")=0D -ERR_DECPARSE_SECTION_COMMA =3D _("Section cannot end with comma."= )=0D -ERR_DECPARSE_SECTION_COMMON =3D \=0D -_("'COMMON' must not be used with specific ARCHs in the same section.")=0D -ERR_DECPARSE_SECTION_IDENTIFY =3D \=0D -_("Section header must start with and end with brackets[].")=0D -ERR_DECPARSE_SECTION_SUBEMPTY =3D \=0D -_("Missing a sub-section name in section: [%s]. "=0D - "All sub-sections need to have names. ")=0D -ERR_DECPARSE_SECTION_SUBTOOMANY =3D _("Too many DOT splits in [%s].")= =0D -ERR_DECPARSE_SECTION_UNKNOW =3D _("Section name [%s] unknown.")=0D -ERR_DECPARSE_SECTION_FEATUREFLAG =3D \=0D -_("[%s] must not be in the same section as other types of PCD.")=0D -ERR_DECPARSE_MACRO_PAIR =3D _("No macro name/value given.")=0D -ERR_DECPARSE_MACRO_NAME =3D _("No macro name given.")=0D -ERR_DECPARSE_MACRO_NAME_UPPER =3D \=0D -_("Macro name must start with upper case letter followed "=0D -"by zero or more upper case letters or numbers. Current macro name is: [%= s].")=0D -ERR_DECPARSE_SECTION_NAME =3D \=0D -_('Cannot mix different section names %s.')=0D -ERR_DECPARSE_BACKSLASH =3D \=0D -_('Backslash must be the last character on a line and '=0D - 'preceded by a space character.')= =0D -ERR_DECPARSE_BACKSLASH_EMPTY =3D \=0D -_('Empty line after previous line that has backslash is not allowed.')=0D -ERR_DECPARSE_REDEFINE =3D _(=0D +ERR_DECPARSE_ARCH =3D \=0D + _("Unknown arch, must be 'common' or start with upper case letter foll= owed by"=0D + " zero or more upper case letters and numbers.")=0D +ERR_DECPARSE_SECTION_COMMA =3D _("Section cannot end with comma.")=0D +ERR_DECPARSE_SECTION_COMMON =3D \=0D + _("'COMMON' must not be used with specific ARCHs in the same section."= )=0D +ERR_DECPARSE_SECTION_IDENTIFY =3D \=0D + _("Section header must start with and end with brackets[].")=0D +ERR_DECPARSE_SECTION_SUBEMPTY =3D \=0D + _("Missing a sub-section name in section: [%s]. "=0D + "All sub-sections need to have names. ")=0D +ERR_DECPARSE_SECTION_SUBTOOMANY =3D _("Too many DOT splits in [%s].")=0D +ERR_DECPARSE_SECTION_UNKNOW =3D _("Section name [%s] unknown.")=0D +ERR_DECPARSE_SECTION_FEATUREFLAG =3D \=0D + _("[%s] must not be in the same section as other types of PCD.")=0D +ERR_DECPARSE_MACRO_PAIR =3D _("No macro name/value given.")=0D +ERR_DECPARSE_MACRO_NAME =3D _("No macro name given.")=0D +ERR_DECPARSE_MACRO_NAME_UPPER =3D \=0D + _("Macro name must start with upper case letter followed "=0D + "by zero or more upper case letters or numbers. Current macro name = is: [%s].")=0D +ERR_DECPARSE_SECTION_NAME =3D \=0D + _('Cannot mix different section names %s.')=0D +ERR_DECPARSE_BACKSLASH =3D \=0D + _('Backslash must be the last character on a line and '=0D + 'preceded by a space character.')=0D +ERR_DECPARSE_BACKSLASH_EMPTY =3D \=0D + _('Empty line after previous line that has backslash is not allowed.')= =0D +ERR_DECPARSE_REDEFINE =3D _(=0D "\"%s\" already defined in line %d.")=0D -ERR_DECPARSE_MACRO_RESOLVE =3D _("Macro %s in %s cannot be resolv= ed.")=0D -ERR_DECPARSE_UE_DUPLICATE =3D \=0D +ERR_DECPARSE_MACRO_RESOLVE =3D _("Macro %s in %s cannot be resolved.")=0D +ERR_DECPARSE_UE_DUPLICATE =3D \=0D _("Duplicated UserExtensions header found.")=0D ERR_DECPARSE_PCDERRORMSG_MISS_VALUE_SPLIT =3D \=0D _("Missing '|' between Pcd's error code and Pcd's error message.")=0D @@ -763,36 +794,38 @@ ERR_DECPARSE_PCD_MISS_ERRORMSG =3D \ _("Missing Pcd's error message.")=0D ERR_DECPARSE_PCD_UNMATCHED_ERRORCODE =3D \=0D _("There is no error message matched with this Pcd error code : %s in = both DEC and UNI file.")=0D -ERR_DECPARSE_PCD_NODEFINED =3D _("The PCD : %s used in the Expression is u= ndefined.")=0D +ERR_DECPARSE_PCD_NODEFINED =3D _(=0D + "The PCD : %s used in the Expression is undefined.")=0D #=0D # Used to print the current line content which cause error raise.=0D # Be attached to the end of every error message above.=0D #=0D -ERR_DECPARSE_LINE =3D _(" Parsing line: \"%s\".")=0D +ERR_DECPARSE_LINE =3D _(" Parsing line: \"%s\".")=0D =0D #=0D # Warning related strings.=0D #=0D -WRN_PACKAGE_EXISTED =3D _(=0D +WRN_PACKAGE_EXISTED =3D _(=0D "A package with this GUID and Version already exists: "=0D "GUID %s, Version %s.")=0D -WRN_MODULE_EXISTED =3D _("This module already exists: %s")=0D -WRN_FILE_EXISTED =3D _("This file already exists: %s")=0D -WRN_FILE_NOT_OVERWRITTEN =3D \=0D -_("This file already exist and cannot be overwritten: %s")=0D -WRN_DIST_PKG_INSTALLED =3D _("This distribution package %s has previously = been installed.")=0D -WRN_DIST_NOT_FOUND =3D _(=0D +WRN_MODULE_EXISTED =3D _("This module already exists: %s")=0D +WRN_FILE_EXISTED =3D _("This file already exists: %s")=0D +WRN_FILE_NOT_OVERWRITTEN =3D \=0D + _("This file already exist and cannot be overwritten: %s")=0D +WRN_DIST_PKG_INSTALLED =3D _(=0D + "This distribution package %s has previously been installed.")=0D +WRN_DIST_NOT_FOUND =3D _(=0D "Distribution is not found at location %s")=0D -WRN_MULTI_PCD_RANGES =3D _(=0D +WRN_MULTI_PCD_RANGES =3D _(=0D "A PCD can only have one type of @ValidRange, @ValidList, and @Express= ion comment")=0D -WRN_MULTI_PCD_VALIDVALUE =3D _(=0D +WRN_MULTI_PCD_VALIDVALUE =3D _(=0D "A PCD can only have one of @ValidList comment")=0D -WRN_MULTI_PCD_PROMPT =3D _(=0D +WRN_MULTI_PCD_PROMPT =3D _(=0D "A PCD can only have one of @Prompt comment")=0D -WRN_MISSING_USAGE =3D _("Missing usage")=0D -WRN_INVALID_GUID_TYPE =3D _("This is and incorrect Guid type: %= s")=0D -WRN_MISSING_GUID_TYPE =3D _("Missing Guid Type")=0D -WRN_INVALID_USAGE =3D _("This is an incorrect Usage: %s")=0D +WRN_MISSING_USAGE =3D _("Missing usage")=0D +WRN_INVALID_GUID_TYPE =3D _("This is and incorrect Guid type: %s")=0D +WRN_MISSING_GUID_TYPE =3D _("Missing Guid Type")=0D +WRN_INVALID_USAGE =3D _("This is an incorrect Usage: %s")=0D WRN_INF_PARSER_MODULE_INVALID_HOB_TYPE =3D \=0D _("This is an incorrect HOB type: %s")=0D WRN_INF_PARSER_MODULE_INVALID_EVENT_TYPE =3D \=0D @@ -817,37 +850,37 @@ WARN_CUSTOMPATH_OVERRIDE_USEGUIDEDPATH =3D \ #=0D # Help related strings.=0D #=0D -HLP_PRINT_DEBUG_INFO =3D _(=0D +HLP_PRINT_DEBUG_INFO =3D _(=0D "Print DEBUG statements, where DEBUG_LEVEL is 0-9")=0D HLP_PRINT_INFORMATIONAL_STATEMENT =3D _("Print informational statements")= =0D -HLP_RETURN_NO_DISPLAY =3D _(=0D +HLP_RETURN_NO_DISPLAY =3D _(=0D "Returns only the exit code, informational and error messages are"=0D " not displayed")=0D -HLP_RETURN_AND_DISPLAY =3D _(=0D +HLP_RETURN_AND_DISPLAY =3D _(=0D "Returns the exit code and displays error messages only")=0D HLP_SPECIFY_PACKAGE_NAME_INSTALL =3D _(=0D "Specify the UEFI Distribution Package filename to install")=0D -HLP_SPECIFY_PACKAGE_NAME_CREATE =3D _(=0D +HLP_SPECIFY_PACKAGE_NAME_CREATE =3D _(=0D "Specify the UEFI Distribution Package filename to create")=0D -HLP_SPECIFY_PACKAGE_NAME_REMOVE =3D _(=0D +HLP_SPECIFY_PACKAGE_NAME_REMOVE =3D _(=0D "Specify the UEFI Distribution Package filename to remove")=0D HLP_SPECIFY_TEMPLATE_NAME_CREATE =3D _(=0D "Specify Package Information Data filename to create package")=0D -HLP_SPECIFY_DEC_NAME_CREATE =3D _(=0D +HLP_SPECIFY_DEC_NAME_CREATE =3D _(=0D "Specify dec file names to create package")=0D -HLP_SPECIFY_INF_NAME_CREATE =3D _(=0D +HLP_SPECIFY_INF_NAME_CREATE =3D _(=0D "Specify inf file names to create package")=0D -HLP_LIST_DIST_INSTALLED =3D _(=0D +HLP_LIST_DIST_INSTALLED =3D _(=0D "List the UEFI Distribution Packages that have been installed")=0D -HLP_NO_SUPPORT_GUI =3D _(=0D +HLP_NO_SUPPORT_GUI =3D _(=0D "Starting the tool in graphical mode is not supported in this version"= )=0D -HLP_DISABLE_PROMPT =3D _(=0D +HLP_DISABLE_PROMPT =3D _(=0D "Disable user prompts for removing modified files. Valid only when -r = is present")=0D -HLP_CUSTOM_PATH_PROMPT =3D _(=0D +HLP_CUSTOM_PATH_PROMPT =3D _(=0D "Enable user prompting for alternate installation directories")=0D -HLP_SKIP_LOCK_CHECK =3D _(=0D +HLP_SKIP_LOCK_CHECK =3D _(=0D "Skip the check for multiple instances")=0D -HLP_SPECIFY_PACKAGE_NAME_REPLACE =3D _(=0D +HLP_SPECIFY_PACKAGE_NAME_REPLACE =3D _(=0D "Specify the UEFI Distribution Package file name to replace the existi= ng file name")=0D HLP_SPECIFY_PACKAGE_NAME_TO_BE_REPLACED =3D _(=0D "Specify the UEFI Distribution Package file name to be replaced")=0D @@ -856,5 +889,7 @@ HLP_USE_GUIDED_PATHS =3D _( HLP_TEST_INSTALL =3D _(=0D "Specify the UEFI Distribution Package filenames to install")=0D =0D -MSG_TEST_INSTALL_PASS =3D _("All distribution package file are satisfied f= or dependence check.")=0D -MSG_TEST_INSTALL_FAIL =3D _("NOT all distribution package file are satisfi= ed for dependence check.")=0D +MSG_TEST_INSTALL_PASS =3D _(=0D + "All distribution package file are satisfied for dependence check.")=0D +MSG_TEST_INSTALL_FAIL =3D _(=0D + "NOT all distribution package file are satisfied for dependence check.= ")=0D diff --git a/BaseTools/Source/Python/UPT/Logger/ToolError.py b/BaseTools/So= urce/Python/UPT/Logger/ToolError.py index 925982beb346..32a7fcfcb977 100644 --- a/BaseTools/Source/Python/UPT/Logger/ToolError.py +++ b/BaseTools/Source/Python/UPT/Logger/ToolError.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Standardized Error Handling infrastructures.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -94,78 +94,79 @@ UPT_MUL_DEC_ERROR =3D 0xD004 UPT_DB_UPDATE_ERROR =3D 0xD005=0D UPT_INI_PARSE_ERROR =3D 0xE000=0D =0D -## Error message of each error code=0D +# Error message of each error code=0D #=0D gERROR_MESSAGE =3D {=0D - FILE_NOT_FOUND : ST.ERR_FILE_NOT_FOUND,=0D - FILE_OPEN_FAILURE : ST.ERR_FILE_OPEN_FAILURE,=0D - FILE_WRITE_FAILURE : ST.ERR_FILE_WRITE_FAILURE,=0D - FILE_PARSE_FAILURE : ST.ERR_FILE_PARSE_FAILURE,=0D - FILE_READ_FAILURE : ST.ERR_FILE_READ_FAILURE,=0D - FILE_CREATE_FAILURE : ST.ERR_FILE_CREATE_FAILURE,=0D - FILE_CHECKSUM_FAILURE : ST.ERR_FILE_CHECKSUM_FAILURE,=0D - FILE_COMPRESS_FAILURE : ST.ERR_FILE_COMPRESS_FAILURE,=0D - FILE_DECOMPRESS_FAILURE : ST.ERR_FILE_DECOMPRESS_FAILURE,=0D - FILE_MOVE_FAILURE : ST.ERR_FILE_MOVE_FAILURE,=0D - FILE_DELETE_FAILURE : ST.ERR_FILE_DELETE_FAILURE,=0D - FILE_COPY_FAILURE : ST.ERR_FILE_COPY_FAILURE,=0D + FILE_NOT_FOUND: ST.ERR_FILE_NOT_FOUND,=0D + FILE_OPEN_FAILURE: ST.ERR_FILE_OPEN_FAILURE,=0D + FILE_WRITE_FAILURE: ST.ERR_FILE_WRITE_FAILURE,=0D + FILE_PARSE_FAILURE: ST.ERR_FILE_PARSE_FAILURE,=0D + FILE_READ_FAILURE: ST.ERR_FILE_READ_FAILURE,=0D + FILE_CREATE_FAILURE: ST.ERR_FILE_CREATE_FAILURE,=0D + FILE_CHECKSUM_FAILURE: ST.ERR_FILE_CHECKSUM_FAILURE,=0D + FILE_COMPRESS_FAILURE: ST.ERR_FILE_COMPRESS_FAILURE,=0D + FILE_DECOMPRESS_FAILURE: ST.ERR_FILE_DECOMPRESS_FAILURE,=0D + FILE_MOVE_FAILURE: ST.ERR_FILE_MOVE_FAILURE,=0D + FILE_DELETE_FAILURE: ST.ERR_FILE_DELETE_FAILURE,=0D + FILE_COPY_FAILURE: ST.ERR_FILE_COPY_FAILURE,=0D FILE_POSITIONING_FAILURE: ST.ERR_FILE_POSITIONING_FAILURE,=0D - FILE_ALREADY_EXIST : ST.ERR_FILE_ALREADY_EXIST,=0D - FILE_TYPE_MISMATCH : ST.ERR_FILE_TYPE_MISMATCH ,=0D - FILE_CASE_MISMATCH : ST.ERR_FILE_CASE_MISMATCH,=0D - FILE_DUPLICATED : ST.ERR_FILE_DUPLICATED,=0D - FILE_UNKNOWN_ERROR : ST.ERR_FILE_UNKNOWN_ERROR,=0D + FILE_ALREADY_EXIST: ST.ERR_FILE_ALREADY_EXIST,=0D + FILE_TYPE_MISMATCH: ST.ERR_FILE_TYPE_MISMATCH,=0D + FILE_CASE_MISMATCH: ST.ERR_FILE_CASE_MISMATCH,=0D + FILE_DUPLICATED: ST.ERR_FILE_DUPLICATED,=0D + FILE_UNKNOWN_ERROR: ST.ERR_FILE_UNKNOWN_ERROR,=0D =0D - OPTION_UNKNOWN : ST.ERR_OPTION_UNKNOWN,=0D - OPTION_MISSING : ST.ERR_OPTION_MISSING,=0D - OPTION_CONFLICT : ST.ERR_OPTION_CONFLICT,=0D - OPTION_VALUE_INVALID : ST.ERR_OPTION_VALUE_INVALID,=0D - OPTION_DEPRECATED : ST.ERR_OPTION_DEPRECATED,=0D - OPTION_NOT_SUPPORTED : ST.ERR_OPTION_NOT_SUPPORTED,=0D - OPTION_UNKNOWN_ERROR : ST.ERR_OPTION_UNKNOWN_ERROR,=0D + OPTION_UNKNOWN: ST.ERR_OPTION_UNKNOWN,=0D + OPTION_MISSING: ST.ERR_OPTION_MISSING,=0D + OPTION_CONFLICT: ST.ERR_OPTION_CONFLICT,=0D + OPTION_VALUE_INVALID: ST.ERR_OPTION_VALUE_INVALID,=0D + OPTION_DEPRECATED: ST.ERR_OPTION_DEPRECATED,=0D + OPTION_NOT_SUPPORTED: ST.ERR_OPTION_NOT_SUPPORTED,=0D + OPTION_UNKNOWN_ERROR: ST.ERR_OPTION_UNKNOWN_ERROR,=0D =0D - PARAMETER_INVALID : ST.ERR_PARAMETER_INVALID,=0D - PARAMETER_MISSING : ST.ERR_PARAMETER_MISSING,=0D - PARAMETER_UNKNOWN_ERROR : ST.ERR_PARAMETER_UNKNOWN_ERROR,=0D + PARAMETER_INVALID: ST.ERR_PARAMETER_INVALID,=0D + PARAMETER_MISSING: ST.ERR_PARAMETER_MISSING,=0D + PARAMETER_UNKNOWN_ERROR: ST.ERR_PARAMETER_UNKNOWN_ERROR,=0D =0D - FORMAT_INVALID : ST.ERR_FORMAT_INVALID,=0D - FORMAT_NOT_SUPPORTED : ST.ERR_FORMAT_NOT_SUPPORTED,=0D - FORMAT_UNKNOWN : ST.ERR_FORMAT_UNKNOWN,=0D - FORMAT_UNKNOWN_ERROR : ST.ERR_FORMAT_UNKNOWN_ERROR,=0D + FORMAT_INVALID: ST.ERR_FORMAT_INVALID,=0D + FORMAT_NOT_SUPPORTED: ST.ERR_FORMAT_NOT_SUPPORTED,=0D + FORMAT_UNKNOWN: ST.ERR_FORMAT_UNKNOWN,=0D + FORMAT_UNKNOWN_ERROR: ST.ERR_FORMAT_UNKNOWN_ERROR,=0D =0D - RESOURCE_NOT_AVAILABLE : ST.ERR_RESOURCE_NOT_AVAILABLE,=0D - RESOURCE_ALLOCATE_FAILURE : ST.ERR_RESOURCE_ALLOCATE_FAILURE,=0D - RESOURCE_FULL : ST.ERR_RESOURCE_FULL,=0D - RESOURCE_OVERFLOW : ST.ERR_RESOURCE_OVERFLOW,=0D - RESOURCE_UNDERRUN : ST.ERR_RESOURCE_UNDERRUN,=0D - RESOURCE_UNKNOWN_ERROR : ST.ERR_RESOURCE_UNKNOWN_ERROR,=0D + RESOURCE_NOT_AVAILABLE: ST.ERR_RESOURCE_NOT_AVAILABLE,=0D + RESOURCE_ALLOCATE_FAILURE: ST.ERR_RESOURCE_ALLOCATE_FAILURE,=0D + RESOURCE_FULL: ST.ERR_RESOURCE_FULL,=0D + RESOURCE_OVERFLOW: ST.ERR_RESOURCE_OVERFLOW,=0D + RESOURCE_UNDERRUN: ST.ERR_RESOURCE_UNDERRUN,=0D + RESOURCE_UNKNOWN_ERROR: ST.ERR_RESOURCE_UNKNOWN_ERROR,=0D =0D - ATTRIBUTE_NOT_AVAILABLE : ST.ERR_ATTRIBUTE_NOT_AVAILABLE,=0D - ATTRIBUTE_RETRIEVE_FAILURE : ST.ERR_ATTRIBUTE_RETRIEVE_FAILURE,=0D - ATTRIBUTE_SET_FAILURE : ST.ERR_ATTRIBUTE_SET_FAILURE,=0D + ATTRIBUTE_NOT_AVAILABLE: ST.ERR_ATTRIBUTE_NOT_AVAILABLE,=0D + ATTRIBUTE_RETRIEVE_FAILURE: ST.ERR_ATTRIBUTE_RETRIEVE_FAILURE,=0D + ATTRIBUTE_SET_FAILURE: ST.ERR_ATTRIBUTE_SET_FAILURE,=0D ATTRIBUTE_UPDATE_FAILURE: ST.ERR_ATTRIBUTE_UPDATE_FAILURE,=0D - ATTRIBUTE_ACCESS_DENIED : ST.ERR_ATTRIBUTE_ACCESS_DENIED,=0D - ATTRIBUTE_UNKNOWN_ERROR : ST.ERR_ATTRIBUTE_UNKNOWN_ERROR,=0D + ATTRIBUTE_ACCESS_DENIED: ST.ERR_ATTRIBUTE_ACCESS_DENIED,=0D + ATTRIBUTE_UNKNOWN_ERROR: ST.ERR_ATTRIBUTE_UNKNOWN_ERROR,=0D =0D - COMMAND_FAILURE : ST.ERR_COMMAND_FAILURE,=0D + COMMAND_FAILURE: ST.ERR_COMMAND_FAILURE,=0D =0D - IO_NOT_READY : ST.ERR_IO_NOT_READY,=0D - IO_BUSY : ST.ERR_IO_BUSY,=0D - IO_TIMEOUT : ST.ERR_IO_TIMEOUT,=0D - IO_UNKNOWN_ERROR : ST.ERR_IO_UNKNOWN_ERROR,=0D + IO_NOT_READY: ST.ERR_IO_NOT_READY,=0D + IO_BUSY: ST.ERR_IO_BUSY,=0D + IO_TIMEOUT: ST.ERR_IO_TIMEOUT,=0D + IO_UNKNOWN_ERROR: ST.ERR_IO_UNKNOWN_ERROR,=0D =0D - UNKNOWN_ERROR : ST.ERR_UNKNOWN_ERROR,=0D + UNKNOWN_ERROR: ST.ERR_UNKNOWN_ERROR,=0D =0D - UPT_ALREADY_INSTALLED_ERROR : ST.ERR_UPT_ALREADY_INSTALLED_ERROR,=0D - UPT_ENVIRON_MISSING_ERROR : ST.ERR_UPT_ENVIRON_MISSING_ERROR,=0D - UPT_REPKG_ERROR : ST.ERR_UPT_REPKG_ERROR,=0D - UPT_ALREADY_RUNNING_ERROR : ST.ERR_UPT_ALREADY_RUNNING_ERROR,=0D - UPT_MUL_DEC_ERROR : ST.ERR_MUL_DEC_ERROR,=0D - UPT_INI_PARSE_ERROR : ST.ERR_UPT_INI_PARSE_ERROR,=0D + UPT_ALREADY_INSTALLED_ERROR: ST.ERR_UPT_ALREADY_INSTALLED_ERROR,=0D + UPT_ENVIRON_MISSING_ERROR: ST.ERR_UPT_ENVIRON_MISSING_ERROR,=0D + UPT_REPKG_ERROR: ST.ERR_UPT_REPKG_ERROR,=0D + UPT_ALREADY_RUNNING_ERROR: ST.ERR_UPT_ALREADY_RUNNING_ERROR,=0D + UPT_MUL_DEC_ERROR: ST.ERR_MUL_DEC_ERROR,=0D + UPT_INI_PARSE_ERROR: ST.ERR_UPT_INI_PARSE_ERROR,=0D }=0D =0D -## Exception indicating a fatal error=0D +# Exception indicating a fatal error=0D #=0D +=0D +=0D class FatalError(Exception):=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Logger/__init__.py b/BaseTools/Sou= rce/Python/UPT/Logger/__init__.py index e53198451794..cee19ef24060 100644 --- a/BaseTools/Source/Python/UPT/Logger/__init__.py +++ b/BaseTools/Source/Python/UPT/Logger/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Logger' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/MkPkg.py b/BaseTools/Source/Python= /UPT/MkPkg.py index c6d4731ed655..e7912b44c6a1 100644 --- a/BaseTools/Source/Python/UPT/MkPkg.py +++ b/BaseTools/Source/Python/UPT/MkPkg.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Install distribution package.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -46,27 +46,32 @@ from Core.DistributionPackageClass import DistributionP= ackageClass from Core.PackageFile import PackageFile=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## CheckForExistingDp=0D +# CheckForExistingDp=0D #=0D # Check if there is a same name DP file existing=0D # @param Path: The path to be checked=0D #=0D +=0D +=0D def CheckForExistingDp(Path):=0D if os.path.exists(Path):=0D Logger.Info(ST.MSG_DISTRIBUTION_PACKAGE_FILE_EXISTS % Path)=0D Input =3D stdin.readline()=0D Input =3D Input.replace('\r', '').replace('\n', '')=0D if Input.upper() !=3D "Y":=0D - Logger.Error("\nMkPkg", ABORT_ERROR, ST.ERR_USER_ABORT, RaiseE= rror=3DTrue)=0D + Logger.Error("\nMkPkg", ABORT_ERROR,=0D + ST.ERR_USER_ABORT, RaiseError=3DTrue)=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D # if it's executed successfully or not.=0D #=0D #=0D -def Main(Options =3D None):=0D +=0D +=0D +def Main(Options=3DNone):=0D if Options is None:=0D Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NOT_FO= UND)=0D try:=0D @@ -78,7 +83,8 @@ def Main(Options =3D None): # Init PackFileToCreate=0D #=0D if not Options.PackFileToCreate:=0D - Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR, ST.ERR_OPTION_NO= T_FOUND)=0D + Logger.Error("\nMkPkg", OPTION_UNKNOWN_ERROR,=0D + ST.ERR_OPTION_NOT_FOUND)=0D =0D #=0D # Handle if the distribution package file already exists=0D @@ -88,11 +94,13 @@ def Main(Options =3D None): #=0D # Check package file existing and valid=0D #=0D - CheckFileList('.DEC', Options.PackageFileList, ST.ERR_INVALID_PACK= AGE_NAME, ST.ERR_INVALID_PACKAGE_PATH)=0D + CheckFileList('.DEC', Options.PackageFileList,=0D + ST.ERR_INVALID_PACKAGE_NAME, ST.ERR_INVALID_PACKAGE_= PATH)=0D #=0D # Check module file existing and valid=0D #=0D - CheckFileList('.INF', Options.ModuleFileList, ST.ERR_INVALID_MODUL= E_NAME, ST.ERR_INVALID_MODULE_PATH)=0D + CheckFileList('.INF', Options.ModuleFileList,=0D + ST.ERR_INVALID_MODULE_NAME, ST.ERR_INVALID_MODULE_PA= TH)=0D =0D #=0D # Get list of files that installed with RePackage attribute availa= ble=0D @@ -130,15 +138,17 @@ def Main(Options =3D None): # strings in your desired encoding before passing them to= =0D # write().=0D #=0D - FromFile =3D os.path.normpath(FileObject.GetURI()).encode(= 'utf_8')=0D + FromFile =3D os.path.normpath(=0D + FileObject.GetURI()).encode('utf_8')=0D FileFullPath =3D mws.join(WorkspaceDir, FromFile)=0D if FileFullPath in RePkgDict:=0D - (DpGuid, DpVersion, DpName, Repackage) =3D RePkgDict[F= ileFullPath]=0D + (DpGuid, DpVersion, DpName,=0D + Repackage) =3D RePkgDict[FileFullPath]=0D if not Repackage:=0D Logger.Error("\nMkPkg",=0D UPT_REPKG_ERROR,=0D ST.ERR_UPT_REPKG_ERROR,=0D - ExtraData=3DST.MSG_REPKG_CONFLICT %\= =0D + ExtraData=3DST.MSG_REPKG_CONFLICT %=0D (FileFullPath, DpGuid, DpVersion, DpN= ame)=0D )=0D else:=0D @@ -155,7 +165,7 @@ def Main(Options =3D None): DistPkg.Header.Guid =3D str(uuid4())=0D DistPkg.Header.Version =3D '1.0'=0D =0D - DistPkg.GetDistributionPackage(WorkspaceDir, Options.PackageFileLi= st, \=0D + DistPkg.GetDistributionPackage(WorkspaceDir, Options.PackageFileLi= st,=0D Options.ModuleFileList)=0D FileList, MetaDataFileList =3D DistPkg.GetDistributionFileList()=0D for File in FileList + MetaDataFileList:=0D @@ -165,14 +175,14 @@ def Main(Options =3D None): # be repackaged=0D #=0D if FileFullPath in RePkgDict:=0D - (DpGuid, DpVersion, DpName, Repackage) =3D RePkgDict[FileF= ullPath]=0D + (DpGuid, DpVersion, DpName,=0D + Repackage) =3D RePkgDict[FileFullPath]=0D if not Repackage:=0D Logger.Error("\nMkPkg",=0D UPT_REPKG_ERROR,=0D ST.ERR_UPT_REPKG_ERROR,=0D - ExtraData =3D \=0D - ST.MSG_REPKG_CONFLICT %(FileFullPath, DpN= ame, \=0D - DpGuid, DpVersion= )=0D + ExtraData=3DST.MSG_REPKG_CONFLICT % (File= FullPath, DpName,=0D + DpGuid= , DpVersion)=0D )=0D else:=0D DistPkg.Header.RePackage =3D True=0D @@ -190,7 +200,8 @@ def Main(Options =3D None): #=0D # Add Md5Signature=0D #=0D - DistPkg.Header.Signature =3D md5(open(str(ContentFile), 'rb').read= ()).hexdigest()=0D + DistPkg.Header.Signature =3D md5(=0D + open(str(ContentFile), 'rb').read()).hexdigest()=0D #=0D # Add current Date=0D #=0D @@ -210,25 +221,25 @@ def Main(Options =3D None): except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % \=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D (python_version(), platform) + format_exc())=0D except KeyboardInterrupt:=0D ReturnCode =3D ABORT_ERROR=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % \=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D (python_version(), platform) + format_exc())=0D except OSError:=0D pass=0D except:=0D Logger.Error(=0D - "\nMkPkg",=0D - CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_CREATING_ERR % \=0D - Options.PackFileToCreate,=0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D - Logger.Quiet(ST.MSG_PYTHON_ON % \=0D + "\nMkPkg",=0D + CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_CREATING_ERR %=0D + Options.PackFileToCreate,=0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D (python_version(), platform) + format_exc())=0D ReturnCode =3D CODE_ERROR=0D finally:=0D @@ -240,7 +251,7 @@ def Main(Options =3D None): return ReturnCode=0D =0D =0D -## CheckFileList=0D +# CheckFileList=0D #=0D # @param QualifiedExt: QualifiedExt=0D # @param FileList: FileList=0D @@ -255,7 +266,7 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringEx= t, ErrorStringFullPath): for Item in FileList:=0D Ext =3D os.path.splitext(Item)[1]=0D if Ext.upper() !=3D QualifiedExt.upper():=0D - Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \=0D + Logger.Error("\nMkPkg", OPTION_VALUE_INVALID,=0D ErrorStringExt % Item)=0D =0D Item =3D os.path.normpath(Item)=0D @@ -266,9 +277,9 @@ def CheckFileList(QualifiedExt, FileList, ErrorStringEx= t, ErrorStringFullPath): Logger.Error("\nMkPkg", OPTION_VALUE_INVALID,=0D ErrorStringFullPath % Item)=0D elif not IsValidPath(Item, WorkspaceDir):=0D - Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \=0D + Logger.Error("\nMkPkg", OPTION_VALUE_INVALID,=0D ErrorStringExt % Item)=0D =0D if not os.path.split(Item)[0]:=0D - Logger.Error("\nMkPkg", OPTION_VALUE_INVALID, \=0D + Logger.Error("\nMkPkg", OPTION_VALUE_INVALID,=0D ST.ERR_INVALID_METAFILE_PATH % Item)=0D diff --git a/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py b/BaseT= ools/Source/Python/UPT/Object/POM/CommonObject.py index ae8fe8306dbd..061a3864df4f 100644 --- a/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py +++ b/BaseTools/Source/Python/UPT/Object/POM/CommonObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common items of class object=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,10 +10,12 @@ Common Object '''=0D from Library.DataType import TAB_LANGUAGE_EN_US=0D =0D -## HelpTextObject=0D +# HelpTextObject=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class HelpTextObject(object):=0D def __init__(self):=0D self.HelpText =3D TextObject()=0D @@ -24,10 +26,12 @@ class HelpTextObject(object): def GetHelpText(self):=0D return self.HelpText=0D =0D -## HelpTextListObject=0D +# HelpTextListObject=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class HelpTextListObject(object):=0D def __init__(self):=0D self.HelpTextList =3D []=0D @@ -38,10 +42,12 @@ class HelpTextListObject(object): def GetHelpTextList(self):=0D return self.HelpTextList=0D =0D -## PromptListObject=0D +# PromptListObject=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class PromptListObject(object):=0D def __init__(self):=0D self.PromptList =3D []=0D @@ -52,7 +58,7 @@ class PromptListObject(object): def GetPromptList(self):=0D return self.PromptList=0D =0D -## CommonPropertiesObject=0D +# CommonPropertiesObject=0D #=0D # This class defined common attribution used in Module/Platform/Package fi= les=0D #=0D @@ -63,6 +69,8 @@ class PromptListObject(object): # @param HelpText: Input value for HelpText, default is ''=0D # @param HelpTextList: Input value for HelpTextList, default is []=0D #=0D +=0D +=0D class CommonPropertiesObject(HelpTextObject, HelpTextListObject):=0D def __init__(self):=0D self.Usage =3D []=0D @@ -96,12 +104,14 @@ class CommonPropertiesObject(HelpTextObject, HelpTextL= istObject): def GetGuidValue(self):=0D return self.GuidValue=0D =0D -## CommonHeaderObject=0D +# CommonHeaderObject=0D #=0D # This class defined common header items used in Module/Platform/Package f= iles=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class CommonHeaderObject(object):=0D def __init__(self):=0D self.AbstractList =3D []=0D @@ -145,12 +155,14 @@ class CommonHeaderObject(object): def GetLicense(self):=0D return self.LicenseList=0D =0D -## BinaryHeaderObject=0D +# BinaryHeaderObject=0D #=0D # This class defined Binary header items used in Module/Platform/Package f= iles=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class BinaryHeaderObject(object):=0D def __init__(self):=0D self.BinaryHeaderAbstractList =3D []=0D @@ -194,12 +206,14 @@ class BinaryHeaderObject(object): def GetBinaryHeaderLicense(self):=0D return self.BinaryHeaderLicenseList=0D =0D -## ClonedRecordObject=0D +# ClonedRecordObject=0D #=0D # This class defined ClonedRecord items used in Module/Platform/Package fi= les=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class ClonedRecordObject(object):=0D def __init__(self):=0D self.IdNum =3D 0=0D @@ -245,12 +259,14 @@ class ClonedRecordObject(object): def GetModuleVersion(self):=0D return self.ModuleVersion=0D =0D -## TextObject=0D +# TextObject=0D #=0D # This class defined Text item used in PKG file=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class TextObject(object):=0D def __init__(self):=0D self.Lang =3D TAB_LANGUAGE_EN_US=0D @@ -268,12 +284,14 @@ class TextObject(object): def GetString(self):=0D return self.String=0D =0D -## FileNameObject=0D +# FileNameObject=0D #=0D # This class defined File item used in module, for binary files=0D #=0D # @param CommonPropertiesObject: Inherited from CommonPropertiesObject c= lass=0D #=0D +=0D +=0D class FileNameObject(CommonPropertiesObject):=0D def __init__(self):=0D self.FileType =3D ''=0D @@ -292,12 +310,14 @@ class FileNameObject(CommonPropertiesObject): def GetFilename(self):=0D return self.Filename=0D =0D -## FileObject=0D +# FileObject=0D #=0D # This class defined File item used in PKG file=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class FileObject(object):=0D def __init__(self):=0D self.Executable =3D ''=0D @@ -327,6 +347,8 @@ class FileObject(object): #=0D # @param CommonHeaderObject: Inherited from CommonHeaderObject class=0D #=0D +=0D +=0D class MiscFileObject(CommonHeaderObject):=0D def __init__(self):=0D self.Name =3D ''=0D @@ -348,15 +370,19 @@ class MiscFileObject(CommonHeaderObject): ##=0D # ToolsObject=0D #=0D +=0D +=0D class ToolsObject(MiscFileObject):=0D pass=0D =0D -## GuidVersionObject=0D +# GuidVersionObject=0D #=0D # This class defined GUID/Version items used in PKG file=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class GuidVersionObject(object):=0D def __init__(self):=0D self.Guid =3D ''=0D @@ -374,12 +400,14 @@ class GuidVersionObject(object): def GetVersion(self):=0D return self.Version=0D =0D -## IdentificationObject=0D +# IdentificationObject=0D #=0D # This class defined Identification items used in Module/Platform/Package = files=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class IdentificationObject(GuidVersionObject):=0D def __init__(self):=0D self.Name =3D ''=0D @@ -440,13 +468,15 @@ class IdentificationObject(GuidVersionObject): def GetCombinePath(self):=0D return self.CombinePath=0D =0D -## GuidProtocolPpiCommonObject=0D +# GuidProtocolPpiCommonObject=0D #=0D # This class defined Guid, Protocol and Ppi like items used in=0D # Module/Platform/Package files=0D #=0D # @param CommonPropertiesObject: Inherited from CommonPropertiesObject = class=0D #=0D +=0D +=0D class GuidProtocolPpiCommonObject(CommonPropertiesObject):=0D def __init__(self):=0D self.Name =3D ''=0D @@ -479,17 +509,20 @@ class GuidProtocolPpiCommonObject(CommonPropertiesObj= ect): def GetSupModuleList(self):=0D return self.SupModuleList=0D =0D -## GuidObject=0D +# GuidObject=0D #=0D # This class defined Guid item used in Module/Platform/Package files=0D #=0D # @param GuidProtocolPpiCommonObject: GuidProtocolPpiCommonObject=0D #=0D +=0D +=0D class GuidObject(GuidProtocolPpiCommonObject):=0D def __init__(self):=0D self.VariableName =3D ''=0D self.GuidTypeList =3D []=0D GuidProtocolPpiCommonObject.__init__(self)=0D +=0D def SetVariableName(self, VariableName):=0D self.VariableName =3D VariableName=0D =0D @@ -502,54 +535,64 @@ class GuidObject(GuidProtocolPpiCommonObject): def GetGuidTypeList(self):=0D return self.GuidTypeList=0D =0D -## ProtocolObject=0D +# ProtocolObject=0D #=0D # This class defined Protocol item used in Module/Platform/Package files=0D #=0D # @param GuidProtocolPpiCommonObject: Inherited from=0D # GuidProtocolPpiCommonObject=0D #=0D +=0D +=0D class ProtocolObject(GuidProtocolPpiCommonObject):=0D def __init__(self):=0D self.Notify =3D False=0D GuidProtocolPpiCommonObject.__init__(self)=0D +=0D def SetNotify(self, Notify):=0D self.Notify =3D Notify=0D =0D def GetNotify(self):=0D return self.Notify=0D =0D -## PpiObject=0D +# PpiObject=0D #=0D # This class defined Ppi item used in Module/Platform/Package files=0D #=0D # @param GuidProtocolPpiCommonObject: Inherited from=0D # GuidProtocolPpiCommonObject=0D #=0D +=0D +=0D class PpiObject(GuidProtocolPpiCommonObject):=0D def __init__(self):=0D self.Notify =3D False=0D GuidProtocolPpiCommonObject.__init__(self)=0D +=0D def SetNotify(self, Notify):=0D self.Notify =3D Notify=0D =0D def GetNotify(self):=0D return self.Notify=0D =0D -## DefineObject=0D +# DefineObject=0D #=0D # This class defined item DEFINE used in Module/Platform/Package files=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class DefineClass(object):=0D def __init__(self):=0D self.Define =3D {}=0D =0D -## UserExtensionObject=0D +# UserExtensionObject=0D #=0D # @param object: Inherited from object class=0D #=0D +=0D +=0D class UserExtensionObject(object):=0D def __init__(self):=0D self.UserID =3D ''=0D @@ -684,12 +727,14 @@ class UserExtensionObject(object): def GetBinariesDict(self):=0D return self.BinariesDict=0D =0D -## LibraryClassObject=0D +# LibraryClassObject=0D #=0D # This class defined Library item used in Module/Platform/Package files=0D #=0D # @param CommonPropertiesObject: Inherited from CommonPropertiesObject cl= ass=0D #=0D +=0D +=0D class LibraryClassObject(CommonPropertiesObject):=0D def __init__(self):=0D self.LibraryClass =3D ''=0D @@ -723,7 +768,7 @@ class LibraryClassObject(CommonPropertiesObject): return self.RecommendedInstance=0D =0D =0D -## PcdErrorObject=0D +# PcdErrorObject=0D #=0D # @param object: Inherited from object class=0D #=0D @@ -801,7 +846,7 @@ class PcdErrorObject(object): return self.LineNum=0D =0D =0D -## IncludeObject=0D +# IncludeObject=0D #=0D # This class defined Include item used in Module/Platform/Package files=0D #=0D @@ -839,7 +884,7 @@ class IncludeObject(CommonPropertiesObject): def GetComment(self):=0D return self.Comment=0D =0D -## PcdObject=0D +# PcdObject=0D #=0D # This class defined Pcd item used in Module/Platform/Package files=0D #=0D @@ -855,6 +900,8 @@ class IncludeObject(CommonPropertiesObject): # @param SkuInfoList: Input value for SkuInfoList, default is {}= =0D # @param SupModuleList: Input value for SupModuleList, default is [= ]=0D #=0D +=0D +=0D class PcdObject(CommonPropertiesObject, HelpTextListObject, PromptListObje= ct):=0D def __init__(self):=0D self.PcdCName =3D ''=0D diff --git a/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py b/BaseT= ools/Source/Python/UPT/Object/POM/ModuleObject.py index 6e515a2c3fe4..6aaae4c1aff2 100644 --- a/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py +++ b/BaseTools/Source/Python/UPT/Object/POM/ModuleObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define a class object to describe a module=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -38,6 +38,8 @@ class BootModeObject(CommonPropertiesObject, HelpTextList= Object): ##=0D # EventObject=0D #=0D +=0D +=0D class EventObject(CommonPropertiesObject, HelpTextListObject):=0D def __init__(self):=0D self.EventType =3D ''=0D @@ -53,6 +55,8 @@ class EventObject(CommonPropertiesObject, HelpTextListObj= ect): ##=0D # HobObject=0D #=0D +=0D +=0D class HobObject(CommonPropertiesObject, HelpTextListObject):=0D def __init__(self):=0D self.HobType =3D ''=0D @@ -68,6 +72,8 @@ class HobObject(CommonPropertiesObject, HelpTextListObjec= t): ##=0D # SpecObject=0D #=0D +=0D +=0D class SpecObject(object):=0D def __init__(self):=0D self.Spec =3D ''=0D @@ -85,10 +91,12 @@ class SpecObject(object): def GetVersion(self):=0D return self.Version=0D =0D -## ModuleHeaderObject=0D +# ModuleHeaderObject=0D #=0D # This class defined header items used in Module file=0D #=0D +=0D +=0D class ModuleHeaderObject(IdentificationObject, CommonHeaderObject, BinaryH= eaderObject):=0D def __init__(self):=0D self.IsLibrary =3D False=0D @@ -211,6 +219,8 @@ class ModuleHeaderObject(IdentificationObject, CommonHe= aderObject, BinaryHeaderO ##=0D # SourceFileObject=0D #=0D +=0D +=0D class SourceFileObject(CommonPropertiesObject):=0D def __init__(self):=0D CommonPropertiesObject.__init__(self)=0D @@ -224,7 +234,7 @@ class SourceFileObject(CommonPropertiesObject): self.SourceFile =3D SourceFile=0D =0D def GetSourceFile(self):=0D - return self.SourceFile=0D + return self.SourceFile=0D =0D def SetTagName(self, TagName):=0D self.TagName =3D TagName=0D @@ -284,22 +294,27 @@ class AsBuildLibraryClassObject(object): =0D def SetLibGuid(self, LibGuid):=0D self.LibGuid =3D LibGuid=0D +=0D def GetLibGuid(self):=0D return self.LibGuid=0D =0D def SetLibVersion(self, LibVersion):=0D self.LibVersion =3D LibVersion=0D +=0D def GetLibVersion(self):=0D return self.LibVersion=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D ##=0D # AsBuiltObject=0D #=0D +=0D +=0D class AsBuiltObject(object):=0D def __init__(self):=0D #=0D @@ -347,6 +362,8 @@ class AsBuiltObject(object): # BinaryBuildFlag, this object will include those fields that are not=0D # covered by the UPT Spec BinaryFile field=0D #=0D +=0D +=0D class BinaryBuildFlagObject(object):=0D def __init__(self):=0D self.Target =3D ''=0D @@ -374,12 +391,15 @@ class BinaryBuildFlagObject(object): =0D def SetAsBuiltOptionFlags(self, AsBuiltOptionFlags):=0D self.AsBuiltOptionFlags =3D AsBuiltOptionFlags=0D +=0D def GetAsBuiltOptionFlags(self):=0D return self.AsBuiltOptionFlags=0D =0D ##=0D # ExternObject=0D #=0D +=0D +=0D class ExternObject(CommonPropertiesObject):=0D def __init__(self):=0D self.EntryPoint =3D ''=0D @@ -415,12 +435,15 @@ class ExternObject(CommonPropertiesObject): =0D def SetSupModList(self, SupModList):=0D self.SupModList =3D SupModList=0D +=0D def GetSupModList(self):=0D return self.SupModList=0D =0D ##=0D # DepexObject=0D #=0D +=0D +=0D class DepexObject(CommonPropertiesObject):=0D def __init__(self):=0D self.Depex =3D ''=0D @@ -442,6 +465,8 @@ class DepexObject(CommonPropertiesObject): ##=0D # PackageDependencyObject=0D #=0D +=0D +=0D class PackageDependencyObject(GuidVersionObject, CommonPropertiesObject):= =0D def __init__(self):=0D self.Package =3D ''=0D @@ -464,6 +489,8 @@ class PackageDependencyObject(GuidVersionObject, Common= PropertiesObject): ##=0D # BuildOptionObject=0D #=0D +=0D +=0D class BuildOptionObject(CommonPropertiesObject):=0D def __init__(self):=0D CommonPropertiesObject.__init__(self)=0D @@ -478,6 +505,8 @@ class BuildOptionObject(CommonPropertiesObject): ##=0D # ModuleObject=0D #=0D +=0D +=0D class ModuleObject(ModuleHeaderObject):=0D def __init__(self):=0D #=0D diff --git a/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py b/Base= Tools/Source/Python/UPT/Object/POM/PackageObject.py index fcc2a3bea94a..8fc202959a1a 100644 --- a/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py +++ b/BaseTools/Source/Python/UPT/Object/POM/PackageObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define a class object to describe a package=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -18,8 +18,10 @@ from Object.POM.CommonObject import CommonHeaderObject from Object.POM.CommonObject import BinaryHeaderObject=0D from Library.Misc import Sdict=0D =0D -## StandardIncludeFileObject=0D +# StandardIncludeFileObject=0D #=0D +=0D +=0D class StandardIncludeFileObject(CommonPropertiesObject):=0D def __init__(self):=0D CommonPropertiesObject.__init__(self)=0D @@ -31,14 +33,18 @@ class StandardIncludeFileObject(CommonPropertiesObject): def GetIncludeFile(self):=0D return self.IncludeFile=0D =0D -## PackageIncludeFileObject=0D +# PackageIncludeFileObject=0D #=0D +=0D +=0D class PackageIncludeFileObject(StandardIncludeFileObject):=0D pass=0D =0D ##=0D # PackageObject=0D #=0D +=0D +=0D class PackageObject(IdentificationObject, CommonHeaderObject, BinaryHeader= Object):=0D def __init__(self):=0D IdentificationObject.__init__(self)=0D @@ -189,4 +195,3 @@ class PackageObject(IdentificationObject, CommonHeaderO= bject, BinaryHeaderObject =0D def GetModuleFileList(self):=0D return self.ModuleFileList=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Object/POM/__init__.py b/BaseTools= /Source/Python/UPT/Object/POM/__init__.py index b36e7f6585c1..ceb3226afc0c 100644 --- a/BaseTools/Source/Python/UPT/Object/POM/__init__.py +++ b/BaseTools/Source/Python/UPT/Object/POM/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Object' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py b/BaseT= ools/Source/Python/UPT/Object/Parser/DecObject.py index 2a7fcf1697e5..28d5153a6af8 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/DecObject.py @@ -1,6 +1,6 @@ -## @file=0D +# @file=0D # This file is used to define class objects for DEC file. It will consumed= by=0D -#DecParser=0D +# DecParser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D #=0D @@ -10,7 +10,7 @@ DecObject=0D '''=0D =0D -## Import modules=0D +# Import modules=0D #=0D import os.path=0D =0D @@ -25,51 +25,55 @@ from Library.DataType import TAB_USER_EXTENSIONS from Library.DataType import TAB_PCDS=0D from Library.DataType import TAB_ARCH_COMMON=0D =0D -## _DecComments=0D +# _DecComments=0D #=0D # Base class for all data objects which have head and tail comments=0D #=0D +=0D +=0D class _DecComments:=0D =0D - ##constructor=0D + # constructor=0D #=0D def __init__(self):=0D self._HeadComment =3D []=0D self._TailComment =3D []=0D =0D - ## GetComments=0D + # GetComments=0D #=0D def GetComments(self):=0D return self._HeadComment, self._TailComment=0D =0D - ## GetHeadComment=0D + # GetHeadComment=0D #=0D def GetHeadComment(self):=0D return self._HeadComment=0D =0D - ## SetHeadComment=0D + # SetHeadComment=0D #=0D # @param Comment: comment content=0D #=0D def SetHeadComment(self, Comment):=0D self._HeadComment =3D Comment=0D =0D - ## GetTailComment=0D + # GetTailComment=0D #=0D def GetTailComment(self):=0D return self._TailComment=0D =0D - ## SetTailComment=0D + # SetTailComment=0D #=0D # @param Comment: comment content=0D #=0D def SetTailComment(self, Comment):=0D self._TailComment =3D Comment=0D =0D -## _DecBaseObject=0D +# _DecBaseObject=0D #=0D # Base class that hold common info=0D #=0D +=0D +=0D class _DecBaseObject(_DecComments):=0D def __init__(self, PkgFullName):=0D _DecComments.__init__(self)=0D @@ -82,27 +86,27 @@ class _DecBaseObject(_DecComments): self._PackagePath, self._FileName =3D os.path.split(PkgFullName)=0D self._SecName =3D ''=0D =0D - ## GetSectionName=0D + # GetSectionName=0D #=0D def GetSectionName(self):=0D return self._SecName=0D =0D - ## GetPackagePath=0D + # GetPackagePath=0D #=0D def GetPackagePath(self):=0D return self._PackagePath=0D =0D - ## GetPackageFile=0D + # GetPackageFile=0D #=0D def GetPackageFile(self):=0D return self._FileName=0D =0D - ## GetPackageFullName=0D + # GetPackageFullName=0D #=0D def GetPackageFullName(self):=0D return self._PkgFullName=0D =0D - ## AddItem=0D + # AddItem=0D # Add sub-item to current object, sub-class should override it if need= ed=0D #=0D # @param Item: Sub-item to be added=0D @@ -122,7 +126,7 @@ class _DecBaseObject(_DecComments): ArchModule.append(Ele[1])=0D Item.ArchAndModuleType =3D ArchModule=0D =0D - ## _GetItemByArch=0D + # _GetItemByArch=0D # Helper class used by sub-class=0D # @param Arch: arch=0D #=0D @@ -132,7 +136,7 @@ class _DecBaseObject(_DecComments): return []=0D return self.ValueDict[Arch]=0D =0D - ## _GetAllItems=0D + # _GetAllItems=0D # Get all items, union all arches, items in returned list are unique=0D #=0D def _GetAllItems(self):=0D @@ -143,10 +147,12 @@ class _DecBaseObject(_DecComments): Retlst.append(Item)=0D return Retlst=0D =0D -## _DecItemBaseObject=0D +# _DecItemBaseObject=0D #=0D # Module type and arch the item belongs to=0D #=0D +=0D +=0D class _DecItemBaseObject(_DecComments):=0D def __init__(self):=0D _DecComments.__init__(self)=0D @@ -155,7 +161,7 @@ class _DecItemBaseObject(_DecComments): #=0D self.ArchAndModuleType =3D []=0D =0D - ## GetArchList=0D + # GetArchList=0D #=0D def GetArchList(self):=0D ArchSet =3D set()=0D @@ -163,10 +169,12 @@ class _DecItemBaseObject(_DecComments): ArchSet.add(Arch)=0D return list(ArchSet)=0D =0D -## DecDefineObject=0D +# DecDefineObject=0D #=0D # Class to hold define section information=0D #=0D +=0D +=0D class DecDefineObject(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D @@ -177,7 +185,7 @@ class DecDefineObject(_DecBaseObject): self._PkgVersion =3D ''=0D self._PkgUniFile =3D ''=0D =0D - ## GetPackageSpecification=0D + # GetPackageSpecification=0D #=0D def GetPackageSpecification(self):=0D return self._DecSpec=0D @@ -185,7 +193,7 @@ class DecDefineObject(_DecBaseObject): def SetPackageSpecification(self, DecSpec):=0D self._DecSpec =3D DecSpec=0D =0D - ## GetPackageName=0D + # GetPackageName=0D #=0D def GetPackageName(self):=0D return self._PkgName=0D @@ -193,7 +201,7 @@ class DecDefineObject(_DecBaseObject): def SetPackageName(self, PkgName):=0D self._PkgName =3D PkgName=0D =0D - ## GetPackageGuid=0D + # GetPackageGuid=0D #=0D def GetPackageGuid(self):=0D return self._PkgGuid=0D @@ -201,7 +209,7 @@ class DecDefineObject(_DecBaseObject): def SetPackageGuid(self, PkgGuid):=0D self._PkgGuid =3D PkgGuid=0D =0D - ## GetPackageVersion=0D + # GetPackageVersion=0D #=0D def GetPackageVersion(self):=0D return self._PkgVersion=0D @@ -209,7 +217,7 @@ class DecDefineObject(_DecBaseObject): def SetPackageVersion(self, PkgVersion):=0D self._PkgVersion =3D PkgVersion=0D =0D - ## GetPackageUniFile=0D + # GetPackageUniFile=0D #=0D def GetPackageUniFile(self):=0D return self._PkgUniFile=0D @@ -217,109 +225,119 @@ class DecDefineObject(_DecBaseObject): def SetPackageUniFile(self, PkgUniFile):=0D self._PkgUniFile =3D PkgUniFile=0D =0D - ## GetDefines=0D + # GetDefines=0D #=0D def GetDefines(self):=0D return self._GetItemByArch(TAB_ARCH_COMMON)=0D =0D - ## GetAllDefines=0D + # GetAllDefines=0D #=0D def GetAllDefines(self):=0D return self._GetAllItems()=0D =0D -## DecDefineItemObject=0D +# DecDefineItemObject=0D #=0D # Each item of define section=0D #=0D +=0D +=0D class DecDefineItemObject(_DecItemBaseObject):=0D def __init__(self):=0D _DecItemBaseObject.__init__(self)=0D self.Key =3D ''=0D self.Value =3D ''=0D =0D - ## __hash__=0D + # __hash__=0D #=0D def __hash__(self):=0D return hash(self.Key + self.Value)=0D =0D - ## __eq__=0D + # __eq__=0D #=0D def __eq__(self, Other):=0D return id(self) =3D=3D id(Other)=0D =0D - ## __str__=0D + # __str__=0D #=0D def __str__(self):=0D return str(self.ArchAndModuleType) + '\n' + self.Key + \=0D ' =3D ' + self.Value=0D =0D -## DecIncludeObject=0D +# DecIncludeObject=0D #=0D # Class to hold include section info=0D #=0D +=0D +=0D class DecIncludeObject(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D self._SecName =3D TAB_INCLUDES.upper()=0D =0D - ## GetIncludes=0D + # GetIncludes=0D #=0D def GetIncludes(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetAllIncludes=0D + # GetAllIncludes=0D #=0D def GetAllIncludes(self):=0D return self._GetAllItems()=0D =0D -## DecIncludeItemObject=0D +# DecIncludeItemObject=0D #=0D # Item of include section=0D #=0D +=0D +=0D class DecIncludeItemObject(_DecItemBaseObject):=0D def __init__(self, File, Root):=0D self.File =3D File=0D self.Root =3D Root=0D _DecItemBaseObject.__init__(self)=0D =0D - ## __hash__=0D + # __hash__=0D #=0D def __hash__(self):=0D return hash(self.File)=0D =0D - ## __eq__=0D + # __eq__=0D #=0D def __eq__(self, Other):=0D return id(self) =3D=3D id(Other)=0D =0D - ## __str__=0D + # __str__=0D #=0D def __str__(self):=0D return self.File=0D =0D -## DecLibraryclassObject=0D +# DecLibraryclassObject=0D #=0D # Class to hold library class section info=0D #=0D +=0D +=0D class DecLibraryclassObject(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D self._PackagePath, self._FileName =3D os.path.split(PkgFullName)=0D self._SecName =3D TAB_LIBRARY_CLASSES.upper()=0D =0D - ## GetLibraryclasses=0D + # GetLibraryclasses=0D #=0D def GetLibraryclasses(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetAllLibraryclasses=0D + # GetAllLibraryclasses=0D #=0D def GetAllLibraryclasses(self):=0D return self._GetAllItems()=0D =0D -## DecLibraryclassItemObject=0D +# DecLibraryclassItemObject=0D # Item of library class section=0D #=0D +=0D +=0D class DecLibraryclassItemObject(_DecItemBaseObject):=0D def __init__(self, Libraryclass, File, Root):=0D _DecItemBaseObject.__init__(self)=0D @@ -327,30 +345,32 @@ class DecLibraryclassItemObject(_DecItemBaseObject): self.Root =3D Root=0D self.Libraryclass =3D Libraryclass=0D =0D - ## __hash__=0D + # __hash__=0D #=0D def __hash__(self):=0D return hash(self.Libraryclass + self.File)=0D =0D - ## __eq__=0D + # __eq__=0D #=0D def __eq__(self, Other):=0D return id(self) =3D=3D id(Other)=0D =0D - ## __str__=0D + # __str__=0D #=0D def __str__(self):=0D return self.Libraryclass + '|' + self.File=0D =0D -## DecPcdObject=0D +# DecPcdObject=0D # Class to hold PCD section=0D #=0D +=0D +=0D class DecPcdObject(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D self._SecName =3D TAB_PCDS.upper()=0D =0D - ## AddItem=0D + # AddItem=0D #=0D # Diff from base class=0D #=0D @@ -371,7 +391,7 @@ class DecPcdObject(_DecBaseObject): ArchModule.append([Type, Arch])=0D Item.ArchAndModuleType =3D ArchModule=0D =0D - ## GetPcds=0D + # GetPcds=0D #=0D # @param PcdType: PcdType=0D # @param Arch: Arch=0D @@ -383,7 +403,7 @@ class DecPcdObject(_DecBaseObject): return []=0D return self.ValueDict[PcdType, Arch]=0D =0D - ## GetPcdsByType=0D + # GetPcdsByType=0D #=0D # @param PcdType: PcdType=0D #=0D @@ -398,12 +418,14 @@ class DecPcdObject(_DecBaseObject): Retlst.append(Item)=0D return Retlst=0D =0D -## DecPcdItemObject=0D +# DecPcdItemObject=0D #=0D # Item of PCD section=0D #=0D # @param _DecItemBaseObject: _DecItemBaseObject object=0D #=0D +=0D +=0D class DecPcdItemObject(_DecItemBaseObject):=0D def __init__(self, Guid, Name, Value, DatumType,=0D Token, MaxDatumSize=3D''):=0D @@ -415,17 +437,17 @@ class DecPcdItemObject(_DecItemBaseObject): self.TokenValue =3D Token=0D self.MaxDatumSize =3D MaxDatumSize=0D =0D - ## __hash__=0D + # __hash__=0D #=0D def __hash__(self):=0D return hash(self.TokenSpaceGuidCName + self.TokenCName)=0D =0D - ## __eq__=0D + # __eq__=0D #=0D def __eq__(self, Other):=0D return id(self) =3D=3D id(Other)=0D =0D - ## GetArchListOfType=0D + # GetArchListOfType=0D #=0D # @param PcdType: PcdType=0D #=0D @@ -438,35 +460,39 @@ class DecPcdItemObject(_DecItemBaseObject): ItemSet.add(Arch)=0D return list(ItemSet)=0D =0D -## DecGuidObjectBase=0D +# DecGuidObjectBase=0D #=0D # Base class for PPI, Protocol, and GUID.=0D # Hold same data but has different method for clarification in sub-class=0D #=0D # @param _DecBaseObject: Dec Base Object=0D #=0D +=0D +=0D class DecGuidObjectBase(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D =0D - ## GetGuidStyleItems=0D + # GetGuidStyleItems=0D #=0D # @param Arch: Arch=0D #=0D def GetGuidStyleItems(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetGuidStyleAllItems=0D + # GetGuidStyleAllItems=0D #=0D def GetGuidStyleAllItems(self):=0D return self._GetAllItems()=0D =0D -## DecGuidItemObject=0D +# DecGuidItemObject=0D #=0D # Item of GUID, PPI and Protocol section=0D #=0D # @param _DecItemBaseObject: Dec Item Base Object=0D #=0D +=0D +=0D class DecGuidItemObject(_DecItemBaseObject):=0D def __init__(self, CName, GuidCValue, GuidString):=0D _DecItemBaseObject.__init__(self)=0D @@ -474,103 +500,111 @@ class DecGuidItemObject(_DecItemBaseObject): self.GuidCValue =3D GuidCValue=0D self.GuidString =3D GuidString=0D =0D - ## __hash__=0D + # __hash__=0D #=0D def __hash__(self):=0D return hash(self.GuidCName)=0D =0D - ## __eq__=0D + # __eq__=0D #=0D def __eq__(self, Other):=0D return id(self) =3D=3D id(Other)=0D =0D - ## __str__=0D + # __str__=0D #=0D def __str__(self):=0D return self.GuidCName + ' =3D ' + self.GuidCValue=0D =0D -## DecGuidObject=0D +# DecGuidObject=0D #=0D # Class for GUID section=0D #=0D # @param DecGuidObjectBase: Dec Guid Object Base=0D #=0D +=0D +=0D class DecGuidObject(DecGuidObjectBase):=0D def __init__(self, PkgFullName):=0D DecGuidObjectBase.__init__(self, PkgFullName)=0D self._SecName =3D TAB_GUIDS.upper()=0D =0D - ## GetGuids=0D + # GetGuids=0D #=0D # @param Arch: Arch=0D #=0D def GetGuids(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetAllGuids=0D + # GetAllGuids=0D #=0D def GetAllGuids(self):=0D return self._GetAllItems()=0D =0D -## DecPpiObject=0D +# DecPpiObject=0D #=0D # Class for PPI section=0D #=0D # @param DecGuidObjectBase: Dec Guid Object Base=0D #=0D +=0D +=0D class DecPpiObject(DecGuidObjectBase):=0D def __init__(self, PkgFullName):=0D DecGuidObjectBase.__init__(self, PkgFullName)=0D self._SecName =3D TAB_PPIS.upper()=0D =0D - ## GetPpis=0D + # GetPpis=0D #=0D # @param Arch: Arch=0D #=0D def GetPpis(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetAllPpis=0D + # GetAllPpis=0D #=0D def GetAllPpis(self):=0D return self._GetAllItems()=0D =0D -## DecProtocolObject=0D +# DecProtocolObject=0D #=0D # Class for protocol section=0D #=0D # @param DecGuidObjectBase: Dec Guid Object Base=0D #=0D +=0D +=0D class DecProtocolObject(DecGuidObjectBase):=0D def __init__(self, PkgFullName):=0D DecGuidObjectBase.__init__(self, PkgFullName)=0D self._SecName =3D TAB_PROTOCOLS.upper()=0D =0D - ## GetProtocols=0D + # GetProtocols=0D #=0D # @param Arch: Arch=0D #=0D def GetProtocols(self, Arch=3DTAB_ARCH_COMMON):=0D return self._GetItemByArch(Arch)=0D =0D - ## GetAllProtocols=0D + # GetAllProtocols=0D #=0D def GetAllProtocols(self):=0D return self._GetAllItems()=0D =0D -## DecUserExtensionObject=0D +# DecUserExtensionObject=0D #=0D # Class for user extension section=0D #=0D # @param _DecBaseObject: Dec Guid Object Base=0D #=0D +=0D +=0D class DecUserExtensionObject(_DecBaseObject):=0D def __init__(self, PkgFullName):=0D _DecBaseObject.__init__(self, PkgFullName)=0D self._SecName =3D TAB_USER_EXTENSIONS.upper()=0D self.ItemList =3D []=0D =0D - ## GetProtocols=0D + # GetProtocols=0D #=0D # @param Item: Item=0D # @param Scope: Scope=0D @@ -582,13 +616,13 @@ class DecUserExtensionObject(_DecBaseObject): return=0D self.ItemList.append(Item)=0D =0D - ## GetAllUserExtensions=0D + # GetAllUserExtensions=0D #=0D def GetAllUserExtensions(self):=0D return self.ItemList=0D =0D =0D -## DecUserExtensionItemObject=0D +# DecUserExtensionItemObject=0D # Item for user extension section=0D #=0D # @param _DecItemBaseObject: Dec Item Base Object=0D @@ -599,7 +633,3 @@ class DecUserExtensionItemObject(_DecItemBaseObject): self.UserString =3D ''=0D self.UserId =3D ''=0D self.IdString =3D ''=0D -=0D -=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py b= /BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py index 6b55d01ab2a2..dd6210c697a3 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfBinaryObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Binaries] section= .=0D # It will consumed by InfParser.=0D #=0D @@ -39,33 +39,41 @@ class InfBianryItem(): =0D def SetFileName(self, FileName):=0D self.FileName =3D FileName=0D +=0D def GetFileName(self):=0D return self.FileName=0D =0D def SetTarget(self, Target):=0D self.Target =3D Target=0D +=0D def GetTarget(self):=0D return self.Target=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetType(self, Type):=0D self.Type =3D Type=0D +=0D def GetType(self):=0D return self.Type=0D +=0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D +=0D class InfBianryVerItem(InfBianryItem, CurrentLine):=0D def __init__(self):=0D InfBianryItem.__init__(self)=0D @@ -74,9 +82,11 @@ class InfBianryVerItem(InfBianryItem, CurrentLine): =0D def SetVerTypeName(self, VerTypeName):=0D self.VerTypeName =3D VerTypeName=0D +=0D def GetVerTypeName(self):=0D return self.VerTypeName=0D =0D +=0D class InfBianryUiItem(InfBianryItem, CurrentLine):=0D def __init__(self):=0D InfBianryItem.__init__(self)=0D @@ -85,9 +95,11 @@ class InfBianryUiItem(InfBianryItem, CurrentLine): =0D def SetUiTypeName(self, UiTypeName):=0D self.UiTypeName =3D UiTypeName=0D +=0D def GetVerTypeName(self):=0D return self.UiTypeName=0D =0D +=0D class InfBianryCommonItem(InfBianryItem, CurrentLine):=0D def __init__(self):=0D self.CommonType =3D ''=0D @@ -99,21 +111,25 @@ class InfBianryCommonItem(InfBianryItem, CurrentLine): =0D def SetCommonType(self, CommonType):=0D self.CommonType =3D CommonType=0D +=0D def GetCommonType(self):=0D return self.CommonType=0D =0D def SetTagName(self, TagName):=0D self.TagName =3D TagName=0D +=0D def GetTagName(self):=0D return self.TagName=0D =0D def SetFamily(self, Family):=0D self.Family =3D Family=0D +=0D def GetFamily(self):=0D return self.Family=0D =0D def SetGuidValue(self, GuidValue):=0D self.GuidValue =3D GuidValue=0D +=0D def GetGuidValue(self):=0D return self.GuidValue=0D =0D @@ -121,6 +137,8 @@ class InfBianryCommonItem(InfBianryItem, CurrentLine): #=0D #=0D #=0D +=0D +=0D class InfBinariesObject(InfSectionCommonDef):=0D def __init__(self):=0D self.Binaries =3D Sdict()=0D @@ -130,7 +148,7 @@ class InfBinariesObject(InfSectionCommonDef): self.Macros =3D {}=0D InfSectionCommonDef.__init__(self)=0D =0D - ## CheckVer=0D + # CheckVer=0D #=0D #=0D def CheckVer(self, Ver, __SupArchList):=0D @@ -150,7 +168,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(VerContent) < 2:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID = % (VerContent[0], 2),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID = % (=0D + VerContent[0], 2),=0D File=3DVerCurrentLine.GetFileName(),=0D Line=3DVerCurrentLine.GetLineNo(),=0D ExtraData=3DVerCurrentLine.GetLineString())=0D @@ -158,7 +177,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(VerContent) > 4:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_= MAX % (VerContent[0], 4),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_= MAX % (=0D + VerContent[0], 4),=0D File=3DVerCurrentLine.GetFileName(),=0D Line=3DVerCurrentLine.GetLineNo(),=0D ExtraData=3DVerCurrentLine.GetLineString())=0D @@ -187,7 +207,8 @@ class InfBinariesObject(InfSectionCommonDef): if not (ValidFile(FullFileName) or ValidFile(VerContent[1]= )):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EX= IST % (VerContent[1]),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EX= IST % (=0D + VerContent[1]),=0D File=3DVerCurrentLine.GetFileName(),=0D Line=3DVerCurrentLine.GetLineNo(),=0D ExtraData=3DVerCurrentLine.GetLineString(= ))=0D @@ -199,14 +220,15 @@ class InfBinariesObject(InfSectionCommonDef): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (VerContent[1]),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (=0D + VerContent[1]),=0D File=3DVerCurrentLine.GetFileName(),=0D Line=3DVerCurrentLine.GetLineNo(),=0D ExtraData=3DVerCurrentLine.GetLineString(= ))=0D return False=0D if IsValidFileFlag:=0D VerContent[0] =3D ConvPathFromAbsToRel(VerContent[0],= =0D - GlobalData.gINF_MODULE_DIR)=0D + GlobalData.gINF_M= ODULE_DIR)=0D InfBianryVerItemObj.SetFileName(VerContent[1])=0D if len(VerContent) >=3D 3:=0D #=0D @@ -224,12 +246,13 @@ class InfBinariesObject(InfSectionCommonDef): #=0D # Validate Feature Flag Express=0D #=0D - FeatureFlagRtv =3D IsValidFeatureFlagExp(VerContent[3].\=0D + FeatureFlagRtv =3D IsValidFeatureFlagExp(VerContent[3].=0D strip())=0D if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DVerCurrentLine.GetFileName(),=0D Line=3DVerCurrentLine.GetLineNo(),=0D ExtraData=3DVerCurrentLine.GetLineString(= ))=0D @@ -275,7 +298,7 @@ class InfBinariesObject(InfSectionCommonDef): BinariesList.append((InfBianryVerItemObj, VerComment))= =0D self.Binaries[InfBianryVerItemObj] =3D BinariesList=0D =0D - ## ParseCommonBinary=0D + # ParseCommonBinary=0D #=0D # ParseCommonBinary=0D #=0D @@ -295,7 +318,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(ItemContent) < 3:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVA= LID % (ItemContent[0], 3),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVA= LID % (=0D + ItemContent[0], 3),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D @@ -304,7 +328,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(ItemContent) < 2:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVA= LID % (ItemContent[0], 2),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVA= LID % (=0D + ItemContent[0], 2),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D @@ -313,7 +338,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(ItemContent) > 7:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_= MAX % (ItemContent[0], 7),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_= MAX % (=0D + ItemContent[0], 7),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D ExtraData=3DCurrentLineOfItem.GetLineString()= )=0D @@ -333,7 +359,7 @@ class InfBinariesObject(InfSectionCommonDef): if BinaryFileType not in DT.BINARY_FILE_TYPE_LIST:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FIL= ETYPE % \=0D + ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FIL= ETYPE %=0D (DT.BINARY_FILE_TYPE_LIST.__str__()),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D @@ -345,7 +371,7 @@ class InfBinariesObject(InfSectionCommonDef): if BinaryFileType =3D=3D 'LIB' or BinaryFileType =3D=3D 'U= EFI_APP':=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FIL= ETYPE % \=0D + ST.ERR_INF_PARSER_BINARY_ITEM_INVALID_FIL= ETYPE %=0D (DT.BINARY_FILE_TYPE_LIST.__str__()),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D @@ -360,11 +386,11 @@ class InfBinariesObject(InfSectionCommonDef): FileName =3D ItemContent[2]=0D else:=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FILENAME_NO= T_EXIST,=0D - File=3DCurrentLineOfItem.GetFileName(),=0D - Line=3DCurrentLineOfItem.GetLineNo(),=0D - ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FILENAM= E_NOT_EXIST,=0D + File=3DCurrentLineOfItem.GetFileName(= ),=0D + Line=3DCurrentLineOfItem.GetLineNo(),= =0D + ExtraData=3DCurrentLineOfItem.GetLine= String())=0D else:=0D FileName =3D ItemContent[1]=0D #=0D @@ -375,7 +401,8 @@ class InfBinariesObject(InfSectionCommonDef): if not (ValidFile(FullFileName) or ValidFile(FileName)):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EX= IST % (FileName),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EX= IST % (=0D + FileName),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D @@ -386,14 +413,16 @@ class InfBinariesObject(InfSectionCommonDef): IsValidFileFlag =3D True=0D else:=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_I= NVALID % (FileName),=0D - File=3DCurrentLineOfItem.GetFileName(),=0D - Line=3DCurrentLineOfItem.GetLineNo(),=0D - ExtraData=3DCurrentLineOfItem.GetLineStrin= g())=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (=0D + FileName),=0D + File=3DCurrentLineOfItem.GetFileName(),=0D + Line=3DCurrentLineOfItem.GetLineNo(),=0D + ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D return False=0D if IsValidFileFlag:=0D - ItemContent[0] =3D ConvPathFromAbsToRel(ItemContent[0]= , GlobalData.gINF_MODULE_DIR)=0D + ItemContent[0] =3D ConvPathFromAbsToRel(=0D + ItemContent[0], GlobalData.gINF_MODULE_DIR)=0D InfBianryCommonItemObj.SetFileName(FileName)=0D if len(ItemContent) >=3D 3:=0D #=0D @@ -423,7 +452,8 @@ class InfBinariesObject(InfSectionCommonDef): if ItemContent[4].strip() !=3D '':=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITT= ED % (ItemContent[4]),=0D + ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITT= ED % (=0D + ItemContent[4]),=0D File=3DCurrentLineOfItem.GetFileName(= ),=0D Line=3DCurrentLineOfItem.GetLineNo(),= =0D ExtraData=3DCurrentLineOfItem.GetLine= String())=0D @@ -445,11 +475,13 @@ class InfBinariesObject(InfSectionCommonDef): #=0D # Validate Feature Flag Express=0D #=0D - FeatureFlagRtv =3D IsValidFeatureFlagExp(ItemContent[5= ].strip())=0D + FeatureFlagRtv =3D IsValidFeatureFlagExp(=0D + ItemContent[5].strip())=0D if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfItem.GetFileName(= ),=0D Line=3DCurrentLineOfItem.GetLineNo(),= =0D ExtraData=3DCurrentLineOfItem.GetLine= String())=0D @@ -458,7 +490,8 @@ class InfBinariesObject(InfSectionCommonDef): if ItemContent[5].strip() !=3D '':=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITT= ED % (ItemContent[5]),=0D + ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITT= ED % (=0D + ItemContent[5]),=0D File=3DCurrentLineOfItem.GetFileName(= ),=0D Line=3DCurrentLineOfItem.GetLineNo(),= =0D ExtraData=3DCurrentLineOfItem.GetLine= String())=0D @@ -466,11 +499,11 @@ class InfBinariesObject(InfSectionCommonDef): if len(ItemContent) =3D=3D 7:=0D if ItemContent[6].strip() =3D=3D '':=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MI= SSING,=0D - File=3DCurrentLineOfItem.GetFileName(= ),=0D - Line=3DCurrentLineOfItem.GetLineNo(),= =0D - ExtraData=3DCurrentLineOfItem.GetLine= String())=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSIN= G,=0D + File=3DCurrentLineOfItem.GetFileName(),=0D + Line=3DCurrentLineOfItem.GetLineNo(),=0D + ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D #=0D # Validate Feature Flag Express=0D #=0D @@ -478,7 +511,8 @@ class InfBinariesObject(InfSectionCommonDef): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfItem.GetFileName(),=0D Line=3DCurrentLineOfItem.GetLineNo(),=0D ExtraData=3DCurrentLineOfItem.GetLineStri= ng())=0D @@ -554,7 +588,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(UiContent) < 2:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_= INVALID % (UiContent[0], 2),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_= INVALID % (=0D + UiContent[0], 2),=0D File=3DUiCurrentLine.GetFileName(),=0D Line=3DUiCurrentLine.GetLineNo(),=0D ExtraData=3DUiCurrentLine.GetLineStri= ng())=0D @@ -563,7 +598,8 @@ class InfBinariesObject(InfSectionCommonDef): if len(UiContent) > 4:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_= INVALID_MAX % (UiContent[0], 4),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_= INVALID_MAX % (=0D + UiContent[0], 4),=0D File=3DUiCurrentLine.GetFileName(),=0D Line=3DUiCurrentLine.GetLineNo(),=0D ExtraData=3DUiCurrentLine.GetLineStri= ng())=0D @@ -576,7 +612,8 @@ class InfBinariesObject(InfSectionCommonDef): if UiContent[0] !=3D 'UI':=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_VER_TYPE= % ('UI'),=0D + ST.ERR_INF_PARSER_BINARY_VER_TYPE= % (=0D + 'UI'),=0D File=3DUiCurrentLine.GetFileName(= ),=0D Line=3DUiCurrentLine.GetLineNo(),= =0D ExtraData=3DUiCurrentLine.GetLine= String())=0D @@ -590,7 +627,8 @@ class InfBinariesObject(InfSectionCommonDef): if not (ValidFile(FullFileName) or ValidFile(UiCon= tent[1])):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_BINARY_ITEM_FIL= E_NOT_EXIST % (UiContent[1]),=0D + ST.ERR_INF_PARSER_BINARY_ITEM_FIL= E_NOT_EXIST % (=0D + UiContent[1]),=0D File=3DUiCurrentLine.GetFileName(= ),=0D Line=3DUiCurrentLine.GetLineNo(),= =0D ExtraData=3DUiCurrentLine.GetLine= String())=0D @@ -602,13 +640,15 @@ class InfBinariesObject(InfSectionCommonDef): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_= OR_NAME_INVALID % (UiContent[1]),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_= OR_NAME_INVALID % (=0D + UiContent[1]),=0D File=3DUiCurrentLine.GetFileName(= ),=0D Line=3DUiCurrentLine.GetLineNo(),= =0D ExtraData=3DUiCurrentLine.GetLine= String())=0D return False=0D if IsValidFileFlag:=0D - UiContent[0] =3D ConvPathFromAbsToRel(UiConten= t[0], GlobalData.gINF_MODULE_DIR)=0D + UiContent[0] =3D ConvPathFromAbsToRel(=0D + UiContent[0], GlobalData.gINF_MODULE_DIR)= =0D InfBianryUiItemObj.SetFileName(UiContent[1])=0D if len(UiContent) >=3D 3:=0D #=0D @@ -626,11 +666,13 @@ class InfBinariesObject(InfSectionCommonDef): #=0D # Validate Feature Flag Express=0D #=0D - FeatureFlagRtv =3D IsValidFeatureFlagExp(UiContent= [3].strip())=0D + FeatureFlagRtv =3D IsValidFeatureFlagExp(=0D + UiContent[3].strip())=0D if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EX= P_SYNTAX_INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EX= P_SYNTAX_INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DUiCurrentLine.GetFileName(= ),=0D Line=3DUiCurrentLine.GetLineNo(),= =0D ExtraData=3DUiCurrentLine.GetLine= String())=0D @@ -669,11 +711,13 @@ class InfBinariesObject(InfSectionCommonDef): if InfBianryUiItemObj is not None:=0D if (InfBianryUiItemObj) in self.Binaries:=0D BinariesList =3D self.Binaries[InfBianryUiItem= Obj]=0D - BinariesList.append((InfBianryUiItemObj, UiCom= ment))=0D + BinariesList.append(=0D + (InfBianryUiItemObj, UiComment))=0D self.Binaries[InfBianryUiItemObj] =3D Binaries= List=0D else:=0D BinariesList =3D []=0D - BinariesList.append((InfBianryUiItemObj, UiCom= ment))=0D + BinariesList.append(=0D + (InfBianryUiItemObj, UiComment))=0D self.Binaries[InfBianryUiItemObj] =3D Binaries= List=0D if Ver is not None and len(Ver) > 0:=0D self.CheckVer(Ver, __SupArchList)=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject= .py b/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py index fdba5db98311..a00a93436f78 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfBuildOptionObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [BuildOptions] sec= tion.=0D # It will consumed by InfParser.=0D #=0D @@ -14,19 +14,22 @@ from Library import GlobalData =0D from Object.Parser.InfCommonObject import InfSectionCommonDef=0D =0D +=0D class InfBuildOptionItem():=0D def __init__(self):=0D - self.Content =3D ''=0D + self.Content =3D ''=0D self.SupArchList =3D []=0D self.AsBuildList =3D []=0D =0D def SetContent(self, Content):=0D self.Content =3D Content=0D +=0D def GetContent(self):=0D return self.Content=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D @@ -35,11 +38,12 @@ class InfBuildOptionItem(): #=0D def SetAsBuildList(self, AsBuildList):=0D self.AsBuildList =3D AsBuildList=0D +=0D def GetAsBuildList(self):=0D return self.AsBuildList=0D =0D =0D -## INF BuildOption section=0D +# INF BuildOption section=0D # Macro define is not permitted for this section.=0D #=0D #=0D @@ -47,7 +51,7 @@ class InfBuildOptionsObject(InfSectionCommonDef): def __init__(self):=0D self.BuildOptions =3D []=0D InfSectionCommonDef.__init__(self)=0D - ## SetBuildOptions function=0D + # SetBuildOptions function=0D #=0D # For BuildOptionName, need to validate its format=0D # For BuildOptionValue, just ignore it.=0D @@ -61,7 +65,8 @@ class InfBuildOptionsObject(InfSectionCommonDef): # @return True Build options set/validate successfully=0D # @return False Build options set/validate failed=0D #=0D - def SetBuildOptions(self, BuildOptCont, ArchList =3D None, SectionCont= ent =3D ''):=0D +=0D + def SetBuildOptions(self, BuildOptCont, ArchList=3DNone, SectionConten= t=3D''):=0D =0D if not GlobalData.gIS_BINARY_INF:=0D =0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py b= /BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py index aa23d0878890..05871d9320a9 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common class objects for INF file.=0D # It will consumed by InfParser=0D #=0D @@ -10,7 +10,7 @@ InfCommonObject=0D '''=0D =0D -## InfLineCommentObject=0D +# InfLineCommentObject=0D #=0D # Comment Object for any line in the INF file=0D #=0D @@ -19,6 +19,8 @@ InfCommonObject # #=0D # Line # TailComment=0D #=0D +=0D +=0D class InfLineCommentObject():=0D def __init__(self):=0D self.HeaderComments =3D ''=0D @@ -36,46 +38,48 @@ class InfLineCommentObject(): def GetTailComments(self):=0D return self.TailComments=0D =0D -## CurrentLine=0D +# CurrentLine=0D #=0D +=0D +=0D class CurrentLine():=0D def __init__(self):=0D self.LineNo =3D ''=0D self.LineString =3D ''=0D self.FileName =3D ''=0D =0D - ## SetLineNo=0D + # SetLineNo=0D #=0D # @param LineNo: LineNo=0D #=0D def SetLineNo(self, LineNo):=0D self.LineNo =3D LineNo=0D =0D - ## GetLineNo=0D + # GetLineNo=0D #=0D def GetLineNo(self):=0D return self.LineNo=0D =0D - ## SetLineString=0D + # SetLineString=0D #=0D # @param LineString: Line String content=0D #=0D def SetLineString(self, LineString):=0D self.LineString =3D LineString=0D =0D - ## GetLineString=0D + # GetLineString=0D #=0D def GetLineString(self):=0D return self.LineString=0D =0D - ## SetFileName=0D + # SetFileName=0D #=0D # @param FileName: File Name=0D #=0D def SetFileName(self, FileName):=0D self.FileName =3D FileName=0D =0D - ## GetFileName=0D + # GetFileName=0D #=0D def GetFileName(self):=0D return self.FileName=0D @@ -83,6 +87,8 @@ class CurrentLine(): ##=0D # Inf Section common data=0D #=0D +=0D +=0D class InfSectionCommonDef():=0D def __init__(self):=0D #=0D @@ -93,43 +99,43 @@ class InfSectionCommonDef(): # data=0D #=0D self.HeaderComments =3D ''=0D - self.TailComments =3D ''=0D + self.TailComments =3D ''=0D #=0D # The support arch list of this section=0D #=0D - self.SupArchList =3D []=0D + self.SupArchList =3D []=0D =0D #=0D # Store all section content=0D # Key is supported Arch=0D #=0D - self.AllContent =3D {}=0D + self.AllContent =3D {}=0D =0D - ## SetHeaderComments=0D + # SetHeaderComments=0D #=0D # @param HeaderComments: HeaderComments=0D #=0D def SetHeaderComments(self, HeaderComments):=0D self.HeaderComments =3D HeaderComments=0D =0D - ## GetHeaderComments=0D + # GetHeaderComments=0D #=0D def GetHeaderComments(self):=0D return self.HeaderComments=0D =0D - ## SetTailComments=0D + # SetTailComments=0D #=0D # @param TailComments: TailComments=0D #=0D def SetTailComments(self, TailComments):=0D self.TailComments =3D TailComments=0D =0D - ## GetTailComments=0D + # GetTailComments=0D #=0D def GetTailComments(self):=0D return self.TailComments=0D =0D - ## SetSupArchList=0D + # SetSupArchList=0D #=0D # @param Arch: Arch=0D #=0D @@ -137,12 +143,12 @@ class InfSectionCommonDef(): if Arch not in self.SupArchList:=0D self.SupArchList.append(Arch)=0D =0D - ## GetSupArchList=0D + # GetSupArchList=0D #=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D - ## SetAllContent=0D + # SetAllContent=0D #=0D # @param ArchList: ArchList=0D # @param Content: Content=0D @@ -150,7 +156,7 @@ class InfSectionCommonDef(): def SetAllContent(self, Content):=0D self.AllContent =3D Content=0D =0D - ## GetAllContent=0D + # GetAllContent=0D #=0D def GetAllContent(self):=0D return self.AllContent=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObjec= t.py b/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py index 738a4c2dbf41..16e804e40f98 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfDefineCommonObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define common class objects of [Defines] section fo= r INF file.=0D # It will consumed by InfParser=0D #=0D @@ -12,37 +12,48 @@ InfDefineCommonObject =0D from Object.Parser.InfCommonObject import InfLineCommentObject=0D =0D -## InfDefineImageExeParamItem=0D +# InfDefineImageExeParamItem=0D #=0D +=0D +=0D class InfDefineImageExeParamItem():=0D def __init__(self):=0D - self.CName =3D ''=0D + self.CName =3D ''=0D self.FeatureFlagExp =3D ''=0D self.Comments =3D InfLineCommentObject()=0D =0D def SetCName(self, CName):=0D self.CName =3D CName=0D +=0D def GetCName(self):=0D return self.CName=0D +=0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D -## InfDefineEntryPointItem=0D +# InfDefineEntryPointItem=0D #=0D +=0D +=0D class InfDefineEntryPointItem(InfDefineImageExeParamItem):=0D def __init__(self):=0D InfDefineImageExeParamItem.__init__(self)=0D =0D -## InfDefineUnloadImageItem=0D +# InfDefineUnloadImageItem=0D #=0D +=0D +=0D class InfDefineUnloadImageItem(InfDefineImageExeParamItem):=0D def __init__(self):=0D InfDefineImageExeParamItem.__init__(self)=0D =0D -## InfDefineConstructorItem=0D +# InfDefineConstructorItem=0D #=0D +=0D +=0D class InfDefineConstructorItem(InfDefineImageExeParamItem):=0D def __init__(self):=0D InfDefineImageExeParamItem.__init__(self)=0D @@ -50,11 +61,14 @@ class InfDefineConstructorItem(InfDefineImageExeParamIt= em): =0D def SetSupModList(self, SupModList):=0D self.SupModList =3D SupModList=0D +=0D def GetSupModList(self):=0D return self.SupModList=0D =0D -## InfDefineDestructorItem=0D +# InfDefineDestructorItem=0D #=0D +=0D +=0D class InfDefineDestructorItem(InfDefineImageExeParamItem):=0D def __init__(self):=0D InfDefineImageExeParamItem.__init__(self)=0D @@ -62,11 +76,14 @@ class InfDefineDestructorItem(InfDefineImageExeParamIte= m): =0D def SetSupModList(self, SupModList):=0D self.SupModList =3D SupModList=0D +=0D def GetSupModList(self):=0D return self.SupModList=0D =0D -## InfDefineLibraryItem=0D +# InfDefineLibraryItem=0D #=0D +=0D +=0D class InfDefineLibraryItem():=0D def __init__(self):=0D self.LibraryName =3D ''=0D @@ -75,9 +92,12 @@ class InfDefineLibraryItem(): =0D def SetLibraryName(self, Name):=0D self.LibraryName =3D Name=0D +=0D def GetLibraryName(self):=0D return self.LibraryName=0D +=0D def SetTypes(self, Type):=0D self.Types =3D Type=0D +=0D def GetTypes(self):=0D return self.Types=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py b= /BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py index a1b691ff0300..aa3d20ae2fa4 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfDefineObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of [Defines] section for INF f= ile.=0D # It will consumed by InfParser=0D #=0D @@ -44,20 +44,22 @@ from Object.Parser.InfDefineCommonObject import InfDefi= neUnloadImageItem from Object.Parser.InfDefineCommonObject import InfDefineConstructorItem=0D from Object.Parser.InfDefineCommonObject import InfDefineDestructorItem=0D =0D +=0D class InfDefSectionOptionRomInfo():=0D def __init__(self):=0D - self.PciVendorId =3D None=0D - self.PciDeviceId =3D None=0D - self.PciClassCode =3D None=0D - self.PciRevision =3D None=0D - self.PciCompress =3D None=0D - self.CurrentLine =3D ['', -1, '']=0D + self.PciVendorId =3D None=0D + self.PciDeviceId =3D None=0D + self.PciClassCode =3D None=0D + self.PciRevision =3D None=0D + self.PciCompress =3D None=0D + self.CurrentLine =3D ['', -1, '']=0D +=0D def SetPciVendorId(self, PciVendorId, Comments):=0D #=0D # Value has been set before.=0D #=0D if self.PciVendorId is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_PCI_VENDOR_ID),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_PCI_VENDOR_ID),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -69,7 +71,7 @@ class InfDefSectionOptionRomInfo(): self.PciVendorId.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciVendorI= d),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (PciVendo= rId),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -81,7 +83,7 @@ class InfDefSectionOptionRomInfo(): # Value has been set before.=0D #=0D if self.PciDeviceId is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_PCI_DEVICE_ID),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_PCI_DEVICE_ID),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -93,7 +95,7 @@ class InfDefSectionOptionRomInfo(): self.PciDeviceId.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciDeviceI= d),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (PciDevic= eId),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -105,7 +107,7 @@ class InfDefSectionOptionRomInfo(): # Value has been set before.=0D #=0D if self.PciClassCode is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_PCI_CLASS_CODE),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_PCI_CLASS_CODE),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -117,7 +119,7 @@ class InfDefSectionOptionRomInfo(): self.PciClassCode.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %=0D (PciClassCode),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D @@ -130,7 +132,7 @@ class InfDefSectionOptionRomInfo(): # Value has been set before.=0D #=0D if self.PciRevision is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_PCI_REVISION),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_PCI_REVISION),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -142,7 +144,7 @@ class InfDefSectionOptionRomInfo(): self.PciRevision.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciRevisio= n),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (PciRevis= ion),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -154,7 +156,7 @@ class InfDefSectionOptionRomInfo(): # Value has been set before.=0D #=0D if self.PciCompress is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_PCI_COMPRESS),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_PCI_COMPRESS),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -167,41 +169,44 @@ class InfDefSectionOptionRomInfo(): self.PciCompress.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PciCompres= s),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (PciCompr= ess),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D +=0D def GetPciCompress(self):=0D return self.PciCompress=0D ##=0D # INF [Define] section Object=0D #=0D +=0D +=0D class InfDefSection(InfDefSectionOptionRomInfo):=0D def __init__(self):=0D - self.BaseName =3D None=0D - self.FileGuid =3D None=0D - self.ModuleType =3D None=0D - self.ModuleUniFileName =3D None=0D - self.InfVersion =3D None=0D - self.EdkReleaseVersion =3D None=0D - self.UefiSpecificationVersion =3D None=0D - self.PiSpecificationVersion =3D None=0D - self.LibraryClass =3D []=0D - self.Package =3D None=0D - self.VersionString =3D None=0D - self.PcdIsDriver =3D None=0D - self.EntryPoint =3D []=0D - self.UnloadImages =3D []=0D - self.Constructor =3D []=0D - self.Destructor =3D []=0D - self.Shadow =3D None=0D - self.CustomMakefile =3D []=0D - self.Specification =3D []=0D - self.UefiHiiResourceSection =3D None=0D - self.DpxSource =3D []=0D - self.CurrentLine =3D ['', -1, '']=0D + self.BaseName =3D None=0D + self.FileGuid =3D None=0D + self.ModuleType =3D None=0D + self.ModuleUniFileName =3D None=0D + self.InfVersion =3D None=0D + self.EdkReleaseVersion =3D None=0D + self.UefiSpecificationVersion =3D None=0D + self.PiSpecificationVersion =3D None=0D + self.LibraryClass =3D []=0D + self.Package =3D None=0D + self.VersionString =3D None=0D + self.PcdIsDriver =3D None=0D + self.EntryPoint =3D []=0D + self.UnloadImages =3D []=0D + self.Constructor =3D []=0D + self.Destructor =3D []=0D + self.Shadow =3D None=0D + self.CustomMakefile =3D []=0D + self.Specification =3D []=0D + self.UefiHiiResourceSection =3D None=0D + self.DpxSource =3D []=0D + self.CurrentLine =3D ['', -1, '']=0D InfDefSectionOptionRomInfo.__init__(self)=0D =0D - ## SetHeadComment=0D + # SetHeadComment=0D #=0D # @param BaseName: BaseName=0D #=0D @@ -210,7 +215,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.BaseName is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_BASE_NAME),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_BASE_NAME),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if not (BaseName =3D=3D '' or BaseName is None):=0D @@ -220,16 +225,16 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.BaseName.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_NAME_INVALID%(BaseName= ),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_NAME_INVALID % (BaseNa= me),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetBaseName=0D + # GetBaseName=0D #=0D def GetBaseName(self):=0D return self.BaseName=0D =0D - ## SetFileGuid=0D + # SetFileGuid=0D #=0D # @param FileGuid: FileGuid=0D #=0D @@ -238,8 +243,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.FileGuid is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_FILE_GUID),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_FILE_GUID),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -251,16 +256,16 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.FileGuid.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_GUID_INVALID%(FileGuid),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_GUID_INVALID % (FileGuid),= =0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetFileGuid=0D + # GetFileGuid=0D #=0D def GetFileGuid(self):=0D return self.FileGuid=0D =0D - ## SetModuleType=0D + # SetModuleType=0D #=0D # @param ModuleType: ModuleType=0D #=0D @@ -269,8 +274,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.ModuleType is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_MODULE_TYPE),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_MODULE_TYPE),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -286,17 +291,17 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.ModuleType.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID%\=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID %=0D (ModuleType),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetModuleType=0D + # GetModuleType=0D #=0D def GetModuleType(self):=0D return self.ModuleType=0D =0D - ## SetModuleUniFileName=0D + # SetModuleUniFileName=0D #=0D # @param ModuleUniFileName: ModuleUniFileName=0D #=0D @@ -304,16 +309,16 @@ class InfDefSection(InfDefSectionOptionRomInfo): if Comments:=0D pass=0D if self.ModuleUniFileName is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_MODULE_UNI_FILE),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_MODULE_UNI_FILE),=0D LineInfo=3Dself.CurrentLine)=0D self.ModuleUniFileName =3D ModuleUniFileName=0D =0D - ## GetModuleType=0D + # GetModuleType=0D #=0D def GetModuleUniFileName(self):=0D return self.ModuleUniFileName=0D =0D - ## SetInfVersion=0D + # SetInfVersion=0D #=0D # @param InfVersion: InfVersion=0D #=0D @@ -322,8 +327,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.InfVersion is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_INF_VERSION),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_INF_VERSION),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -340,7 +345,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): ErrorCode=3DToolError.EDK1_INF_ERROR,=0D LineInfo=3Dself.CurrentLine)=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(InfVersion= ),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (InfVersi= on),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -349,12 +354,12 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.InfVersion.Comments =3D Comments=0D return True=0D =0D - ## GetInfVersion=0D + # GetInfVersion=0D #=0D def GetInfVersion(self):=0D return self.InfVersion=0D =0D - ## SetEdkReleaseVersion=0D + # SetEdkReleaseVersion=0D #=0D # @param EdkReleaseVersion: EdkReleaseVersion=0D #=0D @@ -363,8 +368,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.EdkReleaseVersion is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -377,17 +382,17 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.EdkReleaseVersion.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\=0D - %(EdkReleaseVersion),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID=0D + % (EdkReleaseVersion),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetEdkReleaseVersion=0D + # GetEdkReleaseVersion=0D #=0D def GetEdkReleaseVersion(self):=0D return self.EdkReleaseVersion=0D =0D - ## SetUefiSpecificationVersion=0D + # SetUefiSpecificationVersion=0D #=0D # @param UefiSpecificationVersion: UefiSpecificationVersion=0D #=0D @@ -396,8 +401,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.UefiSpecificationVersion is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION),= =0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -410,17 +415,17 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.UefiSpecificationVersion.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\=0D - %(UefiSpecificationVersion),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID=0D + % (UefiSpecificationVersion),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetUefiSpecificationVersion=0D + # GetUefiSpecificationVersion=0D #=0D def GetUefiSpecificationVersion(self):=0D return self.UefiSpecificationVersion=0D =0D - ## SetPiSpecificationVersion=0D + # SetPiSpecificationVersion=0D #=0D # @param PiSpecificationVersion: PiSpecificationVersion=0D #=0D @@ -429,8 +434,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.PiSpecificationVersion is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -443,17 +448,17 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.PiSpecificationVersion.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\=0D - %(PiSpecificationVersion),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID=0D + % (PiSpecificationVersion),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D - ## GetPiSpecificationVersion=0D + # GetPiSpecificationVersion=0D #=0D def GetPiSpecificationVersion(self):=0D return self.PiSpecificationVersion=0D =0D - ## SetLibraryClass=0D + # SetLibraryClass=0D #=0D # @param LibraryClass: LibraryClass=0D #=0D @@ -470,13 +475,13 @@ class InfDefSection(InfDefSectionOptionRomInfo): TypeList =3D [Type for Type in TypeList if Type !=3D '']=0D for Item in TypeList:=0D if Item not in DT.MODULE_LIST:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID= %(Item),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID= % (Item),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D InfDefineLibraryItemObj.SetTypes(TypeList)=0D self.LibraryClass.append(InfDefineLibraryItemObj)=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Name),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Name),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -490,20 +495,19 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.VersionString is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_VERSION_STRING),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_VERSION_STRING),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if not IsValidDecVersion(VersionString):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID\=0D - %(VersionString),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID=0D + % (VersionString),=0D LineInfo=3Dself.CurrentLine)=0D self.VersionString =3D InfDefMember()=0D self.VersionString.SetValue(VersionString)=0D self.VersionString.Comments =3D Comments=0D return True=0D =0D -=0D def GetVersionString(self):=0D return self.VersionString=0D =0D @@ -512,8 +516,8 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.PcdIsDriver is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND\= =0D - %(DT.TAB_INF_DEFINES_PCD_IS_DRIVER),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D + % (DT.TAB_INF_DEFINES_PCD_IS_DRIVER),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if PcdIsDriver =3D=3D 'PEI_PCD_DRIVER' or PcdIsDriver =3D=3D 'DXE_= PCD_DRIVER':=0D @@ -522,7 +526,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.PcdIsDriver.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(PcdIsDrive= r),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (PcdIsDri= ver),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D =0D @@ -541,13 +545,13 @@ class InfDefSection(InfDefSectionOptionRomInfo): ValueList[0:len(TokenList)] =3D TokenList=0D InfDefineEntryPointItemObj =3D InfDefineEntryPointItem()=0D if not IsValidCVariableName(ValueList[0]):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %=0D (ValueList[0]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineEntryPointItemObj.SetCName(ValueList[0])=0D if len(ValueList) =3D=3D 2:=0D if ValueList[1].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %=0D (ValueList[1]),=0D LineInfo=3Dself.CurrentLine)=0D #=0D @@ -555,12 +559,12 @@ class InfDefSection(InfDefSectionOptionRomInfo): #=0D FeatureFlagRtv =3D IsValidFeatureFlagExp(ValueList[1].strip())= =0D if not FeatureFlagRtv[0]:=0D - ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D%\=0D + ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D %=0D (FeatureFlagRtv[1]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineEntryPointItemObj.SetFeatureFlagExp(ValueList[1])=0D if len(ValueList) > 2:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(EntryPoint= ),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (EntryPoi= nt),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineEntryPointItemObj.Comments =3D Comments=0D self.EntryPoint.append(InfDefineEntryPointItemObj)=0D @@ -580,24 +584,24 @@ class InfDefSection(InfDefSectionOptionRomInfo): ValueList[0:len(TokenList)] =3D TokenList=0D InfDefineUnloadImageItemObj =3D InfDefineUnloadImageItem()=0D if not IsValidCVariableName(ValueList[0]):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[= 0]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (ValueLis= t[0]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineUnloadImageItemObj.SetCName(ValueList[0])=0D if len(ValueList) =3D=3D 2:=0D if ValueList[1].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueL= ist[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Valu= eList[1]),=0D LineInfo=3Dself.CurrentLine)=0D #=0D # Validate FFE=0D #=0D FeatureFlagRtv =3D IsValidFeatureFlagExp(ValueList[1].strip())= =0D if not FeatureFlagRtv[0]:=0D - ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D%(FeatureFlagRtv[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D % (FeatureFlagRtv[1]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineUnloadImageItemObj.SetFeatureFlagExp(ValueList[1])=0D =0D if len(ValueList) > 2:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(UnloadImag= es),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (UnloadIm= ages),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineUnloadImageItemObj.Comments =3D Comments=0D self.UnloadImages.append(InfDefineUnloadImageItemObj)=0D @@ -617,34 +621,34 @@ class InfDefSection(InfDefSectionOptionRomInfo): ValueList[0:len(TokenList)] =3D TokenList=0D InfDefineConstructorItemObj =3D InfDefineConstructorItem()=0D if not IsValidCVariableName(ValueList[0]):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[= 0]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (ValueLis= t[0]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineConstructorItemObj.SetCName(ValueList[0])=0D if len(ValueList) >=3D 2:=0D ModList =3D GetSplitValueList(ValueList[1], ' ')=0D if ValueList[1].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueL= ist[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Valu= eList[1]),=0D LineInfo=3Dself.CurrentLine)=0D for ModItem in ModList:=0D if ModItem not in DT.MODULE_LIST:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID= %(ModItem),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID= % (ModItem),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineConstructorItemObj.SetSupModList(ModList)=0D if len(ValueList) =3D=3D 3:=0D if ValueList[2].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueL= ist[2]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Valu= eList[2]),=0D LineInfo=3Dself.CurrentLine)=0D #=0D # Validate FFE=0D #=0D FeatureFlagRtv =3D IsValidFeatureFlagExp(ValueList[2].strip())= =0D if not FeatureFlagRtv[0]:=0D - ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D%(FeatureFlagRtv[2]),=0D + ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D % (FeatureFlagRtv[2]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineConstructorItemObj.SetFeatureFlagExp(ValueList[2])=0D =0D if len(ValueList) > 3:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Constructo= r),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Construc= tor),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineConstructorItemObj.Comments =3D Comments=0D self.Constructor.append(InfDefineConstructorItemObj)=0D @@ -664,34 +668,34 @@ class InfDefSection(InfDefSectionOptionRomInfo): ValueList[0:len(TokenList)] =3D TokenList=0D InfDefineDestructorItemObj =3D InfDefineDestructorItem()=0D if not IsValidCVariableName(ValueList[0]):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[= 0]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (ValueLis= t[0]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineDestructorItemObj.SetCName(ValueList[0])=0D if len(ValueList) >=3D 2:=0D ModList =3D GetSplitValueList(ValueList[1].strip(), ' ')=0D if ValueList[1].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueL= ist[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Valu= eList[1]),=0D LineInfo=3Dself.CurrentLine)=0D for ModItem in ModList:=0D if ModItem not in DT.MODULE_LIST:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID= %(ModItem),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_MODULETYPE_INVALID= % (ModItem),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineDestructorItemObj.SetSupModList(ModList)=0D if len(ValueList) =3D=3D 3:=0D if ValueList[2].strip() =3D=3D '':=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueL= ist[2]),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Valu= eList[2]),=0D LineInfo=3Dself.CurrentLine)=0D #=0D # Validate FFE=0D #=0D FeatureFlagRtv =3D IsValidFeatureFlagExp(ValueList[2].strip())= =0D if not FeatureFlagRtv[0]:=0D - ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D%(FeatureFlagRtv[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLI= D % (FeatureFlagRtv[1]),=0D LineInfo=3Dself.CurrentLine)=0D InfDefineDestructorItemObj.SetFeatureFlagExp(ValueList[2])=0D =0D if len(ValueList) > 3:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Destructor= ),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Destruct= or),=0D LineInfo=3Dself.CurrentLine)=0D =0D InfDefineDestructorItemObj.Comments =3D Comments=0D @@ -705,7 +709,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): # Value has been set before.=0D #=0D if self.Shadow is not None:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(= DT.TAB_INF_DEFINES_SHADOW),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND %= (DT.TAB_INF_DEFINES_SHADOW),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if (IsValidBoolType(Shadow)):=0D @@ -714,9 +718,10 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.Shadow.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Shadow),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Shadow),= =0D LineInfo=3Dself.CurrentLine)=0D return False=0D +=0D def GetShadow(self):=0D return self.Shadow=0D =0D @@ -736,7 +741,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): Family =3D Family.strip()=0D if Family !=3D '':=0D if not IsValidFamily(Family):=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Fa= mily),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (= Family),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D #=0D @@ -747,11 +752,12 @@ class InfDefSection(InfDefSectionOptionRomInfo): if IsValidPath(FileName, ModulePath):=0D IsValidFileFlag =3D True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALI= D%(FileName),=0D + ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALI= D % (FileName),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if IsValidFileFlag:=0D - FileName =3D ConvPathFromAbsToRel(FileName, GlobalData.gIN= F_MODULE_DIR)=0D + FileName =3D ConvPathFromAbsToRel(=0D + FileName, GlobalData.gINF_MODULE_DIR)=0D self.CustomMakefile.append((Family, FileName, Comments))=0D IsValidFileFlag =3D False=0D return True=0D @@ -785,11 +791,11 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.Specification.append((Name, Version, Comments))=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Versio= n),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Vers= ion),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Name),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Name),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D return True=0D @@ -807,7 +813,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): #=0D if self.UefiHiiResourceSection is not None:=0D ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND=0D - %(DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION),=0D + % (DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if not (UefiHiiResourceSection =3D=3D '' or UefiHiiResourceSection= is None):=0D @@ -817,7 +823,7 @@ class InfDefSection(InfDefSectionOptionRomInfo): self.UefiHiiResourceSection.Comments =3D Comments=0D return True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(UefiHi= iResourceSection),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Uefi= HiiResourceSection),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D else:=0D @@ -835,12 +841,12 @@ class InfDefSection(InfDefSectionOptionRomInfo): if IsValidPath(DpxSource, ModulePath):=0D IsValidFileFlag =3D True=0D else:=0D - ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(D= pxSource),=0D + ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % = (DpxSource),=0D LineInfo=3Dself.CurrentLine)=0D return False=0D if IsValidFileFlag:=0D DpxSource =3D ConvPathFromAbsToRel(DpxSource,=0D - GlobalData.gINF_MODULE_DIR)=0D + GlobalData.gINF_MODULE_DIR)=0D self.DpxSource.append((DpxSource, Comments))=0D IsValidFileFlag =3D False=0D return True=0D @@ -848,69 +854,79 @@ class InfDefSection(InfDefSectionOptionRomInfo): def GetDpxSource(self):=0D return self.DpxSource=0D =0D +=0D gFUNCTION_MAPPING_FOR_DEFINE_SECTION =3D {=0D #=0D # Required Fields=0D #=0D - DT.TAB_INF_DEFINES_BASE_NAME : InfDefSection.SetBase= Name,=0D - DT.TAB_INF_DEFINES_FILE_GUID : InfDefSection.SetFile= Guid,=0D - DT.TAB_INF_DEFINES_MODULE_TYPE : InfDefSection.SetModu= leType,=0D + DT.TAB_INF_DEFINES_BASE_NAME: InfDefSection.SetBaseName,=0D + DT.TAB_INF_DEFINES_FILE_GUID: InfDefSection.SetFileGuid,=0D + DT.TAB_INF_DEFINES_MODULE_TYPE: InfDefSection.SetModuleType,=0D #=0D # Required by EDKII style INF file=0D #=0D - DT.TAB_INF_DEFINES_INF_VERSION : InfDefSection.SetInfV= ersion,=0D + DT.TAB_INF_DEFINES_INF_VERSION: InfDefSection.SetInfVersion,=0D #=0D # Optional Fields=0D #=0D - DT.TAB_INF_DEFINES_MODULE_UNI_FILE : InfDefSection.SetModu= leUniFileName,=0D - DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION : InfDefSection.SetEdkR= eleaseVersion,=0D - DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION : InfDefSection.SetUefi= SpecificationVersion,=0D - DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION : InfDefSection.SetPiSp= ecificationVersion,=0D - DT.TAB_INF_DEFINES_LIBRARY_CLASS : InfDefSection.SetLibr= aryClass,=0D - DT.TAB_INF_DEFINES_VERSION_STRING : InfDefSection.SetVers= ionString,=0D - DT.TAB_INF_DEFINES_PCD_IS_DRIVER : InfDefSection.SetPcdI= sDriver,=0D - DT.TAB_INF_DEFINES_ENTRY_POINT : InfDefSection.SetEntr= yPoint,=0D - DT.TAB_INF_DEFINES_UNLOAD_IMAGE : InfDefSection.SetUnlo= adImages,=0D - DT.TAB_INF_DEFINES_CONSTRUCTOR : InfDefSection.SetCons= tructor,=0D - DT.TAB_INF_DEFINES_DESTRUCTOR : InfDefSection.SetDest= ructor,=0D - DT.TAB_INF_DEFINES_SHADOW : InfDefSection.SetShad= ow,=0D - DT.TAB_INF_DEFINES_PCI_VENDOR_ID : InfDefSection.SetPciV= endorId,=0D - DT.TAB_INF_DEFINES_PCI_DEVICE_ID : InfDefSection.SetPciD= eviceId,=0D - DT.TAB_INF_DEFINES_PCI_CLASS_CODE : InfDefSection.SetPciC= lassCode,=0D - DT.TAB_INF_DEFINES_PCI_REVISION : InfDefSection.SetPciR= evision,=0D - DT.TAB_INF_DEFINES_PCI_COMPRESS : InfDefSection.SetPciC= ompress,=0D - DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE : InfDefSection.SetCust= omMakefile,=0D - DT.TAB_INF_DEFINES_SPEC : InfDefSection.SetSpec= ification,=0D - DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION : InfDefSection.SetUefi= HiiResourceSection,=0D - DT.TAB_INF_DEFINES_DPX_SOURCE : InfDefSection.SetDpxS= ource=0D + DT.TAB_INF_DEFINES_MODULE_UNI_FILE: InfDefSection.SetModuleUniFileName= ,=0D + DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION: InfDefSection.SetEdkReleaseVer= sion,=0D + DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION: InfDefSection.SetUefiSp= ecificationVersion,=0D + DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION: InfDefSection.SetPiSpecif= icationVersion,=0D + DT.TAB_INF_DEFINES_LIBRARY_CLASS: InfDefSection.SetLibraryClass,=0D + DT.TAB_INF_DEFINES_VERSION_STRING: InfDefSection.SetVersionString,=0D + DT.TAB_INF_DEFINES_PCD_IS_DRIVER: InfDefSection.SetPcdIsDriver,=0D + DT.TAB_INF_DEFINES_ENTRY_POINT: InfDefSection.SetEntryPoint,=0D + DT.TAB_INF_DEFINES_UNLOAD_IMAGE: InfDefSection.SetUnloadImages,=0D + DT.TAB_INF_DEFINES_CONSTRUCTOR: InfDefSection.SetConstructor,=0D + DT.TAB_INF_DEFINES_DESTRUCTOR: InfDefSection.SetDestructor,=0D + DT.TAB_INF_DEFINES_SHADOW: InfDefSection.SetShadow,=0D + DT.TAB_INF_DEFINES_PCI_VENDOR_ID: InfDefSection.SetPciVendorId,=0D + DT.TAB_INF_DEFINES_PCI_DEVICE_ID: InfDefSection.SetPciDeviceId,=0D + DT.TAB_INF_DEFINES_PCI_CLASS_CODE: InfDefSection.SetPciClassCode,=0D + DT.TAB_INF_DEFINES_PCI_REVISION: InfDefSection.SetPciRevision,=0D + DT.TAB_INF_DEFINES_PCI_COMPRESS: InfDefSection.SetPciCompress,=0D + DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE: InfDefSection.SetCustomMakefile,=0D + DT.TAB_INF_DEFINES_SPEC: InfDefSection.SetSpecification,=0D + DT.TAB_INF_DEFINES_UEFI_HII_RESOURCE_SECTION: InfDefSection.SetUefiHii= ResourceSection,=0D + DT.TAB_INF_DEFINES_DPX_SOURCE: InfDefSection.SetDpxSource=0D }=0D =0D -## InfDefMember=0D +# InfDefMember=0D #=0D #=0D +=0D +=0D class InfDefMember():=0D def __init__(self, Name=3D'', Value=3D''):=0D self.Comments =3D InfLineCommentObject()=0D - self.Name =3D Name=0D + self.Name =3D Name=0D self.Value =3D Value=0D self.CurrentLine =3D CurrentLine()=0D +=0D def GetName(self):=0D return self.Name=0D +=0D def SetName(self, Name):=0D self.Name =3D Name=0D +=0D def GetValue(self):=0D return self.Value=0D +=0D def SetValue(self, Value):=0D self.Value =3D Value=0D =0D -## InfDefObject=0D +# InfDefObject=0D #=0D #=0D +=0D +=0D class InfDefObject(InfSectionCommonDef):=0D def __init__(self):=0D self.Defines =3D Sdict()=0D InfSectionCommonDef.__init__(self)=0D - def SetDefines(self, DefineContent, Arch =3D None):=0D +=0D + def SetDefines(self, DefineContent, Arch=3DNone):=0D #=0D # Validate Arch=0D #=0D @@ -926,16 +942,19 @@ class InfDefObject(InfSectionCommonDef): Value =3D InfDefMemberObj.GetValue()=0D if Name =3D=3D DT.TAB_INF_DEFINES_MODULE_UNI_FILE:=0D ValidateUNIFilePath(Value)=0D - Value =3D os.path.join(os.path.dirname(InfDefMemberObj.Cur= rentLine.FileName), Value)=0D + Value =3D os.path.join(os.path.dirname(=0D + InfDefMemberObj.CurrentLine.FileName), Value)=0D if not os.path.isfile(Value) or not os.path.exists(Value):= =0D LineInfo[0] =3D InfDefMemberObj.CurrentLine.GetFileNam= e()=0D LineInfo[1] =3D InfDefMemberObj.CurrentLine.GetLineNo(= )=0D LineInfo[2] =3D InfDefMemberObj.CurrentLine.GetLineStr= ing()=0D - ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_IN= VALID%(Name),=0D - LineInfo=3DLineInfo)=0D + ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_IN= VALID % (Name),=0D + LineInfo=3DLineInfo)=0D InfLineCommentObj =3D InfLineCommentObject()=0D - InfLineCommentObj.SetHeaderComments(InfDefMemberObj.Comments.G= etHeaderComments())=0D - InfLineCommentObj.SetTailComments(InfDefMemberObj.Comments.Get= TailComments())=0D + InfLineCommentObj.SetHeaderComments(=0D + InfDefMemberObj.Comments.GetHeaderComments())=0D + InfLineCommentObj.SetTailComments(=0D + InfDefMemberObj.Comments.GetTailComments())=0D if Name =3D=3D 'COMPONENT_TYPE':=0D ErrorInInf(ST.ERR_INF_PARSER_NOT_SUPPORT_EDKI_INF,=0D ErrorCode=3DToolError.EDK1_INF_ERROR,=0D @@ -961,7 +980,7 @@ class InfDefObject(InfSectionCommonDef): # Found the process function from mapping table.=0D #=0D if Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.ke= ys():=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWOR= D_INVALID%(Name),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWOR= D_INVALID % (Name),=0D LineInfo=3DLineInfo)=0D else:=0D ProcessFunc =3D gFUNCTION_MAPPING_FOR_DEFINE_SECTI= ON[Name]=0D @@ -978,7 +997,7 @@ class InfDefObject(InfSectionCommonDef): # Found the process function from mapping table.=0D #=0D if Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.ke= ys():=0D - ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWOR= D_INVALID%(Name),=0D + ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWOR= D_INVALID % (Name),=0D LineInfo=3DLineInfo)=0D #=0D # Found the process function from mapping table.=0D @@ -999,4 +1018,3 @@ class InfDefObject(InfSectionCommonDef): =0D def GetDefines(self):=0D return self.Defines=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py b/= BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py index 0de663291c11..870ca3317f16 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfDepexObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Depex] section.=0D # It will consumed by InfParser.=0D #=0D @@ -19,6 +19,7 @@ from Logger import StringTable as ST from Object.Parser.InfCommonObject import InfSectionCommonDef=0D from Library.ParserValidate import IsValidArch=0D =0D +=0D class InfDepexContentItem():=0D def __init__(self):=0D self.SectionType =3D ''=0D @@ -26,11 +27,13 @@ class InfDepexContentItem(): =0D def SetSectionType(self, SectionType):=0D self.SectionType =3D SectionType=0D +=0D def GetSectionType(self):=0D return self.SectionType=0D =0D def SetSectionString(self, SectionString):=0D self.SectionString =3D SectionString=0D +=0D def GetSectionString(self):=0D return self.SectionString=0D =0D @@ -46,38 +49,46 @@ class InfDepexItem(): =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetSupArch(self, Arch):=0D self.SupArch =3D Arch=0D +=0D def GetSupArch(self):=0D return self.SupArch=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetModuleType(self, Type):=0D self.ModuleType =3D Type=0D +=0D def GetModuleType(self):=0D return self.ModuleType=0D =0D def SetDepexConent(self, Content):=0D self.DepexContent =3D Content=0D +=0D def GetDepexContent(self):=0D return self.DepexContent=0D =0D def SetInfDepexContentItemList(self, InfDepexContentItemList):=0D self.InfDepexContentItemList =3D InfDepexContentItemList=0D +=0D def GetInfDepexContentItemList(self):=0D return self.InfDepexContentItemList=0D =0D -## InfDepexObject=0D +# InfDepexObject=0D #=0D #=0D #=0D +=0D +=0D class InfDepexObject(InfSectionCommonDef):=0D def __init__(self):=0D self.Depex =3D []=0D @@ -112,7 +123,8 @@ class InfDepexObject(InfSectionCommonDef): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TY= PE_ERROR % (ModuleType),=0D + ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TY= PE_ERROR % (=0D + ModuleType),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DKeyItem[2])=0D =0D @@ -127,7 +139,8 @@ class InfDepexObject(InfSectionCommonDef): for Line in DepexContent:=0D LineContent =3D Line[0].strip()=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - LineContent =3D LineContent[:LineContent.find(DT.TAB_C= OMMENT_SPLIT)]=0D + LineContent =3D LineContent[:LineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D if LineContent:=0D DepexString =3D DepexString + LineContent + DT.END_OF_= LINE=0D continue=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py b/B= aseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py index 3e0bc8044003..997f8da17f63 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfGuidObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Guids] section.=0D # It will consumed by InfParser.=0D #=0D @@ -20,6 +20,7 @@ import Logger.Log as Logger from Logger import ToolError=0D from Logger import StringTable as ST=0D =0D +=0D class InfGuidItemCommentContent():=0D def __init__(self):=0D #=0D @@ -45,24 +46,29 @@ class InfGuidItemCommentContent(): =0D def SetUsageItem(self, UsageItem):=0D self.UsageItem =3D UsageItem=0D +=0D def GetUsageItem(self):=0D return self.UsageItem=0D =0D def SetGuidTypeItem(self, GuidTypeItem):=0D self.GuidTypeItem =3D GuidTypeItem=0D +=0D def GetGuidTypeItem(self):=0D return self.GuidTypeItem=0D =0D def SetVariableNameItem(self, VariableNameItem):=0D self.VariableNameItem =3D VariableNameItem=0D +=0D def GetVariableNameItem(self):=0D return self.VariableNameItem=0D =0D def SetHelpStringItem(self, HelpStringItem):=0D self.HelpStringItem =3D HelpStringItem=0D +=0D def GetHelpStringItem(self):=0D return self.HelpStringItem=0D =0D +=0D class InfGuidItem():=0D def __init__(self):=0D self.Name =3D ''=0D @@ -75,33 +81,39 @@ class InfGuidItem(): =0D def SetName(self, Name):=0D self.Name =3D Name=0D +=0D def GetName(self):=0D return self.Name=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetCommentList(self, CommentList):=0D self.CommentList =3D CommentList=0D +=0D def GetCommentList(self):=0D return self.CommentList=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D -## ParseComment=0D +# ParseComment=0D #=0D # ParseComment=0D #=0D +=0D +=0D def ParseGuidComment(CommentsList, InfGuidItemObj):=0D #=0D # Get/Set Usage and HelpString=0D #=0D - if CommentsList is not None and len(CommentsList) !=3D 0 :=0D + if CommentsList is not None and len(CommentsList) !=3D 0:=0D CommentInsList =3D []=0D PreUsage =3D None=0D PreGuidType =3D None=0D @@ -111,14 +123,14 @@ def ParseGuidComment(CommentsList, InfGuidItemObj): for CommentItem in CommentsList:=0D Count =3D Count + 1=0D CommentItemUsage, \=0D - CommentItemGuidType, \=0D - CommentItemVarString, \=0D - CommentItemHelpText =3D \=0D - ParseComment(CommentItem,=0D - DT.ALL_USAGE_TOKENS,=0D - DT.GUID_TYPE_TOKENS,=0D - [],=0D - True)=0D + CommentItemGuidType, \=0D + CommentItemVarString, \=0D + CommentItemHelpText =3D \=0D + ParseComment(CommentItem,=0D + DT.ALL_USAGE_TOKENS,=0D + DT.GUID_TYPE_TOKENS,=0D + [],=0D + True)=0D =0D if CommentItemHelpText is None:=0D CommentItemHelpText =3D ''=0D @@ -158,7 +170,8 @@ def ParseGuidComment(CommentsList, InfGuidItemObj): CommentItemIns.SetGuidTypeItem(CommentItemGuidType)=0D CommentItemIns.SetVariableNameItem(CommentItemVarString)=0D if CommentItemHelpText =3D=3D '' or CommentItemHelpText.en= dswith(DT.END_OF_LINE):=0D - CommentItemHelpText =3D CommentItemHelpText.strip(DT.E= ND_OF_LINE)=0D + CommentItemHelpText =3D CommentItemHelpText.strip(=0D + DT.END_OF_LINE)=0D CommentItemIns.SetHelpStringItem(CommentItemHelpText)=0D CommentInsList.append(CommentItemIns)=0D =0D @@ -186,7 +199,8 @@ def ParseGuidComment(CommentsList, InfGuidItemObj): CommentItemIns.SetGuidTypeItem(CommentItemGuidType)=0D CommentItemIns.SetVariableNameItem(CommentItemVarString)=0D if CommentItemHelpText =3D=3D '' or CommentItemHelpText.en= dswith(DT.END_OF_LINE):=0D - CommentItemHelpText =3D CommentItemHelpText.strip(DT.E= ND_OF_LINE)=0D + CommentItemHelpText =3D CommentItemHelpText.strip(=0D + DT.END_OF_LINE)=0D CommentItemIns.SetHelpStringItem(CommentItemHelpText)=0D CommentInsList.append(CommentItemIns)=0D =0D @@ -212,10 +226,12 @@ def ParseGuidComment(CommentsList, InfGuidItemObj): =0D return InfGuidItemObj=0D =0D -## InfGuidObject=0D +# InfGuidObject=0D #=0D # InfGuidObject=0D #=0D +=0D +=0D class InfGuidObject():=0D def __init__(self):=0D self.Guids =3D Sdict()=0D @@ -224,7 +240,7 @@ class InfGuidObject(): #=0D self.Macros =3D {}=0D =0D - def SetGuid(self, GuidList, Arch =3D None):=0D + def SetGuid(self, GuidList, Arch=3DNone):=0D __SupportArchList =3D []=0D for ArchItem in Arch:=0D #=0D @@ -252,7 +268,7 @@ class InfGuidObject(): if not IsValidCVariableName(Item[0]):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0])= ,=0D + ST.ERR_INF_PARSER_INVALID_CNAME % (Item[0= ]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -285,7 +301,8 @@ class InfGuidObject(): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID%(FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py b= /BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py index 087edca93bc3..67b7b3267731 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file header.=0D # It will consumed by InfParser.=0D #=0D @@ -10,7 +10,7 @@ InfHeaderObject=0D '''=0D =0D -## INF file header object=0D +# INF file header object=0D #=0D # A sample file header=0D #=0D @@ -24,15 +24,17 @@ InfHeaderObject # # License=0D # #=0D #=0D +=0D +=0D class InfHeaderObject():=0D def __init__(self):=0D - self.FileName =3D ''=0D - self.Abstract =3D ''=0D + self.FileName =3D ''=0D + self.Abstract =3D ''=0D self.Description =3D ''=0D - self.Copyright =3D ''=0D - self.License =3D ''=0D + self.Copyright =3D ''=0D + self.License =3D ''=0D =0D - ## SetFileName=0D + # SetFileName=0D #=0D # @param FileName: File Name=0D #=0D @@ -43,12 +45,12 @@ class InfHeaderObject(): else:=0D return False=0D =0D - ## GetFileName=0D + # GetFileName=0D #=0D def GetFileName(self):=0D return self.FileName=0D =0D - ## SetAbstract=0D + # SetAbstract=0D #=0D # @param Abstract: Abstract=0D #=0D @@ -59,12 +61,12 @@ class InfHeaderObject(): else:=0D return False=0D =0D - ## GetAbstract=0D + # GetAbstract=0D #=0D def GetAbstract(self):=0D return self.Abstract=0D =0D - ## SetDescription=0D + # SetDescription=0D #=0D # @param Description: Description content=0D #=0D @@ -75,12 +77,12 @@ class InfHeaderObject(): else:=0D return False=0D =0D - ## GetAbstract=0D + # GetAbstract=0D #=0D def GetDescription(self):=0D return self.Description=0D =0D - ## SetCopyright=0D + # SetCopyright=0D #=0D # @param Copyright: Copyright content=0D #=0D @@ -91,12 +93,12 @@ class InfHeaderObject(): else:=0D return False=0D =0D - ## GetCopyright=0D + # GetCopyright=0D #=0D def GetCopyright(self):=0D return self.Copyright=0D =0D - ## SetCopyright=0D + # SetCopyright=0D #=0D # @param License: License content=0D #=0D @@ -107,7 +109,7 @@ class InfHeaderObject(): else:=0D return False=0D =0D - ## GetLicense=0D + # GetLicense=0D #=0D def GetLicense(self):=0D return self.License=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObj= ect.py b/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.= py index 2e56028318a1..423fb15fe43f 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfLibraryClassesObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [LibraryClasses] s= ection.=0D # It will consumed by InfParser.=0D #=0D @@ -20,10 +20,12 @@ from Object.Parser.InfCommonObject import CurrentLine from Library.ExpressionValidate import IsValidFeatureFlagExp=0D from Library.ParserValidate import IsValidLibName=0D =0D -## GetArchModuleType=0D +# GetArchModuleType=0D #=0D # Get Arch List and ModuleType List=0D #=0D +=0D +=0D def GetArchModuleType(KeyList):=0D __SupArchList =3D []=0D __SupModuleList =3D []=0D @@ -62,26 +64,31 @@ class InfLibraryClassItem(): =0D def SetLibName(self, LibName):=0D self.LibName =3D LibName=0D +=0D def GetLibName(self):=0D return self.LibName=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D def SetSupModuleList(self, SupModuleList):=0D self.SupModuleList =3D SupModuleList=0D +=0D def GetSupModuleList(self):=0D return self.SupModuleList=0D =0D @@ -90,18 +97,22 @@ class InfLibraryClassItem(): #=0D def SetFileGuid(self, FileGuid):=0D self.FileGuid =3D FileGuid=0D +=0D def GetFileGuid(self):=0D return self.FileGuid=0D =0D def SetVersion(self, Version):=0D self.Version =3D Version=0D +=0D def GetVersion(self):=0D return self.Version=0D =0D -## INF LibraryClass Section=0D +# INF LibraryClass Section=0D #=0D #=0D #=0D +=0D +=0D class InfLibraryClassObject():=0D def __init__(self):=0D self.LibraryClasses =3D Sdict()=0D @@ -110,7 +121,7 @@ class InfLibraryClassObject(): #=0D self.Macros =3D {}=0D =0D - ##SetLibraryClasses=0D + # SetLibraryClasses=0D #=0D #=0D # @param HelpString: It can be a common comment or contain a recom= mend=0D @@ -139,15 +150,16 @@ class InfLibraryClassObject(): LibItemObj.SetLibName(LibItem[0])=0D else:=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_LIB_NAME= _INVALID,=0D - File=3DGlobalData.gINF_MODULE_NAM= E,=0D - Line=3DLibItemObj.CurrentLine.Get= LineNo(),=0D - ExtraData=3DLibItemObj.CurrentLin= e.GetLineString())=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_DEFINE_LIB_= NAME_INVALID,=0D + File=3DGlobalData.gINF_MODULE= _NAME,=0D + Line=3DLibItemObj.CurrentLine= .GetLineNo(),=0D + ExtraData=3DLibItemObj.Curren= tLine.GetLineString())=0D else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_I= NVALID % (LibItem[0]),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_I= NVALID % (=0D + LibItem[0]),=0D File=3DGlobalData.gINF_MODULE_NAM= E,=0D Line=3DLibItemObj.CurrentLine.Get= LineNo(),=0D ExtraData=3DLibItemObj.CurrentLin= e.GetLineString())=0D @@ -173,7 +185,8 @@ class InfLibraryClassObject(): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DLibItemObj.CurrentLine.GetLine= No(),=0D ExtraData=3DLibItemObj.CurrentLine.Ge= tLineString())=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py b/BaseToo= ls/Source/Python/UPT/Object/Parser/InfMisc.py index 469d6fbb15ab..a07219d5b5cd 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfMisc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file miscellaneous.=0D # Include BootMode/HOB/Event and others. It will consumed by InfParser.=0D #=0D @@ -20,6 +20,8 @@ from Library.Misc import Sdict ##=0D # BootModeObject=0D #=0D +=0D +=0D class InfBootModeObject():=0D def __init__(self):=0D self.SupportedBootModes =3D ''=0D @@ -28,21 +30,26 @@ class InfBootModeObject(): =0D def SetSupportedBootModes(self, SupportedBootModes):=0D self.SupportedBootModes =3D SupportedBootModes=0D +=0D def GetSupportedBootModes(self):=0D return self.SupportedBootModes=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetUsage(self, Usage):=0D self.Usage =3D Usage=0D +=0D def GetUsage(self):=0D return self.Usage=0D ##=0D # EventObject=0D #=0D +=0D +=0D class InfEventObject():=0D def __init__(self):=0D self.EventType =3D ''=0D @@ -57,16 +64,20 @@ class InfEventObject(): =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetUsage(self, Usage):=0D self.Usage =3D Usage=0D +=0D def GetUsage(self):=0D return self.Usage=0D ##=0D # HobObject=0D #=0D +=0D +=0D class InfHobObject():=0D def __init__(self):=0D self.HobType =3D ''=0D @@ -82,28 +93,33 @@ class InfHobObject(): =0D def SetUsage(self, Usage):=0D self.Usage =3D Usage=0D +=0D def GetUsage(self):=0D return self.Usage=0D =0D def SetSupArchList(self, ArchList):=0D self.SupArchList =3D ArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D ##=0D # InfSpecialCommentObject=0D #=0D +=0D +=0D class InfSpecialCommentObject(InfSectionCommonDef):=0D def __init__(self):=0D self.SpecialComments =3D Sdict()=0D InfSectionCommonDef.__init__(self)=0D =0D - def SetSpecialComments(self, SepcialSectionList =3D None, Type =3D '')= :=0D + def SetSpecialComments(self, SepcialSectionList=3DNone, Type=3D''):=0D if Type =3D=3D DT.TYPE_HOB_SECTION or \=0D Type =3D=3D DT.TYPE_EVENT_SECTION or \=0D Type =3D=3D DT.TYPE_BOOTMODE_SECTION:=0D @@ -123,8 +139,7 @@ class InfSpecialCommentObject(InfSectionCommonDef): return self.SpecialComments=0D =0D =0D -=0D -## ErrorInInf=0D +# ErrorInInf=0D #=0D # An encapsulate of Error for INF parser.=0D #=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py= b/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py index 0e8fc7d98b3f..fe75340e8f37 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfPackagesObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Packages] section= .=0D # It will consumed by InfParser.=0D #=0D @@ -19,38 +19,43 @@ from Library.Misc import Sdict from Library.ParserValidate import IsValidPath=0D from Library.ExpressionValidate import IsValidFeatureFlagExp=0D =0D +=0D class InfPackageItem():=0D def __init__(self,=0D - PackageName =3D '',=0D - FeatureFlagExp =3D '',=0D - HelpString =3D ''):=0D - self.PackageName =3D PackageName=0D + PackageName=3D'',=0D + FeatureFlagExp=3D'',=0D + HelpString=3D''):=0D + self.PackageName =3D PackageName=0D self.FeatureFlagExp =3D FeatureFlagExp=0D - self.HelpString =3D HelpString=0D - self.SupArchList =3D []=0D + self.HelpString =3D HelpString=0D + self.SupArchList =3D []=0D =0D def SetPackageName(self, PackageName):=0D self.PackageName =3D PackageName=0D +=0D def GetPackageName(self):=0D return self.PackageName=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetHelpString(self, HelpString):=0D self.HelpString =3D HelpString=0D +=0D def GetHelpString(self):=0D return self.HelpString=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D =0D -## INF package section=0D +# INF package section=0D #=0D #=0D #=0D @@ -60,11 +65,11 @@ class InfPackageObject(): #=0D # Macro defined in this section should be only used in this sectio= n.=0D #=0D - self.Macros =3D {}=0D + self.Macros =3D {}=0D =0D - def SetPackages(self, PackageData, Arch =3D None):=0D + def SetPackages(self, PackageData, Arch=3DNone):=0D IsValidFileFlag =3D False=0D - SupArchList =3D []=0D + SupArchList =3D []=0D for ArchItem in Arch:=0D #=0D # Validate Arch=0D @@ -94,7 +99,8 @@ class InfPackageObject(): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID%(PackageItem[0]),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (=0D + PackageItem[0]),=0D File=3DCurrentLineOfPackItem[2],=0D Line=3DCurrentLineOfPackItem[1],=0D ExtraData=3DCurrentLineOfPackItem[0])=0D @@ -119,7 +125,8 @@ class InfPackageObject(): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID%(FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfPackItem[2],=0D Line=3DCurrentLineOfPackItem[1],=0D ExtraData=3DCurrentLineOfPackItem[0])=0D @@ -176,6 +183,6 @@ class InfPackageObject(): =0D return True=0D =0D - def GetPackages(self, Arch =3D None):=0D + def GetPackages(self, Arch=3DNone):=0D if Arch is None:=0D return self.Packages=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py b/Ba= seTools/Source/Python/UPT/Object/Parser/InfPcdObject.py index fd8065fab5f4..717834a4aec0 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfPcdObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Pcds] section.=0D # It will consumed by InfParser.=0D #=0D @@ -33,6 +33,7 @@ from Parser.DecParser import Dec =0D from Object.Parser.InfPackagesObject import InfPackageItem=0D =0D +=0D def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList)= :=0D #=0D # Validate Arch=0D @@ -46,7 +47,8 @@ def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchD= ict, SupArchList): if not IsValidArch(ArchItemNew):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (Ar= chItemNew),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID % (=0D + ArchItemNew),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DLineNo,=0D ExtraData=3DArchItemNew)=0D @@ -56,6 +58,7 @@ def ValidateArch(ArchItem, PcdTypeItem1, LineNo, SupArchD= ict, SupArchList): =0D return SupArchList, SupArchDict=0D =0D +=0D def ParsePcdComment(CommentList, PcdTypeItem, PcdItemObj):=0D CommentInsList =3D []=0D PreUsage =3D None=0D @@ -67,10 +70,10 @@ def ParsePcdComment(CommentList, PcdTypeItem, PcdItemOb= j): for CommentItem in CommentList:=0D Count =3D Count + 1=0D CommentItemUsage, CommentType, CommentString, CommentItemHelpText = =3D ParseComment(CommentItem,=0D - = DT.ALL_USAGE_TOKENS,=0D - = {},=0D - = [],=0D - = False)=0D + = DT.ALL_USAGE_TOKENS,=0D + = {},=0D + = [],=0D + = False)=0D if CommentType and CommentString:=0D pass=0D =0D @@ -162,6 +165,7 @@ def ParsePcdComment(CommentList, PcdTypeItem, PcdItemOb= j): =0D return PcdItemObj=0D =0D +=0D class InfPcdItemCommentContent():=0D def __init__(self):=0D #=0D @@ -175,15 +179,17 @@ class InfPcdItemCommentContent(): =0D def SetUsageItem(self, UsageItem):=0D self.UsageItem =3D UsageItem=0D +=0D def GetUsageItem(self):=0D return self.UsageItem=0D =0D def SetHelpStringItem(self, HelpStringItem):=0D self.HelpStringItem =3D HelpStringItem=0D +=0D def GetHelpStringItem(self):=0D return self.HelpStringItem=0D =0D -## InfPcdItem=0D +# InfPcdItem=0D #=0D # This class defined Pcd item used in Module files=0D #=0D @@ -199,6 +205,8 @@ class InfPcdItemCommentContent(): # @param SkuInfoList: Input value for SkuInfoList, default is {}= =0D # @param SupModuleList: Input value for SupModuleList, default is [= ]=0D #=0D +=0D +=0D class InfPcdItem():=0D def __init__(self):=0D self.CName =3D ''=0D @@ -219,71 +227,85 @@ class InfPcdItem(): =0D def SetCName(self, CName):=0D self.CName =3D CName=0D +=0D def GetCName(self):=0D return self.CName=0D =0D def SetToken(self, Token):=0D self.Token =3D Token=0D +=0D def GetToken(self):=0D return self.Token=0D =0D def SetTokenSpaceGuidCName(self, TokenSpaceGuidCName):=0D self.TokenSpaceGuidCName =3D TokenSpaceGuidCName=0D +=0D def GetTokenSpaceGuidCName(self):=0D return self.TokenSpaceGuidCName=0D =0D def SetTokenSpaceGuidValue(self, TokenSpaceGuidValue):=0D self.TokenSpaceGuidValue =3D TokenSpaceGuidValue=0D +=0D def GetTokenSpaceGuidValue(self):=0D return self.TokenSpaceGuidValue=0D =0D def SetDatumType(self, DatumType):=0D self.DatumType =3D DatumType=0D +=0D def GetDatumType(self):=0D return self.DatumType=0D =0D def SetMaxDatumSize(self, MaxDatumSize):=0D self.MaxDatumSize =3D MaxDatumSize=0D +=0D def GetMaxDatumSize(self):=0D return self.MaxDatumSize=0D =0D def SetDefaultValue(self, DefaultValue):=0D self.DefaultValue =3D DefaultValue=0D +=0D def GetDefaultValue(self):=0D return self.DefaultValue=0D =0D def SetPcdErrorsList(self, PcdErrorsList):=0D self.PcdErrorsList =3D PcdErrorsList=0D +=0D def GetPcdErrorsList(self):=0D return self.PcdErrorsList=0D =0D def SetItemType(self, ItemType):=0D self.ItemType =3D ItemType=0D +=0D def GetItemType(self):=0D return self.ItemType=0D =0D def SetSupModuleList(self, SupModuleList):=0D self.SupModuleList =3D SupModuleList=0D +=0D def GetSupModuleList(self):=0D return self.SupModuleList=0D =0D def SetHelpStringList(self, HelpStringList):=0D self.HelpStringList =3D HelpStringList=0D +=0D def GetHelpStringList(self):=0D return self.HelpStringList=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetSupportArchList(self, ArchList):=0D self.SupArchList =3D ArchList=0D +=0D def GetSupportArchList(self):=0D return self.SupArchList=0D =0D def SetOffset(self, Offset):=0D self.Offset =3D Offset=0D +=0D def GetOffset(self):=0D return self.Offset=0D =0D @@ -297,6 +319,8 @@ class InfPcdItem(): #=0D #=0D #=0D +=0D +=0D class InfPcdObject():=0D def __init__(self, FileName):=0D self.Pcds =3D Sdict()=0D @@ -315,7 +339,8 @@ class InfPcdObject(): SupArchDict =3D {}=0D PcdTypeItem =3D ''=0D for (PcdTypeItem1, ArchItem, LineNo) in KeysList:=0D - SupArchList, SupArchDict =3D ValidateArch(ArchItem, PcdTypeIte= m1, LineNo, SupArchDict, SupArchList)=0D + SupArchList, SupArchDict =3D ValidateArch(=0D + ArchItem, PcdTypeItem1, LineNo, SupArchDict, SupArchList)= =0D =0D #=0D # Validate PcdType=0D @@ -326,7 +351,8 @@ class InfPcdObject(): if not IsValidPcdType(PcdTypeItem1):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_PCD_SECTION_TYPE_ERROR = % (DT.PCD_USAGE_TYPE_LIST_OF_MODULE),=0D + ST.ERR_INF_PARSER_PCD_SECTION_TYPE_ERROR = % (=0D + DT.PCD_USAGE_TYPE_LIST_OF_MODULE),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DLineNo,=0D ExtraData=3DPcdTypeItem1)=0D @@ -341,14 +367,16 @@ class InfPcdObject(): PcdItem =3D PcdItem[0]=0D =0D if CommentList is not None and len(CommentList) !=3D 0:=0D - PcdItemObj =3D ParsePcdComment(CommentList, PcdTypeIte= m, PcdItemObj)=0D + PcdItemObj =3D ParsePcdComment(=0D + CommentList, PcdTypeItem, PcdItemObj)=0D else:=0D CommentItemIns =3D InfPcdItemCommentContent()=0D CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)=0D PcdItemObj.SetHelpStringList([CommentItemIns])=0D =0D if len(PcdItem) >=3D 1 and len(PcdItem) <=3D 3:=0D - PcdItemObj =3D SetPcdName(PcdItem, CurrentLineOfPcdIte= m, PcdItemObj)=0D + PcdItemObj =3D SetPcdName(=0D + PcdItem, CurrentLineOfPcdItem, PcdItemObj)=0D =0D if len(PcdItem) >=3D 2 and len(PcdItem) <=3D 3:=0D #=0D @@ -385,7 +413,8 @@ class InfPcdObject(): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SY= NTAX_INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfPcdItem[2],=0D Line=3DCurrentLineOfPcdItem[1],=0D ExtraData=3DCurrentLineOfPcdItem[0])= =0D @@ -429,9 +458,11 @@ class InfPcdObject(): CommentItemIns =3D InfPcdItemCommentContent()=0D CommentItemIns.SetHelpStringItem(CommentString)=0D CommentItemIns.SetUsageItem(CommentString)=0D - PcdItemObj.SetHelpStringList(PcdItemObj.GetHelpStringList(= ) + [CommentItemIns])=0D + PcdItemObj.SetHelpStringList(=0D + PcdItemObj.GetHelpStringList() + [CommentItemIns])=0D if PcdItemObj.GetValidUsage():=0D - PcdItemObj.SetValidUsage(PcdItemObj.GetValidUsage() + = DT.TAB_VALUE_SPLIT + CommentString)=0D + PcdItemObj.SetValidUsage(=0D + PcdItemObj.GetValidUsage() + DT.TAB_VALUE_SPLIT + = CommentString)=0D else:=0D PcdItemObj.SetValidUsage(CommentString)=0D =0D @@ -444,10 +475,10 @@ class InfPcdObject(): # Set Value/DatumType/OffSet/Token=0D #=0D PcdItemObj =3D SetValueDatumTypeMaxSizeToken(PcdItem,=0D - CurrentLineOfPcdItem= ,=0D - PcdItemObj,=0D - KeysList[0][1],=0D - PackageInfo)=0D + CurrentLineOfPcdIte= m,=0D + PcdItemObj,=0D + KeysList[0][1],=0D + PackageInfo)=0D =0D PcdTypeItem =3D KeysList[0][0]=0D if (PcdTypeItem, PcdItemObj) in self.Pcds:=0D @@ -462,6 +493,7 @@ class InfPcdObject(): def GetPcds(self):=0D return self.Pcds=0D =0D +=0D def ParserPcdInfoInDec(String):=0D ValueList =3D GetSplitValueList(String, DT.TAB_VALUE_SPLIT, 3)=0D =0D @@ -470,6 +502,7 @@ def ParserPcdInfoInDec(String): #=0D return ValueList[2], ValueList[3]=0D =0D +=0D def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineOfPcdItem, PcdItemOb= j, Arch, PackageInfo=3DNone):=0D #=0D # Package information not been generated currently, we need to parser = INF file to get information.=0D @@ -477,7 +510,8 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineO= fPcdItem, PcdItemObj, Arc if not PackageInfo:=0D PackageInfo =3D []=0D InfFileName =3D CurrentLineOfPcdItem[2]=0D - PackageInfoList =3D GetPackageListInfo(InfFileName, GlobalData.gWO= RKSPACE, -1)=0D + PackageInfoList =3D GetPackageListInfo(=0D + InfFileName, GlobalData.gWORKSPACE, -1)=0D for PackageInfoListItem in PackageInfoList:=0D PackageInfoIns =3D InfPackageItem()=0D PackageInfoIns.SetPackageName(PackageInfoListItem)=0D @@ -491,7 +525,8 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineO= fPcdItem, PcdItemObj, Arc #=0D # Open DEC file to get information=0D #=0D - FullFileName =3D os.path.normpath(os.path.realpath(os.path.join(Gl= obalData.gWORKSPACE, PackageName)))=0D + FullFileName =3D os.path.normpath(os.path.realpath(=0D + os.path.join(GlobalData.gWORKSPACE, PackageName)))=0D =0D DecParser =3D None=0D if FullFileName not in GlobalData.gPackageDict:=0D @@ -506,7 +541,7 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineO= fPcdItem, PcdItemObj, Arc DecPcdsDict =3D DecParser.GetPcdSectionObject().ValueDict=0D for Key in DecPcdsDict.keys():=0D if (Key[0] =3D=3D 'PCDSDYNAMICEX' and PcdItemObj.GetItemType()= =3D=3D 'PcdEx') and \=0D - (Key[1] =3D=3D 'COMMON' or Key[1] =3D=3D Arch):=0D + (Key[1] =3D=3D 'COMMON' or Key[1] =3D=3D Arch):=0D for PcdInDec in DecPcdsDict[Key]:=0D if PcdInDec.TokenCName =3D=3D PcdItemObj.CName and \=0D PcdInDec.TokenSpaceGuidCName =3D=3D PcdItemObj.Toke= nSpaceGuidCName:=0D @@ -516,7 +551,7 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineO= fPcdItem, PcdItemObj, Arc PcdItemObj.SetDefaultValue(PcdInDec.DefaultValue)= =0D =0D if (Key[0] =3D=3D 'PCDSPATCHABLEINMODULE' and PcdItemObj.GetIt= emType() =3D=3D 'PatchPcd') and \=0D - (Key[1] =3D=3D 'COMMON' or Key[1] =3D=3D Arch):=0D + (Key[1] =3D=3D 'COMMON' or Key[1] =3D=3D Arch):=0D for PcdInDec in DecPcdsDict[Key]:=0D if PcdInDec.TokenCName =3D=3D PcdItemObj.CName and \=0D PcdInDec.TokenSpaceGuidCName =3D=3D PcdItemObj.Toke= nSpaceGuidCName:=0D @@ -526,7 +561,8 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLineO= fPcdItem, PcdItemObj, Arc =0D if PcdItemObj.GetDatumType() =3D=3D 'VOID*':=0D if len(PcdItem) > 1:=0D - PcdItemObj.SetMaxDatumSize('%s' % (len(GetSplitValueList(P= cdItem[1], DT.TAB_COMMA_SPLIT))))=0D + PcdItemObj.SetMaxDatumSize(=0D + '%s' % (len(GetSplitValueList(PcdItem[1], DT.TAB_COMMA= _SPLIT))))=0D =0D DecGuidsDict =3D DecParser.GetGuidSectionObject().ValueDict=0D for Key in DecGuidsDict.keys():=0D @@ -555,35 +591,38 @@ def SetValueDatumTypeMaxSizeToken(PcdItem, CurrentLin= eOfPcdItem, PcdItemObj, Arc PcdItemObj.SetDefaultValue(PcdItem[1])=0D else:=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_ASBUILD_PCD_VALUE_INVALID % ("\"" + PcdItem[1]= + "\"", "\"" +=0D - PcdItemObj.GetDatum= Type() + "\""),=0D - File=3DCurrentLineOfPcdItem[2],=0D - Line=3DCurrentLineOfPcdItem[1],=0D - ExtraData=3DCurrentLineOfPcdItem[0])=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_ASBUILD_PCD_VALUE_INVALID % ("\"" + PcdIte= m[1] + "\"", "\"" +=0D + PcdItemObj.Ge= tDatumType() + "\""),=0D + File=3DCurrentLineOfPcdItem[2],=0D + Line=3DCurrentLineOfPcdItem[1],=0D + ExtraData=3DCurrentLineOfPcdItem[0])=0D #=0D # validate offset=0D #=0D if PcdItemObj.GetItemType().upper() =3D=3D DT.TAB_INF_PATCH_PCD.up= per():=0D if not IsHexDigitUINT32(PcdItem[2]):=0D Logger.Error("InfParser",=0D - ToolError.FORMAT_INVALID,=0D - ST.ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID % ("\"" = + PcdItem[2] + "\""),=0D - File=3DCurrentLineOfPcdItem[2],=0D - Line=3DCurrentLineOfPcdItem[1],=0D - ExtraData=3DCurrentLineOfPcdItem[0])=0D + ToolError.FORMAT_INVALID,=0D + ST.ERR_ASBUILD_PCD_OFFSET_FORMAT_INVALID % (= =0D + "\"" + PcdItem[2] + "\""),=0D + File=3DCurrentLineOfPcdItem[2],=0D + Line=3DCurrentLineOfPcdItem[1],=0D + ExtraData=3DCurrentLineOfPcdItem[0])=0D PcdItemObj.SetOffset(PcdItem[2])=0D =0D if PcdItemObj.GetToken() =3D=3D '' or PcdItemObj.GetDatumType() =3D=3D= '':=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_ASBUILD_PCD_DECLARITION_MISS % ("\"" + PcdItem= [0] + "\""),=0D + ST.ERR_ASBUILD_PCD_DECLARITION_MISS % (=0D + "\"" + PcdItem[0] + "\""),=0D File=3DCurrentLineOfPcdItem[2],=0D Line=3DCurrentLineOfPcdItem[1],=0D ExtraData=3DCurrentLineOfPcdItem[0])=0D =0D return PcdItemObj=0D =0D +=0D def ValidatePcdValueOnDatumType(Value, Type):=0D =0D Value =3D Value.strip()=0D @@ -618,11 +657,11 @@ def ValidatePcdValueOnDatumType(Value, Type): =0D if not ReIsValidUint8z.match(Value) and Type =3D=3D 'UINT8':=0D return False=0D - elif not ReIsValidUint16z.match(Value) and Type =3D=3D 'UINT16':= =0D + elif not ReIsValidUint16z.match(Value) and Type =3D=3D 'UINT16':=0D return False=0D - elif not ReIsValidUint32z.match(Value) and Type =3D=3D 'UINT32':= =0D + elif not ReIsValidUint32z.match(Value) and Type =3D=3D 'UINT32':=0D return False=0D - elif not ReIsValidUint64z.match(Value) and Type =3D=3D 'UINT64':= =0D + elif not ReIsValidUint64z.match(Value) and Type =3D=3D 'UINT64':=0D return False=0D else:=0D #=0D @@ -632,6 +671,7 @@ def ValidatePcdValueOnDatumType(Value, Type): =0D return True=0D =0D +=0D def SetPcdName(PcdItem, CurrentLineOfPcdItem, PcdItemObj):=0D #=0D # Only PCD Name specified=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py b/Ba= seTools/Source/Python/UPT/Object/Parser/InfPpiObject.py index 1968c365732d..f73506623c20 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfPpiObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Ppis] section.=0D # It will consumed by InfParser.=0D #=0D @@ -20,6 +20,7 @@ import Logger.Log as Logger from Logger import ToolError=0D from Logger import StringTable as ST=0D =0D +=0D def ParsePpiComment(CommentsList, InfPpiItemObj):=0D PreNotify =3D None=0D PreUsage =3D None=0D @@ -30,14 +31,14 @@ def ParsePpiComment(CommentsList, InfPpiItemObj): for CommentItem in CommentsList:=0D Count =3D Count + 1=0D CommentItemUsage, \=0D - CommentItemNotify, \=0D - CommentItemString, \=0D - CommentItemHelpText =3D \=0D - ParseComment(CommentItem,=0D - DT.ALL_USAGE_TOKENS,=0D - DT.PPI_NOTIFY_TOKENS,=0D - ['PPI'],=0D - False)=0D + CommentItemNotify, \=0D + CommentItemString, \=0D + CommentItemHelpText =3D \=0D + ParseComment(CommentItem,=0D + DT.ALL_USAGE_TOKENS,=0D + DT.PPI_NOTIFY_TOKENS,=0D + ['PPI'],=0D + False)=0D =0D #=0D # To avoid PyLint error=0D @@ -134,6 +135,7 @@ def ParsePpiComment(CommentsList, InfPpiItemObj): =0D return InfPpiItemObj=0D =0D +=0D class InfPpiItemCommentContent():=0D def __init__(self):=0D #=0D @@ -149,50 +151,60 @@ class InfPpiItemCommentContent(): =0D def SetUsage(self, UsageItem):=0D self.UsageItem =3D UsageItem=0D +=0D def GetUsage(self):=0D return self.UsageItem=0D =0D def SetNotify(self, Notify):=0D if Notify !=3D DT.ITEM_UNDEFINED:=0D self.Notify =3D 'true'=0D +=0D def GetNotify(self):=0D return self.Notify=0D =0D def SetHelpStringItem(self, HelpStringItem):=0D self.HelpStringItem =3D HelpStringItem=0D +=0D def GetHelpStringItem(self):=0D return self.HelpStringItem=0D =0D +=0D class InfPpiItem():=0D def __init__(self):=0D - self.Name =3D ''=0D - self.FeatureFlagExp =3D ''=0D - self.SupArchList =3D []=0D - self.CommentList =3D []=0D + self.Name =3D ''=0D + self.FeatureFlagExp =3D ''=0D + self.SupArchList =3D []=0D + self.CommentList =3D []=0D =0D def SetName(self, Name):=0D self.Name =3D Name=0D +=0D def GetName(self):=0D return self.Name=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D def SetCommentList(self, CommentList):=0D self.CommentList =3D CommentList=0D +=0D def GetCommentList(self):=0D return self.CommentList=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D ##=0D #=0D #=0D #=0D +=0D +=0D class InfPpiObject():=0D def __init__(self):=0D self.Ppis =3D Sdict()=0D @@ -201,7 +213,7 @@ class InfPpiObject(): #=0D self.Macros =3D {}=0D =0D - def SetPpi(self, PpiList, Arch =3D None):=0D + def SetPpi(self, PpiList, Arch=3DNone):=0D __SupArchList =3D []=0D for ArchItem in Arch:=0D #=0D @@ -228,7 +240,7 @@ class InfPpiObject(): if not IsValidCVariableName(Item[0]):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0])= ,=0D + ST.ERR_INF_PARSER_INVALID_CNAME % (Item[0= ]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -265,7 +277,8 @@ class InfPpiObject(): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID%(FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX= _INVLID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -332,6 +345,5 @@ class InfPpiObject(): =0D return True=0D =0D -=0D def GetPpi(self):=0D return self.Ppis=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py= b/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py index 80bfca607754..cf3798dc5317 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfProtocolObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Protocols] sectio= n.=0D # It will consumed by InfParser.=0D #=0D @@ -21,6 +21,7 @@ from Object.Parser.InfMisc import ErrorInInf from Library import DataType as DT=0D from Logger import StringTable as ST=0D =0D +=0D def ParseProtocolComment(CommentsList, InfProtocolItemObj):=0D CommentInsList =3D []=0D PreUsage =3D None=0D @@ -31,14 +32,14 @@ def ParseProtocolComment(CommentsList, InfProtocolItemO= bj): for CommentItem in CommentsList:=0D Count =3D Count + 1=0D CommentItemUsage, \=0D - CommentItemNotify, \=0D - CommentItemString, \=0D - CommentItemHelpText =3D \=0D - ParseComment(CommentItem,=0D - DT.PROTOCOL_USAGE_TOKENS,=0D - DT.PROTOCOL_NOTIFY_TOKENS,=0D - ['PROTOCOL'],=0D - False)=0D + CommentItemNotify, \=0D + CommentItemString, \=0D + CommentItemHelpText =3D \=0D + ParseComment(CommentItem,=0D + DT.PROTOCOL_USAGE_TOKENS,=0D + DT.PROTOCOL_NOTIFY_TOKENS,=0D + ['PROTOCOL'],=0D + False)=0D =0D if CommentItemString:=0D pass=0D @@ -123,6 +124,7 @@ def ParseProtocolComment(CommentsList, InfProtocolItemO= bj): =0D return InfProtocolItemObj=0D =0D +=0D class InfProtocolItemCommentContent():=0D def __init__(self):=0D #=0D @@ -138,20 +140,24 @@ class InfProtocolItemCommentContent(): =0D def SetUsageItem(self, UsageItem):=0D self.UsageItem =3D UsageItem=0D +=0D def GetUsageItem(self):=0D return self.UsageItem=0D =0D def SetNotify(self, Notify):=0D if Notify !=3D DT.ITEM_UNDEFINED:=0D self.Notify =3D 'true'=0D +=0D def GetNotify(self):=0D return self.Notify=0D =0D def SetHelpStringItem(self, HelpStringItem):=0D self.HelpStringItem =3D HelpStringItem=0D +=0D def GetHelpStringItem(self):=0D return self.HelpStringItem=0D =0D +=0D class InfProtocolItem():=0D def __init__(self):=0D self.Name =3D ''=0D @@ -161,21 +167,25 @@ class InfProtocolItem(): =0D def SetName(self, Name):=0D self.Name =3D Name=0D +=0D def GetName(self):=0D return self.Name=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D def SetCommentList(self, CommentList):=0D self.CommentList =3D CommentList=0D +=0D def GetCommentList(self):=0D return self.CommentList=0D =0D @@ -183,6 +193,8 @@ class InfProtocolItem(): #=0D #=0D #=0D +=0D +=0D class InfProtocolObject():=0D def __init__(self):=0D self.Protocols =3D Sdict()=0D @@ -191,7 +203,7 @@ class InfProtocolObject(): #=0D self.Macros =3D {}=0D =0D - def SetProtocol(self, ProtocolContent, Arch =3D None,):=0D + def SetProtocol(self, ProtocolContent, Arch=3DNone,):=0D __SupArchList =3D []=0D for ArchItem in Arch:=0D #=0D @@ -209,7 +221,8 @@ class InfProtocolObject(): if len(Item) =3D=3D 3:=0D CommentsList =3D Item[1]=0D CurrentLineOfItem =3D Item[2]=0D - LineInfo =3D (CurrentLineOfItem[2], CurrentLineOfItem[1], Curr= entLineOfItem[0])=0D + LineInfo =3D (=0D + CurrentLineOfItem[2], CurrentLineOfItem[1], CurrentLineOfI= tem[0])=0D Item =3D Item[0]=0D InfProtocolItemObj =3D InfProtocolItem()=0D if len(Item) >=3D 1 and len(Item) <=3D 2:=0D @@ -217,7 +230,7 @@ class InfProtocolObject(): # Only CName contained=0D #=0D if not IsValidCVariableName(Item[0]):=0D - ErrorInInf(ST.ERR_INF_PARSER_INVALID_CNAME%(Item[0]),= =0D + ErrorInInf(ST.ERR_INF_PARSER_INVALID_CNAME % (Item[0])= ,=0D LineInfo=3DLineInfo)=0D if (Item[0] !=3D ''):=0D InfProtocolItemObj.SetName(Item[0])=0D @@ -239,7 +252,7 @@ class InfProtocolObject(): #=0D FeatureFlagRtv =3D IsValidFeatureFlagExp(Item[1].strip())= =0D if not FeatureFlagRtv[0]:=0D - ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_I= NVLID%(FeatureFlagRtv[1]),=0D + ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_I= NVLID % (FeatureFlagRtv[1]),=0D LineInfo=3DLineInfo)=0D InfProtocolItemObj.SetFeatureFlagExp(Item[1])=0D =0D @@ -254,7 +267,8 @@ class InfProtocolObject(): # Get/Set Usage and HelpString for Protocol entry=0D #=0D if CommentsList is not None and len(CommentsList) !=3D 0:=0D - InfProtocolItemObj =3D ParseProtocolComment(CommentsList, = InfProtocolItemObj)=0D + InfProtocolItemObj =3D ParseProtocolComment(=0D + CommentsList, InfProtocolItemObj)=0D else:=0D CommentItemIns =3D InfProtocolItemCommentContent()=0D CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py b= /BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py index 75ea209c48ac..5827afe5f50c 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfSoucesObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [Sources] section.= =0D # It will consumed by InfParser.=0D #=0D @@ -24,9 +24,11 @@ from Library.Misc import ValidFile from Library.ParserValidate import IsValidFamily=0D from Library.ParserValidate import IsValidPath=0D =0D -## __GenSourceInstance=0D +# __GenSourceInstance=0D #=0D #=0D +=0D +=0D def GenSourceInstance(Item, CurrentLineOfItem, ItemObj):=0D =0D IsValidFileFlag =3D False=0D @@ -53,7 +55,8 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj): if not FeatureFlagRtv[0]:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INV= LID%(FeatureFlagRtv[1]),=0D + ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INV= LID % (=0D + FeatureFlagRtv[1]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -64,7 +67,8 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_TOOLCODE_NOT_PERMITTED%(Ite= m[2]),=0D + ST.ERR_INF_PARSER_TOOLCODE_NOT_PERMITTED % (= =0D + Item[2]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -74,7 +78,8 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED%(Item= [2]),=0D + ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED % (=0D + Item[2]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -89,7 +94,8 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_SOURCE_SECTION_FAMILY_INVAL= ID%(Item[1]),=0D + ST.ERR_INF_PARSER_SOURCE_SECTION_FAMILY_INVAL= ID % (=0D + Item[1]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -97,11 +103,12 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj= ): #=0D # Validate file name exist.=0D #=0D - FullFileName =3D os.path.normpath(os.path.realpath(os.path.joi= n(GlobalData.gINF_MODULE_DIR, Item[0])))=0D + FullFileName =3D os.path.normpath(os.path.realpath(=0D + os.path.join(GlobalData.gINF_MODULE_DIR, Item[0])))=0D if not (ValidFile(FullFileName) or ValidFile(Item[0])):=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_FILELIST_EXIST%(Item[0]),=0D + ST.ERR_FILELIST_EXIST % (Item[0]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -115,7 +122,8 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemObj): else:=0D Logger.Error("InfParser",=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVA= LID%(Item[0]),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVA= LID % (=0D + Item[0]),=0D File=3DCurrentLineOfItem[2],=0D Line=3DCurrentLineOfItem[1],=0D ExtraData=3DCurrentLineOfItem[0])=0D @@ -132,74 +140,86 @@ def GenSourceInstance(Item, CurrentLineOfItem, ItemOb= j): =0D return ItemObj=0D =0D -## InfSourcesItemObject()=0D +# InfSourcesItemObject()=0D #=0D #=0D +=0D +=0D class InfSourcesItemObject():=0D - def __init__(self, \=0D - SourceFileName =3D '', \=0D - Family =3D '', \=0D - TagName =3D '', \=0D - ToolCode =3D '', \=0D - FeatureFlagExp =3D ''):=0D + def __init__(self,=0D + SourceFileName=3D'',=0D + Family=3D'',=0D + TagName=3D'',=0D + ToolCode=3D'',=0D + FeatureFlagExp=3D''):=0D self.SourceFileName =3D SourceFileName=0D - self.Family =3D Family=0D - self.TagName =3D TagName=0D - self.ToolCode =3D ToolCode=0D + self.Family =3D Family=0D + self.TagName =3D TagName=0D + self.ToolCode =3D ToolCode=0D self.FeatureFlagExp =3D FeatureFlagExp=0D - self.HeaderString =3D ''=0D - self.TailString =3D ''=0D - self.SupArchList =3D []=0D + self.HeaderString =3D ''=0D + self.TailString =3D ''=0D + self.SupArchList =3D []=0D =0D def SetSourceFileName(self, SourceFilename):=0D self.SourceFileName =3D SourceFilename=0D +=0D def GetSourceFileName(self):=0D return self.SourceFileName=0D =0D def SetFamily(self, Family):=0D self.Family =3D Family=0D +=0D def GetFamily(self):=0D return self.Family=0D =0D def SetTagName(self, TagName):=0D self.TagName =3D TagName=0D +=0D def GetTagName(self):=0D return self.TagName=0D =0D def SetToolCode(self, ToolCode):=0D self.ToolCode =3D ToolCode=0D +=0D def GetToolCode(self):=0D return self.ToolCode=0D =0D def SetFeatureFlagExp(self, FeatureFlagExp):=0D self.FeatureFlagExp =3D FeatureFlagExp=0D +=0D def GetFeatureFlagExp(self):=0D return self.FeatureFlagExp=0D =0D def SetHeaderString(self, HeaderString):=0D self.HeaderString =3D HeaderString=0D +=0D def GetHeaderString(self):=0D return self.HeaderString=0D =0D def SetTailString(self, TailString):=0D self.TailString =3D TailString=0D +=0D def GetTailString(self):=0D return self.TailString=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D ##=0D #=0D #=0D #=0D +=0D +=0D class InfSourcesObject(InfSectionCommonDef):=0D def __init__(self):=0D self.Sources =3D Sdict()=0D InfSectionCommonDef.__init__(self)=0D =0D - def SetSources(self, SourceList, Arch =3D None):=0D + def SetSources(self, SourceList, Arch=3DNone):=0D __SupArchList =3D []=0D for ArchItem in Arch:=0D #=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObje= ct.py b/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py index ce017dbebb45..bab6ecca94b8 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/InfUserExtensionObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define class objects of INF file [UserExtension] se= ction.=0D # It will consumed by InfParser.=0D #=0D @@ -17,33 +17,38 @@ from Library import GlobalData =0D from Library.Misc import Sdict=0D =0D +=0D class InfUserExtensionItem():=0D def __init__(self,=0D - Content =3D '',=0D - UserId =3D '',=0D - IdString =3D ''):=0D - self.Content =3D Content=0D - self.UserId =3D UserId=0D + Content=3D'',=0D + UserId=3D'',=0D + IdString=3D''):=0D + self.Content =3D Content=0D + self.UserId =3D UserId=0D self.IdString =3D IdString=0D self.SupArchList =3D []=0D =0D def SetContent(self, Content):=0D self.Content =3D Content=0D +=0D def GetContent(self):=0D return self.Content=0D =0D def SetUserId(self, UserId):=0D self.UserId =3D UserId=0D +=0D def GetUserId(self):=0D return self.UserId=0D =0D def SetIdString(self, IdString):=0D self.IdString =3D IdString=0D +=0D def GetIdString(self):=0D return self.IdString=0D =0D def SetSupArchList(self, SupArchList):=0D self.SupArchList =3D SupArchList=0D +=0D def GetSupArchList(self):=0D return self.SupArchList=0D =0D @@ -51,6 +56,8 @@ class InfUserExtensionItem(): #=0D #=0D #=0D +=0D +=0D class InfUserExtensionObject():=0D def __init__(self):=0D self.UserExtension =3D Sdict()=0D @@ -111,8 +118,9 @@ class InfUserExtensionObject(): #=0D Logger.Error('InfParser',=0D ToolError.FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR%= \=0D - (IdContentItem[0] + '.' + IdContentItem[1] + = '.' + IdContentItem[2]),=0D + ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR = %=0D + (IdContentItem[0] + '.' +=0D + IdContentItem[1] + '.' + IdContentItem[2]),= =0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DLineNo,=0D ExtraData=3DNone)=0D diff --git a/BaseTools/Source/Python/UPT/Object/Parser/__init__.py b/BaseTo= ols/Source/Python/UPT/Object/Parser/__init__.py index 268ce7ca1e99..3fec9ece77c0 100644 --- a/BaseTools/Source/Python/UPT/Object/Parser/__init__.py +++ b/BaseTools/Source/Python/UPT/Object/Parser/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Object' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/Object/__init__.py b/BaseTools/Sou= rce/Python/UPT/Object/__init__.py index 53db4406dc73..45bbfca726d5 100644 --- a/BaseTools/Source/Python/UPT/Object/__init__.py +++ b/BaseTools/Source/Python/UPT/Object/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Object' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/So= urce/Python/UPT/Parser/DecParser.py index 8dfa12d8268b..4b0c6f540935 100644 --- a/BaseTools/Source/Python/UPT/Parser/DecParser.py +++ b/BaseTools/Source/Python/UPT/Parser/DecParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse DEC file. It will consumed by DecParser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -7,7 +7,7 @@ '''=0D DecParser=0D '''=0D -## Import modules=0D +# Import modules=0D #=0D import Logger.Log as Logger=0D from Logger.ToolError import FILE_PARSE_FAILURE=0D @@ -60,6 +60,8 @@ from Library.CommentParsing import ParsePcdErrorCode ##=0D # _DecBase class for parsing=0D #=0D +=0D +=0D class _DecBase:=0D def __init__(self, RawData):=0D self._RawData =3D RawData=0D @@ -76,20 +78,20 @@ class _DecBase: def GetLocalMacro(self):=0D return self._LocalMacro=0D =0D - ## BlockStart=0D + # BlockStart=0D #=0D # Called if a new section starts=0D #=0D def BlockStart(self):=0D self._LocalMacro =3D {}=0D =0D - ## _CheckReDefine=0D + # _CheckReDefine=0D #=0D # @param Key: to be checked if multi-defined=0D # @param Scope: Format: [[SectionName, Arch], ...].=0D # If scope is none, use global scope=0D #=0D - def _CheckReDefine(self, Key, Scope =3D None):=0D + def _CheckReDefine(self, Key, Scope=3DNone):=0D if not Scope:=0D Scope =3D self._RawData.CurrentScope=0D return=0D @@ -113,7 +115,8 @@ class _DecBase: # Key in common cannot be redefined in other arche= s=0D # [:-1] means stripping arch info=0D if Other[:-1] =3D=3D SubValue[:-1]:=0D - self._LoggerError(ST.ERR_DECPARSE_REDEFINE % (= Key, Value[1]))=0D + self._LoggerError(=0D + ST.ERR_DECPARSE_REDEFINE % (Key, Value[1])= )=0D return=0D continue=0D CommonScope =3D []=0D @@ -123,11 +126,12 @@ class _DecBase: # Cannot be redefined if this key already defined in COMMO= N Or defined in same arch=0D #=0D if SubValue in Value[0] or CommonScope in Value[0]:=0D - self._LoggerError(ST.ERR_DECPARSE_REDEFINE % (Key, Val= ue[1]))=0D + self._LoggerError(ST.ERR_DECPARSE_REDEFINE %=0D + (Key, Value[1]))=0D return=0D self._ItemDict[Key].append([SecArch, self._RawData.LineIndex])=0D =0D - ## CheckRequiredFields=0D + # CheckRequiredFields=0D # Some sections need to check if some fields exist, define section for= example=0D # Derived class can re-implement, top parser will call this function a= fter all parsing done=0D #=0D @@ -136,7 +140,7 @@ class _DecBase: pass=0D return True=0D =0D - ## IsItemRequired=0D + # IsItemRequired=0D # In DEC spec, sections must have at least one statement except user=0D # extension.=0D # For example: "[guids" [] "]" +=0D @@ -149,23 +153,23 @@ class _DecBase: =0D def _LoggerError(self, ErrorString):=0D Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=3Dself._RawData.F= ilename,=0D - Line =3D self._RawData.LineIndex,=0D + Line=3Dself._RawData.LineIndex,=0D ExtraData=3DErrorString + ST.ERR_DECPARSE_LINE % self= ._RawData.CurrentLine)=0D =0D def _ReplaceMacro(self, String):=0D if gMACRO_PATTERN.findall(String):=0D String =3D ReplaceMacro(String, self._LocalMacro, False,=0D - FileName =3D self._RawData.Filename,=0D - Line =3D ['', self._RawData.LineIndex])= =0D + FileName=3Dself._RawData.Filename,=0D + Line=3D['', self._RawData.LineIndex])=0D String =3D ReplaceMacro(String, self._RawData.Macros, False,=0D - FileName =3D self._RawData.Filename,=0D - Line =3D ['', self._RawData.LineIndex])= =0D + FileName=3Dself._RawData.Filename,=0D + Line=3D['', self._RawData.LineIndex])=0D MacroUsed =3D gMACRO_PATTERN.findall(String)=0D if MacroUsed:=0D Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE,=0D File=3Dself._RawData.Filename,=0D - Line =3D self._RawData.LineIndex,=0D - ExtraData =3D ST.ERR_DECPARSE_MACRO_RESOLVE %= (str(MacroUsed), String))=0D + Line=3Dself._RawData.LineIndex,=0D + ExtraData=3DST.ERR_DECPARSE_MACRO_RESOLVE % (= str(MacroUsed), String))=0D return String=0D =0D def _MacroParser(self, String):=0D @@ -184,7 +188,7 @@ class _DecBase: else:=0D self._LocalMacro[TokenList[0]] =3D self._ReplaceMacro(TokenLis= t[1])=0D =0D - ## _ParseItem=0D + # _ParseItem=0D #=0D # Parse specified item, this function must be derived by subclass=0D #=0D @@ -196,14 +200,14 @@ class _DecBase: #=0D return None=0D =0D -=0D - ## _TailCommentStrategy=0D + # _TailCommentStrategy=0D #=0D # This function can be derived to parse tail comment=0D # default is it will not consume any lines=0D #=0D # @param Comment: Comment of current line=0D #=0D +=0D def _TailCommentStrategy(self, Comment):=0D if Comment:=0D pass=0D @@ -211,7 +215,7 @@ class _DecBase: pass=0D return False=0D =0D - ## _StopCurrentParsing=0D + # _StopCurrentParsing=0D #=0D # Called in Parse if current parsing should be stopped when encounter = some=0D # keyword=0D @@ -224,7 +228,7 @@ class _DecBase: pass=0D return Line[0] =3D=3D DT.TAB_SECTION_START and Line[-1] =3D=3D DT.= TAB_SECTION_END=0D =0D - ## _TryBackSlash=0D + # _TryBackSlash=0D #=0D # Split comment and DEC content, concatenate lines if end of char is '= \'=0D #=0D @@ -281,7 +285,7 @@ class _DecBase: =0D return CatLine, CommentList=0D =0D - ## Parse=0D + # Parse=0D # This is a template method in which other member functions which migh= t=0D # override by sub class are called. It is responsible for reading file= =0D # line by line, and call other member functions to parse. This functio= n=0D @@ -291,24 +295,24 @@ class _DecBase: HeadComments =3D []=0D TailComments =3D []=0D =0D - #=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=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=0D + # =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=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=0D # CurComments may pointer to HeadComments or TailComments=0D - #=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=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=0D + # =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=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=0D CurComments =3D HeadComments=0D CurObj =3D None=0D ItemNum =3D 0=0D FromBuf =3D False=0D =0D - #=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=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=0D + # =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=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=0D # Used to report error information if empty section found=0D - #=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=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=0D + # =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=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=0D Index =3D self._RawData.LineIndex=0D LineStr =3D self._RawData.CurrentLine=0D while not self._RawData.IsEndOfFile() or self._RawData.NextLine:=0D if self._RawData.NextLine:=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # Have processed line in buffer=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D Line =3D self._RawData.NextLine=0D HeadComments.extend(self._RawData.HeadComment)=0D TailComments.extend(self._RawData.TailComment)=0D @@ -316,16 +320,16 @@ class _DecBase: Comment =3D ''=0D FromBuf =3D True=0D else:=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # No line in buffer, read next line=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D Line, Comment =3D CleanString(self._RawData.GetNextLine())= =0D FromBuf =3D False=0D if Line:=0D if not FromBuf and CurObj and TailComments:=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # Set tail comments to previous statement if not empty= .=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D CurObj.SetTailComment(CurObj.GetTailComment()+TailComm= ents)=0D =0D if not FromBuf:=0D @@ -335,15 +339,15 @@ class _DecBase: if Comment:=0D Comments =3D [(Comment, self._RawData.LineIndex)]=0D =0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # Try if last char of line has backslash=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D Line, Comments =3D self._TryBackSlash(Line, Comments)=0D CurComments.extend(Comments)=0D =0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # Macro found=0D - #=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=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D if Line.startswith('DEFINE '):=0D self._MacroParser(Line)=0D del HeadComments[:]=0D @@ -352,10 +356,10 @@ class _DecBase: continue=0D =0D if self._StopCurrentParsing(Line):=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # This line does not belong to this parse,=0D # Save it, can be used by next parse=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D self._RawData.SetNext(Line, HeadComments, TailComments= )=0D break=0D =0D @@ -371,9 +375,9 @@ class _DecBase: CurObj =3D None=0D else:=0D if id(CurComments) =3D=3D id(TailComments):=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D # Check if this comment belongs to tail comment=0D - #=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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D + # =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=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D if not self._TailCommentStrategy(Comment):=0D CurComments =3D HeadComments=0D =0D @@ -384,15 +388,17 @@ class _DecBase: =0D if self._IsStatementRequired() and ItemNum =3D=3D 0:=0D Logger.Error(=0D - TOOL_NAME, FILE_PARSE_FAILURE,=0D - File=3Dself._RawData.Filename,=0D - Line=3DIndex,=0D - ExtraData=3DST.ERR_DECPARSE_STATEMENT_EMPTY % LineStr= =0D + TOOL_NAME, FILE_PARSE_FAILURE,=0D + File=3Dself._RawData.Filename,=0D + Line=3DIndex,=0D + ExtraData=3DST.ERR_DECPARSE_STATEMENT_EMPTY % LineStr=0D )=0D =0D -## _DecDefine=0D +# _DecDefine=0D # Parse define section=0D #=0D +=0D +=0D class _DecDefine(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -404,11 +410,11 @@ class _DecDefine(_DecBase): # Each field has a function to validate=0D #=0D self.DefineValidation =3D {=0D - DT.TAB_DEC_DEFINES_DEC_SPECIFICATION : self._SetDecSpecifi= cation,=0D - DT.TAB_DEC_DEFINES_PACKAGE_NAME : self._SetPackageNam= e,=0D - DT.TAB_DEC_DEFINES_PACKAGE_GUID : self._SetPackageGui= d,=0D - DT.TAB_DEC_DEFINES_PACKAGE_VERSION : self._SetPackageVer= sion,=0D - DT.TAB_DEC_DEFINES_PKG_UNI_FILE : self._SetPackageUni= ,=0D + DT.TAB_DEC_DEFINES_DEC_SPECIFICATION: self._SetDecSpecificat= ion,=0D + DT.TAB_DEC_DEFINES_PACKAGE_NAME: self._SetPackageName,=0D + DT.TAB_DEC_DEFINES_PACKAGE_GUID: self._SetPackageGuid,=0D + DT.TAB_DEC_DEFINES_PACKAGE_VERSION: self._SetPackageVersion,= =0D + DT.TAB_DEC_DEFINES_PKG_UNI_FILE: self._SetPackageUni,=0D }=0D =0D def BlockStart(self):=0D @@ -416,7 +422,7 @@ class _DecDefine(_DecBase): if self._DefSecNum > 1:=0D self._LoggerError(ST.ERR_DECPARSE_DEFINE_MULTISEC)=0D =0D - ## CheckRequiredFields=0D + # CheckRequiredFields=0D #=0D # Check required fields: DEC_SPECIFICATION, PACKAGE_NAME=0D # PACKAGE_GUID, PACKAGE_VERSION=0D @@ -452,14 +458,15 @@ class _DecDefine(_DecBase): self.DefineValidation[TokenList[0]](TokenList[1])=0D =0D DefineItem =3D DecDefineItemObject()=0D - DefineItem.Key =3D TokenList[0]=0D + DefineItem.Key =3D TokenList[0]=0D DefineItem.Value =3D TokenList[1]=0D self.ItemObject.AddItem(DefineItem, self._RawData.CurrentScope)=0D return DefineItem=0D =0D def _SetDecSpecification(self, Token):=0D if self.ItemObject.GetPackageSpecification():=0D - self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_= DEFINES_DEC_SPECIFICATION)=0D + self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED %=0D + DT.TAB_DEC_DEFINES_DEC_SPECIFICATION)=0D if not IsValidToken('0[xX][0-9a-fA-F]{8}', Token):=0D if not IsValidDecVersionVal(Token):=0D self._LoggerError(ST.ERR_DECPARSE_DEFINE_SPEC)=0D @@ -467,21 +474,24 @@ class _DecDefine(_DecBase): =0D def _SetPackageName(self, Token):=0D if self.ItemObject.GetPackageName():=0D - self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_= DEFINES_PACKAGE_NAME)=0D + self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED %=0D + DT.TAB_DEC_DEFINES_PACKAGE_NAME)=0D if not IsValidWord(Token):=0D self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGNAME)=0D self.ItemObject.SetPackageName(Token)=0D =0D def _SetPackageGuid(self, Token):=0D if self.ItemObject.GetPackageGuid():=0D - self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_= DEFINES_PACKAGE_GUID)=0D + self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED %=0D + DT.TAB_DEC_DEFINES_PACKAGE_GUID)=0D if not CheckGuidRegFormat(Token):=0D self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGGUID)=0D self.ItemObject.SetPackageGuid(Token)=0D =0D def _SetPackageVersion(self, Token):=0D if self.ItemObject.GetPackageVersion():=0D - self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_= DEFINES_PACKAGE_VERSION)=0D + self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED %=0D + DT.TAB_DEC_DEFINES_PACKAGE_VERSION)=0D if not IsValidToken(VERSION_PATTERN, Token):=0D self._LoggerError(ST.ERR_DECPARSE_DEFINE_PKGVERSION)=0D else:=0D @@ -491,13 +501,16 @@ class _DecDefine(_DecBase): =0D def _SetPackageUni(self, Token):=0D if self.ItemObject.GetPackageUniFile():=0D - self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED % DT.TAB_DEC_= DEFINES_PKG_UNI_FILE)=0D + self._LoggerError(ST.ERR_DECPARSE_DEFINE_DEFINED %=0D + DT.TAB_DEC_DEFINES_PKG_UNI_FILE)=0D self.ItemObject.SetPackageUniFile(Token)=0D =0D -## _DecInclude=0D +# _DecInclude=0D #=0D # Parse include section=0D #=0D +=0D +=0D class _DecInclude(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -509,14 +522,17 @@ class _DecInclude(_DecBase): if not IsValidPath(Line, self._RawData.PackagePath):=0D self._LoggerError(ST.ERR_DECPARSE_INCLUDE % Line)=0D =0D - Item =3D DecIncludeItemObject(StripRoot(self._RawData.PackagePath,= Line), self._RawData.PackagePath)=0D + Item =3D DecIncludeItemObject(=0D + StripRoot(self._RawData.PackagePath, Line), self._RawData.Pack= agePath)=0D self.ItemObject.AddItem(Item, self._RawData.CurrentScope)=0D return Item=0D =0D -## _DecLibraryclass=0D +# _DecLibraryclass=0D #=0D # Parse library class section=0D #=0D +=0D +=0D class _DecLibraryclass(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -552,10 +568,12 @@ class _DecLibraryclass(_DecBase): self.ItemObject.AddItem(Item, self._RawData.CurrentScope)=0D return Item=0D =0D -## _DecPcd=0D +# _DecPcd=0D #=0D # Parse PCD section=0D #=0D +=0D +=0D class _DecPcd(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -621,7 +639,7 @@ class _DecPcd(_DecBase): IntToken =3D int(Token, 0)=0D if (Guid, IntToken) in self.TokenMap:=0D if self.TokenMap[Guid, IntToken] !=3D CName:=0D - self._LoggerError(ST.ERR_DECPARSE_PCD_TOKEN_UNIQUE%(Token)= )=0D + self._LoggerError(ST.ERR_DECPARSE_PCD_TOKEN_UNIQUE % (Toke= n))=0D else:=0D self.TokenMap[Guid, IntToken] =3D CName=0D =0D @@ -629,10 +647,12 @@ class _DecPcd(_DecBase): self.ItemObject.AddItem(Item, self._RawData.CurrentScope)=0D return Item=0D =0D -## _DecGuid=0D +# _DecGuid=0D #=0D # Parse GUID, PPI, Protocol section=0D #=0D +=0D +=0D class _DecGuid(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -640,11 +660,11 @@ class _DecGuid(_DecBase): self.PpiObj =3D DecPpiObject(RawData.Filename)=0D self.ProtocolObj =3D DecProtocolObject(RawData.Filename)=0D self.ObjectDict =3D \=0D - {=0D - DT.TAB_GUIDS.upper() : self.GuidObj,=0D - DT.TAB_PPIS.upper() : self.PpiObj,=0D - DT.TAB_PROTOCOLS.upper() : self.ProtocolObj=0D - }=0D + {=0D + DT.TAB_GUIDS.upper(): self.GuidObj,=0D + DT.TAB_PPIS.upper(): self.PpiObj,=0D + DT.TAB_PROTOCOLS.upper(): self.ProtocolObj=0D + }=0D =0D def GetDataObject(self):=0D if self._RawData.CurrentScope:=0D @@ -697,10 +717,12 @@ class _DecGuid(_DecBase): ItemObject.AddItem(Item, self._RawData.CurrentScope)=0D return Item=0D =0D -## _DecUserExtension=0D +# _DecUserExtension=0D #=0D # Parse user extension section=0D #=0D +=0D +=0D class _DecUserExtension(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -739,12 +761,14 @@ class _DecUserExtension(_DecBase): Item.UserString =3D Line=0D return Item=0D =0D -## Dec=0D +# Dec=0D #=0D # Top dec parser=0D #=0D +=0D +=0D class Dec(_DecBase, _DecComments):=0D - def __init__(self, DecFile, Parse =3D True):=0D + def __init__(self, DecFile, Parse=3DTrue):=0D try:=0D Content =3D ConvertSpecialChar(open(DecFile, 'r').readlines())= =0D except BaseException:=0D @@ -777,29 +801,29 @@ class Dec(_DecBase, _DecComments): self.BinaryHeadComment =3D []=0D self.PcdErrorCommentDict =3D {}=0D =0D - self._Define =3D _DecDefine(RawData)=0D - self._Include =3D _DecInclude(RawData)=0D - self._Guid =3D _DecGuid(RawData)=0D - self._LibClass =3D _DecLibraryclass(RawData)=0D - self._Pcd =3D _DecPcd(RawData)=0D - self._UserEx =3D _DecUserExtension(RawData)=0D + self._Define =3D _DecDefine(RawData)=0D + self._Include =3D _DecInclude(RawData)=0D + self._Guid =3D _DecGuid(RawData)=0D + self._LibClass =3D _DecLibraryclass(RawData)=0D + self._Pcd =3D _DecPcd(RawData)=0D + self._UserEx =3D _DecUserExtension(RawData)=0D =0D #=0D # DEC file supported data types (one type per section)=0D #=0D self._SectionParser =3D {=0D - DT.TAB_DEC_DEFINES.upper() : self._Defin= e,=0D - DT.TAB_INCLUDES.upper() : self._Inclu= de,=0D - DT.TAB_LIBRARY_CLASSES.upper() : self._LibCl= ass,=0D - DT.TAB_GUIDS.upper() : self._Guid,= =0D - DT.TAB_PPIS.upper() : self._Guid,= =0D - DT.TAB_PROTOCOLS.upper() : self._Guid,= =0D - DT.TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : self._Pcd,= =0D - DT.TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : self._Pcd,= =0D - DT.TAB_PCDS_FEATURE_FLAG_NULL.upper() : self._Pcd,= =0D - DT.TAB_PCDS_DYNAMIC_NULL.upper() : self._Pcd,= =0D - DT.TAB_PCDS_DYNAMIC_EX_NULL.upper() : self._Pcd,= =0D - DT.TAB_USER_EXTENSIONS.upper() : self._UserE= x=0D + DT.TAB_DEC_DEFINES.upper(): self._Define,=0D + DT.TAB_INCLUDES.upper(): self._Include,=0D + DT.TAB_LIBRARY_CLASSES.upper(): self._LibClass,=0D + DT.TAB_GUIDS.upper(): self._Guid,=0D + DT.TAB_PPIS.upper(): self._Guid,=0D + DT.TAB_PROTOCOLS.upper(): self._Guid,=0D + DT.TAB_PCDS_FIXED_AT_BUILD_NULL.upper(): self._Pcd,=0D + DT.TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(): self._Pcd,=0D + DT.TAB_PCDS_FEATURE_FLAG_NULL.upper(): self._Pcd,=0D + DT.TAB_PCDS_DYNAMIC_NULL.upper(): self._Pcd,=0D + DT.TAB_PCDS_DYNAMIC_EX_NULL.upper(): self._Pcd,=0D + DT.TAB_USER_EXTENSIONS.upper(): self._UserEx=0D }=0D =0D if Parse:=0D @@ -832,29 +856,36 @@ class Dec(_DecBase, _DecComments): while not self._RawData.IsEndOfFile():=0D self._RawData.CurrentLine =3D self._RawData.GetNextLine()=0D if self._RawData.CurrentLine.startswith(DT.TAB_COMMENT_SPLIT) = and \=0D - DT.TAB_SECTION_START in self._RawData.CurrentLine and \=0D - DT.TAB_SECTION_END in self._RawData.CurrentLine:=0D - self._RawData.CurrentLine =3D self._RawData.CurrentLine.re= place(DT.TAB_COMMENT_SPLIT, '').strip()=0D + DT.TAB_SECTION_START in self._RawData.CurrentLine and = \=0D + DT.TAB_SECTION_END in self._RawData.CurrentLine:=0D + self._RawData.CurrentLine =3D self._RawData.CurrentLine.re= place(=0D + DT.TAB_COMMENT_SPLIT, '').strip()=0D =0D if self._RawData.CurrentLine[0] =3D=3D DT.TAB_SECTION_STAR= T and \=0D - self._RawData.CurrentLine[-1] =3D=3D DT.TAB_SECTION_EN= D:=0D + self._RawData.CurrentLine[-1] =3D=3D DT.TAB_SECTIO= N_END:=0D RawSection =3D self._RawData.CurrentLine[1:-1].strip()= =0D if RawSection.upper().startswith(DT.TAB_PCD_ERROR.uppe= r()+'.'):=0D - TokenSpaceGuidCName =3D RawSection.split(DT.TAB_PC= D_ERROR+'.')[1].strip()=0D + TokenSpaceGuidCName =3D RawSection.split(=0D + DT.TAB_PCD_ERROR+'.')[1].strip()=0D continue=0D =0D if TokenSpaceGuidCName and self._RawData.CurrentLine.startswit= h(DT.TAB_COMMENT_SPLIT):=0D - self._RawData.CurrentLine =3D self._RawData.CurrentLine.re= place(DT.TAB_COMMENT_SPLIT, '').strip()=0D + self._RawData.CurrentLine =3D self._RawData.CurrentLine.re= place(=0D + DT.TAB_COMMENT_SPLIT, '').strip()=0D if self._RawData.CurrentLine !=3D '':=0D if DT.TAB_VALUE_SPLIT not in self._RawData.CurrentLine= :=0D - self._LoggerError(ST.ERR_DECPARSE_PCDERRORMSG_MISS= _VALUE_SPLIT)=0D + self._LoggerError(=0D + ST.ERR_DECPARSE_PCDERRORMSG_MISS_VALUE_SPLIT)= =0D =0D - PcdErrorNumber, PcdErrorMsg =3D GetSplitValueList(self= ._RawData.CurrentLine, DT.TAB_VALUE_SPLIT, 1)=0D - PcdErrorNumber =3D ParsePcdErrorCode(PcdErrorNumber, s= elf._RawData.Filename, self._RawData.LineIndex)=0D + PcdErrorNumber, PcdErrorMsg =3D GetSplitValueList(=0D + self._RawData.CurrentLine, DT.TAB_VALUE_SPLIT, 1)= =0D + PcdErrorNumber =3D ParsePcdErrorCode(=0D + PcdErrorNumber, self._RawData.Filename, self._RawD= ata.LineIndex)=0D if not PcdErrorMsg.strip():=0D self._LoggerError(ST.ERR_DECPARSE_PCD_MISS_ERRORMS= G)=0D =0D - self.PcdErrorCommentDict[(TokenSpaceGuidCName, PcdErro= rNumber)] =3D PcdErrorMsg.strip()=0D + self.PcdErrorCommentDict[(=0D + TokenSpaceGuidCName, PcdErrorNumber)] =3D PcdError= Msg.strip()=0D else:=0D TokenSpaceGuidCName =3D ''=0D =0D @@ -873,7 +904,7 @@ class Dec(_DecBase, _DecComments): break=0D =0D if Comment and Comment.startswith(DT.TAB_SPECIAL_COMMENT) and = Comment.find(DT.TAB_HEADER_COMMENT) > 0 \=0D - and not Comment[2:Comment.find(DT.TAB_HEADER_COMMENT)].str= ip():=0D + and not Comment[2:Comment.find(DT.TAB_HEADER_COMMENT)]= .strip():=0D IsFileHeader =3D True=0D IsBinaryHeader =3D False=0D FileHeaderLineIndex =3D self._RawData.LineIndex=0D @@ -882,12 +913,12 @@ class Dec(_DecBase, _DecComments): # Get license information before '@file'=0D #=0D if not IsFileHeader and not IsBinaryHeader and Comment and Com= ment.startswith(DT.TAB_COMMENT_SPLIT) and \=0D - DT.TAB_BINARY_HEADER_COMMENT not in Comment:=0D + DT.TAB_BINARY_HEADER_COMMENT not in Comment:=0D self._HeadComment.append((Comment, self._RawData.LineIndex= ))=0D =0D if Comment and IsFileHeader and \=0D - not(Comment.startswith(DT.TAB_SPECIAL_COMMENT) \=0D - and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0):=0D + not(Comment.startswith(DT.TAB_SPECIAL_COMMENT)=0D + and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0):=0D self._HeadComment.append((Comment, self._RawData.LineIndex= ))=0D #=0D # Double '#' indicates end of header comments=0D @@ -897,13 +928,14 @@ class Dec(_DecBase, _DecComments): continue=0D =0D if Comment and Comment.startswith(DT.TAB_SPECIAL_COMMENT) \=0D - and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0:=0D + and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0:=0D IsBinaryHeader =3D True=0D IsFileHeader =3D False=0D BinaryHeaderLineIndex =3D self._RawData.LineIndex=0D =0D if Comment and IsBinaryHeader:=0D - self.BinaryHeadComment.append((Comment, self._RawData.Line= Index))=0D + self.BinaryHeadComment.append(=0D + (Comment, self._RawData.LineIndex))=0D #=0D # Double '#' indicates end of header comments=0D #=0D @@ -918,7 +950,7 @@ class Dec(_DecBase, _DecComments): self._LoggerError(ST.ERR_BINARY_HEADER_ORDER)=0D =0D if FileHeaderLineIndex =3D=3D -1:=0D -# self._LoggerError(ST.ERR_NO_SOURCE_HEADER)=0D + # self._LoggerError(ST.ERR_NO_SOURCE_HEADER)=0D Logger.Error(TOOL_NAME, FORMAT_INVALID,=0D ST.ERR_NO_SOURCE_HEADER,=0D File=3Dself._RawData.Filename)=0D @@ -949,7 +981,8 @@ class Dec(_DecBase, _DecComments): if Token.upper() !=3D DT.TAB_USER_EXTENSIONS.upper():=0D self._LoggerError(ST.ERR_DECPARSE_SECTION_UE)=0D UserExtension =3D Token.upper()=0D - Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE, self.= _RawData.LineIndex)=0D + Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE,=0D + self._RawData.LineIndex)=0D =0D #=0D # UserID=0D @@ -958,7 +991,8 @@ class Dec(_DecBase, _DecComments): if not IsValidUserId(Token):=0D self._LoggerError(ST.ERR_DECPARSE_SECTION_UE_USERID)=0D UserId =3D Token=0D - Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE, self.= _RawData.LineIndex)=0D + Par.AssertChar(DT.TAB_SPLIT, ST.ERR_DECPARSE_SECTION_UE,=0D + self._RawData.LineIndex)=0D #=0D # IdString=0D #=0D @@ -974,7 +1008,7 @@ class Dec(_DecBase, _DecComments): self._LoggerError(ST.ERR_DECPARSE_ARCH)=0D ArchList.add(Arch)=0D if [UserExtension, UserId, IdString, Arch] not in \=0D - self._RawData.CurrentScope:=0D + self._RawData.CurrentScope:=0D self._RawData.CurrentScope.append(=0D [UserExtension, UserId, IdString, Arch]=0D )=0D @@ -986,7 +1020,7 @@ class Dec(_DecBase, _DecComments): if 'COMMON' in ArchList and len(ArchList) > 1:=0D self._LoggerError(ST.ERR_DECPARSE_SECTION_COMMON)=0D =0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D @@ -1014,7 +1048,8 @@ class Dec(_DecBase, _DecComments): ArchList =3D set()=0D for Item in GetSplitValueList(RawSection, DT.TAB_COMMA_SPLIT):=0D if Item =3D=3D '':=0D - self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY % self.= _RawData.CurrentLine)=0D + self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY %=0D + self._RawData.CurrentLine)=0D =0D ItemList =3D GetSplitValueList(Item, DT.TAB_SPLIT)=0D #=0D @@ -1033,7 +1068,8 @@ class Dec(_DecBase, _DecComments): self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBTOOMANY % Ite= m)=0D =0D if DT.TAB_PCDS_FEATURE_FLAG_NULL.upper() in SectionNames and l= en(SectionNames) > 1:=0D - self._LoggerError(ST.ERR_DECPARSE_SECTION_FEATUREFLAG % DT= .TAB_PCDS_FEATURE_FLAG_NULL)=0D + self._LoggerError(ST.ERR_DECPARSE_SECTION_FEATUREFLAG %=0D + DT.TAB_PCDS_FEATURE_FLAG_NULL)=0D #=0D # S1 is always Arch=0D #=0D @@ -1053,39 +1089,55 @@ class Dec(_DecBase, _DecComments): if 'COMMON' in ArchList and len(ArchList) > 1:=0D self._LoggerError(ST.ERR_DECPARSE_SECTION_COMMON)=0D if len(SectionNames) =3D=3D 0:=0D - self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY % self._Raw= Data.CurrentLine)=0D + self._LoggerError(ST.ERR_DECPARSE_SECTION_SUBEMPTY %=0D + self._RawData.CurrentLine)=0D if len(SectionNames) !=3D 1:=0D for Sec in SectionNames:=0D if not Sec.startswith(DT.TAB_PCDS.upper()):=0D - self._LoggerError(ST.ERR_DECPARSE_SECTION_NAME % str(S= ectionNames))=0D + self._LoggerError(=0D + ST.ERR_DECPARSE_SECTION_NAME % str(SectionNames))= =0D =0D def GetDefineSectionMacro(self):=0D return self._Define.GetLocalMacro()=0D +=0D def GetDefineSectionObject(self):=0D return self._Define.GetDataObject()=0D +=0D def GetIncludeSectionObject(self):=0D return self._Include.GetDataObject()=0D +=0D def GetGuidSectionObject(self):=0D return self._Guid.GetGuidObject()=0D +=0D def GetProtocolSectionObject(self):=0D return self._Guid.GetProtocolObject()=0D +=0D def GetPpiSectionObject(self):=0D return self._Guid.GetPpiObject()=0D +=0D def GetLibraryClassSectionObject(self):=0D return self._LibClass.GetDataObject()=0D +=0D def GetPcdSectionObject(self):=0D return self._Pcd.GetDataObject()=0D +=0D def GetUserExtensionSectionObject(self):=0D return self._UserEx.GetDataObject()=0D +=0D def GetPackageSpecification(self):=0D return self._Define.GetDataObject().GetPackageSpecification()=0D +=0D def GetPackageName(self):=0D return self._Define.GetDataObject().GetPackageName()=0D +=0D def GetPackageGuid(self):=0D return self._Define.GetDataObject().GetPackageGuid()=0D +=0D def GetPackageVersion(self):=0D return self._Define.GetDataObject().GetPackageVersion()=0D +=0D def GetPackageUniFile(self):=0D return self._Define.GetDataObject().GetPackageUniFile()=0D +=0D def GetPrivateSections(self):=0D return self._Private=0D diff --git a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py b/BaseTool= s/Source/Python/UPT/Parser/DecParserMisc.py index 27990467d1c5..8b1e949a5f95 100644 --- a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py +++ b/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define helper class and function for DEC parser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -9,7 +9,7 @@ DecParserMisc=0D '''=0D =0D -## Import modules=0D +# Import modules=0D #=0D import os=0D import Logger.Log as Logger=0D @@ -30,9 +30,11 @@ CVAR_PATTERN =3D '[_a-zA-Z][a-zA-Z0-9_]*' PCD_TOKEN_PATTERN =3D '(0[xX]0*[a-fA-F0-9]{1,8})|([0-9]+)'=0D MACRO_PATTERN =3D '[A-Z][_A-Z0-9]*'=0D =0D -## FileContent=0D +# FileContent=0D # Class to hold DEC file information=0D #=0D +=0D +=0D class FileContent:=0D def __init__(self, Filename, FileContent2):=0D self.Filename =3D Filename=0D @@ -72,7 +74,7 @@ class FileContent: return self.LineIndex >=3D self.FileLines=0D =0D =0D -## StripRoot=0D +# StripRoot=0D #=0D # Strip root path=0D #=0D @@ -92,7 +94,7 @@ def StripRoot(Root, Path): return Path=0D return OrigPath=0D =0D -## CleanString=0D +# CleanString=0D #=0D # Split comments in a string=0D # Remove spaces=0D @@ -101,7 +103,9 @@ def StripRoot(Root, Path): # @param CommentCharacter: Comment char, used to ignore comment content,= =0D # default is DataType.TAB_COMMENT_SPLIT=0D #=0D -def CleanString(Line, CommentCharacter=3DTAB_COMMENT_SPLIT, \=0D +=0D +=0D +def CleanString(Line, CommentCharacter=3DTAB_COMMENT_SPLIT,=0D AllowCppStyleComment=3DFalse):=0D #=0D # remove whitespace=0D @@ -129,7 +133,7 @@ def CleanString(Line, CommentCharacter=3DTAB_COMMENT_SP= LIT, \ return Line, Comment=0D =0D =0D -## IsValidNumValUint8=0D +# IsValidNumValUint8=0D #=0D # Check if Token is NumValUint8: ::=3D {} {= } {}=0D #=0D @@ -157,13 +161,15 @@ def IsValidNumValUint8(Token): else:=0D return True=0D =0D -## IsValidNList=0D +# IsValidNList=0D #=0D # Check if Value has the format of ["," ]{0,}=0D # ::=3D {} {} {}=0D #=0D # @param Value: Value to be checked=0D #=0D +=0D +=0D def IsValidNList(Value):=0D Par =3D ParserHelper(Value)=0D if Par.End():=0D @@ -180,12 +186,14 @@ def IsValidNList(Value): break=0D return Par.End()=0D =0D -## IsValidCArray=0D +# IsValidCArray=0D #=0D # check Array is valid=0D #=0D # @param Array: The input Array=0D #=0D +=0D +=0D def IsValidCArray(Array):=0D Par =3D ParserHelper(Array)=0D if not Par.Expect('{'):=0D @@ -212,13 +220,15 @@ def IsValidCArray(Array): return False=0D return Par.End()=0D =0D -## IsValidPcdDatum=0D +# IsValidPcdDatum=0D #=0D # check PcdDatum is valid=0D #=0D # @param Type: The pcd Type=0D # @param Value: The pcd Value=0D #=0D +=0D +=0D def IsValidPcdDatum(Type, Value):=0D if not Value:=0D return False, ST.ERR_DECPARSE_PCD_VALUE_EMPTY=0D @@ -227,13 +237,13 @@ def IsValidPcdDatum(Type, Value): if Type not in ["UINT8", "UINT16", "UINT32", "UINT64", "VOID*", "BOOLE= AN"]:=0D return False, ST.ERR_DECPARSE_PCD_TYPE=0D if Type =3D=3D "VOID*":=0D - if not ((Value.startswith('L"') or Value.startswith('"') and \=0D + if not ((Value.startswith('L"') or Value.startswith('"') and=0D Value.endswith('"'))=0D - or (IsValidCArray(Value)) or (IsValidCFormatGuid(Value)) \= =0D + or (IsValidCArray(Value)) or (IsValidCFormatGuid(Value))=0D or (IsValidNList(Value)) or (CheckGuidRegFormat(Value))=0D - ):=0D + ):=0D return False, ST.ERR_DECPARSE_PCD_VOID % (Value, Type)=0D - RealString =3D Value[Value.find('"') + 1 :-1]=0D + RealString =3D Value[Value.find('"') + 1:-1]=0D if RealString:=0D if not IsValidBareCString(RealString):=0D return False, ST.ERR_DECPARSE_PCD_VOID % (Value, Type)=0D @@ -252,7 +262,7 @@ def IsValidPcdDatum(Type, Value): try:=0D StrVal =3D Value=0D if Value and not Value.startswith('0x') \=0D - and not Value.startswith('0X'):=0D + and not Value.startswith('0X'):=0D Value =3D Value.lstrip('0')=0D if not Value:=0D return True, ""=0D @@ -268,8 +278,10 @@ def IsValidPcdDatum(Type, Value): =0D return True, ""=0D =0D -## ParserHelper=0D +# ParserHelper=0D #=0D +=0D +=0D class ParserHelper:=0D def __init__(self, String, File=3D''):=0D self._String =3D String=0D @@ -277,7 +289,7 @@ class ParserHelper: self._Index =3D 0=0D self._File =3D File=0D =0D - ## End=0D + # End=0D #=0D # End=0D #=0D @@ -285,7 +297,7 @@ class ParserHelper: self.__SkipWhitespace()=0D return self._Index >=3D self._StrLen=0D =0D - ## __SkipWhitespace=0D + # __SkipWhitespace=0D #=0D # Skip whitespace=0D #=0D @@ -295,7 +307,7 @@ class ParserHelper: break=0D self._Index +=3D 1=0D =0D - ## Expect=0D + # Expect=0D #=0D # Expect char in string=0D #=0D @@ -314,7 +326,7 @@ class ParserHelper: #=0D return False=0D =0D - ## GetToken=0D + # GetToken=0D #=0D # Get token until encounter StopChar, front whitespace is consumed=0D #=0D @@ -338,7 +350,7 @@ class ParserHelper: LastChar =3D Char=0D return self._String[PreIndex:self._Index]=0D =0D - ## AssertChar=0D + # AssertChar=0D #=0D # Assert char at current index of string is AssertChar, or will report= =0D # error message=0D @@ -352,7 +364,7 @@ class ParserHelper: Logger.Error(TOOL_NAME, FILE_PARSE_FAILURE, File=3Dself._File,= =0D Line=3DErrorLineNum, ExtraData=3DErrorString)=0D =0D - ## AssertEnd=0D + # AssertEnd=0D #=0D # @param ErrorString: ErrorString=0D # @param ErrorLineNum: ErrorLineNum=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py b/Base= Tools/Source/Python/UPT/Parser/InfAsBuiltProcess.py index 992b609120f8..04142396f3e6 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py +++ b/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to provide method for process AsBuilt INF file. It wil= l consumed by InfParser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -7,7 +7,7 @@ '''=0D InfAsBuiltProcess=0D '''=0D -## Import modules=0D +# Import modules=0D #=0D =0D import os=0D @@ -27,7 +27,7 @@ from Parser.InfParserMisc import InfExpandMacro =0D from Library import DataType as DT=0D =0D -## GetLibInstanceInfo=0D +# GetLibInstanceInfo=0D #=0D # Get the information from Library Instance INF file.=0D #=0D @@ -35,6 +35,8 @@ from Library import DataType as DT # @param WorkSpace. The WorkSpace directory used to combined with INF file= path.=0D #=0D # @return GUID, Version=0D +=0D +=0D def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName):=0D =0D FileGuidString =3D ""=0D @@ -54,10 +56,10 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, Curre= ntInfFileName): # To deal with library instance specified by GUID and version=0D #=0D RegFormatGuidPattern =3D re.compile("\s*([0-9a-fA-F]){8}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){4}-"=0D - "([0-9a-fA-F]){12}\s*")=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){4}-"=0D + "([0-9a-fA-F]){12}\s*")=0D VersionPattern =3D re.compile('[\t\s]*\d+(\.\d+)?[\t\s]*')=0D GuidMatchedObj =3D RegFormatGuidPattern.search(String)=0D =0D @@ -72,8 +74,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, Current= InfFileName): #=0D # To deal with library instance specified by file name=0D #=0D - FileLinesList =3D GetFileLineContent(String, WorkSpace, LineNo, Origin= alString)=0D -=0D + FileLinesList =3D GetFileLineContent(=0D + String, WorkSpace, LineNo, OriginalString)=0D =0D ReFindFileGuidPattern =3D re.compile("^\s*FILE_GUID\s*=3D.*$")=0D ReFindVerStringPattern =3D re.compile("^\s*VERSION_STRING\s*=3D.*$")=0D @@ -91,7 +93,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, Current= InfFileName): =0D return FileGuidString, VerString=0D =0D -## GetPackageListInfo=0D +# GetPackageListInfo=0D #=0D # Get the package information from INF file.=0D #=0D @@ -99,6 +101,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, Curren= tInfFileName): # @param WorkSpace. The WorkSpace directory used to combined with INF file= path.=0D #=0D # @return GUID, Version=0D +=0D +=0D def GetPackageListInfo(FileNameString, WorkSpace, LineNo):=0D PackageInfoList =3D []=0D DefineSectionMacros =3D {}=0D @@ -169,7 +173,8 @@ def GetPackageListInfo(FileNameString, WorkSpace, LineN= o): #=0D # Replace with Local section Macro and [Defines] section Macro= .=0D #=0D - Line =3D InfExpandMacro(Line, (FileNameString, Line, LineNo), = DefineSectionMacros, PackageSectionMacros, True)=0D + Line =3D InfExpandMacro(Line, (FileNameString, Line, LineNo),= =0D + DefineSectionMacros, PackageSectionMacro= s, True)=0D =0D Line =3D GetSplitValueList(Line, "#", 1)[0]=0D Line =3D GetSplitValueList(Line, "|", 1)[0]=0D @@ -177,6 +182,7 @@ def GetPackageListInfo(FileNameString, WorkSpace, LineN= o): =0D return PackageInfoList=0D =0D +=0D def GetFileLineContent(FileName, WorkSpace, LineNo, OriginalString):=0D =0D if not LineNo:=0D @@ -185,7 +191,8 @@ def GetFileLineContent(FileName, WorkSpace, LineNo, Ori= ginalString): #=0D # Validate file name exist.=0D #=0D - FullFileName =3D os.path.normpath(os.path.realpath(os.path.join(WorkSp= ace, FileName)))=0D + FullFileName =3D os.path.normpath(=0D + os.path.realpath(os.path.join(WorkSpace, FileName)))=0D if not (ValidFile(FullFileName)):=0D return []=0D =0D @@ -203,7 +210,8 @@ def GetFileLineContent(FileName, WorkSpace, LineNo, Ori= ginalString): try:=0D FileLinesList =3D Inputfile.readlines()=0D except BaseException:=0D - Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_= FILE_OPEN_FAILURE, File=3DFullFileName)=0D + Logger.Error("InfParser", ToolError.FILE_READ_FAILURE,=0D + ST.ERR_FILE_OPEN_FAILURE, File=3DFullFileName)=0D finally:=0D Inputfile.close()=0D except BaseException:=0D @@ -220,10 +228,12 @@ def GetFileLineContent(FileName, WorkSpace, LineNo, O= riginalString): # Get all INF files from current workspace=0D #=0D #=0D +=0D +=0D def GetInfsFromWorkSpace(WorkSpace):=0D InfFiles =3D []=0D for top, dirs, files in os.walk(WorkSpace):=0D - dirs =3D dirs # just for pylint=0D + dirs =3D dirs # just for pylint=0D for File in files:=0D if File.upper().endswith(".INF"):=0D InfFiles.append(os.path.join(top, File))=0D @@ -234,6 +244,8 @@ def GetInfsFromWorkSpace(WorkSpace): # Get GUID and version from library instance file=0D #=0D #=0D +=0D +=0D def GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName= ):=0D for InfFile in GetInfsFromWorkSpace(WorkSpace):=0D try:=0D @@ -270,14 +282,13 @@ def GetGuidVerFormLibInstance(Guid, Version, WorkSpac= e, CurrentInfFileName): VerString =3D GetSplitValueList(VerString, '=3D', 1)[1]=0D =0D if FileGuidString.strip().upper() =3D=3D Guid.upper() and \=0D - VerString.strip().upper() =3D=3D Version.upper():=0D + VerString.strip().upper() =3D=3D Version.upper():=0D return Guid, Version=0D =0D except BaseException:=0D - Logger.Error("InfParser", ToolError.FILE_READ_FAILURE, ST.ERR_= FILE_OPEN_FAILURE, File=3DInfFile)=0D + Logger.Error("InfParser", ToolError.FILE_READ_FAILURE,=0D + ST.ERR_FILE_OPEN_FAILURE, File=3DInfFile)=0D finally:=0D InfFileObj.close()=0D =0D return '', ''=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py b= /BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py index 58b53276ec0e..dec21e622d80 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfBinarySectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Binaries] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,8 +23,9 @@ from Object.Parser.InfCommonObject import InfLineCommentO= bject from Object.Parser.InfCommonObject import CurrentLine=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfBinarySectionParser(InfParserSectionRoot):=0D - ## InfBinaryParser=0D + # InfBinaryParser=0D #=0D #=0D def InfBinaryParser(self, SectionString, InfSectionObject, FileName):= =0D @@ -32,12 +33,12 @@ class InfBinarySectionParser(InfParserSectionRoot): # Macro defined in this section=0D #=0D SectionMacros =3D {}=0D - ValueList =3D []=0D + ValueList =3D []=0D #=0D # For UI (UI, SEC_UI, UNI_UI) binaries=0D # One and only one UI section can be included=0D #=0D - UiBinaryList =3D []=0D + UiBinaryList =3D []=0D #=0D # For Version (VER, SEC_VER, UNI_VER).=0D # One and only one VER section on be included=0D @@ -48,9 +49,9 @@ class InfBinarySectionParser(InfParserSectionRoot): #=0D ComBinaryList =3D []=0D =0D - StillCommentFalg =3D False=0D - HeaderComments =3D []=0D - LineComment =3D None=0D + StillCommentFalg =3D False=0D + HeaderComments =3D []=0D + LineComment =3D None=0D =0D AllSectionContent =3D ''=0D #=0D @@ -58,7 +59,7 @@ class InfBinarySectionParser(InfParserSectionRoot): #=0D for Line in SectionString:=0D BinLineContent =3D Line[0]=0D - BinLineNo =3D Line[1]=0D + BinLineNo =3D Line[1]=0D =0D if BinLineContent.strip() =3D=3D '':=0D continue=0D @@ -104,8 +105,10 @@ class InfBinarySectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if BinLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - TailComments =3D BinLineContent[BinLineContent.find(DT.TAB= _COMMENT_SPLIT):]=0D - BinLineContent =3D BinLineContent[:BinLineContent.find(DT.= TAB_COMMENT_SPLIT)]=0D + TailComments =3D BinLineContent[BinLineContent.find(=0D + DT.TAB_COMMENT_SPLIT):]=0D + BinLineContent =3D BinLineContent[:BinLineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D if LineComment is None:=0D LineComment =3D InfLineCommentObject()=0D LineComment.SetTailComments(TailComments)=0D @@ -114,9 +117,9 @@ class InfBinarySectionParser(InfParserSectionRoot): # Find Macro=0D #=0D MacroDef =3D MacroParser((BinLineContent, BinLineNo),=0D - FileName,=0D - DT.MODEL_EFI_BINARY_FILE,=0D - self.FileLocalMacros)=0D + FileName,=0D + DT.MODEL_EFI_BINARY_FILE,=0D + self.FileLocalMacros)=0D if MacroDef[0] is not None:=0D SectionMacros[MacroDef[0]] =3D MacroDef[1]=0D LineComment =3D None=0D @@ -157,8 +160,8 @@ class InfBinarySectionParser(InfParserSectionRoot): # Should equal to VER/SEC_VER/UNI_VER=0D #=0D elif ValueList[0] =3D=3D DT.BINARY_FILE_TYPE_UNI_VER or \=0D - ValueList[0] =3D=3D DT.BINARY_FILE_TYPE_SEC_VER or \=0D - ValueList[0] =3D=3D DT.BINARY_FILE_TYPE_VER:=0D + ValueList[0] =3D=3D DT.BINARY_FILE_TYPE_SEC_VER or \=0D + ValueList[0] =3D=3D DT.BINARY_FILE_TYPE_VER:=0D if len(ValueList) =3D=3D 2:=0D TokenList =3D GetSplitValueList(ValueList[1],=0D DT.TAB_VALUE_SPLIT,=0D @@ -178,8 +181,8 @@ class InfBinarySectionParser(InfParserSectionRoot): 5)=0D else:=0D TokenList =3D GetSplitValueList(ValueList[1],=0D - DT.TAB_VALUE_SPLIT,=0D - 4)=0D + DT.TAB_VALUE_SPLIT,= =0D + 4)=0D =0D NewValueList =3D []=0D NewValueList.append(ValueList[0])=0D @@ -195,9 +198,6 @@ class InfBinarySectionParser(InfParserSectionRoot): LineComment,=0D CurrentLineObj))=0D =0D -=0D -=0D -=0D ValueList =3D []=0D LineComment =3D None=0D TailComments =3D ''=0D @@ -220,7 +220,7 @@ class InfBinarySectionParser(InfParserSectionRoot): ArchList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[Bi= naries]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Binaries]"),=0D File=3DFileName,=0D Line=3DItem[3])=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser= .py b/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py index e3b48e9f44f6..7b9f794a656f 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfBuildOptionSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for BuildOption sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -25,22 +25,23 @@ from Library.ParserValidate import IsValidFamily from Library.ParserValidate import IsValidBuildOptionName=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfBuildOptionSectionParser(InfParserSectionRoot):=0D - ## InfBuildOptionParser=0D + # InfBuildOptionParser=0D #=0D #=0D def InfBuildOptionParser(self, SectionString, InfSectionObject, FileNa= me):=0D =0D BuildOptionList =3D []=0D - SectionContent =3D ''=0D + SectionContent =3D ''=0D =0D if not GlobalData.gIS_BINARY_INF:=0D - ValueList =3D []=0D - LineNo =3D 0=0D + ValueList =3D []=0D + LineNo =3D 0=0D =0D for Line in SectionString:=0D LineContent =3D Line[0]=0D - LineNo =3D Line[1]=0D + LineNo =3D Line[1]=0D TailComments =3D ''=0D ReplaceFlag =3D False=0D =0D @@ -58,10 +59,13 @@ class InfBuildOptionSectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - TailComments =3D LineContent[LineContent.find(DT.TAB_C= OMMENT_SPLIT):]=0D - LineContent =3D LineContent[:LineContent.find(DT.TAB_C= OMMENT_SPLIT)]=0D + TailComments =3D LineContent[LineContent.find(=0D + DT.TAB_COMMENT_SPLIT):]=0D + LineContent =3D LineContent[:LineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D =0D - TokenList =3D GetSplitValueList(LineContent, DT.TAB_DEQUAL= _SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LineContent, DT.TAB_DEQUAL_SPLIT, 1)=0D if len(TokenList) =3D=3D 2:=0D #=0D # "Replace" type build option=0D @@ -69,7 +73,8 @@ class InfBuildOptionSectionParser(InfParserSectionRoot): TokenList.append('True')=0D ReplaceFlag =3D True=0D else:=0D - TokenList =3D GetSplitValueList(LineContent, DT.TAB_EQ= UAL_SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LineContent, DT.TAB_EQUAL_SPLIT, 1)=0D #=0D # "Append" type build option=0D #=0D @@ -98,7 +103,8 @@ class InfBuildOptionSectionParser(InfParserSectionRoot): else:=0D EqualString =3D ' =3D=3D '=0D =0D - SectionContent +=3D ValueList[0] + EqualString + ValueList= [1] + TailComments + DT.END_OF_LINE=0D + SectionContent +=3D ValueList[0] + EqualString + \=0D + ValueList[1] + TailComments + DT.END_OF_LINE=0D =0D Family =3D GetSplitValueList(ValueList[0], DT.TAB_COLON_SP= LIT, 1)=0D if len(Family) =3D=3D 2:=0D @@ -129,7 +135,8 @@ class InfBuildOptionSectionParser(InfParserSectionRoot): ValueList =3D []=0D continue=0D else:=0D - BuildOptionList =3D InfAsBuiltBuildOptionParser(SectionString,= FileName)=0D + BuildOptionList =3D InfAsBuiltBuildOptionParser(=0D + SectionString, FileName)=0D =0D #=0D # Current section archs=0D @@ -146,13 +153,16 @@ class InfBuildOptionSectionParser(InfParserSectionRoo= t): if not InfSectionObject.SetBuildOptions(BuildOptionList, ArchList,= SectionContent):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[Bu= ilOptions]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[BuilOptions]"),=0D File=3DFileName,=0D Line=3DLastItem[3])=0D =0D -## InfBuildOptionParser=0D +# InfBuildOptionParser=0D #=0D #=0D +=0D +=0D def InfAsBuiltBuildOptionParser(SectionString, FileName):=0D BuildOptionList =3D []=0D #=0D @@ -164,7 +174,7 @@ def InfAsBuiltBuildOptionParser(SectionString, FileName= ): for Line in SectionString:=0D Count +=3D 1=0D LineContent =3D Line[0]=0D - LineNo =3D Line[1]=0D + LineNo =3D Line[1]=0D =0D #=0D # The last line=0D @@ -172,7 +182,8 @@ def InfAsBuiltBuildOptionParser(SectionString, FileName= ): if len(SectionString) =3D=3D Count:=0D if LineContent.strip().startswith("##") and AsBuildOptionFlag:= =0D BuildOptionList.append(BuildOptionItem)=0D - BuildOptionList.append([GetHelpStringByRemoveHashKey(LineC= ontent)])=0D + BuildOptionList.append(=0D + [GetHelpStringByRemoveHashKey(LineContent)])=0D elif LineContent.strip().startswith("#") and AsBuildOptionFlag= :=0D BuildOptionInfo =3D GetHelpStringByRemoveHashKey(LineConte= nt)=0D BuildOptionItem.append(BuildOptionInfo)=0D @@ -195,11 +206,11 @@ def InfAsBuiltBuildOptionParser(SectionString, FileNa= me): =0D if not LineContent.strip().startswith("#"):=0D Logger.Error('InfParser',=0D - FORMAT_INVALID,=0D - ST.ERR_BO_CONTATIN_ASBUILD_AND_COMMON,=0D - File=3DFileName,=0D - Line=3DLineNo,=0D - ExtraData=3DLineContent)=0D + FORMAT_INVALID,=0D + ST.ERR_BO_CONTATIN_ASBUILD_AND_COMMON,=0D + File=3DFileName,=0D + Line=3DLineNo,=0D + ExtraData=3DLineContent)=0D =0D if IsAsBuildOptionInfo(LineContent):=0D AsBuildOptionFlag =3D True=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py b= /BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py index a63e40e61787..49fd1a26f40e 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for define sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -26,14 +26,17 @@ from Object.Parser.InfMisc import ErrorInInf from Logger import StringTable as ST=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D -## __GetValidateArchList=0D +# __GetValidateArchList=0D #=0D #=0D +=0D +=0D def GetValidateArchList(LineContent):=0D =0D TempArch =3D ''=0D ArchList =3D []=0D - ValidateAcrhPatten =3D re.compile(r"^\s*#\s*VALID_ARCHITECTURES\s*=3D\= s*.*$", re.DOTALL)=0D + ValidateAcrhPatten =3D re.compile(=0D + r"^\s*#\s*VALID_ARCHITECTURES\s*=3D\s*.*$", re.DOTALL)=0D =0D if ValidateAcrhPatten.match(LineContent):=0D TempArch =3D GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)= [1]=0D @@ -50,6 +53,7 @@ def GetValidateArchList(LineContent): =0D return ArchList=0D =0D +=0D class InfDefinSectionParser(InfParserSectionRoot):=0D def InfDefineParser(self, SectionString, InfSectionObject, FileName, S= ectionComment):=0D =0D @@ -58,12 +62,12 @@ class InfDefinSectionParser(InfParserSectionRoot): #=0D # Parser Defines section content and fill self._ContentList dict.= =0D #=0D - StillCommentFalg =3D False=0D + StillCommentFalg =3D False=0D HeaderComments =3D []=0D SectionContent =3D ''=0D - ArchList =3D []=0D - _ContentList =3D []=0D - _ValueList =3D []=0D + ArchList =3D []=0D + _ContentList =3D []=0D + _ValueList =3D []=0D #=0D # Add WORKSPACE to global Marco dict.=0D #=0D @@ -71,14 +75,14 @@ class InfDefinSectionParser(InfParserSectionRoot): =0D for Line in SectionString:=0D LineContent =3D Line[0]=0D - LineNo =3D Line[1]=0D - TailComments =3D ''=0D - LineComment =3D None=0D + LineNo =3D Line[1]=0D + TailComments =3D ''=0D + LineComment =3D None=0D =0D - LineInfo =3D ['', -1, '']=0D - LineInfo[0] =3D FileName=0D - LineInfo[1] =3D LineNo=0D - LineInfo[2] =3D LineContent=0D + LineInfo =3D ['', -1, '']=0D + LineInfo[0] =3D FileName=0D + LineInfo[1] =3D LineNo=0D + LineInfo[2] =3D LineContent=0D =0D if LineContent.strip() =3D=3D '':=0D continue=0D @@ -125,8 +129,10 @@ class InfDefinSectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - TailComments =3D LineContent[LineContent.find(DT.TAB_COMME= NT_SPLIT):]=0D - LineContent =3D LineContent[:LineContent.find(DT.TAB_COMME= NT_SPLIT)]=0D + TailComments =3D LineContent[LineContent.find(=0D + DT.TAB_COMMENT_SPLIT):]=0D + LineContent =3D LineContent[:LineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D if LineComment is None:=0D LineComment =3D InfLineCommentObject()=0D LineComment.SetTailComments(TailComments)=0D @@ -168,8 +174,10 @@ class InfDefinSectionParser(InfParserSectionRoot): =0D InfDefMemberObj =3D InfDefMember(Name, Value)=0D if (LineComment is not None):=0D - InfDefMemberObj.Comments.SetHeaderComments(LineComment.Get= HeaderComments())=0D - InfDefMemberObj.Comments.SetTailComments(LineComment.GetTa= ilComments())=0D + InfDefMemberObj.Comments.SetHeaderComments(=0D + LineComment.GetHeaderComments())=0D + InfDefMemberObj.Comments.SetTailComments(=0D + LineComment.GetTailComments())=0D =0D InfDefMemberObj.CurrentLine.SetFileName(self.FullPath)=0D InfDefMemberObj.CurrentLine.SetLineString(LineContent)=0D @@ -188,4 +196,3 @@ class InfDefinSectionParser(InfParserSectionRoot): InfSectionObject.SetAllContent(SectionContent)=0D =0D InfSectionObject.SetDefines(_ContentList, Arch=3DArchList)=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py b/= BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py index a2e836e482b9..bdad3c79c5bd 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfDepexSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Depex] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -20,8 +20,9 @@ from Library import DataType as DT from Library.Misc import GetSplitValueList=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfDepexSectionParser(InfParserSectionRoot):=0D - ## InfDepexParser=0D + # InfDepexParser=0D #=0D # For now, only separate Depex String and comments.=0D # Have two types of section header.=0D @@ -31,13 +32,13 @@ class InfDepexSectionParser(InfParserSectionRoot): def InfDepexParser(self, SectionString, InfSectionObject, FileName):=0D DepexContent =3D []=0D DepexComment =3D []=0D - ValueList =3D []=0D + ValueList =3D []=0D #=0D # Parse section content=0D #=0D for Line in SectionString:=0D LineContent =3D Line[0]=0D - LineNo =3D Line[1]=0D + LineNo =3D Line[1]=0D =0D #=0D # Found comment=0D @@ -59,7 +60,6 @@ class InfDepexSectionParser(InfParserSectionRoot): DepexComment.append((LineContent[CommentCount:], LineNo))= =0D LineContent =3D LineContent[:CommentCount-1]=0D =0D -=0D CommentCount =3D -1=0D DepexContent.append((LineContent, LineNo))=0D =0D @@ -90,9 +90,10 @@ class InfDepexSectionParser(InfParserSectionRoot): else:=0D FormatCommentLn =3D CommentItem[1] + 1=0D =0D - if not InfSectionObject.SetDepex(DepexContent, KeyList =3D KeyList= , CommentList =3D NewCommentList):=0D + if not InfSectionObject.SetDepex(DepexContent, KeyList=3DKeyList, = CommentList=3DNewCommentList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[De= pex]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Depex]"),=0D File=3DFileName,=0D Line=3DLastItem[3])=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionPa= rser.py b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParse= r.py index 9b83c0473ba6..2821007a5319 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfGuidPpiProtocolSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Guids], [Ppis], [Protocols] sections= in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -25,8 +25,9 @@ from Library.ParserValidate import IsValidUserId from Library.ParserValidate import IsValidArch=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfGuidPpiProtocolSectionParser(InfParserSectionRoot):=0D - ## InfGuidParser=0D + # InfGuidParser=0D #=0D #=0D def InfGuidParser(self, SectionString, InfSectionObject, FileName):=0D @@ -58,10 +59,10 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): #=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D CommentsList.append((=0D - LineContent[LineContent.find(DT.TAB_COMMENT_SP= LIT):],=0D - LineNo))=0D + LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT)= :],=0D + LineNo))=0D LineContent =3D \=0D - LineContent[:LineContent.find(DT.TAB_COMMENT_S= PLIT)]=0D + LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT= )]=0D =0D if LineContent !=3D '':=0D #=0D @@ -77,7 +78,8 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionRoo= t): ValueList =3D []=0D continue=0D =0D - TokenList =3D GetSplitValueList(LineContent, DT.TAB_VALUE_= SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LineContent, DT.TAB_VALUE_SPLIT, 1)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D @@ -85,11 +87,10 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): #=0D ValueList =3D [InfExpandMacro(Value, (FileName, LineConten= t, LineNo),=0D self.FileLocalMacros, SectionM= acros, True)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D CurrentLineVar =3D (LineContent, LineNo, FileName)=0D =0D -=0D if len(ValueList) >=3D 1:=0D GuidList.append((ValueList, CommentsList, CurrentLineVar))= =0D CommentsList =3D []=0D @@ -109,11 +110,12 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): if not InfSectionObject.SetGuid(GuidList, Arch=3DArchList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[= Guid]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Guid]"),=0D File=3DFileName,=0D Line=3DLineIndex)=0D =0D - ## InfPpiParser=0D + # InfPpiParser=0D #=0D #=0D def InfPpiParser(self, SectionString, InfSectionObject, FileName):=0D @@ -145,10 +147,10 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): #=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D CommentsList.append((=0D - LineContent[LineContent.find(DT.TAB_COMMENT_SP= LIT):],=0D - LineNo))=0D + LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT)= :],=0D + LineNo))=0D LineContent =3D \=0D - LineContent[:LineContent.find(DT.TAB_COMMENT_S= PLIT)]=0D + LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT= )]=0D =0D if LineContent !=3D '':=0D #=0D @@ -164,14 +166,15 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): CommentsList =3D []=0D continue=0D =0D - TokenList =3D GetSplitValueList(LineContent, DT.TAB_VALUE_= SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LineContent, DT.TAB_VALUE_SPLIT, 1)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D # Replace with Local section Macro and [Defines] section M= acro.=0D #=0D ValueList =3D [InfExpandMacro(Value, (FileName, LineConten= t, LineNo), self.FileLocalMacros, SectionMacros)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D CurrentLineVar =3D (LineContent, LineNo, FileName)=0D =0D @@ -194,11 +197,12 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): if not InfSectionObject.SetPpi(PpiList, Arch=3DArchList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[= Ppis]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Ppis]"),=0D File=3DFileName,=0D Line=3DLineIndex)=0D =0D - ## InfUserExtensionParser=0D + # InfUserExtensionParser=0D #=0D #=0D def InfUserExtensionParser(self, SectionString, InfSectionObject, File= Name):=0D @@ -245,7 +249,8 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): if not IsValidUserId(UserId):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_UE_SECTION_USER_ID_ERRO= R % (Item[1]),=0D + ST.ERR_INF_PARSER_UE_SECTION_USER_ID_ERRO= R % (=0D + Item[1]),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DSectionLineNo,=0D ExtraData=3DNone)=0D @@ -253,7 +258,8 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): if not IsValidIdString(IdString):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_UE_SECTION_ID_STRING_ER= ROR % (IdString),=0D + ST.ERR_INF_PARSER_UE_SECTION_ID_STRING_ER= ROR % (=0D + IdString),=0D File=3DGlobalData.gINF_MODULE_NAME, Line= =3DSectionLineNo,=0D ExtraData=3DNone)=0D IdContentList.append((UserId, IdString, Arch))=0D @@ -272,7 +278,7 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): Logger.Error('InfParser',=0D FORMAT_INVALID,=0D ST.ERR_INF_PARSER_UE_SECTION_DUPLICATE_ERROR = % (=0D - IdStri= ng),=0D + IdString),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D Line=3DSectionLineNo,=0D ExtraData=3DNone)=0D @@ -281,10 +287,10 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): if not InfSectionObject.SetUserExtension(UserExtensionContent,=0D IdContent=3DIdContentList= ,=0D LineNo=3DSectionLineNo):= =0D - Logger.Error\=0D - ('InfParser', FORMAT_INVALID, \=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[UserExtensio= n]"), \=0D - File=3DFileName, Line=3DLastItem[4])=0D + Logger.Error('InfParser', FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[UserExtension]"),=0D + File=3DFileName, Line=3DLastItem[4])=0D =0D def InfProtocolParser(self, SectionString, InfSectionObject, FileName)= :=0D #=0D @@ -315,10 +321,10 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): #=0D if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D CommentsList.append((=0D - LineContent[LineContent.find(DT.TAB_COMMENT_SP= LIT):],=0D - LineNo))=0D + LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT)= :],=0D + LineNo))=0D LineContent =3D \=0D - LineContent[:LineContent.find(DT.TAB_COMMENT_S= PLIT)]=0D + LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT= )]=0D =0D if LineContent !=3D '':=0D #=0D @@ -334,14 +340,15 @@ class InfGuidPpiProtocolSectionParser(InfParserSectio= nRoot): CommentsList =3D []=0D continue=0D =0D - TokenList =3D GetSplitValueList(LineContent, DT.TAB_VALUE_= SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LineContent, DT.TAB_VALUE_SPLIT, 1)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D # Replace with Local section Macro and [Defines] section M= acro.=0D #=0D ValueList =3D [InfExpandMacro(Value, (FileName, LineConten= t, LineNo), self.FileLocalMacros, SectionMacros)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D CurrentLineVar =3D (LineContent, LineNo, FileName)=0D =0D @@ -362,7 +369,7 @@ class InfGuidPpiProtocolSectionParser(InfParserSectionR= oot): ArchList.append(Item[1])=0D =0D if not InfSectionObject.SetProtocol(ProtocolList, Arch=3DArchList)= :=0D - Logger.Error\=0D - ('InfParser', FORMAT_INVALID, \=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[Protocol]"),= \=0D - File=3DFileName, Line=3DLineIndex)=0D + Logger.Error('InfParser', FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Protocol]"),=0D + File=3DFileName, Line=3DLineIndex)=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py = b/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py index f2070b51a42f..61fb75c717d1 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfLibrarySectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Libraries] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -25,8 +25,9 @@ from Parser.InfParserMisc import IsLibInstanceInfo from Parser.InfAsBuiltProcess import GetLibInstanceInfo=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfLibrarySectionParser(InfParserSectionRoot):=0D - ## InfLibraryParser=0D + # InfLibraryParser=0D #=0D #=0D def InfLibraryParser(self, SectionString, InfSectionObject, FileName):= =0D @@ -88,8 +89,10 @@ class InfLibrarySectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if LibLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - LibTailComments =3D LibLineContent[LibLineContent.find= (DT.TAB_COMMENT_SPLIT):]=0D - LibLineContent =3D LibLineContent[:LibLineContent.find= (DT.TAB_COMMENT_SPLIT)]=0D + LibTailComments =3D LibLineContent[LibLineContent.find= (=0D + DT.TAB_COMMENT_SPLIT):]=0D + LibLineContent =3D LibLineContent[:LibLineContent.find= (=0D + DT.TAB_COMMENT_SPLIT)]=0D if LibLineComment is None:=0D LibLineComment =3D InfLineCommentObject()=0D LibLineComment.SetTailComments(LibTailComments)=0D @@ -107,7 +110,8 @@ class InfLibrarySectionParser(InfParserSectionRoot): LibHeaderComments =3D []=0D continue=0D =0D - TokenList =3D GetSplitValueList(LibLineContent, DT.TAB_VAL= UE_SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + LibLineContent, DT.TAB_VALUE_SPLIT, 1)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D @@ -115,7 +119,7 @@ class InfLibrarySectionParser(InfParserSectionRoot): #=0D ValueList =3D [InfExpandMacro(Value, (FileName, LibLineCon= tent, LibLineNo),=0D self.FileLocalMacros, SectionM= acros, True)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D LibraryList.append((ValueList, LibLineComment,=0D (LibLineContent, LibLineNo, FileName))= )=0D @@ -137,14 +141,16 @@ class InfLibrarySectionParser(InfParserSectionRoot): if not InfSectionObject.SetLibraryClasses(LibraryList, KeyList= =3DKeyList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= ("[Library]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= (=0D + "[Library]"),=0D File=3DFileName,=0D Line=3DItem[3])=0D #=0D # For Binary INF=0D #=0D else:=0D - self.InfAsBuiltLibraryParser(SectionString, InfSectionObject, = FileName)=0D + self.InfAsBuiltLibraryParser(=0D + SectionString, InfSectionObject, FileName)=0D =0D def InfAsBuiltLibraryParser(self, SectionString, InfSectionObject, Fil= eName):=0D LibraryList =3D []=0D @@ -159,18 +165,19 @@ class InfLibrarySectionParser(InfParserSectionRoot): =0D if not LineContent.strip().startswith("#"):=0D Logger.Error('InfParser',=0D - FORMAT_INVALID,=0D - ST.ERR_LIB_CONTATIN_ASBUILD_AND_COMMON,=0D - File=3DFileName,=0D - Line=3DLineNo,=0D - ExtraData=3DLineContent)=0D + FORMAT_INVALID,=0D + ST.ERR_LIB_CONTATIN_ASBUILD_AND_COMMON,=0D + File=3DFileName,=0D + Line=3DLineNo,=0D + ExtraData=3DLineContent)=0D =0D if IsLibInstanceInfo(LineContent):=0D LibInsFlag =3D True=0D continue=0D =0D if LibInsFlag:=0D - LibGuid, LibVer =3D GetLibInstanceInfo(LineContent, Global= Data.gWORKSPACE, LineNo, FileName)=0D + LibGuid, LibVer =3D GetLibInstanceInfo(=0D + LineContent, GlobalData.gWORKSPACE, LineNo, FileName)= =0D #=0D # If the VERSION_STRING is missing from the INF file, tool= should default to "0".=0D #=0D @@ -192,6 +199,7 @@ class InfLibrarySectionParser(InfParserSectionRoot): if not InfSectionObject.SetLibraryClasses(LibraryList, KeyList=3DK= eyList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[= Library]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Library]"),=0D File=3DFileName,=0D Line=3DItem[3])=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py = b/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py index f43241034d22..d040f50c4d74 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfPackageSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Packages] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -22,8 +22,9 @@ from Library.Misc import GetSplitValueList from Object.Parser.InfCommonObject import InfLineCommentObject=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfPackageSectionParser(InfParserSectionRoot):=0D - ## InfPackageParser=0D + # InfPackageParser=0D #=0D #=0D def InfPackageParser(self, SectionString, InfSectionObject, FileName):= =0D @@ -31,17 +32,17 @@ class InfPackageSectionParser(InfParserSectionRoot): # Macro defined in this section=0D #=0D SectionMacros =3D {}=0D - ValueList =3D []=0D - PackageList =3D []=0D - StillCommentFalg =3D False=0D - HeaderComments =3D []=0D - LineComment =3D None=0D + ValueList =3D []=0D + PackageList =3D []=0D + StillCommentFalg =3D False=0D + HeaderComments =3D []=0D + LineComment =3D None=0D #=0D # Parse section content=0D #=0D for Line in SectionString:=0D PkgLineContent =3D Line[0]=0D - PkgLineNo =3D Line[1]=0D + PkgLineNo =3D Line[1]=0D =0D if PkgLineContent.strip() =3D=3D '':=0D continue=0D @@ -81,8 +82,10 @@ class InfPackageSectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if PkgLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - TailComments =3D PkgLineContent[PkgLineContent.find(DT.TAB= _COMMENT_SPLIT):]=0D - PkgLineContent =3D PkgLineContent[:PkgLineContent.find(DT.= TAB_COMMENT_SPLIT)]=0D + TailComments =3D PkgLineContent[PkgLineContent.find(=0D + DT.TAB_COMMENT_SPLIT):]=0D + PkgLineContent =3D PkgLineContent[:PkgLineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D if LineComment is None:=0D LineComment =3D InfLineCommentObject()=0D LineComment.SetTailComments(TailComments)=0D @@ -99,7 +102,8 @@ class InfPackageSectionParser(InfParserSectionRoot): HeaderComments =3D []=0D continue=0D =0D - TokenList =3D GetSplitValueList(PkgLineContent, DT.TAB_VALUE_S= PLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + PkgLineContent, DT.TAB_VALUE_SPLIT, 1)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D @@ -107,7 +111,7 @@ class InfPackageSectionParser(InfParserSectionRoot): #=0D ValueList =3D [InfExpandMacro(Value, (FileName, PkgLineContent= , PkgLineNo),=0D self.FileLocalMacros, SectionMacro= s, True)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D PackageList.append((ValueList, LineComment,=0D (PkgLineContent, PkgLineNo, FileName)))=0D @@ -125,10 +129,10 @@ class InfPackageSectionParser(InfParserSectionRoot): if Item[1] not in ArchList:=0D ArchList.append(Item[1])=0D =0D - if not InfSectionObject.SetPackages(PackageList, Arch =3D ArchList= ):=0D + if not InfSectionObject.SetPackages(PackageList, Arch=3DArchList):= =0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR\=0D - %("[Packages]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR=0D + % ("[Packages]"),=0D File=3DFileName,=0D Line=3DItem[3])=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfParser.py b/BaseTools/So= urce/Python/UPT/Parser/InfParser.py index 2072be6e42f9..a4cbad7feb5f 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -38,9 +38,11 @@ from Parser.InfSectionParser import InfSectionParser from Parser.InfParserMisc import gINF_SECTION_DEF=0D from Parser.InfParserMisc import IsBinaryInf=0D =0D -## OpenInfFile=0D +# OpenInfFile=0D #=0D #=0D +=0D +=0D def OpenInfFile(Filename):=0D FileLinesList =3D []=0D =0D @@ -63,7 +65,7 @@ def OpenInfFile(Filename): =0D return FileLinesList=0D =0D -## InfParser=0D +# InfParser=0D #=0D # This class defined the structure used in InfParser object=0D #=0D @@ -73,19 +75,21 @@ def OpenInfFile(Filename): # @param WorkspaceDir: Input value for current workspace directory,=0D # default is None=0D #=0D +=0D +=0D class InfParser(InfSectionParser):=0D =0D - def __init__(self, Filename =3D None, WorkspaceDir =3D None):=0D + def __init__(self, Filename=3DNone, WorkspaceDir=3DNone):=0D =0D #=0D # Call parent class construct function=0D #=0D InfSectionParser.__init__()=0D =0D - self.WorkspaceDir =3D WorkspaceDir=0D - self.SupArchList =3D DT.ARCH_LIST=0D - self.EventList =3D []=0D - self.HobList =3D []=0D + self.WorkspaceDir =3D WorkspaceDir=0D + self.SupArchList =3D DT.ARCH_LIST=0D + self.EventList =3D []=0D + self.HobList =3D []=0D self.BootModeList =3D []=0D =0D #=0D @@ -94,7 +98,7 @@ class InfParser(InfSectionParser): if Filename is not None:=0D self.ParseInfFile(Filename)=0D =0D - ## Parse INF file=0D + # Parse INF file=0D #=0D # Parse the file if it exists=0D #=0D @@ -113,18 +117,18 @@ class InfParser(InfSectionParser): #=0D # Initialize common data=0D #=0D - LineNo =3D 0=0D - CurrentSection =3D DT.MODEL_UNKNOWN=0D - SectionLines =3D []=0D + LineNo =3D 0=0D + CurrentSection =3D DT.MODEL_UNKNOWN=0D + SectionLines =3D []=0D =0D #=0D # Flags=0D #=0D HeaderCommentStart =3D False=0D - HeaderCommentEnd =3D False=0D + HeaderCommentEnd =3D False=0D HeaderStarLineNo =3D -1=0D BinaryHeaderCommentStart =3D False=0D - BinaryHeaderCommentEnd =3D False=0D + BinaryHeaderCommentEnd =3D False=0D BinaryHeaderStarLineNo =3D -1=0D =0D #=0D @@ -136,17 +140,17 @@ class InfParser(InfSectionParser): #=0D # Parse file content=0D #=0D - CommentBlock =3D []=0D + CommentBlock =3D []=0D =0D #=0D # Variables for Event/Hob/BootMode=0D #=0D - self.EventList =3D []=0D - self.HobList =3D []=0D + self.EventList =3D []=0D + self.HobList =3D []=0D self.BootModeList =3D []=0D SectionType =3D ''=0D =0D - FileLinesList =3D OpenInfFile (Filename)=0D + FileLinesList =3D OpenInfFile(Filename)=0D =0D #=0D # One INF file can only has one [Defines] section.=0D @@ -178,8 +182,8 @@ class InfParser(InfSectionParser): InfSectionCommonDefObj =3D None=0D =0D for Line in FileLinesList:=0D - LineNo =3D LineNo + 1=0D - Line =3D Line.strip()=0D + LineNo =3D LineNo + 1=0D + Line =3D Line.strip()=0D if (LineNo < len(FileLinesList) - 1):=0D NextLine =3D FileLinesList[LineNo].strip()=0D =0D @@ -209,28 +213,30 @@ class InfParser(InfSectionParser): # Collect Header content.=0D #=0D if (Line.startswith(DT.TAB_COMMENT_SPLIT) and CurrentSection = =3D=3D DT.MODEL_META_DATA_FILE_HEADER) and\=0D - HeaderCommentStart and not Line.startswith(DT.TAB_SPECIAL_= COMMENT) and not\=0D - HeaderCommentEnd and NextLine !=3D '':=0D + HeaderCommentStart and not Line.startswith(DT.TAB_SPEC= IAL_COMMENT) and not\=0D + HeaderCommentEnd and NextLine !=3D '':=0D SectionLines.append((Line, LineNo))=0D continue=0D #=0D # Header content end=0D #=0D if (Line.startswith(DT.TAB_SPECIAL_COMMENT) or not Line.strip(= ).startswith("#")) and HeaderCommentStart \=0D - and not HeaderCommentEnd:=0D + and not HeaderCommentEnd:=0D HeaderCommentEnd =3D True=0D BinaryHeaderCommentStart =3D False=0D - BinaryHeaderCommentEnd =3D False=0D + BinaryHeaderCommentEnd =3D False=0D HeaderCommentStart =3D False=0D if Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1:=0D - self.InfHeaderParser(SectionLines, self.InfHeader, sel= f.FileName)=0D + self.InfHeaderParser(=0D + SectionLines, self.InfHeader, self.FileName)=0D SectionLines =3D []=0D else:=0D SectionLines.append((Line, LineNo))=0D #=0D # Call Header comment parser.=0D #=0D - self.InfHeaderParser(SectionLines, self.InfHeader, sel= f.FileName)=0D + self.InfHeaderParser(=0D + SectionLines, self.InfHeader, self.FileName)=0D SectionLines =3D []=0D continue=0D =0D @@ -239,7 +245,7 @@ class InfParser(InfSectionParser): #=0D if Line.startswith(DT.TAB_SPECIAL_COMMENT) and \=0D (Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1) and \=0D - not BinaryHeaderCommentStart:=0D + not BinaryHeaderCommentStart:=0D SectionLines =3D []=0D CurrentSection =3D DT.MODEL_META_DATA_FILE_HEADER=0D #=0D @@ -255,7 +261,7 @@ class InfParser(InfSectionParser): # check whether there are more than one binary header exist=0D #=0D if Line.startswith(DT.TAB_SPECIAL_COMMENT) and BinaryHeaderCom= mentStart and \=0D - not BinaryHeaderCommentEnd and (Line.find(DT.TAB_BINARY_HE= ADER_COMMENT) > -1):=0D + not BinaryHeaderCommentEnd and (Line.find(DT.TAB_BINAR= Y_HEADER_COMMENT) > -1):=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D ST.ERR_MULTIPLE_BINARYHEADER_EXIST,=0D @@ -265,23 +271,24 @@ class InfParser(InfSectionParser): # Collect Binary Header content.=0D #=0D if (Line.startswith(DT.TAB_COMMENT_SPLIT) and CurrentSection = =3D=3D DT.MODEL_META_DATA_FILE_HEADER) and\=0D - BinaryHeaderCommentStart and not Line.startswith(DT.TAB_SP= ECIAL_COMMENT) and not\=0D - BinaryHeaderCommentEnd and NextLine !=3D '':=0D + BinaryHeaderCommentStart and not Line.startswith(DT.TA= B_SPECIAL_COMMENT) and not\=0D + BinaryHeaderCommentEnd and NextLine !=3D '':=0D SectionLines.append((Line, LineNo))=0D continue=0D #=0D # Binary Header content end=0D #=0D if (Line.startswith(DT.TAB_SPECIAL_COMMENT) or not Line.strip(= ).startswith(DT.TAB_COMMENT_SPLIT)) and \=0D - BinaryHeaderCommentStart and not BinaryHeaderCommentEnd:=0D + BinaryHeaderCommentStart and not BinaryHeaderCommentEn= d:=0D SectionLines.append((Line, LineNo))=0D BinaryHeaderCommentStart =3D False=0D #=0D # Call Binary Header comment parser.=0D #=0D - self.InfHeaderParser(SectionLines, self.InfBinaryHeader, s= elf.FileName, True)=0D + self.InfHeaderParser(=0D + SectionLines, self.InfBinaryHeader, self.FileName, Tru= e)=0D SectionLines =3D []=0D - BinaryHeaderCommentEnd =3D True=0D + BinaryHeaderCommentEnd =3D True=0D continue=0D #=0D # Find a new section tab=0D @@ -300,7 +307,7 @@ class InfParser(InfSectionParser): #=0D # Encountered a section. start with '[' and end with ']'=0D #=0D - if (Line.startswith(DT.TAB_SECTION_START) and \=0D + if (Line.startswith(DT.TAB_SECTION_START) and=0D Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:=0D =0D HeaderCommentEnd =3D True=0D @@ -323,14 +330,15 @@ class InfParser(InfSectionParser): # Keep last time section header content for section pa= rser=0D # usage.=0D #=0D - self.LastSectionHeaderContent =3D deepcopy(self.Sectio= nHeaderContent)=0D + self.LastSectionHeaderContent =3D deepcopy(=0D + self.SectionHeaderContent)=0D =0D #=0D # TailComments in section define.=0D #=0D TailComments =3D ''=0D CommentIndex =3D Line.find(DT.TAB_COMMENT_SPLIT)=0D - if CommentIndex > -1:=0D + if CommentIndex > -1:=0D TailComments =3D Line[CommentIndex:]=0D Line =3D Line[:CommentIndex]=0D =0D @@ -345,8 +353,8 @@ class InfParser(InfSectionParser): #=0D if CurrentSection =3D=3D DT.MODEL_META_DATA_DEFINE:=0D DefineSectionParsedFlag =3D self._CallSectionParse= rs(CurrentSection,=0D - DefineS= ectionParsedFlag, SectionLines,=0D - InfSect= ionCommonDefObj, LineNo)=0D + = DefineSectionParsedFlag, SectionLines,=0D + = InfSectionCommonDefObj, LineNo)=0D #=0D # Compare the new section name with current=0D #=0D @@ -354,7 +362,8 @@ class InfParser(InfSectionParser): =0D self._CheckSectionHeaders(Line, LineNo)=0D =0D - SectionType =3D _ConvertSecNameToType(self.SectionHead= erContent[0][0])=0D + SectionType =3D _ConvertSecNameToType(=0D + self.SectionHeaderContent[0][0])=0D =0D if not FirstSectionStartFlag:=0D CurrentSection =3D SectionType=0D @@ -366,7 +375,8 @@ class InfParser(InfSectionParser): continue=0D =0D if LastSectionFalg:=0D - SectionLines, CurrentSection =3D self._ProcessLastSection(= SectionLines, Line, LineNo, CurrentSection)=0D + SectionLines, CurrentSection =3D self._ProcessLastSection(= =0D + SectionLines, Line, LineNo, CurrentSection)=0D =0D #=0D # End of section content collect.=0D @@ -374,7 +384,7 @@ class InfParser(InfSectionParser): #=0D if NewSectionStartFlag or LastSectionFalg:=0D if CurrentSection !=3D DT.MODEL_META_DATA_DEFINE or \=0D - (LastSectionFalg and CurrentSection =3D=3D DT.MODEL_ME= TA_DATA_DEFINE):=0D + (LastSectionFalg and CurrentSection =3D=3D DT.MODE= L_META_DATA_DEFINE):=0D DefineSectionParsedFlag =3D self._CallSectionParsers(C= urrentSection,=0D Def= ineSectionParsedFlag, SectionLines,=0D Inf= SectionCommonDefObj, LineNo)=0D @@ -387,14 +397,14 @@ class InfParser(InfSectionParser): =0D if HeaderStarLineNo =3D=3D -1:=0D Logger.Error("InfParser",=0D - FORMAT_INVALID,=0D - ST.ERR_NO_SOURCE_HEADER,=0D - File=3Dself.FullPath)=0D - if BinaryHeaderStarLineNo > -1 and HeaderStarLineNo > -1 and Head= erStarLineNo > BinaryHeaderStarLineNo:=0D + FORMAT_INVALID,=0D + ST.ERR_NO_SOURCE_HEADER,=0D + File=3Dself.FullPath)=0D + if BinaryHeaderStarLineNo > -1 and HeaderStarLineNo > -1 and Heade= rStarLineNo > BinaryHeaderStarLineNo:=0D Logger.Error("InfParser",=0D - FORMAT_INVALID,=0D - ST.ERR_BINARY_HEADER_ORDER,=0D - File=3Dself.FullPath)=0D + FORMAT_INVALID,=0D + ST.ERR_BINARY_HEADER_ORDER,=0D + File=3Dself.FullPath)=0D #=0D # EDKII INF should not have EDKI style comment=0D #=0D @@ -411,7 +421,7 @@ class InfParser(InfSectionParser): #=0D self._ExtractEventHobBootMod(FileLinesList)=0D =0D - ## _CheckSectionHeaders=0D + # _CheckSectionHeaders=0D #=0D #=0D def _CheckSectionHeaders(self, Line, LineNo):=0D @@ -429,10 +439,10 @@ class InfParser(InfSectionParser): # check.=0D #=0D if SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_FIXED_= PCD.upper() or \=0D - SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_PATCH= _PCD.upper() or \=0D - SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_PCD_E= X.upper() or \=0D - SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_PCD.u= pper() or \=0D - SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_FEATU= RE_PCD.upper():=0D + SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_P= ATCH_PCD.upper() or \=0D + SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_P= CD_EX.upper() or \=0D + SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_P= CD.upper() or \=0D + SectionItem[0].strip().upper() =3D=3D DT.TAB_INF_F= EATURE_PCD.upper():=0D ArchList =3D GetSplitValueList(SectionItem[1].strip(),= ' ')=0D else:=0D ArchList =3D [SectionItem[1].strip()]=0D @@ -441,10 +451,11 @@ class InfParser(InfSectionParser): if (not IsValidArch(Arch)) and \=0D (SectionItem[0].strip().upper() !=3D DT.TAB_DEPEX.= upper()) and \=0D (SectionItem[0].strip().upper() !=3D DT.TAB_USER_E= XTENSIONS.upper()) and \=0D - (SectionItem[0].strip().upper() !=3D DT.TAB_COMMON= _DEFINES.upper()):=0D + (SectionItem[0].strip().upper() !=3D DT.TAB_CO= MMON_DEFINES.upper()):=0D Logger.Error("InfParser",=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_INVAL= ID%(SectionItem[1]),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_INVAL= ID % (=0D + SectionItem[1]),=0D File=3Dself.FullPath,=0D Line=3DLineNo, ExtraData=3DLine)=0D #=0D @@ -454,15 +465,16 @@ class InfParser(InfSectionParser): if (self.SectionHeaderContent[0][0].upper() in ChkModSecti= onList):=0D if SectionItem[2].strip().upper():=0D MoudleTypeList =3D GetSplitValueList(=0D - SectionItem[2].strip().upper())=0D + SectionItem[2].strip().upper())=0D if (not IsValidInfMoudleTypeList(MoudleTypeList)):= =0D Logger.Error("InfParser",=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_I= NVALID%(SectionItem[2]),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_I= NVALID % (=0D + SectionItem[2]),=0D File=3Dself.FullPath, Line=3DLine= No,=0D ExtraData=3DLine)=0D =0D - ## _CallSectionParsers=0D + # _CallSectionParsers=0D #=0D #=0D def _CallSectionParsers(self, CurrentSection, DefineSectionParsedFlag,= =0D @@ -479,7 +491,7 @@ class InfParser(InfSectionParser): PARSER_ERROR,=0D ST.ERR_INF_PARSER_MULTI_DEFINE_SECTION,=0D File=3Dself.FullPath,=0D - RaiseError =3D Logger.IS_RAISE_ERROR)=0D + RaiseError=3DLogger.IS_RAISE_ERROR)=0D =0D elif CurrentSection =3D=3D DT.MODEL_META_DATA_BUILD_OPTION:=0D self.InfBuildOptionParser(SectionLines,=0D @@ -499,10 +511,10 @@ class InfParser(InfSectionParser): # [Pcd] Sections, put it together=0D #=0D elif CurrentSection =3D=3D DT.MODEL_PCD_FIXED_AT_BUILD or \=0D - CurrentSection =3D=3D DT.MODEL_PCD_PATCHABLE_IN_MODULE or \=0D - CurrentSection =3D=3D DT.MODEL_PCD_FEATURE_FLAG or \=0D - CurrentSection =3D=3D DT.MODEL_PCD_DYNAMIC_EX or \=0D - CurrentSection =3D=3D DT.MODEL_PCD_DYNAMIC:=0D + CurrentSection =3D=3D DT.MODEL_PCD_PATCHABLE_IN_MODULE or = \=0D + CurrentSection =3D=3D DT.MODEL_PCD_FEATURE_FLAG or \=0D + CurrentSection =3D=3D DT.MODEL_PCD_DYNAMIC_EX or \=0D + CurrentSection =3D=3D DT.MODEL_PCD_DYNAMIC:=0D self.InfPcdParser(SectionLines,=0D self.InfPcdSection,=0D self.FullPath)=0D @@ -550,13 +562,13 @@ class InfParser(InfSectionParser): PARSER_ERROR,=0D ST.ERR_INF_PARSER_UNKNOWN_SECTION,=0D File=3Dself.FullPath, Line=3DLineNo,=0D - RaiseError =3D Logger.IS_RAISE_ERROR)=0D + RaiseError=3DLogger.IS_RAISE_ERROR)=0D else:=0D Logger.Error("Parser",=0D PARSER_ERROR,=0D ST.ERR_INF_PARSER_NO_SECTION_ERROR,=0D File=3Dself.FullPath, Line=3DLineNo,=0D - RaiseError =3D Logger.IS_RAISE_ERROR)=0D + RaiseError=3DLogger.IS_RAISE_ERROR)=0D =0D return DefineSectionParsedFlag=0D =0D @@ -564,9 +576,9 @@ class InfParser(InfSectionParser): SpecialSectionStart =3D False=0D CheckLocation =3D False=0D GFindSpecialCommentRe =3D \=0D - re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)=0D + re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)=0D GFindNewSectionRe2 =3D \=0D - re.compile(r"""#?(\s*)\[(.*?)\](.*)""", re.DOTALL)=0D + re.compile(r"""#?(\s*)\[(.*?)\](.*)""", re.DOTALL)=0D LineNum =3D 0=0D Element =3D []=0D for Line in FileLinesList:=0D @@ -605,8 +617,8 @@ class InfParser(InfSectionParser): else:=0D if not Line.startswith(DT.TAB_COMMENT_SPLIT):=0D Logger.Warn("Parser",=0D - ST.WARN_SPECIAL_SECTION_LOCATION_= WRONG,=0D - File=3Dself.FullPath, Line=3DLine= Num)=0D + ST.WARN_SPECIAL_SECTION_LOCATION_W= RONG,=0D + File=3Dself.FullPath, Line=3DLineN= um)=0D SpecialSectionStart =3D False=0D CheckLocation =3D False=0D Element =3D []=0D @@ -618,8 +630,8 @@ class InfParser(InfSectionParser): CheckLocation =3D False=0D elif Line:=0D Logger.Warn("Parser",=0D - ST.WARN_SPECIAL_SECTION_LOCATION_= WRONG,=0D - File=3Dself.FullPath, Line=3DLine= Num)=0D + ST.WARN_SPECIAL_SECTION_LOCATION_W= RONG,=0D + File=3Dself.FullPath, Line=3DLineN= um)=0D CheckLocation =3D False=0D =0D if len(self.BootModeList) >=3D 1:=0D @@ -639,9 +651,10 @@ class InfParser(InfSectionParser): self.InfSpecialCommentSection,=0D self.FileName,=0D DT.TYPE_HOB_SECTION)=0D - ## _ProcessLastSection=0D + # _ProcessLastSection=0D #=0D #=0D +=0D def _ProcessLastSection(self, SectionLines, Line, LineNo, CurrentSecti= on):=0D #=0D # The last line is a section header. will discard it.=0D @@ -658,7 +671,7 @@ class InfParser(InfSectionParser): File=3Dself.FullPath,=0D Line=3DLineNo,=0D ExtraData=3DLine,=0D - RaiseError =3D Logger.IS_RAISE_ERROR=0D + RaiseError=3DLogger.IS_RAISE_ERROR=0D )=0D else:=0D CurrentSection =3D gINF_SECTION_DEF[TemSectionName]=0D @@ -666,9 +679,11 @@ class InfParser(InfSectionParser): =0D return SectionLines, CurrentSection=0D =0D -## _ConvertSecNameToType=0D +# _ConvertSecNameToType=0D #=0D #=0D +=0D +=0D def _ConvertSecNameToType(SectionName):=0D SectionType =3D ''=0D if SectionName.upper() not in gINF_SECTION_DEF.keys():=0D @@ -677,4 +692,3 @@ def _ConvertSecNameToType(SectionName): SectionType =3D gINF_SECTION_DEF[SectionName.upper()]=0D =0D return SectionType=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py b/BaseTool= s/Source/Python/UPT/Parser/InfParserMisc.py index d01ae9aa0246..58dcf9cb062b 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py +++ b/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the miscellaneous functions for INF parser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -32,31 +32,31 @@ from Logger.StringTable import ERR_MARCO_DEFINITION_MIS= S_ERROR # Sections can exist in INF file=0D #=0D gINF_SECTION_DEF =3D {=0D - DT.TAB_UNKNOWN.upper() : DT.MODEL_UNKNOWN,=0D - DT.TAB_HEADER.upper() : DT.MODEL_META_DATA_FILE_HEADER,=0D - DT.TAB_INF_DEFINES.upper() : DT.MODEL_META_DATA_DEFINE,=0D - DT.TAB_BUILD_OPTIONS.upper() : DT.MODEL_META_DATA_BUILD_OPTION,= =0D - DT.TAB_LIBRARY_CLASSES.upper() : DT.MODEL_EFI_LIBRARY_CLASS,=0D - DT.TAB_PACKAGES.upper() : DT.MODEL_META_DATA_PACKAGE,=0D - DT.TAB_INF_FIXED_PCD.upper() : DT.MODEL_PCD_FIXED_AT_BUILD,=0D - DT.TAB_INF_PATCH_PCD.upper() : DT.MODEL_PCD_PATCHABLE_IN_MODULE,= =0D - DT.TAB_INF_FEATURE_PCD.upper() : DT.MODEL_PCD_FEATURE_FLAG,=0D - DT.TAB_INF_PCD_EX.upper() : DT.MODEL_PCD_DYNAMIC_EX,=0D - DT.TAB_INF_PCD.upper() : DT.MODEL_PCD_DYNAMIC,=0D - DT.TAB_SOURCES.upper() : DT.MODEL_EFI_SOURCE_FILE,=0D - DT.TAB_GUIDS.upper() : DT.MODEL_EFI_GUID,=0D - DT.TAB_PROTOCOLS.upper() : DT.MODEL_EFI_PROTOCOL,=0D - DT.TAB_PPIS.upper() : DT.MODEL_EFI_PPI,=0D - DT.TAB_DEPEX.upper() : DT.MODEL_EFI_DEPEX,=0D - DT.TAB_BINARIES.upper() : DT.MODEL_EFI_BINARY_FILE,=0D - DT.TAB_USER_EXTENSIONS.upper() : DT.MODEL_META_DATA_USER_EXTENSION= =0D - #=0D - # EDK1 section=0D - # TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE=0D - #=0D - }=0D + DT.TAB_UNKNOWN.upper(): DT.MODEL_UNKNOWN,=0D + DT.TAB_HEADER.upper(): DT.MODEL_META_DATA_FILE_HEADER,=0D + DT.TAB_INF_DEFINES.upper(): DT.MODEL_META_DATA_DEFINE,=0D + DT.TAB_BUILD_OPTIONS.upper(): DT.MODEL_META_DATA_BUILD_OPTION,=0D + DT.TAB_LIBRARY_CLASSES.upper(): DT.MODEL_EFI_LIBRARY_CLASS,=0D + DT.TAB_PACKAGES.upper(): DT.MODEL_META_DATA_PACKAGE,=0D + DT.TAB_INF_FIXED_PCD.upper(): DT.MODEL_PCD_FIXED_AT_BUILD,=0D + DT.TAB_INF_PATCH_PCD.upper(): DT.MODEL_PCD_PATCHABLE_IN_MODULE,=0D + DT.TAB_INF_FEATURE_PCD.upper(): DT.MODEL_PCD_FEATURE_FLAG,=0D + DT.TAB_INF_PCD_EX.upper(): DT.MODEL_PCD_DYNAMIC_EX,=0D + DT.TAB_INF_PCD.upper(): DT.MODEL_PCD_DYNAMIC,=0D + DT.TAB_SOURCES.upper(): DT.MODEL_EFI_SOURCE_FILE,=0D + DT.TAB_GUIDS.upper(): DT.MODEL_EFI_GUID,=0D + DT.TAB_PROTOCOLS.upper(): DT.MODEL_EFI_PROTOCOL,=0D + DT.TAB_PPIS.upper(): DT.MODEL_EFI_PPI,=0D + DT.TAB_DEPEX.upper(): DT.MODEL_EFI_DEPEX,=0D + DT.TAB_BINARIES.upper(): DT.MODEL_EFI_BINARY_FILE,=0D + DT.TAB_USER_EXTENSIONS.upper(): DT.MODEL_META_DATA_USER_EXTENSION=0D + #=0D + # EDK1 section=0D + # TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE=0D + #=0D +}=0D =0D -## InfExpandMacro=0D +# InfExpandMacro=0D #=0D # Expand MACRO definition with MACROs defined in [Defines] section and spe= cific section.=0D # The MACROs defined in specific section has high priority and will be exp= anded firstly.=0D @@ -66,6 +66,8 @@ gINF_SECTION_DEF =3D { # @param SectionMacros MACROs defined in INF specific section=0D # @param Flag If the flag set to True, need to skip macros in a q= uoted string=0D #=0D +=0D +=0D def InfExpandMacro(Content, LineInfo, GlobalMacros=3DNone, SectionMacros= =3DNone, Flag=3DFalse):=0D if GlobalMacros is None:=0D GlobalMacros =3D {}=0D @@ -85,21 +87,21 @@ def InfExpandMacro(Content, LineInfo, GlobalMacros=3DNo= ne, SectionMacros=3DNone, Fla #=0D # First, replace MARCOs with value defined in specific section=0D #=0D - Content =3D ReplaceMacro (Content,=0D - SectionMacros,=0D - False,=0D - (LineContent, LineNo),=0D - FileName,=0D - Flag)=0D + Content =3D ReplaceMacro(Content,=0D + SectionMacros,=0D + False,=0D + (LineContent, LineNo),=0D + FileName,=0D + Flag)=0D #=0D # Then replace MARCOs with value defined in [Defines] section=0D #=0D - Content =3D ReplaceMacro (Content,=0D - GlobalMacros,=0D - False,=0D - (LineContent, LineNo),=0D - FileName,=0D - Flag)=0D + Content =3D ReplaceMacro(Content,=0D + GlobalMacros,=0D + False,=0D + (LineContent, LineNo),=0D + FileName,=0D + Flag)=0D =0D MacroUsed =3D gMACRO_PATTERN.findall(Content)=0D #=0D @@ -109,18 +111,18 @@ def InfExpandMacro(Content, LineInfo, GlobalMacros=3D= None, SectionMacros=3DNone, Fla return Content=0D else:=0D for Macro in MacroUsed:=0D - gQuotedMacro =3D re.compile(".*\".*\$\(%s\).*\".*"%(Macro))=0D + gQuotedMacro =3D re.compile(".*\".*\$\(%s\).*\".*" % (Macro))= =0D if not gQuotedMacro.match(Content):=0D #=0D # Still have MACROs can't be expanded.=0D #=0D - ErrorInInf (ERR_MARCO_DEFINITION_MISS_ERROR,=0D - LineInfo=3DNewLineInfo)=0D + ErrorInInf(ERR_MARCO_DEFINITION_MISS_ERROR,=0D + LineInfo=3DNewLineInfo)=0D =0D return Content=0D =0D =0D -## IsBinaryInf=0D +# IsBinaryInf=0D #=0D # Judge whether the INF file is Binary INF or Common INF=0D #=0D @@ -146,7 +148,7 @@ def IsBinaryInf(FileLineList): return False=0D =0D =0D -## IsLibInstanceInfo=0D +# IsLibInstanceInfo=0D #=0D # Judge whether the string contain the information of ## @LIB_INSTANCES.=0D #=0D @@ -162,7 +164,7 @@ def IsLibInstanceInfo(String): return False=0D =0D =0D -## IsAsBuildOptionInfo=0D +# IsAsBuildOptionInfo=0D #=0D # Judge whether the string contain the information of ## @ASBUILD.=0D #=0D @@ -197,20 +199,20 @@ class InfParserSectionRoot(object): =0D self.FullPath =3D ''=0D =0D - self.InfDefSection =3D None=0D - self.InfBuildOptionSection =3D None=0D - self.InfLibraryClassSection =3D None=0D - self.InfPackageSection =3D None=0D - self.InfPcdSection =3D None=0D - self.InfSourcesSection =3D None=0D - self.InfUserExtensionSection =3D None=0D - self.InfProtocolSection =3D None=0D - self.InfPpiSection =3D None=0D - self.InfGuidSection =3D None=0D - self.InfDepexSection =3D None=0D - self.InfPeiDepexSection =3D None=0D - self.InfDxeDepexSection =3D None=0D - self.InfSmmDepexSection =3D None=0D - self.InfBinariesSection =3D None=0D - self.InfHeader =3D None=0D - self.InfSpecialCommentSection =3D None=0D + self.InfDefSection =3D None=0D + self.InfBuildOptionSection =3D None=0D + self.InfLibraryClassSection =3D None=0D + self.InfPackageSection =3D None=0D + self.InfPcdSection =3D None=0D + self.InfSourcesSection =3D None=0D + self.InfUserExtensionSection =3D None=0D + self.InfProtocolSection =3D None=0D + self.InfPpiSection =3D None=0D + self.InfGuidSection =3D None=0D + self.InfDepexSection =3D None=0D + self.InfPeiDepexSection =3D None=0D + self.InfDxeDepexSection =3D None=0D + self.InfSmmDepexSection =3D None=0D + self.InfBinariesSection =3D None=0D + self.InfHeader =3D None=0D + self.InfSpecialCommentSection =3D None=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py b/Ba= seTools/Source/Python/UPT/Parser/InfPcdSectionParser.py index 6954742bf20f..1ea4770a3d99 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfPcdSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Pcds] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,8 +23,9 @@ from Library import GlobalData from Library.StringUtils import SplitPcdEntry=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfPcdSectionParser(InfParserSectionRoot):=0D - ## Section PCD related parser=0D + # Section PCD related parser=0D #=0D # For 5 types of PCD list below, all use this function.=0D # 'FixedPcd', 'FeaturePcd', 'PatchPcd', 'Pcd', 'PcdEx'=0D @@ -35,7 +36,7 @@ class InfPcdSectionParser(InfParserSectionRoot): #=0D def InfPcdParser(self, SectionString, InfSectionObject, FileName):=0D KeysList =3D []=0D - PcdList =3D []=0D + PcdList =3D []=0D CommentsList =3D []=0D ValueList =3D []=0D #=0D @@ -47,10 +48,10 @@ class InfPcdSectionParser(InfParserSectionRoot): KeysList.append((Item[0], Item[1], Item[3]))=0D LineIndex =3D Item[3]=0D =0D - if (Item[0].upper() =3D=3D DT.TAB_INF_FIXED_PCD.upper() or \=0D - Item[0].upper() =3D=3D DT.TAB_INF_FEATURE_PCD.upper() or \= =0D - Item[0].upper() =3D=3D DT.TAB_INF_PCD.upper()) and GlobalD= ata.gIS_BINARY_INF:=0D - Logger.Error('InfParser', FORMAT_INVALID, ST.ERR_ASBUILD_P= CD_SECTION_TYPE%("\"" + Item[0] + "\""),=0D + if (Item[0].upper() =3D=3D DT.TAB_INF_FIXED_PCD.upper() or=0D + Item[0].upper() =3D=3D DT.TAB_INF_FEATURE_PCD.upper() or=0D + Item[0].upper() =3D=3D DT.TAB_INF_PCD.upper()) and Glo= balData.gIS_BINARY_INF:=0D + Logger.Error('InfParser', FORMAT_INVALID, ST.ERR_ASBUILD_P= CD_SECTION_TYPE % ("\"" + Item[0] + "\""),=0D File=3DFileName, Line=3DLineIndex)=0D =0D #=0D @@ -63,7 +64,7 @@ class InfPcdSectionParser(InfParserSectionRoot): SectionMacros =3D {}=0D for Line in SectionString:=0D PcdLineContent =3D Line[0]=0D - PcdLineNo =3D Line[1]=0D + PcdLineNo =3D Line[1]=0D if PcdLineContent.strip() =3D=3D '':=0D CommentsList =3D []=0D continue=0D @@ -77,9 +78,11 @@ class InfPcdSectionParser(InfParserSectionRoot): #=0D if PcdLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D CommentsList.append((=0D - PcdLineContent[PcdLineContent.find(DT.TAB_= COMMENT_SPLIT):],=0D - PcdLineNo))=0D - PcdLineContent =3D PcdLineContent[:PcdLineContent.= find(DT.TAB_COMMENT_SPLIT)]=0D + PcdLineContent[PcdLineContent.find(=0D + DT.TAB_COMMENT_SPLIT):],=0D + PcdLineNo))=0D + PcdLineContent =3D PcdLineContent[:PcdLineContent.= find(=0D + DT.TAB_COMMENT_SPLIT)]=0D =0D if PcdLineContent !=3D '':=0D #=0D @@ -109,10 +112,11 @@ class InfPcdSectionParser(InfParserSectionRoot): #=0D ValueList =3D [InfExpandMacro(Value, (FileName, PcdLin= eContent, PcdLineNo),=0D self.FileLocalMacros, Sect= ionMacros, True)=0D - for Value in ValueList]=0D + for Value in ValueList]=0D =0D if len(ValueList) >=3D 1:=0D - PcdList.append((ValueList, CommentsList, (PcdLineConte= nt, PcdLineNo, FileName)))=0D + PcdList.append(=0D + (ValueList, CommentsList, (PcdLineContent, PcdLine= No, FileName)))=0D ValueList =3D []=0D CommentsList =3D []=0D continue=0D @@ -122,7 +126,7 @@ class InfPcdSectionParser(InfParserSectionRoot): else:=0D for Line in SectionString:=0D LineContent =3D Line[0].strip()=0D - LineNo =3D Line[1]=0D + LineNo =3D Line[1]=0D =0D if LineContent =3D=3D '':=0D CommentsList =3D []=0D @@ -135,7 +139,7 @@ class InfPcdSectionParser(InfParserSectionRoot): # Have comments at tail.=0D #=0D CommentIndex =3D LineContent.find(DT.TAB_COMMENT_SPLIT)=0D - if CommentIndex > -1:=0D + if CommentIndex > -1:=0D CommentsList.append(LineContent[CommentIndex+1:])=0D LineContent =3D LineContent[:CommentIndex]=0D =0D @@ -163,16 +167,17 @@ class InfPcdSectionParser(InfParserSectionRoot): ExtraData=3DLineContent)=0D ValueList[0:len(TokenList)] =3D TokenList=0D if len(ValueList) >=3D 1:=0D - PcdList.append((ValueList, CommentsList, (LineContent,= LineNo, FileName)))=0D + PcdList.append(=0D + (ValueList, CommentsList, (LineContent, LineNo, Fi= leName)))=0D ValueList =3D []=0D CommentsList =3D []=0D continue=0D =0D - if not InfSectionObject.SetPcds(PcdList, KeysList =3D KeysList,=0D - PackageInfo =3D self.InfPackageSec= tion.GetPackages()):=0D + if not InfSectionObject.SetPcds(PcdList, KeysList=3DKeysList,=0D + PackageInfo=3Dself.InfPackageSecti= on.GetPackages()):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR%("[PC= D]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[PCD]"),=0D File=3DFileName,=0D Line=3DLineIndex)=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py b/BaseT= ools/Source/Python/UPT/Parser/InfSectionParser.py index 474d37379d2b..5f5a02dc1370 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -53,10 +53,12 @@ from Parser.InfBinarySectionParser import InfBinarySect= ionParser from Parser.InfPcdSectionParser import InfPcdSectionParser=0D from Parser.InfDepexSectionParser import InfDepexSectionParser=0D =0D -## GetSpecialStr2=0D +# GetSpecialStr2=0D #=0D # GetSpecialStr2=0D #=0D +=0D +=0D def GetSpecialStr2(ItemList, FileName, LineNo, SectionString):=0D Str2 =3D ''=0D #=0D @@ -68,13 +70,14 @@ def GetSpecialStr2(ItemList, FileName, LineNo, SectionS= tring): # section can has more than 2 items in section header string,=0D # others should report error.=0D #=0D - if not (ItemList[0].upper() =3D=3D DT.TAB_LIBRARY_CLASSES.upper() = or \=0D - ItemList[0].upper() =3D=3D DT.TAB_DEPEX.upper() or \=0D + if not (ItemList[0].upper() =3D=3D DT.TAB_LIBRARY_CLASSES.upper() = or=0D + ItemList[0].upper() =3D=3D DT.TAB_DEPEX.upper() or=0D ItemList[0].upper() =3D=3D DT.TAB_USER_EXTENSIONS.upper())= :=0D if ItemList[2] !=3D '':=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_= INVALID % (SectionString),=0D + ST.ERR_INF_PARSER_SOURCE_SECTION_SECTIONNAME_= INVALID % (=0D + SectionString),=0D File=3DFileName,=0D Line=3DLineNo,=0D ExtraData=3DSectionString)=0D @@ -87,7 +90,7 @@ def GetSpecialStr2(ItemList, FileName, LineNo, SectionStr= ing): #=0D if not ItemList[0].upper() =3D=3D DT.TAB_USER_EXTENSIONS.upper() o= r ItemList[0].upper() =3D=3D DT.TAB_DEPEX.upper():=0D if ItemList[3] !=3D '':=0D - Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_S= OURCE_SECTION_SECTIONNAME_INVALID \=0D + Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_S= OURCE_SECTION_SECTIONNAME_INVALID=0D % (SectionString), File=3DFileName, Line=3DLi= neNo, ExtraData=3DSectionString)=0D =0D if not ItemList[0].upper() =3D=3D DT.TAB_USER_EXTENSIONS.upper():= =0D @@ -96,14 +99,16 @@ def GetSpecialStr2(ItemList, FileName, LineNo, SectionS= tring): Str2 =3D ItemList[2]=0D =0D elif len(ItemList) > 4:=0D - Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_SOURCE_SE= CTION_SECTIONNAME_INVALID \=0D + Logger.Error('Parser', FORMAT_INVALID, ST.ERR_INF_PARSER_SOURCE_SE= CTION_SECTIONNAME_INVALID=0D % (SectionString), File=3DFileName, Line=3DLineNo, Ex= traData=3DSectionString)=0D =0D return Str2=0D =0D -## ProcessUseExtHeader=0D +# ProcessUseExtHeader=0D #=0D #=0D +=0D +=0D def ProcessUseExtHeader(ItemList):=0D NewItemList =3D []=0D AppendContent =3D ''=0D @@ -138,10 +143,12 @@ def ProcessUseExtHeader(ItemList): =0D return True, NewItemList=0D =0D -## GetArch=0D +# GetArch=0D #=0D # GetArch=0D #=0D +=0D +=0D def GetArch(ItemList, ArchList, FileName, LineNo, SectionString):=0D #=0D # S1 is always Arch=0D @@ -165,10 +172,12 @@ def GetArch(ItemList, ArchList, FileName, LineNo, Sec= tionString): =0D return Arch, ArchList=0D =0D -## InfSectionParser=0D +# InfSectionParser=0D #=0D # Inherit from object=0D #=0D +=0D +=0D class InfSectionParser(InfDefinSectionParser,=0D InfBuildOptionSectionParser,=0D InfSourceSectionParser,=0D @@ -183,7 +192,7 @@ class InfSectionParser(InfDefinSectionParser, #=0D MetaFiles =3D {}=0D =0D - ## Factory method=0D + # Factory method=0D #=0D # One file, one parser object. This factory method makes sure that the= re's=0D # only one object constructed for one meta file.=0D @@ -248,16 +257,18 @@ class InfSectionParser(InfDefinSectionParser, #=0D # File Header content parser=0D #=0D - def InfHeaderParser(self, Content, InfHeaderObject2, FileName, IsBinar= yHeader =3D False):=0D + def InfHeaderParser(self, Content, InfHeaderObject2, FileName, IsBinar= yHeader=3DFalse):=0D if IsBinaryHeader:=0D - (Abstract, Description, Copyright, License) =3D ParseHeaderCom= mentSection(Content, FileName, True)=0D + (Abstract, Description, Copyright, License) =3D ParseHeaderCom= mentSection(=0D + Content, FileName, True)=0D if not Abstract or not Description or not Copyright or not Lic= ense:=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D ST.ERR_INVALID_BINARYHEADER_FORMAT,=0D File=3DFileName)=0D else:=0D - (Abstract, Description, Copyright, License) =3D ParseHeaderCom= mentSection(Content, FileName)=0D + (Abstract, Description, Copyright,=0D + License) =3D ParseHeaderCommentSection(Content, FileName)=0D #=0D # Not process file name now, for later usage.=0D #=0D @@ -272,10 +283,7 @@ class InfSectionParser(InfDefinSectionParser, InfHeaderObject2.SetCopyright(Copyright)=0D InfHeaderObject2.SetLicense(License)=0D =0D -=0D -=0D -=0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D @@ -283,23 +291,25 @@ class InfSectionParser(InfDefinSectionParser, #=0D # @param String A string contained the content need to be parsed.=0D #=0D +=0D def SectionHeaderParser(self, SectionString, FileName, LineNo):=0D _Scope =3D []=0D _SectionName =3D ''=0D ArchList =3D set()=0D _ValueList =3D []=0D _PcdNameList =3D [DT.TAB_INF_FIXED_PCD.upper(),=0D - DT.TAB_INF_FEATURE_PCD.upper(),=0D - DT.TAB_INF_PATCH_PCD.upper(),=0D - DT.TAB_INF_PCD.upper(),=0D - DT.TAB_INF_PCD_EX.upper()=0D - ]=0D + DT.TAB_INF_FEATURE_PCD.upper(),=0D + DT.TAB_INF_PATCH_PCD.upper(),=0D + DT.TAB_INF_PCD.upper(),=0D + DT.TAB_INF_PCD_EX.upper()=0D + ]=0D SectionString =3D SectionString.strip()=0D for Item in GetSplitValueList(SectionString[1:-1], DT.TAB_COMMA_SP= LIT):=0D if Item =3D=3D '':=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= (""),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= (=0D + ""),=0D File=3DFileName,=0D Line=3DLineNo,=0D ExtraData=3DSectionString)=0D @@ -317,10 +327,11 @@ class InfSectionParser(InfDefinSectionParser, Line=3DLineNo,=0D ExtraData=3DSectionString)=0D elif _PcdNameList[1] in [_SectionName.upper(), ItemList[0].upp= er()] and \=0D - (_SectionName.upper()!=3D ItemList[0].upper()):=0D + (_SectionName.upper() !=3D ItemList[0].upper()):=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= (""),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR %= (=0D + ""),=0D File=3DFileName,=0D Line=3DLineNo,=0D ExtraData=3DSectionString)=0D @@ -340,7 +351,8 @@ class InfSectionParser(InfDefinSectionParser, #=0D # Get Arch=0D #=0D - Str1, ArchList =3D GetArch(ItemList, ArchList, FileName, LineN= o, SectionString)=0D + Str1, ArchList =3D GetArch(=0D + ItemList, ArchList, FileName, LineNo, SectionString)=0D =0D #=0D # For [Defines] section, do special check.=0D @@ -349,7 +361,8 @@ class InfSectionParser(InfDefinSectionParser, if len(ItemList) !=3D 1:=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %= (SectionString),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %= (=0D + SectionString),=0D File=3DFileName, Line=3DLineNo, ExtraData= =3DSectionString)=0D =0D #=0D @@ -362,7 +375,8 @@ class InfSectionParser(InfDefinSectionParser, if not RetValue[0]:=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %= (SectionString),=0D + ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID %= (=0D + SectionString),=0D File=3DFileName, Line=3DLineNo, ExtraData= =3DSectionString)=0D else:=0D ItemList =3D RetValue[1]=0D @@ -377,12 +391,14 @@ class InfSectionParser(InfDefinSectionParser, #=0D if ItemList[0].upper() =3D=3D DT.TAB_LIBRARY_CLASSES.upper() a= nd len(ItemList) =3D=3D 3:=0D if ItemList[2] !=3D '':=0D - ModuleTypeList =3D GetSplitValueList(ItemList[2], DT.T= AB_VALUE_SPLIT)=0D + ModuleTypeList =3D GetSplitValueList(=0D + ItemList[2], DT.TAB_VALUE_SPLIT)=0D for Item in ModuleTypeList:=0D if Item.strip() not in DT.MODULE_LIST:=0D Logger.Error('Parser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_DEFINE_MODULETY= PE_INVALID % (Item),=0D + ST.ERR_INF_PARSER_DEFINE_MODULETY= PE_INVALID % (=0D + Item),=0D File=3DFileName,=0D Line=3DLineNo,=0D ExtraData=3DSectionString)=0D @@ -412,18 +428,20 @@ class InfSectionParser(InfDefinSectionParser, _ValueList.append([_SectionName, Str1, Str2, LineNo])= =0D else:=0D if len(ItemList) =3D=3D 4:=0D - _ValueList.append([_SectionName, Str1, Str2, ItemL= ist[3], LineNo])=0D + _ValueList.append(=0D + [_SectionName, Str1, Str2, ItemList[3], LineNo= ])=0D =0D self.SectionHeaderContent =3D deepcopy(_ValueList)=0D =0D - ## GenSpecialSectionList=0D + # GenSpecialSectionList=0D #=0D # @param SpecialSectionList: a list of list, of which item's format=0D # (Comment, LineNum)=0D # @param ContainerFile: Input value for filename of Inf file=0D #=0D - def InfSpecialCommentParser (self, SpecialSectionList, InfSectionObjec= t, ContainerFile, SectionType):=0D - ReFindSpecialCommentRe =3D re.compile(r"""#(?:\s*)\[(.*?)\](?:.*)"= "", re.DOTALL)=0D + def InfSpecialCommentParser(self, SpecialSectionList, InfSectionObject= , ContainerFile, SectionType):=0D + ReFindSpecialCommentRe =3D re.compile(=0D + r"""#(?:\s*)\[(.*?)\](?:.*)""", re.DOTALL)=0D ReFindHobArchRe =3D re.compile(r"""[Hh][Oo][Bb]\.([^,]*)""", re.DO= TALL)=0D if self.FileName:=0D pass=0D @@ -450,7 +468,8 @@ class InfSectionParser(InfDefinSectionParser, ArchList.append(Arch)=0D CommentSoFar =3D ''=0D for Index in range(1, len(List)):=0D - Result =3D ParseComment(List[Index], DT.ALL_USAGE_TOKENS, = TokenDict, [], False)=0D + Result =3D ParseComment(=0D + List[Index], DT.ALL_USAGE_TOKENS, TokenDict, [], False= )=0D Usage =3D Result[0]=0D Type =3D Result[1]=0D HelpText =3D Result[3]=0D @@ -488,6 +507,7 @@ class InfSectionParser(InfDefinSectionParser, SectionType):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (Se= ctionType),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + SectionType),=0D ContainerFile=0D )=0D diff --git a/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py b= /BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py index 916df7ee1a34..6d82913b58c8 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfSourceSectionParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contained the parser for [Sources] sections in INF file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -22,21 +22,22 @@ from Library.Misc import GetSplitValueList from Object.Parser.InfCommonObject import InfLineCommentObject=0D from Parser.InfParserMisc import InfParserSectionRoot=0D =0D +=0D class InfSourceSectionParser(InfParserSectionRoot):=0D - ## InfSourceParser=0D + # InfSourceParser=0D #=0D #=0D def InfSourceParser(self, SectionString, InfSectionObject, FileName):= =0D SectionMacros =3D {}=0D - ValueList =3D []=0D - SourceList =3D []=0D - StillCommentFalg =3D False=0D - HeaderComments =3D []=0D - LineComment =3D None=0D - SectionContent =3D ''=0D + ValueList =3D []=0D + SourceList =3D []=0D + StillCommentFalg =3D False=0D + HeaderComments =3D []=0D + LineComment =3D None=0D + SectionContent =3D ''=0D for Line in SectionString:=0D SrcLineContent =3D Line[0]=0D - SrcLineNo =3D Line[1]=0D + SrcLineNo =3D Line[1]=0D =0D if SrcLineContent.strip() =3D=3D '':=0D continue=0D @@ -78,8 +79,10 @@ class InfSourceSectionParser(InfParserSectionRoot): # Find Tail comment.=0D #=0D if SrcLineContent.find(DT.TAB_COMMENT_SPLIT) > -1:=0D - TailComments =3D SrcLineContent[SrcLineContent.find(DT.TAB= _COMMENT_SPLIT):]=0D - SrcLineContent =3D SrcLineContent[:SrcLineContent.find(DT.= TAB_COMMENT_SPLIT)]=0D + TailComments =3D SrcLineContent[SrcLineContent.find(=0D + DT.TAB_COMMENT_SPLIT):]=0D + SrcLineContent =3D SrcLineContent[:SrcLineContent.find(=0D + DT.TAB_COMMENT_SPLIT)]=0D if LineComment is None:=0D LineComment =3D InfLineCommentObject()=0D LineComment.SetTailComments(TailComments)=0D @@ -101,11 +104,12 @@ class InfSourceSectionParser(InfParserSectionRoot): # Replace with Local section Macro and [Defines] section Macro= .=0D #=0D SrcLineContent =3D InfExpandMacro(SrcLineContent,=0D - (FileName, SrcLineContent, SrcLin= eNo),=0D - self.FileLocalMacros,=0D - SectionMacros)=0D + (FileName, SrcLineContent, Src= LineNo),=0D + self.FileLocalMacros,=0D + SectionMacros)=0D =0D - TokenList =3D GetSplitValueList(SrcLineContent, DT.TAB_VALUE_S= PLIT, 4)=0D + TokenList =3D GetSplitValueList(=0D + SrcLineContent, DT.TAB_VALUE_SPLIT, 4)=0D ValueList[0:len(TokenList)] =3D TokenList=0D =0D #=0D @@ -131,9 +135,10 @@ class InfSourceSectionParser(InfParserSectionRoot): InfSectionObject.SetSupArchList(Item[1])=0D =0D InfSectionObject.SetAllContent(SectionContent)=0D - if not InfSectionObject.SetSources(SourceList, Arch =3D ArchList):= =0D + if not InfSectionObject.SetSources(SourceList, Arch=3DArchList):=0D Logger.Error('InfParser',=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % ("[= Sources]"),=0D + ST.ERR_INF_PARSER_MODULE_SECTION_TYPE_ERROR % (=0D + "[Sources]"),=0D File=3DFileName,=0D Line=3DItem[3])=0D diff --git a/BaseTools/Source/Python/UPT/Parser/__init__.py b/BaseTools/Sou= rce/Python/UPT/Parser/__init__.py index 785b56df6e2a..539a99527964 100644 --- a/BaseTools/Source/Python/UPT/Parser/__init__.py +++ b/BaseTools/Source/Python/UPT/Parser/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Parser' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py b/Ba= seTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py index da92fe5d3eb2..393d2e86a833 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py @@ -1,4 +1,4 @@ -## @file DecPomAlignment.py=0D +# @file DecPomAlignment.py=0D # This file contained the adapter for convert INF parser object to POM Obj= ect=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -86,12 +86,12 @@ from Object.POM.CommonObject import MiscFileObject from Object.POM.CommonObject import FileObject=0D =0D =0D -## DecPomAlignment=0D +# DecPomAlignment=0D #=0D # Inherited from PackageObject=0D #=0D class DecPomAlignment(PackageObject):=0D - def __init__(self, Filename, WorkspaceDir =3D None, CheckMulDec =3D Fa= lse):=0D + def __init__(self, Filename, WorkspaceDir=3DNone, CheckMulDec=3DFalse)= :=0D PackageObject.__init__(self)=0D self.UserExtensions =3D ''=0D self.WorkspaceDir =3D WorkspaceDir=0D @@ -111,7 +111,7 @@ class DecPomAlignment(PackageObject): #=0D self.DecToPackage()=0D =0D - ## Load Dec file=0D + # Load Dec file=0D #=0D # Load the file if it exists=0D #=0D @@ -131,7 +131,7 @@ class DecPomAlignment(PackageObject): =0D self.DecParser =3D Dec(Filename)=0D =0D - ## Transfer to Package Object=0D + # Transfer to Package Object=0D #=0D # Transfer all contents of a Dec file to a standard Package Object=0D #=0D @@ -187,7 +187,7 @@ class DecPomAlignment(PackageObject): #=0D self.GenUserExtensions()=0D =0D - ## Generate user extension=0D + # Generate user extension=0D #=0D #=0D def GenUserExtensions(self):=0D @@ -221,12 +221,14 @@ class DecPomAlignment(PackageObject): # Add Private sections to UserExtension=0D if self.DecParser.GetPrivateSections():=0D PrivateUserExtension =3D UserExtensionObject()=0D - PrivateUserExtension.SetStatement(self.DecParser.GetPrivateSec= tions())=0D + PrivateUserExtension.SetStatement(=0D + self.DecParser.GetPrivateSections())=0D PrivateUserExtension.SetIdentifier(DT.TAB_PRIVATE)=0D PrivateUserExtension.SetUserID(DT.TAB_INTEL)=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [Priva= teUserExtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [PrivateUserExtension])=0D =0D - ## Generate miscellaneous files on DEC file=0D + # Generate miscellaneous files on DEC file=0D #=0D #=0D def GenMiscFiles(self, Content):=0D @@ -241,16 +243,18 @@ class DecPomAlignment(PackageObject): if IsValidPath(FileName, self.GetRelaPath()):=0D FileObj =3D FileObject()=0D FileObj.SetURI(FileName)=0D - MiscFileObj.SetFileList(MiscFileObj.GetFileList()+[Fil= eObj])=0D + MiscFileObj.SetFileList(=0D + MiscFileObj.GetFileList()+[FileObj])=0D else:=0D Logger.Error("InfParser",=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID%(Line),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (=0D + Line),=0D File=3Dself.GetFileName(),=0D ExtraData=3DLine)=0D self.SetMiscFileList(self.GetMiscFileList()+[MiscFileObj])=0D =0D - ## Generate Package Header=0D + # Generate Package Header=0D #=0D # Gen Package Header of Dec as =3D =0D #=0D @@ -268,9 +272,9 @@ class DecPomAlignment(PackageObject): #=0D # put items into Dict except for PackageName, Guid, Version, D= EC_SPECIFICATION=0D #=0D - SkipItemList =3D [TAB_DEC_DEFINES_PACKAGE_NAME, \=0D - TAB_DEC_DEFINES_PACKAGE_GUID, TAB_DEC_DEFINES_PACKAGE_VERS= ION, \=0D - TAB_DEC_DEFINES_DEC_SPECIFICATION, TAB_DEC_DEFINES_PKG_UNI= _FILE]=0D + SkipItemList =3D [TAB_DEC_DEFINES_PACKAGE_NAME,=0D + TAB_DEC_DEFINES_PACKAGE_GUID, TAB_DEC_DEFINES_= PACKAGE_VERSION,=0D + TAB_DEC_DEFINES_DEC_SPECIFICATION, TAB_DEC_DEF= INES_PKG_UNI_FILE]=0D if Item.Key in SkipItemList:=0D continue=0D DefinesDict['%s =3D %s' % (Item.Key, Item.Value)] =3D TAB_ARCH= _COMMON=0D @@ -284,7 +288,8 @@ class DecPomAlignment(PackageObject): if DefObj.GetPackageUniFile():=0D ValidateUNIFilePath(DefObj.GetPackageUniFile())=0D self.UniFileClassObject =3D \=0D - UniFileClassObject([PathClass(os.path.join(DefObj.GetPackagePa= th(), DefObj.GetPackageUniFile()))])=0D + UniFileClassObject(=0D + [PathClass(os.path.join(DefObj.GetPackagePath(), DefOb= j.GetPackageUniFile()))])=0D else:=0D self.UniFileClassObject =3D None=0D =0D @@ -322,9 +327,9 @@ class DecPomAlignment(PackageObject): if self.DecParser.BinaryHeadComment:=0D Abstract, Description, Copyright, License =3D \=0D ParseHeaderCommentSection(self.DecParser.BinaryHeadComment= ,=0D - ContainerFile, True)=0D + ContainerFile, True)=0D =0D - if not Abstract or not Description or not Copyright or not Li= cense:=0D + if not Abstract or not Description or not Copyright or not Lic= ense:=0D Logger.Error('MkPkg',=0D FORMAT_INVALID,=0D ST.ERR_INVALID_BINARYHEADER_FORMAT,=0D @@ -338,7 +343,7 @@ class DecPomAlignment(PackageObject): BinaryAbstractList =3D []=0D BinaryDescriptionList =3D []=0D =0D - #Get Binary header from UNI file=0D + # Get Binary header from UNI file=0D # Initialize the UniStrDict dictionary, top keys are language code= s=0D UniStrDict =3D {}=0D if self.UniFileClassObject:=0D @@ -348,19 +353,20 @@ class DecPomAlignment(PackageObject): Lang =3D GetLanguageCode1766(Lang)=0D if StringDefClassObject.StringName =3D=3D TAB_DEC_BINA= RY_ABSTRACT:=0D if (Lang, ConvertSpecialUnicodes(StringDefClassObj= ect.StringValue)) \=0D - not in self.GetBinaryHeaderAbstract():=0D - BinaryAbstractList.append((Lang, ConvertSpecia= lUnicodes(StringDefClassObject.StringValue)))=0D + not in self.GetBinaryHeaderAbstract():=0D + BinaryAbstractList.append(=0D + (Lang, ConvertSpecialUnicodes(StringDefCla= ssObject.StringValue)))=0D if StringDefClassObject.StringName =3D=3D TAB_DEC_BINA= RY_DESCRIPTION:=0D if (Lang, ConvertSpecialUnicodes(StringDefClassObj= ect.StringValue)) \=0D - not in self.GetBinaryHeaderDescription():=0D + not in self.GetBinaryHeaderDescription():= =0D BinaryDescriptionList.append((Lang,=0D ConvertSpecialUn= icodes(StringDefClassObject.StringValue)))=0D - #Combine Binary header from DEC file and UNI file=0D + # Combine Binary header from DEC file and UNI file=0D BinaryAbstractList =3D self.GetBinaryHeaderAbstract() + BinaryAbst= ractList=0D BinaryDescriptionList =3D self.GetBinaryHeaderDescription() + Bina= ryDescriptionList=0D BinaryCopyrightList =3D self.GetBinaryHeaderCopyright()=0D BinaryLicenseList =3D self.GetBinaryHeaderLicense()=0D - #Generate the UserExtensionObject for TianoCore."BinaryHeader"=0D + # Generate the UserExtensionObject for TianoCore."BinaryHeader"=0D if BinaryAbstractList or BinaryDescriptionList or BinaryCopyrightL= ist or BinaryLicenseList:=0D BinaryUserExtension =3D UserExtensionObject()=0D BinaryUserExtension.SetBinaryAbstract(BinaryAbstractList)=0D @@ -369,15 +375,16 @@ class DecPomAlignment(PackageObject): BinaryUserExtension.SetBinaryLicense(BinaryLicenseList)=0D BinaryUserExtension.SetIdentifier(TAB_BINARY_HEADER_IDENTIFIER= )=0D BinaryUserExtension.SetUserID(TAB_BINARY_HEADER_USERID)=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [Binar= yUserExtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [BinaryUserExtension])=0D =0D -=0D - ## GenIncludes=0D + # GenIncludes=0D #=0D # Gen Includes of Dec=0D #=0D # @param ContainerFile: The Dec file full path=0D #=0D +=0D def GenIncludes(self, ContainerFile):=0D if ContainerFile:=0D pass=0D @@ -393,7 +400,8 @@ class DecPomAlignment(PackageObject): if Item.GetArchList() =3D=3D [TAB_ARCH_COMMON] or Includes= Dict[IncludePath] =3D=3D [TAB_ARCH_COMMON]:=0D IncludesDict[IncludePath] =3D [TAB_ARCH_COMMON]=0D else:=0D - IncludesDict[IncludePath] =3D IncludesDict[IncludePath= ] + Item.GetArchList()=0D + IncludesDict[IncludePath] =3D IncludesDict[IncludePath= ] + \=0D + Item.GetArchList()=0D else:=0D IncludesDict[IncludePath] =3D Item.GetArchList()=0D =0D @@ -421,7 +429,7 @@ class DecPomAlignment(PackageObject): # to remove the extra path separator '\'=0D # as this list is used to search the supported Arch info=0D #=0D - for IndexN in range (0, len(IncludePathList)):=0D + for IndexN in range(0, len(IncludePathList)):=0D IncludePathList[IndexN] =3D os.path.normpath(IncludePathList[I= ndexN])=0D IncludePathList.sort()=0D IncludePathList.reverse()=0D @@ -434,16 +442,19 @@ class DecPomAlignment(PackageObject): =0D IncludeFileList =3D []=0D for Path in NonOverLapList:=0D - FileList =3D GetFiles(os.path.join(PackagePath, Path), ['CVS',= '.svn'], False)=0D - IncludeFileList +=3D [os.path.normpath(os.path.join(Path, File= )) for File in FileList]=0D + FileList =3D GetFiles(os.path.join(PackagePath, Path), [=0D + 'CVS', '.svn'], False)=0D + IncludeFileList +=3D [os.path.normpath(os.path.join(Path, File= ))=0D + for File in FileList]=0D for Includefile in IncludeFileList:=0D ExtName =3D os.path.splitext(Includefile)[1]=0D if ExtName.upper() =3D=3D '.DEC' and self.CheckMulDec:=0D Logger.Error('MkPkg',=0D UPT_MUL_DEC_ERROR,=0D - ST.ERR_MUL_DEC_ERROR%(os.path.dirname(Contain= erFile),=0D - os.path.basename(Contai= nerFile),=0D - Includefile))=0D + ST.ERR_MUL_DEC_ERROR % (os.path.dirname(Conta= inerFile),=0D + os.path.basename(=0D + ContainerFile),=0D + Includefile))=0D =0D FileCombinePath =3D os.path.dirname(Includefile)=0D Include =3D IncludeObject()=0D @@ -471,9 +482,10 @@ class DecPomAlignment(PackageObject): Include.SetFilePath(IncludePath)=0D Include.SetSupArchList(Item.GetArchList())=0D PackagePathList.append(Include)=0D - self.SetPackageIncludeFileList(PackagePathList + PackageIncludeFil= eList)=0D + self.SetPackageIncludeFileList(=0D + PackagePathList + PackageIncludeFileList)=0D =0D - ## GenPpis=0D + # GenPpis=0D #=0D # Gen Ppis of Dec=0D # =3D=0D @@ -489,6 +501,7 @@ class DecPomAlignment(PackageObject): Factory =3D None=0D if Type =3D=3D TAB_GUIDS:=0D Obj =3D self.DecParser.GetGuidSectionObject()=0D +=0D def CreateGuidObject():=0D Object =3D GuidObject()=0D Object.SetGuidTypeList([])=0D @@ -522,7 +535,7 @@ class DecPomAlignment(PackageObject): for Item in Obj.GetGuidStyleAllItems():=0D Name =3D Item.GuidCName=0D Value =3D Item.GuidString=0D - HelpTxt =3D ParseGenericComment(Item.GetHeadComment() + \=0D + HelpTxt =3D ParseGenericComment(Item.GetHeadComment() +=0D Item.GetTailComment())=0D =0D ListObject =3D Factory()=0D @@ -537,7 +550,7 @@ class DecPomAlignment(PackageObject): DeclarationsList.append(ListObject)=0D =0D #=0D - #GuidTypeList is abstracted from help=0D + # GuidTypeList is abstracted from help=0D #=0D if Type =3D=3D TAB_GUIDS:=0D self.SetGuidList(self.GetGuidList() + DeclarationsList)=0D @@ -546,7 +559,7 @@ class DecPomAlignment(PackageObject): elif Type =3D=3D TAB_PPIS:=0D self.SetPpiList(self.GetPpiList() + DeclarationsList)=0D =0D - ## GenLibraryClasses=0D + # GenLibraryClasses=0D #=0D # Gen LibraryClasses of Dec=0D # =3D=0D @@ -565,7 +578,7 @@ class DecPomAlignment(PackageObject): LibraryClass.SetLibraryClass(Item.Libraryclass)=0D LibraryClass.SetSupArchList(Item.GetArchList())=0D LibraryClass.SetIncludeHeader(Item.File)=0D - HelpTxt =3D ParseGenericComment(Item.GetHeadComment() + \=0D + HelpTxt =3D ParseGenericComment(Item.GetHeadComment() +=0D Item.GetTailComment(), None, '@l= ibraryclass')=0D if HelpTxt:=0D if self.UniFileClassObject:=0D @@ -573,10 +586,10 @@ class DecPomAlignment(PackageObject): LibraryClass.SetHelpTextList([HelpTxt])=0D LibraryClassDeclarations.append(LibraryClass)=0D =0D - self.SetLibraryClassList(self.GetLibraryClassList() + \=0D + self.SetLibraryClassList(self.GetLibraryClassList() +=0D LibraryClassDeclarations)=0D =0D - ## GenPcds=0D + # GenPcds=0D #=0D # Gen Pcds of Dec=0D # .|||=0D @@ -617,15 +630,15 @@ class DecPomAlignment(PackageObject): StrList =3D StringDefClassObject.StringName.split('_')= =0D # StringName format is STR___PROMPT=0D if len(StrList) =3D=3D 4 and StrList[0] =3D=3D TAB_STR= _TOKENCNAME and StrList[3] =3D=3D TAB_STR_TOKENPROMPT:=0D - PromptStrList.append((GetLanguageCode1766(Lang), S= tringDefClassObject.StringName, \=0D + PromptStrList.append((GetLanguageCode1766(Lang), S= tringDefClassObject.StringName,=0D StringDefClassObject.StringV= alue))=0D # StringName format is STR___HELP=0D if len(StrList) =3D=3D 4 and StrList[0] =3D=3D TAB_STR= _TOKENCNAME and StrList[3] =3D=3D TAB_STR_TOKENHELP:=0D - HelpStrList.append((GetLanguageCode1766(Lang), Str= ingDefClassObject.StringName, \=0D + HelpStrList.append((GetLanguageCode1766(Lang), Str= ingDefClassObject.StringName,=0D StringDefClassObject.StringVal= ue))=0D # StringName format is STR__ERR_##=0D if len(StrList) =3D=3D 4 and StrList[0] =3D=3D TAB_STR= _TOKENCNAME and StrList[2] =3D=3D TAB_STR_TOKENERR:=0D - PcdErrStrList.append((GetLanguageCode1766(Lang), S= tringDefClassObject.StringName, \=0D + PcdErrStrList.append((GetLanguageCode1766(Lang), S= tringDefClassObject.StringName,=0D StringDefClassObject.StringV= alue))=0D #=0D # For each PCD type=0D @@ -638,13 +651,13 @@ class DecPomAlignment(PackageObject): #=0D for Item in PcdObj.GetPcdsByType(PcdType.upper()):=0D PcdDeclaration =3D GenPcdDeclaration(=0D - ContainerFile,=0D - (Item.TokenSpaceGuidCName, Item.TokenCName,=0D - Item.DefaultValue, Item.DatumType, Item.TokenValue= ,=0D - Type, Item.GetHeadComment(), Item.GetTailComment()= , ''),=0D - Language,=0D - self.DecParser.GetDefineSectionMacro()=0D - )=0D + ContainerFile,=0D + (Item.TokenSpaceGuidCName, Item.TokenCName,=0D + Item.DefaultValue, Item.DatumType, Item.TokenValue,=0D + Type, Item.GetHeadComment(), Item.GetTailComment(), '= '),=0D + Language,=0D + self.DecParser.GetDefineSectionMacro()=0D + )=0D PcdDeclaration.SetSupArchList(Item.GetArchListOfType(PcdTy= pe))=0D =0D #=0D @@ -652,38 +665,41 @@ class DecPomAlignment(PackageObject): #=0D for PcdErr in PcdDeclaration.GetPcdErrorsList():=0D if (PcdDeclaration.GetTokenSpaceGuidCName(), PcdErr.Ge= tErrorNumber()) \=0D - in self.DecParser.PcdErrorCommentDict:=0D - Key =3D (PcdDeclaration.GetTokenSpaceGuidCName(), = PcdErr.GetErrorNumber())=0D - PcdErr.SetErrorMessageList(PcdErr.GetErrorMessageL= ist() + \=0D - [(Language, self.Dec= Parser.PcdErrorCommentDict[Key])])=0D + in self.DecParser.PcdErrorCommentDict:=0D + Key =3D (PcdDeclaration.GetTokenSpaceGuidCName(),= =0D + PcdErr.GetErrorNumber())=0D + PcdErr.SetErrorMessageList(PcdErr.GetErrorMessageL= ist() +=0D + [(Language, self.DecPar= ser.PcdErrorCommentDict[Key])])=0D =0D for Index in range(0, len(PromptStrList)):=0D StrNameList =3D PromptStrList[Index][1].split('_')=0D if StrNameList[1].lower() =3D=3D Item.TokenSpaceGuidCN= ame.lower() and \=0D - StrNameList[2].lower() =3D=3D Item.TokenCName.lower():= =0D + StrNameList[2].lower() =3D=3D Item.TokenCName.= lower():=0D TxtObj =3D TextObject()=0D TxtObj.SetLang(PromptStrList[Index][0])=0D TxtObj.SetString(PromptStrList[Index][2])=0D for Prompt in PcdDeclaration.GetPromptList():=0D if Prompt.GetLang() =3D=3D TxtObj.GetLang() an= d \=0D - Prompt.GetString() =3D=3D TxtObj.GetString= ():=0D + Prompt.GetString() =3D=3D TxtObj.GetSt= ring():=0D break=0D else:=0D - PcdDeclaration.SetPromptList(PcdDeclaration.Ge= tPromptList() + [TxtObj])=0D + PcdDeclaration.SetPromptList(=0D + PcdDeclaration.GetPromptList() + [TxtObj])= =0D =0D for Index in range(0, len(HelpStrList)):=0D StrNameList =3D HelpStrList[Index][1].split('_')=0D if StrNameList[1].lower() =3D=3D Item.TokenSpaceGuidCN= ame.lower() and \=0D - StrNameList[2].lower() =3D=3D Item.TokenCName.lower():= =0D + StrNameList[2].lower() =3D=3D Item.TokenCName.= lower():=0D TxtObj =3D TextObject()=0D TxtObj.SetLang(HelpStrList[Index][0])=0D TxtObj.SetString(HelpStrList[Index][2])=0D for HelpStrObj in PcdDeclaration.GetHelpTextList()= :=0D if HelpStrObj.GetLang() =3D=3D TxtObj.GetLang(= ) and \=0D - HelpStrObj.GetString() =3D=3D TxtObj.GetSt= ring():=0D + HelpStrObj.GetString() =3D=3D TxtObj.G= etString():=0D break=0D else:=0D - PcdDeclaration.SetHelpTextList(PcdDeclaration.= GetHelpTextList() + [TxtObj])=0D + PcdDeclaration.SetHelpTextList(=0D + PcdDeclaration.GetHelpTextList() + [TxtObj= ])=0D =0D #=0D # Get PCD error message from UNI file=0D @@ -691,12 +707,12 @@ class DecPomAlignment(PackageObject): for Index in range(0, len(PcdErrStrList)):=0D StrNameList =3D PcdErrStrList[Index][1].split('_')=0D if StrNameList[1].lower() =3D=3D Item.TokenSpaceGuidCN= ame.lower() and \=0D - StrNameList[2].lower() =3D=3D TAB_STR_TOKENERR.low= er():=0D + StrNameList[2].lower() =3D=3D TAB_STR_TOKENERR= .lower():=0D for PcdErr in PcdDeclaration.GetPcdErrorsList():=0D if PcdErr.GetErrorNumber().lower() =3D=3D (TAB= _HEX_START + StrNameList[3]).lower() and \=0D - (PcdErrStrList[Index][0], PcdErrStrList[In= dex][2]) not in PcdErr.GetErrorMessageList():=0D - PcdErr.SetErrorMessageList(PcdErr.GetError= MessageList() + \=0D - [(PcdErrStrLis= t[Index][0], PcdErrStrList[Index][2])])=0D + (PcdErrStrList[Index][0], PcdErrStrLis= t[Index][2]) not in PcdErr.GetErrorMessageList():=0D + PcdErr.SetErrorMessageList(PcdErr.GetError= MessageList() +=0D + [(PcdErrStrList= [Index][0], PcdErrStrList[Index][2])])=0D =0D #=0D # Check to prevent missing error message if a Pcd has the = error code.=0D @@ -790,9 +806,10 @@ class DecPomAlignment(PackageObject): for MatchedItem in MatchedList:=0D if MatchedItem not in self.PcdDefaultValueDict:=0D Logger.Error("Dec File Parser", FORMAT_INVALID, Messag= e=3DST.ERR_DECPARSE_PCD_NODEFINED % MatchedItem,=0D - File=3Dself.FullPath)=0D + File=3Dself.FullPath)=0D =0D - ReplaceValue =3D ReplaceValue.replace(MatchedItem, self.Pc= dDefaultValueDict[MatchedItem])=0D + ReplaceValue =3D ReplaceValue.replace(=0D + MatchedItem, self.PcdDefaultValueDict[MatchedItem])=0D =0D return ReplaceValue=0D =0D @@ -802,11 +819,12 @@ class DecPomAlignment(PackageObject): def CheckPcdValue(self):=0D for Pcd in self.GetPcdList():=0D self.PcdDefaultValueDict[TAB_SPLIT.join((Pcd.GetTokenSpaceGuid= CName(), Pcd.GetCName())).strip()] =3D \=0D - Pcd.GetDefaultValue()=0D + Pcd.GetDefaultValue()=0D =0D for Pcd in self.GetPcdList():=0D ValidationExpressions =3D []=0D - PcdGuidName =3D TAB_SPLIT.join((Pcd.GetTokenSpaceGuidCName(), = Pcd.GetCName()))=0D + PcdGuidName =3D TAB_SPLIT.join(=0D + (Pcd.GetTokenSpaceGuidCName(), Pcd.GetCName()))=0D Valids =3D Pcd.GetPcdErrorsList()=0D for Valid in Valids:=0D Expression =3D Valid.GetExpression()=0D @@ -819,28 +837,35 @@ class DecPomAlignment(PackageObject): if QuotedMatchedObj:=0D MatchedStr =3D QuotedMatchedObj.group().strip()=0D if MatchedStr.startswith('L'):=0D - Expression =3D Expression.replace(MatchedStr, = MatchedStr[1:].strip())=0D + Expression =3D Expression.replace(=0D + MatchedStr, MatchedStr[1:].strip())=0D =0D Expression =3D self.ReplaceForEval(Expression, IsExpr= =3DTrue)=0D Expression =3D Expression.replace(PcdGuidName, 'x')=0D - Message =3D self.GetEnErrorMessage(Valid.GetErrorMessa= geList())=0D + Message =3D self.GetEnErrorMessage(=0D + Valid.GetErrorMessageList())=0D ValidationExpressions.append((Expression, Message))=0D =0D ValidList =3D Valid.GetValidValue()=0D if ValidList:=0D - ValidValue =3D 'x in %s' % [eval(v) for v in ValidList= .split(' ') if v]=0D - Message =3D self.GetEnErrorMessage(Valid.GetErrorMessa= geList())=0D + ValidValue =3D 'x in %s' % [=0D + eval(v) for v in ValidList.split(' ') if v]=0D + Message =3D self.GetEnErrorMessage(=0D + Valid.GetErrorMessageList())=0D ValidationExpressions.append((ValidValue, Message))=0D =0D ValidValueRange =3D Valid.GetValidValueRange()=0D if ValidValueRange:=0D - ValidValueRange =3D self.ReplaceForEval(ValidValueRang= e, IsRange=3DTrue)=0D + ValidValueRange =3D self.ReplaceForEval(=0D + ValidValueRange, IsRange=3DTrue)=0D if ValidValueRange.find('-') >=3D 0:=0D - ValidValueRange =3D ValidValueRange.replace('-', '= <=3D x <=3D')=0D + ValidValueRange =3D ValidValueRange.replace(=0D + '-', '<=3D x <=3D')=0D elif not ValidValueRange.startswith('x ') and not Vali= dValueRange.startswith('not ') \=0D - and not ValidValueRange.startswith('not(') and not= ValidValueRange.startswith('('):=0D + and not ValidValueRange.startswith('not(') and= not ValidValueRange.startswith('('):=0D ValidValueRange =3D 'x %s' % ValidValueRange=0D - Message =3D self.GetEnErrorMessage(Valid.GetErrorMessa= geList())=0D + Message =3D self.GetEnErrorMessage(=0D + Valid.GetErrorMessageList())=0D ValidationExpressions.append((ValidValueRange, Message= ))=0D =0D DefaultValue =3D self.PcdDefaultValueDict[PcdGuidName.strip()]= =0D @@ -852,31 +877,32 @@ class DecPomAlignment(PackageObject): if QuotedMatchedObj:=0D MatchedStr =3D QuotedMatchedObj.group().strip()=0D if MatchedStr.startswith('L'):=0D - DefaultValue =3D DefaultValue.replace(MatchedStr, Matc= hedStr[1:].strip())=0D + DefaultValue =3D DefaultValue.replace(=0D + MatchedStr, MatchedStr[1:].strip())=0D =0D try:=0D DefaultValue =3D eval(DefaultValue.replace('TRUE', 'True')= .replace('true', 'True')=0D - .replace('FALSE', 'False').replace= ('false', 'False'))=0D + .replace('FALSE', 'False').replace('fa= lse', 'False'))=0D except BaseException:=0D pass=0D =0D for (Expression, Msg) in ValidationExpressions:=0D try:=0D - if not eval(Expression, {'x':DefaultValue}):=0D - Logger.Error("Dec File Parser", FORMAT_INVALID, Ex= traData=3D'%s, value =3D %s' %\=0D + if not eval(Expression, {'x': DefaultValue}):=0D + Logger.Error("Dec File Parser", FORMAT_INVALID, Ex= traData=3D'%s, value =3D %s' %=0D (PcdGuidName, DefaultValue), Message= =3DMsg, File=3Dself.FullPath)=0D except TypeError:=0D - Logger.Error("Dec File Parser", FORMAT_INVALID, ExtraD= ata=3DPcdGuidName, \=0D - Message=3DMsg, File=3Dself.FullPath)=0D + Logger.Error("Dec File Parser", FORMAT_INVALID, ExtraD= ata=3DPcdGuidName,=0D + Message=3DMsg, File=3Dself.FullPath)=0D =0D - ## GenModuleFileList=0D + # GenModuleFileList=0D #=0D def GenModuleFileList(self, ContainerFile):=0D ModuleFileList =3D []=0D ContainerFileName =3D os.path.basename(ContainerFile)=0D ContainerFilePath =3D os.path.dirname(ContainerFile)=0D for Item in GetFiles(ContainerFilePath,=0D - ['CVS', '.svn'] + self.GetIncludePathList(), False= ):=0D + ['CVS', '.svn'] + self.GetIncludePathList(), = False):=0D ExtName =3D os.path.splitext(Item)[1]=0D if ExtName.lower() =3D=3D '.inf':=0D ModuleFileList.append(Item)=0D @@ -885,13 +911,13 @@ class DecPomAlignment(PackageObject): continue=0D Logger.Error('MkPkg',=0D UPT_MUL_DEC_ERROR,=0D - ST.ERR_MUL_DEC_ERROR%(ContainerFilePath,=0D - ContainerFileName,=0D - Item))=0D + ST.ERR_MUL_DEC_ERROR % (ContainerFilePath,=0D + ContainerFileName,=0D + Item))=0D =0D self.SetModuleFileList(ModuleFileList)=0D =0D - ## Show detailed information of Package=0D + # Show detailed information of Package=0D #=0D # Print all members and their values of Package class=0D #=0D @@ -901,12 +927,12 @@ class DecPomAlignment(PackageObject): print('\nVersion =3D', self.GetVersion())=0D print('\nGuid =3D', self.GetGuid())=0D =0D - print('\nStandardIncludes =3D %d ' \=0D - % len(self.GetStandardIncludeFileList()), end=3D' ')=0D + print('\nStandardIncludes =3D %d '=0D + % len(self.GetStandardIncludeFileList()), end=3D' ')=0D for Item in self.GetStandardIncludeFileList():=0D print(Item.GetFilePath(), ' ', Item.GetSupArchList())=0D - print('\nPackageIncludes =3D %d \n' \=0D - % len(self.GetPackageIncludeFileList()), end=3D' ')=0D + print('\nPackageIncludes =3D %d \n'=0D + % len(self.GetPackageIncludeFileList()), end=3D' ')=0D for Item in self.GetPackageIncludeFileList():=0D print(Item.GetFilePath(), ' ', Item.GetSupArchList())=0D =0D @@ -921,16 +947,16 @@ class DecPomAlignment(PackageObject): print(Item.GetCName(), Item.GetGuid(), Item.GetSupArchList())= =0D print('\nLibraryClasses =3D', self.GetLibraryClassList())=0D for Item in self.GetLibraryClassList():=0D - print(Item.GetLibraryClass(), Item.GetRecommendedInstance(), \= =0D - Item.GetSupArchList())=0D + print(Item.GetLibraryClass(), Item.GetRecommendedInstance(),=0D + Item.GetSupArchList())=0D print('\nPcds =3D', self.GetPcdList())=0D for Item in self.GetPcdList():=0D - print('CName=3D', Item.GetCName(), 'TokenSpaceGuidCName=3D', \= =0D - Item.GetTokenSpaceGuidCName(), \=0D - 'DefaultValue=3D', Item.GetDefaultValue(), \=0D - 'ValidUsage=3D', Item.GetValidUsage(), \=0D - 'SupArchList', Item.GetSupArchList(), \=0D - 'Token=3D', Item.GetToken(), 'DatumType=3D', Item.GetDatum= Type())=0D + print('CName=3D', Item.GetCName(), 'TokenSpaceGuidCName=3D',=0D + Item.GetTokenSpaceGuidCName(),=0D + 'DefaultValue=3D', Item.GetDefaultValue(),=0D + 'ValidUsage=3D', Item.GetValidUsage(),=0D + 'SupArchList', Item.GetSupArchList(),=0D + 'Token=3D', Item.GetToken(), 'DatumType=3D', Item.GetDat= umType())=0D =0D for Item in self.GetMiscFileList():=0D print(Item.GetName())=0D @@ -938,7 +964,7 @@ class DecPomAlignment(PackageObject): print(FileObjectItem.GetURI())=0D print('****************\n')=0D =0D -## GenPcdDeclaration=0D +# GenPcdDeclaration=0D #=0D # @param ContainerFile: File name of the DEC file=0D # @param PcdInfo: Pcd information, of format (TokenGuidCName,=0D @@ -946,6 +972,8 @@ class DecPomAlignment(PackageObject): # GenericComment, TailComment, Arch)=0D # @param Language: The language of HelpText, Prompt=0D #=0D +=0D +=0D def GenPcdDeclaration(ContainerFile, PcdInfo, Language, MacroReplaceDict):= =0D HelpStr =3D ''=0D PromptStr =3D ''=0D @@ -979,7 +1007,7 @@ def GenPcdDeclaration(ContainerFile, PcdInfo, Language= , MacroReplaceDict): =0D if TailComment:=0D SupModuleList, TailHelpStr =3D ParseDecPcdTailComment(TailComment,= =0D - ContainerFile)=0D + ContainerFile)= =0D if SupModuleList:=0D Pcd.SetSupModuleList(SupModuleList)=0D =0D diff --git a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py b/Ba= seTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py index 9c406e5f49e3..e57c1749f2a1 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignment.py @@ -1,4 +1,4 @@ -## @file InfPomAlignment.py=0D +# @file InfPomAlignment.py=0D # This file contained the adapter for convert INF parser object to POM Obj= ect=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -47,12 +47,14 @@ from Parser import InfParser from PomAdapter.DecPomAlignment import DecPomAlignment=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -## InfPomAlignment=0D +# InfPomAlignment=0D #=0D # Inherit from ModuleObject=0D #=0D +=0D +=0D class InfPomAlignment(ModuleObject):=0D - ## Construct of InfPomAlignment=0D + # Construct of InfPomAlignment=0D # Skip means that UPT don't care the syntax of INF, this may be the no= t=0D # distributed INF files during creation or the INF files checked for=0D # dependency rule during remove.=0D @@ -110,7 +112,7 @@ class InfPomAlignment(ModuleObject): self._GenGuidProtocolPpis(DT.TAB_PPIS)=0D self._GenDepexes()=0D =0D - ## Convert [Defines] section content to InfDefObject=0D + # Convert [Defines] section content to InfDefObject=0D #=0D # Convert [Defines] section content to InfDefObject=0D #=0D @@ -152,7 +154,8 @@ class InfPomAlignment(ModuleObject): ModulePath =3D os.path.split(CombinePath)[0]=0D ModuleRelativePath =3D ModulePath=0D if self.GetPackagePath() !=3D '':=0D - ModuleRelativePath =3D GetRelativePath(ModulePath, self.GetPac= kagePath())=0D + ModuleRelativePath =3D GetRelativePath(=0D + ModulePath, self.GetPackagePath())=0D self.SetModulePath(ModuleRelativePath)=0D #=0D # For Define Seciton Items.=0D @@ -173,7 +176,8 @@ class InfPomAlignment(ModuleObject): SpecList =3D DefineObj.GetSpecification()=0D NewSpecList =3D []=0D for SpecItem in SpecList:=0D - NewSpecList.append((SpecItem[0], ConvertVersionToDecimal(SpecI= tem[1])))=0D + NewSpecList.append(=0D + (SpecItem[0], ConvertVersionToDecimal(SpecItem[1])))=0D self.SetSpecList(NewSpecList)=0D =0D #=0D @@ -205,7 +209,8 @@ class InfPomAlignment(ModuleObject): else:=0D self.SetBaseName(DefineObj.GetBaseName().GetValue())=0D if DefineObj.GetModuleUniFileName():=0D - self.UniFileClassObject =3D UniFileClassObject([PathClass(Defi= neObj.GetModuleUniFileName())])=0D + self.UniFileClassObject =3D UniFileClassObject(=0D + [PathClass(DefineObj.GetModuleUniFileName())])=0D else:=0D self.UniFileClassObject =3D None=0D if DefineObj.GetInfVersion() is None:=0D @@ -248,7 +253,8 @@ class InfPomAlignment(ModuleObject): if DefineObj.GetShadow():=0D ModuleTypeValue =3D DefineObj.GetModuleType().GetValue()=0D if not (ModuleTypeValue =3D=3D 'SEC' or ModuleTypeValue =3D=3D= 'PEI_CORE' or ModuleTypeValue =3D=3D 'PEIM'):=0D - Logger.Error("InfParser", FORMAT_INVALID, ST.ERR_INF_PARSE= R_DEFINE_SHADOW_INVALID, File=3Dself.FullPath)=0D + Logger.Error("InfParser", FORMAT_INVALID,=0D + ST.ERR_INF_PARSER_DEFINE_SHADOW_INVALID, File= =3Dself.FullPath)=0D =0D if DefineObj.GetPcdIsDriver() is not None:=0D self.SetPcdIsDriver(DefineObj.GetPcdIsDriver().GetValue())=0D @@ -284,7 +290,8 @@ class InfPomAlignment(ModuleObject): UserExtension.SetDefinesDict(DefinesDictNew)=0D UserExtension.SetIdentifier('DefineModifiers')=0D UserExtension.SetUserID('EDK2')=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [UserE= xtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [UserExtension])=0D #=0D # Get all meta-file header information=0D # the record is list of items formatted:=0D @@ -311,15 +318,18 @@ class InfPomAlignment(ModuleObject): #=0D InfBinaryHeaderObj =3D self.Parser.InfBinaryHeader=0D if InfBinaryHeaderObj.GetAbstract():=0D - self.SetBinaryHeaderAbstract((Lang, InfBinaryHeaderObj.GetAbst= ract()))=0D + self.SetBinaryHeaderAbstract(=0D + (Lang, InfBinaryHeaderObj.GetAbstract()))=0D if InfBinaryHeaderObj.GetDescription():=0D - self.SetBinaryHeaderDescription((Lang, InfBinaryHeaderObj.GetD= escription()))=0D + self.SetBinaryHeaderDescription(=0D + (Lang, InfBinaryHeaderObj.GetDescription()))=0D if InfBinaryHeaderObj.GetCopyright():=0D - self.SetBinaryHeaderCopyright(('', InfBinaryHeaderObj.GetCopyr= ight()))=0D + self.SetBinaryHeaderCopyright(=0D + ('', InfBinaryHeaderObj.GetCopyright()))=0D if InfBinaryHeaderObj.GetLicense():=0D self.SetBinaryHeaderLicense(('', InfBinaryHeaderObj.GetLicense= ()))=0D =0D - ## GenModuleHeaderLibClass=0D + # GenModuleHeaderLibClass=0D #=0D #=0D def _GenModuleHeaderLibClass(self, DefineObj, ArchList):=0D @@ -334,9 +344,10 @@ class InfPomAlignment(ModuleObject): Lib.SetSupArchList(ArchList)=0D self.SetLibraryClassList(self.GetLibraryClassList() + [Lib])=0D self.SetIsLibrary(True)=0D - self.SetIsLibraryModList(self.GetIsLibraryModList() + SupModul= eList)=0D + self.SetIsLibraryModList(=0D + self.GetIsLibraryModList() + SupModuleList)=0D =0D - ## GenModuleHeaderExterns=0D + # GenModuleHeaderExterns=0D #=0D #=0D def _GenModuleHeaderExterns(self, DefineObj):=0D @@ -382,7 +393,7 @@ class InfPomAlignment(ModuleObject): Image.SetDestructor(DestructorItem.GetCName())=0D self.SetExternList(self.GetExternList() + [Image])=0D =0D - ## GenModuleHeaderExterns=0D + # GenModuleHeaderExterns=0D # BootMode/HOB/Event=0D #=0D def _GenSpecialComments(self):=0D @@ -421,7 +432,8 @@ class InfPomAlignment(ModuleObject): BootModeList =3D []=0D for Item in SpecialCommentsList[Key]:=0D BootMode =3D BootModeObject()=0D - BootMode.SetSupportedBootModes(Item.GetSupportedBootMo= des())=0D + BootMode.SetSupportedBootModes(=0D + Item.GetSupportedBootModes())=0D BootMode.SetUsage(Item.GetUsage())=0D if Item.GetHelpString():=0D HelpTextObj =3D CommonObject.TextObject()=0D @@ -432,7 +444,7 @@ class InfPomAlignment(ModuleObject): BootModeList.append(BootMode)=0D self.SetBootModeList(BootModeList)=0D =0D - ## GenBuildOptions=0D + # GenBuildOptions=0D #=0D # Gen BuildOptions of Inf=0D # [:]=3DFlag=0D @@ -460,14 +472,15 @@ class InfPomAlignment(ModuleObject): UserExtension.SetBuildOptionDict(BuildOptionDict)=0D UserExtension.SetIdentifier('BuildOptionModifiers')=0D UserExtension.SetUserID('EDK2')=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [UserE= xtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [UserExtension])=0D else:=0D #=0D # Not process this information, will be processed in GenBinari= es()=0D #=0D pass=0D =0D - ## GenLibraryClasses=0D + # GenLibraryClasses=0D #=0D # Get LibraryClass of Inf=0D # |=0D @@ -487,7 +500,8 @@ class InfPomAlignment(ModuleObject): LibraryClass.SetLibraryClass(Item.GetLibName())=0D LibraryClass.SetRecommendedInstance(None)=0D LibraryClass.SetFeatureFlag(Item.GetFeatureFlagExp())= =0D - LibraryClass.SetSupArchList(ConvertArchList(Item.GetSu= pArchList()))=0D + LibraryClass.SetSupArchList(=0D + ConvertArchList(Item.GetSupArchList()))=0D LibraryClass.SetSupModuleList(Item.GetSupModuleList())= =0D HelpStringObj =3D Item.GetHelpString()=0D if HelpStringObj is not None:=0D @@ -498,9 +512,10 @@ class InfPomAlignment(ModuleObject): HelpTextHeaderObj.SetLang(DT.TAB_LANGUAGE_EN_X= )=0D HelpTextHeaderObj.SetString(CommentString)=0D LibraryClass.SetHelpTextList([HelpTextHeaderObj])= =0D - self.SetLibraryClassList(self.GetLibraryClassList() + = [LibraryClass])=0D + self.SetLibraryClassList(=0D + self.GetLibraryClassList() + [LibraryClass])=0D =0D - ## GenPackages=0D + # GenPackages=0D #=0D # Gen Packages of Inf=0D #=0D @@ -521,11 +536,15 @@ class InfPomAlignment(ModuleObject): # Need package information for dependency check usage=0D #=0D PackageDependency =3D PackageDependencyObject()=0D - PackageDependency.SetPackageFilePath(NormPath(PackageItemObj.G= etPackageName()))=0D - PackageDependency.SetSupArchList(ConvertArchList(PackageItemOb= j.GetSupArchList()))=0D - PackageDependency.SetFeatureFlag(PackageItemObj.GetFeatureFlag= Exp())=0D + PackageDependency.SetPackageFilePath(=0D + NormPath(PackageItemObj.GetPackageName()))=0D + PackageDependency.SetSupArchList(=0D + ConvertArchList(PackageItemObj.GetSupArchList()))=0D + PackageDependency.SetFeatureFlag(=0D + PackageItemObj.GetFeatureFlagExp())=0D =0D - PkgInfo =3D GetPkgInfoFromDec(mws.join(self.WorkSpace, NormPat= h(PackageItemObj.GetPackageName())))=0D + PkgInfo =3D GetPkgInfoFromDec(=0D + mws.join(self.WorkSpace, NormPath(PackageItemObj.GetPackag= eName())))=0D if PkgInfo[1] and PkgInfo[2]:=0D PackageDependency.SetGuid(PkgInfo[1])=0D PackageDependency.SetVersion(PkgInfo[2])=0D @@ -539,7 +558,7 @@ class InfPomAlignment(ModuleObject): PackageDependencyList.append(PackageDependency)=0D self.SetPackageDependencyList(PackageDependencyList)=0D =0D - ## GenPcds=0D + # GenPcds=0D #=0D # Gen Pcds of Inf=0D # .[| [|]]=0D @@ -565,22 +584,25 @@ class InfPomAlignment(ModuleObject): for CommentItem in CommentList:=0D Pcd =3D CommonObject.PcdObject()=0D Pcd.SetCName(PcdItemObj.GetCName())=0D - Pcd.SetTokenSpaceGuidCName(PcdItemObj.GetToken= SpaceGuidCName())=0D + Pcd.SetTokenSpaceGuidCName(=0D + PcdItemObj.GetTokenSpaceGuidCName())=0D Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue= ())=0D Pcd.SetItemType(PcdType)=0D Pcd.SetValidUsage(CommentItem.GetUsageItem())= =0D Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagEx= p())=0D - Pcd.SetSupArchList(ConvertArchList(PcdItemObj.= GetSupportArchList()))=0D + Pcd.SetSupArchList(ConvertArchList(=0D + PcdItemObj.GetSupportArchList()))=0D HelpTextObj =3D CommonObject.TextObject()=0D if self.UniFileClassObject:=0D HelpTextObj.SetLang(DT.TAB_LANGUAGE_EN_X)= =0D - HelpTextObj.SetString(CommentItem.GetHelpStrin= gItem())=0D + HelpTextObj.SetString(=0D + CommentItem.GetHelpStringItem())=0D Pcd.SetHelpTextList([HelpTextObj])=0D PcdList =3D self.GetPcdList()=0D PcdList.append(Pcd)=0D self.SetPcdList(PcdList)=0D =0D - ## GenSources=0D + # GenSources=0D #=0D # Gen Sources of Inf=0D # [|[|[|[|]]]]=0D @@ -615,11 +637,11 @@ class InfPomAlignment(ModuleObject): =0D self.SetSourceFileList(self.GetSourceFileList() + SourceList)=0D =0D -=0D - ## GenUserExtensions=0D + # GenUserExtensions=0D #=0D # Gen UserExtensions of Inf=0D #=0D +=0D def _GenUserExtensions(self):=0D #=0D # UserExtensions=0D @@ -645,19 +667,21 @@ class InfPomAlignment(ModuleObject): self._GenMiscFiles(UserExtensionDataObj.GetContent())= =0D UserExtension.SetIdentifier(Identifier)=0D UserExtension.SetStatement(UserExtensionDataObj.GetContent= ())=0D - UserExtension.SetSupArchList(ConvertArchList(UserExtension= DataObj.GetSupArchList()))=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [U= serExtension])=0D + UserExtension.SetSupArchList(ConvertArchList(=0D + UserExtensionDataObj.GetSupArchList()))=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [UserExtension])=0D =0D #=0D # Gen UserExtensions of TianoCore."BinaryHeader"=0D #=0D =0D - #Get Binary header from INF file=0D + # Get Binary header from INF file=0D BinaryAbstractList =3D self.BinaryHeaderAbstractList=0D BinaryDescriptionList =3D self.BinaryHeaderDescriptionList=0D BinaryCopyrightList =3D self.BinaryHeaderCopyrightList=0D BinaryLicenseList =3D self.BinaryHeaderLicenseList=0D - #Get Binary header from UNI file=0D + # Get Binary header from UNI file=0D # Initialize UniStrDict, the top keys are language codes=0D UniStrDict =3D {}=0D if self.UniFileClassObject:=0D @@ -666,9 +690,11 @@ class InfPomAlignment(ModuleObject): for StringDefClassObject in UniStrDict[Lang]:=0D Lang =3D GetLanguageCode1766(Lang)=0D if StringDefClassObject.StringName =3D=3D DT.TAB_INF_B= INARY_ABSTRACT:=0D - BinaryAbstractList.append((Lang, ConvertSpecialUni= codes(StringDefClassObject.StringValue)))=0D + BinaryAbstractList.append(=0D + (Lang, ConvertSpecialUnicodes(StringDefClassOb= ject.StringValue)))=0D if StringDefClassObject.StringName =3D=3D DT.TAB_INF_B= INARY_DESCRIPTION:=0D - BinaryDescriptionList.append((Lang, ConvertSpecial= Unicodes(StringDefClassObject.StringValue)))=0D + BinaryDescriptionList.append(=0D + (Lang, ConvertSpecialUnicodes(StringDefClassOb= ject.StringValue)))=0D if BinaryAbstractList or BinaryDescriptionList or BinaryCopyrightL= ist or BinaryLicenseList:=0D BinaryUserExtension =3D CommonObject.UserExtensionObject()=0D BinaryUserExtension.SetBinaryAbstract(BinaryAbstractList)=0D @@ -677,7 +703,8 @@ class InfPomAlignment(ModuleObject): BinaryUserExtension.SetBinaryLicense(BinaryLicenseList)=0D BinaryUserExtension.SetIdentifier(DT.TAB_BINARY_HEADER_IDENTIF= IER)=0D BinaryUserExtension.SetUserID(DT.TAB_BINARY_HEADER_USERID)=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [Binar= yUserExtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [BinaryUserExtension])=0D =0D def _GenDepexesList(self, SmmDepexList, DxeDepexList, PeiDepexList):=0D if SmmDepexList:=0D @@ -687,7 +714,7 @@ class InfPomAlignment(ModuleObject): if PeiDepexList:=0D self.SetPeiDepex(PeiDepexList)=0D =0D - ## GenDepexes=0D + # GenDepexes=0D #=0D # Gen Depex of Inf=0D #=0D @@ -737,7 +764,8 @@ class InfPomAlignment(ModuleObject): ModuleType =3D self.ModuleType=0D if ModuleType not in DT.VALID_DEPEX_MODULE_TYPE_LIST:=0D Logger.Error("\nMkPkg", PARSER_ERROR,=0D - ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TY= PE_ERROR % (ModuleType),=0D + ST.ERR_INF_PARSER_DEPEX_SECTION_MODULE_TY= PE_ERROR % (=0D + ModuleType),=0D self.GetFullPath(), RaiseError=3DTrue)=0D if ModuleType !=3D self.ModuleType:=0D Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_PARSE= R_DEPEX_SECTION_NOT_DETERMINED,=0D @@ -757,7 +785,8 @@ class InfPomAlignment(ModuleObject): HelpIns =3D CommonObject.TextObject()=0D if self.UniFileClassObject:=0D HelpIns.SetLang(DT.TAB_LANGUAGE_EN_X)=0D - HelpIns.SetString(GetHelpStringByRemoveHashKey(Depex.H= elpString))=0D + HelpIns.SetString(=0D + GetHelpStringByRemoveHashKey(Depex.HelpString))=0D DepexIns.SetHelpText(HelpIns)=0D =0D if ModuleType in SMM_LIST:=0D @@ -773,11 +802,11 @@ class InfPomAlignment(ModuleObject): Logger.Error("\nMkPkg", PARSER_ERROR, ST.ERR_INF_P= ARSER_DEPEX_SECTION_INVALID_FOR_DRIVER,=0D self.GetFullPath(), RaiseError=3DTrue= )=0D =0D - #End of for ModuleType in ModuleTypeList=0D + # End of for ModuleType in ModuleTypeList=0D self._GenDepexesList(SmmDepexList, DxeDepexList, PeiDepexList)= =0D - #End of for Depex in DepexData=0D + # End of for Depex in DepexData=0D =0D - ## GenBinaries=0D + # GenBinaries=0D #=0D # Gen Binary of Inf, must be called after Pcd/Library is generated=0D # ||[|.]=0D @@ -829,7 +858,8 @@ class InfPomAlignment(ModuleObject): #=0D # PatchPcd and PcdEx=0D #=0D - AsBuildIns =3D self._GenAsBuiltPcds(self.Parser.InfPcdSection.GetP= cds(), AsBuildIns)=0D + AsBuildIns =3D self._GenAsBuiltPcds(=0D + self.Parser.InfPcdSection.GetPcds(), AsBuildIns)=0D =0D #=0D # Parse the DEC file that contains the GUID value of the GUID CNam= e which is used by=0D @@ -843,13 +873,15 @@ class InfPomAlignment(ModuleObject): TempPath =3D ModulePath=0D ModulePath =3D os.path.dirname(ModulePath)=0D PackageName =3D TempPath=0D - DecFilePath =3D os.path.normpath(os.path.join(WorkSpace, Packa= geName))=0D + DecFilePath =3D os.path.normpath(=0D + os.path.join(WorkSpace, PackageName))=0D if DecFilePath:=0D for File in os.listdir(DecFilePath):=0D if File.upper().endswith('.DEC'):=0D - DecFileFullPath =3D os.path.normpath(os.path.join(= DecFilePath, File))=0D - DecObjList.append(DecPomAlignment(DecFileFullPath,= self.WorkSpace))=0D -=0D + DecFileFullPath =3D os.path.normpath(=0D + os.path.join(DecFilePath, File))=0D + DecObjList.append(DecPomAlignment(=0D + DecFileFullPath, self.WorkSpace))=0D =0D BinariesDict, AsBuildIns, BinaryFileObjectList =3D GenBinaryData(B= inaryData, BinaryObj,=0D Bin= ariesDict,=0D @@ -882,9 +914,10 @@ class InfPomAlignment(ModuleObject): UserExtension.SetBinariesDict(BinariesDict2)=0D UserExtension.SetIdentifier('BinaryFileModifiers')=0D UserExtension.SetUserID('EDK2')=0D - self.SetUserExtensionList(self.GetUserExtensionList() + [UserE= xtension])=0D + self.SetUserExtensionList(=0D + self.GetUserExtensionList() + [UserExtension])=0D =0D - ## GenAsBuiltPcds=0D + # GenAsBuiltPcds=0D #=0D #=0D def _GenAsBuiltPcds(self, PcdList, AsBuildIns):=0D @@ -902,16 +935,18 @@ class InfPomAlignment(ModuleObject): if PcdItemObj.GetTokenSpaceGuidValue() =3D=3D '' and self.= BinaryModule:=0D Logger.Error("\nMkPkg",=0D PARSER_ERROR,=0D - ST.ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_= MISS % \=0D + ST.ERR_ASBUILD_PCD_TOKENSPACE_GUID_VALUE_= MISS %=0D (PcdItemObj.GetTokenSpaceGuidCName()),=0D self.GetFullPath(), RaiseError=3DTrue)=0D else:=0D - Pcd.SetTokenSpaceGuidValue(PcdItemObj.GetTokenSpaceGui= dValue())=0D + Pcd.SetTokenSpaceGuidValue(=0D + PcdItemObj.GetTokenSpaceGuidValue())=0D if (PcdItemObj.GetToken() =3D=3D '' or PcdItemObj.GetDatum= Type() =3D=3D '') and self.BinaryModule:=0D Logger.Error("\nMkPkg",=0D PARSER_ERROR,=0D - ST.ERR_ASBUILD_PCD_DECLARITION_MISS % \=0D - (PcdItemObj.GetTokenSpaceGuidCName() + '.= ' + PcdItemObj.GetCName()),=0D + ST.ERR_ASBUILD_PCD_DECLARITION_MISS %=0D + (PcdItemObj.GetTokenSpaceGuidCName() +=0D + '.' + PcdItemObj.GetCName()),=0D self.GetFullPath(), RaiseError=3DTrue)=0D Pcd.SetToken(PcdItemObj.GetToken())=0D Pcd.SetDatumType(PcdItemObj.GetDatumType())=0D @@ -920,7 +955,8 @@ class InfPomAlignment(ModuleObject): Pcd.SetOffset(PcdItemObj.GetOffset())=0D Pcd.SetItemType(PcdItem[0])=0D Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagExp())=0D - Pcd.SetSupArchList(ConvertArchList(PcdItemObj.GetSupportAr= chList()))=0D + Pcd.SetSupArchList(ConvertArchList(=0D + PcdItemObj.GetSupportArchList()))=0D Pcd.SetValidUsage(PcdItemObj.GetValidUsage())=0D for CommentItem in PcdItemObj.GetHelpStringList():=0D HelpTextObj =3D CommonObject.TextObject()=0D @@ -939,7 +975,8 @@ class InfPomAlignment(ModuleObject): Pcd.SetDefaultValue(PcdItemObj.GetDefaultValue())=0D Pcd.SetItemType(PcdItem[0])=0D Pcd.SetFeatureFlag(PcdItemObj.GetFeatureFlagExp())=0D - Pcd.SetSupArchList(ConvertArchList(PcdItemObj.GetSupportAr= chList()))=0D + Pcd.SetSupArchList(ConvertArchList(=0D + PcdItemObj.GetSupportArchList()))=0D Pcd.SetValidUsage(PcdItemObj.GetValidUsage())=0D for CommentItem in PcdItemObj.GetHelpStringList():=0D HelpTextObj =3D CommonObject.TextObject()=0D @@ -953,7 +990,7 @@ class InfPomAlignment(ModuleObject): =0D return AsBuildIns=0D =0D - ## GenGuidProtocolPpis=0D + # GenGuidProtocolPpis=0D #=0D # Gen Guids/Protocol/Ppis of INF=0D # =3D=0D @@ -980,12 +1017,15 @@ class InfPomAlignment(ModuleObject): if CommentList:=0D for GuidComentItem in CommentList:=0D ListObject =3D CommonObject.GuidObject()=0D - ListObject.SetGuidTypeList([GuidComentItem.GetGuid= TypeItem()])=0D - ListObject.SetVariableName(GuidComentItem.GetVaria= bleNameItem())=0D + ListObject.SetGuidTypeList(=0D + [GuidComentItem.GetGuidTypeItem()])=0D + ListObject.SetVariableName(=0D + GuidComentItem.GetVariableNameItem())=0D ListObject.SetUsage(GuidComentItem.GetUsageItem())= =0D ListObject.SetName(Item.GetName())=0D ListObject.SetCName(Item.GetName())=0D - ListObject.SetSupArchList(ConvertArchList(Item.Get= SupArchList()))=0D + ListObject.SetSupArchList(=0D + ConvertArchList(Item.GetSupArchList()))=0D ListObject.SetFeatureFlag(Item.GetFeatureFlagExp()= )=0D HelpString =3D GuidComentItem.GetHelpStringItem()= =0D if HelpString.strip():=0D @@ -1003,7 +1043,8 @@ class InfPomAlignment(ModuleObject): for CommentItem in CommentList:=0D ListObject =3D CommonObject.ProtocolObject()=0D ListObject.SetCName(Item.GetName())=0D - ListObject.SetSupArchList(ConvertArchList(Item.GetSupA= rchList()))=0D + ListObject.SetSupArchList(=0D + ConvertArchList(Item.GetSupArchList()))=0D ListObject.SetFeatureFlag(Item.GetFeatureFlagExp())=0D ListObject.SetNotify(CommentItem.GetNotify())=0D ListObject.SetUsage(CommentItem.GetUsageItem())=0D @@ -1022,7 +1063,8 @@ class InfPomAlignment(ModuleObject): for CommentItem in CommentList:=0D ListObject =3D CommonObject.PpiObject()=0D ListObject.SetCName(Item.GetName())=0D - ListObject.SetSupArchList(ConvertArchList(Item.GetSupA= rchList()))=0D + ListObject.SetSupArchList(=0D + ConvertArchList(Item.GetSupArchList()))=0D ListObject.SetFeatureFlag(Item.GetFeatureFlagExp())=0D ListObject.SetNotify(CommentItem.GetNotify())=0D ListObject.SetUsage(CommentItem.GetUsage())=0D @@ -1042,7 +1084,7 @@ class InfPomAlignment(ModuleObject): elif Type =3D=3D DT.TAB_PPIS:=0D self.SetPpiList(self.GetPpiList() + GuidProtocolPpiList)=0D =0D - ## GenMiscFiles=0D + # GenMiscFiles=0D #=0D # Gen MiscellaneousFiles of Inf=0D #=0D @@ -1060,12 +1102,13 @@ class InfPomAlignment(ModuleObject): if IsValidPath(FileName, GlobalData.gINF_MODULE_DIR):=0D FileObj =3D CommonObject.FileObject()=0D FileObj.SetURI(FileName)=0D - MiscFileObj.SetFileList(MiscFileObj.GetFileList()+[Fil= eObj])=0D + MiscFileObj.SetFileList(=0D + MiscFileObj.GetFileList()+[FileObj])=0D else:=0D Logger.Error("InfParser",=0D FORMAT_INVALID,=0D - ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID%(Line),=0D + ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_= INVALID % (=0D + Line),=0D File=3DGlobalData.gINF_MODULE_NAME,=0D ExtraData=3DLine)=0D self.SetMiscFileList(self.GetMiscFileList()+[MiscFileObj])=0D -=0D diff --git a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py = b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py index 08a6b257dbef..b93ddee7ccb7 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/InfPomAlignmentMisc.py @@ -1,4 +1,4 @@ -## @file InfPomAlignmentMisc.py=0D +# @file InfPomAlignmentMisc.py=0D # This file contained the routines for InfPomAlignment=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,7 +23,7 @@ from Library.Misc import CheckGuidRegFormat from Logger import StringTable as ST=0D =0D =0D -## GenModuleHeaderUserExt=0D +# GenModuleHeaderUserExt=0D #=0D #=0D def GenModuleHeaderUserExt(DefineObj, ArchString):=0D @@ -120,7 +120,8 @@ def GenModuleHeaderUserExt(DefineObj, ArchString): #=0D if len(CustomMakefileItem) =3D=3D 3:=0D if CustomMakefileItem[0] !=3D '':=0D - Value =3D CustomMakefileItem[0] + ' | ' + CustomMakefi= leItem[1]=0D + Value =3D CustomMakefileItem[0] + \=0D + ' | ' + CustomMakefileItem[1]=0D else:=0D Value =3D CustomMakefileItem[1]=0D =0D @@ -146,7 +147,7 @@ def GenModuleHeaderUserExt(DefineObj, ArchString): return DefinesDictNew=0D =0D =0D -## Generate the define statement that will be put into userextension=0D +# Generate the define statement that will be put into userextension=0D # Not support comments.=0D #=0D # @param HeaderComment: the original header comment (# not removed)=0D @@ -162,10 +163,12 @@ def _GenInfDefineStateMent(HeaderComment, Name, Value= , TailComment): =0D return Statement=0D =0D -## GenBinaryData=0D +# GenBinaryData=0D #=0D #=0D -def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryF= ileObjectList, \=0D +=0D +=0D +def GenBinaryData(BinaryData, BinaryObj, BinariesDict, AsBuildIns, BinaryF= ileObjectList,=0D SupArchList, BinaryModule, DecObjList=3DNone):=0D if BinaryModule:=0D pass=0D @@ -206,16 +209,16 @@ def GenBinaryData(BinaryData, BinaryObj, BinariesDict= , AsBuildIns, BinaryFileObj if not CheckGuidRegFormat(ItemObj.GetGuidValue()):=0D if not DecObjList:=0D if DT.TAB_HORIZON_LINE_SPLIT in ItemObj.GetGuidValue()= or \=0D - DT.TAB_COMMA_SPLIT in ItemObj.GetGuidValue():=0D + DT.TAB_COMMA_SPLIT in ItemObj.GetGuidValue():= =0D Logger.Error("\nMkPkg",=0D - FORMAT_INVALID,=0D - ST.ERR_DECPARSE_DEFINE_PKGGUID,=0D - ExtraData=3DItemObj.GetGuidValue(),=0D - RaiseError=3DTrue)=0D + FORMAT_INVALID,=0D + ST.ERR_DECPARSE_DEFINE_PKGGUID,=0D + ExtraData=3DItemObj.GetGuidValue(),=0D + RaiseError=3DTrue)=0D else:=0D Logger.Error("\nMkPkg",=0D FORMAT_INVALID,=0D - ST.ERR_UNI_SUBGUID_VALUE_DEFINE_DEC_N= OT_FOUND % \=0D + ST.ERR_UNI_SUBGUID_VALUE_DEFINE_DEC_N= OT_FOUND %=0D (ItemObj.GetGuidValue()),=0D RaiseError=3DTrue)=0D else:=0D @@ -227,10 +230,10 @@ def GenBinaryData(BinaryData, BinaryObj, BinariesDict= , AsBuildIns, BinaryFileObj =0D if not FileNameObj.GetGuidValue():=0D Logger.Error("\nMkPkg",=0D - FORMAT_INVALID,=0D - ST.ERR_DECPARSE_CGUID_NOT_FOUND %= \=0D - (ItemObj.GetGuidValue()),=0D - RaiseError=3DTrue)=0D + FORMAT_INVALID,=0D + ST.ERR_DECPARSE_CGUID_NOT_FOUND %=0D + (ItemObj.GetGuidValue()),=0D + RaiseError=3DTrue)=0D else:=0D FileNameObj.SetGuidValue(ItemObj.GetGuidValue().strip())=0D =0D diff --git a/BaseTools/Source/Python/UPT/PomAdapter/__init__.py b/BaseTools= /Source/Python/UPT/PomAdapter/__init__.py index a7c7e9dbf70c..1143abb3afd8 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/__init__.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Parser' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/UPT/ReplacePkg.py b/BaseTools/Source/P= ython/UPT/ReplacePkg.py index 03b91dab8455..02b5c7141054 100644 --- a/BaseTools/Source/Python/UPT/ReplacePkg.py +++ b/BaseTools/Source/Python/UPT/ReplacePkg.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Replace distribution package.=0D #=0D # Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -30,7 +30,7 @@ from InstallPkg import InstallDp from RmPkg import GetInstalledDpInfo=0D from RmPkg import RemoveDist=0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -38,15 +38,18 @@ from RmPkg import RemoveDist #=0D # @param Options: command Options=0D #=0D -def Main(Options =3D None):=0D +=0D +=0D +def Main(Options=3DNone):=0D ContentZipFile, DistFile =3D None, None=0D try:=0D DataBase =3D GlobalData.gDB=0D WorkspaceDir =3D GlobalData.gWORKSPACE=0D Dep =3D DependencyRules(DataBase)=0D - DistPkg, ContentZipFile, DpPkgFileName, DistFile =3D UnZipDp(Works= paceDir, Options.PackFileToReplace)=0D + DistPkg, ContentZipFile, DpPkgFileName, DistFile =3D UnZipDp(=0D + WorkspaceDir, Options.PackFileToReplace)=0D =0D - StoredDistFile, OrigDpGuid, OrigDpVersion =3D GetInstalledDpInfo(O= ptions.PackFileToBeReplaced, \=0D + StoredDistFile, OrigDpGuid, OrigDpVersion =3D GetInstalledDpInfo(O= ptions.PackFileToBeReplaced,=0D Dep= , DataBase, WorkspaceDir)=0D =0D #=0D @@ -57,35 +60,38 @@ def Main(Options =3D None): #=0D # Remove the old distribution=0D #=0D - RemoveDist(OrigDpGuid, OrigDpVersion, StoredDistFile, DataBase, Wo= rkspaceDir, Options.Yes)=0D + RemoveDist(OrigDpGuid, OrigDpVersion, StoredDistFile,=0D + DataBase, WorkspaceDir, Options.Yes)=0D =0D #=0D # Install the new distribution=0D #=0D - InstallDp(DistPkg, DpPkgFileName, ContentZipFile, Options, Dep, Wo= rkspaceDir, DataBase)=0D + InstallDp(DistPkg, DpPkgFileName, ContentZipFile,=0D + Options, Dep, WorkspaceDir, DataBase)=0D ReturnCode =3D 0=0D =0D except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),=0D - platform) + format_exc())=0D + platform) + format_exc())=0D except KeyboardInterrupt:=0D ReturnCode =3D ABORT_ERROR=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),=0D - platform) + format_exc())=0D + platform) + format_exc())=0D except:=0D ReturnCode =3D CODE_ERROR=0D Logger.Error(=0D - "\nReplacePkg",=0D - CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_REPLACE_ERR % (Options.PackFileTo= Replace, Options.PackFileToBeReplaced),=0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D + "\nReplacePkg",=0D + CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_REPLACE_ERR % (=0D + Options.PackFileToReplace, Options.PackFileToBeReplaced),= =0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(),=0D - platform) + format_exc())=0D + platform) + format_exc())=0D =0D finally:=0D Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)=0D @@ -103,13 +109,15 @@ def Main(Options =3D None): =0D return ReturnCode=0D =0D +=0D def CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpVersion):=0D NewDpPkgList =3D []=0D for PkgInfo in DistPkg.PackageSurfaceArea:=0D Guid, Version =3D PkgInfo[0], PkgInfo[1]=0D NewDpPkgList.append((Guid, Version))=0D =0D - NewDpInfo =3D "%s %s" % (DistPkg.Header.GetGuid(), DistPkg.Header.GetV= ersion())=0D + NewDpInfo =3D "%s %s" % (DistPkg.Header.GetGuid(),=0D + DistPkg.Header.GetVersion())=0D OrigDpInfo =3D "%s %s" % (OrigDpGuid, OrigDpVersion)=0D =0D #=0D @@ -118,25 +126,25 @@ def CheckReplaceDpx(Dep, DistPkg, OrigDpGuid, OrigDpV= ersion): if (NewDpInfo !=3D OrigDpInfo):=0D if Dep.CheckDpExists(DistPkg.Header.GetGuid(), DistPkg.Header.GetV= ersion()):=0D Logger.Error("\nReplacePkg", UPT_ALREADY_INSTALLED_ERROR,=0D - ST.WRN_DIST_PKG_INSTALLED,=0D - ExtraData=3DST.MSG_REPLACE_ALREADY_INSTALLED_DP)=0D + ST.WRN_DIST_PKG_INSTALLED,=0D + ExtraData=3DST.MSG_REPLACE_ALREADY_INSTALLED_DP)= =0D =0D #=0D # check whether the original distribution could be replaced by new dis= tribution=0D #=0D - Logger.Verbose(ST.MSG_CHECK_DP_FOR_REPLACE%(NewDpInfo, OrigDpInfo))=0D - DepInfoResult =3D Dep.CheckDpDepexForReplace(OrigDpGuid, OrigDpVersion= , NewDpPkgList)=0D + Logger.Verbose(ST.MSG_CHECK_DP_FOR_REPLACE % (NewDpInfo, OrigDpInfo))= =0D + DepInfoResult =3D Dep.CheckDpDepexForReplace(=0D + OrigDpGuid, OrigDpVersion, NewDpPkgList)=0D Replaceable =3D DepInfoResult[0]=0D if not Replaceable:=0D Logger.Error("\nReplacePkg", UNKNOWN_ERROR,=0D - ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY)=0D + ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY)=0D =0D #=0D # check whether new distribution could be installed by dependency rule= =0D #=0D - Logger.Verbose(ST.MSG_CHECK_DP_FOR_INSTALL%str(NewDpInfo))=0D + Logger.Verbose(ST.MSG_CHECK_DP_FOR_INSTALL % str(NewDpInfo))=0D if not Dep.ReplaceCheckNewDpDepex(DistPkg, OrigDpGuid, OrigDpVersion):= =0D Logger.Error("\nReplacePkg", UNKNOWN_ERROR,=0D - ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY,=0D - ExtraData=3DDistPkg.Header.Name)=0D -=0D + ST.ERR_PACKAGE_NOT_MATCH_DEPENDENCY,=0D + ExtraData=3DDistPkg.Header.Name)=0D diff --git a/BaseTools/Source/Python/UPT/RmPkg.py b/BaseTools/Source/Python= /UPT/RmPkg.py index cf37e2bdcabf..2ca9a020b186 100644 --- a/BaseTools/Source/Python/UPT/RmPkg.py +++ b/BaseTools/Source/Python/UPT/RmPkg.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Install distribution package.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -32,7 +32,7 @@ from Logger.ToolError import CODE_ERROR from Logger.ToolError import FatalError=0D =0D =0D -## CheckDpDepex=0D +# CheckDpDepex=0D #=0D # Check if the Depex is satisfied=0D # @param Dep: Dep=0D @@ -57,13 +57,14 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir): # also generate a log file for reference=0D #=0D Logger.Info(ST.MSG_INVALID_MODULE_INTRODUCED)=0D - LogFilePath =3D os.path.normpath(os.path.join(WorkspaceDir, Gl= obalData.gINVALID_MODULE_FILE))=0D + LogFilePath =3D os.path.normpath(os.path.join(=0D + WorkspaceDir, GlobalData.gINVALID_MODULE_FILE))=0D Logger.Info(ST.MSG_CHECK_LOG_FILE % LogFilePath)=0D try:=0D LogFile =3D open(LogFilePath, 'w')=0D try:=0D for ModulePath in DependModuleList:=0D - LogFile.write("%s\n"%ModulePath)=0D + LogFile.write("%s\n" % ModulePath)=0D Logger.Info(ModulePath)=0D except IOError:=0D Logger.Warn("\nRmPkg", ST.ERR_FILE_WRITE_FAILURE,=0D @@ -74,13 +75,15 @@ def CheckDpDepex(Dep, Guid, Version, WorkspaceDir): finally:=0D LogFile.close()=0D =0D -## Remove Path=0D +# Remove Path=0D #=0D # removing readonly file on windows will get "Access is denied"=0D # error, so before removing, change the mode to be writeable=0D #=0D # @param Path: The Path to be removed=0D #=0D +=0D +=0D def RemovePath(Path):=0D Logger.Info(ST.MSG_REMOVE_FILE % Path)=0D if not os.access(Path, os.W_OK):=0D @@ -90,16 +93,18 @@ def RemovePath(Path): os.removedirs(os.path.split(Path)[0])=0D except OSError:=0D pass=0D -## GetCurrentFileList=0D +# GetCurrentFileList=0D #=0D # @param DataBase: DataBase of UPT=0D # @param Guid: Guid of Dp=0D # @param Version: Version of Dp=0D # @param WorkspaceDir: Workspace Dir=0D #=0D +=0D +=0D def GetCurrentFileList(DataBase, Guid, Version, WorkspaceDir):=0D NewFileList =3D []=0D - for Dir in DataBase.GetDpInstallDirList(Guid, Version):=0D + for Dir in DataBase.GetDpInstallDirList(Guid, Version):=0D RootDir =3D os.path.normpath(os.path.join(WorkspaceDir, Dir))=0D for Root, Dirs, Files in os.walk(RootDir):=0D Logger.Debug(0, Dirs)=0D @@ -110,7 +115,7 @@ def GetCurrentFileList(DataBase, Guid, Version, Workspa= ceDir): return NewFileList=0D =0D =0D -## Tool entrance method=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -118,7 +123,7 @@ def GetCurrentFileList(DataBase, Guid, Version, Workspa= ceDir): #=0D # @param Options: command option=0D #=0D -def Main(Options =3D None):=0D +def Main(Options=3DNone):=0D =0D try:=0D DataBase =3D GlobalData.gDB=0D @@ -135,7 +140,8 @@ def Main(Options =3D None): #=0D # Get the Dp information=0D #=0D - StoredDistFile, Guid, Version =3D GetInstalledDpInfo(Options.Distr= ibutionFile, Dep, DataBase, WorkspaceDir)=0D + StoredDistFile, Guid, Version =3D GetInstalledDpInfo(=0D + Options.DistributionFile, Dep, DataBase, WorkspaceDir)=0D =0D #=0D # Check Dp depex=0D @@ -145,7 +151,8 @@ def Main(Options =3D None): #=0D # remove distribution=0D #=0D - RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, = Options.Yes)=0D + RemoveDist(Guid, Version, StoredDistFile,=0D + DataBase, WorkspaceDir, Options.Yes)=0D =0D Logger.Quiet(ST.MSG_FINISH)=0D =0D @@ -154,27 +161,27 @@ def Main(Options =3D None): except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += \=0D + Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += =0D format_exc())=0D except KeyboardInterrupt:=0D ReturnCode =3D ABORT_ERROR=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += \=0D + Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += =0D format_exc())=0D except:=0D Logger.Error(=0D - "\nRmPkg",=0D - CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_REMOVING_ERR,=0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + \=0D + "\nRmPkg",=0D + CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_REMOVING_ERR,=0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D + Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) +=0D format_exc())=0D ReturnCode =3D CODE_ERROR=0D return ReturnCode=0D =0D -## GetInstalledDpInfo method=0D +# GetInstalledDpInfo method=0D #=0D # Get the installed distribution information=0D #=0D @@ -186,10 +193,14 @@ def Main(Options =3D None): # @retval Guid: the Guid of the distribution=0D # @retval Version: the Version of distribution=0D #=0D +=0D +=0D def GetInstalledDpInfo(DistributionFile, Dep, DataBase, WorkspaceDir):=0D - (Guid, Version, NewDpFileName) =3D DataBase.GetDpByName(os.path.split(= DistributionFile)[1])=0D + (Guid, Version, NewDpFileName) =3D DataBase.GetDpByName(=0D + os.path.split(DistributionFile)[1])=0D if not Guid:=0D - Logger.Error("RmPkg", UNKNOWN_ERROR, ST.ERR_PACKAGE_NOT_INSTALLED = % DistributionFile)=0D + Logger.Error("RmPkg", UNKNOWN_ERROR,=0D + ST.ERR_PACKAGE_NOT_INSTALLED % DistributionFile)=0D =0D #=0D # Check Dp existing=0D @@ -200,14 +211,15 @@ def GetInstalledDpInfo(DistributionFile, Dep, DataBas= e, WorkspaceDir): # Check for Distribution files existence in /conf/upt, if not exist,=0D # Warn user and go on.=0D #=0D - StoredDistFile =3D os.path.normpath(os.path.join(WorkspaceDir, GlobalD= ata.gUPT_DIR, NewDpFileName))=0D + StoredDistFile =3D os.path.normpath(os.path.join(=0D + WorkspaceDir, GlobalData.gUPT_DIR, NewDpFileName))=0D if not os.path.isfile(StoredDistFile):=0D - Logger.Warn("RmPkg", ST.WRN_DIST_NOT_FOUND%StoredDistFile)=0D + Logger.Warn("RmPkg", ST.WRN_DIST_NOT_FOUND % StoredDistFile)=0D StoredDistFile =3D None=0D =0D return StoredDistFile, Guid, Version=0D =0D -## RemoveDist method=0D +# RemoveDist method=0D #=0D # remove a distribution=0D #=0D @@ -218,6 +230,8 @@ def GetInstalledDpInfo(DistributionFile, Dep, DataBase,= WorkspaceDir): # @param WorkspaceDir: work space directory=0D # @param ForceRemove: whether user want to remove file even it is modifie= d=0D #=0D +=0D +=0D def RemoveDist(Guid, Version, StoredDistFile, DataBase, WorkspaceDir, Forc= eRemove):=0D #=0D # Get Current File List=0D diff --git a/BaseTools/Source/Python/UPT/TestInstall.py b/BaseTools/Source/= Python/UPT/TestInstall.py index 1adc19260d89..9d1a5880f9e6 100644 --- a/BaseTools/Source/Python/UPT/TestInstall.py +++ b/BaseTools/Source/Python/UPT/TestInstall.py @@ -31,6 +31,8 @@ from sys import platform #=0D # @param Options: command Options=0D #=0D +=0D +=0D def Main(Options=3DNone):=0D ContentZipFile, DistFile =3D None, None=0D ReturnCode =3D 0=0D @@ -39,11 +41,13 @@ def Main(Options=3DNone): DataBase =3D GlobalData.gDB=0D WorkspaceDir =3D GlobalData.gWORKSPACE=0D if not Options.DistFiles:=0D - Logger.Error("TestInstallPkg", TE.OPTION_MISSING, ExtraData=3D= ST.ERR_SPECIFY_PACKAGE)=0D + Logger.Error("TestInstallPkg", TE.OPTION_MISSING,=0D + ExtraData=3DST.ERR_SPECIFY_PACKAGE)=0D =0D DistPkgList =3D []=0D for DistFile in Options.DistFiles:=0D - DistPkg, ContentZipFile, __, DistFile =3D UnZipDp(WorkspaceDir= , DistFile)=0D + DistPkg, ContentZipFile, __, DistFile =3D UnZipDp(=0D + WorkspaceDir, DistFile)=0D DistPkgList.append(DistPkg)=0D =0D #=0D @@ -65,18 +69,20 @@ def Main(Options=3DNone): except TE.FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D =0D except Exception as x:=0D ReturnCode =3D TE.CODE_ERROR=0D Logger.Error(=0D - "\nTestInstallPkg",=0D - TE.CODE_ERROR,=0D - ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.DistFiles,= =0D - ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL= _ADDR,=0D - RaiseError=3DFalse=0D - )=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + for= mat_exc())=0D + "\nTestInstallPkg",=0D + TE.CODE_ERROR,=0D + ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.DistFiles,=0D + ExtraData=3DST.MSG_SEARCH_FOR_HELP % ST.MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D =0D finally:=0D Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)=0D @@ -91,4 +97,3 @@ def Main(Options=3DNone): if ReturnCode =3D=3D 0:=0D Logger.Quiet(ST.MSG_FINISH)=0D return ReturnCode=0D -=0D diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/U= PT/UPT.py index 480f389d7d03..75b1a3bac21f 100644 --- a/BaseTools/Source/Python/UPT/UPT.py +++ b/BaseTools/Source/Python/UPT/UPT.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D # This file is the main entry for UPT=0D #=0D @@ -13,6 +13,35 @@ UPT =0D ## import modules=0D #=0D +from BuildVersion import gBUILD_VERSION=0D +from Core.IpiDb import IpiDatabase=0D +from Library import GlobalData=0D +from Library.Misc import GetWorkspace=0D +import TestInstall=0D +import ReplacePkg=0D +import InventoryWs=0D +import RmPkg=0D +import InstallPkg=0D +import MkPkg=0D +from Common.MultipleWorkspace import MultipleWorkspace as mws=0D +from Logger.ToolError import UPT_ALREADY_INSTALLED_ERROR=0D +from Logger.ToolError import FatalError=0D +from Logger.ToolError import OPTION_CONFLICT=0D +from Logger.ToolError import FILE_TYPE_MISMATCH=0D +from Logger.ToolError import OPTION_MISSING=0D +from Logger.ToolError import FILE_NOT_FOUND=0D +from Logger.StringTable import MSG_USAGE=0D +from Logger.StringTable import MSG_DESCRIPTION=0D +from Logger.StringTable import MSG_VERSION=0D +import Logger.Log as Logger=0D +from Logger import StringTable as ST=0D +from platform import python_version=0D +from traceback import format_exc=0D +from optparse import OptionParser=0D +import platform as pf=0D +from sys import platform=0D +import os.path=0D +from Core import FileHook=0D import locale=0D import sys=0D from imp import reload=0D @@ -20,57 +49,29 @@ encoding =3D locale.getdefaultlocale()[1] if encoding:=0D reload(sys)=0D sys.setdefaultencoding(encoding)=0D -from Core import FileHook=0D -import os.path=0D -from sys import platform=0D -import platform as pf=0D -from optparse import OptionParser=0D -from traceback import format_exc=0D -from platform import python_version=0D =0D -from Logger import StringTable as ST=0D -import Logger.Log as Logger=0D -from Logger.StringTable import MSG_VERSION=0D -from Logger.StringTable import MSG_DESCRIPTION=0D -from Logger.StringTable import MSG_USAGE=0D -from Logger.ToolError import FILE_NOT_FOUND=0D -from Logger.ToolError import OPTION_MISSING=0D -from Logger.ToolError import FILE_TYPE_MISMATCH=0D -from Logger.ToolError import OPTION_CONFLICT=0D -from Logger.ToolError import FatalError=0D -from Logger.ToolError import UPT_ALREADY_INSTALLED_ERROR=0D -from Common.MultipleWorkspace import MultipleWorkspace as mws=0D =0D -import MkPkg=0D -import InstallPkg=0D -import RmPkg=0D -import InventoryWs=0D -import ReplacePkg=0D -import TestInstall=0D -from Library.Misc import GetWorkspace=0D -from Library import GlobalData=0D -from Core.IpiDb import IpiDatabase=0D -from BuildVersion import gBUILD_VERSION=0D -=0D -## CheckConflictOption=0D +# CheckConflictOption=0D #=0D # CheckConflictOption=0D #=0D +=0D def CheckConflictOption(Opt):=0D if (Opt.PackFileToCreate or Opt.PackFileToInstall or Opt.PackFileToRem= ove or Opt.PackFileToReplace) \=0D - and Opt.InventoryWs:=0D + and Opt.InventoryWs:=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_L_OA_EXCLU= SIVE)=0D elif Opt.PackFileToReplace and (Opt.PackFileToCreate or Opt.PackFileTo= Install or Opt.PackFileToRemove):=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_U_ICR_EXCL= USIVE)=0D elif (Opt.PackFileToCreate and Opt.PackFileToInstall and Opt.PackFileT= oRemove):=0D - Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_REQUIRE_I_= C_R_OPTION)=0D + Logger.Error("UPT", OPTION_CONFLICT,=0D + ExtraData=3DST.ERR_REQUIRE_I_C_R_OPTION)=0D elif Opt.PackFileToCreate and Opt.PackFileToInstall:=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_I_C_EXCLUS= IVE)=0D elif Opt.PackFileToInstall and Opt.PackFileToRemove:=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_I_R_EXCLUS= IVE)=0D - elif Opt.PackFileToCreate and Opt.PackFileToRemove:=0D + elif Opt.PackFileToCreate and Opt.PackFileToRemove:=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_C_R_EXCLUS= IVE)=0D - elif Opt.TestDistFiles and (Opt.PackFileToCreate or Opt.PackFileToInst= all \=0D + elif Opt.TestDistFiles and (Opt.PackFileToCreate or Opt.PackFileToInst= all=0D or Opt.PackFileToRemove or Opt.PackFileToR= eplace):=0D Logger.Error("UPT", OPTION_CONFLICT, ExtraData=3DST.ERR_C_R_EXCLUS= IVE)=0D =0D @@ -78,8 +79,10 @@ def CheckConflictOption(Opt): Logger.Warn("UPT", ST.WARN_CUSTOMPATH_OVERRIDE_USEGUIDEDPATH)=0D Opt.UseGuidedPkgPath =3D False=0D =0D -## SetLogLevel=0D +# SetLogLevel=0D #=0D +=0D +=0D def SetLogLevel(Opt):=0D if Opt.opt_verbose:=0D Logger.SetLevel(Logger.VERBOSE)=0D @@ -96,24 +99,29 @@ def SetLogLevel(Opt): else:=0D Logger.SetLevel(Logger.INFO)=0D =0D -## Main=0D +# Main=0D #=0D # Main=0D #=0D +=0D +=0D def Main():=0D Logger.Initialize()=0D =0D Parser =3D OptionParser(version=3D(MSG_VERSION + ' Build ' + gBUILD_VE= RSION), description=3DMSG_DESCRIPTION,=0D prog=3D"UPT.exe", usage=3DMSG_USAGE)=0D =0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int", des= t=3D"debug_level", help=3DST.HLP_PRINT_DEBUG_INFO)=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",=0D + dest=3D"debug_level", help=3DST.HLP_PRINT_DEBUG_INFO= )=0D =0D Parser.add_option("-v", "--verbose", action=3D"store_true", dest=3D"op= t_verbose",=0D help=3DST.HLP_PRINT_INFORMATIONAL_STATEMENT)=0D =0D - Parser.add_option("-s", "--silent", action=3D"store_true", dest=3D"opt= _slient", help=3DST.HLP_RETURN_NO_DISPLAY)=0D + Parser.add_option("-s", "--silent", action=3D"store_true",=0D + dest=3D"opt_slient", help=3DST.HLP_RETURN_NO_DISPLAY= )=0D =0D - Parser.add_option("-q", "--quiet", action=3D"store_true", dest=3D"opt_= quiet", help=3DST.HLP_RETURN_AND_DISPLAY)=0D + Parser.add_option("-q", "--quiet", action=3D"store_true",=0D + dest=3D"opt_quiet", help=3DST.HLP_RETURN_AND_DISPLAY= )=0D =0D Parser.add_option("-i", "--install", action=3D"append", type=3D"string= ", dest=3D"Install_Distribution_Package_File",=0D help=3DST.HLP_SPECIFY_PACKAGE_NAME_INSTALL)=0D @@ -136,11 +144,14 @@ def Main(): Parser.add_option("-l", "--list", action=3D"store_true", dest=3D"List_= Dist_Installed",=0D help=3DST.HLP_LIST_DIST_INSTALLED)=0D =0D - Parser.add_option("-f", "--force", action=3D"store_true", dest=3D"Yes"= , help=3DST.HLP_DISABLE_PROMPT)=0D + Parser.add_option("-f", "--force", action=3D"store_true",=0D + dest=3D"Yes", help=3DST.HLP_DISABLE_PROMPT)=0D =0D - Parser.add_option("-n", "--custom-path", action=3D"store_true", dest= =3D"CustomPath", help=3DST.HLP_CUSTOM_PATH_PROMPT)=0D + Parser.add_option("-n", "--custom-path", action=3D"store_true",=0D + dest=3D"CustomPath", help=3DST.HLP_CUSTOM_PATH_PROMP= T)=0D =0D - Parser.add_option("-x", "--free-lock", action=3D"store_true", dest=3D"= SkipLock", help=3DST.HLP_SKIP_LOCK_CHECK)=0D + Parser.add_option("-x", "--free-lock", action=3D"store_true",=0D + dest=3D"SkipLock", help=3DST.HLP_SKIP_LOCK_CHECK)=0D =0D Parser.add_option("-u", "--replace", action=3D"store", type=3D"string"= , dest=3D"Replace_Distribution_Package_File",=0D help=3DST.HLP_SPECIFY_PACKAGE_NAME_REPLACE)=0D @@ -148,7 +159,8 @@ def Main(): Parser.add_option("-o", "--original", action=3D"store", type=3D"string= ", dest=3D"Original_Distribution_Package_File",=0D help=3DST.HLP_SPECIFY_PACKAGE_NAME_TO_BE_REPLACED)=0D =0D - Parser.add_option("--use-guided-paths", action=3D"store_true", dest=3D= "Use_Guided_Paths", help=3DST.HLP_USE_GUIDED_PATHS)=0D + Parser.add_option("--use-guided-paths", action=3D"store_true",=0D + dest=3D"Use_Guided_Paths", help=3DST.HLP_USE_GUIDED_= PATHS)=0D =0D Parser.add_option("-j", "--test-install", action=3D"append", type=3D"s= tring",=0D dest=3D"Test_Install_Distribution_Package_Files", he= lp=3DST.HLP_TEST_INSTALL)=0D @@ -176,7 +188,8 @@ def Main(): GlobalData.gWORKSPACE, GlobalData.gPACKAGE_PATH =3D GetWorkspace()= =0D except FatalError as XExcept:=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += format_exc())=0D + Logger.Quiet(ST.MSG_PYTHON_ON %=0D + (python_version(), platform) + format_exc())=0D return XExcept.args[0]=0D =0D # Support WORKSPACE is a long path=0D @@ -197,7 +210,7 @@ def Main(): Mgr =3D FileHook.RecoverMgr(WorkspaceDir)=0D FileHook.SetRecoverMgr(Mgr)=0D =0D - GlobalData.gDB =3D IpiDatabase(os.path.normpath(os.path.join(Workspace= Dir, \=0D + GlobalData.gDB =3D IpiDatabase(os.path.normpath(os.path.join(Workspace= Dir,=0D "Conf/Distr= ibutionPackageDatabase.db")), WorkspaceDir)=0D GlobalData.gDB.InitDatabase(Opt.SkipLock)=0D =0D @@ -213,24 +226,30 @@ def Main(): if Opt.PackageInformationDataFile:=0D if not os.path.exists(Opt.PackageInformationDataFile):=0D if not os.path.exists(os.path.join(WorkspaceDir, Opt.P= ackageInformationDataFile)):=0D - Logger.Error("\nUPT", FILE_NOT_FOUND, ST.ERR_NO_TE= MPLATE_FILE % Opt.PackageInformationDataFile)=0D + Logger.Error(=0D + "\nUPT", FILE_NOT_FOUND, ST.ERR_NO_TEMPLATE_FI= LE % Opt.PackageInformationDataFile)=0D else:=0D - Opt.PackageInformationDataFile =3D os.path.join(Wo= rkspaceDir, Opt.PackageInformationDataFile)=0D + Opt.PackageInformationDataFile =3D os.path.join(=0D + WorkspaceDir, Opt.PackageInformationDataFile)= =0D else:=0D - Logger.Error("UPT", OPTION_MISSING, ExtraData=3DST.ERR_REQ= UIRE_T_OPTION)=0D + Logger.Error("UPT", OPTION_MISSING,=0D + ExtraData=3DST.ERR_REQUIRE_T_OPTION)=0D if not Opt.PackFileToCreate.endswith('.dist'):=0D - Logger.Error("CreatePkg", FILE_TYPE_MISMATCH, ExtraData=3D= ST.ERR_DIST_EXT_ERROR % Opt.PackFileToCreate)=0D + Logger.Error("CreatePkg", FILE_TYPE_MISMATCH,=0D + ExtraData=3DST.ERR_DIST_EXT_ERROR % Opt.PackF= ileToCreate)=0D RunModule =3D MkPkg.Main=0D =0D elif Opt.PackFileToInstall:=0D AbsPath =3D []=0D for Item in Opt.PackFileToInstall:=0D if not Item.endswith('.dist'):=0D - Logger.Error("InstallPkg", FILE_TYPE_MISMATCH, ExtraDa= ta=3DST.ERR_DIST_EXT_ERROR % Item)=0D + Logger.Error("InstallPkg", FILE_TYPE_MISMATCH,=0D + ExtraData=3DST.ERR_DIST_EXT_ERROR % Item)= =0D =0D AbsPath.append(GetFullPathDist(Item, WorkspaceDir))=0D if not AbsPath:=0D - Logger.Error("InstallPkg", FILE_NOT_FOUND, ST.ERR_INST= ALL_DIST_NOT_FOUND % Item)=0D + Logger.Error("InstallPkg", FILE_NOT_FOUND,=0D + ST.ERR_INSTALL_DIST_NOT_FOUND % Item)=0D =0D Opt.PackFileToInstall =3D AbsPath=0D setattr(Opt, 'PackageFile', Opt.PackFileToInstall)=0D @@ -238,7 +257,8 @@ def Main(): =0D elif Opt.PackFileToRemove:=0D if not Opt.PackFileToRemove.endswith('.dist'):=0D - Logger.Error("RemovePkg", FILE_TYPE_MISMATCH, ExtraData=3D= ST.ERR_DIST_EXT_ERROR % Opt.PackFileToRemove)=0D + Logger.Error("RemovePkg", FILE_TYPE_MISMATCH,=0D + ExtraData=3DST.ERR_DIST_EXT_ERROR % Opt.PackF= ileToRemove)=0D head, tail =3D os.path.split(Opt.PackFileToRemove)=0D if head or not tail:=0D Logger.Error("RemovePkg",=0D @@ -251,13 +271,16 @@ def Main(): RunModule =3D InventoryWs.Main=0D =0D elif Opt.PackFileToBeReplaced and not Opt.PackFileToReplace:=0D - Logger.Error("ReplacePkg", OPTION_MISSING, ExtraData=3DST.ERR_= REQUIRE_U_OPTION)=0D + Logger.Error("ReplacePkg", OPTION_MISSING,=0D + ExtraData=3DST.ERR_REQUIRE_U_OPTION)=0D =0D elif Opt.PackFileToReplace:=0D if not Opt.PackFileToReplace.endswith('.dist'):=0D - Logger.Error("ReplacePkg", FILE_TYPE_MISMATCH, ExtraData= =3DST.ERR_DIST_EXT_ERROR % Opt.PackFileToReplace)=0D + Logger.Error("ReplacePkg", FILE_TYPE_MISMATCH,=0D + ExtraData=3DST.ERR_DIST_EXT_ERROR % Opt.PackF= ileToReplace)=0D if not Opt.PackFileToBeReplaced:=0D - Logger.Error("ReplacePkg", OPTION_MISSING, ExtraData=3DST.= ERR_REQUIRE_O_OPTION)=0D + Logger.Error("ReplacePkg", OPTION_MISSING,=0D + ExtraData=3DST.ERR_REQUIRE_O_OPTION)=0D if not Opt.PackFileToBeReplaced.endswith('.dist'):=0D Logger.Error("ReplacePkg",=0D FILE_TYPE_MISMATCH,=0D @@ -271,7 +294,8 @@ def Main(): =0D AbsPath =3D GetFullPathDist(Opt.PackFileToReplace, WorkspaceDi= r)=0D if not AbsPath:=0D - Logger.Error("ReplacePkg", FILE_NOT_FOUND, ST.ERR_REPLACE_= DIST_NOT_FOUND % Opt.PackFileToReplace)=0D + Logger.Error("ReplacePkg", FILE_NOT_FOUND,=0D + ST.ERR_REPLACE_DIST_NOT_FOUND % Opt.PackFileT= oReplace)=0D =0D Opt.PackFileToReplace =3D AbsPath=0D RunModule =3D ReplacePkg.Main=0D @@ -279,7 +303,8 @@ def Main(): elif Opt.Test_Install_Distribution_Package_Files:=0D for Dist in Opt.Test_Install_Distribution_Package_Files:=0D if not Dist.endswith('.dist'):=0D - Logger.Error("TestInstall", FILE_TYPE_MISMATCH, ExtraD= ata=3DST.ERR_DIST_EXT_ERROR % Dist)=0D + Logger.Error("TestInstall", FILE_TYPE_MISMATCH,=0D + ExtraData=3DST.ERR_DIST_EXT_ERROR % Dist)= =0D =0D setattr(Opt, 'DistFiles', Opt.Test_Install_Distribution_Packag= e_Files)=0D RunModule =3D TestInstall.Main=0D @@ -292,7 +317,7 @@ def Main(): except FatalError as XExcept:=0D ReturnCode =3D XExcept.args[0]=0D if Logger.GetLevel() <=3D Logger.DEBUG_9:=0D - Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += \=0D + Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) += =0D format_exc())=0D finally:=0D try:=0D @@ -313,7 +338,7 @@ def Main(): =0D return ReturnCode=0D =0D -## GetFullPathDist=0D +# GetFullPathDist=0D #=0D # This function will check DistFile existence, if not absolute path, then= try current working directory,=0D # then $(WORKSPACE),and return the AbsPath. If file doesn't find, then re= turn None=0D @@ -322,6 +347,8 @@ def Main(): # @param WorkspaceDir: Workspace Directory=0D # @return AbsPath: The Absolute path of the distribution file if exi= sted, None else=0D #=0D +=0D +=0D def GetFullPathDist(DistFile, WorkspaceDir):=0D if os.path.isabs(DistFile):=0D if not (os.path.exists(DistFile) and os.path.isfile(DistFile)):=0D @@ -337,6 +364,7 @@ def GetFullPathDist(DistFile, WorkspaceDir): =0D return AbsPath=0D =0D +=0D if __name__ =3D=3D '__main__':=0D RETVAL =3D Main()=0D #=0D diff --git a/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest= .py b/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py index dc67dc615a44..249219fbdcd7 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/CommentGeneratingUnitTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contain unit test for CommentParsing=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -34,6 +34,8 @@ from Library.Misc import CreateDirectory #=0D # Test _GetHelpStr=0D #=0D +=0D +=0D class _GetHelpStrTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -507,6 +509,8 @@ Guid1|FFE1 #=0D # Test GenProtocolPPiSections=0D #=0D +=0D +=0D class GenProtocolPPiSectionsTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -536,18 +540,18 @@ class GenProtocolPPiSectionsTest(unittest.TestCase): return Object=0D =0D # Usage Notify Help INF Comment=0D - #1 UNDEFINED true Present ## UNDEFINED ## NOTIFY # Help=0D - #2 UNDEFINED true Not Present ## UNDEFINED ## NOTIFY=0D - #3 UNDEFINED false Present ## UNDEFINED # Help=0D - #4 UNDEFINED false Not Present ## UNDEFINED=0D - #5 UNDEFINED Not Present Present # Help=0D - #6 UNDEFINED Not Present Not Present =0D - #7 Other true Present ## Other ## NOTIFY # Help=0D - #8 Other true Not Present ## Other ## NOTIFY=0D - #9 Other false Present ## Other # Help=0D - #A Other false Not Present ## Other=0D - #B Other Not Present Present ## Other # Help=0D - #C Other Not Present Not Present ## Other=0D + # 1 UNDEFINED true Present ## UNDEFINED ## NOTIFY # Help=0D + # 2 UNDEFINED true Not Present ## UNDEFINED ## NOTIFY=0D + # 3 UNDEFINED false Present ## UNDEFINED # Help=0D + # 4 UNDEFINED false Not Present ## UNDEFINED=0D + # 5 UNDEFINED Not Present Present # Help=0D + # 6 UNDEFINED Not Present Not Present =0D + # 7 Other true Present ## Other ## NOTIFY # Help=0D + # 8 Other true Not Present ## Other ## NOTIFY=0D + # 9 Other false Present ## Other # Help=0D + # A Other false Not Present ## Other=0D + # B Other Not Present Present ## Other # Help=0D + # C Other Not Present Not Present ## Other=0D =0D def testNormalCase1(self):=0D ObjectList =3D []=0D @@ -560,10 +564,9 @@ class GenProtocolPPiSectionsTest(unittest.TestCase): HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help'''=0D @@ -572,10 +575,9 @@ Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help''' IsProtocol =3D False=0D ObjectList =3D []=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Ppis]=0D Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help'''=0D @@ -592,10 +594,9 @@ Guid1|FFE1 ## UNDEFINED ## NOTIFY # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## UNDEFINED ## NOTIFY'''=0D @@ -612,10 +613,9 @@ Guid1|FFE1 ## UNDEFINED ## NOTIFY''' HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## UNDEFINED # Help'''=0D @@ -632,10 +632,9 @@ Guid1|FFE1 ## UNDEFINED # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## UNDEFINED'''=0D @@ -652,10 +651,9 @@ Guid1|FFE1 ## UNDEFINED''' HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 # Help'''=0D @@ -672,10 +670,9 @@ Guid1|FFE1 # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1'''=0D @@ -692,10 +689,9 @@ Guid1|FFE1''' HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES ## NOTIFY # Help'''=0D @@ -712,10 +708,9 @@ Guid1|FFE1 ## PRODUCES ## NOTIFY # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES ## NOTIFY'''=0D @@ -732,10 +727,9 @@ Guid1|FFE1 ## PRODUCES ## NOTIFY''' HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES # Help'''=0D @@ -752,10 +746,9 @@ Guid1|FFE1 ## PRODUCES # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES'''=0D @@ -772,10 +765,9 @@ Guid1|FFE1 ## PRODUCES''' HelpStr =3D 'Help'=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES # Help'''=0D @@ -792,10 +784,9 @@ Guid1|FFE1 ## PRODUCES # Help''' HelpStr =3D ''=0D IsProtocol =3D True=0D Object =3D self.ObjectFactory(CName, FFE, Usage, Notify,=0D - HelpStr, IsProtocol)=0D + HelpStr, IsProtocol)=0D ObjectList.append(Object)=0D =0D -=0D Result =3D GenProtocolPPiSections(ObjectList, IsProtocol)=0D Expected =3D '''[Protocols]=0D Guid1|FFE1 ## PRODUCES'''=0D @@ -804,6 +795,8 @@ Guid1|FFE1 ## PRODUCES''' #=0D # Test GenPcdSections=0D #=0D +=0D +=0D class GenPcdSectionsTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -832,12 +825,11 @@ class GenPcdSectionsTest(unittest.TestCase): =0D return Object=0D =0D -=0D # Usage Help INF Comment=0D - #1 UNDEFINED Present # Help=0D - #2 UNDEFINED Not Present =0D - #3 Other Present ## Other # Help=0D - #4 Other Not Present ## Other=0D + # 1 UNDEFINED Present # Help=0D + # 2 UNDEFINED Not Present =0D + # 3 Other Present ## Other # Help=0D + # 4 Other Not Present ## Other=0D =0D def testNormalCase1(self):=0D ObjectList =3D []=0D @@ -1244,7 +1236,6 @@ class GenHobSectionsTest(unittest.TestCase): Usage =3D 'UNDEFINED'=0D Str =3D '\nNew Stack HoB'=0D =0D -=0D Object =3D self.ObjectFactory(SupArchList, Type, Usage, Str)=0D ObjectList.append(Object)=0D =0D @@ -1266,7 +1257,6 @@ class GenHobSectionsTest(unittest.TestCase): Usage =3D 'UNDEFINED'=0D Str =3D '\nNew Stack HoB\n\nTail Comment'=0D =0D -=0D Object =3D self.ObjectFactory(SupArchList, Type, Usage, Str)=0D ObjectList.append(Object)=0D =0D @@ -1290,7 +1280,6 @@ class GenHobSectionsTest(unittest.TestCase): Usage =3D 'UNDEFINED'=0D Str =3D '\n\n'=0D =0D -=0D Object =3D self.ObjectFactory(SupArchList, Type, Usage, Str)=0D ObjectList.append(Object)=0D =0D @@ -1372,6 +1361,8 @@ class GenHobSectionsTest(unittest.TestCase): #=0D # Test GenGenericCommentF=0D #=0D +=0D +=0D class GenGenericCommentFTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -1409,6 +1400,7 @@ class GenGenericCommentFTest(unittest.TestCase): Expected =3D '# coment line 1\n# coment line 2\n'=0D self.assertEqual(Result, Expected)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D Logger.Initialize()=0D unittest.main()=0D diff --git a/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py= b/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py index 4a3f6db5e3b2..1f31c96e518b 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/CommentParsingUnitTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contain unit test for CommentParsing=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -9,9 +9,9 @@ import unittest =0D import Logger.Log as Logger=0D from Library.CommentParsing import ParseHeaderCommentSection, \=0D - ParseGenericComment, \=0D - ParseDecPcdGenericComment, \=0D - ParseDecPcdTailComment=0D + ParseGenericComment, \=0D + ParseDecPcdGenericComment, \=0D + ParseDecPcdTailComment=0D from Library.CommentParsing import _IsCopyrightLine=0D from Library.StringUtils import GetSplitValueList=0D from Library.DataType import TAB_SPACE_SPLIT=0D @@ -20,6 +20,8 @@ from Library.DataType import TAB_LANGUAGE_EN_US #=0D # Test ParseHeaderCommentSection=0D #=0D +=0D +=0D class ParseHeaderCommentSectionTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -32,7 +34,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase1(self):=0D TestCommentLines1 =3D \=0D - '''# License1=0D + '''# License1=0D # License2=0D #=0D ## @file=0D @@ -74,7 +76,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase2(self):=0D TestCommentLines2 =3D \=0D - ''' # License1=0D + ''' # License1=0D # License2=0D #=0D ## @file=0D @@ -110,14 +112,14 @@ class ParseHeaderCommentSectionTest(unittest.TestCase= ): ExpectedLicense =3D 'License1\nLicense2'=0D self.assertEqual(License, ExpectedLicense)=0D =0D -=0D #=0D # Normal case2: have license/copyright/license above @file,=0D # but no abstract/description=0D #=0D +=0D def testNormalCase3(self):=0D TestCommentLines3 =3D \=0D - ''' # License1=0D + ''' # License1=0D # License2=0D #=0D ## @file=0D @@ -160,7 +162,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase4(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstract=0D #=0D @@ -202,7 +204,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase5(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstract=0D #=0D @@ -248,7 +250,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase6(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstract=0D #=0D @@ -296,7 +298,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase7(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D #=0D # Description=0D @@ -343,7 +345,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testNormalCase8(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstact=0D #=0D @@ -383,7 +385,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testErrorCase1(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstract=0D #=0D @@ -410,7 +412,7 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D def testErrorCase2(self):=0D TestCommentLines =3D \=0D - '''=0D + '''=0D ## @file=0D # Abstract=0D #=0D @@ -437,6 +439,8 @@ class ParseHeaderCommentSectionTest(unittest.TestCase): #=0D # Test ParseGenericComment=0D #=0D +=0D +=0D class ParseGenericCommentTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -449,7 +453,7 @@ class ParseGenericCommentTest(unittest.TestCase): #=0D def testNormalCase1(self):=0D TestCommentLines =3D \=0D - '''# hello world'''=0D + '''# hello world'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -458,7 +462,8 @@ class ParseGenericCommentTest(unittest.TestCase): LineNum +=3D 1=0D TestCommentLinesList.append((Comment, LineNum))=0D =0D - HelptxtObj =3D ParseGenericComment(TestCommentLinesList, 'testNorm= alCase1')=0D + HelptxtObj =3D ParseGenericComment(=0D + TestCommentLinesList, 'testNormalCase1')=0D self.failIf(not HelptxtObj)=0D self.assertEqual(HelptxtObj.GetString(), 'hello world')=0D self.assertEqual(HelptxtObj.GetLang(), TAB_LANGUAGE_EN_US)=0D @@ -468,7 +473,7 @@ class ParseGenericCommentTest(unittest.TestCase): #=0D def testNormalCase2(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D @@ -478,7 +483,8 @@ class ParseGenericCommentTest(unittest.TestCase): LineNum +=3D 1=0D TestCommentLinesList.append((Comment, LineNum))=0D =0D - HelptxtObj =3D ParseGenericComment(TestCommentLinesList, 'testNorm= alCase2')=0D + HelptxtObj =3D ParseGenericComment(=0D + TestCommentLinesList, 'testNormalCase2')=0D self.failIf(not HelptxtObj)=0D self.assertEqual(HelptxtObj.GetString(),=0D 'hello world\n' + 'second line')=0D @@ -489,7 +495,7 @@ class ParseGenericCommentTest(unittest.TestCase): #=0D def testNormalCase3(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D This is not comment line'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D @@ -499,7 +505,8 @@ class ParseGenericCommentTest(unittest.TestCase): LineNum +=3D 1=0D TestCommentLinesList.append((Comment, LineNum))=0D =0D - HelptxtObj =3D ParseGenericComment(TestCommentLinesList, 'testNorm= alCase3')=0D + HelptxtObj =3D ParseGenericComment(=0D + TestCommentLinesList, 'testNormalCase3')=0D self.failIf(not HelptxtObj)=0D self.assertEqual(HelptxtObj.GetString(),=0D 'hello world\n\n')=0D @@ -508,6 +515,8 @@ class ParseGenericCommentTest(unittest.TestCase): #=0D # Test ParseDecPcdGenericComment=0D #=0D +=0D +=0D class ParseDecPcdGenericCommentTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -520,7 +529,7 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D def testNormalCase1(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D @@ -537,13 +546,13 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase= ): self.assertEqual(HelpTxt,=0D 'hello world\n' + 'second line')=0D =0D -=0D #=0D # Normal case2: comments with valid list=0D #=0D +=0D def testNormalCase2(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line=0D # @ValidList 1, 2, 3=0D # other line'''=0D @@ -562,8 +571,8 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): self.assertEqual(HelpTxt,=0D 'hello world\n' + 'second line\n' + 'other line')= =0D ExpectedList =3D GetSplitValueList('1 2 3', TAB_SPACE_SPLIT)=0D - ActualList =3D [item for item in \=0D - GetSplitValueList(PcdErr.GetValidValue(), TAB_SPACE_SPLIT) if = item]=0D + ActualList =3D [item for item in=0D + GetSplitValueList(PcdErr.GetValidValue(), TAB_SPACE_= SPLIT) if item]=0D self.assertEqual(ExpectedList, ActualList)=0D self.failIf(PcdErr.GetExpression())=0D self.failIf(PcdErr.GetValidValueRange())=0D @@ -573,7 +582,7 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D def testNormalCase3(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line=0D # @ValidRange LT 1 AND GT 2=0D # other line'''=0D @@ -600,7 +609,7 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D def testNormalCase4(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line=0D # @Expression LT 1 AND GT 2=0D # other line'''=0D @@ -627,7 +636,7 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D def testNormalCase5(self):=0D TestCommentLines =3D \=0D - '''# @Expression LT 1 AND GT 2'''=0D + '''# @Expression LT 1 AND GT 2'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -649,7 +658,7 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D def testNormalCase6(self):=0D TestCommentLines =3D \=0D - '''#'''=0D + '''#'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -663,15 +672,14 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase= ): self.assertEqual(HelpTxt, '\n')=0D self.failIf(PcdErr)=0D =0D -=0D -=0D #=0D # Error case1: comments with both expression and valid list, use later= =0D # ignore the former and with a warning message=0D #=0D +=0D def testErrorCase1(self):=0D TestCommentLines =3D \=0D - '''## hello world=0D + '''## hello world=0D # second line=0D # @ValidList 1, 2, 3=0D # @Expression LT 1 AND GT 2=0D @@ -692,6 +700,8 @@ class ParseDecPcdGenericCommentTest(unittest.TestCase): #=0D # Test ParseDecPcdTailComment=0D #=0D +=0D +=0D class ParseDecPcdTailCommentTest(unittest.TestCase):=0D def setUp(self):=0D pass=0D @@ -704,7 +714,7 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): #=0D def testNormalCase1(self):=0D TestCommentLines =3D \=0D - '''## #hello world'''=0D + '''## #hello world'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -725,7 +735,7 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): #=0D def testNormalCase2(self):=0D TestCommentLines =3D \=0D - '''## BASE #hello world'''=0D + '''## BASE #hello world'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -748,7 +758,7 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): #=0D def testNormalCase3(self):=0D TestCommentLines =3D \=0D - '''## BASE UEFI_APPLICATION #hello world'''=0D + '''## BASE UEFI_APPLICATION #hello world'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -771,7 +781,7 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): #=0D def testNormalCase4(self):=0D TestCommentLines =3D \=0D - '''## BASE UEFI_APPLICATION'''=0D + '''## BASE UEFI_APPLICATION'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -792,7 +802,7 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): #=0D def testNormalCase5(self):=0D TestCommentLines =3D \=0D - ''' # 1 =3D 128MB, 2 =3D 256MB, 3 =3D MAX'''=0D + ''' # 1 =3D 128MB, 2 =3D 256MB, 3 =3D MAX'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -808,14 +818,14 @@ class ParseDecPcdTailCommentTest(unittest.TestCase): '1 =3D 128MB, 2 =3D 256MB, 3 =3D MAX')=0D self.failIf(SupModeList)=0D =0D -=0D #=0D # Error case2: comments with supModList contains valid and invalid=0D # module type=0D #=0D +=0D def testErrorCase2(self):=0D TestCommentLines =3D \=0D - '''## BASE INVALID_MODULE_TYPE #hello world'''=0D + '''## BASE INVALID_MODULE_TYPE #hello world'''=0D =0D CommentList =3D GetSplitValueList(TestCommentLines, "\n")=0D LineNum =3D 0=0D @@ -912,6 +922,7 @@ class _IsCopyrightLineTest(unittest.TestCase): Result =3D _IsCopyrightLine(Line)=0D self.failIf(Result)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D Logger.Initialize()=0D unittest.main()=0D diff --git a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py b/BaseTo= ols/Source/Python/UPT/UnitTest/DecParserTest.py index b9f7dfe52a6d..01adb668d4bc 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/DecParserTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contain unit test for DecParser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -20,6 +20,8 @@ from Library.ParserValidate import IsValidCFormatGuid #=0D # Test tool function=0D #=0D +=0D +=0D def TestToolFuncs():=0D assert IsValidCArray('{0x1, 0x23}')=0D =0D @@ -46,8 +48,11 @@ def TestToolFuncs(): assert not IsValidPcdDatum('UNKNOWNTYPE', '0xabc')[0]=0D assert not IsValidPcdDatum('UINT8', 'not number')[0]=0D =0D - assert( IsValidCFormatGuid('{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, 0x66= , 0x53, 0x8c , 0x38, 0xaf, 0x48, 0xce }}'))=0D - assert( not IsValidCFormatGuid('{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, = 0x66 , 0x53, 0x8c , 0x38, 0xaf, 0x48, 0xce }} 0xaa'))=0D + assert(IsValidCFormatGuid(=0D + '{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, 0x66 , 0x53, 0x8c , 0x38, 0= xaf, 0x48, 0xce }}'))=0D + assert(not IsValidCFormatGuid(=0D + '{ 0xfa0b1735 , 0x87a0, 0x4193, {0xb2, 0x66 , 0x53, 0x8c , 0x38, 0= xaf, 0x48, 0xce }} 0xaa'))=0D +=0D =0D def TestTemplate(TestString, TestFunc):=0D Path =3D os.path.join(os.getcwd(), 'test.dec')=0D @@ -75,6 +80,8 @@ def TestTemplate(TestString, TestFunc): # This function test right syntax DEC file=0D # @retval: parser object=0D #=0D +=0D +=0D def TestOK(Path, TestString):=0D try:=0D Parser =3D Dec(Path)=0D @@ -84,6 +91,8 @@ def TestOK(Path, TestString): =0D # This function test wrong syntax DEC file=0D # if parser checked wrong syntax, exception thrown and it's expected resul= t=0D +=0D +=0D def TestError(Path, TestString):=0D try:=0D Dec(Path)=0D @@ -92,6 +101,7 @@ def TestError(Path, TestString): return True=0D raise 'Bug!!! Wrong syntax in DEC file, but passed by DEC parser!!\n' = + TestString=0D =0D +=0D def TestDecDefine():=0D TestString =3D '''=0D [Defines]=0D @@ -119,6 +129,7 @@ def TestDecDefine(): '''=0D assert TestTemplate(TestString, TestError)=0D =0D +=0D def TestDecInclude():=0D TestString =3D '''=0D [Defines]=0D @@ -163,6 +174,7 @@ def TestDecInclude(): =0D os.removedirs('Include/Ia32')=0D =0D +=0D def TestDecGuidPpiProtocol():=0D TestString =3D '''=0D [Defines]=0D @@ -205,6 +217,7 @@ def TestDecGuidPpiProtocol(): assert Items[0].GuidCName =3D=3D 'gEfiPeiMasterBootModePpiGuid'=0D assert Items[0].GuidCValue =3D=3D '{ 0x7408d748, 0xfc8c, 0x4ee6, {0x92= , 0x88, 0xc4, 0xbe, 0xc0, 0x92, 0xa4, 0x10 } }'=0D =0D +=0D def TestDecPcd():=0D TestString =3D '''=0D [Defines]=0D @@ -246,6 +259,7 @@ def TestDecPcd(): assert len(Items) =3D=3D 4=0D assert len(Obj.GetPcdsByType('PcdsPatchableInModule')) =3D=3D 2=0D =0D +=0D def TestDecUserExtension():=0D TestString =3D '''=0D [Defines]=0D @@ -264,6 +278,7 @@ def TestDecUserExtension(): assert len(Items[0].ArchAndModuleType) =3D=3D 1=0D assert ['MyID', '"TestString"', 'IA32'] in Items[0].ArchAndModuleType= =0D =0D +=0D if __name__ =3D=3D '__main__':=0D import Logger.Logger=0D Logger.Logger.Initialize()=0D @@ -275,5 +290,3 @@ if __name__ =3D=3D '__main__': unittest.FunctionTestCase(TestDecUserExtension).runTest()=0D =0D print('All tests passed...')=0D -=0D -=0D diff --git a/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py b/Ba= seTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py index bac127f8e2ac..22d4db05e2e0 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/DecParserUnitTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contain unit test for DecParser=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -24,6 +24,8 @@ from Object.Parser.DecObject import _DecComments #=0D # Test CleanString=0D #=0D +=0D +=0D class CleanStringTestCase(unittest.TestCase):=0D def testCleanString(self):=0D Line, Comment =3D CleanString('')=0D @@ -43,13 +45,16 @@ class CleanStringTestCase(unittest.TestCase): self.assertEqual(Comment, '# and comment')=0D =0D def testCleanStringCpp(self):=0D - Line, Comment =3D CleanString('line // and comment', AllowCppStyle= Comment =3D True)=0D + Line, Comment =3D CleanString(=0D + 'line // and comment', AllowCppStyleComment=3DTrue)=0D self.assertEqual(Line, 'line')=0D self.assertEqual(Comment, '# and comment')=0D =0D #=0D # Test _DecBase._MacroParser function=0D #=0D +=0D +=0D class MacroParserTestCase(unittest.TestCase):=0D def setUp(self):=0D self.dec =3D _DecBase(FileContent('dummy', []))=0D @@ -61,7 +66,8 @@ class MacroParserTestCase(unittest.TestCase): =0D def testErrorMacro1(self):=0D # Raise fatal error, macro name must be upper case letter=0D - self.assertRaises(FatalError, self.dec._MacroParser, 'DEFINE not_u= pper_case =3D test2')=0D + self.assertRaises(FatalError, self.dec._MacroParser,=0D + 'DEFINE not_upper_case =3D test2')=0D =0D def testErrorMacro2(self):=0D # No macro name given=0D @@ -70,6 +76,8 @@ class MacroParserTestCase(unittest.TestCase): #=0D # Test _DecBase._TryBackSlash function=0D #=0D +=0D +=0D class TryBackSlashTestCase(unittest.TestCase):=0D def setUp(self):=0D Content =3D [=0D @@ -92,34 +100,43 @@ class TryBackSlashTestCase(unittest.TestCase): #=0D # Right case, assert return values=0D #=0D - ConcatLine, CommentList =3D self.dec._TryBackSlash(self.dec._RawDa= ta.GetNextLine(), [])=0D + ConcatLine, CommentList =3D self.dec._TryBackSlash(=0D + self.dec._RawData.GetNextLine(), [])=0D self.assertEqual(ConcatLine, 'test no backslash')=0D self.assertEqual(CommentList, [])=0D =0D - ConcatLine, CommentList =3D self.dec._TryBackSlash(self.dec._RawDa= ta.GetNextLine(), [])=0D + ConcatLine, CommentList =3D self.dec._TryBackSlash(=0D + self.dec._RawData.GetNextLine(), [])=0D self.assertEqual(CommentList, [])=0D - self.assertEqual(ConcatLine, 'test with backslash continue second = line')=0D + self.assertEqual(=0D + ConcatLine, 'test with backslash continue second line')=0D =0D #=0D # Error cases, assert raise exception=0D #=0D - self.assertRaises(FatalError, self.dec._TryBackSlash, self.dec._Ra= wData.GetNextLine(), [])=0D - self.assertRaises(FatalError, self.dec._TryBackSlash, self.dec._Ra= wData.GetNextLine(), [])=0D + self.assertRaises(FatalError, self.dec._TryBackSlash,=0D + self.dec._RawData.GetNextLine(), [])=0D + self.assertRaises(FatalError, self.dec._TryBackSlash,=0D + self.dec._RawData.GetNextLine(), [])=0D =0D #=0D # Test _DecBase.Parse function=0D #=0D +=0D +=0D class DataItem(_DecComments):=0D def __init__(self):=0D _DecComments.__init__(self)=0D self.String =3D ''=0D =0D +=0D class Data(_DecComments):=0D def __init__(self):=0D _DecComments.__init__(self)=0D # List of DataItem=0D self.ItemList =3D []=0D =0D +=0D class TestInner(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -137,6 +154,7 @@ class TestInner(_DecBase): def _TailCommentStrategy(self, Comment):=0D return Comment.find('@comment') !=3D -1=0D =0D +=0D class TestTop(_DecBase):=0D def __init__(self, RawData):=0D _DecBase.__init__(self, RawData)=0D @@ -153,13 +171,14 @@ class TestTop(_DecBase): self.ItemObject.append(TestParser.ItemObject)=0D return TestParser.ItemObject=0D =0D +=0D class ParseTestCase(unittest.TestCase):=0D def setUp(self):=0D pass=0D =0D def testParse(self):=0D Content =3D \=0D - '''# Top comment=0D + '''# Top comment=0D [TOP]=0D # sub1 head comment=0D (test item has both head and tail comment) # sub1 tail comment=0D @@ -187,7 +206,8 @@ class ParseTestCase(unittest.TestCase): self.assertEqual(len(data.ItemList), 3)=0D =0D dataitem =3D data.ItemList[0]=0D - self.assertEqual(dataitem.String, '(test item has both head and ta= il comment)')=0D + self.assertEqual(=0D + dataitem.String, '(test item has both head and tail comment)')= =0D # Comment content=0D self.assertEqual(dataitem._HeadComment[0][0], '# sub1 head comment= ')=0D self.assertEqual(dataitem._TailComment[0][0], '# sub1 tail comment= ')=0D @@ -196,10 +216,12 @@ class ParseTestCase(unittest.TestCase): self.assertEqual(dataitem._TailComment[0][1], 4)=0D =0D dataitem =3D data.ItemList[1]=0D - self.assertEqual(dataitem.String, '(test item has head and special= tail comment)')=0D + self.assertEqual(=0D + dataitem.String, '(test item has head and special tail comment= )')=0D # Comment content=0D self.assertEqual(dataitem._HeadComment[0][0], '# sub2 head comment= ')=0D - self.assertEqual(dataitem._TailComment[0][0], '# @comment test Tai= lCommentStrategy branch')=0D + self.assertEqual(=0D + dataitem._TailComment[0][0], '# @comment test TailCommentStrat= egy branch')=0D # Comment line number=0D self.assertEqual(dataitem._HeadComment[0][1], 5)=0D self.assertEqual(dataitem._TailComment[0][1], 7)=0D @@ -225,6 +247,8 @@ class ParseTestCase(unittest.TestCase): #=0D # Test _DecDefine._ParseItem=0D #=0D +=0D +=0D class DecDefineTestCase(unittest.TestCase):=0D def GetObj(self, Content):=0D Obj =3D _DecDefine(FileContent('dummy', Content.splitlines()))=0D @@ -251,6 +275,8 @@ class DecDefineTestCase(unittest.TestCase): #=0D # Test _DecLibraryclass._ParseItem=0D #=0D +=0D +=0D class DecLibraryTestCase(unittest.TestCase):=0D def GetObj(self, Content):=0D Obj =3D _DecLibraryclass(FileContent('dummy', Content.splitlines()= ))=0D @@ -266,7 +292,8 @@ class DecLibraryTestCase(unittest.TestCase): self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testLibclassNaming(self):=0D - obj =3D self.GetObj('lowercase_efiRuntimeLib|Include/Library/UefiR= untimeLib.h')=0D + obj =3D self.GetObj(=0D + 'lowercase_efiRuntimeLib|Include/Library/UefiRuntimeLib.h')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testLibclassExt(self):=0D @@ -280,6 +307,8 @@ class DecLibraryTestCase(unittest.TestCase): #=0D # Test _DecPcd._ParseItem=0D #=0D +=0D +=0D class DecPcdTestCase(unittest.TestCase):=0D def GetObj(self, Content):=0D Obj =3D _DecPcd(FileContent('dummy', Content.splitlines()))=0D @@ -288,7 +317,8 @@ class DecPcdTestCase(unittest.TestCase): return Obj=0D =0D def testOK(self):=0D - item =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDis= able|FALSE|BOOLEAN|0x0000000d')._ParseItem()=0D + item =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEA= N|0x0000000d')._ParseItem()=0D self.assertEqual(item.TokenSpaceGuidCName, 'gEfiMdePkgTokenSpaceGu= id')=0D self.assertEqual(item.TokenCName, 'PcdComponentNameDisable')=0D self.assertEqual(item.DefaultValue, 'FALSE')=0D @@ -296,31 +326,39 @@ class DecPcdTestCase(unittest.TestCase): self.assertEqual(item.TokenValue, '0x0000000d')=0D =0D def testNoCvar(self):=0D - obj =3D self.GetObj('123ai.PcdComponentNameDisable|FALSE|BOOLEAN|0= x0000000d')=0D + obj =3D self.GetObj(=0D + '123ai.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testSplit(self):=0D - obj =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisa= ble FALSE|BOOLEAN|0x0000000d')=0D + obj =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable FALSE|BOOLEA= N|0x0000000d')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D - obj =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisa= ble|FALSE|BOOLEAN|0x0000000d | abc')=0D + obj =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEA= N|0x0000000d | abc')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testUnknownType(self):=0D - obj =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisa= ble|FALSE|unknown|0x0000000d')=0D + obj =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|unknow= n|0x0000000d')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testVoid(self):=0D - obj =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisa= ble|abc|VOID*|0x0000000d')=0D + obj =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|abc|VOID*|0x= 0000000d')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D def testUINT(self):=0D - obj =3D self.GetObj('gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisa= ble|0xabc|UINT8|0x0000000d')=0D + obj =3D self.GetObj(=0D + 'gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|0xabc|UINT8|= 0x0000000d')=0D self.assertRaises(FatalError, obj._ParseItem)=0D =0D #=0D # Test _DecInclude._ParseItem=0D #=0D +=0D +=0D class DecIncludeTestCase(unittest.TestCase):=0D #=0D # Test code to be added=0D @@ -330,6 +368,8 @@ class DecIncludeTestCase(unittest.TestCase): #=0D # Test _DecGuid._ParseItem=0D #=0D +=0D +=0D class DecGuidTestCase(unittest.TestCase):=0D def GetObj(self, Content):=0D Obj =3D _DecGuid(FileContent('dummy', Content.splitlines()))=0D @@ -341,12 +381,15 @@ class DecGuidTestCase(unittest.TestCase): item =3D self.GetObj('gEfiIpSecProtocolGuid=3D{ 0xdfb386f7, 0xe100= , 0x43ad,'=0D ' {0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x= 12 }}')._ParseItem()=0D self.assertEqual(item.GuidCName, 'gEfiIpSecProtocolGuid')=0D - self.assertEqual(item.GuidCValue, '{ 0xdfb386f7, 0xe100, 0x43ad, {= 0x9c, 0x9a, 0xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 }}')=0D + self.assertEqual(=0D + item.GuidCValue, '{ 0xdfb386f7, 0xe100, 0x43ad, {0x9c, 0x9a, 0= xed, 0x90, 0xd0, 0x8a, 0x5e, 0x12 }}')=0D =0D def testGuidString(self):=0D - item =3D self.GetObj('gEfiIpSecProtocolGuid=3D1E73767F-8F52-4603-A= EB4-F29B510B6766')._ParseItem()=0D + item =3D self.GetObj(=0D + 'gEfiIpSecProtocolGuid=3D1E73767F-8F52-4603-AEB4-F29B510B6766'= )._ParseItem()=0D self.assertEqual(item.GuidCName, 'gEfiIpSecProtocolGuid')=0D - self.assertEqual(item.GuidCValue, '1E73767F-8F52-4603-AEB4-F29B510= B6766')=0D + self.assertEqual(=0D + item.GuidCValue, '1E73767F-8F52-4603-AEB4-F29B510B6766')=0D =0D def testNoValue1(self):=0D obj =3D self.GetObj('gEfiIpSecProtocolGuid')=0D @@ -363,10 +406,13 @@ class DecGuidTestCase(unittest.TestCase): #=0D # Test Dec.__init__=0D #=0D +=0D +=0D class DecDecInitTestCase(unittest.TestCase):=0D def testNoDecFile(self):=0D self.assertRaises(FatalError, Dec, 'No_Such_File')=0D =0D +=0D class TmpFile:=0D def __init__(self, File):=0D self.File =3D File=0D @@ -388,11 +434,13 @@ class TmpFile: #=0D # Test Dec._UserExtentionSectionParser=0D #=0D +=0D +=0D class DecUESectionTestCase(unittest.TestCase):=0D def setUp(self):=0D self.File =3D TmpFile('test.dec')=0D self.File.Write(=0D -'''[userextensions.intel."myid"]=0D + '''[userextensions.intel."myid"]=0D [userextensions.intel."myid".IA32]=0D [userextensions.intel."myid".IA32,]=0D [userextensions.intel."myid]=0D @@ -409,7 +457,8 @@ class DecUESectionTestCase(unittest.TestCase): dec._RawData.CurrentLine =3D CleanString(dec._RawData.GetNextLine(= ))[0]=0D dec._UserExtentionSectionParser()=0D self.assertEqual(len(dec._RawData.CurrentScope), 1)=0D - self.assertEqual(dec._RawData.CurrentScope[0][0], 'userextensions'= .upper())=0D + self.assertEqual(=0D + dec._RawData.CurrentScope[0][0], 'userextensions'.upper())=0D self.assertEqual(dec._RawData.CurrentScope[0][1], 'intel')=0D self.assertEqual(dec._RawData.CurrentScope[0][2], '"myid"')=0D self.assertEqual(dec._RawData.CurrentScope[0][3], 'COMMON')=0D @@ -418,7 +467,8 @@ class DecUESectionTestCase(unittest.TestCase): dec._RawData.CurrentLine =3D CleanString(dec._RawData.GetNextLine(= ))[0]=0D dec._UserExtentionSectionParser()=0D self.assertEqual(len(dec._RawData.CurrentScope), 1)=0D - self.assertEqual(dec._RawData.CurrentScope[0][0], 'userextensions'= .upper())=0D + self.assertEqual(=0D + dec._RawData.CurrentScope[0][0], 'userextensions'.upper())=0D self.assertEqual(dec._RawData.CurrentScope[0][1], 'intel')=0D self.assertEqual(dec._RawData.CurrentScope[0][2], '"myid"')=0D self.assertEqual(dec._RawData.CurrentScope[0][3], 'IA32')=0D @@ -434,11 +484,13 @@ class DecUESectionTestCase(unittest.TestCase): #=0D # Test Dec._SectionHeaderParser=0D #=0D +=0D +=0D class DecSectionTestCase(unittest.TestCase):=0D def setUp(self):=0D self.File =3D TmpFile('test.dec')=0D self.File.Write(=0D -'''[no section start or end=0D + '''[no section start or end=0D [,] # empty sub-section=0D [unknow_section_name]=0D [Includes.IA32.other] # no third one=0D @@ -446,7 +498,7 @@ class DecSectionTestCase(unittest.TestCase): [Includes.IA32, Includes.IA32]=0D [Includes, Includes.IA32] # common cannot be with other arch=0D [Includes.IA32, PcdsFeatureFlag] # different section name=0D -''' )=0D +''')=0D =0D def tearDown(self):=0D self.File.Remove()=0D @@ -457,7 +509,7 @@ class DecSectionTestCase(unittest.TestCase): dec._RawData.CurrentLine =3D CleanString(dec._RawData.GetNextLine(= ))[0]=0D self.assertRaises(FatalError, dec._SectionHeaderParser)=0D =0D - #[,] # empty sub-section=0D + # [,] # empty sub-section=0D dec._RawData.CurrentLine =3D CleanString(dec._RawData.GetNextLine(= ))[0]=0D self.assertRaises(FatalError, dec._SectionHeaderParser)=0D =0D @@ -491,11 +543,13 @@ class DecSectionTestCase(unittest.TestCase): #=0D # Test Dec._ParseDecComment=0D #=0D +=0D +=0D class DecDecCommentTestCase(unittest.TestCase):=0D def testDecHeadComment(self):=0D File =3D TmpFile('test.dec')=0D File.Write(=0D - '''# abc=0D + '''# abc=0D ##''')=0D dec =3D Dec('test.dec', False)=0D dec.ParseDecComment()=0D @@ -509,7 +563,7 @@ class DecDecCommentTestCase(unittest.TestCase): def testNoDoubleComment(self):=0D File =3D TmpFile('test.dec')=0D File.Write(=0D - '''# abc=0D + '''# abc=0D #=0D [section_start]''')=0D dec =3D Dec('test.dec', False)=0D @@ -521,8 +575,8 @@ class DecDecCommentTestCase(unittest.TestCase): self.assertEqual(dec._HeadComment[1][1], 2)=0D File.Remove()=0D =0D +=0D if __name__ =3D=3D '__main__':=0D import Logger.Logger=0D Logger.Logger.Initialize()=0D unittest.main()=0D -=0D diff --git a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py b= /BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py index 12e3045f3753..4b707b960fc1 100644 --- a/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py +++ b/BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file contain unit test for Test [Binary] section part of InfParser= =0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,14 +23,14 @@ import Library.GlobalData as Global # Only has 1 element, binary item Type=0D #=0D SectionStringsCommonItem1 =3D \=0D -"""=0D + """=0D GUID=0D """=0D #=0D # Have 2 elements, binary item Type and FileName=0D #=0D SectionStringsCommonItem2 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid=0D """=0D =0D @@ -38,7 +38,7 @@ GUID | Test/Test.guid # Have 3 elements, Type | FileName | Target | Family | TagName | FeatureFl= agExp=0D #=0D SectionStringsCommonItem3 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG=0D """=0D =0D @@ -47,7 +47,7 @@ GUID | Test/Test.guid | DEBUG # Target with MACRO defined in [Define] section=0D #=0D SectionStringsCommonItem4 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | $(TARGET)=0D """=0D =0D @@ -56,7 +56,7 @@ GUID | Test/Test.guid | $(TARGET) # FileName with MACRO defined in [Binary] section=0D #=0D SectionStringsCommonItem5 =3D \=0D -"""=0D + """=0D DEFINE BINARY_FILE_PATH =3D Test=0D GUID | $(BINARY_FILE_PATH)/Test.guid | $(TARGET)=0D """=0D @@ -65,7 +65,7 @@ GUID | $(BINARY_FILE_PATH)/Test.guid | $(TARGET) # Have 4 elements, Type | FileName | Target | Family=0D #=0D SectionStringsCommonItem6 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG | *=0D """=0D =0D @@ -73,7 +73,7 @@ GUID | Test/Test.guid | DEBUG | * # Have 4 elements, Type | FileName | Target | Family=0D #=0D SectionStringsCommonItem7 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG | MSFT=0D """=0D =0D @@ -81,7 +81,7 @@ GUID | Test/Test.guid | DEBUG | MSFT # Have 5 elements, Type | FileName | Target | Family | TagName=0D #=0D SectionStringsCommonItem8 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG | MSFT | TEST=0D """=0D =0D @@ -89,7 +89,7 @@ GUID | Test/Test.guid | DEBUG | MSFT | TEST # Have 6 elements, Type | FileName | Target | Family | TagName | FFE=0D #=0D SectionStringsCommonItem9 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE=0D """=0D =0D @@ -98,28 +98,27 @@ GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE # Test wrong format=0D #=0D SectionStringsCommonItem10 =3D \=0D -"""=0D + """=0D GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE | OVERFLOW=0D """=0D =0D #-------------end of common binary item test input------------------------= ----#=0D =0D =0D -=0D #-------------start of VER type binary item test input--------------------= ----#=0D =0D #=0D # Has 1 element, error format=0D #=0D SectionStringsVerItem1 =3D \=0D -"""=0D + """=0D VER=0D """=0D #=0D # Have 5 elements, error format(Maximum elements amount is 4)=0D #=0D SectionStringsVerItem2 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver | * | TRUE | OverFlow=0D """=0D =0D @@ -127,7 +126,7 @@ VER | Test/Test.ver | * | TRUE | OverFlow # Have 2 elements, Type | FileName=0D #=0D SectionStringsVerItem3 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver=0D """=0D =0D @@ -135,7 +134,7 @@ VER | Test/Test.ver # Have 3 elements, Type | FileName | Target=0D #=0D SectionStringsVerItem4 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver | DEBUG=0D """=0D =0D @@ -143,7 +142,7 @@ VER | Test/Test.ver | DEBUG # Have 4 elements, Type | FileName | Target | FeatureFlagExp=0D #=0D SectionStringsVerItem5 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver | DEBUG | TRUE=0D """=0D =0D @@ -151,7 +150,7 @@ VER | Test/Test.ver | DEBUG | TRUE # Exist 2 VER items, both opened.=0D #=0D SectionStringsVerItem6 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver | * | TRUE=0D VER | Test/Test2.ver | * | TRUE=0D """=0D @@ -161,7 +160,7 @@ VER | Test/Test2.ver | * | TRUE # Exist 2 VER items, only 1 opened.=0D #=0D SectionStringsVerItem7 =3D \=0D -"""=0D + """=0D VER | Test/Test.ver | * | TRUE=0D VER | Test/Test2.ver | * | FALSE=0D """=0D @@ -175,19 +174,19 @@ VER | Test/Test2.ver | * | FALSE # Test only one UI section can exist=0D #=0D SectionStringsUiItem1 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | * | TRUE=0D UI | Test/Test2.ui | * | TRUE=0D """=0D =0D SectionStringsUiItem2 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | * | TRUE=0D SEC_UI | Test/Test2.ui | * | TRUE=0D """=0D =0D SectionStringsUiItem3 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | * | TRUE=0D UI | Test/Test2.ui | * | FALSE=0D """=0D @@ -196,14 +195,14 @@ UI | Test/Test2.ui | * | FALSE # Has 1 element, error format=0D #=0D SectionStringsUiItem4 =3D \=0D -"""=0D + """=0D UI=0D """=0D #=0D # Have 5 elements, error format(Maximum elements amount is 4)=0D #=0D SectionStringsUiItem5 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | * | TRUE | OverFlow=0D """=0D =0D @@ -211,7 +210,7 @@ UI | Test/Test.ui | * | TRUE | OverFlow # Have 2 elements, Type | FileName=0D #=0D SectionStringsUiItem6 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui=0D """=0D =0D @@ -219,7 +218,7 @@ UI | Test/Test.ui # Have 3 elements, Type | FileName | Target=0D #=0D SectionStringsUiItem7 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | DEBUG=0D """=0D =0D @@ -227,7 +226,7 @@ UI | Test/Test.ui | DEBUG # Have 4 elements, Type | FileName | Target | FeatureFlagExp=0D #=0D SectionStringsUiItem8 =3D \=0D -"""=0D + """=0D UI | Test/Test.ui | DEBUG | TRUE=0D """=0D #---------------end of UI type binary item test input---------------------= ----#=0D @@ -238,6 +237,8 @@ gFileName =3D "BinarySectionTest.inf" ##=0D # Construct SectionString for call section parser usage.=0D #=0D +=0D +=0D def StringToSectionString(String):=0D Lines =3D String.split('\n')=0D LineNo =3D 0=0D @@ -250,6 +251,7 @@ def StringToSectionString(String): =0D return SectionString=0D =0D +=0D def PrepareTest(String):=0D SectionString =3D StringToSectionString(String)=0D ItemList =3D []=0D @@ -263,7 +265,7 @@ def PrepareTest(String): #=0D FileName =3D os.path.normpath(os.path.realpath(ValueList[1].st= rip()))=0D try:=0D - TempFile =3D open (FileName, "w")=0D + TempFile =3D open(FileName, "w")=0D TempFile.close()=0D except:=0D print("File Create Error")=0D @@ -277,6 +279,7 @@ def PrepareTest(String): =0D return ItemList=0D =0D +=0D if __name__ =3D=3D '__main__':=0D Logger.Initialize()=0D =0D @@ -290,26 +293,26 @@ if __name__ =3D=3D '__main__': # For All Ui test=0D #=0D UiStringList =3D [=0D - SectionStringsUiItem1,=0D - SectionStringsUiItem2,=0D - SectionStringsUiItem3,=0D - SectionStringsUiItem4,=0D - SectionStringsUiItem5,=0D - SectionStringsUiItem6,=0D - SectionStringsUiItem7,=0D - SectionStringsUiItem8=0D - ]=0D + SectionStringsUiItem1,=0D + SectionStringsUiItem2,=0D + SectionStringsUiItem3,=0D + SectionStringsUiItem4,=0D + SectionStringsUiItem5,=0D + SectionStringsUiItem6,=0D + SectionStringsUiItem7,=0D + SectionStringsUiItem8=0D + ]=0D =0D for Item in UiStringList:=0D Ui =3D PrepareTest(Item)=0D if Item =3D=3D SectionStringsUiItem4 or Item =3D=3D SectionStrings= UiItem5:=0D try:=0D - InfBinariesInstance.SetBinary(Ui =3D Ui, ArchList =3D Arch= List)=0D + InfBinariesInstance.SetBinary(Ui=3DUi, ArchList=3DArchList= )=0D except Logger.FatalError:=0D pass=0D else:=0D try:=0D - InfBinariesInstance.SetBinary(Ui =3D Ui, ArchList =3D Arch= List)=0D + InfBinariesInstance.SetBinary(Ui=3DUi, ArchList=3DArchList= )=0D except:=0D AllPassedFlag =3D False=0D =0D @@ -317,27 +320,27 @@ if __name__ =3D=3D '__main__': # For All Ver Test=0D #=0D VerStringList =3D [=0D - SectionStringsVerItem1,=0D - SectionStringsVerItem2,=0D - SectionStringsVerItem3,=0D - SectionStringsVerItem4,=0D - SectionStringsVerItem5,=0D - SectionStringsVerItem6,=0D - SectionStringsVerItem7=0D - ]=0D + SectionStringsVerItem1,=0D + SectionStringsVerItem2,=0D + SectionStringsVerItem3,=0D + SectionStringsVerItem4,=0D + SectionStringsVerItem5,=0D + SectionStringsVerItem6,=0D + SectionStringsVerItem7=0D + ]=0D for Item in VerStringList:=0D Ver =3D PrepareTest(Item)=0D if Item =3D=3D SectionStringsVerItem1 or \=0D Item =3D=3D SectionStringsVerItem2:=0D =0D try:=0D - InfBinariesInstance.SetBinary(Ver =3D Ver, ArchList =3D Ar= chList)=0D + InfBinariesInstance.SetBinary(Ver=3DVer, ArchList=3DArchLi= st)=0D except:=0D pass=0D =0D else:=0D try:=0D - InfBinariesInstance.SetBinary(Ver =3D Ver, ArchList =3D Ar= chList)=0D + InfBinariesInstance.SetBinary(Ver=3DVer, ArchList=3DArchLi= st)=0D except:=0D AllPassedFlag =3D False=0D =0D @@ -345,17 +348,17 @@ if __name__ =3D=3D '__main__': # For All Common Test=0D #=0D CommonStringList =3D [=0D - SectionStringsCommonItem1,=0D - SectionStringsCommonItem2,=0D - SectionStringsCommonItem3,=0D - SectionStringsCommonItem4,=0D - SectionStringsCommonItem5,=0D - SectionStringsCommonItem6,=0D - SectionStringsCommonItem7,=0D - SectionStringsCommonItem8,=0D - SectionStringsCommonItem9,=0D - SectionStringsCommonItem10=0D - ]=0D + SectionStringsCommonItem1,=0D + SectionStringsCommonItem2,=0D + SectionStringsCommonItem3,=0D + SectionStringsCommonItem4,=0D + SectionStringsCommonItem5,=0D + SectionStringsCommonItem6,=0D + SectionStringsCommonItem7,=0D + SectionStringsCommonItem8,=0D + SectionStringsCommonItem9,=0D + SectionStringsCommonItem10=0D + ]=0D =0D for Item in CommonStringList:=0D CommonBin =3D PrepareTest(Item)=0D @@ -363,19 +366,19 @@ if __name__ =3D=3D '__main__': Item =3D=3D SectionStringsCommonItem1:=0D =0D try:=0D - InfBinariesInstance.SetBinary(CommonBinary =3D CommonBin, = ArchList =3D ArchList)=0D + InfBinariesInstance.SetBinary(=0D + CommonBinary=3DCommonBin, ArchList=3DArchList)=0D except:=0D pass=0D =0D else:=0D try:=0D - InfBinariesInstance.SetBinary(Ver =3D Ver, ArchList =3D Ar= chList)=0D + InfBinariesInstance.SetBinary(Ver=3DVer, ArchList=3DArchLi= st)=0D except:=0D print("Test Failed!")=0D AllPassedFlag =3D False=0D =0D - if AllPassedFlag :=0D + if AllPassedFlag:=0D print('All tests passed...')=0D else:=0D print('Some unit test failed!')=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Xml/CommonXml.py b/BaseTools/Sourc= e/Python/UPT/Xml/CommonXml.py index cfadacf4aaaf..d7dc8435d1a2 100644 --- a/BaseTools/Source/Python/UPT/Xml/CommonXml.py +++ b/BaseTools/Source/Python/UPT/Xml/CommonXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a PCD file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -41,6 +41,8 @@ import Library.DataType as DataType ##=0D # ClonedFromXml=0D #=0D +=0D +=0D class ClonedFromXml(object):=0D def __init__(self):=0D self.GUID =3D ''=0D @@ -85,9 +87,11 @@ class CommonDefinesXml(object): pass=0D self.Usage =3D XmlAttribute(Item, 'Usage')=0D self.SupArchList =3D \=0D - [Arch for Arch in GetSplitValueList(XmlAttribute(Item, 'SupArchLis= t'), DataType.TAB_SPACE_SPLIT) if Arch]=0D + [Arch for Arch in GetSplitValueList(XmlAttribute(=0D + Item, 'SupArchList'), DataType.TAB_SPACE_SPLIT) if Arch]=0D self.SupModList =3D \=0D - [Mod for Mod in GetSplitValueList(XmlAttribute(Item, 'SupModList')= , DataType.TAB_SPACE_SPLIT) if Mod]=0D + [Mod for Mod in GetSplitValueList(XmlAttribute(=0D + Item, 'SupModList'), DataType.TAB_SPACE_SPLIT) if Mod]=0D self.FeatureFlag =3D ConvertNOTEQToNE(XmlAttribute(Item, 'FeatureF= lag'))=0D =0D def ToXml(self):=0D @@ -95,11 +99,13 @@ class CommonDefinesXml(object): =0D def __str__(self):=0D return "Usage =3D %s SupArchList =3D %s SupModList =3D %s FeatureF= lag =3D %s" \=0D - % (self.Usage, self.SupArchList, self.SupModList, self.Fea= tureFlag)=0D + % (self.Usage, self.SupArchList, self.SupModList, self.Feature= Flag)=0D =0D ##=0D # PromptXml=0D #=0D +=0D +=0D class PromptXml(object):=0D def __init__(self):=0D self.Prompt =3D ''=0D @@ -115,12 +121,15 @@ class PromptXml(object): if self.Prompt:=0D pass=0D return CreateXmlElement('%s' % Key, Prompt.GetString(), [], [['Lan= g', Prompt.GetLang()]])=0D +=0D def __str__(self):=0D return "Prompt =3D %s Lang =3D %s" % (self.Prompt, self.Lang)=0D =0D ##=0D # HelpTextXml=0D #=0D +=0D +=0D class HelpTextXml(object):=0D def __init__(self):=0D self.HelpText =3D ''=0D @@ -136,12 +145,15 @@ class HelpTextXml(object): if self.HelpText:=0D pass=0D return CreateXmlElement('%s' % Key, HelpText.GetString(), [], [['L= ang', HelpText.GetLang()]])=0D +=0D def __str__(self):=0D return "HelpText =3D %s Lang =3D %s" % (self.HelpText, self.Lang)= =0D =0D ##=0D # HeaderXml=0D #=0D +=0D +=0D class HeaderXml(object):=0D def __init__(self):=0D self.Name =3D ''=0D @@ -159,26 +171,32 @@ class HeaderXml(object): if IsStandAlongModule:=0D XmlTreeLevel =3D ['DistributionPackage', 'ModuleSurfaceAre= a']=0D else:=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceAr= ea', 'ModuleSurfaceArea']=0D - CheckDict =3D {'Header':''}=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'ModuleSurfaceArea']= =0D + CheckDict =3D {'Header': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D self.Name =3D XmlElement(Item, '%s/Name' % Key)=0D - self.BaseName =3D XmlAttribute(XmlNode(Item, '%s/Name' % Key), 'Ba= seName')=0D + self.BaseName =3D XmlAttribute(=0D + XmlNode(Item, '%s/Name' % Key), 'BaseName')=0D self.GUID =3D XmlElement(Item, '%s/GUID' % Key)=0D self.Version =3D XmlAttribute(XmlNode(Item, '%s/GUID' % Key), 'Ver= sion')=0D =0D for SubItem in XmlList(Item, '%s/Abstract' % Key):=0D HeaderAbstractLang =3D XmlAttribute(SubItem, 'Lang')=0D - self.AbstractList.append((HeaderAbstractLang, XmlElement(SubIt= em, '%s/Abstract' % Key)))=0D + self.AbstractList.append(=0D + (HeaderAbstractLang, XmlElement(SubItem, '%s/Abstract' % K= ey)))=0D for SubItem in XmlList(Item, '%s/Description' % Key):=0D HeaderDescriptionLang =3D XmlAttribute(SubItem, 'Lang')=0D - self.DescriptionList.append((HeaderDescriptionLang, XmlElement= (SubItem, '%s/Description' % Key)))=0D + self.DescriptionList.append(=0D + (HeaderDescriptionLang, XmlElement(SubItem, '%s/Descriptio= n' % Key)))=0D for SubItem in XmlList(Item, '%s/Copyright' % Key):=0D HeaderCopyrightLang =3D XmlAttribute(SubItem, 'Lang')=0D - self.CopyrightList.append((HeaderCopyrightLang, XmlElement(Sub= Item, '%s/Copyright' % Key)))=0D + self.CopyrightList.append(=0D + (HeaderCopyrightLang, XmlElement(SubItem, '%s/Copyright' %= Key)))=0D for SubItem in XmlList(Item, '%s/License' % Key):=0D HeaderLicenseLang =3D XmlAttribute(SubItem, 'Lang')=0D - self.LicenseList.append((HeaderLicenseLang, XmlElement(SubItem= , '%s/License' % Key)))=0D + self.LicenseList.append(=0D + (HeaderLicenseLang, XmlElement(SubItem, '%s/License' % Key= )))=0D ModuleHeader =3D ModuleObject()=0D ModuleHeader.SetName(self.Name)=0D ModuleHeader.SetBaseName(self.BaseName)=0D @@ -193,8 +211,10 @@ class HeaderXml(object): def ToXml(self, Header, Key):=0D if self.GUID:=0D pass=0D - Element1 =3D CreateXmlElement('Name', Header.GetName(), [], [['Bas= eName', Header.GetBaseName()]])=0D - Element2 =3D CreateXmlElement('GUID', Header.GetGuid(), [], [['Ver= sion', Header.GetVersion()]])=0D + Element1 =3D CreateXmlElement('Name', Header.GetName(), [], [=0D + ['BaseName', Header.GetBaseName()]])=0D + Element2 =3D CreateXmlElement('GUID', Header.GetGuid(), [], [=0D + ['Version', Header.GetVersion()]])=0D NodeList =3D [Element1,=0D Element2,=0D ]=0D @@ -226,10 +246,12 @@ class HeaderXml(object): NodeList.append(CreateXmlElement('License', Value, [], [])= )=0D for (Lang, Value) in Header.GetAbstract() + UNIInfAbstractList:=0D if Value:=0D - NodeList.append(CreateXmlElement('Abstract', Value, [], [[= 'Lang', Lang]]))=0D + NodeList.append(CreateXmlElement(=0D + 'Abstract', Value, [], [['Lang', Lang]]))=0D for (Lang, Value) in Header.GetDescription() + UNIInfDescriptionLi= st:=0D if Value:=0D - NodeList.append(CreateXmlElement('Description', Value, [],= [['Lang', Lang]]))=0D + NodeList.append(CreateXmlElement(=0D + 'Description', Value, [], [['Lang', Lang]]))=0D =0D AttributeList =3D []=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, AttributeList)= =0D @@ -238,11 +260,13 @@ class HeaderXml(object): def __str__(self):=0D return "Name =3D %s BaseName =3D %s GUID =3D %s Version =3D %s Cop= yright =3D %s \=0D License =3D %s Abstract =3D %s Description =3D %s" % \=0D - (self.Name, self.BaseName, self.GUID, self.Version, self.Copyright= List, \=0D - self.LicenseList, self.AbstractList, self.DescriptionList)=0D + (self.Name, self.BaseName, self.GUID, self.Version, self.Copyr= ightList,=0D + self.LicenseList, self.AbstractList, self.DescriptionList)=0D ##=0D # DistributionPackageHeaderXml=0D #=0D +=0D +=0D class DistributionPackageHeaderXml(object):=0D def __init__(self):=0D self.Header =3D HeaderXml()=0D @@ -289,19 +313,21 @@ class DistributionPackageHeaderXml(object): def ToXml(self, DistributionPackageHeader, Key):=0D if self.Header:=0D pass=0D - Element1 =3D CreateXmlElement('Name', \=0D - DistributionPackageHeader.GetName(), [= ], \=0D - [['BaseName', \=0D - DistributionPackageHeader.GetBaseName(= )]])=0D - Element2 =3D CreateXmlElement('GUID', \=0D - DistributionPackageHeader.GetGuid(), [= ], \=0D - [['Version', \=0D - DistributionPackageHeader.GetVersion()= ]])=0D + Element1 =3D CreateXmlElement('Name',=0D + DistributionPackageHeader.GetName(), [= ],=0D + [['BaseName',=0D + DistributionPackageHeader.GetBaseNam= e()]])=0D + Element2 =3D CreateXmlElement('GUID',=0D + DistributionPackageHeader.GetGuid(), [= ],=0D + [['Version',=0D + DistributionPackageHeader.GetVersion= ()]])=0D AttributeList =3D []=0D if DistributionPackageHeader.ReadOnly !=3D '':=0D - AttributeList.append(['ReadOnly', str(DistributionPackageHeade= r.ReadOnly).lower()])=0D + AttributeList.append(=0D + ['ReadOnly', str(DistributionPackageHeader.ReadOnly).lower= ()])=0D if DistributionPackageHeader.RePackage !=3D '':=0D - AttributeList.append(['RePackage', str(DistributionPackageHead= er.RePackage).lower()])=0D + AttributeList.append(=0D + ['RePackage', str(DistributionPackageHeader.RePackage).low= er()])=0D if DistributionPackageHeader.GetAbstract():=0D DPAbstract =3D DistributionPackageHeader.GetAbstract()[0][1]=0D else:=0D @@ -327,7 +353,7 @@ class DistributionPackageHeaderXml(object): ['Abstract', DPAbstract],=0D ['Description', DPDescription],=0D ['Signature', DistributionPackageHeader.Signature],=0D - ['XmlSpecification', \=0D + ['XmlSpecification',=0D DistributionPackageHeader.XmlSpecification],=0D ]=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, AttributeList)= =0D @@ -336,11 +362,13 @@ class DistributionPackageHeaderXml(object): def __str__(self):=0D return "ReadOnly =3D %s RePackage =3D %s Vendor =3D %s Date =3D %s= \=0D Signature =3D %s XmlSpecification =3D %s %s" % \=0D - (self.ReadOnly, self.RePackage, self.Vendor, self.Date, \=0D - self.Signature, self.XmlSpecification, self.Header)=0D + (self.ReadOnly, self.RePackage, self.Vendor, self.Date,=0D + self.Signature, self.XmlSpecification, self.Header)=0D ##=0D # PackageHeaderXml=0D #=0D +=0D +=0D class PackageHeaderXml(object):=0D def __init__(self):=0D self.Header =3D HeaderXml()=0D @@ -366,9 +394,9 @@ class PackageHeaderXml(object): def ToXml(self, PackageObject2, Key):=0D if self.PackagePath:=0D pass=0D - Element1 =3D CreateXmlElement('Name', PackageObject2.GetName(), []= , \=0D - [['BaseName', PackageObject2.GetBaseName()]])=0D - Element2 =3D CreateXmlElement('GUID', PackageObject2.GetGuid(), []= , \=0D + Element1 =3D CreateXmlElement('Name', PackageObject2.GetName(), []= ,=0D + [['BaseName', PackageObject2.GetBaseNa= me()]])=0D + Element2 =3D CreateXmlElement('GUID', PackageObject2.GetGuid(), []= ,=0D [['Version', PackageObject2.GetVersion= ()]])=0D NodeList =3D [Element1,=0D Element2=0D @@ -395,17 +423,20 @@ class PackageHeaderXml(object): # Get Abstract and Description from DEC File Header=0D for (Lang, Value) in PackageObject2.GetCopyright():=0D if Value:=0D - NodeList.append(CreateXmlElement(DataType.TAB_HEADER_COPYR= IGHT, Value, [], []))=0D + NodeList.append(CreateXmlElement(=0D + DataType.TAB_HEADER_COPYRIGHT, Value, [], []))=0D for (Lang, Value) in PackageObject2.GetLicense():=0D if Value:=0D - NodeList.append(CreateXmlElement(DataType.TAB_HEADER_LICEN= SE, Value, [], []))=0D + NodeList.append(CreateXmlElement(=0D + DataType.TAB_HEADER_LICENSE, Value, [], []))=0D for (Lang, Value) in PackageObject2.GetAbstract() + UNIPackageAbrs= tractList:=0D if Value:=0D - NodeList.append(CreateXmlElement(DataType.TAB_HEADER_ABSTR= ACT, Value, [], [['Lang', Lang]]))=0D + NodeList.append(CreateXmlElement(=0D + DataType.TAB_HEADER_ABSTRACT, Value, [], [['Lang', Lan= g]]))=0D for (Lang, Value) in PackageObject2.GetDescription() + UNIPackageD= escriptionList:=0D if Value:=0D - NodeList.append(CreateXmlElement(DataType.TAB_HEADER_DESCR= IPTION, Value, [], [['Lang', Lang]]))=0D -=0D + NodeList.append(CreateXmlElement(=0D + DataType.TAB_HEADER_DESCRIPTION, Value, [], [['Lang', = Lang]]))=0D =0D NodeList.append(['PackagePath', PackageObject2.GetPackagePath()])= =0D AttributeList =3D []=0D @@ -419,6 +450,8 @@ class PackageHeaderXml(object): ##=0D # MiscellaneousFileXml=0D #=0D +=0D +=0D class MiscellaneousFileXml(object):=0D def __init__(self):=0D self.Header =3D HeaderXml()=0D @@ -426,6 +459,7 @@ class MiscellaneousFileXml(object): ##=0D # This API is used for Package or Module's MiscellaneousFile section=0D #=0D +=0D def FromXml(self, Item, Key):=0D if not Item:=0D return None=0D @@ -434,7 +468,8 @@ class MiscellaneousFileXml(object): self.Header.FromXml(NewItem, 'Header')=0D for SubItem in XmlList(Item, '%s/Filename' % Key):=0D Filename =3D XmlElement(SubItem, '%s/Filename' % Key)=0D - Executable =3D XmlAttribute(XmlNode(SubItem, '%s/Filename' % K= ey), 'Executable')=0D + Executable =3D XmlAttribute(=0D + XmlNode(SubItem, '%s/Filename' % Key), 'Executable')=0D if Executable.upper() =3D=3D "TRUE":=0D Executable =3D True=0D elif Executable.upper() =3D=3D "FALSE":=0D @@ -458,6 +493,7 @@ class MiscellaneousFileXml(object): ##=0D # This API is used for DistP's tool section=0D #=0D +=0D def FromXml2(self, Item, Key):=0D if Item is None:=0D return None=0D @@ -466,7 +502,8 @@ class MiscellaneousFileXml(object): for SubItem in XmlList(Item, '%s/Filename' % Key):=0D Filename =3D XmlElement(SubItem, '%s/Filename' % Key)=0D Executable =3D \=0D - XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'Executabl= e')=0D + XmlAttribute(XmlNode(SubItem, '%s/Filename' %=0D + Key), 'Executable')=0D OsType =3D XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key),= 'OS')=0D if Executable.upper() =3D=3D "TRUE":=0D Executable =3D True=0D @@ -518,17 +555,17 @@ class MiscellaneousFileXml(object): ['License', DPLicense],=0D ['Abstract', DPAbstract],=0D ['Description', DPDescription],=0D - ]=0D + ]=0D for File in MiscFile.GetFileList():=0D - NodeList.append\=0D - (CreateXmlElement\=0D - ('Filename', File.GetURI(), [], \=0D - [['Executable', str(File.GetExecutable()).lower()]]))=0D + NodeList.append(CreateXmlElement=0D + ('Filename', File.GetURI(), [],=0D + [['Executable', str(File.GetExecutable())= .lower()]]))=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, [])=0D return Root=0D ##=0D # This API is used for DistP's tool section=0D #=0D +=0D def ToXml2(self, MiscFile, Key):=0D if self.Header:=0D pass=0D @@ -554,15 +591,14 @@ class MiscellaneousFileXml(object): ['License', DPLicense],=0D ['Abstract', DPAbstract],=0D ['Description', DPDescription],=0D - ]=0D + ]=0D HeaderNode =3D CreateXmlElement('Header', '', NodeList, [])=0D NodeList =3D [HeaderNode]=0D for File in MiscFile.GetFileList():=0D - NodeList.append\=0D - (CreateXmlElement\=0D - ('Filename', File.GetURI(), [], \=0D - [['Executable', str(File.GetExecutable()).lower()], \=0D - ['OS', File.GetOS()]]))=0D + NodeList.append(CreateXmlElement=0D + ('Filename', File.GetURI(), [],=0D + [['Executable', str(File.GetExecutable())= .lower()],=0D + ['OS', File.GetOS()]]))=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, [])=0D return Root=0D =0D @@ -574,6 +610,8 @@ class MiscellaneousFileXml(object): ##=0D # UserExtensionsXml=0D #=0D +=0D +=0D class UserExtensionsXml(object):=0D def __init__(self):=0D self.UserId =3D ''=0D @@ -605,22 +643,23 @@ class UserExtensionsXml(object): self.UserId =3D XmlAttribute(XmlNode(Item, '%s' % Key), 'UserId')= =0D self.Identifier =3D XmlAttribute(XmlNode(Item, '%s' % Key), 'Ident= ifier')=0D if self.UserId =3D=3D DataType.TAB_BINARY_HEADER_USERID \=0D - and self.Identifier =3D=3D DataType.TAB_BINARY_HEADER_IDENTIFIER:= =0D + and self.Identifier =3D=3D DataType.TAB_BINARY_HEADER_IDEN= TIFIER:=0D for SubItem in XmlList(Item, '%s/BinaryAbstract' % Key):=0D BinaryAbstractLang =3D XmlAttribute(SubItem, 'Lang')=0D - self.BinaryAbstractList.append((BinaryAbstractLang, XmlEle= ment(SubItem, '%s/BinaryAbstract' % Key)))=0D + self.BinaryAbstractList.append(=0D + (BinaryAbstractLang, XmlElement(SubItem, '%s/BinaryAbs= tract' % Key)))=0D for SubItem in XmlList(Item, '%s/BinaryDescription' % Key):=0D BinaryDescriptionLang =3D XmlAttribute(SubItem, 'Lang')=0D self.BinaryDescriptionList.append((BinaryDescriptionLang,= =0D - XmlElement(SubItem,= '%s/BinaryDescription' % Key)))=0D + XmlElement(SubItem, '%s= /BinaryDescription' % Key)))=0D for SubItem in XmlList(Item, '%s/BinaryCopyright' % Key):=0D BinaryCopyrightLang =3D XmlAttribute(SubItem, 'Lang')=0D self.BinaryCopyrightList.append((BinaryCopyrightLang,=0D - XmlElement(SubItem, '= %s/BinaryCopyright' % Key)))=0D + XmlElement(SubItem, '%s/B= inaryCopyright' % Key)))=0D for SubItem in XmlList(Item, '%s/BinaryLicense' % Key):=0D BinaryLicenseLang =3D XmlAttribute(SubItem, 'Lang')=0D self.BinaryLicenseList.append((BinaryLicenseLang,=0D - XmlElement(SubItem, '%s= /BinaryLicense' % Key)))=0D + XmlElement(SubItem, '%s/Bin= aryLicense' % Key)))=0D =0D DefineItem =3D XmlNode(Item, '%s/Define' % Key)=0D for SubItem in XmlList(DefineItem, 'Define/Statement'):=0D @@ -629,12 +668,14 @@ class UserExtensionsXml(object): BuildOptionItem =3D XmlNode(Item, '%s/BuildOption' % Key)=0D for SubItem in XmlList(BuildOptionItem, 'BuildOption/Statement'):= =0D Statement =3D XmlElement(SubItem, '%s/Statement' % Key)=0D - Arch =3D XmlAttribute(XmlNode(SubItem, '%s/Statement' % Key), = 'SupArchList')=0D + Arch =3D XmlAttribute(=0D + XmlNode(SubItem, '%s/Statement' % Key), 'SupArchList')=0D self.BuildOptionDict[Arch] =3D Statement=0D IncludesItem =3D XmlNode(Item, '%s/Includes' % Key)=0D for SubItem in XmlList(IncludesItem, 'Includes/Statement'):=0D Statement =3D XmlElement(SubItem, '%s/Statement' % Key)=0D - Arch =3D XmlAttribute(XmlNode(SubItem, '%s/Statement' % Key), = 'SupArchList')=0D + Arch =3D XmlAttribute(=0D + XmlNode(SubItem, '%s/Statement' % Key), 'SupArchList')=0D self.IncludesDict[Statement] =3D Arch=0D SourcesItem =3D XmlNode(Item, '%s/Sources' % Key)=0D Tmp =3D UserExtensionSourceXml()=0D @@ -646,7 +687,8 @@ class UserExtensionsXml(object): self.BinariesDict =3D BinariesDict=0D self.Statement =3D XmlElement(Item, 'UserExtensions')=0D SupArch =3D XmlAttribute(XmlNode(Item, '%s' % Key), 'SupArchList')= =0D - self.SupArchList =3D [Arch for Arch in GetSplitValueList(SupArch, = DataType.TAB_SPACE_SPLIT) if Arch]=0D + self.SupArchList =3D [Arch for Arch in GetSplitValueList(=0D + SupArch, DataType.TAB_SPACE_SPLIT) if Arch]=0D UserExtension =3D UserExtensionObject()=0D UserExtension.SetUserID(self.UserId)=0D UserExtension.SetIdentifier(self.Identifier)=0D @@ -668,35 +710,39 @@ class UserExtensionsXml(object): pass=0D AttributeList =3D [['UserId', str(UserExtension.GetUserID())],=0D ['Identifier', str(UserExtension.GetIdentifier())= ],=0D - ['SupArchList', \=0D + ['SupArchList',=0D GetStringOfList(UserExtension.GetSupArchList())]= ,=0D - ]=0D - Root =3D CreateXmlElement('%s' % Key, UserExtension.GetStatement()= , [], \=0D - AttributeList)=0D + ]=0D + Root =3D CreateXmlElement('%s' % Key, UserExtension.GetStatement()= , [],=0D + AttributeList)=0D if UserExtension.GetIdentifier() =3D=3D DataType.TAB_BINARY_HEADER= _IDENTIFIER and \=0D - UserExtension.GetUserID() =3D=3D DataType.TAB_BINARY_HEADER_USERID= :=0D + UserExtension.GetUserID() =3D=3D DataType.TAB_BINARY_HEADE= R_USERID:=0D for (Lang, Value) in UserExtension.GetBinaryAbstract():=0D if Value:=0D - ChildElement =3D CreateXmlElement('BinaryAbstract', Va= lue, [], [['Lang', Lang]])=0D + ChildElement =3D CreateXmlElement(=0D + 'BinaryAbstract', Value, [], [['Lang', Lang]])=0D Root.appendChild(ChildElement)=0D for (Lang, Value) in UserExtension.GetBinaryDescription():=0D if Value:=0D - ChildElement =3D CreateXmlElement('BinaryDescription',= Value, [], [['Lang', Lang]])=0D + ChildElement =3D CreateXmlElement(=0D + 'BinaryDescription', Value, [], [['Lang', Lang]])= =0D Root.appendChild(ChildElement)=0D for (Lang, Value) in UserExtension.GetBinaryCopyright():=0D if Value:=0D - ChildElement =3D CreateXmlElement('BinaryCopyright', V= alue, [], [])=0D + ChildElement =3D CreateXmlElement(=0D + 'BinaryCopyright', Value, [], [])=0D Root.appendChild(ChildElement)=0D for (Lang, Value) in UserExtension.GetBinaryLicense():=0D if Value:=0D - ChildElement =3D CreateXmlElement('BinaryLicense', Val= ue, [], [])=0D + ChildElement =3D CreateXmlElement(=0D + 'BinaryLicense', Value, [], [])=0D Root.appendChild(ChildElement)=0D =0D NodeList =3D []=0D DefineDict =3D UserExtension.GetDefinesDict()=0D if DefineDict:=0D for Item in DefineDict.keys():=0D - NodeList.append(CreateXmlElement\=0D + NodeList.append(CreateXmlElement=0D ('Statement', Item, [], []))=0D DefineElement =3D CreateXmlElement('Define', '', NodeList, [])= =0D Root.appendChild(DefineElement)=0D @@ -704,18 +750,18 @@ class UserExtensionsXml(object): BuildOptionDict =3D UserExtension.GetBuildOptionDict()=0D if BuildOptionDict:=0D for Item in BuildOptionDict.keys():=0D - NodeList.append(CreateXmlElement\=0D - ('Statement', BuildOptionDict[Item], [], \= =0D + NodeList.append(CreateXmlElement=0D + ('Statement', BuildOptionDict[Item], [],=0D [['SupArchList', Item]]))=0D BuildOptionElement =3D \=0D - CreateXmlElement('BuildOption', '', NodeList, [])=0D + CreateXmlElement('BuildOption', '', NodeList, [])=0D Root.appendChild(BuildOptionElement)=0D NodeList =3D []=0D IncludesDict =3D UserExtension.GetIncludesDict()=0D if IncludesDict:=0D for Item in IncludesDict.keys():=0D - NodeList.append(CreateXmlElement\=0D - ('Statement', Item, [], \=0D + NodeList.append(CreateXmlElement=0D + ('Statement', Item, [],=0D [['SupArchList', IncludesDict[Item]]]))=0D IncludesElement =3D CreateXmlElement('Includes', '', NodeList,= [])=0D Root.appendChild(IncludesElement)=0D @@ -740,6 +786,8 @@ class UserExtensionsXml(object): ##=0D # UserExtensionSourceXml=0D #=0D +=0D +=0D class UserExtensionSourceXml(object):=0D def __init__(self):=0D self.UserExtensionSource =3D ''=0D @@ -758,13 +806,13 @@ class UserExtensionSourceXml(object): SupArchStr =3D XmlElement(SubItem, 'SourceFile/SupArchList')=0D DictKey =3D (FileName, Family, FeatureFlag, SupArchStr)=0D ValueList =3D []=0D - for ValueNodeItem in XmlList(SubItem, \=0D + for ValueNodeItem in XmlList(SubItem,=0D 'SourceFile/SourceFileOtherAttr')= :=0D - TagName =3D XmlElement(ValueNodeItem, \=0D + TagName =3D XmlElement(ValueNodeItem,=0D 'SourceFileOtherAttr/TagName')=0D - ToolCode =3D XmlElement(ValueNodeItem, \=0D + ToolCode =3D XmlElement(ValueNodeItem,=0D 'SourceFileOtherAttr/ToolCode')=0D - Comment =3D XmlElement(ValueNodeItem, \=0D + Comment =3D XmlElement(ValueNodeItem,=0D 'SourceFileOtherAttr/Comment')=0D if (TagName =3D=3D ' ') and (ToolCode =3D=3D ' ') and (Com= ment =3D=3D ' '):=0D TagName =3D ''=0D @@ -795,10 +843,10 @@ class UserExtensionSourceXml(object): ValueNodeList.append(["TagName", TagName])=0D ValueNodeList.append(["ToolCode", ToolCode])=0D ValueNodeList.append(["Comment", Comment])=0D - ValueNodeXml =3D CreateXmlElement('SourceFileOtherAttr', '= ', \=0D + ValueNodeXml =3D CreateXmlElement('SourceFileOtherAttr', '= ',=0D ValueNodeList, [])=0D SourceFileNodeList.append(ValueNodeXml)=0D - SourceFileNodeXml =3D CreateXmlElement('SourceFile', '', \=0D + SourceFileNodeXml =3D CreateXmlElement('SourceFile', '',=0D SourceFileNodeList, [])=0D SourcesNodeList.append(SourceFileNodeXml)=0D Root =3D CreateXmlElement('%s' % Key, '', SourcesNodeList, [])=0D @@ -807,6 +855,8 @@ class UserExtensionSourceXml(object): ##=0D # UserExtensionBinaryXml=0D #=0D +=0D +=0D class UserExtensionBinaryXml(object):=0D def __init__(self):=0D self.UserExtensionBinary =3D ''=0D @@ -824,15 +874,15 @@ class UserExtensionBinaryXml(object): SupArch =3D XmlElement(SubItem, 'Binary/SupArchList')=0D DictKey =3D (FileName, FileType, ConvertNOTEQToNE(FFE), SupArc= h)=0D ValueList =3D []=0D - for ValueNodeItem in XmlList(SubItem, \=0D + for ValueNodeItem in XmlList(SubItem,=0D 'Binary/BinaryFileOtherAttr'):=0D - Target =3D XmlElement(ValueNodeItem, \=0D + Target =3D XmlElement(ValueNodeItem,=0D 'BinaryFileOtherAttr/Target')=0D - Family =3D XmlElement(ValueNodeItem, \=0D + Family =3D XmlElement(ValueNodeItem,=0D 'BinaryFileOtherAttr/Family')=0D - TagName =3D XmlElement(ValueNodeItem, \=0D + TagName =3D XmlElement(ValueNodeItem,=0D 'BinaryFileOtherAttr/TagName')=0D - Comment =3D XmlElement(ValueNodeItem, \=0D + Comment =3D XmlElement(ValueNodeItem,=0D 'BinaryFileOtherAttr/Comment')=0D if (Target =3D=3D ' ') and (Family =3D=3D ' ') and \=0D (TagName =3D=3D ' ') and (Comment =3D=3D ' '):=0D @@ -868,7 +918,7 @@ class UserExtensionBinaryXml(object): ValueNodeList.append(["Family", Family])=0D ValueNodeList.append(["TagName", TagName])=0D ValueNodeList.append(["Comment", Comment])=0D - ValueNodeXml =3D CreateXmlElement('BinaryFileOtherAttr', '= ', \=0D + ValueNodeXml =3D CreateXmlElement('BinaryFileOtherAttr', '= ',=0D ValueNodeList, [])=0D FileNodeList.append(ValueNodeXml)=0D FileNodeXml =3D CreateXmlElement('Binary', '', FileNodeList, [= ])=0D @@ -879,6 +929,8 @@ class UserExtensionBinaryXml(object): ##=0D # LibraryClassXml=0D #=0D +=0D +=0D class LibraryClassXml(object):=0D def __init__(self):=0D self.Keyword =3D ''=0D @@ -905,7 +957,8 @@ class LibraryClassXml(object): LibraryClass.SetUsage(self.CommonDefines.Usage)=0D LibraryClass.SetSupArchList(self.CommonDefines.SupArchList)=0D LibraryClass.SetSupModuleList(self.CommonDefines.SupModList)=0D - LibraryClass.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.Fe= atureFlag))=0D + LibraryClass.SetFeatureFlag(=0D + ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))=0D LibraryClass.SetHelpTextList(GetHelpTextList(self.HelpText))=0D return LibraryClass=0D =0D @@ -913,10 +966,11 @@ class LibraryClassXml(object): if self.HeaderFile:=0D pass=0D AttributeList =3D \=0D - [['Keyword', LibraryClass.GetLibraryClass()],=0D - ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())],= =0D - ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())]= =0D - ]=0D + [['Keyword', LibraryClass.GetLibraryClass()],=0D + ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList()= )],=0D + ['SupModList', GetStringOfList(=0D + LibraryClass.GetSupModuleList())]=0D + ]=0D NodeList =3D [['HeaderFile', LibraryClass.GetIncludeHeader()]]=0D for Item in LibraryClass.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -929,11 +983,12 @@ class LibraryClassXml(object): pass=0D FeatureFlag =3D ConvertNEToNOTEQ(LibraryClass.GetFeatureFlag())=0D AttributeList =3D \=0D - [['Usage', LibraryClass.GetUsage()], \=0D - ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList())], = \=0D - ['SupModList', GetStringOfList(LibraryClass.GetSupModuleList())],= \=0D - ['FeatureFlag', FeatureFlag]=0D - ]=0D + [['Usage', LibraryClass.GetUsage()],=0D + ['SupArchList', GetStringOfList(LibraryClass.GetSupArchList()= )],=0D + ['SupModList', GetStringOfList(=0D + LibraryClass.GetSupModuleList())],=0D + ['FeatureFlag', FeatureFlag]=0D + ]=0D NodeList =3D [['Keyword', LibraryClass.GetLibraryClass()], ]=0D for Item in LibraryClass.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -943,8 +998,8 @@ class LibraryClassXml(object): =0D def __str__(self):=0D Str =3D "Keyword =3D %s HeaderFile =3D %s RecommendedInstanceGuid = =3D %s RecommendedInstanceVersion =3D %s %s" % \=0D - (self.Keyword, self.HeaderFile, self.RecommendedInstanceGuid= , self.RecommendedInstanceVersion, \=0D - self.CommonDefines)=0D + (self.Keyword, self.HeaderFile, self.RecommendedInstanceGuid= , self.RecommendedInstanceVersion,=0D + self.CommonDefines)=0D for Item in self.HelpText:=0D Str =3D Str + "\n\t" + str(Item)=0D return Str=0D @@ -952,6 +1007,8 @@ class LibraryClassXml(object): ##=0D # FilenameXml=0D #=0D +=0D +=0D class FilenameXml(object):=0D def __init__(self):=0D self.FileType =3D ''=0D @@ -982,16 +1039,18 @@ class FilenameXml(object): def ToXml(self, Filename, Key):=0D if self.Filename:=0D pass=0D - AttributeList =3D [['SupArchList', \=0D + AttributeList =3D [['SupArchList',=0D GetStringOfList(Filename.GetSupArchList())],=0D ['FileType', Filename.GetFileType()],=0D - ['FeatureFlag', ConvertNEToNOTEQ(Filename.GetFeat= ureFlag())],=0D + ['FeatureFlag', ConvertNEToNOTEQ(=0D + Filename.GetFeatureFlag())],=0D ['GUID', Filename.GetGuidValue()]=0D - ]=0D - Root =3D CreateXmlElement('%s' % Key, Filename.GetFilename(), [], = AttributeList)=0D + ]=0D + Root =3D CreateXmlElement(=0D + '%s' % Key, Filename.GetFilename(), [], AttributeList)=0D =0D return Root=0D =0D def __str__(self):=0D return "FileType =3D %s Filename =3D %s %s" \=0D - % (self.FileType, self.Filename, self.CommonDefines)=0D + % (self.FileType, self.Filename, self.CommonDefines)=0D diff --git a/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py b/BaseTo= ols/Source/Python/UPT/Xml/GuidProtocolPpiXml.py index d6645fc23cf0..dbfc6876c1c7 100644 --- a/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py +++ b/BaseTools/Source/Python/UPT/Xml/GuidProtocolPpiXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a xml file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -28,8 +28,10 @@ from Xml.CommonXml import HelpTextXml from Xml.XmlParserMisc import GetHelpTextList=0D =0D ##=0D -#GUID/Protocol/Ppi Common=0D +# GUID/Protocol/Ppi Common=0D #=0D +=0D +=0D class GuidProtocolPpiXml(object):=0D def __init__(self, Mode):=0D self.UiName =3D ''=0D @@ -78,18 +80,22 @@ class GuidProtocolPpiXml(object): if self.GuidValue:=0D pass=0D AttributeList =3D \=0D - [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \=0D - ['UiName', GuidProtocolPpi.GetName()], \=0D - ['GuidType', GetStringOfList(GuidProtocolPpi.GetGuidTypeList())],= \=0D - ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \=0D - ['SupArchList', GetStringOfList(GuidProtocolPpi.GetSupArchList())= ], \=0D - ['SupModList', GetStringOfList(GuidProtocolPpi.GetSupModuleList()= )], \=0D - ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureFlag()= )]=0D - ]=0D + [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())],=0D + ['UiName', GuidProtocolPpi.GetName()],=0D + ['GuidType', GetStringOfList(=0D + GuidProtocolPpi.GetGuidTypeList())],=0D + ['Notify', str(GuidProtocolPpi.GetNotify()).lower()],=0D + ['SupArchList', GetStringOfList(=0D + GuidProtocolPpi.GetSupArchList())],=0D + ['SupModList', GetStringOfList(=0D + GuidProtocolPpi.GetSupModuleList())],=0D + ['FeatureFlag', ConvertNEToNOTEQ(=0D + GuidProtocolPpi.GetFeatureFlag())]=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D ['GuidValue', GuidProtocolPpi.GetGuid()],=0D ['VariableName', GuidProtocolPpi.VariableName]=0D - ]=0D + ]=0D for Item in GuidProtocolPpi.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D NodeList.append(Tmp.ToXml(Item))=0D @@ -99,15 +105,17 @@ class GuidProtocolPpiXml(object): =0D def __str__(self):=0D Str =3D \=0D - "UiName =3D %s Notify =3D %s GuidTypes =3D %s CName =3D %s GuidVal= ue =3D %s %s" \=0D - % (self.UiName, self.Notify, self.GuidTypes, self.CName, \=0D - self.GuidValue, self.CommonDefines)=0D + "UiName =3D %s Notify =3D %s GuidTypes =3D %s CName =3D %s Gui= dValue =3D %s %s" \=0D + % (self.UiName, self.Notify, self.GuidTypes, self.CName,=0D + self.GuidValue, self.CommonDefines)=0D for Item in self.HelpText:=0D Str =3D Str + "\n\t" + str(Item)=0D return Str=0D ##=0D -#GUID Xml=0D +# GUID Xml=0D #=0D +=0D +=0D class GuidXml(GuidProtocolPpiXml):=0D def __init__(self, Mode):=0D GuidProtocolPpiXml.__init__(self, Mode)=0D @@ -127,7 +135,8 @@ class GuidXml(GuidProtocolPpiXml): if self.GuidType:=0D GuidProtocolPpi.SetGuidTypeList([self.GuidType])=0D GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)= =0D - GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDef= ines.FeatureFlag))=0D + GuidProtocolPpi.SetFeatureFlag(=0D + ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))=0D GuidProtocolPpi.SetCName(self.CName)=0D GuidProtocolPpi.SetVariableName(self.VariableName)=0D return GuidProtocolPpi=0D @@ -135,27 +144,29 @@ class GuidXml(GuidProtocolPpiXml): def ToXml(self, GuidProtocolPpi, Key):=0D if self.Mode =3D=3D 'Package':=0D AttributeList =3D \=0D - [['GuidType', \=0D - GetStringOfList(GuidProtocolPpi.GetGuidTypeList())], \=0D - ['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())], \=0D - ['SupModList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupModuleList())],=0D - ]=0D + [['GuidType',=0D + GetStringOfList(GuidProtocolPpi.GetGuidTypeList())],=0D + ['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ['SupModList',=0D + GetStringOfList(GuidProtocolPpi.GetSupModuleList())],= =0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D ['GuidValue', GuidProtocolPpi.GetGuid()],=0D - ]=0D + ]=0D else:=0D AttributeList =3D \=0D - [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \=0D - ['GuidType', GetStringOfList(GuidProtocolPpi.GetGuidTypeList(= ))],\=0D - ['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())], \=0D - ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeature= Flag())]=0D - ]=0D + [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())],=0D + ['GuidType', GetStringOfList(=0D + GuidProtocolPpi.GetGuidTypeList())],=0D + ['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ['FeatureFlag', ConvertNEToNOTEQ(=0D + GuidProtocolPpi.GetFeatureFlag())]=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D ['VariableName', GuidProtocolPpi.GetVariableName()= ]=0D - ]=0D + ]=0D =0D for Item in GuidProtocolPpi.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -164,8 +175,10 @@ class GuidXml(GuidProtocolPpiXml): =0D return Root=0D ##=0D -#Protocol Xml=0D +# Protocol Xml=0D #=0D +=0D +=0D class ProtocolXml(GuidProtocolPpiXml):=0D def __init__(self, Mode):=0D GuidProtocolPpiXml.__init__(self, Mode)=0D @@ -188,7 +201,8 @@ class ProtocolXml(GuidProtocolPpiXml): else:=0D GuidProtocolPpi.SetNotify('')=0D GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)= =0D - GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDef= ines.FeatureFlag))=0D + GuidProtocolPpi.SetFeatureFlag(=0D + ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))=0D GuidProtocolPpi.SetCName(self.CName)=0D =0D return GuidProtocolPpi=0D @@ -196,25 +210,26 @@ class ProtocolXml(GuidProtocolPpiXml): def ToXml(self, GuidProtocolPpi, Key):=0D if self.Mode =3D=3D 'Package':=0D AttributeList =3D \=0D - [['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())], \=0D - ['SupModList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupModuleList())], \=0D - ['FeatureFlag', GuidProtocolPpi.GetFeatureFlag()]=0D - ]=0D + [['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ['SupModList',=0D + GetStringOfList(GuidProtocolPpi.GetSupModuleList())],= =0D + ['FeatureFlag', GuidProtocolPpi.GetFeatureFlag()]=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D ['GuidValue', GuidProtocolPpi.GetGuid()],=0D - ]=0D + ]=0D else:=0D AttributeList =3D \=0D - [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \=0D - ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \=0D - ['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())], \=0D - ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureF= lag())]=0D - ]=0D + [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())],=0D + ['Notify', str(GuidProtocolPpi.GetNotify()).lower()],=0D + ['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ['FeatureFlag', ConvertNEToNOTEQ(=0D + GuidProtocolPpi.GetFeatureFlag())]=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D - ]=0D + ]=0D =0D for Item in GuidProtocolPpi.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -223,8 +238,10 @@ class ProtocolXml(GuidProtocolPpiXml): =0D return Root=0D ##=0D -#Ppi Xml=0D +# Ppi Xml=0D #=0D +=0D +=0D class PpiXml(GuidProtocolPpiXml):=0D def __init__(self, Mode):=0D GuidProtocolPpiXml.__init__(self, Mode)=0D @@ -246,7 +263,8 @@ class PpiXml(GuidProtocolPpiXml): else:=0D GuidProtocolPpi.SetNotify('')=0D GuidProtocolPpi.SetSupArchList(self.CommonDefines.SupArchList)= =0D - GuidProtocolPpi.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDef= ines.FeatureFlag))=0D + GuidProtocolPpi.SetFeatureFlag(=0D + ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))=0D GuidProtocolPpi.SetCName(self.CName)=0D =0D return GuidProtocolPpi=0D @@ -254,22 +272,23 @@ class PpiXml(GuidProtocolPpiXml): def ToXml(self, GuidProtocolPpi, Key):=0D if self.Mode =3D=3D 'Package':=0D AttributeList =3D \=0D - [['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D - ]=0D + [['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D ['GuidValue', GuidProtocolPpi.GetGuid()],=0D - ]=0D + ]=0D else:=0D AttributeList =3D \=0D - [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())], \=0D - ['Notify', str(GuidProtocolPpi.GetNotify()).lower()], \=0D - ['SupArchList', \=0D - GetStringOfList(GuidProtocolPpi.GetSupArchList())], \=0D - ['FeatureFlag', ConvertNEToNOTEQ(GuidProtocolPpi.GetFeatureF= lag())]=0D - ]=0D + [['Usage', GetStringOfList(GuidProtocolPpi.GetUsage())],=0D + ['Notify', str(GuidProtocolPpi.GetNotify()).lower()],=0D + ['SupArchList',=0D + GetStringOfList(GuidProtocolPpi.GetSupArchList())],=0D + ['FeatureFlag', ConvertNEToNOTEQ(=0D + GuidProtocolPpi.GetFeatureFlag())]=0D + ]=0D NodeList =3D [['CName', GuidProtocolPpi.GetCName()],=0D - ]=0D + ]=0D =0D for Item in GuidProtocolPpi.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D diff --git a/BaseTools/Source/Python/UPT/Xml/IniToXml.py b/BaseTools/Source= /Python/UPT/Xml/IniToXml.py index 3dc4001313de..ce5366d755a2 100644 --- a/BaseTools/Source/Python/UPT/Xml/IniToXml.py +++ b/BaseTools/Source/Python/UPT/Xml/IniToXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is for converting package information data file to xml file.=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -28,38 +28,46 @@ from Library.StringUtils import ConvertSpecialChar from Library.ParserValidate import IsValidPath=0D from Library import GlobalData=0D =0D -## log error:=0D +# log error:=0D #=0D # @param error: error=0D # @param File: File=0D # @param Line: Line=0D #=0D +=0D +=0D def IniParseError(Error, File, Line):=0D Logger.Error("UPT", UPT_INI_PARSE_ERROR, File=3DFile,=0D Line=3DLine, ExtraData=3DError)=0D =0D -## __ValidatePath=0D +# __ValidatePath=0D #=0D # @param Path: Path to be checked=0D #=0D +=0D +=0D def __ValidatePath(Path, Root):=0D Path =3D Path.strip()=0D if os.path.isabs(Path) or not IsValidPath(Path, Root):=0D return False, ST.ERR_FILELIST_LOCATION % (Root, Path)=0D return True, ''=0D =0D -## ValidateMiscFile=0D +# ValidateMiscFile=0D #=0D # @param Filename: File to be checked=0D #=0D +=0D +=0D def ValidateMiscFile(Filename):=0D Root =3D GlobalData.gWORKSPACE=0D return __ValidatePath(Filename, Root)=0D =0D -## ValidateToolsFile=0D +# ValidateToolsFile=0D #=0D # @param Filename: File to be checked=0D #=0D +=0D +=0D def ValidateToolsFile(Filename):=0D Valid, Cause =3D False, ''=0D if not Valid and 'EDK_TOOLS_PATH' in os.environ:=0D @@ -68,13 +76,15 @@ def ValidateToolsFile(Filename): Valid, Cause =3D __ValidatePath(Filename, GlobalData.gWORKSPACE)=0D return Valid, Cause=0D =0D -## ParseFileList=0D +# ParseFileList=0D #=0D # @param Line: Line=0D # @param Map: Map=0D # @param CurrentKey: CurrentKey=0D # @param PathFunc: Path validate function=0D #=0D +=0D +=0D def ParseFileList(Line, Map, CurrentKey, PathFunc):=0D FileList =3D ["", {}]=0D TokenList =3D Line.split(TAB_VALUE_SPLIT)=0D @@ -107,11 +117,13 @@ def ParseFileList(Line, Map, CurrentKey, PathFunc): Map[CurrentKey].append(FileList)=0D return True, ''=0D =0D -## Create header XML file=0D +# Create header XML file=0D #=0D # @param DistMap: DistMap=0D # @param Root: Root=0D #=0D +=0D +=0D def CreateHeaderXml(DistMap, Root):=0D Element1 =3D CreateXmlElement('Name', DistMap['Name'],=0D [], [['BaseName', DistMap['BaseName']]])=0D @@ -133,12 +145,14 @@ def CreateHeaderXml(DistMap, Root): Root.appendChild(CreateXmlElement('DistributionHeader', '',=0D NodeList, AttributeList))=0D =0D -## Create tools XML file=0D +# Create tools XML file=0D #=0D # @param Map: Map=0D # @param Root: Root=0D # @param Tag: Tag=0D #=0D +=0D +=0D def CreateToolsXml(Map, Root, Tag):=0D #=0D # Check if all elements in this section are empty=0D @@ -154,7 +168,7 @@ def CreateToolsXml(Map, Root, Tag): ['License', Map['License']],=0D ['Abstract', Map['Abstract']],=0D ['Description', Map['Description']],=0D - ]=0D + ]=0D HeaderNode =3D CreateXmlElement('Header', '', NodeList, [])=0D NodeList =3D [HeaderNode]=0D =0D @@ -165,12 +179,14 @@ def CreateToolsXml(Map, Root, Tag): NodeList.append(CreateXmlElement('Filename', File[0], [], AttrList= ))=0D Root.appendChild(CreateXmlElement(Tag, '', NodeList, []))=0D =0D -## ValidateValues=0D +# ValidateValues=0D #=0D # @param Key: Key=0D # @param Value: Value=0D # @param SectionName: SectionName=0D #=0D +=0D +=0D def ValidateValues(Key, Value, SectionName):=0D if SectionName =3D=3D 'DistributionHeader':=0D Valid, Cause =3D ValidateRegValues(Key, Value)=0D @@ -185,24 +201,26 @@ def ValidateValues(Key, Value, SectionName): return Valid, ST.ERR_VALUE_INVALID % (Key, SectionName)=0D return True, ''=0D =0D -## ValidateRegValues=0D +# ValidateRegValues=0D #=0D # @param Key: Key=0D # @param Value: Value=0D #=0D +=0D +=0D def ValidateRegValues(Key, Value):=0D ValidateMap =3D {=0D - 'ReadOnly' :=0D + 'ReadOnly':=0D ('true|false', ST.ERR_BOOLEAN_VALUE % (Key, Value)),=0D - 'RePackage' :=0D + 'RePackage':=0D ('true|false', ST.ERR_BOOLEAN_VALUE % (Key, Value)),=0D - 'GUID' :=0D + 'GUID':=0D ('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}'=0D - '-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}',=0D - ST.ERR_GUID_VALUE % Value),=0D - 'Version' : ('[0-9]+(\.[0-9]+)?', ST.ERR_VERSION_VALUE % \=0D - (Key, Value)),=0D - 'XmlSpecification' : ('1\.1', ST.ERR_VERSION_XMLSPEC % Value)=0D + '-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}',=0D + ST.ERR_GUID_VALUE % Value),=0D + 'Version': ('[0-9]+(\.[0-9]+)?', ST.ERR_VERSION_VALUE %=0D + (Key, Value)),=0D + 'XmlSpecification': ('1\.1', ST.ERR_VERSION_XMLSPEC % Value)=0D }=0D if Key not in ValidateMap:=0D return True, ''=0D @@ -212,10 +230,12 @@ def ValidateRegValues(Key, Value): return True, ''=0D return False, Elem[1]=0D =0D -## __ValidateDistHeaderName=0D +# __ValidateDistHeaderName=0D #=0D # @param Name: Name=0D #=0D +=0D +=0D def __ValidateDistHeaderName(Name):=0D if len(Name) < 1:=0D return False=0D @@ -225,10 +245,12 @@ def __ValidateDistHeaderName(Name): return False=0D return True=0D =0D -## __ValidateDistHeaderBaseName=0D +# __ValidateDistHeaderBaseName=0D #=0D # @param BaseName: BaseName=0D #=0D +=0D +=0D def __ValidateDistHeaderBaseName(BaseName):=0D if not BaseName:=0D return False=0D @@ -241,78 +263,88 @@ def __ValidateDistHeaderBaseName(BaseName): return False=0D return True=0D =0D -## __ValidateDistHeaderAbstract=0D +# __ValidateDistHeaderAbstract=0D #=0D # @param Abstract: Abstract=0D #=0D +=0D +=0D def __ValidateDistHeaderAbstract(Abstract):=0D return '\t' not in Abstract and len(Abstract.splitlines()) =3D=3D 1=0D =0D -## __ValidateOtherHeaderAbstract=0D +# __ValidateOtherHeaderAbstract=0D #=0D # @param Abstract: Abstract=0D #=0D +=0D +=0D def __ValidateOtherHeaderAbstract(Abstract):=0D return __ValidateDistHeaderAbstract(Abstract)=0D =0D -## __ValidateDistHeader=0D +# __ValidateDistHeader=0D #=0D # @param Key: Key=0D # @param Value: Value=0D #=0D +=0D +=0D def __ValidateDistHeader(Key, Value):=0D ValidateMap =3D {=0D - 'Name' : __ValidateDistHeaderName,=0D - 'BaseName' : __ValidateDistHeaderBaseName,=0D - 'Abstract' : __ValidateDistHeaderAbstract,=0D - 'Vendor' : __ValidateDistHeaderAbstract=0D + 'Name': __ValidateDistHeaderName,=0D + 'BaseName': __ValidateDistHeaderBaseName,=0D + 'Abstract': __ValidateDistHeaderAbstract,=0D + 'Vendor': __ValidateDistHeaderAbstract=0D }=0D return not (Value and Key in ValidateMap and not ValidateMap[Key](Valu= e))=0D =0D -## __ValidateOtherHeader=0D +# __ValidateOtherHeader=0D #=0D # @param Key: Key=0D # @param Value: Value=0D #=0D +=0D +=0D def __ValidateOtherHeader(Key, Value):=0D ValidateMap =3D {=0D - 'Name' : __ValidateDistHeaderName,=0D - 'Abstract' : __ValidateOtherHeaderAbstract=0D + 'Name': __ValidateDistHeaderName,=0D + 'Abstract': __ValidateOtherHeaderAbstract=0D }=0D return not (Value and Key in ValidateMap and not ValidateMap[Key](Valu= e))=0D =0D -## Convert ini file to xml file=0D +# Convert ini file to xml file=0D #=0D # @param IniFile=0D #=0D +=0D +=0D def IniToXml(IniFile):=0D if not os.path.exists(IniFile):=0D Logger.Error("UPT", FILE_NOT_FOUND, ST.ERR_TEMPLATE_NOTFOUND % Ini= File)=0D =0D - DistMap =3D {'ReadOnly' : '', 'RePackage' : '', 'Name' : '',=0D - 'BaseName' : '', 'GUID' : '', 'Version' : '', 'Vendor' : ''= ,=0D - 'Date' : '', 'Copyright' : '', 'License' : '', 'Abstract' := '',=0D - 'Description' : '', 'Signature' : '', 'XmlSpecification' : = ''=0D - }=0D + DistMap =3D {'ReadOnly': '', 'RePackage': '', 'Name': '',=0D + 'BaseName': '', 'GUID': '', 'Version': '', 'Vendor': '',=0D + 'Date': '', 'Copyright': '', 'License': '', 'Abstract': '',= =0D + 'Description': '', 'Signature': '', 'XmlSpecification': ''= =0D + }=0D =0D - ToolsMap =3D {'Name' : '', 'Copyright' : '', 'License' : '',=0D - 'Abstract' : '', 'Description' : '', 'FileList' : []}=0D + ToolsMap =3D {'Name': '', 'Copyright': '', 'License': '',=0D + 'Abstract': '', 'Description': '', 'FileList': []}=0D #=0D # Only FileList is a list: [['file1', {}], ['file2', {}], ...]=0D #=0D - MiscMap =3D {'Name' : '', 'Copyright' : '', 'License' : '',=0D - 'Abstract' : '', 'Description' : '', 'FileList' : []}=0D + MiscMap =3D {'Name': '', 'Copyright': '', 'License': '',=0D + 'Abstract': '', 'Description': '', 'FileList': []}=0D =0D SectionMap =3D {=0D - 'DistributionHeader' : DistMap,=0D - 'ToolsHeader' : ToolsMap,=0D - 'MiscellaneousFilesHeader' : MiscMap=0D - }=0D + 'DistributionHeader': DistMap,=0D + 'ToolsHeader': ToolsMap,=0D + 'MiscellaneousFilesHeader': MiscMap=0D + }=0D =0D PathValidator =3D {=0D - 'ToolsHeader' : ValidateToolsFile,=0D - 'MiscellaneousFilesHeader' : ValidateMiscFile=0D - }=0D + 'ToolsHeader': ValidateToolsFile,=0D + 'MiscellaneousFilesHeader': ValidateMiscFile=0D + }=0D =0D ParsedSection =3D []=0D =0D @@ -332,11 +364,11 @@ def IniToXml(IniFile): SectionName =3D Line[1:-1].strip()=0D if SectionName not in SectionMap:=0D IniParseError(ST.ERR_SECTION_NAME_INVALID % SectionName,=0D - IniFile, Index+1)=0D + IniFile, Index+1)=0D =0D if SectionName in ParsedSection:=0D IniParseError(ST.ERR_SECTION_REDEFINE % SectionName,=0D - IniFile, Index+1)=0D + IniFile, Index+1)=0D else:=0D ParsedSection.append(SectionName)=0D =0D @@ -419,7 +451,7 @@ def IniToXml(IniFile): return CreateXml(DistMap, ToolsMap, MiscMap, IniFile)=0D =0D =0D -## CheckMdtKeys=0D +# CheckMdtKeys=0D #=0D # @param MdtDistKeys: All mandatory keys=0D # @param DistMap: Dist content=0D @@ -428,7 +460,8 @@ def IniToXml(IniFile): # @param Maps: Tools and Misc section name and map. (('section_name', map)= ,*)=0D #=0D def CheckMdtKeys(DistMap, IniFile, LastIndex, Maps):=0D - MdtDistKeys =3D ['Name', 'GUID', 'Version', 'Vendor', 'Copyright', 'Li= cense', 'Abstract', 'XmlSpecification']=0D + MdtDistKeys =3D ['Name', 'GUID', 'Version', 'Vendor',=0D + 'Copyright', 'License', 'Abstract', 'XmlSpecification']= =0D for Key in MdtDistKeys:=0D if Key not in DistMap or DistMap[Key] =3D=3D '':=0D IniParseError(ST.ERR_KEYWORD_MANDATORY % Key, IniFile, LastInd= ex+1)=0D @@ -460,22 +493,26 @@ def CheckMdtKeys(DistMap, IniFile, LastIndex, Maps): NonEmptyKey +=3D 1=0D =0D if NonEmptyKey > 0 and not Map['FileList']:=0D - IniParseError(ST.ERR_KEYWORD_MANDATORY % (Item[0] + '.FileList= '), IniFile, LastIndex+1)=0D + IniParseError(ST.ERR_KEYWORD_MANDATORY %=0D + (Item[0] + '.FileList'), IniFile, LastIndex+1)=0D =0D if NonEmptyKey > 0 and not Map['Name']:=0D - IniParseError(ST.ERR_KEYWORD_MANDATORY % (Item[0] + '.Name'), = IniFile, LastIndex+1)=0D + IniParseError(ST.ERR_KEYWORD_MANDATORY %=0D + (Item[0] + '.Name'), IniFile, LastIndex+1)=0D =0D -## CreateXml=0D +# CreateXml=0D #=0D # @param DistMap: Dist Content=0D # @param ToolsMap: Tools Content=0D # @param MiscMap: Misc Content=0D # @param IniFile: Ini File=0D #=0D +=0D +=0D def CreateXml(DistMap, ToolsMap, MiscMap, IniFile):=0D Attrs =3D [['xmlns', 'http://www.uefi.org/2011/1.1'],=0D ['xmlns:xsi', 'http:/www.w3.org/2001/XMLSchema-instance'],=0D - ]=0D + ]=0D Root =3D CreateXmlElement('DistributionPackage', '', [], Attrs)=0D CreateHeaderXml(DistMap, Root)=0D CreateToolsXml(ToolsMap, Root, 'Tools')=0D @@ -489,8 +526,7 @@ def CreateXml(DistMap, ToolsMap, MiscMap, IniFile): File =3D open(FileName, 'w')=0D =0D try:=0D - File.write(Root.toprettyxml(indent =3D ' '))=0D + File.write(Root.toprettyxml(indent=3D' '))=0D finally:=0D File.close()=0D return FileName=0D -=0D diff --git a/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py b/Base= Tools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py index 741da908047c..f1548725219e 100644 --- a/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py +++ b/BaseTools/Source/Python/UPT/Xml/ModuleSurfaceAreaXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a Module file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -48,7 +48,7 @@ from Xml.XmlParserMisc import GetHelpTextList from Library import GlobalData=0D from Library.Misc import GetSplitValueList=0D =0D -## BinaryFileXml=0D +# BinaryFileXml=0D #=0D # represent the following XML item=0D #=0D @@ -62,6 +62,8 @@ from Library.Misc import GetSplitValueList # ... {0,}=0D # {1,}=0D #=0D +=0D +=0D class BinaryFileXml(object):=0D def __init__(self):=0D self.FileNames =3D []=0D @@ -117,7 +119,8 @@ class BinaryFileXml(object): BuildFlagList =3D []=0D for SubItem in XmlList(Item, '%s/AsBuilt/BuildFlags' % Key= ):=0D BuildFlag =3D BuildFlagXml()=0D - BuildFlagList.append(BuildFlag.FromXml2(SubItem, 'Buil= dFlags'))=0D + BuildFlagList.append(=0D + BuildFlag.FromXml2(SubItem, 'BuildFlags'))=0D AsBuilt.SetBuildFlagsList(BuildFlagList)=0D AsBuiltList.append(AsBuilt)=0D BinaryFile.SetAsBuiltList(AsBuiltList)=0D @@ -156,17 +159,20 @@ class BinaryFileXml(object): for LibGuidVer in LibGuidVerList:=0D if LibGuidVer.GetLibGuid() and IsMatchArch(LibGuidVer.GetSupAr= chList(), SupportArch):=0D GuiVerElem =3D \=0D - CreateXmlElement('GUID', LibGuidVer.GetLibGuid(), [], [['V= ersion', LibGuidVer.GetLibVersion()]])=0D + CreateXmlElement('GUID', LibGuidVer.GetLibGuid(), [], = [=0D + ['Version', LibGuidVer.GetLibVersion(= )]])=0D GuiVerElemList.append(GuiVerElem)=0D if len(GuiVerElemList) > 0:=0D - LibGuidVerElem =3D CreateXmlElement('LibraryInstances', '', Gu= iVerElemList, [])=0D + LibGuidVerElem =3D CreateXmlElement(=0D + 'LibraryInstances', '', GuiVerElemList, [])=0D AsBuiltNodeList.append(LibGuidVerElem)=0D =0D for BuildFlag in BuildFlagList:=0D if IsMatchArch(BuildFlag.GetSupArchList(), SupportArch):=0D for Item in BuildFlag.GetAsBuildList():=0D Tmp =3D BuildFlagXml()=0D - Elem =3D CreateXmlElement('BuildFlags', ''.join(Item),= [], [])=0D + Elem =3D CreateXmlElement(=0D + 'BuildFlags', ''.join(Item), [], [])=0D AsBuiltNodeList.append(Elem)=0D =0D if len(AsBuiltNodeList) > 0:=0D @@ -194,6 +200,8 @@ class BinaryFileXml(object): ##=0D # PackageXml=0D #=0D +=0D +=0D class PackageXml(object):=0D def __init__(self):=0D self.Description =3D ''=0D @@ -211,7 +219,8 @@ class PackageXml(object): PackageDependency.SetPackage(self.Description)=0D PackageDependency.SetGuid(self.Guid)=0D PackageDependency.SetVersion(self.Version)=0D - PackageDependency.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefin= es.FeatureFlag))=0D + PackageDependency.SetFeatureFlag(=0D + ConvertNOTEQToNE(self.CommonDefines.FeatureFlag))=0D PackageDependency.SetSupArchList(self.CommonDefines.SupArchList)=0D =0D return PackageDependency=0D @@ -223,7 +232,8 @@ class PackageXml(object): ['FeatureFlag', ConvertNEToNOTEQ(PackageDependenc= y.GetFeatureFlag())], ]=0D Element1 =3D CreateXmlElement('GUID', PackageDependency.GetGuid(),= [],=0D [['Version', PackageDependency.GetVers= ion()]])=0D - NodeList =3D [['Description', PackageDependency.GetPackage()], Ele= ment1, ]=0D + NodeList =3D [['Description', PackageDependency.GetPackage()],=0D + Element1, ]=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, AttributeList)= =0D =0D return Root=0D @@ -235,6 +245,8 @@ class PackageXml(object): ##=0D # ExternXml=0D #=0D +=0D +=0D class ExternXml(object):=0D def __init__(self):=0D self.CommonDefines =3D CommonDefinesXml()=0D @@ -290,6 +302,8 @@ class ExternXml(object): ##=0D # DepexXml=0D #=0D +=0D +=0D class DepexXml(object):=0D def __init__(self):=0D self.CommonDefines =3D CommonDefinesXml()=0D @@ -337,6 +351,8 @@ class DepexXml(object): ##=0D # BootModeXml=0D #=0D +=0D +=0D class BootModeXml(object):=0D def __init__(self):=0D self.SupportedBootModes =3D ''=0D @@ -345,7 +361,7 @@ class BootModeXml(object): =0D def FromXml(self, Item, Key):=0D self.SupportedBootModes =3D \=0D - XmlElement(Item, '%s/SupportedBootModes' % Key)=0D + XmlElement(Item, '%s/SupportedBootModes' % Key)=0D self.CommonDefines.FromXml(Item, Key)=0D for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):=0D HelpTextObj =3D HelpTextXml()=0D @@ -372,13 +388,16 @@ class BootModeXml(object): return Root=0D =0D def __str__(self):=0D - Str =3D "SupportedBootModes =3D %s %s" % (self.SupportedBootModes,= self.CommonDefines)=0D + Str =3D "SupportedBootModes =3D %s %s" % (=0D + self.SupportedBootModes, self.CommonDefines)=0D for Item in self.HelpText:=0D Str =3D Str + '\n\t' + str(Item)=0D return Str=0D ##=0D # EventXml=0D #=0D +=0D +=0D class EventXml(object):=0D def __init__(self):=0D self.EventType =3D ''=0D @@ -407,7 +426,7 @@ class EventXml(object): pass=0D AttributeList =3D [['EventType', Event.GetEventType()],=0D ['Usage', Event.GetUsage()],=0D - ]=0D + ]=0D NodeList =3D []=0D for Item in Event.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -424,6 +443,8 @@ class EventXml(object): ##=0D # HobXml=0D #=0D +=0D +=0D class HobXml(object):=0D def __init__(self):=0D self.HobType =3D ''=0D @@ -471,6 +492,8 @@ class HobXml(object): ##=0D # SourceFileXml=0D #=0D +=0D +=0D class SourceFileXml(object):=0D def __init__(self):=0D self.SourceFile =3D ''=0D @@ -483,7 +506,8 @@ class SourceFileXml(object): self.SourceFile =3D XmlElement(Item, 'Filename')=0D self.CommonDefines.FromXml(Item, Key)=0D =0D - self.CommonDefines.FeatureFlag =3D ConvertNOTEQToNE(self.CommonDef= ines.FeatureFlag)=0D + self.CommonDefines.FeatureFlag =3D ConvertNOTEQToNE(=0D + self.CommonDefines.FeatureFlag)=0D =0D SourceFile =3D SourceFileObject()=0D SourceFile.SetSourceFile(self.SourceFile)=0D @@ -500,12 +524,15 @@ class SourceFileXml(object): AttributeList =3D [['SupArchList', GetStringOfList(SourceFile.GetS= upArchList())],=0D ['Family', SourceFile.GetFamily()],=0D ['FeatureFlag', FeatureFlag], ]=0D - Root =3D CreateXmlElement('%s' % Key, SourceFile.GetSourceFile(), = [], AttributeList)=0D + Root =3D CreateXmlElement(=0D + '%s' % Key, SourceFile.GetSourceFile(), [], AttributeList)=0D return Root=0D =0D ##=0D # ModulePropertyXml=0D #=0D +=0D +=0D class ModulePropertyXml(object):=0D def __init__(self):=0D self.CommonDefines =3D CommonDefinesXml()=0D @@ -525,11 +552,14 @@ class ModulePropertyXml(object): self.ModuleType =3D XmlElement(Item, '%s/ModuleType' % Key)=0D self.Path =3D XmlElement(Item, '%s/Path' % Key)=0D self.PcdIsDriver =3D XmlElement(Item, '%s/PcdIsDriver' % Key)=0D - self.UefiSpecificationVersion =3D XmlElement(Item, '%s/UefiSpecifi= cationVersion' % Key)=0D - self.PiSpecificationVersion =3D XmlElement(Item, '%s/PiSpecificati= onVersion' % Key)=0D + self.UefiSpecificationVersion =3D XmlElement(=0D + Item, '%s/UefiSpecificationVersion' % Key)=0D + self.PiSpecificationVersion =3D XmlElement(=0D + Item, '%s/PiSpecificationVersion' % Key)=0D for SubItem in XmlList(Item, '%s/Specification' % Key):=0D Specification =3D XmlElement(SubItem, '/Specification')=0D - Version =3D XmlAttribute(XmlNode(SubItem, '/Specification'), '= Version')=0D + Version =3D XmlAttribute(=0D + XmlNode(SubItem, '/Specification'), 'Version')=0D self.SpecificationList.append((Specification, Version))=0D for SubItem in XmlList(Item, '%s/BootMode' % Key):=0D Axml =3D BootModeXml()=0D @@ -558,21 +588,23 @@ class ModulePropertyXml(object): =0D return Header, self.BootModes, self.Events, self.HOBs=0D =0D -=0D def ToXml(self, Header, BootModes, Events, Hobs, Key):=0D if self.ModuleType:=0D pass=0D - AttributeList =3D [['SupArchList', GetStringOfList(Header.GetSupAr= chList())], ]=0D + AttributeList =3D [=0D + ['SupArchList', GetStringOfList(Header.GetSupArchList())], ]=0D =0D NodeList =3D [['ModuleType', Header.GetModuleType()],=0D ['Path', Header.GetModulePath()],=0D ['PcdIsDriver', Header.GetPcdIsDriver()],=0D - ['UefiSpecificationVersion', Header.GetUefiSpecificati= onVersion()],=0D + ['UefiSpecificationVersion',=0D + Header.GetUefiSpecificationVersion()],=0D ['PiSpecificationVersion', Header.GetPiSpecificationVe= rsion()],=0D - ]=0D + ]=0D for Item in Header.GetSpecList():=0D Spec, Version =3D Item=0D - SpecElem =3D CreateXmlElement('Specification', Spec, [], [['Ve= rsion', Version]])=0D + SpecElem =3D CreateXmlElement(=0D + 'Specification', Spec, [], [['Version', Version]])=0D NodeList.append(SpecElem)=0D =0D for Item in BootModes:=0D @@ -591,9 +623,9 @@ class ModulePropertyXml(object): def __str__(self):=0D Str =3D "ModuleType =3D %s Path =3D %s PcdIsDriver =3D %s UefiSpec= ificationVersion =3D %s PiSpecificationVersion =3D %s \=0D Specification =3D %s SpecificationVersion =3D %s %s" % \=0D - (self.ModuleType, self.Path, self.PcdIsDriver, \=0D - self.UefiSpecificationVersion, self.PiSpecificationVersion, \=0D - self.SpecificationList, self.SpecificationVersion, self.CommonDef= ines)=0D + (self.ModuleType, self.Path, self.PcdIsDriver,=0D + self.UefiSpecificationVersion, self.PiSpecificationVersion,=0D + self.SpecificationList, self.SpecificationVersion, self.Commo= nDefines)=0D for Item in self.BootModes:=0D Str =3D Str + '\n\t' + str(Item)=0D for Item in self.Events:=0D @@ -605,6 +637,8 @@ class ModulePropertyXml(object): ##=0D # ModuleXml=0D #=0D +=0D +=0D class ModuleSurfaceAreaXml(object):=0D def __init__(self, Package=3D''):=0D self.Module =3D None=0D @@ -649,7 +683,8 @@ class ModuleSurfaceAreaXml(object): #=0D # MiscellaneousFile=0D Tmp =3D MiscellaneousFileXml()=0D - MiscFileList =3D Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/Mis= cellaneousFiles'), 'MiscellaneousFiles')=0D + MiscFileList =3D Tmp.FromXml(=0D + XmlNode(Item, '/ModuleSurfaceArea/MiscellaneousFiles'), 'Misce= llaneousFiles')=0D if MiscFileList:=0D Module.SetMiscFileList([MiscFileList])=0D else:=0D @@ -661,7 +696,8 @@ class ModuleSurfaceAreaXml(object): for Item in XmlList(Item, '/ModuleSurfaceArea/UserExtensions'):=0D Tmp =3D UserExtensionsXml()=0D UserExtension =3D Tmp.FromXml(Item, 'UserExtensions')=0D - Module.SetUserExtensionList(Module.GetUserExtensionList() + [U= serExtension])=0D + Module.SetUserExtensionList(=0D + Module.GetUserExtensionList() + [UserExtension])=0D =0D return Module=0D =0D @@ -671,7 +707,8 @@ class ModuleSurfaceAreaXml(object): # Header=0D #=0D Tmp =3D HeaderXml()=0D - Module =3D Tmp.FromXml(XmlNode(Item, '/%s/Header' % Key), 'Header'= , True, IsStandAlongModule)=0D + Module =3D Tmp.FromXml(XmlNode(Item, '/%s/Header' %=0D + Key), 'Header', True, IsStandAlongModule)=0D Module.SetBinaryModule(IsBinaryModule)=0D =0D if IsBinaryModule:=0D @@ -682,7 +719,8 @@ class ModuleSurfaceAreaXml(object): #=0D Tmp =3D ModulePropertyXml()=0D (Module, BootModes, Events, HOBs) =3D \=0D - Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/ModuleProperties'), = 'ModuleProperties', Module)=0D + Tmp.FromXml(XmlNode(=0D + Item, '/ModuleSurfaceArea/ModuleProperties'), 'ModulePrope= rties', Module)=0D Module.SetBootModeList(BootModes)=0D Module.SetEventList(Events)=0D Module.SetHobList(HOBs)=0D @@ -690,7 +728,8 @@ class ModuleSurfaceAreaXml(object): # ClonedFrom=0D #=0D Tmp =3D ClonedFromXml()=0D - ClonedFrom =3D Tmp.FromXml(XmlNode(Item, '/ModuleSurfaceArea/Clone= dFrom'), 'ClonedFrom')=0D + ClonedFrom =3D Tmp.FromXml(=0D + XmlNode(Item, '/ModuleSurfaceArea/ClonedFrom'), 'ClonedFrom')= =0D if ClonedFrom:=0D Module.SetClonedFrom(ClonedFrom)=0D =0D @@ -700,7 +739,8 @@ class ModuleSurfaceAreaXml(object): for SubItem in XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefin= itions/LibraryClass'):=0D Tmp =3D LibraryClassXml()=0D LibraryClass =3D Tmp.FromXml(SubItem, 'LibraryClass')=0D - Module.SetLibraryClassList(Module.GetLibraryClassList() + [Lib= raryClass])=0D + Module.SetLibraryClassList(=0D + Module.GetLibraryClassList() + [LibraryClass])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefinitions') and= \=0D not XmlList(Item, '/ModuleSurfaceArea/LibraryClassDefinitions/L= ibraryClass'):=0D @@ -715,7 +755,7 @@ class ModuleSurfaceAreaXml(object): Module.SetSourceFileList(Module.GetSourceFileList() + [SourceF= ile])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/SourceFiles') and \=0D - not XmlList(Item, '/ModuleSurfaceArea/SourceFiles/Filename') := =0D + not XmlList(Item, '/ModuleSurfaceArea/SourceFiles/Filename'):=0D Module.SetSourceFileList([None])=0D =0D #=0D @@ -727,7 +767,7 @@ class ModuleSurfaceAreaXml(object): Module.SetBinaryFileList(Module.GetBinaryFileList() + [BinaryF= ile])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/BinaryFiles') and \=0D - not XmlList(Item, '/ModuleSurfaceArea/BinaryFiles/BinaryFile') = :=0D + not XmlList(Item, '/ModuleSurfaceArea/BinaryFiles/BinaryFile'):= =0D Module.SetBinaryFileList([None])=0D #=0D # PackageDependencies=0D @@ -735,7 +775,8 @@ class ModuleSurfaceAreaXml(object): for SubItem in XmlList(Item, '/ModuleSurfaceArea/PackageDependenci= es/Package'):=0D Tmp =3D PackageXml()=0D PackageDependency =3D Tmp.FromXml(SubItem, 'Package')=0D - Module.SetPackageDependencyList(Module.GetPackageDependencyLis= t() + [PackageDependency])=0D + Module.SetPackageDependencyList(=0D + Module.GetPackageDependencyList() + [PackageDependency])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/PackageDependencies') and \=0D not XmlList(Item, '/ModuleSurfaceArea/PackageDependencies/Packa= ge'):=0D @@ -758,7 +799,8 @@ class ModuleSurfaceAreaXml(object): for SubItem in XmlList(Item, '/ModuleSurfaceArea/Protocols/Protoco= l'):=0D Tmp =3D ProtocolXml('Module')=0D GuidProtocolPpi =3D Tmp.FromXml(SubItem, 'Protocol')=0D - Module.SetProtocolList(Module.GetProtocolList() + [GuidProtoco= lPpi])=0D + Module.SetProtocolList(=0D + Module.GetProtocolList() + [GuidProtocolPpi])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/Protocols') and not XmlList(I= tem, '/ModuleSurfaceArea/Protocols/Protocol'):=0D Module.SetProtocolList([None])=0D @@ -795,7 +837,7 @@ class ModuleSurfaceAreaXml(object): Module.SetPcdList(Module.GetPcdList() + [PcdEntry])=0D =0D if XmlList(Item, '/ModuleSurfaceArea/PcdCoded') and \=0D - not XmlList(Item, '/ModuleSurfaceArea/PcdCoded/PcdEntry'):= =0D + not XmlList(Item, '/ModuleSurfaceArea/PcdCoded/PcdEntr= y'):=0D Module.SetPcdList([None])=0D =0D Module =3D self.FromXml2(Item, Module)=0D @@ -824,21 +866,24 @@ class ModuleSurfaceAreaXml(object): # ModuleProperties=0D #=0D Tmp =3D ModulePropertyXml()=0D - DomModule.appendChild(Tmp.ToXml(Module, Module.GetBootModeList(), = Module.GetEventList(), Module.GetHobList(), \=0D + DomModule.appendChild(Tmp.ToXml(Module, Module.GetBootModeList(), = Module.GetEventList(), Module.GetHobList(),=0D 'ModuleProperties'))=0D #=0D # ClonedFrom=0D #=0D Tmp =3D ClonedFromXml()=0D if Module.GetClonedFrom():=0D - DomModule.appendChild(Tmp.ToXml(Module.GetClonedFrom(), 'Clone= dFrom'))=0D + DomModule.appendChild(=0D + Tmp.ToXml(Module.GetClonedFrom(), 'ClonedFrom'))=0D #=0D # LibraryClass=0D #=0D - LibraryClassNode =3D CreateXmlElement('LibraryClassDefinitions', '= ', [], [])=0D + LibraryClassNode =3D CreateXmlElement(=0D + 'LibraryClassDefinitions', '', [], [])=0D for LibraryClass in Module.GetLibraryClassList():=0D Tmp =3D LibraryClassXml()=0D - LibraryClassNode.appendChild(Tmp.ToXml2(LibraryClass, 'Library= Class'))=0D + LibraryClassNode.appendChild(=0D + Tmp.ToXml2(LibraryClass, 'LibraryClass'))=0D DomModule.appendChild(LibraryClassNode)=0D #=0D # SourceFile=0D @@ -859,10 +904,12 @@ class ModuleSurfaceAreaXml(object): #=0D # PackageDependencies=0D #=0D - PackageDependencyNode =3D CreateXmlElement('PackageDependencies', = '', [], [])=0D + PackageDependencyNode =3D CreateXmlElement(=0D + 'PackageDependencies', '', [], [])=0D for PackageDependency in Module.GetPackageDependencyList():=0D Tmp =3D PackageXml()=0D - PackageDependencyNode.appendChild(Tmp.ToXml(PackageDependency,= 'Package'))=0D + PackageDependencyNode.appendChild(=0D + Tmp.ToXml(PackageDependency, 'Package'))=0D DomModule.appendChild(PackageDependencyNode)=0D =0D #=0D @@ -871,7 +918,8 @@ class ModuleSurfaceAreaXml(object): GuidProtocolPpiNode =3D CreateXmlElement('Guids', '', [], [])=0D for GuidProtocolPpi in Module.GetGuidList():=0D Tmp =3D GuidXml('Module')=0D - GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Gu= idCName'))=0D + GuidProtocolPpiNode.appendChild(=0D + Tmp.ToXml(GuidProtocolPpi, 'GuidCName'))=0D DomModule.appendChild(GuidProtocolPpiNode)=0D =0D #=0D @@ -880,7 +928,8 @@ class ModuleSurfaceAreaXml(object): GuidProtocolPpiNode =3D CreateXmlElement('Protocols', '', [], [])= =0D for GuidProtocolPpi in Module.GetProtocolList():=0D Tmp =3D ProtocolXml('Module')=0D - GuidProtocolPpiNode.appendChild(Tmp.ToXml(GuidProtocolPpi, 'Pr= otocol'))=0D + GuidProtocolPpiNode.appendChild(=0D + Tmp.ToXml(GuidProtocolPpi, 'Protocol'))=0D DomModule.appendChild(GuidProtocolPpiNode)=0D =0D #=0D @@ -937,20 +986,24 @@ class ModuleSurfaceAreaXml(object): #=0D if Module.GetMiscFileList():=0D Tmp =3D MiscellaneousFileXml()=0D - DomModule.appendChild(Tmp.ToXml(Module.GetMiscFileList()[0], '= MiscellaneousFiles'))=0D + DomModule.appendChild(=0D + Tmp.ToXml(Module.GetMiscFileList()[0], 'MiscellaneousFiles= '))=0D #=0D # UserExtensions=0D #=0D if Module.GetUserExtensionList():=0D for UserExtension in Module.GetUserExtensionList():=0D Tmp =3D UserExtensionsXml()=0D - DomModule.appendChild(Tmp.ToXml(UserExtension, 'UserExtens= ions'))=0D + DomModule.appendChild(=0D + Tmp.ToXml(UserExtension, 'UserExtensions'))=0D =0D return DomModule=0D =0D ##=0D # BuildFlagXml used to generate BuildFlag for =0D #=0D +=0D +=0D class BuildFlagXml(object):=0D def __init__(self):=0D self.Target =3D ''=0D diff --git a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py b/Bas= eTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py index 103939023bcf..9e1df1faf56d 100644 --- a/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py +++ b/BaseTools/Source/Python/UPT/Xml/PackageSurfaceAreaXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a Package file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -35,6 +35,8 @@ from Xml.PcdXml import PcdEntryXml ##=0D # IndustryStandardHeaderXml=0D #=0D +=0D +=0D class IndustryStandardHeaderXml(object):=0D def __init__(self):=0D self.HeaderFile =3D ''=0D @@ -72,6 +74,8 @@ class IndustryStandardHeaderXml(object): ##=0D # PackageIncludeHeaderXml=0D #=0D +=0D +=0D class PackageIncludeHeaderXml(object):=0D def __init__(self):=0D self.HeaderFile =3D ''=0D @@ -80,7 +84,8 @@ class PackageIncludeHeaderXml(object): =0D def FromXml(self, Item, Key):=0D self.HeaderFile =3D XmlElement(Item, '%s/HeaderFile' % Key)=0D - self.CommonDefines.FromXml(XmlNode(Item, '%s/HeaderFile' % Key), '= HeaderFile')=0D + self.CommonDefines.FromXml(=0D + XmlNode(Item, '%s/HeaderFile' % Key), 'HeaderFile')=0D for HelpTextItem in XmlList(Item, '%s/HelpText' % Key):=0D HelpTextObj =3D HelpTextXml()=0D HelpTextObj.FromXml(HelpTextItem, '%s/HelpText' % Key)=0D @@ -98,10 +103,11 @@ class PackageIncludeHeaderXml(object): def ToXml(self, PackageIncludeHeader, Key):=0D if self.HeaderFile:=0D pass=0D - AttributeList =3D [['SupArchList', GetStringOfList(PackageIncludeH= eader.GetSupArchList())], \=0D + AttributeList =3D [['SupArchList', GetStringOfList(PackageIncludeH= eader.GetSupArchList())],=0D ['SupModList', GetStringOfList(PackageIncludeHead= er.GetSupModuleList())], ]=0D =0D - HeaderFileNode =3D CreateXmlElement('HeaderFile', PackageIncludeHe= ader.FilePath, [], AttributeList)=0D + HeaderFileNode =3D CreateXmlElement(=0D + 'HeaderFile', PackageIncludeHeader.FilePath, [], AttributeList= )=0D =0D NodeList =3D [HeaderFileNode]=0D for Item in PackageIncludeHeader.GetHelpTextList():=0D @@ -121,6 +127,8 @@ class PackageIncludeHeaderXml(object): ##=0D # PcdCheckXml=0D #=0D +=0D +=0D class PcdCheckXml(object):=0D def __init__(self):=0D self.PcdCheck =3D ''=0D @@ -144,6 +152,8 @@ class PcdCheckXml(object): ##=0D # PackageSurfaceAreaXml=0D #=0D +=0D +=0D class PackageSurfaceAreaXml(object):=0D def __init__(self):=0D self.Package =3D None=0D @@ -159,13 +169,15 @@ class PackageSurfaceAreaXml(object): # Header=0D #=0D Tmp =3D PackageHeaderXml()=0D - Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/Header'), 'Header',= Package)=0D + Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/Header'),=0D + 'Header', Package)=0D #=0D # ClonedFrom=0D #=0D Tmp =3D ClonedFromXml()=0D if XmlNode(Item, '/PackageSurfaceArea/ClonedFrom'):=0D - ClonedFrom =3D Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/= ClonedFrom'), 'ClonedFrom')=0D + ClonedFrom =3D Tmp.FromXml(=0D + XmlNode(Item, '/PackageSurfaceArea/ClonedFrom'), 'ClonedFr= om')=0D Package.SetClonedFromList([ClonedFrom])=0D #=0D # LibraryClass=0D @@ -174,7 +186,8 @@ class PackageSurfaceAreaXml(object): for SubItem in XmlList(Item, '/PackageSurfaceArea/LibraryClassDecl= arations/LibraryClass'):=0D Tmp =3D LibraryClassXml()=0D LibraryClass =3D Tmp.FromXml(SubItem, 'LibraryClass')=0D - Package.SetLibraryClassList(Package.GetLibraryClassList() + [L= ibraryClass])=0D + Package.SetLibraryClassList(=0D + Package.GetLibraryClassList() + [LibraryClass])=0D =0D if XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations') a= nd \=0D not XmlList(Item, '/PackageSurfaceArea/LibraryClassDeclarations= /LibraryClass'):=0D @@ -186,20 +199,21 @@ class PackageSurfaceAreaXml(object): for SubItem in XmlList(Item, '/PackageSurfaceArea/IndustryStandard= Includes/IndustryStandardHeader'):=0D Tmp =3D IndustryStandardHeaderXml()=0D Include =3D Tmp.FromXml(SubItem, 'IndustryStandardHeader')=0D - Package.SetStandardIncludeFileList(Package.GetStandardIncludeF= ileList() + [Include])=0D + Package.SetStandardIncludeFileList(=0D + Package.GetStandardIncludeFileList() + [Include])=0D =0D if XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes') a= nd \=0D - not XmlList(Item, '/PackageSurfaceArea/IndustryStandardIncludes/In= dustryStandardHeader'):=0D + not XmlList(Item, '/PackageSurfaceArea/IndustryStandardInc= ludes/IndustryStandardHeader'):=0D Package.SetStandardIncludeFileList([None])=0D =0D -=0D #=0D # PackageHeader=0D #=0D for SubItem in XmlList(Item, '/PackageSurfaceArea/PackageIncludes/= PackageHeader'):=0D Tmp =3D PackageIncludeHeaderXml()=0D Include =3D Tmp.FromXml(SubItem, 'PackageHeader')=0D - Package.SetPackageIncludeFileList(Package.GetPackageIncludeFil= eList() + [Include])=0D + Package.SetPackageIncludeFileList(=0D + Package.GetPackageIncludeFileList() + [Include])=0D =0D if XmlList(Item, '/PackageSurfaceArea/PackageIncludes') and not \= =0D XmlList(Item, '/PackageSurfaceArea/PackageIncludes/PackageHeade= r'):=0D @@ -223,7 +237,8 @@ class PackageSurfaceAreaXml(object): for SubItem in XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarat= ions/Entry'):=0D Tmp =3D ProtocolXml('Package')=0D GuidProtocolPpi =3D Tmp.FromXml(SubItem, 'Entry')=0D - Package.SetProtocolList(Package.GetProtocolList() + [GuidProto= colPpi])=0D + Package.SetProtocolList(=0D + Package.GetProtocolList() + [GuidProtocolPpi])=0D =0D if XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations') and n= ot \=0D XmlList(Item, '/PackageSurfaceArea/ProtocolDeclarations/Entry')= :=0D @@ -256,8 +271,7 @@ class PackageSurfaceAreaXml(object): PcdErrorMessageList =3D PcdErrorObj.GetErrorMessageList()= =0D if PcdErrorMessageList:=0D Package.PcdErrorCommentDict[(PcdEntry.GetTokenSpaceGui= dCName(), PcdErrorObj.GetErrorNumber())] =3D \=0D - PcdErrorMessageList=0D -=0D + PcdErrorMessageList=0D =0D if XmlList(Item, '/PackageSurfaceArea/PcdDeclarations') and not \= =0D XmlList(Item, '/PackageSurfaceArea/PcdDeclarations/PcdEntry'):= =0D @@ -277,13 +291,15 @@ class PackageSurfaceAreaXml(object): for SubItem in XmlList(Item, '/PackageSurfaceArea/Modules/ModuleSu= rfaceArea'):=0D Tmp =3D ModuleSurfaceAreaXml()=0D Module =3D Tmp.FromXml(SubItem, 'ModuleSurfaceArea')=0D - ModuleDictKey =3D (Module.GetGuid(), Module.GetVersion(), Modu= le.GetName(), Module.GetModulePath())=0D + ModuleDictKey =3D (Module.GetGuid(), Module.GetVersion(),=0D + Module.GetName(), Module.GetModulePath())=0D Package.ModuleDict[ModuleDictKey] =3D Module=0D #=0D # MiscellaneousFile=0D #=0D Tmp =3D MiscellaneousFileXml()=0D - MiscFileList =3D Tmp.FromXml(XmlNode(Item, '/PackageSurfaceArea/Mi= scellaneousFiles'), 'MiscellaneousFiles')=0D + MiscFileList =3D Tmp.FromXml(=0D + XmlNode(Item, '/PackageSurfaceArea/MiscellaneousFiles'), 'Misc= ellaneousFiles')=0D if MiscFileList:=0D Package.SetMiscFileList([MiscFileList])=0D else:=0D @@ -317,30 +333,37 @@ class PackageSurfaceAreaXml(object): #=0D Tmp =3D ClonedFromXml()=0D if Package.GetClonedFromList() !=3D []:=0D - DomPackage.appendChild(Tmp.ToXml(Package.GetClonedFromList[0],= 'ClonedFrom'))=0D + DomPackage.appendChild(=0D + Tmp.ToXml(Package.GetClonedFromList[0], 'ClonedFrom'))=0D #=0D # LibraryClass=0D #=0D - LibraryClassNode =3D CreateXmlElement('LibraryClassDeclarations', = '', [], [])=0D + LibraryClassNode =3D CreateXmlElement(=0D + 'LibraryClassDeclarations', '', [], [])=0D for LibraryClass in Package.GetLibraryClassList():=0D Tmp =3D LibraryClassXml()=0D - LibraryClassNode.appendChild(Tmp.ToXml(LibraryClass, 'LibraryC= lass'))=0D + LibraryClassNode.appendChild(=0D + Tmp.ToXml(LibraryClass, 'LibraryClass'))=0D DomPackage.appendChild(LibraryClassNode)=0D #=0D # IndustryStandardHeader=0D #=0D - IndustryStandardHeaderNode =3D CreateXmlElement('IndustryStandardI= ncludes', '', [], [])=0D + IndustryStandardHeaderNode =3D CreateXmlElement(=0D + 'IndustryStandardIncludes', '', [], [])=0D for Include in Package.GetStandardIncludeFileList():=0D Tmp =3D IndustryStandardHeaderXml()=0D - IndustryStandardHeaderNode.appendChild(Tmp.ToXml(Include, 'Ind= ustryStandardHeader'))=0D + IndustryStandardHeaderNode.appendChild(=0D + Tmp.ToXml(Include, 'IndustryStandardHeader'))=0D DomPackage.appendChild(IndustryStandardHeaderNode)=0D #=0D # PackageHeader=0D #=0D - PackageIncludeHeaderNode =3D CreateXmlElement('PackageIncludes', '= ', [], [])=0D + PackageIncludeHeaderNode =3D CreateXmlElement(=0D + 'PackageIncludes', '', [], [])=0D for Include in Package.GetPackageIncludeFileList():=0D Tmp =3D PackageIncludeHeaderXml()=0D - PackageIncludeHeaderNode.appendChild(Tmp.ToXml(Include, 'Packa= geHeader'))=0D + PackageIncludeHeaderNode.appendChild(=0D + Tmp.ToXml(Include, 'PackageHeader'))=0D DomPackage.appendChild(PackageIncludeHeaderNode)=0D ModuleNode =3D CreateXmlElement('Modules', '', [], [])=0D for Module in Package.GetModuleDict().values():=0D @@ -353,18 +376,18 @@ class PackageSurfaceAreaXml(object): GuidProtocolPpiNode =3D CreateXmlElement('GuidDeclarations', '', [= ], [])=0D for GuidProtocolPpi in Package.GetGuidList():=0D Tmp =3D GuidXml('Package')=0D - GuidProtocolPpiNode.appendChild(Tmp.ToXml\=0D + GuidProtocolPpiNode.appendChild(Tmp.ToXml=0D (GuidProtocolPpi, 'Entry'))=0D DomPackage.appendChild(GuidProtocolPpiNode)=0D #=0D # Protocol=0D #=0D GuidProtocolPpiNode =3D \=0D - CreateXmlElement('ProtocolDeclarations', '', [], [])=0D + CreateXmlElement('ProtocolDeclarations', '', [], [])=0D for GuidProtocolPpi in Package.GetProtocolList():=0D Tmp =3D ProtocolXml('Package')=0D - GuidProtocolPpiNode.appendChild\=0D - (Tmp.ToXml(GuidProtocolPpi, 'Entry'))=0D + GuidProtocolPpiNode.appendChild(=0D + Tmp.ToXml(GuidProtocolPpi, 'Entry'))=0D DomPackage.appendChild(GuidProtocolPpiNode)=0D #=0D # Ppi=0D @@ -372,8 +395,8 @@ class PackageSurfaceAreaXml(object): GuidProtocolPpiNode =3D CreateXmlElement('PpiDeclarations', '', []= , [])=0D for GuidProtocolPpi in Package.GetPpiList():=0D Tmp =3D PpiXml('Package')=0D - GuidProtocolPpiNode.appendChild\=0D - (Tmp.ToXml(GuidProtocolPpi, 'Entry'))=0D + GuidProtocolPpiNode.appendChild(=0D + Tmp.ToXml(GuidProtocolPpi, 'Entry'))=0D DomPackage.appendChild(GuidProtocolPpiNode)=0D #=0D # PcdEntry=0D @@ -389,7 +412,8 @@ class PackageSurfaceAreaXml(object): #=0D Tmp =3D MiscellaneousFileXml()=0D if Package.GetMiscFileList():=0D - DomPackage.appendChild(Tmp.ToXml(Package.GetMiscFileList()[0],= 'MiscellaneousFiles'))=0D + DomPackage.appendChild(=0D + Tmp.ToXml(Package.GetMiscFileList()[0], 'MiscellaneousFile= s'))=0D =0D #=0D # UserExtensions=0D @@ -397,6 +421,7 @@ class PackageSurfaceAreaXml(object): if Package.GetUserExtensionList():=0D for UserExtension in Package.GetUserExtensionList():=0D Tmp =3D UserExtensionsXml()=0D - DomPackage.appendChild(Tmp.ToXml(UserExtension, 'UserExten= sions'))=0D + DomPackage.appendChild(=0D + Tmp.ToXml(UserExtension, 'UserExtensions'))=0D =0D return DomPackage=0D diff --git a/BaseTools/Source/Python/UPT/Xml/PcdXml.py b/BaseTools/Source/P= ython/UPT/Xml/PcdXml.py index bbcee45a0132..22fa048afbc3 100644 --- a/BaseTools/Source/Python/UPT/Xml/PcdXml.py +++ b/BaseTools/Source/Python/UPT/Xml/PcdXml.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a PCD file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -35,6 +35,8 @@ import re ##=0D # PcdErrorXml=0D #=0D +=0D +=0D class PcdErrorXml(object):=0D def __init__(self):=0D self.ValidValueList =3D ''=0D @@ -47,14 +49,15 @@ class PcdErrorXml(object): def FromXml(self, Item, Key):=0D self.ValidValueList =3D XmlElement(Item, '%s/ValidValueList' % Key= )=0D self.ValidValueListLang =3D \=0D - XmlAttribute(XmlNode(Item, '%s/ValidValueList' % Key), 'Lang')=0D - self.ValidValueRange =3D self.TransferValidEpxr2ValidRange(XmlElem= ent(Item, '%s/ValidValueRange' % Key))=0D + XmlAttribute(XmlNode(Item, '%s/ValidValueList' % Key), 'Lang')= =0D + self.ValidValueRange =3D self.TransferValidEpxr2ValidRange(=0D + XmlElement(Item, '%s/ValidValueRange' % Key))=0D self.Expression =3D XmlElement(Item, '%s/Expression' % Key)=0D self.ErrorNumber =3D XmlElement(Item, '%s/ErrorNumber' % Key)=0D for ErrMsg in XmlList(Item, '%s/ErrorMessage' % Key):=0D ErrorMessageString =3D XmlElement(ErrMsg, 'ErrorMessage')=0D ErrorMessageLang =3D \=0D - XmlAttribute(XmlNode(ErrMsg, 'ErrorMessage'), 'Lang')=0D + XmlAttribute(XmlNode(ErrMsg, 'ErrorMessage'), 'Lang')=0D self.ErrorMessage.append((ErrorMessageLang, ErrorMessageString= ))=0D =0D Error =3D PcdErrorObject()=0D @@ -74,16 +77,16 @@ class PcdErrorXml(object): NodeList =3D []=0D if PcdError.GetValidValue():=0D Element1 =3D \=0D - CreateXmlElement('ValidValueList', PcdError.GetValidValue(), [= ], \=0D - [['Lang', PcdError.GetValidValueLang()]])=0D + CreateXmlElement('ValidValueList', PcdError.GetValidValue(= ), [],=0D + [['Lang', PcdError.GetValidValueLang()]])= =0D NodeList.append(Element1)=0D if PcdError.GetValidValueRange():=0D TansferedRangeStr =3D self.TransferValidRange2Expr(PcdError.Ge= tTokenSpaceGuidCName(),=0D PcdError.GetC= Name(),=0D PcdError.GetV= alidValueRange())=0D Element1 =3D \=0D - CreateXmlElement('ValidValueRange', \=0D - TansferedRangeStr, [], [])=0D + CreateXmlElement('ValidValueRange',=0D + TansferedRangeStr, [], [])=0D NodeList.append(Element1)=0D if PcdError.GetExpression():=0D NodeList.append(['Expression', PcdError.GetExpression()])=0D @@ -91,7 +94,8 @@ class PcdErrorXml(object): NodeList.append(['ErrorNumber', PcdError.GetErrorNumber()])=0D for Item in PcdError.GetErrorMessageList():=0D Element =3D \=0D - CreateXmlElement('ErrorMessage', Item[1], [], [['Lang', Item[0= ]]])=0D + CreateXmlElement('ErrorMessage', Item[1], [], [=0D + ['Lang', Item[0]]])=0D NodeList.append(Element)=0D Root =3D CreateXmlElement('%s' % Key, '', NodeList, AttributeList)= =0D =0D @@ -137,7 +141,8 @@ class PcdErrorXml(object): for MatchStr in HexMatchedList:=0D RangeItemList =3D MatchStr.strip().split('-')=0D TransferedRangeStr =3D '(%s GE %s) AND (%s LE %s)' % \=0D - (PcdName, RangeItemList[0].strip(), PcdName, RangeItemList= [1].strip())=0D + (PcdName, RangeItemList[0].strip(),=0D + PcdName, RangeItemList[1].strip())=0D ValidRange =3D ValidRange.replace(MatchStr, TransferedRangeStr= )=0D #=0D # Convert INT1 format range=0D @@ -148,7 +153,8 @@ class PcdErrorXml(object): for MatchStr in IntMatchedList:=0D RangeItemList =3D MatchStr.strip().split('-')=0D TransferedRangeStr =3D '(%s GE %s) AND (%s LE %s)' % \=0D - (PcdName, RangeItemList[0].strip(), PcdName, RangeItemList= [1].strip())=0D + (PcdName, RangeItemList[0].strip(),=0D + PcdName, RangeItemList[1].strip())=0D ValidRange =3D ValidRange.replace(MatchStr, TransferedRangeStr= )=0D =0D return ValidRange=0D @@ -158,18 +164,20 @@ class PcdErrorXml(object): pass=0D =0D PCD_PATTERN =3D \=0D - '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_= ]*[\t\s]*'=0D + '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z= 0-9_]*[\t\s]*'=0D IntPattern1 =3D \=0D - '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+\d+[\t\s]*\)[\t\s]= +AND[\t\s]+\([\t\s]*'+\=0D - PCD_PATTERN+'[\t\s]+LE[\t\s]+\d+[\t\s]*\)'=0D + '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+\d+[\t\s]*\)[\= t\s]+AND[\t\s]+\([\t\s]*' +\=0D + PCD_PATTERN+'[\t\s]+LE[\t\s]+\d+[\t\s]*\)'=0D IntPattern1 =3D IntPattern1.replace(' ', '')=0D - IntPattern2 =3D '[\t\s]*'+PCD_PATTERN+'[\t\s]+(LT|GT|LE|GE|XOR|EQ)= [\t\s]+\d+[\t\s]*'=0D + IntPattern2 =3D '[\t\s]*'+PCD_PATTERN + \=0D + '[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+\d+[\t\s]*'=0D =0D HexPattern1 =3D \=0D - '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+0[xX][0-9a-fA-F]+[= \t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*'+\=0D - PCD_PATTERN+'[\t\s]+LE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)'=0D + '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+0[xX][0-9a-fA-= F]+[\t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*' +\=0D + PCD_PATTERN+'[\t\s]+LE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)'=0D HexPattern1 =3D HexPattern1.replace(' ', '')=0D - HexPattern2 =3D '[\t\s]*'+PCD_PATTERN+'[\t\s]+(LT|GT|LE|GE|XOR|EQ)= [\t\s]+0[xX][0-9a-zA-Z]+[\t\s]*'=0D + HexPattern2 =3D '[\t\s]*'+PCD_PATTERN + \=0D + '[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+0[xX][0-9a-zA-Z]+[\t\s]*'=0D =0D #=0D # Do the Hex1 conversion=0D @@ -180,7 +188,8 @@ class PcdErrorXml(object): #=0D # To match items on both sides of '-'=0D #=0D - RangeItemList =3D re.compile('[\t\s]*0[xX][0-9a-fA-F]+[\t\s]*'= ).findall(HexMatchedItem)=0D + RangeItemList =3D re.compile(=0D + '[\t\s]*0[xX][0-9a-fA-F]+[\t\s]*').findall(HexMatchedItem)= =0D if RangeItemList and len(RangeItemList) =3D=3D 2:=0D HexRangeDict[HexMatchedItem] =3D RangeItemList=0D =0D @@ -204,7 +213,8 @@ class PcdErrorXml(object): #=0D # To match items on both sides of '-'=0D #=0D - RangeItemList =3D re.compile('[\t\s]*\d+[\t\s]*').findall(Matc= hedItem)=0D + RangeItemList =3D re.compile(=0D + '[\t\s]*\d+[\t\s]*').findall(MatchedItem)=0D if RangeItemList and len(RangeItemList) =3D=3D 2:=0D IntRangeDict[MatchedItem] =3D RangeItemList=0D =0D @@ -236,17 +246,17 @@ class PcdErrorXml(object): =0D return ValidRangeExpr=0D =0D -=0D -=0D def __str__(self):=0D return "ValidValueList =3D %s ValidValueListLang =3D %s ValidValue= Range \=0D =3D %s Expression =3D %s ErrorNumber =3D %s %s" % \=0D - (self.ValidValueList, self.ValidValueListLang, self.ValidValueRang= e, \=0D - self.Expression, self.ErrorNumber, self.ErrorMessage)=0D + (self.ValidValueList, self.ValidValueListLang, self.ValidValue= Range,=0D + self.Expression, self.ErrorNumber, self.ErrorMessage)=0D =0D ##=0D # PcdEntryXml=0D #=0D +=0D +=0D class PcdEntryXml(object):=0D def __init__(self):=0D self.PcdItemType =3D ''=0D @@ -272,12 +282,12 @@ class PcdEntryXml(object): #=0D def FromXml(self, Item, Key):=0D self.PcdItemType =3D \=0D - XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')=0D + XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')=0D self.PcdUsage =3D XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsag= e')=0D self.TokenSpaceGuidCName =3D \=0D - XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)=0D + XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)=0D self.TokenSpaceGuidValue =3D \=0D - XmlElement(Item, '%s/TokenSpaceGuidValue' % Key)=0D + XmlElement(Item, '%s/TokenSpaceGuidValue' % Key)=0D self.Token =3D XmlElement(Item, '%s/Token' % Key)=0D self.CName =3D XmlElement(Item, '%s/CName' % Key)=0D self.PcdCName =3D XmlElement(Item, '%s/PcdCName' % Key)=0D @@ -315,7 +325,8 @@ class PcdEntryXml(object): PcdEntry.SetValidUsage(self.ValidUsage)=0D PcdEntry.SetDefaultValue(self.DefaultValue)=0D PcdEntry.SetMaxDatumSize(self.MaxDatumSize)=0D - PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.Featur= eFlag))=0D + PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(=0D + self.CommonDefines.FeatureFlag))=0D PcdEntry.SetItemType(self.PcdItemType)=0D =0D PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))=0D @@ -325,9 +336,10 @@ class PcdEntryXml(object): ##=0D # Package will use FromXml2=0D #=0D +=0D def FromXml2(self, Item, Key):=0D self.TokenSpaceGuidCName =3D \=0D - XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)=0D + XmlElement(Item, '%s/TokenSpaceGuidCname' % Key)=0D self.Token =3D XmlElement(Item, '%s/Token' % Key)=0D self.CName =3D XmlElement(Item, '%s/CName' % Key)=0D self.DatumType =3D XmlElement(Item, '%s/DatumType' % Key)=0D @@ -360,7 +372,8 @@ class PcdEntryXml(object): PcdEntry.SetValidUsage(self.ValidUsage)=0D PcdEntry.SetDefaultValue(self.DefaultValue)=0D PcdEntry.SetMaxDatumSize(self.MaxDatumSize)=0D - PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.Featur= eFlag))=0D + PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(=0D + self.CommonDefines.FeatureFlag))=0D =0D PcdEntry.SetPromptList(GetPromptList(self.Prompt))=0D PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))=0D @@ -373,10 +386,10 @@ class PcdEntryXml(object): #=0D def FromXml3(self, Item, Key):=0D self.PcdItemType =3D \=0D - XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')=0D + XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdItemType')=0D self.PcdUsage =3D XmlAttribute(XmlNode(Item, '%s' % Key), 'PcdUsag= e')=0D self.TokenSpaceGuidCName =3D \=0D - XmlElement(Item, '%s/TokenSpaceGuidCName' % Key)=0D + XmlElement(Item, '%s/TokenSpaceGuidCName' % Key)=0D self.CName =3D XmlElement(Item, '%s/CName' % Key)=0D self.DefaultValue =3D XmlElement(Item, '%s/DefaultValue' % Key)=0D self.CommonDefines.FromXml(XmlNode(Item, '%s' % Key), Key)=0D @@ -397,7 +410,8 @@ class PcdEntryXml(object): PcdEntry.SetCName(self.CName)=0D PcdEntry.SetValidUsage(self.PcdUsage)=0D PcdEntry.SetDefaultValue(self.DefaultValue)=0D - PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(self.CommonDefines.Featur= eFlag))=0D + PcdEntry.SetFeatureFlag(ConvertNOTEQToNE(=0D + self.CommonDefines.FeatureFlag))=0D PcdEntry.SetItemType(self.PcdItemType)=0D =0D PcdEntry.SetHelpTextList(GetHelpTextList(self.HelpText))=0D @@ -412,11 +426,11 @@ class PcdEntryXml(object): DefaultValue =3D ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())=0D =0D AttributeList =3D \=0D - [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \=0D - ['PcdUsage', PcdEntry.GetValidUsage()], \=0D - ['PcdItemType', PcdEntry.GetItemType()], \=0D - ['FeatureFlag', PcdEntry.GetFeatureFlag()],=0D - ]=0D + [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())],= =0D + ['PcdUsage', PcdEntry.GetValidUsage()],=0D + ['PcdItemType', PcdEntry.GetItemType()],=0D + ['FeatureFlag', PcdEntry.GetFeatureFlag()],=0D + ]=0D NodeList =3D [['TokenSpaceGuidCname', PcdEntry.GetTokenSpaceGuidCN= ame()],=0D ['TokenSpaceGuidValue', PcdEntry.GetTokenSpaceGuidValu= e()],=0D ['Token', PcdEntry.GetToken()],=0D @@ -426,7 +440,7 @@ class PcdEntryXml(object): ['DefaultValue', DefaultValue],=0D ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],=0D ['Offset', PcdEntry.GetOffset()],=0D - ]=0D + ]=0D =0D for Item in PcdEntry.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -441,6 +455,7 @@ class PcdEntryXml(object): ##=0D # Package will use ToXml2=0D #=0D +=0D def ToXml2(self, PcdEntry, Key):=0D if self.PcdCName:=0D pass=0D @@ -448,9 +463,9 @@ class PcdEntryXml(object): DefaultValue =3D ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())=0D =0D AttributeList =3D \=0D - [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \=0D - ['SupModList', GetStringOfList(PcdEntry.GetSupModuleList())]=0D - ]=0D + [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())],= =0D + ['SupModList', GetStringOfList(PcdEntry.GetSupModuleList())]= =0D + ]=0D NodeList =3D [['TokenSpaceGuidCname', PcdEntry.GetTokenSpaceGuidCN= ame()],=0D ['Token', PcdEntry.GetToken()],=0D ['CName', PcdEntry.GetCName()],=0D @@ -458,7 +473,7 @@ class PcdEntryXml(object): ['ValidUsage', GetStringOfList(PcdEntry.GetValidUsage(= ))],=0D ['DefaultValue', DefaultValue],=0D ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],=0D - ]=0D + ]=0D for Item in PcdEntry.GetPromptList():=0D Tmp =3D PromptXml()=0D NodeList.append(Tmp.ToXml(Item))=0D @@ -477,6 +492,7 @@ class PcdEntryXml(object): ##=0D # Module will use ToXml3=0D #=0D +=0D def ToXml3(self, PcdEntry, Key):=0D if self.PcdCName:=0D pass=0D @@ -484,15 +500,15 @@ class PcdEntryXml(object): DefaultValue =3D ConvertNEToNOTEQ(PcdEntry.GetDefaultValue())=0D =0D AttributeList =3D \=0D - [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())], \=0D - ['PcdUsage', PcdEntry.GetValidUsage()], \=0D - ['PcdItemType', PcdEntry.GetItemType()], \=0D - ['FeatureFlag', ConvertNEToNOTEQ(PcdEntry.GetFeatureFlag())],=0D - ]=0D + [['SupArchList', GetStringOfList(PcdEntry.GetSupArchList())],= =0D + ['PcdUsage', PcdEntry.GetValidUsage()],=0D + ['PcdItemType', PcdEntry.GetItemType()],=0D + ['FeatureFlag', ConvertNEToNOTEQ(PcdEntry.GetFeatureFlag()= )],=0D + ]=0D NodeList =3D [['CName', PcdEntry.GetCName()],=0D ['TokenSpaceGuidCName', PcdEntry.GetTokenSpaceGuidCNam= e()],=0D ['DefaultValue', DefaultValue],=0D - ]=0D + ]=0D =0D for Item in PcdEntry.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -517,14 +533,14 @@ class PcdEntryXml(object): AttributeList =3D []=0D =0D NodeList =3D [=0D - ['TokenSpaceGuidValue', PcdEntry.GetTokenSpaceGuidValu= e()],=0D - ['PcdCName', PcdEntry.GetCName()],=0D - ['Token', PcdEntry.GetToken()],=0D - ['DatumType', PcdEntry.GetDatumType()],=0D - ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],=0D - ['Value', DefaultValue],=0D - ['Offset', PcdEntry.GetOffset()]=0D - ]=0D + ['TokenSpaceGuidValue', PcdEntry.GetTokenSpaceGuidValue()],=0D + ['PcdCName', PcdEntry.GetCName()],=0D + ['Token', PcdEntry.GetToken()],=0D + ['DatumType', PcdEntry.GetDatumType()],=0D + ['MaxDatumSize', PcdEntry.GetMaxDatumSize()],=0D + ['Value', DefaultValue],=0D + ['Offset', PcdEntry.GetOffset()]=0D + ]=0D =0D for Item in PcdEntry.GetHelpTextList():=0D Tmp =3D HelpTextXml()=0D @@ -537,17 +553,16 @@ class PcdEntryXml(object): =0D return Root=0D =0D -=0D def __str__(self):=0D Str =3D \=0D - ('PcdItemType =3D %s PcdUsage =3D %s TokenSpaceGuidCName =3D %s \= =0D + ('PcdItemType =3D %s PcdUsage =3D %s TokenSpaceGuidCName =3D %= s \=0D TokenSpaceGuidValue =3D %s Token =3D %s CName =3D %s PcdCName =3D = %s \=0D DatumType =3D %s ValidUsage =3D %s DefaultValue =3D %s MaxDatumSiz= e =3D %s \=0D Value =3D %s Offset =3D %s %s') % \=0D - (self.PcdItemType, self.PcdUsage, self.TokenSpaceGuidCName, \=0D - self.TokenSpaceGuidValue, self.Token, self.CName, self.PcdCName, = \=0D - self.DatumType, self.ValidUsage, self.DefaultValue, \=0D - self.MaxDatumSize, self.Value, self.Offset, self.CommonDefines)=0D + (self.PcdItemType, self.PcdUsage, self.TokenSpaceGuidCName,=0D + self.TokenSpaceGuidValue, self.Token, self.CName, self.PcdCNa= me,=0D + self.DatumType, self.ValidUsage, self.DefaultValue,=0D + self.MaxDatumSize, self.Value, self.Offset, self.CommonDefine= s)=0D for Item in self.HelpText:=0D Str =3D Str + "\n\t" + str(Item)=0D for Item in self.PcdError:=0D diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParser.py b/BaseTools/Sourc= e/Python/UPT/Xml/XmlParser.py index 8e22a280f655..789c8b958c75 100644 --- a/BaseTools/Source/Python/UPT/Xml/XmlParser.py +++ b/BaseTools/Source/Python/UPT/Xml/XmlParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a xml file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -48,12 +48,14 @@ import Logger.Log as Logger ##=0D # DistributionPackageXml=0D #=0D +=0D +=0D class DistributionPackageXml(object):=0D def __init__(self):=0D self.DistP =3D DistributionPackageClass()=0D self.Pkg =3D ''=0D =0D - ## ValidateDistributionPackage=0D + # ValidateDistributionPackage=0D #=0D # Check if any required item is missing in DistributionPackage=0D #=0D @@ -64,7 +66,7 @@ class DistributionPackageXml(object): # Check DistributionPackage -> DistributionHeader=0D #=0D XmlTreeLevel =3D ['DistributionPackage', '']=0D - CheckDict =3D {'DistributionHeader':self.DistP.Header }=0D + CheckDict =3D {'DistributionHeader': self.DistP.Header}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D if self.DistP.Header:=0D @@ -110,7 +112,8 @@ class DistributionPackageXml(object): # Check Each Module=0D #=0D for Key in self.DistP.ModuleSurfaceArea:=0D - ValidateMS(self.DistP.ModuleSurfaceArea[Key], ['Distributi= onPackage', 'ModuleSurfaceArea'])=0D + ValidateMS(self.DistP.ModuleSurfaceArea[Key], [=0D + 'DistributionPackage', 'ModuleSurfaceArea'])=0D =0D #=0D # Check Each Tool=0D @@ -133,16 +136,19 @@ class DistributionPackageXml(object): # Check Each Misc File=0D #=0D if self.DistP.MiscellaneousFiles:=0D - XmlTreeLevel =3D ['DistributionPackage', 'MiscellaneousFil= es', 'Header']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'MiscellaneousFiles', 'Header']=0D CheckDict =3D {'Name': self.DistP.MiscellaneousFiles.GetNa= me(), }=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D if not self.DistP.MiscellaneousFiles.GetFileList():=0D - XmlTreeLevel =3D ['DistributionPackage', 'Miscellaneou= sFiles']=0D + XmlTreeLevel =3D [=0D + 'DistributionPackage', 'MiscellaneousFiles']=0D CheckDict =3D {'FileName': None, }=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D for Item in self.DistP.MiscellaneousFiles.GetFileList():=0D - XmlTreeLevel =3D ['DistributionPackage', 'Miscellaneou= sFiles']=0D + XmlTreeLevel =3D [=0D + 'DistributionPackage', 'MiscellaneousFiles']=0D CheckDict =3D {'FileName': Item.GetURI(), }=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D @@ -154,7 +160,6 @@ class DistributionPackageXml(object): CheckDict =3D {'UserId': Item.GetUserID(), }=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D -=0D def FromXml(self, Filename=3DNone):=0D if Filename is not None:=0D self.DistP =3D DistributionPackageClass()=0D @@ -168,7 +173,8 @@ class DistributionPackageXml(object): #=0D Tmp =3D DistributionPackageHeaderXml()=0D DistributionPackageHeader =3D \=0D - Tmp.FromXml(XmlNode(self.Pkg, '/DistributionPackage/Distributi= onHeader'), 'DistributionHeader')=0D + Tmp.FromXml(XmlNode(=0D + self.Pkg, '/DistributionPackage/DistributionHeader'), = 'DistributionHeader')=0D self.DistP.Header =3D DistributionPackageHeader=0D #=0D # Parse each PackageSurfaceArea=0D @@ -176,40 +182,43 @@ class DistributionPackageXml(object): for Item in XmlList(self.Pkg, '/DistributionPackage/PackageSur= faceArea'):=0D Psa =3D PackageSurfaceAreaXml()=0D Package =3D Psa.FromXml(Item, 'PackageSurfaceArea')=0D - self.DistP.PackageSurfaceArea[(Package.GetGuid(), \=0D - Package.GetVersion(), \=0D + self.DistP.PackageSurfaceArea[(Package.GetGuid(),=0D + Package.GetVersion(),=0D Package.GetPackagePath())] = =3D \=0D - Package=0D + Package=0D #=0D # Parse each ModuleSurfaceArea=0D #=0D for Item in XmlList(self.Pkg, '/DistributionPackage/ModuleSurf= aceArea'):=0D Msa =3D ModuleSurfaceAreaXml()=0D Module =3D Msa.FromXml(Item, 'ModuleSurfaceArea', True)=0D - ModuleKey =3D (Module.GetGuid(), Module.GetVersion(), Modu= le.GetName(), Module.GetModulePath())=0D + ModuleKey =3D (Module.GetGuid(), Module.GetVersion(),=0D + Module.GetName(), Module.GetModulePath())=0D self.DistP.ModuleSurfaceArea[ModuleKey] =3D Module=0D =0D #=0D # Parse Tools=0D #=0D Tmp =3D MiscellaneousFileXml()=0D - self.DistP.Tools =3D Tmp.FromXml2(XmlNode(self.Pkg, '/Distribu= tionPackage/Tools'), 'Tools')=0D + self.DistP.Tools =3D Tmp.FromXml2(=0D + XmlNode(self.Pkg, '/DistributionPackage/Tools'), 'Tools')= =0D =0D #=0D # Parse MiscFiles=0D #=0D Tmp =3D MiscellaneousFileXml()=0D self.DistP.MiscellaneousFiles =3D \=0D - Tmp.FromXml2(XmlNode(self.Pkg, \=0D - '/DistributionPackage/MiscellaneousFiles'= ), \=0D - 'MiscellaneousFiles')=0D + Tmp.FromXml2(XmlNode(self.Pkg,=0D + '/DistributionPackage/MiscellaneousFi= les'),=0D + 'MiscellaneousFiles')=0D =0D #=0D # Parse UserExtensions=0D #=0D for Item in XmlList(self.Pkg, '/DistributionPackage/UserExtens= ions'):=0D Tmp =3D UserExtensionsXml()=0D - self.DistP.UserExtensions.append(Tmp.FromXml2(Item, 'UserE= xtensions'))=0D + self.DistP.UserExtensions.append(=0D + Tmp.FromXml2(Item, 'UserExtensions'))=0D =0D #=0D # Check Required Items for XML=0D @@ -264,7 +273,6 @@ class DistributionPackageXml(object): =0D XmlContent =3D Root.toprettyxml(indent=3D' ')=0D =0D -=0D #=0D # Remove empty element=0D #=0D @@ -280,58 +288,62 @@ class DistributionPackageXml(object): # Remove SupArchList=3D"COMMON" or "common"=0D #=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]*CO= MMON'=0D - '[\s\r\n]*"', '', XmlContent)=0D + re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n= ]*COMMON'=0D + '[\s\r\n]*"', '', XmlContent)=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]*co= mmon'=0D - '[\s\r\n]*"', '', XmlContent)=0D + re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n= ]*common'=0D + '[\s\r\n]*"', '', XmlContent)=0D #=0D # Remove COMMON =0D #=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*[\s\r\n]*COMMON[\s\r\n]*'=0D - '[\s\r\n]*', '', XmlContent)=0D + re.sub(r'[\s\r\n]*[\s\r\n]*COMMON[\s\r\n]*'=0D + '[\s\r\n]*', '', XmlContent)=0D =0D #=0D # Remove common =0D #=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*[\s\r\n]*'=0D - 'common[\s\r\n]*[\s\r\n]*', '', XmlContent)=0D + re.sub(r'[\s\r\n]*[\s\r\n]*'=0D + 'common[\s\r\n]*[\s\r\n]*', '', XmlCo= ntent)=0D =0D #=0D # Remove SupModList=3D"COMMON" or "common"=0D #=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]*COM= MON'=0D - '[\s\r\n]*"', '', XmlContent)=0D + re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]= *COMMON'=0D + '[\s\r\n]*"', '', XmlContent)=0D XmlContent =3D \=0D - re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]*com= mon'=0D - '[\s\r\n]*"', '', XmlContent)=0D + re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=3D[\s\r\n]*"[\s\r\n]= *common'=0D + '[\s\r\n]*"', '', XmlContent)=0D =0D return XmlContent=0D =0D return ''=0D =0D -## ValidateMS=0D +# ValidateMS=0D #=0D # Check if any required item is missing in ModuleSurfaceArea=0D #=0D # @param Module: The ModuleSurfaceArea to be checked=0D # @param XmlTreeLevel: The top level of Module=0D #=0D +=0D +=0D def ValidateMS(Module, TopXmlTreeLevel):=0D ValidateMS1(Module, TopXmlTreeLevel)=0D ValidateMS2(Module, TopXmlTreeLevel)=0D ValidateMS3(Module, TopXmlTreeLevel)=0D =0D -## ValidateMS1=0D +# ValidateMS1=0D #=0D # Check if any required item is missing in ModuleSurfaceArea=0D #=0D # @param Module: The ModuleSurfaceArea to be checked=0D # @param XmlTreeLevel: The top level of Module=0D #=0D +=0D +=0D def ValidateMS1(Module, TopXmlTreeLevel):=0D #=0D # Check Guids -> GuidCName=0D @@ -339,21 +351,22 @@ def ValidateMS1(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['Guids']=0D for Item in Module.GetGuidList():=0D if Item is None:=0D - CheckDict =3D {'GuidCName':''}=0D + CheckDict =3D {'GuidCName': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['Guids', 'GuidCName']=0D for Item in Module.GetGuidList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'GuidType':Item.GetGuidTypeList(),=0D - 'Usage':Item.GetUsage()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'GuidType': Item.GetGuidTypeList(),=0D + 'Usage': Item.GetUsage()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D if Item.GetVariableName():=0D Result =3D ConvertVariableName(Item.GetVariableName())=0D if Result is None:=0D Msg =3D "->".join(Node for Node in XmlTreeLevel)=0D - ErrorMsg =3D ERR_XML_INVALID_VARIABLENAME % (Item.GetVaria= bleName(), Item.GetCName(), Msg)=0D + ErrorMsg =3D ERR_XML_INVALID_VARIABLENAME % (=0D + Item.GetVariableName(), Item.GetCName(), Msg)=0D Logger.Error('\nUPT', PARSER_ERROR, ErrorMsg, RaiseError= =3DTrue)=0D else:=0D Item.SetVariableName(Result)=0D @@ -364,13 +377,13 @@ def ValidateMS1(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['Protocols']=0D for Item in Module.GetProtocolList():=0D if Item is None:=0D - CheckDict =3D {'Protocol':''}=0D + CheckDict =3D {'Protocol': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['Protocols', 'Protocol']=0D for Item in Module.GetProtocolList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'Usage':Item.GetUsage()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'Usage': Item.GetUsage()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -379,13 +392,13 @@ def ValidateMS1(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['PPIs']=0D for Item in Module.GetPpiList():=0D if Item is None:=0D - CheckDict =3D {'Ppi':''}=0D + CheckDict =3D {'Ppi': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['PPIs', 'Ppi']=0D for Item in Module.GetPpiList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'Usage':Item.GetUsage()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'Usage': Item.GetUsage()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -394,15 +407,15 @@ def ValidateMS1(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['PcdCoded']=0D for Item in Module.GetPcdList():=0D if Item is None:=0D - CheckDict =3D {'PcdEntry':''}=0D + CheckDict =3D {'PcdEntry': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['PcdCoded', 'PcdEntry']=0D for Item in Module.GetPcdList():=0D - CheckDict =3D {'TokenSpaceGuidCname':Item.GetTokenSpaceGuidCName()= ,=0D - 'CName':Item.GetCName(),=0D - 'PcdUsage':Item.GetValidUsage(),=0D - 'PcdItemType':Item.GetItemType()}=0D + CheckDict =3D {'TokenSpaceGuidCname': Item.GetTokenSpaceGuidCName(= ),=0D + 'CName': Item.GetCName(),=0D + 'PcdUsage': Item.GetValidUsage(),=0D + 'PcdItemType': Item.GetItemType()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -411,7 +424,7 @@ def ValidateMS1(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['Externs']=0D for Item in Module.GetExternList():=0D if Item is None:=0D - CheckDict =3D {'Extern':''}=0D + CheckDict =3D {'Extern': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -426,7 +439,8 @@ def ValidateMS1(Module, TopXmlTreeLevel): if not IsEqualList(Item.SupArchList, Module.SupArchList):=0D Logger.Error('\nUPT',=0D PARSER_ERROR,=0D - ERR_XML_INVALID_EXTERN_SUPARCHLIST % (str(Ite= m.SupArchList), str(Module.SupArchList)),=0D + ERR_XML_INVALID_EXTERN_SUPARCHLIST % (=0D + str(Item.SupArchList), str(Module.SupArch= List)),=0D RaiseError=3DTrue)=0D =0D #=0D @@ -434,7 +448,8 @@ def ValidateMS1(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['UserExtensions']=0D for Item in Module.GetUserExtensionList():=0D - CheckDict =3D {'UserId':Item.GetUserID(), 'Identifier':Item.GetIde= ntifier()}=0D + CheckDict =3D {'UserId': Item.GetUserID(=0D + ), 'Identifier': Item.GetIdentifier()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -448,13 +463,15 @@ def ValidateMS1(Module, TopXmlTreeLevel): for File in Item.GetFileList():=0D CheckDict =3D {'Filename': File.GetURI(), }=0D =0D -## ValidateMS2=0D +# ValidateMS2=0D #=0D # Check if any required item is missing in ModuleSurfaceArea=0D #=0D # @param Module: The ModuleSurfaceArea to be checked=0D # @param XmlTreeLevel: The top level of Module=0D #=0D +=0D +=0D def ValidateMS2(Module, TopXmlTreeLevel):=0D #=0D # Check Header=0D @@ -471,20 +488,21 @@ def ValidateMS2(Module, TopXmlTreeLevel): # Check ModuleProperties=0D #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['ModuleProperties']=0D - CheckDict =3D {'ModuleType':Module.GetModuleType(),=0D - 'Path':Module.GetModulePath()}=0D + CheckDict =3D {'ModuleType': Module.GetModuleType(),=0D + 'Path': Module.GetModulePath()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D if not IsValidInstallPath(Module.GetModulePath()):=0D - Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE % Modul= e.GetModulePath())=0D + Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE %=0D + Module.GetModulePath())=0D =0D #=0D # Check ModuleProperties->BootMode=0D #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['ModuleProperties'] + ['BootMode']= =0D for Item in Module.GetBootModeList():=0D - CheckDict =3D {'Usage':Item.GetUsage(),=0D - 'SupportedBootModes':Item.GetSupportedBootModes()}=0D + CheckDict =3D {'Usage': Item.GetUsage(),=0D + 'SupportedBootModes': Item.GetSupportedBootModes()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -492,8 +510,8 @@ def ValidateMS2(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['ModuleProperties'] + ['Event']=0D for Item in Module.GetEventList():=0D - CheckDict =3D {'Usage':Item.GetUsage(),=0D - 'EventType':Item.GetEventType()}=0D + CheckDict =3D {'Usage': Item.GetUsage(),=0D + 'EventType': Item.GetEventType()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -501,8 +519,8 @@ def ValidateMS2(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['ModuleProperties'] + ['HOB']=0D for Item in Module.GetHobList():=0D - CheckDict =3D {'Usage':Item.GetUsage(),=0D - 'HobType':Item.GetHobType()}=0D + CheckDict =3D {'Usage': Item.GetUsage(),=0D + 'HobType': Item.GetHobType()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -513,11 +531,11 @@ def ValidateMS2(Module, TopXmlTreeLevel): if Module.ModuleType =3D=3D "UEFI_RUNTIME_DRIVER":=0D Module.ModuleType =3D "DXE_RUNTIME_DRIVER"=0D DxeObj =3D DepexObject()=0D - DxeObj.SetDepex("gEfiBdsArchProtocolGuid AND \ngEfiCpuArchProtocol= Guid AND\n" + \=0D - "gEfiMetronomeArchProtocolGuid AND \ngEfiMonotonic= CounterArchProtocolGuid AND\n" + \=0D - "gEfiRealTimeClockArchProtocolGuid AND \ngEfiReset= ArchProtocolGuid AND\n" + \=0D - "gEfiRuntimeArchProtocolGuid AND \ngEfiSecurityArc= hProtocolGuid AND\n" + \=0D - "gEfiTimerArchProtocolGuid AND \ngEfiVariableWrite= ArchProtocolGuid AND\n" + \=0D + DxeObj.SetDepex("gEfiBdsArchProtocolGuid AND \ngEfiCpuArchProtocol= Guid AND\n" +=0D + "gEfiMetronomeArchProtocolGuid AND \ngEfiMonotonic= CounterArchProtocolGuid AND\n" +=0D + "gEfiRealTimeClockArchProtocolGuid AND \ngEfiReset= ArchProtocolGuid AND\n" +=0D + "gEfiRuntimeArchProtocolGuid AND \ngEfiSecurityArc= hProtocolGuid AND\n" +=0D + "gEfiTimerArchProtocolGuid AND \ngEfiVariableWrite= ArchProtocolGuid AND\n" +=0D "gEfiVariableArchProtocolGuid AND \ngEfiWatchdogTi= merArchProtocolGuid")=0D DxeObj.SetModuleType(['DXE_RUNTIME_DRIVER'])=0D Module.PeiDepex =3D []=0D @@ -531,16 +549,17 @@ def ValidateMS2(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['LibraryClassDefinitions']=0D for Item in Module.GetLibraryClassList():=0D if Item is None:=0D - CheckDict =3D {'LibraryClass':''}=0D + CheckDict =3D {'LibraryClass': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D TopXmlTreeLevel + ['LibraryClassDefinitions', 'Librar= yClass']=0D + XmlTreeLevel =3D TopXmlTreeLevel + \=0D + ['LibraryClassDefinitions', 'LibraryClass']=0D =0D IsLibraryModule =3D False=0D LibrarySupModList =3D []=0D for Item in Module.GetLibraryClassList():=0D - CheckDict =3D {'Keyword':Item.GetLibraryClass(),=0D - 'Usage':Item.GetUsage()}=0D + CheckDict =3D {'Keyword': Item.GetLibraryClass(),=0D + 'Usage': Item.GetUsage()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D #=0D # If the LibraryClass:SupModList is not "UNDEFINED" the LIBRARY_CL= ASS entry must have the list=0D @@ -559,14 +578,14 @@ def ValidateMS2(Module, TopXmlTreeLevel): if not IsValidInfMoudleType(SupModule):=0D Logger.Error('\nUPT',=0D PARSER_ERROR,=0D - ERR_XML_INVALID_LIB_SUPMODLIST % (Item.Li= braryClass, str(SupModule)),=0D + ERR_XML_INVALID_LIB_SUPMODLIST % (=0D + Item.LibraryClass, str(SupModule)),=0D RaiseError=3DTrue)=0D =0D if Item.Usage =3D=3D 'PRODUCES' or Item.Usage =3D=3D 'SOMETIMES_PR= ODUCES':=0D IsLibraryModule =3D True=0D LibrarySupModList =3D Item.SupModuleList=0D =0D -=0D #=0D # For Library modules (indicated by a LIBRARY_CLASS statement in the [= Defines] section)=0D # If the SupModList attribute of the CONSTRUCTOR or DESTRUCTOR element= does not match the Supported Module=0D @@ -580,9 +599,10 @@ def ValidateMS2(Module, TopXmlTreeLevel): if hasattr(Item, 'SupModList') and len(Item.SupModList) > = 0 and \=0D not IsEqualList(Item.SupModList, LibrarySupModList):=0D Logger.Error('\nUPT',=0D - PARSER_ERROR,=0D - ERR_XML_INVALID_EXTERN_SUPMODLIST % (str(Item.Sup= ModList), str(LibrarySupModList)),=0D - RaiseError=3DTrue)=0D + PARSER_ERROR,=0D + ERR_XML_INVALID_EXTERN_SUPMODLIST % (=0D + str(Item.SupModList), str(LibrarySupM= odList)),=0D + RaiseError=3DTrue)=0D =0D #=0D # If the module is not a library module, the MODULE_TYPE listed in the= ModuleSurfaceArea.Header must match the=0D @@ -594,21 +614,22 @@ def ValidateMS2(Module, TopXmlTreeLevel): if hasattr(Item, 'SupModList') and len(Item.SupModList) > 0 an= d \=0D not IsEqualList(Item.SupModList, [Module.ModuleType]):=0D Logger.Error('\nUPT',=0D - PARSER_ERROR,=0D - ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB % (str(Modu= le.ModuleType), str(Item.SupModList)),=0D - RaiseError=3DTrue)=0D + PARSER_ERROR,=0D + ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB % (= =0D + str(Module.ModuleType), str(Item.SupModLi= st)),=0D + RaiseError=3DTrue)=0D #=0D # Check SourceFiles=0D #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['SourceFiles']=0D for Item in Module.GetSourceFileList():=0D if Item is None:=0D - CheckDict =3D {'Filename':''}=0D + CheckDict =3D {'Filename': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['SourceFiles']=0D for Item in Module.GetSourceFileList():=0D - CheckDict =3D {'Filename':Item.GetSourceFile()}=0D + CheckDict =3D {'Filename': Item.GetSourceFile()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D for ItemCount in range(len(Module.GetBinaryFileList())):=0D @@ -617,13 +638,15 @@ def ValidateMS2(Module, TopXmlTreeLevel): Item.FileNamList[0].FileType =3D 'SUBTYPE_GUID'=0D Module.GetBinaryFileList()[ItemCount] =3D Item=0D =0D -## ValidateMS3=0D +# ValidateMS3=0D #=0D # Check if any required item is missing in ModuleSurfaceArea=0D #=0D # @param Module: The ModuleSurfaceArea to be checked=0D # @param XmlTreeLevel: The top level of Module=0D #=0D +=0D +=0D def ValidateMS3(Module, TopXmlTreeLevel):=0D #=0D # Check PackageDependencies -> Package=0D @@ -631,12 +654,12 @@ def ValidateMS3(Module, TopXmlTreeLevel): XmlTreeLevel =3D TopXmlTreeLevel + ['PackageDependencies']=0D for Item in Module.GetPackageDependencyList():=0D if Item is None:=0D - CheckDict =3D {'Package':''}=0D + CheckDict =3D {'Package': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['PackageDependencies', 'Package']= =0D for Item in Module.GetPackageDependencyList():=0D - CheckDict =3D {'GUID':Item.GetGuid()}=0D + CheckDict =3D {'GUID': Item.GetGuid()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -645,50 +668,53 @@ def ValidateMS3(Module, TopXmlTreeLevel): for Item in Module.GetBinaryFileList():=0D if Item is None:=0D XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles']=0D - CheckDict =3D {'BinaryFile':''}=0D + CheckDict =3D {'BinaryFile': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D if not Item.GetFileNameList():=0D XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile= ']=0D - CheckDict =3D {'Filename':''}=0D + CheckDict =3D {'Filename': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile']=0D for File in Item.GetFileNameList():=0D - CheckDict =3D {'Filename':File.GetFilename(),=0D - 'FileType':File.GetFileType()}=0D + CheckDict =3D {'Filename': File.GetFilename(),=0D + 'FileType': File.GetFileType()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D for AsBuilt in Item.GetAsBuiltList():=0D #=0D # Check LibInstance=0D #=0D if len(AsBuilt.LibraryInstancesList) =3D=3D 1 and not AsBuilt.= LibraryInstancesList[0]:=0D - CheckDict =3D {'GUID':''}=0D - XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Binary= File', 'AsBuilt', 'LibraryInstances']=0D + CheckDict =3D {'GUID': ''}=0D + XmlTreeLevel =3D TopXmlTreeLevel + \=0D + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'LibraryInsta= nces']=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D for LibItem in AsBuilt.LibraryInstancesList:=0D - CheckDict =3D {'Guid':LibItem.Guid,=0D - 'Version':LibItem.Version}=0D - XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Binary= File', 'AsBuilt', 'LibraryInstances']=0D + CheckDict =3D {'Guid': LibItem.Guid,=0D + 'Version': LibItem.Version}=0D + XmlTreeLevel =3D TopXmlTreeLevel + \=0D + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'LibraryInsta= nces']=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check PatchPcd=0D #=0D for PatchPcdItem in AsBuilt.PatchPcdList:=0D - CheckDict =3D {'TokenSpaceGuidValue':PatchPcdItem.TokenSpa= ceGuidValue,=0D - 'PcdCName':PatchPcdItem.PcdCName,=0D - 'Token':PatchPcdItem.Token,=0D - 'DatumType':PatchPcdItem.DatumType,=0D - 'Value':PatchPcdItem.DefaultValue,=0D - 'Offset':PatchPcdItem.Offset}=0D - XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Binary= File', 'AsBuilt', 'PatchPcdValue']=0D + CheckDict =3D {'TokenSpaceGuidValue': PatchPcdItem.TokenSp= aceGuidValue,=0D + 'PcdCName': PatchPcdItem.PcdCName,=0D + 'Token': PatchPcdItem.Token,=0D + 'DatumType': PatchPcdItem.DatumType,=0D + 'Value': PatchPcdItem.DefaultValue,=0D + 'Offset': PatchPcdItem.Offset}=0D + XmlTreeLevel =3D TopXmlTreeLevel + \=0D + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'PatchPcdValu= e']=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D #=0D # Check PcdError=0D #=0D for PcdErrorItem in PatchPcdItem.PcdErrorsList:=0D - CheckDict =3D {'ErrorNumber':PcdErrorItem.ErrorNumber}= =0D + CheckDict =3D {'ErrorNumber': PcdErrorItem.ErrorNumber= }=0D XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Bi= naryFile', 'AsBuilt',=0D 'PatchPcdValue', 'Pc= dError']=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D @@ -696,16 +722,17 @@ def ValidateMS3(Module, TopXmlTreeLevel): # Check PcdEx=0D #=0D for PcdExItem in AsBuilt.PcdExValueList:=0D - CheckDict =3D {'TokenSpaceGuidValue':PcdExItem.TokenSpaceG= uidValue,=0D - 'Token':PcdExItem.Token,=0D - 'DatumType':PcdExItem.DatumType}=0D - XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Binary= File', 'AsBuilt', 'PcdExValue']=0D + CheckDict =3D {'TokenSpaceGuidValue': PcdExItem.TokenSpace= GuidValue,=0D + 'Token': PcdExItem.Token,=0D + 'DatumType': PcdExItem.DatumType}=0D + XmlTreeLevel =3D TopXmlTreeLevel + \=0D + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'PcdExValue']= =0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D #=0D # Check PcdError=0D #=0D for PcdErrorItem in PcdExItem.PcdErrorsList:=0D - CheckDict =3D {'ErrorNumber':PcdErrorItem.ErrorNumber}= =0D + CheckDict =3D {'ErrorNumber': PcdErrorItem.ErrorNumber= }=0D XmlTreeLevel =3D TopXmlTreeLevel + ['BinaryFiles', 'Bi= naryFile', 'AsBuilt',=0D 'PcdExValue', 'PcdEr= ror']=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D @@ -714,7 +741,7 @@ def ValidateMS3(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['SmmDepex']=0D for Item in Module.GetSmmDepex():=0D - CheckDict =3D {'Expression':Item.GetDepex()}=0D + CheckDict =3D {'Expression': Item.GetDepex()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -722,7 +749,7 @@ def ValidateMS3(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['PeiDepex']=0D for Item in Module.GetPeiDepex():=0D - CheckDict =3D {'Expression':Item.GetDepex()}=0D + CheckDict =3D {'Expression': Item.GetDepex()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -730,7 +757,7 @@ def ValidateMS3(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['DxeDepex']=0D for Item in Module.GetDxeDepex():=0D - CheckDict =3D {'Expression':Item.GetDepex()}=0D + CheckDict =3D {'Expression': Item.GetDepex()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D @@ -738,13 +765,16 @@ def ValidateMS3(Module, TopXmlTreeLevel): #=0D XmlTreeLevel =3D TopXmlTreeLevel + ['UserExtensions']=0D for Item in Module.GetUserExtensionList():=0D - CheckDict =3D {'UserId':Item.GetUserID(), 'Identifier':Item.GetIde= ntifier()}=0D + CheckDict =3D {'UserId': Item.GetUserID(=0D + ), 'Identifier': Item.GetIdentifier()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D -## ValidatePS1=0D +# ValidatePS1=0D #=0D # ValidatePS1=0D #=0D +=0D +=0D def ValidatePS1(Package):=0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> Header=0D @@ -759,7 +789,8 @@ def ValidatePS1(Package): =0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D if not IsValidInstallPath(Package.GetPackagePath()):=0D - Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE % Packa= ge.GetPackagePath())=0D + Logger.Error("UPT", FORMAT_INVALID, ERR_FILE_NAME_INVALIDE %=0D + Package.GetPackagePath())=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> ClonedFrom=0D @@ -779,134 +810,154 @@ def ValidatePS1(Package): #=0D # Check DistributionPackage -> PackageSurfaceArea -> LibraryClassDecla= rations -> LibraryClass=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Librar= yClassDeclarations']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'LibraryClassDeclarations']=0D for Item in Package.GetLibraryClassList():=0D if Item is None:=0D - CheckDict =3D {'LibraryClass':''}=0D + CheckDict =3D {'LibraryClass': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Librar= yClassDeclarations', 'LibraryClass']=0D + XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea',=0D + 'LibraryClassDeclarations', 'LibraryClass']=0D for Item in Package.GetLibraryClassList():=0D - CheckDict =3D {'Keyword':Item.GetLibraryClass(),=0D - 'HeaderFile':Item.GetIncludeHeader()}=0D + CheckDict =3D {'Keyword': Item.GetLibraryClass(),=0D + 'HeaderFile': Item.GetIncludeHeader()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> IndustryStandardI= ncludes -> IndustryStandardHeader=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Indust= ryStandardIncludes']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'IndustryStandardIncludes']=0D for Item in Package.GetStandardIncludeFileList():=0D if Item is None:=0D - CheckDict =3D {'IndustryStandardHeader':''}=0D + CheckDict =3D {'IndustryStandardHeader': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Indust= ryStandardIncludes', 'IndustryStandardHeader']=0D + XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea',=0D + 'IndustryStandardIncludes', 'IndustryStandardHeader']= =0D for Item in Package.GetStandardIncludeFileList():=0D - CheckDict =3D {'HeaderFile':Item.GetFilePath()}=0D + CheckDict =3D {'HeaderFile': Item.GetFilePath()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> PackageIncludes -= > PackageHeader=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Packag= eIncludes']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PackageIncludes']=0D for Item in Package.GetPackageIncludeFileList():=0D if Item is None:=0D - CheckDict =3D {'PackageHeader':''}=0D + CheckDict =3D {'PackageHeader': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Packag= eIncludes', 'PackageHeader']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PackageIncludes', 'PackageHeade= r']=0D for Item in Package.GetPackageIncludeFileList():=0D - CheckDict =3D {'HeaderFile':Item.GetFilePath()}=0D + CheckDict =3D {'HeaderFile': Item.GetFilePath()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D -## ValidatePS2=0D +# ValidatePS2=0D #=0D # ValidatePS2=0D #=0D +=0D +=0D def ValidatePS2(Package):=0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> Modules -> Module= SurfaceArea=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Module= s', 'ModuleSurfaceArea']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'Modules', 'ModuleSurfaceArea']= =0D for Item in Package.GetModuleDict().values():=0D ValidateMS(Item, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> GuidDeclarations = Entry=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'GuidDe= clarations']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'GuidDeclarations']=0D for Item in Package.GetGuidList():=0D if Item is None:=0D - CheckDict =3D {'Entry':''}=0D + CheckDict =3D {'Entry': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'GuidDe= clarations', 'Entry']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'GuidDeclarations', 'Entry']=0D for Item in Package.GetGuidList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'GuidValue':Item.GetGuid()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'GuidValue': Item.GetGuid()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> ProtocolDeclarati= ons -> Entry=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Protoc= olDeclarations']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'ProtocolDeclarations']=0D for Item in Package.GetProtocolList():=0D if Item is None:=0D - CheckDict =3D {'Entry':''}=0D + CheckDict =3D {'Entry': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Protoc= olDeclarations', 'Entry']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'ProtocolDeclarations', 'Entry']= =0D for Item in Package.GetProtocolList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'GuidValue':Item.GetGuid()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'GuidValue': Item.GetGuid()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> PpiDeclarations -= > Entry=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'PpiDec= larations']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PpiDeclarations']=0D for Item in Package.GetPpiList():=0D if Item is None:=0D - CheckDict =3D {'Entry':''}=0D + CheckDict =3D {'Entry': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'PpiDec= larations', 'Entry']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PpiDeclarations', 'Entry']=0D for Item in Package.GetPpiList():=0D - CheckDict =3D {'CName':Item.GetCName(),=0D - 'GuidValue':Item.GetGuid()}=0D + CheckDict =3D {'CName': Item.GetCName(),=0D + 'GuidValue': Item.GetGuid()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> PcdDeclarations -= > Entry=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'PcdDec= larations']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PcdDeclarations']=0D for Item in Package.GetPcdList():=0D if Item is None:=0D - CheckDict =3D {'PcdEntry':''}=0D + CheckDict =3D {'PcdEntry': ''}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'PcdDec= larations', 'PcdEntry']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'PcdDeclarations', 'PcdEntry']=0D for Item in Package.GetPcdList():=0D - CheckDict =3D {'TokenSpaceGuidCname':Item.GetTokenSpaceGuidCName()= ,=0D - 'Token':Item.GetToken(),=0D - 'CName':Item.GetCName(),=0D - 'DatumType':Item.GetDatumType(),=0D - 'ValidUsage':Item.GetValidUsage(),=0D - 'DefaultValue':Item.GetDefaultValue()}=0D + CheckDict =3D {'TokenSpaceGuidCname': Item.GetTokenSpaceGuidCName(= ),=0D + 'Token': Item.GetToken(),=0D + 'CName': Item.GetCName(),=0D + 'DatumType': Item.GetDatumType(),=0D + 'ValidUsage': Item.GetValidUsage(),=0D + 'DefaultValue': Item.GetDefaultValue()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> UserExtensions=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'UserEx= tensions']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'UserExtensions']=0D for Item in Package.GetUserExtensionList():=0D - CheckDict =3D {'UserId':Item.GetUserID(), 'Identifier':Item.GetIde= ntifier()}=0D + CheckDict =3D {'UserId': Item.GetUserID(=0D + ), 'Identifier': Item.GetIdentifier()}=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D #=0D # Check DistributionPackage -> PackageSurfaceArea -> MiscellaneousFile= s -> Filename=0D #=0D - XmlTreeLevel =3D ['DistributionPackage', 'PackageSurfaceArea', 'Miscel= laneousFiles']=0D + XmlTreeLevel =3D ['DistributionPackage',=0D + 'PackageSurfaceArea', 'MiscellaneousFiles']=0D for Item in Package.GetMiscFileList():=0D if not Item.GetFileList():=0D CheckDict =3D {'Filename': '', }=0D @@ -915,12 +966,14 @@ def ValidatePS2(Package): CheckDict =3D {'Filename': File.GetURI(), }=0D IsRequiredItemListNull(CheckDict, XmlTreeLevel)=0D =0D -## ValidatePackageSurfaceArea=0D +# ValidatePackageSurfaceArea=0D #=0D # Check if any required item is missing in PackageSurfaceArea=0D #=0D # @param Package: The PackageSurfaceArea to be checked=0D #=0D +=0D +=0D def ValidatePackageSurfaceArea(Package):=0D ValidatePS1(Package)=0D ValidatePS2(Package)=0D diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py b/BaseTools/S= ource/Python/UPT/Xml/XmlParserMisc.py index 48381ee8c6bf..3680f667ae57 100644 --- a/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py +++ b/BaseTools/Source/Python/UPT/Xml/XmlParserMisc.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse a xml file of .PKG file=0D #=0D # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,7 +14,7 @@ from Logger.StringTable import ERR_XML_PARSER_REQUIRED_IT= EM_MISSING from Logger.ToolError import PARSER_ERROR=0D import Logger.Log as Logger=0D =0D -## ConvertVariableName()=0D +# ConvertVariableName()=0D # Convert VariableName to be L"string",=0D # input of UCS-2 format Hex Array or L"string" (C style.) could be convert= ed successfully,=0D # others will not.=0D @@ -22,6 +22,8 @@ import Logger.Log as Logger # @param VariableName: string need to be converted=0D # @retval: the L quoted string converted if success, else None will be ret= urned=0D #=0D +=0D +=0D def ConvertVariableName(VariableName):=0D VariableName =3D VariableName.strip()=0D #=0D @@ -34,7 +36,7 @@ def ConvertVariableName(VariableName): # check for Hex Array, it should be little endian even number of hex n= umbers=0D #=0D ValueList =3D VariableName.split(' ')=0D - if len(ValueList)%2 =3D=3D 1:=0D + if len(ValueList) % 2 =3D=3D 1:=0D return None=0D =0D TransferedStr =3D ''=0D @@ -49,18 +51,20 @@ def ConvertVariableName(VariableName): =0D if FirstByte not in range(0x20, 0x7F):=0D return None=0D - TransferedStr +=3D ('%c')%FirstByte=0D + TransferedStr +=3D ('%c') % FirstByte=0D Index =3D Index + 2=0D =0D return 'L"' + TransferedStr + '"'=0D =0D -## IsRequiredItemListNull=0D +# IsRequiredItemListNull=0D #=0D # Check if a required XML section item/attribue is NULL=0D #=0D # @param ItemList: The list of items to be checked=0D # @param XmlTreeLevel: The error message tree level=0D #=0D +=0D +=0D def IsRequiredItemListNull(ItemDict, XmlTreeLevel):=0D for Key in ItemDict:=0D if not ItemDict[Key]:=0D @@ -68,10 +72,12 @@ def IsRequiredItemListNull(ItemDict, XmlTreeLevel): ErrorMsg =3D ERR_XML_PARSER_REQUIRED_ITEM_MISSING % (Key, Msg)= =0D Logger.Error('\nUPT', PARSER_ERROR, ErrorMsg, RaiseError=3DTru= e)=0D =0D -## Get help text=0D +# Get help text=0D #=0D # @param HelpText=0D #=0D +=0D +=0D def GetHelpTextList(HelpText):=0D HelpTextList =3D []=0D for HelT in HelpText:=0D @@ -81,10 +87,12 @@ def GetHelpTextList(HelpText): HelpTextList.append(HelpTextObj)=0D return HelpTextList=0D =0D -## Get Prompt text=0D +# Get Prompt text=0D #=0D # @param Prompt=0D #=0D +=0D +=0D def GetPromptList(Prompt):=0D PromptList =3D []=0D for SubPrompt in Prompt:=0D diff --git a/BaseTools/Source/Python/UPT/Xml/__init__.py b/BaseTools/Source= /Python/UPT/Xml/__init__.py index 172e498451b8..03dedeed636e 100644 --- a/BaseTools/Source/Python/UPT/Xml/__init__.py +++ b/BaseTools/Source/Python/UPT/Xml/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Library' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTo= ols/Source/Python/Workspace/BuildClassObject.py index ef873720f455..08c32ca08c2c 100644 --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to define each component of the build database=0D #=0D # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -10,7 +10,7 @@ from Common.DataType import * import collections=0D import re=0D from collections import OrderedDict=0D -from Common.Misc import CopyDict,ArrayIndex=0D +from Common.Misc import CopyDict, ArrayIndex=0D import copy=0D from CommonDataClass.DataClass import *=0D import Common.EdkLogger as EdkLogger=0D @@ -19,7 +19,7 @@ from Common.BuildToolError import OPTION_VALUE_INVALID from Common.caching import cached_property=0D StructPattern =3D re.compile(r'[_a-zA-Z][0-9A-Za-z_\[\]]*$')=0D =0D -## PcdClassObject=0D +# PcdClassObject=0D #=0D # This Class is used for PcdObject=0D #=0D @@ -45,8 +45,10 @@ StructPattern =3D re.compile(r'[_a-zA-Z][0-9A-Za-z_\[\]]= *$') # @var IsOverrided: To store value for IsOverrided=0D # @var Phase: To store value for Phase, default is "DXE"=0D #=0D +=0D +=0D class PcdClassObject(object):=0D - def __init__(self, Name =3D None, Guid =3D None, Type =3D None, DatumT= ype =3D None, Value =3D None, Token =3D None, MaxDatumSize =3D None, SkuInf= oList =3D None, IsOverrided =3D False, GuidValue =3D None, validateranges = =3D None, validlists =3D None, expressions =3D None, IsDsc =3D False, UserD= efinedDefaultStoresFlag =3D False):=0D + def __init__(self, Name=3DNone, Guid=3DNone, Type=3DNone, DatumType=3D= None, Value=3DNone, Token=3DNone, MaxDatumSize=3DNone, SkuInfoList=3DNone, = IsOverrided=3DFalse, GuidValue=3DNone, validateranges=3DNone, validlists=3D= None, expressions=3DNone, IsDsc=3DFalse, UserDefinedDefaultStoresFlag=3DFal= se):=0D self.TokenCName =3D Name=0D self.TokenSpaceGuidCName =3D Guid=0D self.TokenSpaceGuidValue =3D GuidValue=0D @@ -72,7 +74,7 @@ class PcdClassObject(object): self.DscDefaultValue =3D Value=0D self.PcdValueFromComm =3D ""=0D self.PcdValueFromFdf =3D ""=0D - self.PcdValueFromComponents =3D {} #{ModuleGuid:value, file_path,l= ineNo}=0D + self.PcdValueFromComponents =3D {} # {ModuleGuid:value, file_path= ,lineNo}=0D self.CustomAttribute =3D {}=0D self.UserDefinedDefaultStoresFlag =3D UserDefinedDefaultStoresFlag= =0D self._Capacity =3D None=0D @@ -86,7 +88,8 @@ class PcdClassObject(object): maxsize =3D item.lstrip("[").rstrip("]").strip()=0D if not maxsize:=0D maxsize =3D "-1"=0D - maxsize =3D str(int(maxsize,16)) if maxsize.startswith(("0= x","0X")) else maxsize=0D + maxsize =3D str(int(maxsize, 16)) if maxsize.startswith(=0D + ("0x", "0X")) else maxsize=0D self._Capacity.append(maxsize)=0D if hasattr(self, "SkuOverrideValues"):=0D for sku in self.SkuOverrideValues:=0D @@ -98,10 +101,11 @@ class PcdClassObject(object): for i in range(len(deme)):=0D if int(deme[i].lstrip("[").rstrip("]").str= ip()) >=3D int(self._Capacity[i]):=0D if self._Capacity[i] !=3D "-1":=0D - firstfieldinfo =3D list(fieldinfo.= values())[0]=0D + firstfieldinfo =3D list(=0D + fieldinfo.values())[0]=0D EdkLogger.error('Build', OPTION_VA= LUE_INVALID, "For Pcd %s, Array Index exceed the Array size. From %s Line %= s \n " %=0D - (".".join((self.TokenSpaceGuidCName, s= elf.TokenCName)), firstfieldinfo[1],firstfieldinfo[2] ))=0D - if hasattr(self,"DefaultValues"):=0D + (".".join((self.To= kenSpaceGuidCName, self.TokenCName)), firstfieldinfo[1], firstfieldinfo[2])= )=0D + if hasattr(self, "DefaultValues"):=0D for demesionattr in self.DefaultValues:=0D fieldinfo =3D self.DefaultValues[demesionattr]=0D deme =3D ArrayIndex.findall(demesionattr)=0D @@ -110,7 +114,7 @@ class PcdClassObject(object): if self._Capacity[i] !=3D "-1":=0D firstfieldinfo =3D list(fieldinfo.values()= )[0]=0D EdkLogger.error('Build', OPTION_VALUE_INVA= LID, "For Pcd %s, Array Index exceed the Array size. From %s Line %s \n " %= =0D - (".".join((self.TokenSpaceGuidCName, s= elf.TokenCName)), firstfieldinfo[1],firstfieldinfo[2] ))=0D + (".".join((self.TokenSpace= GuidCName, self.TokenCName)), firstfieldinfo[1], firstfieldinfo[2]))=0D return self._Capacity=0D =0D def PcdArraySize(self):=0D @@ -120,12 +124,13 @@ class PcdClassObject(object): for de in self.Capacity:=0D size =3D size * int(de)=0D return size=0D +=0D @property=0D def DatumType(self):=0D return self._DatumType=0D =0D @DatumType.setter=0D - def DatumType(self,DataType):=0D + def DatumType(self, DataType):=0D self._DatumType =3D DataType=0D self._Capacity =3D None=0D =0D @@ -135,6 +140,7 @@ class PcdClassObject(object): return self._DatumType[:self._DatumType.index("[")]=0D else:=0D return self._DatumType=0D +=0D def IsArray(self):=0D return True if len(self.Capacity) else False=0D =0D @@ -153,31 +159,32 @@ class PcdClassObject(object): @staticmethod=0D def GetPcdMaxSizeWorker(PcdString, MaxSize):=0D if PcdString.startswith("{") and PcdString.endswith("}"):=0D - return max([len(PcdString.split(",")),MaxSize])=0D + return max([len(PcdString.split(",")), MaxSize])=0D =0D if PcdString.startswith("\"") or PcdString.startswith("\'"):=0D - return max([len(PcdString)-2+1,MaxSize])=0D + return max([len(PcdString)-2+1, MaxSize])=0D =0D if PcdString.startswith("L\""):=0D - return max([2*(len(PcdString)-3+1),MaxSize])=0D + return max([2*(len(PcdString)-3+1), MaxSize])=0D =0D - return max([len(PcdString),MaxSize])=0D + return max([len(PcdString), MaxSize])=0D =0D - ## Get the maximum number of bytes=0D + # Get the maximum number of bytes=0D def GetPcdMaxSize(self):=0D if self.DatumType in TAB_PCD_NUMERIC_TYPES:=0D return MAX_SIZE_TYPE[self.DatumType]=0D =0D MaxSize =3D int(self.MaxDatumSize, 10) if self.MaxDatumSize else 0= =0D if self.PcdValueFromFdf:=0D - MaxSize =3D self.GetPcdMaxSizeWorker(self.PcdValueFromFdf,MaxS= ize)=0D + MaxSize =3D self.GetPcdMaxSizeWorker(self.PcdValueFromFdf, Max= Size)=0D if self.PcdValueFromComm:=0D - MaxSize =3D self.GetPcdMaxSizeWorker(self.PcdValueFromComm,Max= Size)=0D + MaxSize =3D self.GetPcdMaxSizeWorker(self.PcdValueFromComm, Ma= xSize)=0D if hasattr(self, "DefaultValueFromDec"):=0D - MaxSize =3D self.GetPcdMaxSizeWorker(self.DefaultValueFromDec,= MaxSize)=0D + MaxSize =3D self.GetPcdMaxSizeWorker(=0D + self.DefaultValueFromDec, MaxSize)=0D return MaxSize=0D =0D - ## Get the number of bytes=0D + # Get the number of bytes=0D def GetPcdSize(self):=0D if self.DatumType in TAB_PCD_NUMERIC_TYPES:=0D return MAX_SIZE_TYPE[self.DatumType]=0D @@ -190,14 +197,14 @@ class PcdClassObject(object): else:=0D return len(self.DefaultValue) - 1=0D =0D -=0D - ## Convert the class to a string=0D + # Convert the class to a string=0D #=0D # Convert each member of the class to string=0D # Organize to a single line format string=0D #=0D # @retval Rtn Formatted String=0D #=0D +=0D def __str__(self):=0D Rtn =3D '\tTokenCName=3D' + str(self.TokenCName) + ', ' + \=0D 'TokenSpaceGuidCName=3D' + str(self.TokenSpaceGuidCName) + '= , ' + \=0D @@ -212,7 +219,7 @@ class PcdClassObject(object): =0D return Rtn=0D =0D - ## Override __eq__ function=0D + # Override __eq__ function=0D #=0D # Check whether pcds are the same=0D #=0D @@ -222,7 +229,7 @@ class PcdClassObject(object): def __eq__(self, Other):=0D return Other and self.TokenCName =3D=3D Other.TokenCName and self.= TokenSpaceGuidCName =3D=3D Other.TokenSpaceGuidCName=0D =0D - ## Override __hash__ function=0D + # Override __hash__ function=0D #=0D # Use (TokenCName, TokenSpaceGuidCName) as key in hash table=0D #=0D @@ -233,14 +240,15 @@ class PcdClassObject(object): =0D @cached_property=0D def _fullname(self):=0D - return ".".join((self.TokenSpaceGuidCName,self.TokenCName))=0D + return ".".join((self.TokenSpaceGuidCName, self.TokenCName))=0D =0D - def __lt__(self,pcd):=0D + def __lt__(self, pcd):=0D return self._fullname < pcd._fullname=0D - def __gt__(self,pcd):=0D +=0D + def __gt__(self, pcd):=0D return self._fullname > pcd._fullname=0D =0D - def sharedcopy(self,new_pcd):=0D + def sharedcopy(self, new_pcd):=0D new_pcd.TokenCName =3D self.TokenCName=0D new_pcd.TokenSpaceGuidCName =3D self.TokenSpaceGuidCName=0D new_pcd.TokenSpaceGuidValue =3D self.TokenSpaceGuidValue=0D @@ -265,16 +273,18 @@ class PcdClassObject(object): new_pcd.validateranges =3D [item for item in self.validateranges]= =0D new_pcd.validlists =3D [item for item in self.validlists]=0D new_pcd.expressions =3D [item for item in self.expressions]=0D - new_pcd.SkuInfoList =3D {key: copy.deepcopy(skuobj) for key,skuobj= in self.SkuInfoList.items()}=0D + new_pcd.SkuInfoList =3D {key: copy.deepcopy(=0D + skuobj) for key, skuobj in self.SkuInfoList.items()}=0D return new_pcd=0D =0D - def __deepcopy__(self,memo):=0D + def __deepcopy__(self, memo):=0D new_pcd =3D PcdClassObject()=0D self.sharedcopy(new_pcd)=0D return new_pcd=0D =0D +=0D class StructurePcd(PcdClassObject):=0D - 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):=0D + 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=3DTAB_DEFAULT_STORES_DEFAULT):=0D if SkuInfoList is None:=0D SkuInfoList =3D {}=0D if validateranges is None:=0D @@ -285,8 +295,10 @@ class StructurePcd(PcdClassObject): expressions =3D []=0D if Packages is None:=0D Packages =3D []=0D - super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Va= lue, Token, MaxDatumSize, SkuInfoList, IsOverrided, GuidValue, validaterang= es, validlists, expressions)=0D - self.StructuredPcdIncludeFile =3D [] if StructuredPcdIncludeFile i= s None else StructuredPcdIncludeFile=0D + super(StructurePcd, self).__init__(Name, Guid, Type, DatumType, Va= lue, Token, MaxDatumSize,=0D + SkuInfoList, IsOverrided, GuidV= alue, validateranges, validlists, expressions)=0D + self.StructuredPcdIncludeFile =3D [=0D + ] if StructuredPcdIncludeFile is None else StructuredPcdIncludeFil= e=0D self.PackageDecs =3D Packages=0D self.DefaultStoreName =3D [default_store]=0D self.DefaultValues =3D OrderedDict()=0D @@ -300,41 +312,49 @@ class StructurePcd(PcdClassObject): self.ValueChain =3D set()=0D self.PcdFieldValueFromComm =3D OrderedDict()=0D self.PcdFieldValueFromFdf =3D OrderedDict()=0D - self.DefaultFromDSC=3DNone=0D + self.DefaultFromDSC =3D None=0D self.PcdFiledValueFromDscComponent =3D OrderedDict()=0D +=0D def __repr__(self):=0D return self.TypeName=0D =0D - def AddDefaultValue (self, FieldName, Value, FileName=3D"", LineNo=3D0= ,DimensionAttr =3D"-1"):=0D + def AddDefaultValue(self, FieldName, Value, FileName=3D"", LineNo=3D0,= DimensionAttr=3D"-1"):=0D if DimensionAttr not in self.DefaultValues:=0D self.DefaultValues[DimensionAttr] =3D collections.OrderedDict(= )=0D if FieldName in self.DefaultValues[DimensionAttr]:=0D del self.DefaultValues[DimensionAttr][FieldName]=0D - self.DefaultValues[DimensionAttr][FieldName] =3D [Value.strip(), F= ileName, LineNo]=0D + self.DefaultValues[DimensionAttr][FieldName] =3D [=0D + Value.strip(), FileName, LineNo]=0D return self.DefaultValues[DimensionAttr][FieldName]=0D =0D - def SetDecDefaultValue(self, DefaultValue,decpath=3DNone,lineno=3DNone= ):=0D + def SetDecDefaultValue(self, DefaultValue, decpath=3DNone, lineno=3DNo= ne):=0D self.DefaultValueFromDec =3D DefaultValue=0D - self.DefaultValueFromDecInfo =3D (decpath,lineno)=0D - def AddOverrideValue (self, FieldName, Value, SkuName, DefaultStoreNam= e, FileName=3D"", LineNo=3D0, DimensionAttr =3D '-1'):=0D + self.DefaultValueFromDecInfo =3D (decpath, lineno)=0D +=0D + def AddOverrideValue(self, FieldName, Value, SkuName, DefaultStoreName= , FileName=3D"", LineNo=3D0, DimensionAttr=3D'-1'):=0D if SkuName not in self.SkuOverrideValues:=0D self.SkuOverrideValues[SkuName] =3D OrderedDict()=0D if DefaultStoreName not in self.SkuOverrideValues[SkuName]:=0D self.SkuOverrideValues[SkuName][DefaultStoreName] =3D OrderedD= ict()=0D if DimensionAttr not in self.SkuOverrideValues[SkuName][DefaultSto= reName]:=0D - self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAtt= r] =3D collections.OrderedDict()=0D + self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAtt= r] =3D collections.OrderedDict(=0D + )=0D if FieldName in self.SkuOverrideValues[SkuName][DefaultStoreName][= DimensionAttr]:=0D del self.SkuOverrideValues[SkuName][DefaultStoreName][Dimensio= nAttr][FieldName]=0D - self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr][F= ieldName] =3D [Value.strip(), FileName, LineNo]=0D + self.SkuOverrideValues[SkuName][DefaultStoreName][DimensionAttr][F= ieldName] =3D [=0D + Value.strip(), FileName, LineNo]=0D return self.SkuOverrideValues[SkuName][DefaultStoreName][Dimension= Attr][FieldName]=0D =0D - def AddComponentOverrideValue(self,FieldName, Value, ModuleGuid, FileN= ame=3D"", LineNo=3D0, DimensionAttr =3D '-1'):=0D - self.PcdFiledValueFromDscComponent.setdefault(ModuleGuid, OrderedD= ict())=0D - self.PcdFiledValueFromDscComponent[ModuleGuid].setdefault(Dimensio= nAttr,OrderedDict())=0D - self.PcdFiledValueFromDscComponent[ModuleGuid][DimensionAttr][Fiel= dName] =3D [Value.strip(), FileName, LineNo]=0D + def AddComponentOverrideValue(self, FieldName, Value, ModuleGuid, File= Name=3D"", LineNo=3D0, DimensionAttr=3D'-1'):=0D + self.PcdFiledValueFromDscComponent.setdefault(=0D + ModuleGuid, OrderedDict())=0D + self.PcdFiledValueFromDscComponent[ModuleGuid].setdefault(=0D + DimensionAttr, OrderedDict())=0D + self.PcdFiledValueFromDscComponent[ModuleGuid][DimensionAttr][Fiel= dName] =3D [=0D + Value.strip(), FileName, LineNo]=0D return self.PcdFiledValueFromDscComponent[ModuleGuid][DimensionAtt= r][FieldName]=0D =0D - def SetPcdMode (self, PcdMode):=0D + def SetPcdMode(self, PcdMode):=0D self.PcdMode =3D PcdMode=0D =0D def copy(self, PcdObject):=0D @@ -343,7 +363,7 @@ class StructurePcd(PcdClassObject): self.TokenSpaceGuidValue =3D PcdObject.TokenSpaceGuidValue if PcdO= bject.TokenSpaceGuidValue else self.TokenSpaceGuidValue=0D self.Type =3D PcdObject.Type if PcdObject.Type else self.Type=0D self._DatumType =3D PcdObject.DatumType if PcdObject.DatumType els= e self.DatumType=0D - self.DefaultValue =3D PcdObject.DefaultValue if PcdObject.Default= Value else self.DefaultValue=0D + self.DefaultValue =3D PcdObject.DefaultValue if PcdObject.DefaultV= alue else self.DefaultValue=0D self.TokenValue =3D PcdObject.TokenValue if PcdObject.TokenValue e= lse self.TokenValue=0D self.MaxDatumSize =3D PcdObject.MaxDatumSize if PcdObject.MaxDatum= Size else self.MaxDatumSize=0D self.SkuInfoList =3D PcdObject.SkuInfoList if PcdObject.SkuInfoLis= t else self.SkuInfoList=0D @@ -377,7 +397,7 @@ class StructurePcd(PcdClassObject): self.PcdFieldValueFromFdf =3D PcdObject.PcdFieldValueFromFdf i= f PcdObject.PcdFieldValueFromFdf else self.PcdFieldValueFromFdf=0D self.PcdFiledValueFromDscComponent =3D PcdObject.PcdFiledValue= FromDscComponent if PcdObject.PcdFiledValueFromDscComponent else self.PcdFi= ledValueFromDscComponent=0D =0D - def __deepcopy__(self,memo):=0D + def __deepcopy__(self, memo):=0D new_pcd =3D StructurePcd()=0D self.sharedcopy(new_pcd)=0D =0D @@ -387,53 +407,58 @@ class StructurePcd(PcdClassObject): new_pcd.StructName =3D self.DatumType=0D new_pcd.PcdDefineLineNo =3D self.PcdDefineLineNo=0D new_pcd.PkgPath =3D self.PkgPath=0D - new_pcd.StructuredPcdIncludeFile =3D [item for item in self.Struct= uredPcdIncludeFile]=0D + new_pcd.StructuredPcdIncludeFile =3D [=0D + item for item in self.StructuredPcdIncludeFile]=0D new_pcd.PackageDecs =3D [item for item in self.PackageDecs]=0D new_pcd.DefaultValues =3D CopyDict(self.DefaultValues)=0D - new_pcd.DefaultFromDSC=3DCopyDict(self.DefaultFromDSC)=0D + new_pcd.DefaultFromDSC =3D CopyDict(self.DefaultFromDSC)=0D new_pcd.SkuOverrideValues =3D CopyDict(self.SkuOverrideValues)=0D new_pcd.PcdFieldValueFromComm =3D CopyDict(self.PcdFieldValueFromC= omm)=0D new_pcd.PcdFieldValueFromFdf =3D CopyDict(self.PcdFieldValueFromFd= f)=0D - new_pcd.PcdFiledValueFromDscComponent =3D CopyDict(self.PcdFiledVa= lueFromDscComponent)=0D + new_pcd.PcdFiledValueFromDscComponent =3D CopyDict(=0D + self.PcdFiledValueFromDscComponent)=0D new_pcd.ValueChain =3D {item for item in self.ValueChain}=0D return new_pcd=0D =0D -LibraryClassObject =3D namedtuple('LibraryClassObject', ['LibraryClass','S= upModList'])=0D +=0D +LibraryClassObject =3D namedtuple(=0D + 'LibraryClassObject', ['LibraryClass', 'SupModList'])=0D +=0D =0D class BuildData(object):=0D # dict used to convert PCD type in database to string used by build to= ol=0D =0D _PCD_TYPE_STRING_ =3D {=0D - MODEL_PCD_FIXED_AT_BUILD : TAB_PCDS_FIXED_AT_BUILD,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : TAB_PCDS_PATCHABLE_IN_MODULE,= =0D - MODEL_PCD_FEATURE_FLAG : TAB_PCDS_FEATURE_FLAG,=0D - MODEL_PCD_DYNAMIC : TAB_PCDS_DYNAMIC,=0D - MODEL_PCD_DYNAMIC_DEFAULT : TAB_PCDS_DYNAMIC,=0D - MODEL_PCD_DYNAMIC_HII : TAB_PCDS_DYNAMIC_HII,=0D - MODEL_PCD_DYNAMIC_VPD : TAB_PCDS_DYNAMIC_VPD,=0D - MODEL_PCD_DYNAMIC_EX : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_EX_HII : TAB_PCDS_DYNAMIC_EX_HII,=0D - MODEL_PCD_DYNAMIC_EX_VPD : TAB_PCDS_DYNAMIC_EX_VPD,=0D + MODEL_PCD_FIXED_AT_BUILD: TAB_PCDS_FIXED_AT_BUILD,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: TAB_PCDS_PATCHABLE_IN_MODULE,=0D + MODEL_PCD_FEATURE_FLAG: TAB_PCDS_FEATURE_FLAG,=0D + MODEL_PCD_DYNAMIC: TAB_PCDS_DYNAMIC,=0D + MODEL_PCD_DYNAMIC_DEFAULT: TAB_PCDS_DYNAMIC,=0D + MODEL_PCD_DYNAMIC_HII: TAB_PCDS_DYNAMIC_HII,=0D + MODEL_PCD_DYNAMIC_VPD: TAB_PCDS_DYNAMIC_VPD,=0D + MODEL_PCD_DYNAMIC_EX: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_EX_HII: TAB_PCDS_DYNAMIC_EX_HII,=0D + MODEL_PCD_DYNAMIC_EX_VPD: TAB_PCDS_DYNAMIC_EX_VPD,=0D }=0D =0D def UpdatePcdTypeDict(self):=0D - if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_PCD_DYNAMIC_= AS_DYNAMICEX,"FALSE").upper() =3D=3D "TRUE":=0D + if GlobalData.gCommandLineDefines.get(TAB_DSC_DEFINES_PCD_DYNAMIC_= AS_DYNAMICEX, "FALSE").upper() =3D=3D "TRUE":=0D self._PCD_TYPE_STRING_ =3D {=0D - MODEL_PCD_FIXED_AT_BUILD : TAB_PCDS_FIXED_AT_BUIL= D,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : TAB_PCDS_PATCHABLE_IN_= MODULE,=0D - MODEL_PCD_FEATURE_FLAG : TAB_PCDS_FEATURE_FLAG,= =0D - MODEL_PCD_DYNAMIC : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_DEFAULT : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_HII : TAB_PCDS_DYNAMIC_EX_HI= I,=0D - MODEL_PCD_DYNAMIC_VPD : TAB_PCDS_DYNAMIC_EX_VP= D,=0D - MODEL_PCD_DYNAMIC_EX : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : TAB_PCDS_DYNAMIC_EX,=0D - MODEL_PCD_DYNAMIC_EX_HII : TAB_PCDS_DYNAMIC_EX_HI= I,=0D - MODEL_PCD_DYNAMIC_EX_VPD : TAB_PCDS_DYNAMIC_EX_VP= D,=0D + MODEL_PCD_FIXED_AT_BUILD: TAB_PCDS_FIXED_AT_BUILD,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: TAB_PCDS_PATCHABLE_IN_MOD= ULE,=0D + MODEL_PCD_FEATURE_FLAG: TAB_PCDS_FEATURE_FLAG,=0D + MODEL_PCD_DYNAMIC: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_DEFAULT: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_HII: TAB_PCDS_DYNAMIC_EX_HII,=0D + MODEL_PCD_DYNAMIC_VPD: TAB_PCDS_DYNAMIC_EX_VPD,=0D + MODEL_PCD_DYNAMIC_EX: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: TAB_PCDS_DYNAMIC_EX,=0D + MODEL_PCD_DYNAMIC_EX_HII: TAB_PCDS_DYNAMIC_EX_HII,=0D + MODEL_PCD_DYNAMIC_EX_VPD: TAB_PCDS_DYNAMIC_EX_VPD,=0D }=0D =0D - ## Convert the class to a string=0D + # Convert the class to a string=0D #=0D # Convert member MetaFile of the class to a string=0D #=0D @@ -442,7 +467,7 @@ class BuildData(object): def __str__(self):=0D return str(self.MetaFile)=0D =0D - ## Override __eq__ function=0D + # Override __eq__ function=0D #=0D # Check whether ModuleBuildClassObjects are the same=0D #=0D @@ -452,7 +477,7 @@ class BuildData(object): def __eq__(self, Other):=0D return self.MetaFile =3D=3D Other=0D =0D - ## Override __hash__ function=0D + # Override __hash__ function=0D #=0D # Use MetaFile as key in hash table=0D #=0D @@ -461,7 +486,7 @@ class BuildData(object): def __hash__(self):=0D return hash(self.MetaFile)=0D =0D -## ModuleBuildClassObject=0D +# ModuleBuildClassObject=0D #=0D # This Class defines ModuleBuildClass=0D #=0D @@ -505,41 +530,43 @@ class BuildData(object): # { [BuildOptionKey] : BuildOptionValue}=0D # @var Depex: To store value for Depex=0D #=0D +=0D +=0D class ModuleBuildClassObject(BuildData):=0D def __init__(self):=0D - self.AutoGenVersion =3D 0=0D - self.MetaFile =3D ''=0D - self.BaseName =3D ''=0D - self.ModuleType =3D ''=0D - self.Guid =3D ''=0D - self.Version =3D ''=0D - self.PcdIsDriver =3D ''=0D - self.BinaryModule =3D ''=0D - self.Shadow =3D ''=0D - self.CustomMakefile =3D {}=0D - self.Specification =3D {}=0D - self.LibraryClass =3D []=0D - self.ModuleEntryPointList =3D []=0D - self.ModuleUnloadImageList =3D []=0D - self.ConstructorList =3D []=0D - self.DestructorList =3D []=0D + self.AutoGenVersion =3D 0=0D + self.MetaFile =3D ''=0D + self.BaseName =3D ''=0D + self.ModuleType =3D ''=0D + self.Guid =3D ''=0D + self.Version =3D ''=0D + self.PcdIsDriver =3D ''=0D + self.BinaryModule =3D ''=0D + self.Shadow =3D ''=0D + self.CustomMakefile =3D {}=0D + self.Specification =3D {}=0D + self.LibraryClass =3D []=0D + self.ModuleEntryPointList =3D []=0D + self.ModuleUnloadImageList =3D []=0D + self.ConstructorList =3D []=0D + self.DestructorList =3D []=0D =0D - self.Binaries =3D []=0D - self.Sources =3D []=0D - self.LibraryClasses =3D OrderedDict()=0D - self.Libraries =3D []=0D - self.Protocols =3D []=0D - self.Ppis =3D []=0D - self.Guids =3D []=0D - self.Includes =3D []=0D - self.Packages =3D []=0D - self.Pcds =3D {}=0D - self.BuildOptions =3D {}=0D - self.Depex =3D {}=0D - self.StrPcdSet =3D []=0D - self.StrPcdOverallValue =3D {}=0D + self.Binaries =3D []=0D + self.Sources =3D []=0D + self.LibraryClasses =3D OrderedDict()=0D + self.Libraries =3D []=0D + self.Protocols =3D []=0D + self.Ppis =3D []=0D + self.Guids =3D []=0D + self.Includes =3D []=0D + self.Packages =3D []=0D + self.Pcds =3D {}=0D + self.BuildOptions =3D {}=0D + self.Depex =3D {}=0D + self.StrPcdSet =3D []=0D + self.StrPcdOverallValue =3D {}=0D =0D -## PackageBuildClassObject=0D +# PackageBuildClassObject=0D #=0D # This Class defines PackageBuildClass=0D #=0D @@ -562,21 +589,23 @@ class ModuleBuildClassObject(BuildData): # @var Pcds: To store value for Pcds, it is a set structure as= =0D # { [(PcdCName, PcdGuidCName)] : PcdClassObject}=0D #=0D +=0D +=0D class PackageBuildClassObject(BuildData):=0D def __init__(self):=0D - self.MetaFile =3D ''=0D - self.PackageName =3D ''=0D - self.Guid =3D ''=0D - self.Version =3D ''=0D + self.MetaFile =3D ''=0D + self.PackageName =3D ''=0D + self.Guid =3D ''=0D + self.Version =3D ''=0D =0D - self.Protocols =3D {}=0D - self.Ppis =3D {}=0D - self.Guids =3D {}=0D - self.Includes =3D []=0D - self.LibraryClasses =3D {}=0D - self.Pcds =3D {}=0D + self.Protocols =3D {}=0D + self.Ppis =3D {}=0D + self.Guids =3D {}=0D + self.Includes =3D []=0D + self.LibraryClasses =3D {}=0D + self.Pcds =3D {}=0D =0D -## PlatformBuildClassObject=0D +# PlatformBuildClassObject=0D #=0D # This Class defines PlatformBuildClass=0D #=0D @@ -603,21 +632,23 @@ class PackageBuildClassObject(BuildData): # @var BuildOptions: To store value for BuildOptions, it is a set str= ucture as=0D # { [BuildOptionKey] : BuildOptionValue }=0D #=0D +=0D +=0D class PlatformBuildClassObject(BuildData):=0D def __init__(self):=0D - self.MetaFile =3D ''=0D - self.PlatformName =3D ''=0D - self.Guid =3D ''=0D - self.Version =3D ''=0D - self.DscSpecification =3D ''=0D - self.OutputDirectory =3D ''=0D - self.FlashDefinition =3D ''=0D - self.BuildNumber =3D ''=0D + self.MetaFile =3D ''=0D + self.PlatformName =3D ''=0D + self.Guid =3D ''=0D + self.Version =3D ''=0D + self.DscSpecification =3D ''=0D + self.OutputDirectory =3D ''=0D + self.FlashDefinition =3D ''=0D + self.BuildNumber =3D ''=0D =0D - self.SkuIds =3D {}=0D - self.Modules =3D []=0D - self.LibraryInstances =3D []=0D - self.LibraryClasses =3D {}=0D - self.Libraries =3D {}=0D - self.Pcds =3D {}=0D - self.BuildOptions =3D {}=0D + self.SkuIds =3D {}=0D + self.Modules =3D []=0D + self.LibraryInstances =3D []=0D + self.LibraryClasses =3D {}=0D + self.Libraries =3D {}=0D + self.Pcds =3D {}=0D + self.BuildOptions =3D {}=0D diff --git a/BaseTools/Source/Python/Workspace/DecBuildData.py b/BaseTools/= Source/Python/Workspace/DecBuildData.py index eeb7c490ac8c..5f23904d9985 100644 --- a/BaseTools/Source/Python/Workspace/DecBuildData.py +++ b/BaseTools/Source/Python/Workspace/DecBuildData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by build tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -15,11 +15,13 @@ from Workspace.BuildClassObject import PackageBuildClas= sObject, StructurePcd, Pc from Common.GlobalData import gGlobalDefines=0D from re import compile=0D =0D -## Platform build information from DEC file=0D +# Platform build information from DEC file=0D #=0D # This class is used to retrieve information stored in database and conve= rt them=0D # into PackageBuildClassObject form for easier use for AutoGen.=0D #=0D +=0D +=0D class DecBuildData(PackageBuildClassObject):=0D =0D # dict used to convert part of [Defines] to members of DecBuildData di= rectly=0D @@ -27,13 +29,13 @@ class DecBuildData(PackageBuildClassObject): #=0D # Required Fields=0D #=0D - TAB_DEC_DEFINES_PACKAGE_NAME : "_PackageName",=0D - TAB_DEC_DEFINES_PACKAGE_GUID : "_Guid",=0D - TAB_DEC_DEFINES_PACKAGE_VERSION : "_Version",=0D - TAB_DEC_DEFINES_PKG_UNI_FILE : "_PkgUniFile",=0D + TAB_DEC_DEFINES_PACKAGE_NAME: "_PackageName",=0D + TAB_DEC_DEFINES_PACKAGE_GUID: "_Guid",=0D + TAB_DEC_DEFINES_PACKAGE_VERSION: "_Version",=0D + TAB_DEC_DEFINES_PKG_UNI_FILE: "_PkgUniFile",=0D }=0D =0D - ## Constructor of DecBuildData=0D + # Constructor of DecBuildData=0D #=0D # Initialize object of DecBuildData=0D #=0D @@ -63,43 +65,43 @@ class DecBuildData(PackageBuildClassObject): def __getitem__(self, key):=0D return self.__dict__[self._PROPERTY_[key]]=0D =0D - ## "in" test support=0D + # "in" test support=0D def __contains__(self, key):=0D return key in self._PROPERTY_=0D =0D - ## Set all internal used members of DecBuildData to None=0D + # Set all internal used members of DecBuildData to None=0D def _Clear(self):=0D - self._Header =3D None=0D - self._PackageName =3D None=0D - self._Guid =3D None=0D - self._Version =3D None=0D - self._PkgUniFile =3D None=0D - self._Protocols =3D None=0D - self._Ppis =3D None=0D - self._Guids =3D None=0D - self._Includes =3D None=0D - self._CommonIncludes =3D None=0D - self._LibraryClasses =3D None=0D - self._Pcds =3D None=0D - self._MacroDict =3D None=0D - self._PrivateProtocols =3D None=0D - self._PrivatePpis =3D None=0D - self._PrivateGuids =3D None=0D - self._PrivateIncludes =3D None=0D + self._Header =3D None=0D + self._PackageName =3D None=0D + self._Guid =3D None=0D + self._Version =3D None=0D + self._PkgUniFile =3D None=0D + self._Protocols =3D None=0D + self._Ppis =3D None=0D + self._Guids =3D None=0D + self._Includes =3D None=0D + self._CommonIncludes =3D None=0D + self._LibraryClasses =3D None=0D + self._Pcds =3D None=0D + self._MacroDict =3D None=0D + self._PrivateProtocols =3D None=0D + self._PrivatePpis =3D None=0D + self._PrivateGuids =3D None=0D + self._PrivateIncludes =3D None=0D =0D - ## Get current effective macros=0D + # Get current effective macros=0D @property=0D def _Macros(self):=0D if self._MacroDict is None:=0D self._MacroDict =3D dict(gGlobalDefines)=0D return self._MacroDict=0D =0D - ## Get architecture=0D + # Get architecture=0D @property=0D def Arch(self):=0D return self._Arch=0D =0D - ## Retrieve all information in [Defines] section=0D + # Retrieve all information in [Defines] section=0D #=0D # (Retrieving all [Defines] information in one-shot is just to save = time.)=0D #=0D @@ -111,27 +113,29 @@ class DecBuildData(PackageBuildClassObject): self[Name] =3D Record[2]=0D self._Header =3D 'DUMMY'=0D =0D - ## Retrieve package name=0D + # Retrieve package name=0D @property=0D def PackageName(self):=0D if self._PackageName is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._PackageName is None:=0D - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "No PACK= AGE_NAME", File=3Dself.MetaFile)=0D + EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,=0D + "No PACKAGE_NAME", File=3Dself.MetaFile)=0D return self._PackageName=0D =0D - ## Retrieve file guid=0D + # Retrieve file guid=0D @property=0D def PackageName(self):=0D if self._Guid is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._Guid is None:=0D - EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE, "No PACK= AGE_GUID", File=3Dself.MetaFile)=0D + EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,=0D + "No PACKAGE_GUID", File=3Dself.MetaFile)=0D return self._Guid=0D =0D - ## Retrieve package version=0D + # Retrieve package version=0D @property=0D def Version(self):=0D if self._Version is None:=0D @@ -141,7 +145,7 @@ class DecBuildData(PackageBuildClassObject): self._Version =3D ''=0D return self._Version=0D =0D - ## Retrieve protocol definitions (name/value pairs)=0D + # Retrieve protocol definitions (name/value pairs)=0D @property=0D def Protocols(self):=0D if self._Protocols is None:=0D @@ -162,12 +166,14 @@ class DecBuildData(PackageBuildClassObject): PrivateNameList.append(Name)=0D PrivateProtocolDict[Arch, Name] =3D Guid=0D if Name in PublicNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D else:=0D if Name not in PublicNameList:=0D PublicNameList.append(Name)=0D if Name in PrivateNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D if Name not in NameList:=0D NameList.append(Name)=0D ProtocolDict[Arch, Name] =3D Guid=0D @@ -184,7 +190,7 @@ class DecBuildData(PackageBuildClassObject): self._PrivateProtocols[Name] =3D PrivateProtocolDict[self.= _Arch, Name]=0D return self._Protocols=0D =0D - ## Retrieve PPI definitions (name/value pairs)=0D + # Retrieve PPI definitions (name/value pairs)=0D @property=0D def Ppis(self):=0D if self._Ppis is None:=0D @@ -205,12 +211,14 @@ class DecBuildData(PackageBuildClassObject): PrivateNameList.append(Name)=0D PrivatePpiDict[Arch, Name] =3D Guid=0D if Name in PublicNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D else:=0D if Name not in PublicNameList:=0D PublicNameList.append(Name)=0D if Name in PrivateNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D if Name not in NameList:=0D NameList.append(Name)=0D PpiDict[Arch, Name] =3D Guid=0D @@ -227,7 +235,7 @@ class DecBuildData(PackageBuildClassObject): self._PrivatePpis[Name] =3D PrivatePpiDict[self._Arch, Nam= e]=0D return self._Ppis=0D =0D - ## Retrieve GUID definitions (name/value pairs)=0D + # Retrieve GUID definitions (name/value pairs)=0D @property=0D def Guids(self):=0D if self._Guids is None:=0D @@ -248,12 +256,14 @@ class DecBuildData(PackageBuildClassObject): PrivateNameList.append(Name)=0D PrivateGuidDict[Arch, Name] =3D Guid=0D if Name in PublicNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D else:=0D if Name not in PublicNameList:=0D PublicNameList.append(Name)=0D if Name in PrivateNameList:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % Name, File=3Dself.MetaFile, Line=3DLineNo)=0D if Name not in NameList:=0D NameList.append(Name)=0D GuidDict[Arch, Name] =3D Guid=0D @@ -270,7 +280,7 @@ class DecBuildData(PackageBuildClassObject): self._PrivateGuids[Name] =3D PrivateGuidDict[self._Arch, N= ame]=0D return self._Guids=0D =0D - ## Retrieve public include paths declared in this package=0D + # Retrieve public include paths declared in this package=0D @property=0D def Includes(self):=0D if self._Includes is None or self._CommonIncludes is None:=0D @@ -281,12 +291,14 @@ class DecBuildData(PackageBuildClassObject): RecordList =3D self._RawData[MODEL_EFI_INCLUDE, self._Arch]=0D Macros =3D self._Macros=0D for Record in RecordList:=0D - File =3D PathClass(NormPath(Record[0], Macros), self._Pack= ageDir, Arch=3Dself._Arch)=0D + File =3D PathClass(=0D + NormPath(Record[0], Macros), self._PackageDir, Arch=3D= self._Arch)=0D LineNo =3D Record[-1]=0D # validate the path=0D ErrorCode, ErrorInfo =3D File.Validate()=0D if ErrorCode !=3D 0:=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorI= nfo, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3D= self.MetaFile, Line=3DLineNo)=0D =0D # avoid duplicate include path=0D if File not in self._Includes:=0D @@ -295,17 +307,19 @@ class DecBuildData(PackageBuildClassObject): if File not in self._PrivateIncludes:=0D self._PrivateIncludes.append(File)=0D if File in PublicInclues:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % File, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % File, File=3Dself.MetaFile, Line=3DLineNo)=0D else:=0D if File not in PublicInclues:=0D PublicInclues.append(File)=0D if File in self._PrivateIncludes:=0D - EdkLogger.error('build', OPTION_CONFLICT, "Can't d= etermine %s's attribute, it is both defined as Private and non-Private attr= ibute in DEC file." % File, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', OPTION_CONFLICT, "Can't determine %s'= s attribute, it is both defined as Private and non-Private attribute in DEC= file." % File, File=3Dself.MetaFile, Line=3DLineNo)=0D if Record[3] =3D=3D TAB_COMMON:=0D self._CommonIncludes.append(File)=0D return self._Includes=0D =0D - ## Retrieve library class declarations (not used in build at present)= =0D + # Retrieve library class declarations (not used in build at present)=0D @property=0D def LibraryClasses(self):=0D if self._LibraryClasses is None:=0D @@ -318,11 +332,13 @@ class DecBuildData(PackageBuildClassObject): RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Ar= ch]=0D Macros =3D self._Macros=0D for LibraryClass, File, Dummy, Arch, PrivateFlag, ID, LineNo i= n RecordList:=0D - File =3D PathClass(NormPath(File, Macros), self._PackageDi= r, Arch=3Dself._Arch)=0D + File =3D PathClass(NormPath(File, Macros),=0D + self._PackageDir, Arch=3Dself._Arch)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate()=0D if ErrorCode !=3D 0:=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorI= nfo, File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3D= self.MetaFile, Line=3DLineNo)=0D LibraryClassSet.add(LibraryClass)=0D LibraryClassDict[Arch, LibraryClass] =3D File=0D self._LibraryClasses =3D OrderedDict()=0D @@ -330,7 +346,7 @@ class DecBuildData(PackageBuildClassObject): self._LibraryClasses[LibraryClass] =3D LibraryClassDict[se= lf._Arch, LibraryClass]=0D return self._LibraryClasses=0D =0D - ## Retrieve PCD declarations=0D + # Retrieve PCD declarations=0D @property=0D def Pcds(self):=0D if self._Pcds is None:=0D @@ -342,7 +358,7 @@ class DecBuildData(PackageBuildClassObject): self._Pcds.update(self._GetPcd(MODEL_PCD_DYNAMIC_EX))=0D return self._Pcds=0D =0D - def ParsePcdName(self,TokenCName):=0D + def ParsePcdName(self, TokenCName):=0D TokenCName =3D TokenCName.strip()=0D if TokenCName.startswith("["):=0D if "." in TokenCName:=0D @@ -355,7 +371,7 @@ class DecBuildData(PackageBuildClassObject): Demesionattr =3D ""=0D Fields =3D TokenCName=0D =0D - return Demesionattr,Fields=0D + return Demesionattr, Fields=0D =0D def ProcessStructurePcd(self, StructurePcdRawDataSet):=0D s_pcd_set =3D OrderedDict()=0D @@ -372,25 +388,30 @@ class DecBuildData(PackageBuildClassObject): if not item.TokenCName:=0D continue=0D if "" in item.TokenCName:=0D - struct_pcd.StructuredPcdIncludeFile.append(item.Defaul= tValue)=0D + struct_pcd.StructuredPcdIncludeFile.append(=0D + item.DefaultValue)=0D elif "" in item.TokenCName:=0D dep_pkgs.append(item.DefaultValue)=0D elif item.DatumType =3D=3D item.TokenCName:=0D struct_pcd.copy(item)=0D - struct_pcd.TokenValue =3D struct_pcd.TokenValue.strip(= "{").strip()=0D - struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName = =3D pcdname.split(".")=0D + struct_pcd.TokenValue =3D struct_pcd.TokenValue.strip(= =0D + "{").strip()=0D + struct_pcd.TokenSpaceGuidCName, struct_pcd.TokenCName = =3D pcdname.split(=0D + ".")=0D struct_pcd.PcdDefineLineNo =3D LineNo=0D struct_pcd.PkgPath =3D self.MetaFile.File=0D - struct_pcd.SetDecDefaultValue(item.DefaultValue,self.M= etaFile.File,LineNo)=0D + struct_pcd.SetDecDefaultValue(=0D + item.DefaultValue, self.MetaFile.File, LineNo)=0D else:=0D DemesionAttr, Fields =3D self.ParsePcdName(item.TokenC= Name)=0D - struct_pcd.AddDefaultValue(Fields, item.DefaultValue, = self.MetaFile.File, LineNo,DemesionAttr)=0D + struct_pcd.AddDefaultValue(=0D + Fields, item.DefaultValue, self.MetaFile.File, Lin= eNo, DemesionAttr)=0D =0D struct_pcd.PackageDecs =3D dep_pkgs=0D str_pcd_set.append(struct_pcd)=0D return str_pcd_set=0D =0D - ## Retrieve PCD declarations for given type=0D + # Retrieve PCD declarations for given type=0D def _GetPcd(self, Type):=0D Pcds =3D OrderedDict()=0D #=0D @@ -420,38 +441,43 @@ class DecBuildData(PackageBuildClassObject): continue=0D =0D DefaultValue, DatumType, TokenNumber =3D AnalyzePcdData(Settin= g)=0D - validateranges, validlists, expressions =3D self._RawData.GetV= alidExpression(TokenSpaceGuid, PcdCName)=0D + validateranges, validlists, expressions =3D self._RawData.GetV= alidExpression(=0D + TokenSpaceGuid, PcdCName)=0D PcdObj =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - self._PCD_TYPE_STRING_[Type],=0D - DatumType,=0D - DefaultValue,=0D - TokenNumber,=0D - '',=0D - {},=0D - False,=0D - None,=0D - list(validateranges),=0D - list(validlists),=0D - list(expressions)=0D - )=0D + PcdCName,=0D + TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type],=0D + DatumType,=0D + DefaultValue,=0D + TokenNumber,=0D + '',=0D + {},=0D + False,=0D + None,=0D + list(validateranges),=0D + list(validlists),=0D + list(expressions)=0D + )=0D DefinitionPosition[PcdObj] =3D (self.MetaFile.File, LineNo)=0D if "." in TokenSpaceGuid:=0D StrPcdSet.append((PcdObj, LineNo))=0D else:=0D - Pcds[PcdCName, TokenSpaceGuid, self._PCD_TYPE_STRING_[Type= ]] =3D PcdObj=0D + Pcds[PcdCName, TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type]] =3D PcdObj=0D =0D StructurePcds =3D self.ProcessStructurePcd(StrPcdSet)=0D for pcd in StructurePcds:=0D - Pcds[pcd.TokenCName, pcd.TokenSpaceGuidCName, self._PCD_TYPE_S= TRING_[Type]] =3D pcd=0D + Pcds[pcd.TokenCName, pcd.TokenSpaceGuidCName,=0D + self._PCD_TYPE_STRING_[Type]] =3D pcd=0D StructPattern =3D compile(r'[_a-zA-Z][0-9A-Za-z_]*$')=0D for pcd in Pcds.values():=0D if pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TA= B_UINT64, TAB_VOID, "BOOLEAN"]:=0D if not pcd.IsAggregateDatumType():=0D - EdkLogger.error('build', FORMAT_INVALID, "DatumType on= ly support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct = name.", DefinitionPosition[pcd][0], DefinitionPosition[pcd][1])=0D + EdkLogger.error('build', FORMAT_INVALID, "DatumType on= ly support BOOLEAN, UINT8, UINT16, UINT32, UINT64, VOID* or a valid struct = name.",=0D + DefinitionPosition[pcd][0], Definition= Position[pcd][1])=0D elif not pcd.IsArray() and not pcd.StructuredPcdIncludeFil= e:=0D - EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "The= structure Pcd %s.%s header file is not found in %s line %s \n" % (pcd.Toke= nSpaceGuidCName, pcd.TokenCName, pcd.DefinitionPosition[0], pcd.DefinitionP= osition[1] ))=0D + EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "The= structure Pcd %s.%s header file is not found in %s line %s \n" % (=0D + pcd.TokenSpaceGuidCName, pcd.TokenCName, pcd.Defin= itionPosition[0], pcd.DefinitionPosition[1]))=0D return Pcds=0D =0D @property=0D diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index e9f68384b429..fe1f8369a220 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by build tool=0D #=0D # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
        =0D @@ -6,12 +6,13 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Platform build information from DSC file=0D +# Platform build information from DSC file=0D #=0D # This class is used to retrieve information stored in database and conve= rt them=0D # into PlatformBuildClassObject form for easier use for AutoGen.=0D #=0D from __future__ import print_function=0D +from AutoGen.GenMake import gIncludePattern=0D from __future__ import absolute_import=0D from Common.StringUtils import *=0D from Common.DataType import *=0D @@ -19,15 +20,15 @@ from Common.Misc import * from types import *=0D from Common.Expression import *=0D from CommonDataClass.CommonClass import SkuInfoClass=0D -from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFil= e=0D -from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile=0D +from Common.TargetTxtClassObject import TargetTxtDict, gDefaultTargetTxtFi= le=0D +from Common.ToolDefClassObject import ToolDefDict, gDefaultToolsDefFile=0D from .MetaDataTable import *=0D from .MetaFileTable import *=0D from .MetaFileParser import *=0D =0D from .WorkspaceCommon import GetDeclaredPcd=0D from Common.Misc import AnalyzeDscPcd=0D -from Common.Misc import ProcessDuplicatedInf,RemoveCComments,ArrayIndex=0D +from Common.Misc import ProcessDuplicatedInf, RemoveCComments, ArrayIndex= =0D import re=0D from Common.Parsing import IsValidWord=0D from Common.VariableAttributes import VariableAttributes=0D @@ -38,11 +39,12 @@ from Common.Misc import SaveFileOnChange from Workspace.BuildClassObject import PlatformBuildClassObject, Structure= Pcd, PcdClassObject, ModuleBuildClassObject=0D from collections import OrderedDict, defaultdict=0D =0D -def _IsFieldValueAnArray (Value):=0D +=0D +def _IsFieldValueAnArray(Value):=0D Value =3D Value.strip()=0D if Value.startswith(TAB_GUID) and Value.endswith(')'):=0D return True=0D - if Value.startswith('L"') and Value.endswith('"') and len(list(Value[= 2:-1])) > 1:=0D + if Value.startswith('L"') and Value.endswith('"') and len(list(Value[2= :-1])) > 1:=0D return True=0D if Value[0] =3D=3D '"' and Value[-1] =3D=3D '"' and len(list(Value[1:-= 1])) > 1:=0D return True=0D @@ -54,6 +56,7 @@ def _IsFieldValueAnArray (Value): return True=0D return False=0D =0D +=0D PcdValueInitName =3D 'PcdValueInit'=0D PcdValueCommonName =3D 'PcdValueCommon'=0D =0D @@ -109,13 +112,12 @@ LIBS =3D -lCommon =0D variablePattern =3D re.compile(r'[\t\s]*0[xX][a-fA-F0-9]+$')=0D SkuIdPattern =3D re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*$')=0D -## regular expressions for finding decimal and hex numbers=0D +# regular expressions for finding decimal and hex numbers=0D Pattern =3D re.compile('^[1-9]\d*|0$')=0D HexPattern =3D re.compile(r'0[xX][0-9a-fA-F]+$')=0D -## Regular expression for finding header file inclusions=0D -from AutoGen.GenMake import gIncludePattern=0D +# Regular expression for finding header file inclusions=0D =0D -## Find dependencies for one source file=0D +# Find dependencies for one source file=0D #=0D # By searching recursively "#include" directive in file, find out all the= =0D # files needed by given source file. The dependecies will be only searche= d=0D @@ -125,6 +127,8 @@ from AutoGen.GenMake import gIncludePattern #=0D # @retval list The list of files the given source file de= pends on=0D #=0D +=0D +=0D def GetDependencyList(FileStack, SearchPathList):=0D DepDb =3D dict()=0D DependencySet =3D set(FileStack)=0D @@ -139,7 +143,8 @@ def GetDependencyList(FileStack, SearchPathList): Fd =3D open(F, 'r')=0D FileContent =3D Fd.read()=0D except BaseException as X:=0D - EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=3DF = + "\n\t" + str(X))=0D + EdkLogger.error("build", FILE_OPEN_FAILURE,=0D + ExtraData=3DF + "\n\t" + str(X))=0D finally:=0D if "Fd" in dir(locals()):=0D Fd.close()=0D @@ -179,6 +184,7 @@ def GetDependencyList(FileStack, SearchPathList): =0D return DependencyList=0D =0D +=0D class DscBuildData(PlatformBuildClassObject):=0D =0D # dict used to convert part of [Defines] to members of DscBuildData di= rectly=0D @@ -186,19 +192,19 @@ class DscBuildData(PlatformBuildClassObject): #=0D # Required Fields=0D #=0D - TAB_DSC_DEFINES_PLATFORM_NAME : "_PlatformName",=0D - TAB_DSC_DEFINES_PLATFORM_GUID : "_Guid",=0D - TAB_DSC_DEFINES_PLATFORM_VERSION : "_Version",=0D - TAB_DSC_DEFINES_DSC_SPECIFICATION : "_DscSpecification",=0D + TAB_DSC_DEFINES_PLATFORM_NAME: "_PlatformName",=0D + TAB_DSC_DEFINES_PLATFORM_GUID: "_Guid",=0D + TAB_DSC_DEFINES_PLATFORM_VERSION: "_Version",=0D + TAB_DSC_DEFINES_DSC_SPECIFICATION: "_DscSpecification",=0D # TAB_DSC_DEFINES_OUTPUT_DIRECTORY : "_OutputDirectory",= =0D # TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES : "_SupArchList",=0D # TAB_DSC_DEFINES_BUILD_TARGETS : "_BuildTargets",=0D - TAB_DSC_DEFINES_SKUID_IDENTIFIER : "_SkuName",=0D + TAB_DSC_DEFINES_SKUID_IDENTIFIER: "_SkuName",=0D # TAB_DSC_DEFINES_FLASH_DEFINITION : "_FlashDefinition",= =0D - TAB_DSC_DEFINES_BUILD_NUMBER : "_BuildNumber",=0D - TAB_DSC_DEFINES_MAKEFILE_NAME : "_MakefileName",=0D - TAB_DSC_DEFINES_BS_BASE_ADDRESS : "_BsBaseAddress",=0D - TAB_DSC_DEFINES_RT_BASE_ADDRESS : "_RtBaseAddress",=0D + TAB_DSC_DEFINES_BUILD_NUMBER: "_BuildNumber",=0D + TAB_DSC_DEFINES_MAKEFILE_NAME: "_MakefileName",=0D + TAB_DSC_DEFINES_BS_BASE_ADDRESS: "_BsBaseAddress",=0D + TAB_DSC_DEFINES_RT_BASE_ADDRESS: "_RtBaseAddress",=0D # TAB_DSC_DEFINES_RFC_LANGUAGES : "_RFCLanguages",=0D # TAB_DSC_DEFINES_ISO_LANGUAGES : "_ISOLanguages",=0D }=0D @@ -206,7 +212,7 @@ class DscBuildData(PlatformBuildClassObject): # used to compose dummy library class name for those forced library in= stances=0D _NullLibraryNumber =3D 0=0D =0D - ## Constructor of DscBuildData=0D + # Constructor of DscBuildData=0D #=0D # Initialize object of DscBuildData=0D #=0D @@ -226,10 +232,12 @@ class DscBuildData(PlatformBuildClassObject): self._Toolchain =3D Toolchain=0D self._ToolChainFamily =3D None=0D self._Clear()=0D - self.WorkspaceDir =3D os.getenv("WORKSPACE") if os.getenv("WORKSPA= CE") else ""=0D + self.WorkspaceDir =3D os.getenv(=0D + "WORKSPACE") if os.getenv("WORKSPACE") else ""=0D self.DefaultStores =3D None=0D self.SkuIdMgr =3D SkuClass(self.SkuName, self.SkuIds)=0D self.UpdatePcdTypeDict()=0D +=0D @property=0D def OutputPath(self):=0D if os.getenv("WORKSPACE"):=0D @@ -245,46 +253,46 @@ class DscBuildData(PlatformBuildClassObject): def __getitem__(self, key):=0D return self.__dict__[self._PROPERTY_[key]]=0D =0D - ## "in" test support=0D + # "in" test support=0D def __contains__(self, key):=0D return key in self._PROPERTY_=0D =0D - ## Set all internal used members of DscBuildData to None=0D + # Set all internal used members of DscBuildData to None=0D def _Clear(self):=0D - self._Header =3D None=0D - self._PlatformName =3D None=0D - self._Guid =3D None=0D - self._Version =3D None=0D - self._DscSpecification =3D None=0D - self._OutputDirectory =3D None=0D - self._SupArchList =3D None=0D - self._BuildTargets =3D None=0D - self._SkuName =3D None=0D - self._PcdInfoFlag =3D None=0D - self._VarCheckFlag =3D None=0D - self._FlashDefinition =3D None=0D - self._Prebuild =3D None=0D - self._Postbuild =3D None=0D - self._BuildNumber =3D None=0D - self._MakefileName =3D None=0D - self._BsBaseAddress =3D None=0D - self._RtBaseAddress =3D None=0D - self._SkuIds =3D None=0D - self._Modules =3D None=0D - self._LibraryInstances =3D None=0D - self._LibraryClasses =3D None=0D - self._Pcds =3D None=0D - self._DecPcds =3D None=0D - self._BuildOptions =3D None=0D + self._Header =3D None=0D + self._PlatformName =3D None=0D + self._Guid =3D None=0D + self._Version =3D None=0D + self._DscSpecification =3D None=0D + self._OutputDirectory =3D None=0D + self._SupArchList =3D None=0D + self._BuildTargets =3D None=0D + self._SkuName =3D None=0D + self._PcdInfoFlag =3D None=0D + self._VarCheckFlag =3D None=0D + self._FlashDefinition =3D None=0D + self._Prebuild =3D None=0D + self._Postbuild =3D None=0D + self._BuildNumber =3D None=0D + self._MakefileName =3D None=0D + self._BsBaseAddress =3D None=0D + self._RtBaseAddress =3D None=0D + self._SkuIds =3D None=0D + self._Modules =3D None=0D + self._LibraryInstances =3D None=0D + self._LibraryClasses =3D None=0D + self._Pcds =3D None=0D + self._DecPcds =3D None=0D + self._BuildOptions =3D None=0D self._ModuleTypeOptions =3D None=0D - self._LoadFixAddress =3D None=0D - self._RFCLanguages =3D None=0D - self._ISOLanguages =3D None=0D - self._VpdToolGuid =3D None=0D - self._MacroDict =3D None=0D - self.DefaultStores =3D None=0D + self._LoadFixAddress =3D None=0D + self._RFCLanguages =3D None=0D + self._ISOLanguages =3D None=0D + self._VpdToolGuid =3D None=0D + self._MacroDict =3D None=0D + self.DefaultStores =3D None=0D =0D - ## Get current effective macros=0D + # Get current effective macros=0D @property=0D def _Macros(self):=0D if self._MacroDict is None:=0D @@ -294,15 +302,16 @@ class DscBuildData(PlatformBuildClassObject): self._MacroDict.update(GlobalData.gCommandLineDefines)=0D return self._MacroDict=0D =0D - ## Get architecture=0D + # Get architecture=0D @property=0D def Arch(self):=0D return self._Arch=0D +=0D @property=0D def Dir(self):=0D return self.MetaFile.Dir=0D =0D - ## Retrieve all information in [Defines] section=0D + # Retrieve all information in [Defines] section=0D #=0D # (Retrieving all [Defines] information in one-shot is just to save = time.)=0D #=0D @@ -320,7 +329,8 @@ class DscBuildData(PlatformBuildClassObject): File=3Dself.MetaFile, Line=3DRecord[-1= ],=0D ExtraData=3Dself._OutputDirectory)=0D elif Name =3D=3D TAB_DSC_DEFINES_FLASH_DEFINITION:=0D - self._FlashDefinition =3D PathClass(NormPath(Record[2], se= lf._Macros), GlobalData.gWorkspace)=0D + self._FlashDefinition =3D PathClass(=0D + NormPath(Record[2], self._Macros), GlobalData.gWorkspa= ce)=0D ErrorCode, ErrorInfo =3D self._FlashDefinition.Validate('.= fdf')=0D if ErrorCode !=3D 0:=0D EdkLogger.error('build', ErrorCode, File=3Dself.MetaFi= le, Line=3DRecord[-1],=0D @@ -330,7 +340,7 @@ class DscBuildData(PlatformBuildClassObject): if Record[2][0] =3D=3D '"':=0D if Record[2][-1] !=3D '"':=0D EdkLogger.error('build', FORMAT_INVALID, 'Missing = double quotes in the end of %s statement.' % TAB_DSC_PREBUILD,=0D - File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D + File=3Dself.MetaFile, Line=3DRecor= d[-1])=0D PrebuildValue =3D Record[2][1:-1]=0D self._Prebuild =3D PrebuildValue=0D elif Name =3D=3D TAB_DSC_POSTBUILD:=0D @@ -338,11 +348,12 @@ class DscBuildData(PlatformBuildClassObject): if Record[2][0] =3D=3D '"':=0D if Record[2][-1] !=3D '"':=0D EdkLogger.error('build', FORMAT_INVALID, 'Missing = double quotes in the end of %s statement.' % TAB_DSC_POSTBUILD,=0D - File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D + File=3Dself.MetaFile, Line=3DRecor= d[-1])=0D PostbuildValue =3D Record[2][1:-1]=0D self._Postbuild =3D PostbuildValue=0D elif Name =3D=3D TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES:=0D - self._SupArchList =3D GetSplitValueList(Record[2], TAB_VAL= UE_SPLIT)=0D + self._SupArchList =3D GetSplitValueList(=0D + Record[2], TAB_VALUE_SPLIT)=0D elif Name =3D=3D TAB_DSC_DEFINES_BUILD_TARGETS:=0D self._BuildTargets =3D GetSplitValueList(Record[2])=0D elif Name =3D=3D TAB_DSC_DEFINES_SKUID_IDENTIFIER:=0D @@ -356,9 +367,10 @@ class DscBuildData(PlatformBuildClassObject): self._VarCheckFlag =3D Record[2]=0D elif Name =3D=3D TAB_FIX_LOAD_TOP_MEMORY_ADDRESS:=0D try:=0D - self._LoadFixAddress =3D int (Record[2], 0)=0D + self._LoadFixAddress =3D int(Record[2], 0)=0D except:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_= TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (Record[2]))=0D + EdkLogger.error(=0D + "build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_A= DDRESS %s is not valid dec or hex string" % (Record[2]))=0D elif Name =3D=3D TAB_DSC_DEFINES_RFC_LANGUAGES:=0D if not Record[2] or Record[2][0] !=3D '"' or Record[2][-1]= !=3D '"' or len(Record[2]) =3D=3D 1:=0D EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'langua= ge code for RFC_LANGUAGES must have double quotes around it, for example: R= FC_LANGUAGES =3D "en-us;zh-hans"',=0D @@ -367,7 +379,8 @@ class DscBuildData(PlatformBuildClassObject): if not LanguageCodes:=0D EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or= more RFC4646 format language code must be provided for RFC_LANGUAGES state= ment',=0D File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D - LanguageList =3D GetSplitValueList(LanguageCodes, TAB_SEMI= _COLON_SPLIT)=0D + LanguageList =3D GetSplitValueList(=0D + LanguageCodes, TAB_SEMI_COLON_SPLIT)=0D # check whether there is empty entries in the list=0D if None in LanguageList:=0D EdkLogger.error('build', FORMAT_NOT_SUPPORTED, 'one or= more empty language code is in RFC_LANGUAGES statement',=0D @@ -390,7 +403,8 @@ class DscBuildData(PlatformBuildClassObject): self._ISOLanguages =3D LanguageList=0D elif Name =3D=3D TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_ST= ORE:=0D if TAB_DSC_DEFINES_VPD_AUTHENTICATED_VARIABLE_STORE not in= gCommandLineDefines:=0D - gCommandLineDefines[TAB_DSC_DEFINES_VPD_AUTHENTICATED_= VARIABLE_STORE] =3D Record[2].strip()=0D + gCommandLineDefines[TAB_DSC_DEFINES_VPD_AUTHENTICATED_= VARIABLE_STORE] =3D Record[2].strip(=0D + )=0D =0D elif Name =3D=3D TAB_DSC_DEFINES_VPD_TOOL_GUID:=0D #=0D @@ -400,88 +414,97 @@ class DscBuildData(PlatformBuildClassObject): try:=0D uuid.UUID(Record[2])=0D except:=0D - EdkLogger.error("build", FORMAT_INVALID, "Invalid GUID= format for VPD_TOOL_GUID", File=3Dself.MetaFile)=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, "Invalid GUID format for = VPD_TOOL_GUID", File=3Dself.MetaFile)=0D self._VpdToolGuid =3D Record[2]=0D elif Name =3D=3D TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX:=0D if TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYNAMICEX not in gComman= dLineDefines:=0D - gCommandLineDefines[TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYN= AMICEX] =3D Record[2].strip()=0D + gCommandLineDefines[TAB_DSC_DEFINES_PCD_DYNAMIC_AS_DYN= AMICEX] =3D Record[2].strip(=0D + )=0D elif Name in self:=0D self[Name] =3D Record[2]=0D # set _Header to non-None in order to avoid database re-querying=0D self._Header =3D 'DUMMY'=0D =0D - ## Retrieve platform name=0D + # Retrieve platform name=0D @property=0D def PlatformName(self):=0D if self._PlatformName is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._PlatformName is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLAT= FORM_NAME", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No PLATFORM_NAME", File=3Dself.MetaFile)= =0D return self._PlatformName=0D =0D @property=0D def Platform(self):=0D return self.PlatformName=0D =0D - ## Retrieve file guid=0D + # Retrieve file guid=0D @property=0D def Guid(self):=0D if self._Guid is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._Guid is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLAT= FORM_GUID", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No PLATFORM_GUID", File=3Dself.MetaFile)= =0D return self._Guid=0D =0D - ## Retrieve platform version=0D + # Retrieve platform version=0D @property=0D def Version(self):=0D if self._Version is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._Version is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No PLAT= FORM_VERSION", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No PLATFORM_VERSION", File=3Dself.MetaFil= e)=0D return self._Version=0D =0D - ## Retrieve platform description file version=0D + # Retrieve platform description file version=0D @property=0D def DscSpecification(self):=0D if self._DscSpecification is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._DscSpecification is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No DSC_= SPECIFICATION", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No DSC_SPECIFICATION", File=3Dself.MetaFi= le)=0D return self._DscSpecification=0D =0D - ## Retrieve OUTPUT_DIRECTORY=0D + # Retrieve OUTPUT_DIRECTORY=0D @property=0D def OutputDirectory(self):=0D if self._OutputDirectory is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._OutputDirectory is None:=0D - self._OutputDirectory =3D os.path.join("Build", self._Plat= formName)=0D + self._OutputDirectory =3D os.path.join(=0D + "Build", self._PlatformName)=0D return self._OutputDirectory=0D =0D - ## Retrieve SUPPORTED_ARCHITECTURES=0D + # Retrieve SUPPORTED_ARCHITECTURES=0D @property=0D def SupArchList(self):=0D if self._SupArchList is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._SupArchList is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No SUPP= ORTED_ARCHITECTURES", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No SUPPORTED_ARCHITECTURES", File=3Dself.= MetaFile)=0D return self._SupArchList=0D =0D - ## Retrieve BUILD_TARGETS=0D + # Retrieve BUILD_TARGETS=0D @property=0D def BuildTargets(self):=0D if self._BuildTargets is None:=0D if self._Header is None:=0D self._GetHeaderInfo()=0D if self._BuildTargets is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No BUIL= D_TARGETS", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No BUILD_TARGETS", File=3Dself.MetaFile)= =0D return self._BuildTargets=0D =0D @property=0D @@ -512,7 +535,7 @@ class DscBuildData(PlatformBuildClassObject): self._SkuName =3D TAB_DEFAULT=0D return self._SkuName=0D =0D - ## Override SKUID_IDENTIFIER=0D + # Override SKUID_IDENTIFIER=0D @SkuName.setter=0D def SkuName(self, Value):=0D self._SkuName =3D Value=0D @@ -544,7 +567,7 @@ class DscBuildData(PlatformBuildClassObject): self._Postbuild =3D ''=0D return self._Postbuild=0D =0D - ## Retrieve FLASH_DEFINITION=0D + # Retrieve FLASH_DEFINITION=0D @property=0D def BuildNumber(self):=0D if self._BuildNumber is None:=0D @@ -554,7 +577,7 @@ class DscBuildData(PlatformBuildClassObject): self._BuildNumber =3D ''=0D return self._BuildNumber=0D =0D - ## Retrieve MAKEFILE_NAME=0D + # Retrieve MAKEFILE_NAME=0D @property=0D def MakefileName(self):=0D if self._MakefileName is None:=0D @@ -564,7 +587,7 @@ class DscBuildData(PlatformBuildClassObject): self._MakefileName =3D ''=0D return self._MakefileName=0D =0D - ## Retrieve BsBaseAddress=0D + # Retrieve BsBaseAddress=0D @property=0D def BsBaseAddress(self):=0D if self._BsBaseAddress is None:=0D @@ -574,7 +597,7 @@ class DscBuildData(PlatformBuildClassObject): self._BsBaseAddress =3D ''=0D return self._BsBaseAddress=0D =0D - ## Retrieve RtBaseAddress=0D + # Retrieve RtBaseAddress=0D @property=0D def RtBaseAddress(self):=0D if self._RtBaseAddress is None:=0D @@ -584,7 +607,7 @@ class DscBuildData(PlatformBuildClassObject): self._RtBaseAddress =3D ''=0D return self._RtBaseAddress=0D =0D - ## Retrieve the top address for the load fix address=0D + # Retrieve the top address for the load fix address=0D @property=0D def LoadFixAddress(self):=0D if self._LoadFixAddress is None:=0D @@ -592,30 +615,36 @@ class DscBuildData(PlatformBuildClassObject): self._GetHeaderInfo()=0D =0D if self._LoadFixAddress is None:=0D - self._LoadFixAddress =3D self._Macros.get(TAB_FIX_LOAD_TOP= _MEMORY_ADDRESS, '0')=0D + self._LoadFixAddress =3D self._Macros.get(=0D + TAB_FIX_LOAD_TOP_MEMORY_ADDRESS, '0')=0D =0D try:=0D - self._LoadFixAddress =3D int (self._LoadFixAddress, 0)=0D + self._LoadFixAddress =3D int(self._LoadFixAddress, 0)=0D except:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS %s is not valid dec or hex string" % (self._LoadFixAddress))= =0D + EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS %s is not valid dec or hex string" % (=0D + self._LoadFixAddress))=0D =0D #=0D # If command line defined, should override the value in DSC file.= =0D #=0D if 'FIX_LOAD_TOP_MEMORY_ADDRESS' in GlobalData.gCommandLineDefines= :=0D try:=0D - self._LoadFixAddress =3D int(GlobalData.gCommandLineDefine= s['FIX_LOAD_TOP_MEMORY_ADDRESS'], 0)=0D + self._LoadFixAddress =3D int(=0D + GlobalData.gCommandLineDefines['FIX_LOAD_TOP_MEMORY_AD= DRESS'], 0)=0D except:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS %s is not valid dec or hex string" % (GlobalData.gCommandLin= eDefines['FIX_LOAD_TOP_MEMORY_ADDRESS']))=0D + EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS %s is not valid dec or hex string" % (=0D + GlobalData.gCommandLineDefines['FIX_LOAD_TOP_MEMORY_AD= DRESS']))=0D =0D if self._LoadFixAddress < 0:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMO= RY_ADDRESS is set to the invalid negative value 0x%x" % (self._LoadFixAddre= ss))=0D + EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMO= RY_ADDRESS is set to the invalid negative value 0x%x" % (=0D + self._LoadFixAddress))=0D if self._LoadFixAddress !=3D 0xFFFFFFFFFFFFFFFF and self._LoadFixA= ddress % 0x1000 !=3D 0:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMO= RY_ADDRESS is set to the invalid unaligned 4K value 0x%x" % (self._LoadFixA= ddress))=0D + EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMO= RY_ADDRESS is set to the invalid unaligned 4K value 0x%x" % (=0D + self._LoadFixAddress))=0D =0D return self._LoadFixAddress=0D =0D - ## Retrieve RFCLanguage filter=0D + # Retrieve RFCLanguage filter=0D @property=0D def RFCLanguages(self):=0D if self._RFCLanguages is None:=0D @@ -625,7 +654,7 @@ class DscBuildData(PlatformBuildClassObject): self._RFCLanguages =3D []=0D return self._RFCLanguages=0D =0D - ## Retrieve ISOLanguage filter=0D + # Retrieve ISOLanguage filter=0D @property=0D def ISOLanguages(self):=0D if self._ISOLanguages is None:=0D @@ -635,7 +664,7 @@ class DscBuildData(PlatformBuildClassObject): self._ISOLanguages =3D []=0D return self._ISOLanguages=0D =0D - ## Retrieve the GUID string for VPD tool=0D + # Retrieve the GUID string for VPD tool=0D @property=0D def VpdToolGuid(self):=0D if self._VpdToolGuid is None:=0D @@ -645,7 +674,7 @@ class DscBuildData(PlatformBuildClassObject): self._VpdToolGuid =3D ''=0D return self._VpdToolGuid=0D =0D - ## Retrieve [SkuIds] section information=0D + # Retrieve [SkuIds] section information=0D @property=0D def SkuIds(self):=0D if self._SkuIds is None:=0D @@ -664,7 +693,8 @@ class DscBuildData(PlatformBuildClassObject): if not SkuIdPattern.match(Record[1]) or (Record[2] and not= SkuIdPattern.match(Record[2])):=0D EdkLogger.error('build', FORMAT_INVALID, "The format o= f the Sku ID name is invalid. The correct format is '(a-zA-Z_)(a-zA-Z0-9_)*= '",=0D File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D - self._SkuIds[Record[1].upper()] =3D (str(DscBuildData.ToIn= t(Record[0])), Record[1].upper(), Record[2].upper())=0D + self._SkuIds[Record[1].upper()] =3D (=0D + str(DscBuildData.ToInt(Record[0])), Record[1].upper(),= Record[2].upper())=0D if TAB_DEFAULT not in self._SkuIds:=0D self._SkuIds[TAB_DEFAULT] =3D ("0", TAB_DEFAULT, TAB_DEFAU= LT)=0D if TAB_COMMON not in self._SkuIds:=0D @@ -692,9 +722,11 @@ class DscBuildData(PlatformBuildClassObject): if not IsValidWord(Record[1]):=0D EdkLogger.error('build', FORMAT_INVALID, "The format o= f the DefaultStores ID name is invalid. The correct format is '(a-zA-Z0-9_)= (a-zA-Z0-9_-.)*'",=0D File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D - self.DefaultStores[Record[1].upper()] =3D (DscBuildData.To= Int(Record[0]), Record[1].upper())=0D + self.DefaultStores[Record[1].upper()] =3D (=0D + DscBuildData.ToInt(Record[0]), Record[1].upper())=0D if TAB_DEFAULT_STORES_DEFAULT not in self.DefaultStores:=0D - self.DefaultStores[TAB_DEFAULT_STORES_DEFAULT] =3D (0, TAB= _DEFAULT_STORES_DEFAULT)=0D + self.DefaultStores[TAB_DEFAULT_STORES_DEFAULT] =3D (=0D + 0, TAB_DEFAULT_STORES_DEFAULT)=0D GlobalData.gDefaultStores =3D sorted(self.DefaultStores.keys()= )=0D return self.DefaultStores=0D =0D @@ -704,32 +736,38 @@ class DscBuildData(PlatformBuildClassObject): Components =3D {}=0D for Record in RecordList:=0D ModuleId =3D Record[6]=0D - file_guid =3D self._RawData[MODEL_META_DATA_HEADER, self._Arch= , None, ModuleId]=0D + file_guid =3D self._RawData[MODEL_META_DATA_HEADER,=0D + self._Arch, None, ModuleId]=0D file_guid_str =3D file_guid[0][2] if file_guid else "NULL"=0D - ModuleFile =3D PathClass(NormPath(Record[0], Macros), GlobalDa= ta.gWorkspace, Arch=3Dself._Arch)=0D - if self._Arch !=3D TAB_ARCH_COMMON and (file_guid_str,str(Modu= leFile)) in Components:=0D - self._RawData.DisableOverrideComponent(Components[(file_gu= id_str,str(ModuleFile))])=0D - Components[(file_guid_str,str(ModuleFile))] =3D ModuleId=0D + ModuleFile =3D PathClass(=0D + NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch= =3Dself._Arch)=0D + if self._Arch !=3D TAB_ARCH_COMMON and (file_guid_str, str(Mod= uleFile)) in Components:=0D + self._RawData.DisableOverrideComponent(=0D + Components[(file_guid_str, str(ModuleFile))])=0D + Components[(file_guid_str, str(ModuleFile))] =3D ModuleId=0D self._RawData._PostProcessed =3D False=0D =0D - ## Retrieve packages this Platform depends on=0D + # Retrieve packages this Platform depends on=0D @cached_property=0D def Packages(self):=0D RetVal =3D set()=0D RecordList =3D self._RawData[MODEL_META_DATA_PACKAGE, self._Arch]= =0D Macros =3D self._Macros=0D for Record in RecordList:=0D - File =3D PathClass(NormPath(Record[0], Macros), GlobalData.gWo= rkspace, Arch=3Dself._Arch)=0D + File =3D PathClass(=0D + NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch= =3Dself._Arch)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate('.dec')=0D if ErrorCode !=3D 0:=0D LineNo =3D Record[-1]=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInfo,= File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3Dself= .MetaFile, Line=3DLineNo)=0D # parse this package now. we need it to get protocol/ppi/guid = value=0D - RetVal.add(self._Bdb[File, self._Arch, self._Target, self._Too= lchain])=0D + RetVal.add(self._Bdb[File, self._Arch,=0D + self._Target, self._Toolchain])=0D return RetVal=0D =0D - ## Retrieve [Components] section information=0D + # Retrieve [Components] section information=0D @property=0D def Modules(self):=0D if self._Modules is not None:=0D @@ -739,7 +777,8 @@ class DscBuildData(PlatformBuildClassObject): RecordList =3D self._RawData[MODEL_META_DATA_COMPONENT, self._Arch= ]=0D Macros =3D self._Macros=0D for Record in RecordList:=0D - ModuleFile =3D PathClass(NormPath(Record[0], Macros), GlobalDa= ta.gWorkspace, Arch=3Dself._Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch= =3Dself._Arch)=0D ModuleId =3D Record[6]=0D LineNo =3D Record[7]=0D =0D @@ -749,15 +788,18 @@ class DscBuildData(PlatformBuildClassObject): EdkLogger.error('build', ErrorCode, File=3Dself.MetaFile, = Line=3DLineNo,=0D ExtraData=3DErrorInfo)=0D =0D - ModuleBuildData =3D self._Bdb[ModuleFile, self._Arch, self._Ta= rget, self._Toolchain]=0D + ModuleBuildData =3D self._Bdb[ModuleFile,=0D + self._Arch, self._Target, self._To= olchain]=0D Module =3D ModuleBuildClassObject()=0D Module.MetaFile =3D ModuleFile=0D Module.Guid =3D ModuleBuildData.Guid=0D # get module private library instance=0D - RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Ar= ch, None, ModuleId]=0D + RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS,=0D + self._Arch, None, ModuleId]=0D for Record in RecordList:=0D LibraryClass =3D Record[0]=0D - LibraryPath =3D PathClass(NormPath(Record[1], Macros), Glo= balData.gWorkspace, Arch=3Dself._Arch)=0D + LibraryPath =3D PathClass(=0D + NormPath(Record[1], Macros), GlobalData.gWorkspace, Ar= ch=3Dself._Arch)=0D LineNo =3D Record[-1]=0D =0D # check the file validation=0D @@ -769,13 +811,14 @@ class DscBuildData(PlatformBuildClassObject): if LibraryClass =3D=3D '' or LibraryClass =3D=3D 'NULL':=0D self._NullLibraryNumber +=3D 1=0D LibraryClass =3D 'NULL%d' % self._NullLibraryNumber=0D - EdkLogger.verbose("Found forced library for %s\n\t%s [= %s]" % (ModuleFile, LibraryPath, LibraryClass))=0D + EdkLogger.verbose("Found forced library for %s\n\t%s [= %s]" % (=0D + ModuleFile, LibraryPath, LibraryClass))=0D Module.LibraryClasses[LibraryClass] =3D LibraryPath=0D if LibraryPath not in self.LibraryInstances:=0D self.LibraryInstances.append(LibraryPath)=0D S_PcdSet =3D []=0D # get module private PCD setting=0D - for Type in [MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_= MODULE, \=0D + for Type in [MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_= MODULE,=0D MODEL_PCD_FEATURE_FLAG, MODEL_PCD_DYNAMIC, MODEL_= PCD_DYNAMIC_EX]:=0D RecordList =3D self._RawData[Type, self._Arch, None, Modul= eId]=0D for TokenSpaceGuid, PcdCName, Setting, Dummy1, Dummy2, Dum= my3, Dummy4, Dummy5 in RecordList:=0D @@ -788,45 +831,52 @@ class DscBuildData(PlatformBuildClassObject): MaxDatumSize =3D ''=0D TypeString =3D self._PCD_TYPE_STRING_[Type]=0D =0D - TCName,PCName,DimensionAttr,Field =3D self.ParsePcdNam= eStruct(TokenSpaceGuid, PcdCName)=0D + TCName, PCName, DimensionAttr, Field =3D self.ParsePcd= NameStruct(=0D + TokenSpaceGuid, PcdCName)=0D =0D if ("." in TokenSpaceGuid or "[" in PcdCName):=0D - S_PcdSet.append([ TCName,PCName,DimensionAttr,Fiel= d, ModuleBuildData.Guid, "", Dummy5, AnalyzePcdExpression(Setting)[0]])=0D + S_PcdSet.append([TCName, PCName, DimensionAttr, Fi= eld,=0D + ModuleBuildData.Guid, "", Dummy5, = AnalyzePcdExpression(Setting)[0]])=0D DefaultValue =3D ''=0D - if ( PCName,TCName) not in Module.Pcds:=0D + if (PCName, TCName) not in Module.Pcds:=0D Pcd =3D PcdClassObject(=0D - PCName,=0D - TCName,=0D - TypeString,=0D - '',=0D - DefaultValue,=0D - '',=0D - MaxDatumSize,=0D - {},=0D - False,=0D - None,=0D - IsDsc=3DTrue)=0D + PCName,=0D + TCName,=0D + TypeString,=0D + '',=0D + DefaultValue,=0D + '',=0D + MaxDatumSize,=0D + {},=0D + False,=0D + None,=0D + IsDsc=3DTrue)=0D Module.Pcds[PCName, TCName] =3D Pcd=0D =0D Module.StrPcdSet =3D S_PcdSet=0D - for TCName,PCName, _,_,_,_,_,_ in S_PcdSet:=0D - if (PCName,TCName) in Module.Pcds:=0D - Module.StrPcdOverallValue[(PCName,TCName)] =3D Module.= Pcds[(PCName,TCName)].DefaultValue, self.MetaFile,Dummy5=0D + for TCName, PCName, _, _, _, _, _, _ in S_PcdSet:=0D + if (PCName, TCName) in Module.Pcds:=0D + Module.StrPcdOverallValue[(PCName, TCName)] =3D Module= .Pcds[(=0D + PCName, TCName)].DefaultValue, self.MetaFile, Dumm= y5=0D # get module private build options=0D - RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION, sel= f._Arch, None, ModuleId]=0D + RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION,=0D + self._Arch, None, ModuleId]=0D for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3= , Dummy4, Dummy5 in RecordList:=0D if (ToolChainFamily, ToolChain) not in Module.BuildOptions= :=0D Module.BuildOptions[ToolChainFamily, ToolChain] =3D Op= tion=0D else:=0D OptionString =3D Module.BuildOptions[ToolChainFamily, = ToolChain]=0D - Module.BuildOptions[ToolChainFamily, ToolChain] =3D Op= tionString + " " + Option=0D + Module.BuildOptions[ToolChainFamily,=0D + ToolChain] =3D OptionString + " " = + Option=0D =0D - RecordList =3D self._RawData[MODEL_META_DATA_HEADER, self._Arc= h, None, ModuleId]=0D + RecordList =3D self._RawData[MODEL_META_DATA_HEADER,=0D + self._Arch, None, ModuleId]=0D if RecordList:=0D if len(RecordList) !=3D 1:=0D EdkLogger.error('build', OPTION_UNKNOWN, 'Only FILE_GU= ID can be listed in section.',=0D File=3Dself.MetaFile, ExtraData=3Dstr(= ModuleFile), Line=3DLineNo)=0D - ModuleFile =3D ProcessDuplicatedInf(ModuleFile, RecordList= [0][2], GlobalData.gWorkspace)=0D + ModuleFile =3D ProcessDuplicatedInf(=0D + ModuleFile, RecordList[0][2], GlobalData.gWorkspace)=0D ModuleFile.Arch =3D self._Arch=0D Module.Guid =3D RecordList[0][2]=0D for item in Module.StrPcdSet:=0D @@ -834,14 +884,14 @@ class DscBuildData(PlatformBuildClassObject): self._Modules[ModuleFile] =3D Module=0D return self._Modules=0D =0D - ## Retrieve all possible library instances used in this platform=0D + # Retrieve all possible library instances used in this platform=0D @property=0D def LibraryInstances(self):=0D if self._LibraryInstances is None:=0D self.LibraryClasses=0D return self._LibraryInstances=0D =0D - ## Retrieve [LibraryClasses] information=0D + # Retrieve [LibraryClasses] information=0D @property=0D def LibraryClasses(self):=0D if self._LibraryClasses is None:=0D @@ -853,16 +903,19 @@ class DscBuildData(PlatformBuildClassObject): LibraryClassDict =3D tdict(True, 3)=0D # track all library class names=0D LibraryClassSet =3D set()=0D - RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Ar= ch, None, -1]=0D + RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS,=0D + self._Arch, None, -1]=0D Macros =3D self._Macros=0D for Record in RecordList:=0D LibraryClass, LibraryInstance, Dummy, Arch, ModuleType, Du= mmy, Dummy, LineNo =3D Record=0D if LibraryClass =3D=3D '' or LibraryClass =3D=3D 'NULL':=0D self._NullLibraryNumber +=3D 1=0D LibraryClass =3D 'NULL%d' % self._NullLibraryNumber=0D - EdkLogger.verbose("Found forced library for arch=3D%s\= n\t%s [%s]" % (Arch, LibraryInstance, LibraryClass))=0D + EdkLogger.verbose("Found forced library for arch=3D%s\= n\t%s [%s]" % (=0D + Arch, LibraryInstance, LibraryClass))=0D LibraryClassSet.add(LibraryClass)=0D - LibraryInstance =3D PathClass(NormPath(LibraryInstance, Ma= cros), GlobalData.gWorkspace, Arch=3Dself._Arch)=0D + LibraryInstance =3D PathClass(=0D + NormPath(LibraryInstance, Macros), GlobalData.gWorkspa= ce, Arch=3Dself._Arch)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D LibraryInstance.Validate('.inf')= =0D if ErrorCode !=3D 0:=0D @@ -872,7 +925,8 @@ class DscBuildData(PlatformBuildClassObject): if ModuleType !=3D TAB_COMMON and ModuleType not in SUP_MO= DULE_LIST:=0D EdkLogger.error('build', OPTION_UNKNOWN, "Unknown modu= le type [%s]" % ModuleType,=0D File=3Dself.MetaFile, ExtraData=3DLibr= aryInstance, Line=3DLineNo)=0D - LibraryClassDict[Arch, ModuleType, LibraryClass] =3D Libra= ryInstance=0D + LibraryClassDict[Arch, ModuleType,=0D + LibraryClass] =3D LibraryInstance=0D if LibraryInstance not in self._LibraryInstances:=0D self._LibraryInstances.append(LibraryInstance)=0D =0D @@ -881,14 +935,17 @@ class DscBuildData(PlatformBuildClassObject): for LibraryClass in LibraryClassSet:=0D # try all possible module types=0D for ModuleType in SUP_MODULE_LIST:=0D - LibraryInstance =3D LibraryClassDict[self._Arch, Modul= eType, LibraryClass]=0D + LibraryInstance =3D LibraryClassDict[self._Arch,=0D + ModuleType, Library= Class]=0D if LibraryInstance is None:=0D continue=0D - self._LibraryClasses[LibraryClass, ModuleType] =3D Lib= raryInstance=0D + self._LibraryClasses[LibraryClass,=0D + ModuleType] =3D LibraryInstance=0D =0D RecordList =3D self._RawData[MODEL_EFI_LIBRARY_INSTANCE, self.= _Arch]=0D for Record in RecordList:=0D - File =3D PathClass(NormPath(Record[0], Macros), GlobalData= .gWorkspace, Arch=3Dself._Arch)=0D + File =3D PathClass(=0D + NormPath(Record[0], Macros), GlobalData.gWorkspace, Ar= ch=3Dself._Arch)=0D LineNo =3D Record[-1]=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate('.inf')=0D @@ -902,7 +959,8 @@ class DscBuildData(PlatformBuildClassObject): # to parse it here. (self._Bdb[] will trigger a file parse= if it=0D # hasn't been parsed)=0D #=0D - Library =3D self._Bdb[File, self._Arch, self._Target, self= ._Toolchain]=0D + Library =3D self._Bdb[File, self._Arch,=0D + self._Target, self._Toolchain]=0D self._LibraryClasses[Library.BaseName, ':dummy:'] =3D Libr= ary=0D return self._LibraryClasses=0D =0D @@ -915,21 +973,26 @@ class DscBuildData(PlatformBuildClassObject): =0D PkgSet =3D set()=0D for Inf in FdfInfList:=0D - ModuleFile =3D PathClass(NormPath(Inf), GlobalData.gWorksp= ace, Arch=3Dself._Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, Arch=3Dself._Arc= h)=0D if ModuleFile in self._Modules:=0D continue=0D - ModuleData =3D self._Bdb[ModuleFile, self._Arch, self._Tar= get, self._Toolchain]=0D + ModuleData =3D self._Bdb[ModuleFile,=0D + self._Arch, self._Target, self._Too= lchain]=0D PkgSet.update(ModuleData.Packages)=0D if self.Packages:=0D PkgSet.update(self.Packages)=0D - self._DecPcds, self._GuidDict =3D GetDeclaredPcd(self, self._B= db, self._Arch, self._Target, self._Toolchain, PkgSet)=0D + self._DecPcds, self._GuidDict =3D GetDeclaredPcd(=0D + self, self._Bdb, self._Arch, self._Target, self._Toolchain= , PkgSet)=0D self._GuidDict.update(GlobalData.gPlatformPcds)=0D =0D if (PcdCName, TokenSpaceGuid) not in self._DecPcds:=0D EdkLogger.error('build', PARSER_ERROR,=0D - "Pcd (%s.%s) defined in DSC is not declared in= DEC files referenced in INF files in FDF. Arch: ['%s']" % (TokenSpaceGuid,= PcdCName, self._Arch),=0D + "Pcd (%s.%s) defined in DSC is not declared in= DEC files referenced in INF files in FDF. Arch: ['%s']" % (=0D + TokenSpaceGuid, PcdCName, self._Arch),=0D File=3Dself.MetaFile, Line=3DLineNo)=0D - ValueList, IsValid, Index =3D AnalyzeDscPcd(Setting, PcdType, self= ._DecPcds[PcdCName, TokenSpaceGuid].DatumType)=0D + ValueList, IsValid, Index =3D AnalyzeDscPcd(=0D + Setting, PcdType, self._DecPcds[PcdCName, TokenSpaceGuid].Datu= mType)=0D if not IsValid:=0D if PcdType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_AT_= BUILD]:=0D EdkLogger.error('build', FORMAT_INVALID, "Pcd format incor= rect.", File=3Dself.MetaFile, Line=3DLineNo,=0D @@ -937,16 +1000,17 @@ class DscBuildData(PlatformBuildClassObject): else:=0D if ValueList[2] =3D=3D '-1':=0D EdkLogger.error('build', FORMAT_INVALID, "Pcd format i= ncorrect.", File=3Dself.MetaFile, Line=3DLineNo,=0D - ExtraData=3D"%s.%s|%s" % (TokenSpaceGuid, = PcdCName, Setting))=0D + ExtraData=3D"%s.%s|%s" % (TokenSpaceGu= id, PcdCName, Setting))=0D if ValueList[Index]:=0D DatumType =3D self._DecPcds[PcdCName, TokenSpaceGuid].DatumTyp= e=0D if "{CODE(" not in ValueList[Index]:=0D try:=0D - ValueList[Index] =3D ValueExpressionEx(ValueList[Index= ], DatumType, self._GuidDict)(True)=0D + ValueList[Index] =3D ValueExpressionEx(=0D + ValueList[Index], DatumType, self._GuidDict)(True)= =0D except BadExpression as Value:=0D EdkLogger.error('Parser', FORMAT_INVALID, Value, File= =3Dself.MetaFile, Line=3DLineNo,=0D ExtraData=3D"PCD [%s.%s] Value \"%s\" = " % (=0D - TokenSpaceGuid, PcdCName, ValueList[In= dex]))=0D + TokenSpaceGuid, PcdCName, ValueLis= t[Index]))=0D except EvaluationException as Excpt:=0D if hasattr(Excpt, 'Pcd'):=0D if Excpt.Pcd in GlobalData.gPlatformOtherPcds:=0D @@ -962,7 +1026,8 @@ class DscBuildData(PlatformBuildClassObject): File=3Dself.MetaFile, Line=3DLineN= o)=0D =0D if ValueList[Index]:=0D - Valid, ErrStr =3D CheckPcdDatum(self._DecPcds[PcdCName, TokenS= paceGuid].DatumType, ValueList[Index])=0D + Valid, ErrStr =3D CheckPcdDatum(=0D + self._DecPcds[PcdCName, TokenSpaceGuid].DatumType, ValueLi= st[Index])=0D if not Valid:=0D EdkLogger.error('build', FORMAT_INVALID, ErrStr, File=3Dse= lf.MetaFile, Line=3DLineNo,=0D ExtraData=3D"%s.%s" % (TokenSpaceGuid, Pcd= CName))=0D @@ -970,14 +1035,16 @@ class DscBuildData(PlatformBuildClassObject): if self._DecPcds[PcdCName, TokenSpaceGuid].DatumType.strip= () !=3D ValueList[1].strip():=0D DecPcd =3D self._DecPcds[PcdCName, TokenSpaceGuid]=0D EdkLogger.error('build', FORMAT_INVALID,=0D - "Pcd datumtype used in DSC file is not= the same as its declaration. DatumType:%s"%DecPcd.DatumType,=0D + "Pcd datumtype used in DSC file is not= the same as its declaration. DatumType:%s" % DecPcd.DatumType,=0D File=3Dself.MetaFile, Line=3DLineNo,=0D - ExtraData=3D"Dsc:%s.%s|%s\n Dec:%s.= %s|%s|%s|%s" % (TokenSpaceGuid, PcdCName, Setting, TokenSpaceGuid, \=0D - PcdCName, DecPcd.DefaultValue, DecPcd.= DatumType, DecPcd.TokenValue))=0D + ExtraData=3D"Dsc:%s.%s|%s\n Dec:%s.= %s|%s|%s|%s" % (TokenSpaceGuid, PcdCName, Setting, TokenSpaceGuid,=0D + = PcdCName, DecPcd.DefaultValue, DecPcd.DatumType, DecPcd.Token= Value))=0D if (TokenSpaceGuid + '.' + PcdCName) in GlobalData.gPlatformPcds:= =0D if GlobalData.gPlatformPcds[TokenSpaceGuid + '.' + PcdCName] != =3D ValueList[Index]:=0D - GlobalData.gPlatformPcds[TokenSpaceGuid + '.' + PcdCName] = =3D ValueList[Index]=0D - GlobalData.gPlatformFinalPcds[TokenSpaceGuid + '.' + PcdCName]= =3D ValueList[Index]=0D + GlobalData.gPlatformPcds[TokenSpaceGuid +=0D + '.' + PcdCName] =3D ValueList[Ind= ex]=0D + GlobalData.gPlatformFinalPcds[TokenSpaceGuid +=0D + '.' + PcdCName] =3D ValueList[In= dex]=0D return ValueList=0D =0D def _FilterPcdBySkuUsage(self, Pcds):=0D @@ -986,38 +1053,47 @@ class DscBuildData(PlatformBuildClassObject): if sku_usage =3D=3D SkuClass.SINGLE:=0D for pcdname in Pcds:=0D pcd =3D Pcds[pcdname]=0D - Pcds[pcdname].SkuInfoList =3D {TAB_DEFAULT:pcd.SkuInfoList= [skuid] for skuid in pcd.SkuInfoList if skuid in available_sku}=0D + Pcds[pcdname].SkuInfoList =3D {TAB_DEFAULT: pcd.SkuInfoLis= t[skuid]=0D + for skuid in pcd.SkuInfoList = if skuid in available_sku}=0D if isinstance(pcd, StructurePcd) and pcd.SkuOverrideValues= :=0D - Pcds[pcdname].SkuOverrideValues =3D {TAB_DEFAULT:pcd.S= kuOverrideValues[skuid] for skuid in pcd.SkuOverrideValues if skuid in avai= lable_sku}=0D + Pcds[pcdname].SkuOverrideValues =3D {=0D + TAB_DEFAULT: pcd.SkuOverrideValues[skuid] for skui= d in pcd.SkuOverrideValues if skuid in available_sku}=0D else:=0D for pcdname in Pcds:=0D pcd =3D Pcds[pcdname]=0D - Pcds[pcdname].SkuInfoList =3D {skuid:pcd.SkuInfoList[skuid= ] for skuid in pcd.SkuInfoList if skuid in available_sku}=0D + Pcds[pcdname].SkuInfoList =3D {skuid: pcd.SkuInfoList[skui= d]=0D + for skuid in pcd.SkuInfoList = if skuid in available_sku}=0D if isinstance(pcd, StructurePcd) and pcd.SkuOverrideValues= :=0D - Pcds[pcdname].SkuOverrideValues =3D {skuid:pcd.SkuOver= rideValues[skuid] for skuid in pcd.SkuOverrideValues if skuid in available_= sku}=0D + Pcds[pcdname].SkuOverrideValues =3D {=0D + skuid: pcd.SkuOverrideValues[skuid] for skuid in p= cd.SkuOverrideValues if skuid in available_sku}=0D return Pcds=0D =0D def CompleteHiiPcdsDefaultStores(self, Pcds):=0D - HiiPcd =3D [Pcds[pcd] for pcd in Pcds if Pcds[pcd].Type in [self._= PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX_HII]]]=0D + HiiPcd =3D [Pcds[pcd] for pcd in Pcds if Pcds[pcd].Type in [self._= PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAM= IC_EX_HII]]]=0D DefaultStoreMgr =3D DefaultStore(self.DefaultStores)=0D for pcd in HiiPcd:=0D for skuid in pcd.SkuInfoList:=0D skuobj =3D pcd.SkuInfoList.get(skuid)=0D if TAB_DEFAULT_STORES_DEFAULT not in skuobj.DefaultStoreDi= ct:=0D - PcdDefaultStoreSet =3D set(defaultstorename for defau= ltstorename in skuobj.DefaultStoreDict)=0D - mindefaultstorename =3D DefaultStoreMgr.GetMin(PcdDefa= ultStoreSet)=0D + PcdDefaultStoreSet =3D set(=0D + defaultstorename for defaultstorename in skuobj.De= faultStoreDict)=0D + mindefaultstorename =3D DefaultStoreMgr.GetMin(=0D + PcdDefaultStoreSet)=0D skuobj.DefaultStoreDict[TAB_DEFAULT_STORES_DEFAULT] = =3D skuobj.DefaultStoreDict[mindefaultstorename]=0D return Pcds=0D =0D def RecoverCommandLinePcd(self):=0D def UpdateCommandLineValue(pcd):=0D if pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUIL= D],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_P= ATCHABLE_IN_MODULE]]:=0D + self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_= MODULE]]:=0D pcd.PcdValueFromComm =3D pcd.DefaultValue=0D elif pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII= ], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D - pcd.PcdValueFromComm =3D pcd.SkuInfoList.get(TAB_DEFAULT).= HiiDefaultValue=0D + pcd.PcdValueFromComm =3D pcd.SkuInfoList.get(=0D + TAB_DEFAULT).HiiDefaultValue=0D else:=0D - pcd.PcdValueFromComm =3D pcd.SkuInfoList.get(TAB_DEFAULT).= DefaultValue=0D + pcd.PcdValueFromComm =3D pcd.SkuInfoList.get(=0D + TAB_DEFAULT).DefaultValue=0D for pcd in self._Pcds:=0D if isinstance(self._Pcds[pcd], StructurePcd) and (self._Pcds[p= cd].PcdValueFromComm or self._Pcds[pcd].PcdFieldValueFromComm):=0D UpdateCommandLineValue(self._Pcds[pcd])=0D @@ -1029,7 +1105,8 @@ class DscBuildData(PlatformBuildClassObject): continue=0D (pcdname, pcdvalue) =3D pcd.split('=3D')=0D if not pcdvalue:=0D - EdkLogger.error('build', AUTOGEN_ERROR, "No Value spec= ified for the PCD %s." % (pcdname))=0D + EdkLogger.error(=0D + 'build', AUTOGEN_ERROR, "No Value specified for th= e PCD %s." % (pcdname))=0D if '.' in pcdname:=0D (Name1, Name2) =3D pcdname.split('.', 1)=0D if "." in Name2:=0D @@ -1048,7 +1125,7 @@ class DscBuildData(PlatformBuildClassObject): HasTokenSpace =3D True=0D TokenCName =3D Name2=0D TokenSpaceGuidCName =3D Name1=0D - FieldName =3D""=0D + FieldName =3D ""=0D else:=0D FieldName =3D Name2=0D TokenCName =3D Name1=0D @@ -1070,48 +1147,59 @@ class DscBuildData(PlatformBuildClassObject): PcdItem =3D self.DecPcds[key]=0D if TokenCName =3D=3D PcdItem.TokenCName:=0D if not PcdItem.TokenSpaceGuidCName in TokenSpa= ceGuidCNameList:=0D - if len (TokenSpaceGuidCNameList) < 1:=0D - TokenSpaceGuidCNameList.append(PcdItem= .TokenSpaceGuidCName)=0D + if len(TokenSpaceGuidCNameList) < 1:=0D + TokenSpaceGuidCNameList.append(=0D + PcdItem.TokenSpaceGuidCName)=0D TokenSpaceGuidCName =3D PcdItem.TokenS= paceGuidCName=0D PcdDatumType =3D PcdItem.DatumType=0D FoundFlag =3D True=0D else:=0D EdkLogger.error(=0D - 'build',=0D - AUTOGEN_ERROR,=0D - "The Pcd %s is found under mul= tiple different TokenSpaceGuid: %s and %s." % (DisplayName, PcdItem.TokenSp= aceGuidCName, TokenSpaceGuidCNameList[0])=0D - )=0D + 'build',=0D + AUTOGEN_ERROR,=0D + "The Pcd %s is found under multipl= e different TokenSpaceGuid: %s and %s." % (=0D + DisplayName, PcdItem.TokenSpac= eGuidCName, TokenSpaceGuidCNameList[0])=0D + )=0D else:=0D if (TokenCName, TokenSpaceGuidCName) in self.DecPcds:= =0D - PcdDatumType =3D self.DecPcds[(TokenCName, TokenSp= aceGuidCName)].DatumType=0D + PcdDatumType =3D self.DecPcds[(=0D + TokenCName, TokenSpaceGuidCName)].DatumType=0D FoundFlag =3D True=0D if not FoundFlag:=0D if HasTokenSpace:=0D - EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd %= s.%s is not found in the DEC file." % (TokenSpaceGuidCName, DisplayName))=0D + EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd %= s.%s is not found in the DEC file." % (=0D + TokenSpaceGuidCName, DisplayName))=0D else:=0D - EdkLogger.error('build', AUTOGEN_ERROR, "The Pcd %= s is not found in the DEC file." % (DisplayName))=0D - pcdvalue =3D pcdvalue.replace("\\\\\\'", '\\\\\\"').replac= e('\\\'', '\'').replace('\\\\\\"', "\\'")=0D + EdkLogger.error(=0D + 'build', AUTOGEN_ERROR, "The Pcd %s is not fou= nd in the DEC file." % (DisplayName))=0D + pcdvalue =3D pcdvalue.replace("\\\\\\'", '\\\\\\"').replac= e(=0D + '\\\'', '\'').replace('\\\\\\"', "\\'")=0D if FieldName:=0D - pcdvalue =3D DscBuildData.HandleFlexiblePcd(TokenSpace= GuidCName, TokenCName, pcdvalue, PcdDatumType, self._GuidDict, FieldName)=0D + pcdvalue =3D DscBuildData.HandleFlexiblePcd(=0D + TokenSpaceGuidCName, TokenCName, pcdvalue, PcdDatu= mType, self._GuidDict, FieldName)=0D else:=0D - pcdvalue =3D DscBuildData.HandleFlexiblePcd(TokenSpace= GuidCName, TokenCName, pcdvalue, PcdDatumType, self._GuidDict)=0D + pcdvalue =3D DscBuildData.HandleFlexiblePcd(=0D + TokenSpaceGuidCName, TokenCName, pcdvalue, PcdDatu= mType, self._GuidDict)=0D IsValid, Cause =3D CheckPcdDatum(PcdDatumType, pcdvalu= e)=0D if not IsValid:=0D - EdkLogger.error("build", FORMAT_INVALID, Cause, Ex= traData=3D"%s.%s" % (TokenSpaceGuidCName, TokenCName))=0D - GlobalData.BuildOptionPcd[i] =3D (TokenSpaceGuidCName, Tok= enCName, FieldName, pcdvalue, ("build command options", 1))=0D + EdkLogger.error("build", FORMAT_INVALID, Cause, Ex= traData=3D"%s.%s" % (=0D + TokenSpaceGuidCName, TokenCName))=0D + GlobalData.BuildOptionPcd[i] =3D (=0D + TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, = ("build command options", 1))=0D =0D if GlobalData.BuildOptionPcd:=0D - inf_objs =3D [item for item in self._Bdb._CACHE_.values() if i= tem.Arch =3D=3D self.Arch and item.MetaFile.Ext.lower() =3D=3D '.inf']=0D + inf_objs =3D [item for item in self._Bdb._CACHE_.values(=0D + ) if item.Arch =3D=3D self.Arch and item.MetaFile.Ext.lower() = =3D=3D '.inf']=0D for pcd in GlobalData.BuildOptionPcd:=0D (TokenSpaceGuidCName, TokenCName, FieldName, pcdvalue, _) = =3D pcd=0D for BuildData in inf_objs:=0D for key in BuildData.Pcds:=0D PcdItem =3D BuildData.Pcds[key]=0D - if (TokenSpaceGuidCName, TokenCName) =3D=3D (PcdIt= em.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =3D=3D"":=0D + if (TokenSpaceGuidCName, TokenCName) =3D=3D (PcdIt= em.TokenSpaceGuidCName, PcdItem.TokenCName) and FieldName =3D=3D "":=0D PcdItem.DefaultValue =3D pcdvalue=0D PcdItem.PcdValueFromComm =3D pcdvalue=0D - #In command line, the latter full assign value in commandLine shou= ld override the former field assign value.=0D - #For example, --pcd Token.pcd.field=3D"" --pcd Token.pcd=3DH"{}"=0D + # In command line, the latter full assign value in commandLine sho= uld override the former field assign value.=0D + # For example, --pcd Token.pcd.field=3D"" --pcd Token.pcd=3DH"{}"= =0D delete_assign =3D []=0D field_assign =3D {}=0D if GlobalData.BuildOptionPcd:=0D @@ -1123,7 +1211,8 @@ class DscBuildData(PlatformBuildClassObject): field_assign[TokenSpaceGuid, Token].append(pcdTuple)=0D else:=0D if (TokenSpaceGuid, Token) in field_assign:=0D - delete_assign.extend(field_assign[TokenSpaceGuid, = Token])=0D + delete_assign.extend(=0D + field_assign[TokenSpaceGuid, Token])=0D field_assign[TokenSpaceGuid, Token] =3D []=0D for item in delete_assign:=0D GlobalData.BuildOptionPcd.remove(item)=0D @@ -1140,7 +1229,8 @@ class DscBuildData(PlatformBuildClassObject): if FieldName and not IsArray:=0D return PcdValue=0D try:=0D - PcdValue =3D ValueExpressionEx(PcdValue[1:], PcdDatumType,= GuidDict)(True)=0D + PcdValue =3D ValueExpressionEx(=0D + PcdValue[1:], PcdDatumType, GuidDict)(True)=0D except BadExpression as Value:=0D EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Val= ue "%s", %s' %=0D (TokenSpaceGuidCName, TokenCName, PcdValue= , Value))=0D @@ -1151,7 +1241,8 @@ class DscBuildData(PlatformBuildClassObject): if FieldName and not IsArray:=0D return PcdValue=0D try:=0D - PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, Gui= dDict)(True)=0D + PcdValue =3D ValueExpressionEx(=0D + PcdValue, PcdDatumType, GuidDict)(True)=0D except BadExpression as Value:=0D EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Val= ue "%s", %s' %=0D (TokenSpaceGuidCName, TokenCName, PcdValue= , Value))=0D @@ -1163,7 +1254,8 @@ class DscBuildData(PlatformBuildClassObject): if FieldName and not IsArray:=0D return PcdValue=0D try:=0D - PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, Gui= dDict)(True)=0D + PcdValue =3D ValueExpressionEx(=0D + PcdValue, PcdDatumType, GuidDict)(True)=0D except BadExpression as Value:=0D EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Val= ue "%s", %s' %=0D (TokenSpaceGuidCName, TokenCName, PcdValue= , Value))=0D @@ -1192,13 +1284,14 @@ class DscBuildData(PlatformBuildClassObject): if not IsArray:=0D return PcdValue=0D try:=0D - PcdValue =3D ValueExpressionEx(PcdValue, PcdDatumType, Gui= dDict)(True)=0D + PcdValue =3D ValueExpressionEx(=0D + PcdValue, PcdDatumType, GuidDict)(True)=0D except BadExpression as Value:=0D EdkLogger.error('Parser', FORMAT_INVALID, 'PCD [%s.%s] Val= ue "%s", %s' %=0D (TokenSpaceGuidCName, TokenCName, PcdValue= , Value))=0D return PcdValue=0D =0D - ## Retrieve all PCD settings in platform=0D + # Retrieve all PCD settings in platform=0D @property=0D def Pcds(self):=0D if self._Pcds is None:=0D @@ -1210,14 +1303,16 @@ class DscBuildData(PlatformBuildClassObject): self._Pcds.update(self._GetDynamicPcd(MODEL_PCD_DYNAMIC_DEFAUL= T))=0D self._Pcds.update(self._GetDynamicHiiPcd(MODEL_PCD_DYNAMIC_HII= ))=0D self._Pcds.update(self._GetDynamicVpdPcd(MODEL_PCD_DYNAMIC_VPD= ))=0D - self._Pcds.update(self._GetDynamicPcd(MODEL_PCD_DYNAMIC_EX_DEF= AULT))=0D + self._Pcds.update(self._GetDynamicPcd(=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT))=0D self._Pcds.update(self._GetDynamicHiiPcd(MODEL_PCD_DYNAMIC_EX_= HII))=0D self._Pcds.update(self._GetDynamicVpdPcd(MODEL_PCD_DYNAMIC_EX_= VPD))=0D =0D self._Pcds =3D self.CompletePcdValues(self._Pcds)=0D self._Pcds =3D self.OverrideByFdfOverAll(self._Pcds)=0D self._Pcds =3D self.OverrideByCommOverAll(self._Pcds)=0D - self._Pcds =3D self.UpdateStructuredPcds(MODEL_PCD_TYPE_LIST, = self._Pcds)=0D + self._Pcds =3D self.UpdateStructuredPcds(=0D + MODEL_PCD_TYPE_LIST, self._Pcds)=0D self._Pcds =3D self.CompleteHiiPcdsDefaultStores(self._Pcds)=0D self._Pcds =3D self._FilterPcdBySkuUsage(self._Pcds)=0D =0D @@ -1233,7 +1328,8 @@ class DscBuildData(PlatformBuildClassObject): # Retrieve build option for EDKII and EDK style module=0D #=0D for CodeBase in (EDKII_NAME, EDK_NAME):=0D - RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION,= self._Arch, CodeBase]=0D + RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION,= =0D + self._Arch, CodeBase]=0D for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Du= mmy3, Dummy4, Dummy5 in RecordList:=0D if Dummy3.upper() !=3D TAB_COMMON:=0D continue=0D @@ -1247,6 +1343,7 @@ class DscBuildData(PlatformBuildClassObject): if ' ' + Option not in self._BuildOptions[CurKey]:= =0D self._BuildOptions[CurKey] +=3D ' ' + Option=0D return self._BuildOptions=0D +=0D def GetBuildOptionsByPkg(self, Module, ModuleType):=0D =0D local_pkg =3D os.path.split(Module.LocalPkg())[0]=0D @@ -1254,10 +1351,10 @@ class DscBuildData(PlatformBuildClassObject): self._ModuleTypeOptions =3D OrderedDict()=0D if ModuleType not in self._ModuleTypeOptions:=0D options =3D OrderedDict()=0D - self._ModuleTypeOptions[ ModuleType] =3D options=0D + self._ModuleTypeOptions[ModuleType] =3D options=0D RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION, sel= f._Arch]=0D for ToolChainFamily, ToolChain, Option, Dummy1, Dummy2, Dummy3= , Dummy4, Dummy5 in RecordList:=0D - if Dummy2 not in (TAB_COMMON,local_pkg.upper(),"EDKII"):=0D + if Dummy2 not in (TAB_COMMON, local_pkg.upper(), "EDKII"):= =0D continue=0D Type =3D Dummy3=0D if Type.upper() =3D=3D ModuleType.upper():=0D @@ -1268,6 +1365,7 @@ class DscBuildData(PlatformBuildClassObject): if ' ' + Option not in options[Key]:=0D options[Key] +=3D ' ' + Option=0D return self._ModuleTypeOptions[ModuleType]=0D +=0D def GetBuildOptionsByModuleType(self, Edk, ModuleType):=0D if self._ModuleTypeOptions is None:=0D self._ModuleTypeOptions =3D OrderedDict()=0D @@ -1297,29 +1395,31 @@ class DscBuildData(PlatformBuildClassObject): return structure_pcd_data=0D =0D @staticmethod=0D - def OverrideByFdf(StruPcds,workspace):=0D + def OverrideByFdf(StruPcds, workspace):=0D if GlobalData.gFdfParser is None:=0D return StruPcds=0D StructurePcdInFdf =3D OrderedDict()=0D fdfpcd =3D GlobalData.gFdfParser.Profile.PcdDict=0D fdfpcdlocation =3D GlobalData.gFdfParser.Profile.PcdLocalDict=0D - for item in fdfpcd :=0D - if len(item[2]) and (item[0],item[1]) in StruPcds:=0D - StructurePcdInFdf[(item[1],item[0],item[2] )] =3D fdfpcd[i= tem]=0D - GlobalPcds =3D {(item[0],item[1]) for item in StructurePcdInFdf}=0D + for item in fdfpcd:=0D + if len(item[2]) and (item[0], item[1]) in StruPcds:=0D + StructurePcdInFdf[(item[1], item[0], item[2])] =3D fdfpcd[= item]=0D + GlobalPcds =3D {(item[0], item[1]) for item in StructurePcdInFdf}= =0D for Pcd in StruPcds.values():=0D - if (Pcd.TokenSpaceGuidCName,Pcd.TokenCName) not in GlobalPcds:= =0D + if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) not in GlobalPcds= :=0D continue=0D FieldValues =3D OrderedDict()=0D for item in StructurePcdInFdf:=0D - if (Pcd.TokenSpaceGuidCName,Pcd.TokenCName) =3D=3D (item[0= ],item[1]) and item[2]:=0D + if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) =3D=3D (item[= 0], item[1]) and item[2]:=0D FieldValues[item[2]] =3D StructurePcdInFdf[item]=0D for field in FieldValues:=0D if field not in Pcd.PcdFieldValueFromFdf:=0D - Pcd.PcdFieldValueFromFdf[field] =3D ["","",""]=0D + Pcd.PcdFieldValueFromFdf[field] =3D ["", "", ""]=0D Pcd.PcdFieldValueFromFdf[field][0] =3D FieldValues[field]= =0D - Pcd.PcdFieldValueFromFdf[field][1] =3D os.path.relpath(fdf= pcdlocation[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName,field)][0],workspace)=0D - Pcd.PcdFieldValueFromFdf[field][2] =3D fdfpcdlocation[(Pcd= .TokenCName,Pcd.TokenSpaceGuidCName,field)][1]=0D + Pcd.PcdFieldValueFromFdf[field][1] =3D os.path.relpath(=0D + fdfpcdlocation[(Pcd.TokenCName, Pcd.TokenSpaceGuidCNam= e, field)][0], workspace)=0D + Pcd.PcdFieldValueFromFdf[field][2] =3D fdfpcdlocation[(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuidCName, field)][1]=0D =0D return StruPcds=0D =0D @@ -1328,7 +1428,8 @@ class DscBuildData(PlatformBuildClassObject): StructurePcdInCom =3D OrderedDict()=0D for item in GlobalData.BuildOptionPcd:=0D if len(item) =3D=3D 5 and (item[1], item[0]) in StruPcds:=0D - StructurePcdInCom[(item[0], item[1], item[2] )] =3D (item[= 3], item[4])=0D + StructurePcdInCom[(item[0], item[1], item[2])=0D + ] =3D (item[3], item[4])=0D GlobalPcds =3D {(item[0], item[1]) for item in StructurePcdInCom}= =0D for Pcd in StruPcds.values():=0D if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) not in GlobalPcds= :=0D @@ -1345,7 +1446,7 @@ class DscBuildData(PlatformBuildClassObject): Pcd.PcdFieldValueFromComm[field][2] =3D FieldValues[field]= [1][1]=0D return StruPcds=0D =0D - def OverrideByCommOverAll(self,AllPcds):=0D + def OverrideByCommOverAll(self, AllPcds):=0D def CheckStructureInComm(commpcds):=0D if not commpcds:=0D return False=0D @@ -1356,7 +1457,8 @@ class DscBuildData(PlatformBuildClassObject): if CheckStructureInComm(GlobalData.BuildOptionPcd):=0D StructurePcdInCom =3D OrderedDict()=0D for item in GlobalData.BuildOptionPcd:=0D - StructurePcdInCom[(item[0], item[1], item[2] )] =3D (item[= 3], item[4])=0D + StructurePcdInCom[(item[0], item[1], item[2])=0D + ] =3D (item[3], item[4])=0D for item in StructurePcdInCom:=0D if not item[2]:=0D NoFiledValues[(item[0], item[1])] =3D StructurePcdInCo= m[item]=0D @@ -1367,24 +1469,32 @@ class DscBuildData(PlatformBuildClassObject): if (Name, Guid) in AllPcds:=0D Pcd =3D AllPcds.get((Name, Guid))=0D if isinstance(self._DecPcds.get((Pcd.TokenCName, Pcd.Token= SpaceGuidCName), None), StructurePcd):=0D - self._DecPcds.get((Pcd.TokenCName, Pcd.TokenSpaceGuidC= Name)).PcdValueFromComm =3D NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.Tok= enCName)][0]=0D + self._DecPcds.get((Pcd.TokenCName, Pcd.TokenSpaceGuidC= Name)).PcdValueFromComm =3D NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]=0D else:=0D - Pcd.PcdValueFromComm =3D NoFiledValues[(Pcd.TokenSpace= GuidCName, Pcd.TokenCName)][0]=0D - Pcd.DefaultValue =3D NoFiledValues[(Pcd.TokenSpaceGuid= CName, Pcd.TokenCName)][0]=0D + Pcd.PcdValueFromComm =3D NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]=0D + Pcd.DefaultValue =3D NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]=0D for sku in Pcd.SkuInfoList:=0D SkuInfo =3D Pcd.SkuInfoList[sku]=0D if SkuInfo.DefaultValue:=0D - SkuInfo.DefaultValue =3D NoFiledValues[(Pcd.To= kenSpaceGuidCName, Pcd.TokenCName)][0]=0D + SkuInfo.DefaultValue =3D NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][= 0]=0D else:=0D - SkuInfo.HiiDefaultValue =3D NoFiledValues[(Pcd= .TokenSpaceGuidCName, Pcd.TokenCName)][0]=0D + SkuInfo.HiiDefaultValue =3D NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][= 0]=0D for defaultstore in SkuInfo.DefaultStoreDict:= =0D - SkuInfo.DefaultStoreDict[defaultstore] =3D= NoFiledValues[(Pcd.TokenSpaceGuidCName, Pcd.TokenCName)][0]=0D + SkuInfo.DefaultStoreDict[defaultstore] =3D= NoFiledValues[(=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e)][0]=0D if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAM= IC_EX_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII]]:=0D if Pcd.DatumType =3D=3D TAB_VOID:=0D if not Pcd.MaxDatumSize:=0D Pcd.MaxDatumSize =3D '0'=0D - CurrentSize =3D int(Pcd.MaxDatumSize, 16) if P= cd.MaxDatumSize.upper().startswith("0X") else int(Pcd.MaxDatumSize)=0D - OptionSize =3D len((StringToArray(Pcd.PcdValue= FromComm)).split(","))=0D + CurrentSize =3D int(Pcd.MaxDatumSize, 16) if P= cd.MaxDatumSize.upper(=0D + ).startswith("0X") else int(Pcd.MaxDatumSize)= =0D + OptionSize =3D len(=0D + (StringToArray(Pcd.PcdValueFromComm)).spli= t(","))=0D MaxSize =3D max(CurrentSize, OptionSize)=0D Pcd.MaxDatumSize =3D str(MaxSize)=0D else:=0D @@ -1392,30 +1502,36 @@ class DscBuildData(PlatformBuildClassObject): if PcdInDec:=0D PcdInDec.PcdValueFromComm =3D NoFiledValues[(Guid, Nam= e)][0]=0D if PcdInDec.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_= FIXED_AT_BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_P= ATCHABLE_IN_MODULE],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_F= EATURE_FLAG],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX]]:=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_PATCHABLE_IN_MODULE= ],=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_FEATURE_FLAG],=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_= DYNAMIC_EX]]:=0D self._Pcds[Name, Guid] =3D copy.deepcopy(PcdInDec)= =0D - self._Pcds[Name, Guid].DefaultValue =3D NoFiledVal= ues[( Guid, Name)][0]=0D + self._Pcds[Name, Guid].DefaultValue =3D NoFiledVal= ues[(=0D + Guid, Name)][0]=0D if PcdInDec.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_= DYNAMIC],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX]]:=0D - self._Pcds[Name, Guid].SkuInfoList =3D {TAB_DEFAUL= T:SkuInfoClass(TAB_DEFAULT, self.SkuIds[TAB_DEFAULT][0], '', '', '', '', ''= , NoFiledValues[( Guid, Name)][0])}=0D + self._PCD_TYPE_STRING_[MODEL_PCD_= DYNAMIC_EX]]:=0D + self._Pcds[Name, Guid].SkuInfoList =3D {TAB_DEFAUL= T: SkuInfoClass(=0D + TAB_DEFAULT, self.SkuIds[TAB_DEFAULT][0], '', = '', '', '', '', NoFiledValues[(Guid, Name)][0])}=0D return AllPcds=0D =0D - def OverrideByFdfOverAll(self,AllPcds):=0D + def OverrideByFdfOverAll(self, AllPcds):=0D =0D if GlobalData.gFdfParser is None:=0D return AllPcds=0D NoFiledValues =3D GlobalData.gFdfParser.Profile.PcdDict=0D - for Name,Guid,Field in NoFiledValues:=0D + for Name, Guid, Field in NoFiledValues:=0D if len(Field):=0D continue=0D - Value =3D NoFiledValues[(Name,Guid,Field)]=0D - if (Name,Guid) in AllPcds:=0D - Pcd =3D AllPcds.get((Name,Guid))=0D - if isinstance(self._DecPcds.get((Pcd.TokenCName,Pcd.TokenS= paceGuidCName), None),StructurePcd):=0D - self._DecPcds.get((Pcd.TokenCName,Pcd.TokenSpaceGuidCN= ame)).PcdValueFromComm =3D Value=0D + Value =3D NoFiledValues[(Name, Guid, Field)]=0D + if (Name, Guid) in AllPcds:=0D + Pcd =3D AllPcds.get((Name, Guid))=0D + if isinstance(self._DecPcds.get((Pcd.TokenCName, Pcd.Token= SpaceGuidCName), None), StructurePcd):=0D + self._DecPcds.get(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName)).PcdValu= eFromComm =3D Value=0D else:=0D Pcd.PcdValueFromComm =3D Value=0D Pcd.DefaultValue =3D Value=0D @@ -1431,22 +1547,25 @@ class DscBuildData(PlatformBuildClassObject): if Pcd.DatumType =3D=3D TAB_VOID:=0D if not Pcd.MaxDatumSize:=0D Pcd.MaxDatumSize =3D '0'=0D - CurrentSize =3D int(Pcd.MaxDatumSize,16) if Pc= d.MaxDatumSize.upper().startswith("0X") else int(Pcd.MaxDatumSize)=0D - OptionSize =3D len((StringToArray(Pcd.PcdValue= FromComm)).split(","))=0D + CurrentSize =3D int(Pcd.MaxDatumSize, 16) if P= cd.MaxDatumSize.upper(=0D + ).startswith("0X") else int(Pcd.MaxDatumSize)= =0D + OptionSize =3D len(=0D + (StringToArray(Pcd.PcdValueFromComm)).spli= t(","))=0D MaxSize =3D max(CurrentSize, OptionSize)=0D Pcd.MaxDatumSize =3D str(MaxSize)=0D else:=0D - PcdInDec =3D self.DecPcds.get((Name,Guid))=0D + PcdInDec =3D self.DecPcds.get((Name, Guid))=0D if PcdInDec:=0D PcdInDec.PcdValueFromFdf =3D Value=0D if PcdInDec.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_= FIXED_AT_BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_P= ATCHABLE_IN_MODULE],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_F= EATURE_FLAG]]:=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_PATCHABLE_IN_MODULE= ],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_= FEATURE_FLAG]]:=0D self._Pcds[Name, Guid] =3D copy.deepcopy(PcdInDec)= =0D self._Pcds[Name, Guid].DefaultValue =3D Value=0D return AllPcds=0D =0D - def ParsePcdNameStruct(self,NamePart1,NamePart2):=0D + def ParsePcdNameStruct(self, NamePart1, NamePart2):=0D TokenSpaceCName =3D PcdCName =3D DimensionAttr =3D Field =3D ""=0D if "." in NamePart1:=0D TokenSpaceCName, TempPcdCName =3D NamePart1.split(".")=0D @@ -1464,22 +1583,23 @@ class DscBuildData(PlatformBuildClassObject): else:=0D PcdCName =3D NamePart2=0D =0D - return TokenSpaceCName,PcdCName,DimensionAttr,Field=0D + return TokenSpaceCName, PcdCName, DimensionAttr, Field=0D =0D def UpdateStructuredPcds(self, TypeList, AllPcds):=0D =0D DynamicPcdType =3D [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_DEFAU= LT],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_VPD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_DEFAUL= T],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII],= =0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_VPD]]= =0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_VPD],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_DEFA= ULT],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]= ,=0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_VPD]= ]=0D =0D Pcds =3D AllPcds=0D DefaultStoreMgr =3D DefaultStore(self.DefaultStores)=0D SkuIds =3D self.SkuIds=0D - self.SkuIdMgr.AvailableSkuIdSet.update({TAB_DEFAULT:0})=0D - DefaultStores =3D {storename for pcdobj in AllPcds.values() for sk= uobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDic= t}=0D + self.SkuIdMgr.AvailableSkuIdSet.update({TAB_DEFAULT: 0})=0D + DefaultStores =3D {storename for pcdobj in AllPcds.values(=0D + ) for skuobj in pcdobj.SkuInfoList.values() for storename in skuob= j.DefaultStoreDict}=0D DefaultStores.add(TAB_DEFAULT_STORES_DEFAULT)=0D =0D S_PcdSet =3D []=0D @@ -1495,28 +1615,34 @@ class DscBuildData(PlatformBuildClassObject): SkuName =3D TAB_DEFAULT if SkuName =3D=3D TAB_COMMON else SkuN= ame=0D if SkuName not in SkuIds:=0D continue=0D - TCName,PCName,DimensionAttr,Field =3D self.ParsePcdNameStruct(= TokenSpaceGuid, PcdCName)=0D - pcd_in_dec =3D self._DecPcds.get((PCName,TCName), None)=0D + TCName, PCName, DimensionAttr, Field =3D self.ParsePcdNameStru= ct(=0D + TokenSpaceGuid, PcdCName)=0D + pcd_in_dec =3D self._DecPcds.get((PCName, TCName), None)=0D if pcd_in_dec is None:=0D EdkLogger.error('build', PARSER_ERROR,=0D - "Pcd (%s.%s) defined in DSC is not declared in= DEC files. Arch: ['%s']" % (TCName, PCName, self._Arch),=0D - File=3Dself.MetaFile, Line =3D Dummy5)=0D + "Pcd (%s.%s) defined in DSC is not declare= d in DEC files. Arch: ['%s']" % (=0D + TCName, PCName, self._Arch),=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if SkuName in SkuIds and ("." in TokenSpaceGuid or "[" in PcdC= Name):=0D - if not isinstance (pcd_in_dec, StructurePcd):=0D + if not isinstance(pcd_in_dec, StructurePcd):=0D EdkLogger.error('build', PARSER_ERROR,=0D - "Pcd (%s.%s) is not declared as Structure = PCD in DEC files. Arch: ['%s']" % (TCName, PCName, self._Arch),=0D - File=3Dself.MetaFile, Line =3D Dummy5)=0D + "Pcd (%s.%s) is not declared as Struct= ure PCD in DEC files. Arch: ['%s']" % (=0D + TCName, PCName, self._Arch),=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D =0D - S_PcdSet.append([ TCName,PCName,DimensionAttr,Field, SkuNa= me, default_store, Dummy5, AnalyzePcdExpression(Setting)[0]])=0D + S_PcdSet.append([TCName, PCName, DimensionAttr, Field, Sku= Name,=0D + default_store, Dummy5, AnalyzePcdExpressio= n(Setting)[0]])=0D ModuleScopeOverallValue =3D {}=0D for m in self.Modules.values():=0D mguid =3D m.Guid=0D if m.StrPcdSet:=0D S_PcdSet.extend(m.StrPcdSet)=0D mguid =3D m.StrPcdSet[0][4]=0D - for (PCName,TCName) in m.StrPcdOverallValue:=0D - Value, dsc_file, lineNo =3D m.StrPcdOverallValue[(PCName,T= CName)]=0D - ModuleScopeOverallValue.setdefault((PCName,TCName),{})[mgu= id] =3D Value, dsc_file, lineNo=0D + for (PCName, TCName) in m.StrPcdOverallValue:=0D + Value, dsc_file, lineNo =3D m.StrPcdOverallValue[(=0D + PCName, TCName)]=0D + ModuleScopeOverallValue.setdefault((PCName, TCName), {})[= =0D + mguid] =3D Value, dsc_file, lineNo=0D # handle pcd value override=0D StrPcdSet =3D DscBuildData.GetStructurePcdInfo(S_PcdSet)=0D S_pcd_set =3D OrderedDict()=0D @@ -1528,17 +1654,23 @@ class DscBuildData(PlatformBuildClassObject): if str_pcd_obj:=0D str_pcd_obj_str.copy(str_pcd_obj)=0D if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defaultst= ore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, st= r_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in Default= Stores} for skuname in str_pcd_obj.SkuInfoList}=0D + str_pcd_obj_str.DefaultFromDSC =3D {skuname: {defaults= tore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(=0D + defaultstore, str_pcd_obj.SkuInfoList[skuname].Hii= DefaultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj= .SkuInfoList}=0D else:=0D - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defaultst= ore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, st= r_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultSto= res} for skuname in str_pcd_obj.SkuInfoList}=0D + str_pcd_obj_str.DefaultFromDSC =3D {skuname: {defaults= tore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(=0D + defaultstore, str_pcd_obj.SkuInfoList[skuname].Def= aultValue) for defaultstore in DefaultStores} for skuname in str_pcd_obj.Sk= uInfoList}=0D for str_pcd_data in StrPcdSet[str_pcd]:=0D if str_pcd_data[4] in SkuIds:=0D - str_pcd_obj_str.AddOverrideValue(str_pcd_data[3], str(= str_pcd_data[7]), TAB_DEFAULT if str_pcd_data[4] =3D=3D TAB_COMMON else str= _pcd_data[4], TAB_DEFAULT_STORES_DEFAULT if str_pcd_data[5] =3D=3D TAB_COMM= ON else str_pcd_data[5], self.MetaFile.File if self.WorkspaceDir not in sel= f.MetaFile.File else self.MetaFile.File[len(self.WorkspaceDir) if self.Work= spaceDir.endswith(os.path.sep) else len(self.WorkspaceDir)+1:], LineNo=3Dst= r_pcd_data[6],DimensionAttr =3D str_pcd_data[2])=0D + str_pcd_obj_str.AddOverrideValue(str_pcd_data[3], str(= str_pcd_data[7]), TAB_DEFAULT if str_pcd_data[4] =3D=3D TAB_COMMON else str= _pcd_data[4], TAB_DEFAULT_STORES_DEFAULT if str_pcd_data[5] =3D=3D TAB_COMM= ON else str_pcd_data[5],=0D + self.MetaFile.File if= self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.File[len(se= lf.WorkspaceDir) if self.WorkspaceDir.endswith(os.path.sep) else len(self.W= orkspaceDir)+1:], LineNo=3Dstr_pcd_data[6], DimensionAttr=3Dstr_pcd_data[2]= )=0D elif GlobalData.gGuidPattern.match(str_pcd_data[4]):=0D - str_pcd_obj_str.AddComponentOverrideValue(str_pcd_data= [3], str(str_pcd_data[7]), str_pcd_data[4].replace("-","S"), self.MetaFile.= File if self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.File= [len(self.WorkspaceDir) if self.WorkspaceDir.endswith(os.path.sep) else len= (self.WorkspaceDir)+1:], LineNo=3Dstr_pcd_data[6],DimensionAttr =3D str_pcd= _data[2])=0D - PcdComponentValue =3D ModuleScopeOverallValue.get((str= _pcd_obj_str.TokenCName,str_pcd_obj_str.TokenSpaceGuidCName))=0D + str_pcd_obj_str.AddComponentOverrideValue(str_pcd_data= [3], str(str_pcd_data[7]), str_pcd_data[4].replace("-", "S"), self.MetaFile= .File if self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.Fil= e[len(=0D + self.WorkspaceDir) if self.WorkspaceDir.endswith(o= s.path.sep) else len(self.WorkspaceDir)+1:], LineNo=3Dstr_pcd_data[6], Dime= nsionAttr=3Dstr_pcd_data[2])=0D + PcdComponentValue =3D ModuleScopeOverallValue.get(=0D + (str_pcd_obj_str.TokenCName, str_pcd_obj_str.Token= SpaceGuidCName))=0D for module_guid in PcdComponentValue:=0D - str_pcd_obj_str.PcdValueFromComponents[module_guid= .replace("-","S")] =3D PcdComponentValue[module_guid]=0D + str_pcd_obj_str.PcdValueFromComponents[module_guid= .replace(=0D + "-", "S")] =3D PcdComponentValue[module_guid]= =0D S_pcd_set[str_pcd[1], str_pcd[0]] =3D str_pcd_obj_str=0D =0D # Add the Structure PCD that only defined in DEC, don't have overr= ide in DSC file=0D @@ -1551,9 +1683,11 @@ class DscBuildData(PlatformBuildClassObject): if str_pcd_obj:=0D str_pcd_obj_str.copy(str_pcd_obj)=0D if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MOD= EL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{d= efaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaults= tore, str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in= DefaultStores} for skuname in str_pcd_obj.SkuInfoList}=0D + str_pcd_obj_str.DefaultFromDSC =3D {skuname: {= defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(=0D + defaultstore, str_pcd_obj.SkuInfoList[skun= ame].HiiDefaultValue) for defaultstore in DefaultStores} for skuname in str= _pcd_obj.SkuInfoList}=0D else:=0D - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{d= efaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaults= tore, str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in De= faultStores} for skuname in str_pcd_obj.SkuInfoList}=0D + str_pcd_obj_str.DefaultFromDSC =3D {skuname: {= defaultstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(=0D + defaultstore, str_pcd_obj.SkuInfoList[skun= ame].DefaultValue) for defaultstore in DefaultStores} for skuname in str_pc= d_obj.SkuInfoList}=0D S_pcd_set[Pcd] =3D str_pcd_obj_str=0D if S_pcd_set:=0D GlobalData.gStructurePcd[self.Arch] =3D S_pcd_set.copy()=0D @@ -1570,12 +1704,13 @@ class DscBuildData(PlatformBuildClassObject): NoDefault =3D True=0D break=0D nextskuid =3D self.SkuIdMgr.GetNextSkuId(nextskuid= )=0D - 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.Default= Values})=0D + stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy(=0D + {defaultstorename: stru_pcd.DefaultValues for defa= ultstorename in DefaultStores} if DefaultStores else {}) # {TAB_DEFAULT_ST= ORES_DEFAULT:stru_pcd.DefaultValues})=0D if not NoDefault:=0D stru_pcd.ValueChain.add((skuid, ''))=0D if 'DEFAULT' in stru_pcd.SkuOverrideValues and not GlobalD= ata.gPcdSkuOverrides.get((stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCName= )):=0D GlobalData.gPcdSkuOverrides.update(=0D - {(stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCNam= e): {'DEFAULT':stru_pcd.SkuOverrideValues['DEFAULT']}})=0D + {(stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCNam= e): {'DEFAULT': stru_pcd.SkuOverrideValues['DEFAULT']}})=0D if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_= HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D for skuid in SkuIds:=0D nextskuid =3D skuid=0D @@ -1588,14 +1723,17 @@ class DscBuildData(PlatformBuildClassObject): nextskuid =3D self.SkuIdMgr.GetNextSkuId(nexts= kuid)=0D if NoDefault:=0D continue=0D - PcdDefaultStoreSet =3D set(defaultstorename for defau= ltstorename in stru_pcd.SkuOverrideValues[nextskuid])=0D - mindefaultstorename =3D DefaultStoreMgr.GetMin(PcdDefa= ultStoreSet)=0D + PcdDefaultStoreSet =3D set(=0D + defaultstorename for defaultstorename in stru_pcd.= SkuOverrideValues[nextskuid])=0D + mindefaultstorename =3D DefaultStoreMgr.GetMin(=0D + PcdDefaultStoreSet)=0D =0D for defaultstoreid in DefaultStores:=0D if defaultstoreid not in stru_pcd.SkuOverrideValue= s[skuid]:=0D - stru_pcd.SkuOverrideValues[skuid][defaultstore= id] =3D CopyDict(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstorename]= )=0D + stru_pcd.SkuOverrideValues[skuid][defaultstore= id] =3D CopyDict(=0D + stru_pcd.SkuOverrideValues[nextskuid][mind= efaultstorename])=0D stru_pcd.ValueChain.add((skuid, defaultstoreid= ))=0D - S_pcd_set =3D DscBuildData.OverrideByFdf(S_pcd_set,self.WorkspaceD= ir)=0D + S_pcd_set =3D DscBuildData.OverrideByFdf(S_pcd_set, self.Workspace= Dir)=0D S_pcd_set =3D DscBuildData.OverrideByComm(S_pcd_set)=0D =0D # Create a tool to caculate structure pcd value=0D @@ -1610,21 +1748,24 @@ class DscBuildData(PlatformBuildClassObject): if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_HII],=0D self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX_HII]]:=0D if skuname not in str_pcd_obj.SkuInfoList:=0D - str_pcd_obj.SkuInfoList[skuname] =3D SkuInfoClass(= SkuIdName=3Dskuname, SkuId=3Dself.SkuIds[skuname][0], HiiDefaultValue=3DPcd= Value, DefaultStore =3D {StoreName:PcdValue})=0D + str_pcd_obj.SkuInfoList[skuname] =3D SkuInfoClass(= =0D + SkuIdName=3Dskuname, SkuId=3Dself.SkuIds[skuna= me][0], HiiDefaultValue=3DPcdValue, DefaultStore=3D{StoreName: PcdValue})=0D else:=0D str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue = =3D PcdValue=0D - str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.= update({StoreName:PcdValue})=0D + str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.= update(=0D + {StoreName: PcdValue})=0D elif str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD= _FIXED_AT_BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_P= ATCHABLE_IN_MODULE]]:=0D + self._PCD_TYPE_STRING_[MODEL_PCD= _PATCHABLE_IN_MODULE]]:=0D if skuname in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT,= TAB_COMMON):=0D str_pcd_obj.DefaultValue =3D PcdValue=0D else:=0D - #Module Scope Structure Pcd=0D - moduleguid =3D skuname.replace("S","-")=0D + # Module Scope Structure Pcd=0D + moduleguid =3D skuname.replace("S", "-")=0D if GlobalData.gGuidPattern.match(moduleguid):=0D for component in self.Modules.values():=0D if component.Guid =3D=3D moduleguid:=0D - component.Pcds[(PcdName, PcdGuid)].Def= aultValue =3D PcdValue=0D + component.Pcds[(=0D + PcdName, PcdGuid)].DefaultValue = =3D PcdValue=0D =0D else:=0D if skuname not in str_pcd_obj.SkuInfoList:=0D @@ -1635,25 +1776,32 @@ class DscBuildData(PlatformBuildClassObject): NoDefault =3D True=0D break=0D nextskuid =3D self.SkuIdMgr.GetNextSkuId(nexts= kuid)=0D - str_pcd_obj.SkuInfoList[skuname] =3D copy.deepcopy= (str_pcd_obj.SkuInfoList[nextskuid]) if not NoDefault else SkuInfoClass(Sku= IdName=3Dskuname, SkuId=3Dself.SkuIds[skuname][0], DefaultValue=3DPcdValue)= =0D + str_pcd_obj.SkuInfoList[skuname] =3D copy.deepcopy= (str_pcd_obj.SkuInfoList[nextskuid]) if not NoDefault else SkuInfoClass(=0D + SkuIdName=3Dskuname, SkuId=3Dself.SkuIds[skuna= me][0], DefaultValue=3DPcdValue)=0D str_pcd_obj.SkuInfoList[skuname].SkuId =3D self.Sk= uIds[skuname][0]=0D str_pcd_obj.SkuInfoList[skuname].SkuIdName =3D sku= name=0D else:=0D str_pcd_obj.SkuInfoList[skuname].DefaultValue =3D = PcdValue=0D for str_pcd_obj in S_pcd_set.values():=0D if str_pcd_obj.Type not in [self._PCD_TYPE_STRING_[MODEL_P= CD_DYNAMIC_HII],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_D= YNAMIC_EX_HII]]:=0D + self._PCD_TYPE_STRING_[MODEL_P= CD_DYNAMIC_EX_HII]]:=0D continue=0D - PcdDefaultStoreSet =3D set(defaultstorename for skuobj in = str_pcd_obj.SkuInfoList.values() for defaultstorename in skuobj.DefaultStor= eDict)=0D + PcdDefaultStoreSet =3D set(defaultstorename for skuobj in = str_pcd_obj.SkuInfoList.values(=0D + ) for defaultstorename in skuobj.DefaultStoreDict)=0D DefaultStoreObj =3D DefaultStore(self._GetDefaultStores())= =0D - mindefaultstorename =3D DefaultStoreObj.GetMin(PcdDefaultS= toreSet)=0D - str_pcd_obj.SkuInfoList[self.SkuIdMgr.SystemSkuId].HiiDefa= ultValue =3D str_pcd_obj.SkuInfoList[self.SkuIdMgr.SystemSkuId].DefaultStor= eDict[mindefaultstorename]=0D + mindefaultstorename =3D DefaultStoreObj.GetMin(=0D + PcdDefaultStoreSet)=0D + str_pcd_obj.SkuInfoList[self.SkuIdMgr.SystemSkuId].HiiDefa= ultValue =3D str_pcd_obj.SkuInfoList[=0D + self.SkuIdMgr.SystemSkuId].DefaultStoreDict[mindefault= storename]=0D =0D for str_pcd_obj in S_pcd_set.values():=0D =0D - str_pcd_obj.MaxDatumSize =3D DscBuildData.GetStructurePcdM= axSize(str_pcd_obj)=0D - Pcds[str_pcd_obj.TokenCName, str_pcd_obj.TokenSpaceGuidCNa= me] =3D str_pcd_obj=0D - Pcds[str_pcd_obj.TokenCName, str_pcd_obj.TokenSpaceGuidCNa= me].CustomAttribute['IsStru']=3DTrue=0D + str_pcd_obj.MaxDatumSize =3D DscBuildData.GetStructurePcdM= axSize(=0D + str_pcd_obj)=0D + Pcds[str_pcd_obj.TokenCName,=0D + str_pcd_obj.TokenSpaceGuidCName] =3D str_pcd_obj=0D + Pcds[str_pcd_obj.TokenCName,=0D + str_pcd_obj.TokenSpaceGuidCName].CustomAttribute['IsS= tru'] =3D True=0D =0D for pcdkey in Pcds:=0D pcd =3D Pcds[pcdkey]=0D @@ -1663,31 +1811,36 @@ class DscBuildData(PlatformBuildClassObject): elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.= SkuInfoList:=0D del pcd.SkuInfoList[TAB_COMMON]=0D =0D - list(map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds = if Pcds[pcdkey].Type in DynamicPcdType]))=0D + list(map(self.FilterSkuSettings, [=0D + Pcds[pcdkey] for pcdkey in Pcds if Pcds[pcdkey].Type in Dynam= icPcdType]))=0D return Pcds=0D +=0D @cached_property=0D def PlatformUsedPcds(self):=0D FdfInfList =3D []=0D if GlobalData.gFdfParser:=0D FdfInfList =3D GlobalData.gFdfParser.Profile.InfList=0D - FdfModuleList =3D [PathClass(NormPath(Inf), GlobalData.gWorkspace,= Arch=3Dself._Arch) for Inf in FdfInfList]=0D + FdfModuleList =3D [PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, Arch=3Dself._Arch) for I= nf in FdfInfList]=0D AllModulePcds =3D set()=0D ModuleSet =3D set(list(self._Modules.keys()) + FdfModuleList)=0D for ModuleFile in ModuleSet:=0D - ModuleData =3D self._Bdb[ModuleFile, self._Arch, self._Target,= self._Toolchain]=0D + ModuleData =3D self._Bdb[ModuleFile,=0D + self._Arch, self._Target, self._Toolcha= in]=0D AllModulePcds =3D AllModulePcds | ModuleData.PcdsName=0D for ModuleFile in self.LibraryInstances:=0D - ModuleData =3D self._Bdb.CreateBuildObject(ModuleFile, self._A= rch, self._Target, self._Toolchain)=0D + ModuleData =3D self._Bdb.CreateBuildObject(=0D + ModuleFile, self._Arch, self._Target, self._Toolchain)=0D AllModulePcds =3D AllModulePcds | ModuleData.PcdsName=0D return AllModulePcds=0D =0D - #Filter the StrucutrePcd that is not used by any module in dsc file an= d fdf file.=0D + # Filter the StrucutrePcd that is not used by any module in dsc file a= nd fdf file.=0D def FilterStrcturePcd(self, S_pcd_set):=0D UnusedStruPcds =3D set(S_pcd_set.keys()) - self.PlatformUsedPcds=0D for (Token, TokenSpaceGuid) in UnusedStruPcds:=0D del S_pcd_set[(Token, TokenSpaceGuid)]=0D =0D - ## Retrieve non-dynamic PCD settings=0D + # Retrieve non-dynamic PCD settings=0D #=0D # @param Type PCD type=0D #=0D @@ -1711,7 +1864,7 @@ class DscBuildData(PlatformBuildClassObject): SkuName =3D TAB_DEFAULT if SkuName =3D=3D TAB_COMMON else SkuN= ame=0D if SkuName not in AvailableSkuIdSet:=0D EdkLogger.error('build ', PARAMETER_INVALID, 'Sku %s is no= t defined in [SkuIds] section' % SkuName,=0D - File=3Dself.MetaFile, Line=3DD= ummy5)=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if SkuName in (self.SkuIdMgr.SystemSkuId, TAB_DEFAULT, TAB_COM= MON):=0D if "." not in TokenSpaceGuid and "[" not in PcdCName and (= PcdCName, TokenSpaceGuid, SkuName, Dummy5) not in PcdList:=0D PcdList.append((PcdCName, TokenSpaceGuid, SkuName, Dum= my5))=0D @@ -1721,7 +1874,8 @@ class DscBuildData(PlatformBuildClassObject): Setting =3D PcdDict[self._Arch, PcdCName, TokenSpaceGuid, SkuN= ame]=0D if Setting is None:=0D continue=0D - PcdValue, DatumType, MaxDatumSize =3D self._ValidatePcd(PcdCNa= me, TokenSpaceGuid, Setting, Type, Dummy4)=0D + PcdValue, DatumType, MaxDatumSize =3D self._ValidatePcd(=0D + PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)=0D if MaxDatumSize:=0D if int(MaxDatumSize, 0) > 0xFFFF:=0D EdkLogger.error('build', FORMAT_INVALID, "The size val= ue must not exceed the maximum value of 0xFFFF (UINT16) for %s." % ".".join= ((TokenSpaceGuid, PcdCName)),=0D @@ -1730,47 +1884,51 @@ class DscBuildData(PlatformBuildClassObject): EdkLogger.error('build', FORMAT_INVALID, "The size val= ue can't be set to negative value for %s." % ".".join((TokenSpaceGuid, PcdC= Name)),=0D File=3Dself.MetaFile, Line=3DDummy4)=0D if (PcdCName, TokenSpaceGuid) in PcdValueDict:=0D - PcdValueDict[PcdCName, TokenSpaceGuid][SkuName] =3D (PcdVa= lue, DatumType, MaxDatumSize,Dummy4)=0D + PcdValueDict[PcdCName, TokenSpaceGuid][SkuName] =3D (=0D + PcdValue, DatumType, MaxDatumSize, Dummy4)=0D else:=0D - PcdValueDict[PcdCName, TokenSpaceGuid] =3D {SkuName:(PcdVa= lue, DatumType, MaxDatumSize,Dummy4)}=0D + PcdValueDict[PcdCName, TokenSpaceGuid] =3D {=0D + SkuName: (PcdValue, DatumType, MaxDatumSize, Dummy4)}= =0D =0D for ((PcdCName, TokenSpaceGuid), PcdSetting) in PcdValueDict.items= ():=0D if self.SkuIdMgr.SystemSkuId in PcdSetting:=0D - PcdValue, DatumType, MaxDatumSize,_ =3D PcdSetting[self.Sk= uIdMgr.SystemSkuId]=0D + PcdValue, DatumType, MaxDatumSize, _ =3D PcdSetting[self.S= kuIdMgr.SystemSkuId]=0D elif TAB_DEFAULT in PcdSetting:=0D - PcdValue, DatumType, MaxDatumSize,_ =3D PcdSetting[TAB_DE= FAULT]=0D + PcdValue, DatumType, MaxDatumSize, _ =3D PcdSetting[TAB_DE= FAULT]=0D elif TAB_COMMON in PcdSetting:=0D - PcdValue, DatumType, MaxDatumSize,_ =3D PcdSetting[TAB_CO= MMON]=0D + PcdValue, DatumType, MaxDatumSize, _ =3D PcdSetting[TAB_CO= MMON]=0D else:=0D PcdValue =3D None=0D DatumType =3D None=0D MaxDatumSize =3D None=0D =0D Pcds[PcdCName, TokenSpaceGuid] =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - self._PCD_TYPE_STRING_[Typ= e],=0D - DatumType,=0D - PcdValue,=0D - '',=0D - MaxDatumSize,=0D - {},=0D - False,=0D - None,=0D - IsDsc=3DTrue)=0D + PcdCName,=0D + TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type],=0D + DatumType,=0D + PcdValue,=0D + '',=0D + MaxDatumSize,=0D + {},=0D + False,=0D + None,=0D + IsDsc=3DTrue)=0D for SkuName in PcdValueDict[PcdCName, TokenSpaceGuid]:=0D Settings =3D PcdValueDict[PcdCName, TokenSpaceGuid][SkuNam= e]=0D if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawVal= ue:=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] = =3D {}=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName= ] =3D {}=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DE= FAULT_STORES_DEFAULT] =3D Settings[0]=0D - Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TA= B_DEFAULT_STORES_DEFAULT] =3D (self.MetaFile.File,Settings[3])=0D + Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TA= B_DEFAULT_STORES_DEFAULT] =3D (=0D + self.MetaFile.File, Settings[3])=0D return Pcds=0D =0D @staticmethod=0D def GetStructurePcdMaxSize(str_pcd):=0D pcd_default_value =3D str_pcd.DefaultValue=0D - sku_values =3D [skuobj.HiiDefaultValue if str_pcd.Type in [DscBuil= dData._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], DscBuildData._PCD_TYPE_STRI= NG_[MODEL_PCD_DYNAMIC_EX_HII]] else skuobj.DefaultValue for skuobj in str_p= cd.SkuInfoList.values()]=0D + sku_values =3D [skuobj.HiiDefaultValue if str_pcd.Type in [DscBuil= dData._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],=0D + DscBuildD= ata._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]] else skuobj.DefaultValue f= or skuobj in str_pcd.SkuInfoList.values()]=0D sku_values.append(pcd_default_value)=0D =0D def get_length(value):=0D @@ -1788,7 +1946,7 @@ class DscBuildData(PlatformBuildClassObject): if (Value[0] =3D=3D '{' and Value[-1] =3D=3D '}'):=0D return len(Value.split(","))=0D if Value.startswith("L'") and Value.endswith("'") and len(= list(Value[2:-1])) > 1:=0D - return len(list(Value[2:-1]))=0D + return len(list(Value[2:-1]))=0D if Value[0] =3D=3D "'" and Value[-1] =3D=3D "'" and len(li= st(Value[1:-1])) > 1:=0D return len(Value) - 2=0D return len(Value)=0D @@ -1796,18 +1954,20 @@ class DscBuildData(PlatformBuildClassObject): return str(max(get_length(item) for item in sku_values))=0D =0D @staticmethod=0D - def ExecuteCommand (Command):=0D + def ExecuteCommand(Command):=0D try:=0D - Process =3D subprocess.Popen(Command, stdout=3Dsubprocess.PIPE= , stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + Process =3D subprocess.Popen(=0D + Command, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.PIP= E, shell=3DTrue)=0D except:=0D - EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute com= mand: %s' % Command)=0D + EdkLogger.error('Build', COMMAND_FAILURE,=0D + 'Can not execute command: %s' % Command)=0D Result =3D Process.communicate()=0D return Process.returncode, Result[0].decode(errors=3D'ignore'), Re= sult[1].decode(errors=3D'ignore')=0D =0D @staticmethod=0D def IntToCString(Value, ValueSize):=0D Result =3D '"'=0D - if not isinstance (Value, str):=0D + if not isinstance(Value, str):=0D for Index in range(0, ValueSize):=0D Result =3D Result + '\\x%02x' % (Value & 0xff)=0D Value =3D Value >> 8=0D @@ -1816,38 +1976,51 @@ class DscBuildData(PlatformBuildClassObject): =0D def GenerateSizeFunction(self, Pcd):=0D CApp =3D "// Default Value in Dec \n"=0D - CApp =3D CApp + "void Cal_%s_%s_Size(UINT32 *Size){\n" % (Pcd.Toke= nSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + \=0D + "void Cal_%s_%s_Size(UINT32 *Size){\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D =0D if Pcd.IsArray() and Pcd.Capacity[-1] !=3D "-1":=0D - CApp +=3D " *Size =3D (sizeof (%s) > *Size ? sizeof (%s) : *S= ize);\n" % (Pcd.DatumType,Pcd.DatumType)=0D + CApp +=3D " *Size =3D (sizeof (%s) > *Size ? sizeof (%s) : *S= ize);\n" % (=0D + Pcd.DatumType, Pcd.DatumType)=0D else:=0D if "{CODE(" in Pcd.DefaultValueFromDec:=0D - CApp +=3D " *Size =3D (sizeof (%s_%s_INIT_Value) > *Size = ? sizeof (%s_%s_INIT_Value) : *Size);\n" % (Pcd.TokenSpaceGuidCName,Pcd.Tok= enCName,Pcd.TokenSpaceGuidCName,Pcd.TokenCName)=0D + CApp +=3D " *Size =3D (sizeof (%s_%s_INIT_Value) > *Size = ? sizeof (%s_%s_INIT_Value) : *Size);\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.TokenSpac= eGuidCName, Pcd.TokenCName)=0D if Pcd.Type in PCD_DYNAMIC_TYPE_SET | PCD_DYNAMIC_EX_TYPE_SET:= =0D for skuname in Pcd.SkuInfoList:=0D skuobj =3D Pcd.SkuInfoList[skuname]=0D if skuobj.VariableName:=0D for defaultstore in skuobj.DefaultStoreDict:=0D - pcddef =3D self.GetPcdDscRawDefaultValue(Pcd,s= kuname,defaultstore)=0D + pcddef =3D self.GetPcdDscRawDefaultValue(=0D + Pcd, skuname, defaultstore)=0D if pcddef:=0D if "{CODE(" in pcddef:=0D - CApp +=3D " *Size =3D (sizeof (%s_%s_= %s_%s_Value) > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (Pcd.Token= SpaceGuidCName,Pcd.TokenCName,skuname,defaultstore,Pcd.TokenSpaceGuidCName,= Pcd.TokenCName,skuname,defaultstore)=0D + CApp +=3D " *Size =3D (sizeof (%s_%s_= %s_%s_Value) > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.Token= CName, skuname, defaultstore, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, skun= ame, defaultstore)=0D else:=0D - CApp +=3D " *Size =3D %s > *Size ? %s= : *Size;\n" % (self.GetStructurePcdMaxSize(Pcd),self.GetStructurePcdMaxSiz= e(Pcd))=0D + CApp +=3D " *Size =3D %s > *Size ? %s= : *Size;\n" % (=0D + self.GetStructurePcdMaxSize(Pcd), = self.GetStructurePcdMaxSize(Pcd))=0D else:=0D - pcddef =3D self.GetPcdDscRawDefaultValue(Pcd,skuna= me,TAB_DEFAULT_STORES_DEFAULT)=0D + pcddef =3D self.GetPcdDscRawDefaultValue(=0D + Pcd, skuname, TAB_DEFAULT_STORES_DEFAULT)=0D if pcddef:=0D - if "{CODE(" in pcddef:=0D - CApp +=3D " *Size =3D (sizeof (%s_%s_%s_%= s_Value) > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (Pcd.TokenSpac= eGuidCName,Pcd.TokenCName,skuname,TAB_DEFAULT_STORES_DEFAULT,Pcd.TokenSpace= GuidCName,Pcd.TokenCName,skuname,TAB_DEFAULT_STORES_DEFAULT)=0D + if "{CODE(" in pcddef:=0D + CApp +=3D " *Size =3D (sizeof (%s_%s_%s_%= s_Value) > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (Pcd.TokenSpac= eGuidCName,=0D + = Pcd.TokenCName, s= kuname, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pcd.TokenCName= , skuname, TAB_DEFAULT_STORES_DEFAULT)=0D else:=0D - CApp +=3D " *Size =3D %s > *Size ? %s : *= Size;\n" % (self.GetStructurePcdMaxSize(Pcd),self.GetStructurePcdMaxSize(Pc= d))=0D + CApp +=3D " *Size =3D %s > *Size ? %s : *= Size;\n" % (=0D + self.GetStructurePcdMaxSize(Pcd), self= .GetStructurePcdMaxSize(Pcd))=0D else:=0D - pcddef =3D self.GetPcdDscRawDefaultValue(Pcd,TAB_DEFAULT,T= AB_DEFAULT_STORES_DEFAULT)=0D + pcddef =3D self.GetPcdDscRawDefaultValue(=0D + Pcd, TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)=0D if pcddef:=0D if "{CODE(" in pcddef:=0D - CApp +=3D " *Size =3D (sizeof (%s_%s_%s_%s_Value)= > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (Pcd.TokenSpaceGuidCNa= me,Pcd.TokenCName,TAB_DEFAULT,TAB_DEFAULT_STORES_DEFAULT,Pcd.TokenSpaceGuid= CName,Pcd.TokenCName,TAB_DEFAULT,TAB_DEFAULT_STORES_DEFAULT)=0D + CApp +=3D " *Size =3D (sizeof (%s_%s_%s_%s_Value)= > *Size ? sizeof (%s_%s_%s_%s_Value) : *Size);\n" % (Pcd.TokenSpaceGuidCNa= me, Pcd.TokenCName,=0D + = TAB_DEFAULT, TAB_DEFAULT_= STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, TAB_DEFAULT, TAB_D= EFAULT_STORES_DEFAULT)=0D else:=0D - CApp +=3D " *Size =3D %s > *Size ? %s : *Size;\n"= % (self.GetStructurePcdMaxSize(Pcd),self.GetStructurePcdMaxSize(Pcd))=0D + CApp +=3D " *Size =3D %s > *Size ? %s : *Size;\n"= % (=0D + self.GetStructurePcdMaxSize(Pcd), self.GetStru= cturePcdMaxSize(Pcd))=0D ActualCap =3D []=0D for index in Pcd.DefaultValues:=0D if index:=0D @@ -1857,33 +2030,41 @@ class DscBuildData(PlatformBuildClassObject): continue=0D for FieldName in FieldList:=0D FieldName =3D "." + FieldName=0D - IsArray =3D _IsFieldValueAnArray(FieldList[FieldName.strip= (".")][0])=0D + IsArray =3D _IsFieldValueAnArray(=0D + FieldList[FieldName.strip(".")][0])=0D if IsArray and not (FieldList[FieldName.strip(".")][0].sta= rtswith('{GUID') and FieldList[FieldName.strip(".")][0].endswith('}')):=0D try:=0D - Value =3D ValueExpressionEx(FieldList[FieldName.st= rip(".")][0], TAB_VOID, self._GuidDict)(True)=0D + Value =3D ValueExpressionEx(=0D + FieldList[FieldName.strip(".")][0], TAB_VOID, = self._GuidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName.strip('.'))), FieldList[FieldName.strip(".")][1= ], FieldList[FieldName.strip(".")][2]))=0D Value, ValueSize =3D ParseFieldValue(Value)=0D if not Pcd.IsArray():=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, = %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ?= 1 : 0)); // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.stri= p("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.Datu= mType, FieldName.strip("."), FieldList[FieldName.strip(".")][1], FieldList[= FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, = %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ?= 1 : 0)); // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.stri= p(=0D + "."), ValueSize, Pcd.DatumType, FieldName.stri= p("."), ValueSize, Pcd.DatumType, FieldName.strip("."), FieldList[FieldName= .strip(".")][1], FieldList[FieldName.strip(".")][2], FieldList[FieldName.st= rip(".")][0])=0D else:=0D NewFieldName =3D ''=0D FieldName_ori =3D FieldName.strip('.')=0D - while '[' in FieldName:=0D - NewFieldName =3D NewFieldName + FieldName.split('[= ', 1)[0] + '[0]'=0D - Array_Index =3D int(FieldName.split('[', 1)[1].spl= it(']', 1)[0])=0D + while '[' in FieldName:=0D + NewFieldName =3D NewFieldName + \=0D + FieldName.split('[', 1)[0] + '[0]'=0D + Array_Index =3D int(FieldName.split(=0D + '[', 1)[1].split(']', 1)[0])=0D FieldName =3D FieldName.split(']', 1)[1]=0D FieldName =3D NewFieldName + FieldName=0D while '[' in FieldName and not Pcd.IsArray():=0D FieldName =3D FieldName.rsplit('[', 1)[0]=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, = %d); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip("."),= Array_Index + 1, FieldList[FieldName_ori][1], FieldList[FieldName_ori][2],= FieldList[FieldName_ori][0])=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, = %d); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip(=0D + "."), Array_Index + 1, FieldList[FieldName_ori= ][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])=0D flexisbale_size_statement_cache =3D set()=0D for skuname in Pcd.SkuOverrideValues:=0D if skuname =3D=3D TAB_COMMON:=0D continue=0D for defaultstorenameitem in Pcd.SkuOverrideValues[skuname]:=0D - CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n"= % (skuname, defaultstorenameitem)=0D + CApp =3D CApp + \=0D + "// SkuName: %s, DefaultStoreName: %s \n" % (=0D + skuname, defaultstorenameitem)=0D for index in Pcd.SkuOverrideValues[skuname][defaultstorena= meitem]:=0D if index:=0D ActualCap.append(index)=0D @@ -1896,85 +2077,107 @@ class DscBuildData(PlatformBuildClassObject): continue=0D flexisbale_size_statement_cache.add(fieldinfo)= =0D FieldName =3D "." + FieldName=0D - IsArray =3D _IsFieldValueAnArray(FieldList[Fie= ldName.strip(".")][0])=0D + IsArray =3D _IsFieldValueAnArray(=0D + FieldList[FieldName.strip(".")][0])=0D if IsArray and not (FieldList[FieldName.strip(= ".")][0].startswith('{GUID') and FieldList[FieldName.strip(".")][0].endswit= h('}')):=0D try:=0D - Value =3D ValueExpressionEx(FieldList[= FieldName.strip(".")][0], TAB_VOID, self._GuidDict)(True)=0D + Value =3D ValueExpressionEx(=0D + FieldList[FieldName.strip(".")][0]= , TAB_VOID, self._GuidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALI= D, "Invalid value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSp= aceGuidCName, Pcd.TokenCName, FieldName.strip('.'))), FieldList[FieldName.s= trip(".")][1], FieldList[FieldName.strip(".")][2]))=0D Value, ValueSize =3D ParseFieldValue(Value= )=0D if not Pcd.IsArray():=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Si= ze, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZ= E(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, Fiel= dName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize= , Pcd.DatumType, FieldName.strip("."), FieldList[FieldName.strip(".")][1], = FieldList[FieldName.strip(".")][2], FieldList[FieldName.strip(".")][0]);=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Si= ze, %s, %s, %d / __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZ= E(%s, %s)) ? 1 : 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, Fiel= dName.strip(=0D + "."), ValueSize, Pcd.DatumType, Fi= eldName.strip("."), ValueSize, Pcd.DatumType, FieldName.strip("."), FieldLi= st[FieldName.strip(".")][1], FieldList[FieldName.strip(".")][2], FieldList[= FieldName.strip(".")][0])=0D else:=0D NewFieldName =3D ''=0D FieldName_ori =3D FieldName.strip('.')=0D - while '[' in FieldName:=0D - NewFieldName =3D NewFieldName + FieldN= ame.split('[', 1)[0] + '[0]'=0D - Array_Index =3D int(FieldName.split('[= ', 1)[1].split(']', 1)[0])=0D + while '[' in FieldName:=0D + NewFieldName =3D NewFieldName + \=0D + FieldName.split('[', 1)[0] + '[0]'= =0D + Array_Index =3D int(FieldName.split(=0D + '[', 1)[1].split(']', 1)[0])=0D FieldName =3D FieldName.split(']', 1)[= 1]=0D FieldName =3D NewFieldName + FieldName=0D while '[' in FieldName and not Pcd.IsArray= ():=0D FieldName =3D FieldName.rsplit('[', 1)= [0]=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Si= ze, %s, %s, %d); // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldNam= e.strip("."), Array_Index + 1, FieldList[FieldName_ori][1], FieldList[Field= Name_ori][2], FieldList[FieldName_ori][0])=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Si= ze, %s, %s, %d); // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldNam= e.strip(=0D + "."), Array_Index + 1, FieldList[F= ieldName_ori][1], FieldList[FieldName_ori][2], FieldList[FieldName_ori][0])= =0D if Pcd.PcdFieldValueFromFdf:=0D CApp =3D CApp + "// From fdf \n"=0D for FieldName in Pcd.PcdFieldValueFromFdf:=0D FieldName =3D "." + FieldName=0D - IsArray =3D _IsFieldValueAnArray(Pcd.PcdFieldValueFromFdf[Fiel= dName.strip(".")][0])=0D + IsArray =3D _IsFieldValueAnArray(=0D + Pcd.PcdFieldValueFromFdf[FieldName.strip(".")][0])=0D if IsArray and not (Pcd.PcdFieldValueFromFdf[FieldName.strip("= .")][0].startswith('{GUID') and Pcd.PcdFieldValueFromFdf[FieldName.strip(".= ")][0].endswith('}')):=0D try:=0D - Value =3D ValueExpressionEx(Pcd.PcdFieldValueFromFdf[F= ieldName.strip(".")][0], TAB_VOID, self._GuidDict)(True)=0D + Value =3D ValueExpressionEx(Pcd.PcdFieldValueFromFdf[F= ieldName.strip(=0D + ".")][0], TAB_VOID, self._GuidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName, Pc= d.TokenCName, FieldName.strip('.'))), Pcd.PcdFieldValueFromFdf[FieldName.st= rip(".")][1], Pcd.PcdFieldValueFromFdf[FieldName.strip(".")][2]))=0D Value, ValueSize =3D ParseFieldValue(Value)=0D if not Pcd.IsArray():=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d /= __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 := 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip(".")= , ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType,= FieldName.strip("."), Pcd.PcdFieldValueFromFdf[FieldName.strip(".")][1], P= cd.PcdFieldValueFromFdf[FieldName.strip(".")][2], Pcd.PcdFieldValueFromFdf[= FieldName.strip(".")][0]);=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d /= __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 := 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip(".")= , ValueSize, Pcd.DatumType, FieldName.strip(=0D + "."), ValueSize, Pcd.DatumType, FieldName.strip(".= "), Pcd.PcdFieldValueFromFdf[FieldName.strip(".")][1], Pcd.PcdFieldValueFro= mFdf[FieldName.strip(".")][2], Pcd.PcdFieldValueFromFdf[FieldName.strip("."= )][0])=0D else:=0D NewFieldName =3D ''=0D FieldName_ori =3D FieldName.strip('.')=0D - while '[' in FieldName:=0D - NewFieldName =3D NewFieldName + FieldName.split('[', 1= )[0] + '[0]'=0D - Array_Index =3D int(FieldName.split('[', 1)[1].split('= ]', 1)[0])=0D + while '[' in FieldName:=0D + NewFieldName =3D NewFieldName + \=0D + FieldName.split('[', 1)[0] + '[0]'=0D + Array_Index =3D int(FieldName.split(=0D + '[', 1)[1].split(']', 1)[0])=0D FieldName =3D FieldName.split(']', 1)[1]=0D FieldName =3D NewFieldName + FieldName=0D while '[' in FieldName:=0D FieldName =3D FieldName.rsplit('[', 1)[0]=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %s Value %s \n' % (Pcd.DatumType, FieldName.strip("."), Ar= ray_Index + 1, Pcd.PcdFieldValueFromFdf[FieldName_ori][1], Pcd.PcdFieldValu= eFromFdf[FieldName_ori][2], Pcd.PcdFieldValueFromFdf[FieldName_ori][0])=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %s Value %s \n' % (Pcd.DatumType, FieldName.strip(=0D + "."), Array_Index + 1, Pcd.PcdFieldValueFromFdf[Fi= eldName_ori][1], Pcd.PcdFieldValueFromFdf[FieldName_ori][2], Pcd.PcdFieldVa= lueFromFdf[FieldName_ori][0])=0D if Pcd.PcdFieldValueFromComm:=0D CApp =3D CApp + "// From Command Line \n"=0D for FieldName in Pcd.PcdFieldValueFromComm:=0D FieldName =3D "." + FieldName=0D - IsArray =3D _IsFieldValueAnArray(Pcd.PcdFieldValueFromComm[Fie= ldName.strip(".")][0])=0D + IsArray =3D _IsFieldValueAnArray(=0D + Pcd.PcdFieldValueFromComm[FieldName.strip(".")][0])=0D if IsArray and not (Pcd.PcdFieldValueFromComm[FieldName.strip(= ".")][0].startswith('{GUID') and Pcd.PcdFieldValueFromComm[FieldName.strip(= ".")][0].endswith('}')):=0D try:=0D - Value =3D ValueExpressionEx(Pcd.PcdFieldValueFromComm[= FieldName.strip(".")][0], TAB_VOID, self._GuidDict)(True)=0D + Value =3D ValueExpressionEx(Pcd.PcdFieldValueFromComm[= FieldName.strip(=0D + ".")][0], TAB_VOID, self._GuidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName, Pc= d.TokenCName, FieldName.strip('.'))), Pcd.PcdFieldValueFromComm[FieldName.s= trip(".")][1], Pcd.PcdFieldValueFromComm[FieldName.strip(".")][2]))=0D Value, ValueSize =3D ParseFieldValue(Value)=0D if not Pcd.IsArray():=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d /= __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 := 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip(".")= , ValueSize, Pcd.DatumType, FieldName.strip("."), ValueSize, Pcd.DatumType,= FieldName.strip("."), Pcd.PcdFieldValueFromComm[FieldName.strip(".")][1], = Pcd.PcdFieldValueFromComm[FieldName.strip(".")][2], Pcd.PcdFieldValueFromCo= mm[FieldName.strip(".")][0]);=0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d /= __ARRAY_ELEMENT_SIZE(%s, %s) + ((%d %% __ARRAY_ELEMENT_SIZE(%s, %s)) ? 1 := 0)); // From %s Line %d Value %s\n' % (Pcd.DatumType, FieldName.strip(".")= , ValueSize, Pcd.DatumType, FieldName.strip(=0D + "."), ValueSize, Pcd.DatumType, FieldName.strip(".= "), Pcd.PcdFieldValueFromComm[FieldName.strip(".")][1], Pcd.PcdFieldValueFr= omComm[FieldName.strip(".")][2], Pcd.PcdFieldValueFromComm[FieldName.strip(= ".")][0])=0D else:=0D NewFieldName =3D ''=0D FieldName_ori =3D FieldName.strip('.')=0D - while '[' in FieldName:=0D - NewFieldName =3D NewFieldName + FieldName.split('[', 1= )[0] + '[0]'=0D - Array_Index =3D int(FieldName.split('[', 1)[1].split('= ]', 1)[0])=0D + while '[' in FieldName:=0D + NewFieldName =3D NewFieldName + \=0D + FieldName.split('[', 1)[0] + '[0]'=0D + Array_Index =3D int(FieldName.split(=0D + '[', 1)[1].split(']', 1)[0])=0D FieldName =3D FieldName.split(']', 1)[1]=0D FieldName =3D NewFieldName + FieldName=0D while '[' in FieldName and not Pcd.IsArray():=0D FieldName =3D FieldName.rsplit('[', 1)[0]=0D - CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip("."), Ar= ray_Index + 1, Pcd.PcdFieldValueFromComm[FieldName_ori][1], Pcd.PcdFieldVal= ueFromComm[FieldName_ori][2], Pcd.PcdFieldValueFromComm[FieldName_ori][0])= =0D + CApp =3D CApp + ' __FLEXIBLE_SIZE(*Size, %s, %s, %d);= // From %s Line %d Value %s \n' % (Pcd.DatumType, FieldName.strip(=0D + "."), Array_Index + 1, Pcd.PcdFieldValueFromComm[F= ieldName_ori][1], Pcd.PcdFieldValueFromComm[FieldName_ori][2], Pcd.PcdField= ValueFromComm[FieldName_ori][0])=0D if Pcd.GetPcdMaxSize():=0D - CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The= Pcd maxsize is %d \n" % (Pcd.GetPcdMaxSize(), Pcd.GetPcdMaxSize(), Pcd.Get= PcdMaxSize())=0D + CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); // The= Pcd maxsize is %d \n" % (=0D + Pcd.GetPcdMaxSize(), Pcd.GetPcdMaxSize(), Pcd.GetPcdMaxSiz= e())=0D ArraySizeByAssign =3D self.CalculateActualCap(ActualCap)=0D if ArraySizeByAssign > 1:=0D - CApp =3D CApp + " *Size =3D (%d > *Size ? %d : *Size); \n" % = (ArraySizeByAssign, ArraySizeByAssign)=0D + CApp =3D CApp + \=0D + " *Size =3D (%d > *Size ? %d : *Size); \n" % (ArraySizeBy= Assign,=0D + ArraySizeByAs= sign)=0D CApp =3D CApp + "}\n"=0D return CApp=0D - def CalculateActualCap(self,ActualCap):=0D +=0D + def CalculateActualCap(self, ActualCap):=0D if not ActualCap:=0D return 1=0D maxsize =3D 1=0D @@ -1986,22 +2189,23 @@ class DscBuildData(PlatformBuildClassObject): if not index_num:=0D # Not support flexiable pcd array assignment=0D return 1=0D - index_num =3D int(index_num,16) if index_num.startswith(("= 0x","0X")) else int(index_num)=0D + index_num =3D int(index_num, 16) if index_num.startswith(= =0D + ("0x", "0X")) else int(index_num)=0D rt =3D rt * (index_num+1)=0D - if rt >maxsize:=0D + if rt > maxsize:=0D maxsize =3D rt=0D =0D return maxsize=0D =0D @staticmethod=0D - def GenerateSizeStatments(Pcd,skuname,defaultstorename):=0D + def GenerateSizeStatments(Pcd, skuname, defaultstorename):=0D if Pcd.IsArray():=0D r_datatype =3D [Pcd.BaseDatumType]=0D lastoneisEmpty =3D False=0D for dem in Pcd.Capacity:=0D if lastoneisEmpty:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. " %=0D - (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName))))=0D + (".".join((Pcd.TokenSpaceGuidCName, Pc= d.TokenCName))))=0D if dem =3D=3D '0' or dem =3D=3D "-1":=0D r_datatype.append("[1]")=0D lastoneisEmpty =3D True=0D @@ -2009,45 +2213,54 @@ class DscBuildData(PlatformBuildClassObject): r_datatype.append("[" + dem + "]")=0D =0D if Pcd.Type in [MODEL_PCD_DYNAMIC_EX_HII, MODEL_PCD_DYNAMIC_HI= I]:=0D - PcdDefValue =3D Pcd.SkuInfoList.get(skuname).DefaultStoreD= ict.get(defaultstorename)=0D - elif Pcd.Type in [MODEL_PCD_DYNAMIC_EX_DEFAULT,MODEL_PCD_DYNAM= IC_VPD,MODEL_PCD_DYNAMIC_DEFAULT,MODEL_PCD_DYNAMIC_EX_VPD]:=0D + PcdDefValue =3D Pcd.SkuInfoList.get(=0D + skuname).DefaultStoreDict.get(defaultstorename)=0D + elif Pcd.Type in [MODEL_PCD_DYNAMIC_EX_DEFAULT, MODEL_PCD_DYNA= MIC_VPD, MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_VPD]:=0D PcdDefValue =3D Pcd.SkuInfoList.get(skuname).DefaultValue= =0D else:=0D PcdDefValue =3D Pcd.DefaultValue=0D if lastoneisEmpty:=0D if "{CODE(" not in PcdDefValue:=0D - sizebasevalue_plus =3D "(%s / sizeof(%s) + 1)" % ((Dsc= BuildData.GetStructurePcdMaxSize(Pcd), Pcd.BaseDatumType))=0D - sizebasevalue =3D "(%s / sizeof(%s))" % ((DscBuildData= .GetStructurePcdMaxSize(Pcd), Pcd.BaseDatumType))=0D + sizebasevalue_plus =3D "(%s / sizeof(%s) + 1)" % (=0D + (DscBuildData.GetStructurePcdMaxSize(Pcd), Pcd.Bas= eDatumType))=0D + sizebasevalue =3D "(%s / sizeof(%s))" % (=0D + (DscBuildData.GetStructurePcdMaxSize(Pcd), Pcd.Bas= eDatumType))=0D sizeof =3D "sizeof(%s)" % Pcd.BaseDatumType=0D - CApp =3D ' int ArraySize =3D %s %% %s ? %s : %s ;\n' = % ( (DscBuildData.GetStructurePcdMaxSize(Pcd), sizeof, sizebasevalue_plus, = sizebasevalue))=0D + CApp =3D ' int ArraySize =3D %s %% %s ? %s : %s ;\n' = % (=0D + (DscBuildData.GetStructurePcdMaxSize(Pcd), sizeof,= sizebasevalue_plus, sizebasevalue))=0D CApp +=3D ' Size =3D ArraySize * sizeof(%s); \n' % Pc= d.BaseDatumType=0D else:=0D CApp =3D " Size =3D 0;\n"=0D else:=0D - CApp =3D ' Size =3D sizeof(%s);\n' % ("".join(r_datatype)= )=0D + CApp =3D ' Size =3D sizeof(%s);\n' % ("".join(r_datatype)= )=0D else:=0D CApp =3D ' Size =3D sizeof(%s);\n' % (Pcd.DatumType)=0D - CApp =3D CApp + ' Cal_%s_%s_Size(&Size);\n' % (Pcd.TokenSpaceGuid= CName, Pcd.TokenCName)=0D + CApp =3D CApp + \=0D + ' Cal_%s_%s_Size(&Size);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D return CApp=0D =0D - def GetIndicator(self,index,FieldName,Pcd):=0D + def GetIndicator(self, index, FieldName, Pcd):=0D def cleanupindex(indexstr):=0D return indexstr.strip("[").strip("]").strip()=0D index_elements =3D ArrayIndex.findall(index)=0D pcd_capacity =3D Pcd.Capacity=0D if index:=0D indicator =3D "(Pcd"=0D - if len(pcd_capacity)>2:=0D - for i in range(0,len(index_elements)):=0D + if len(pcd_capacity) > 2:=0D + for i in range(0, len(index_elements)):=0D index_ele =3D index_elements[i]=0D index_num =3D index_ele.strip("[").strip("]").strip()= =0D - if i =3D=3D len(index_elements) -2:=0D - indicator +=3D "+ %d*Size/sizeof(%s)/%d + %s)" %(i= nt(cleanupindex(index_elements[i+1])),Pcd.BaseDatumType,reduce(lambda x,y: = int(x)*int(y),pcd_capacity[:-1]), cleanupindex(index_elements[i]))=0D + if i =3D=3D len(index_elements) - 2:=0D + indicator +=3D "+ %d*Size/sizeof(%s)/%d + %s)" % (= int(cleanupindex(index_elements[i+1])), Pcd.BaseDatumType, reduce(=0D + lambda x, y: int(x)*int(y), pcd_capacity[:-1])= , cleanupindex(index_elements[i]))=0D break=0D else:=0D - indicator +=3D " + %d*%s*Size/sizeof(%s)/%d" %(int= (cleanupindex(index_elements[i])),reduce(lambda x,y: int(x)*int(y),pcd_capa= city[i+1:-1]),Pcd.BaseDatumType,reduce(lambda x,y: int(x)*int(y),pcd_capaci= ty[:-1]))=0D + indicator +=3D " + %d*%s*Size/sizeof(%s)/%d" % (in= t(cleanupindex(index_elements[i])), reduce(lambda x, y: int(=0D + x)*int(y), pcd_capacity[i+1:-1]), Pcd.BaseDatu= mType, reduce(lambda x, y: int(x)*int(y), pcd_capacity[:-1]))=0D elif len(pcd_capacity) =3D=3D 2:=0D - indicator +=3D "+ %d*Size/sizeof(%s)/%d + %s)" %(int(clean= upindex(index_elements[0])),Pcd.BaseDatumType,int(pcd_capacity[0]), index_e= lements[1].strip("[").strip("]").strip())=0D + indicator +=3D "+ %d*Size/sizeof(%s)/%d + %s)" % (int(clea= nupindex(index_elements[0])), Pcd.BaseDatumType, int(=0D + pcd_capacity[0]), index_elements[1].strip("[").strip("= ]").strip())=0D elif len(pcd_capacity) =3D=3D 1:=0D index_ele =3D index_elements[0]=0D index_num =3D index_ele.strip("[").strip("]").strip()=0D @@ -2058,16 +2271,18 @@ class DscBuildData(PlatformBuildClassObject): indicator +=3D "->" + FieldName=0D return indicator=0D =0D - def GetStarNum(self,Pcd):=0D + def GetStarNum(self, Pcd):=0D if not Pcd.IsArray():=0D return 1=0D elif Pcd.IsSimpleTypeArray():=0D return len(Pcd.Capacity)=0D else:=0D return len(Pcd.Capacity) + 1=0D +=0D def GenerateDefaultValueAssignFunction(self, Pcd):=0D CApp =3D "// Default value in Dec \n"=0D - CApp =3D CApp + "void Assign_%s_%s_Default_Value(%s *Pcd){\n" % (P= cd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.BaseDatumType)=0D + CApp =3D CApp + "void Assign_%s_%s_Default_Value(%s *Pcd){\n" % (= =0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.BaseDatumType)=0D CApp =3D CApp + ' UINT32 FieldSize;\n'=0D CApp =3D CApp + ' CHAR8 *Value;\n'=0D CApp =3D CApp + ' UINT32 PcdArraySize;\n'=0D @@ -2075,12 +2290,13 @@ class DscBuildData(PlatformBuildClassObject): IsArray =3D _IsFieldValueAnArray(Pcd.DefaultValueFromDec)=0D if IsArray:=0D try:=0D - DefaultValueFromDec =3D ValueExpressionEx(Pcd.DefaultValue= FromDec, TAB_VOID)(True)=0D + DefaultValueFromDec =3D ValueExpressionEx(=0D + Pcd.DefaultValueFromDec, TAB_VOID)(True)=0D except BadExpression:=0D EdkLogger.error("Build", FORMAT_INVALID, "Invalid value fo= rmat for %s.%s, from DEC: %s" %=0D (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, = DefaultValueFromDec))=0D DefaultValueFromDec =3D StringToArray(DefaultValueFromDec)=0D - Value, ValueSize =3D ParseFieldValue (DefaultValueFromDec)=0D + Value, ValueSize =3D ParseFieldValue(DefaultValueFromDec)=0D if IsArray:=0D #=0D # Use memcpy() to copy value into field=0D @@ -2089,24 +2305,34 @@ class DscBuildData(PlatformBuildClassObject): pcdarraysize =3D Pcd.PcdArraySize()=0D if "{CODE(" in Pcd.DefaultValueFromDec:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_INIT= _Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capabil= ity %s"); // From %s Line %s \n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCNa= me,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName, Pcd.TokenCName,P= cd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])= =0D - CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_INIT_V= alue);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D - CApp =3D CApp + ' memcpy (Pcd, %s_%s_INIT_Value,PcdAr= raySize);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_INIT= _Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capabil= ity %s"); // From %s Line %s \n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, pcdar= raysize, Pcd.BaseDatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.Da= tumType, Pcd.DefaultValueFromDecInfo[0], Pcd.DefaultValueFromDecInfo[1])=0D + CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_INIT_V= alue);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + ' memcpy (Pcd, %s_%s_INIT_Value,PcdAr= raySize);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D else:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(%d < %d * sizeof(= %s), "Pcd %s.%s Value in Dec exceed the array capability %s"); // From %s L= ine %s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.Defaul= tValueFromDecInfo[1])=0D + CApp =3D CApp + '__STATIC_ASSERT(%d < %d * sizeof(= %s), "Pcd %s.%s Value in Dec exceed the array capability %s"); // From %s L= ine %s \n' % (=0D + ValueSize, pcdarraysize, Pcd.BaseDatumType, Pc= d.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, Pcd.DefaultValueFromD= ecInfo[0], Pcd.DefaultValueFromDecInfo[1])=0D CApp =3D CApp + ' PcdArraySize =3D %d;\n' % ValueSize= =0D - CApp =3D CApp + ' Value =3D %s; // From DEC Defau= lt Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultV= alueFromDec)=0D + CApp =3D CApp + ' Value =3D %s; // From DEC Defau= lt Value %s\n' % (=0D + DscBuildData.IntToCString(Value, ValueSize), Pcd.D= efaultValueFromDec)=0D CApp =3D CApp + ' memcpy (Pcd, Value, PcdArraySize);\= n'=0D else:=0D if "{CODE(" in Pcd.DefaultValueFromDec:=0D - CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_INIT_= Value);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D - CApp =3D CApp + ' memcpy (Pcd, &%s_%s_INIT_Value,PcdA= rraySize);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_INIT_= Value);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + ' memcpy (Pcd, &%s_%s_INIT_Value,PcdA= rraySize);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D else:=0D - CApp =3D CApp + ' Value =3D %s; // From DEC Defau= lt Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.DefaultV= alueFromDec)=0D + CApp =3D CApp + ' Value =3D %s; // From DEC Defau= lt Value %s\n' % (=0D + DscBuildData.IntToCString(Value, ValueSize), Pcd.D= efaultValueFromDec)=0D CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Valu= eSize)=0D elif isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd =3D %s; // From DEC Default Value %s\n'= % (Value, Pcd.DefaultValueFromDec)=0D + CApp =3D CApp + \=0D + ' Pcd =3D %s; // From DEC Default Value %s\n' % (=0D + Value, Pcd.DefaultValueFromDec)=0D for index in Pcd.DefaultValues:=0D FieldList =3D Pcd.DefaultValues[index]=0D if not FieldList:=0D @@ -2115,100 +2341,128 @@ class DscBuildData(PlatformBuildClassObject): IsArray =3D _IsFieldValueAnArray(FieldList[FieldName][0])= =0D if IsArray:=0D try:=0D - FieldList[FieldName][0] =3D ValueExpressionEx(Fiel= dList[FieldName][0], TAB_VOID, self._GuidDict)(True)=0D + FieldList[FieldName][0] =3D ValueExpressionEx(=0D + FieldList[FieldName][0], TAB_VOID, self._GuidD= ict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName= ][2]))=0D =0D try:=0D - Value, ValueSize =3D ParseFieldValue (FieldList[FieldN= ame][0])=0D + Value, ValueSize =3D ParseFieldValue(FieldList[FieldNa= me][0])=0D except Exception:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName, Pc= d.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName][2]= ))=0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldNam= e)), FieldList[FieldName][1], FieldList[FieldName][2]))=0D =0D - indicator =3D self.GetIndicator(index, FieldName,Pcd)=0D + indicator =3D self.GetIndicator(index, FieldName, Pcd)=0D if IsArray:=0D #=0D # Use memcpy() to copy value into field=0D #=0D - CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, %s);= \n' % (Pcd.BaseDatumType, FieldName)=0D - CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList[Fie= ldName][1], FieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (Pcd.BaseDatumType, FieldNa= me, ValueSize, Pcd.BaseDatumType, FieldName, FieldList[FieldName][1], Field= List[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' memcpy (&%s, Value, (FieldSize > 0 = && FieldSize < %d) ? FieldSize : %d);\n' % (indicator, ValueSize, ValueSize= )=0D + CApp =3D CApp + \=0D + ' FieldSize =3D __FIELD_SIZE(%s, %s);\n' % (=0D + Pcd.BaseDatumType, FieldName)=0D + CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), FieldList[FieldName][1], FieldL= ist[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (=0D + Pcd.BaseDatumType, FieldName, ValueSize, Pcd.BaseD= atumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2], Fiel= dList[FieldName][0])=0D + CApp =3D CApp + ' memcpy (&%s, Value, (FieldSize > 0 = && FieldSize < %d) ? FieldSize : %d);\n' % (=0D + indicator, ValueSize, ValueSize)=0D elif isinstance(Value, str):=0D - CApp =3D CApp + ' %s =3D %s; // From %s Line %d Value= %s\n' % (indicator, Value, FieldList[FieldName][1], FieldList[FieldName][2= ], FieldList[FieldName][0])=0D + CApp =3D CApp + ' %s =3D %s; // From %s Line %d Value= %s\n' % (=0D + indicator, Value, FieldList[FieldName][1], FieldLi= st[FieldName][2], FieldList[FieldName][0])=0D else:=0D if '[' in FieldName and ']' in FieldName:=0D Index =3D int(FieldName.split('[')[1].split(']')[0= ])=0D - CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (Index, FieldName.spli= t('[')[0], FieldName.split('[')[0], FieldList[FieldName][1], FieldList[Fiel= dName][2], FieldName)=0D + CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (=0D + Index, FieldName.split('[')[0], FieldName.spli= t('[')[0], FieldList[FieldName][1], FieldList[FieldName][2], FieldName)=0D if ValueSize > 4:=0D - CApp =3D CApp + ' %s =3D %dULL; // From %s Line %= d Value %s\n' % (indicator, Value, FieldList[FieldName][1], FieldList[Field= Name][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' %s =3D %dULL; // From %s Line %= d Value %s\n' % (=0D + indicator, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D else:=0D - CApp =3D CApp + ' %s =3D %d; // From %s Line %d V= alue %s\n' % (indicator, Value, FieldList[FieldName][1], FieldList[FieldNam= e][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' %s =3D %d; // From %s Line %d V= alue %s\n' % (=0D + indicator, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D CApp =3D CApp + "}\n"=0D return CApp=0D =0D @staticmethod=0D def GenerateDefaultValueAssignStatement(Pcd):=0D - CApp =3D ' Assign_%s_%s_Default_Value(Pcd);\n' % (Pcd.TokenSpaceG= uidCName, Pcd.TokenCName)=0D + CApp =3D ' Assign_%s_%s_Default_Value(Pcd);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D return CApp=0D =0D - def GetPcdDscRawDefaultValue(self,Pcd, SkuName,DefaultStoreName):=0D + def GetPcdDscRawDefaultValue(self, Pcd, SkuName, DefaultStoreName):=0D if Pcd.Type in PCD_DYNAMIC_TYPE_SET or Pcd.Type in PCD_DYNAMIC_EX_= TYPE_SET:=0D if (SkuName, DefaultStoreName) =3D=3D (TAB_DEFAULT, TAB_DEFAUL= T_STORES_DEFAULT):=0D - pcddefaultvalue =3D Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}= ).get(TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else None=0D + pcddefaultvalue =3D Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}= ).get(=0D + TAB_DEFAULT_STORES_DEFAULT) if Pcd.DefaultFromDSC else= None=0D else:=0D - pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName, {}).get(D= efaultStoreName)=0D + pcddefaultvalue =3D Pcd.DscRawValue.get(=0D + SkuName, {}).get(DefaultStoreName)=0D else:=0D - pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName, {}).get(TAB_D= EFAULT_STORES_DEFAULT)=0D + pcddefaultvalue =3D Pcd.DscRawValue.get(=0D + SkuName, {}).get(TAB_DEFAULT_STORES_DEFAULT)=0D =0D return pcddefaultvalue=0D - def GetPcdDscRawValueInfo(self,Pcd, SkuName,DefaultStoreName):=0D - DscValueInfo =3D Pcd.DscRawValueInfo.get(SkuName, {}).get(DefaultS= toreName)=0D +=0D + def GetPcdDscRawValueInfo(self, Pcd, SkuName, DefaultStoreName):=0D + DscValueInfo =3D Pcd.DscRawValueInfo.get(=0D + SkuName, {}).get(DefaultStoreName)=0D if DscValueInfo:=0D - dscfilepath,lineno =3D DscValueInfo=0D + dscfilepath, lineno =3D DscValueInfo=0D else:=0D dscfilepath =3D self.MetaFile.File=0D lineno =3D ""=0D - return dscfilepath,lineno=0D + return dscfilepath, lineno=0D =0D def GenerateInitValueFunction(self, Pcd, SkuName, DefaultStoreName):=0D - CApp =3D "// Value in Dsc for Sku: %s, DefaultStore %s\n" % (SkuNa= me, DefaultStoreName)=0D - CApp =3D CApp + "void Assign_%s_%s_%s_%s_Value(%s *Pcd){\n" % (Pcd= .TokenSpaceGuidCName, Pcd.TokenCName, SkuName, DefaultStoreName, Pcd.BaseDa= tumType)=0D + CApp =3D "// Value in Dsc for Sku: %s, DefaultStore %s\n" % (=0D + SkuName, DefaultStoreName)=0D + CApp =3D CApp + "void Assign_%s_%s_%s_%s_Value(%s *Pcd){\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuName, DefaultStore= Name, Pcd.BaseDatumType)=0D CApp =3D CApp + ' UINT32 FieldSize;\n'=0D CApp =3D CApp + ' CHAR8 *Value;\n'=0D CApp =3D CApp + ' UINT32 PcdArraySize;\n'=0D =0D - CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % (TAB_= DEFAULT, TAB_DEFAULT_STORES_DEFAULT)=0D + CApp =3D CApp + \=0D + "// SkuName: %s, DefaultStoreName: %s \n" % (=0D + TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)=0D inherit_OverrideValues =3D Pcd.SkuOverrideValues[SkuName]=0D - dscfilepath,lineno =3D self.GetPcdDscRawValueInfo(Pcd, SkuName, De= faultStoreName)=0D + dscfilepath, lineno =3D self.GetPcdDscRawValueInfo(=0D + Pcd, SkuName, DefaultStoreName)=0D if lineno:=0D - valuefrom =3D "%s Line %s" % (dscfilepath,str(lineno))=0D + valuefrom =3D "%s Line %s" % (dscfilepath, str(lineno))=0D else:=0D valuefrom =3D dscfilepath=0D =0D - pcddefaultvalue =3D self.GetPcdDscRawDefaultValue(Pcd, SkuName, De= faultStoreName)=0D + pcddefaultvalue =3D self.GetPcdDscRawDefaultValue(=0D + Pcd, SkuName, DefaultStoreName)=0D if pcddefaultvalue:=0D FieldList =3D pcddefaultvalue=0D IsArray =3D _IsFieldValueAnArray(FieldList)=0D if IsArray:=0D if "{CODE(" not in FieldList:=0D try:=0D - FieldList =3D ValueExpressionEx(FieldList, TAB_VOI= D)(True)=0D + FieldList =3D ValueExpressionEx(=0D + FieldList, TAB_VOID)(True)=0D except BadExpression:=0D EdkLogger.error("Build", FORMAT_INVALID, "Invalid = value format for %s.%s, from DSC: %s" %=0D (Pcd.TokenSpaceGuidCName, Pcd.Toke= nCName, FieldList))=0D - Value, ValueSize =3D ParseFieldValue (FieldList)=0D + Value, ValueSize =3D ParseFieldValue(FieldList)=0D =0D if (SkuName, DefaultStoreName) =3D=3D (TAB_DEFAULT, TAB_DEFAUL= T_STORES_DEFAULT):=0D if isinstance(Value, str):=0D if "{CODE(" in Value:=0D if Pcd.IsArray() and Pcd.Capacity[-1] !=3D "-1":=0D pcdarraysize =3D Pcd.PcdArraySize()=0D - CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_= %s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array ca= pability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Sk= uName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName,Pcd.DatumType, valuefrom)=0D - CApp =3D CApp+ ' PcdArraySize =3D sizeof(%s_%s_%s_= %s_Value);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultS= toreName)=0D - CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value= ,PcdArraySize);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, Def= aultStoreName)=0D + CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_= %s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array ca= pability %s"); // From %s \n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName, pcdarraysize, Pcd.BaseDatumType, Pcd.TokenSpaceGu= idCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D + CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_%s= _%s_Value);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuNa= me, DefaultStoreName)=0D + CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value= ,PcdArraySize);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuNa= me, DefaultStoreName)=0D else:=0D - CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (Value, Pcd.DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFA= ULT_STORES_DEFAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.Defaul= tValue)=0D + CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (Value, Pcd.DefaultFromDSC.get(=0D + TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAUL= T, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D elif IsArray:=0D #=0D # Use memcpy() to copy value into field=0D @@ -2217,32 +2471,46 @@ class DscBuildData(PlatformBuildClassObject): pcdarraysize =3D Pcd.PcdArraySize()=0D if "{CODE(" in pcddefaultvalue:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s= _%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the arra= y capability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCNa= me,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceG= uidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)=0D - CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%= s_%s_%s_Value);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, Def= aultStoreName)=0D - CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Va= lue, PcdArraySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, = DefaultStoreName)=0D + CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s= _%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the arra= y capability %s"); // From %s \n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e, SkuName, DefaultStoreName, pcdarraysize, Pcd.BaseDatumType, Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D + CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%= s_%s_%s_Value);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D + CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Va= lue, PcdArraySize);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D else:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(%d < %d *= sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array capability %s"); // F= rom %s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName,Pcd.DatumType,valuefrom)=0D + CApp =3D CApp + '__STATIC_ASSERT(%d < %d *= sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array capability %s"); // F= rom %s \n' % (=0D + ValueSize, pcdarraysize, Pcd.BaseDatum= Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D CApp =3D CApp + ' PcdArraySize =3D %d;\n' % Va= lueSize=0D - CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.Def= aultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D - CApp =3D CApp + ' memcpy (Pcd, Value, PcdArra= ySize);\n'=0D + CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DefaultFromDSC.get(=0D + TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DE= FAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D + CApp =3D CApp + \=0D + ' memcpy (Pcd, Value, PcdArraySize);\n'=0D else:=0D if "{CODE(" in pcddefaultvalue:=0D - CApp =3D CApp + ' PcdArraySize =3D %d < sizeo= f(%s) * %d ? %d: sizeof(%s) * %d;\n ' % (ValueSize,Pcd.BaseDatumType,pcdarr= aysize,ValueSize,Pcd.BaseDatumType,pcdarraysize)=0D - CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_V= alue, PcdArraySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName,= DefaultStoreName)=0D + CApp =3D CApp + ' PcdArraySize =3D %d < sizeo= f(%s) * %d ? %d: sizeof(%s) * %d;\n ' % (=0D + ValueSize, Pcd.BaseDatumType, pcdarraysize= , ValueSize, Pcd.BaseDatumType, pcdarraysize)=0D + CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_V= alue, PcdArraySize);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D else:=0D - CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DefaultFromDSC.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.Def= aultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D - CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n'= % (ValueSize)=0D + CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DefaultFromDSC.get(=0D + TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DE= FAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D + CApp =3D CApp + \=0D + ' memcpy (Pcd, Value, %d);\n' % (ValueSiz= e)=0D else:=0D if isinstance(Value, str):=0D if "{CODE(" in Value:=0D if Pcd.IsArray() and Pcd.Capacity[-1] !=3D "-1":=0D pcdarraysize =3D Pcd.PcdArraySize()=0D - CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_= %s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array ca= pability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,Sk= uName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName,Pcd.DatumType,valuefrom)=0D - CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_%s= _%s_Value);\n '% (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultS= toreName)=0D - CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value= , PcdArraySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, Def= aultStoreName)=0D + CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s_%s_= %s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array ca= pability %s"); // From %s \n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName, pcdarraysize, Pcd.BaseDatumType, Pcd.TokenSpaceGu= idCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D + CApp =3D CApp + ' PcdArraySize =3D sizeof(%s_%s_%s= _%s_Value);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuNa= me, DefaultStoreName)=0D + CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_Value= , PcdArraySize);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuNa= me, DefaultStoreName)=0D else:=0D - CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (Value, Pcd.DscRawValue.get(SkuName, {}).get(DefaultStoreNam= e))=0D + CApp =3D CApp + ' Pcd =3D %s; // From DSC Default= Value %s\n' % (=0D + Value, Pcd.DscRawValue.get(SkuName, {}).get(De= faultStoreName))=0D elif IsArray:=0D #=0D # Use memcpy() to copy value into field=0D @@ -2251,22 +2519,32 @@ class DscBuildData(PlatformBuildClassObject): pcdarraysize =3D Pcd.PcdArraySize()=0D if "{CODE(" in pcddefaultvalue:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s= _%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the arra= y capability %s"); // From %s \n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCNa= me,SkuName, DefaultStoreName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceG= uidCName, Pcd.TokenCName,Pcd.DatumType,valuefrom)=0D - CApp + ' PcdArraySize =3D sizeof(%s_%s_%s_%s_V= alue);\n ' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, DefaultStore= Name)=0D - CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Va= lue, PcdArraySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName, = DefaultStoreName)=0D + CApp =3D CApp + '__STATIC_ASSERT(sizeof(%s= _%s_%s_%s_Value) < %d * sizeof(%s), "Pcd %s.%s Value in Dsc exceed the arra= y capability %s"); // From %s \n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e, SkuName, DefaultStoreName, pcdarraysize, Pcd.BaseDatumType, Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D + CApp + ' PcdArraySize =3D sizeof(%s_%s_%s_%s_V= alue);\n ' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D + CApp =3D CApp + ' memcpy (Pcd, %s_%s_%s_%s_Va= lue, PcdArraySize);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D else:=0D if Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + '__STATIC_ASSERT(%d < %d *= sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array capability %s"); // F= rom %s \n' % (ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName,Pcd.DatumType,valuefrom)=0D + CApp =3D CApp + '__STATIC_ASSERT(%d < %d *= sizeof(%s), "Pcd %s.%s Value in Dsc exceed the array capability %s"); // F= rom %s \n' % (=0D + ValueSize, pcdarraysize, Pcd.BaseDatum= Type, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, valuefrom)=0D CApp =3D CApp + ' PcdArraySize =3D %d;\n' % Va= lueSize=0D - CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DscRawValue.get(TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DEFAULT, Pcd.Defaul= tValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D - CApp =3D CApp + ' memcpy (Pcd, Value, PcdArra= ySize);\n'=0D + CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DscRawValue.get(=0D + TAB_DEFAULT, {}).get(TAB_DEFAULT_STORES_DE= FAULT, Pcd.DefaultValue) if Pcd.DefaultFromDSC else Pcd.DefaultValue)=0D + CApp =3D CApp + \=0D + ' memcpy (Pcd, Value, PcdArraySize);\n'=0D else:=0D if "{CODE(" in pcddefaultvalue:=0D - CApp =3D CApp + ' PcdArraySize =3D %d < sizeo= f(%s) * %d ? %d: sizeof(%s) * %d;\n ' % (ValueSize,Pcd.BaseDatumType,pcdarr= aysize,ValueSize,Pcd.BaseDatumType,pcdarraysize)=0D - CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_V= alue, PcdArraySize);\n' % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName,SkuName,= DefaultStoreName)=0D + CApp =3D CApp + ' PcdArraySize =3D %d < sizeo= f(%s) * %d ? %d: sizeof(%s) * %d;\n ' % (=0D + ValueSize, Pcd.BaseDatumType, pcdarraysize= , ValueSize, Pcd.BaseDatumType, pcdarraysize)=0D + CApp =3D CApp + ' memcpy (Pcd, &%s_%s_%s_%s_V= alue, PcdArraySize);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, S= kuName, DefaultStoreName)=0D else:=0D - CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), Pcd.= DscRawValue.get(SkuName, {}).get(DefaultStoreName))=0D - CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n'= % (ValueSize)=0D + CApp =3D CApp + ' Value =3D %s; // From D= SC Default Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), Pcd.DscRawValue.get(Sku= Name, {}).get(DefaultStoreName))=0D + CApp =3D CApp + \=0D + ' memcpy (Pcd, Value, %d);\n' % (ValueSiz= e)=0D =0D inheritvalue =3D inherit_OverrideValues.get(DefaultStoreName)=0D if not inheritvalue:=0D @@ -2275,49 +2553,63 @@ class DscBuildData(PlatformBuildClassObject): FieldList =3D inheritvalue[index]=0D if not FieldList:=0D continue=0D - if (SkuName, DefaultStoreName) =3D=3D (TAB_DEFAULT, TAB_DEFAUL= T_STORES_DEFAULT) or (( (SkuName, '') not in Pcd.ValueChain) and ( (SkuName= , DefaultStoreName) not in Pcd.ValueChain )):=0D + if (SkuName, DefaultStoreName) =3D=3D (TAB_DEFAULT, TAB_DEFAUL= T_STORES_DEFAULT) or (((SkuName, '') not in Pcd.ValueChain) and ((SkuName, = DefaultStoreName) not in Pcd.ValueChain)):=0D for FieldName in FieldList:=0D - indicator =3D self.GetIndicator(index, FieldName,Pcd)= =0D + indicator =3D self.GetIndicator(index, FieldName, Pcd)= =0D IsArray =3D _IsFieldValueAnArray(FieldList[FieldName][= 0])=0D if IsArray:=0D try:=0D - FieldList[FieldName][0] =3D ValueExpressionEx(= FieldList[FieldName][0], TAB_VOID, self._GuidDict)(True)=0D + FieldList[FieldName][0] =3D ValueExpressionEx(= =0D + FieldList[FieldName][0], TAB_VOID, self._G= uidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Inva= lid value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[Field= Name][2]))=0D try:=0D - Value, ValueSize =3D ParseFieldValue (FieldList[Fi= eldName][0])=0D + Value, ValueSize =3D ParseFieldValue(=0D + FieldList[FieldName][0])=0D except Exception:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName= ][2]))=0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " % (".".join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Fiel= dName)), FieldList[FieldName][1], FieldList[FieldName][2]))=0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line= %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line= %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, = %s);\n' % (Pcd.BaseDatumType, FieldName)=0D - CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList= [FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%= s, %s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds t= he buffer array"); // From %s Line %d Value %s\n' % (Pcd.BaseDatumType, Fie= ldName, ValueSize, Pcd.BaseDatumType, FieldName, FieldList[FieldName][1], F= ieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' memcpy (&%s, Value, (FieldSize = > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (indicator, ValueSize, Value= Size)=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + \=0D + ' FieldSize =3D __FIELD_SIZE(%s, %s);\n' % (= =0D + Pcd.BaseDatumType, FieldName)=0D + CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), FieldList[FieldName][1], Fi= eldList[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%= s, %s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds t= he buffer array"); // From %s Line %d Value %s\n' % (=0D + Pcd.BaseDatumType, FieldName, ValueSize, Pcd.B= aseDatumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2], = FieldList[FieldName][0])=0D + CApp =3D CApp + ' memcpy (&%s, Value, (FieldSize = > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (=0D + indicator, ValueSize, ValueSize)=0D else:=0D if '[' in FieldName and ']' in FieldName:=0D Index =3D int(FieldName.split('[')[1].split(']= ')[0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARR= AY_SIZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds= the array number"); // From %s Line %d Index of %s\n' % (Index, FieldName.= split('[')[0], FieldName.split('[')[0], FieldList[FieldName][1], FieldList[= FieldName][2], FieldName)=0D + CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARR= AY_SIZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds= the array number"); // From %s Line %d Index of %s\n' % (=0D + Index, FieldName.split('[')[0], FieldName.= split('[')[0], FieldList[FieldName][1], FieldList[FieldName][2], FieldName)= =0D if ValueSize > 4:=0D - CApp =3D CApp + ' %s =3D %dULL; // From %s Li= ne %d Value %s\n' % (indicator, Value, FieldList[FieldName][1], FieldList[F= ieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' %s =3D %dULL; // From %s Li= ne %d Value %s\n' % (=0D + indicator, Value, FieldList[FieldName][1],= FieldList[FieldName][2], FieldList[FieldName][0])=0D else:=0D - CApp =3D CApp + ' %s =3D %d; // From %s Line = %d Value %s\n' % (indicator, Value, FieldList[FieldName][1], FieldList[Fiel= dName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' %s =3D %d; // From %s Line = %d Value %s\n' % (=0D + indicator, Value, FieldList[FieldName][1],= FieldList[FieldName][2], FieldList[FieldName][0])=0D CApp =3D CApp + "}\n"=0D return CApp=0D =0D @staticmethod=0D def GenerateInitValueStatement(Pcd, SkuName, DefaultStoreName):=0D - CApp =3D ' Assign_%s_%s_%s_%s_Value(Pcd);\n' % (Pcd.TokenSpaceGui= dCName, Pcd.TokenCName, SkuName, DefaultStoreName)=0D + CApp =3D ' Assign_%s_%s_%s_%s_Value(Pcd);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, SkuName, DefaultStore= Name)=0D return CApp=0D =0D def GenerateCommandLineValue(self, Pcd):=0D CApp =3D "// Value in CommandLine\n"=0D - CApp =3D CApp + "void Assign_%s_%s_CommandLine_Value(%s *Pcd){\n" = % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.BaseDatumType)=0D + CApp =3D CApp + "void Assign_%s_%s_CommandLine_Value(%s *Pcd){\n" = % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.BaseDatumType)=0D CApp =3D CApp + ' UINT32 FieldSize;\n'=0D CApp =3D CApp + ' CHAR8 *Value;\n'=0D =0D @@ -2329,53 +2621,67 @@ class DscBuildData(PlatformBuildClassObject): IsArray =3D _IsFieldValueAnArray(FieldList)=0D if IsArray:=0D try:=0D - FieldList =3D ValueExpressionEx(FieldList, TAB_VOI= D)(True)=0D + FieldList =3D ValueExpressionEx(=0D + FieldList, TAB_VOID)(True)=0D except BadExpression:=0D EdkLogger.error("Build", FORMAT_INVALID, "Invalid = value format for %s.%s, from Command: %s" %=0D (Pcd.TokenSpaceGuidCName, Pcd.Toke= nCName, FieldList))=0D - Value, ValueSize =3D ParseFieldValue (FieldList)=0D + Value, ValueSize =3D ParseFieldValue(FieldList)=0D =0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd =3D %s; // From Command Line \n= ' % (Value)=0D + CApp =3D CApp + \=0D + ' Pcd =3D %s; // From Command Line \n' % (Value)= =0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' Value =3D %s; // From Command L= ine.\n' % (DscBuildData.IntToCString(Value, ValueSize))=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + ' Value =3D %s; // From Command L= ine.\n' % (=0D + DscBuildData.IntToCString(Value, ValueSize))=0D CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Valu= eSize)=0D continue=0D for FieldName in FieldList:=0D IsArray =3D _IsFieldValueAnArray(FieldList[FieldName][0])= =0D if IsArray:=0D try:=0D - FieldList[FieldName][0] =3D ValueExpressionEx(Fiel= dList[FieldName][0], TAB_VOID, self._GuidDict)(True)=0D + FieldList[FieldName][0] =3D ValueExpressionEx(=0D + FieldList[FieldName][0], TAB_VOID, self._GuidD= ict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName= ][2]))=0D except:=0D print("error")=0D try:=0D - Value, ValueSize =3D ParseFieldValue (FieldList[FieldN= ame][0])=0D + Value, ValueSize =3D ParseFieldValue(FieldList[FieldNa= me][0])=0D except Exception:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName, Pc= d.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName][2]= ))=0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldNam= e)), FieldList[FieldName][1], FieldList[FieldName][2]))=0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line %d = Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldNa= me][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line %d = Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], FieldLi= st[FieldName][2], FieldList[FieldName][0])=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, %s);= \n' % (Pcd.BaseDatumType, FieldName)=0D - CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList[Fie= ldName][1], FieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (Pcd.BaseDatumType, FieldNa= me, ValueSize, Pcd.BaseDatumType, FieldName, FieldList[FieldName][1], Field= List[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, Valu= eSize)=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + \=0D + ' FieldSize =3D __FIELD_SIZE(%s, %s);\n' % (=0D + Pcd.BaseDatumType, FieldName)=0D + CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), FieldList[FieldName][1], FieldL= ist[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (=0D + Pcd.BaseDatumType, FieldName, ValueSize, Pcd.BaseD= atumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2], Fiel= dList[FieldName][0])=0D + CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (=0D + FieldName, ValueSize, ValueSize)=0D else:=0D if '[' in FieldName and ']' in FieldName:=0D Index =3D int(FieldName.split('[')[1].split(']')[0= ])=0D - CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (Index, FieldName.spli= t('[')[0], FieldName.split('[')[0], FieldList[FieldName][1], FieldList[Fiel= dName][2], FieldName)=0D + CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (=0D + Index, FieldName.split('[')[0], FieldName.spli= t('[')[0], FieldList[FieldName][1], FieldList[FieldName][2], FieldName)=0D if ValueSize > 4:=0D - CApp =3D CApp + ' Pcd->%s =3D %dULL; // From %s L= ine %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[= FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %dULL; // From %s L= ine %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D else:=0D - CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D CApp =3D CApp + "}\n"=0D return CApp=0D =0D @@ -2383,31 +2689,36 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D "// Value in Dsc Module scope \n"=0D for ModuleGuid in Pcd.PcdFiledValueFromDscComponent:=0D =0D - CApp =3D CApp + "void Assign_%s_%s_%s_Value(%s *Pcd){\n" % (Pc= d.TokenSpaceGuidCName, Pcd.TokenCName, ModuleGuid,Pcd.BaseDatumType)=0D + CApp =3D CApp + "void Assign_%s_%s_%s_Value(%s *Pcd){\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, ModuleGuid, Pcd.B= aseDatumType)=0D CApp =3D CApp + ' UINT32 FieldSize;\n'=0D CApp =3D CApp + ' CHAR8 *Value;\n'=0D - pcddefaultvalue, file_path,lineNo =3D Pcd.PcdValueFromComponen= ts.get(ModuleGuid,(None,None,None))=0D + pcddefaultvalue, file_path, lineNo =3D Pcd.PcdValueFromCompone= nts.get(=0D + ModuleGuid, (None, None, None))=0D =0D if pcddefaultvalue:=0D IsArray =3D _IsFieldValueAnArray(pcddefaultvalue)=0D if IsArray:=0D try:=0D - FieldList =3D ValueExpressionEx(pcddefaultvalue, T= AB_VOID)(True)=0D + FieldList =3D ValueExpressionEx(=0D + pcddefaultvalue, TAB_VOID)(True)=0D except BadExpression:=0D EdkLogger.error("Build", FORMAT_INVALID, "Invalid = value format for %s.%s, from %s Line %s: %s" %=0D (Pcd.TokenSpaceGuidCName, Pcd.Toke= nCName, file_path, lineNo, FieldList))=0D - Value, ValueSize =3D ParseFieldValue (FieldList)=0D + Value, ValueSize =3D ParseFieldValue(FieldList)=0D =0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd =3D %s; // From %s Line %s \n' = % (Value, file_path, lineNo)=0D + CApp =3D CApp + \=0D + ' Pcd =3D %s; // From %s Line %s \n' % (=0D + Value, file_path, lineNo)=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' Value =3D %s; // From %s Line %= s.\n' % (DscBuildData.IntToCString(Value, ValueSize), file_path, lineNo)=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + ' Value =3D %s; // From %s Line %= s.\n' % (=0D + DscBuildData.IntToCString(Value, ValueSize), file_= path, lineNo)=0D CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Valu= eSize)=0D =0D -=0D PcdFiledValue =3D Pcd.PcdFiledValueFromDscComponent.get(Module= Guid)=0D for index in PcdFiledValue:=0D FieldList =3D PcdFiledValue[index]=0D @@ -2417,118 +2728,151 @@ class DscBuildData(PlatformBuildClassObject): IsArray =3D _IsFieldValueAnArray(FieldList[FieldName][= 0])=0D if IsArray:=0D try:=0D - FieldList[FieldName][0] =3D ValueExpressionEx(= FieldList[FieldName][0], TAB_VOID, self._GuidDict)(True)=0D + FieldList[FieldName][0] =3D ValueExpressionEx(= =0D + FieldList[FieldName][0], TAB_VOID, self._G= uidDict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Inva= lid value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[Field= Name][2]))=0D except:=0D print("error")=0D try:=0D - Value, ValueSize =3D ParseFieldValue (FieldList[Fi= eldName][0])=0D + Value, ValueSize =3D ParseFieldValue(=0D + FieldList[FieldName][0])=0D except Exception:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName= ][2]))=0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " % (".".join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Fiel= dName)), FieldList[FieldName][1], FieldList[FieldName][2]))=0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line= %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line= %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, = %s);\n' % (Pcd.BaseDatumType, FieldName)=0D - CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList= [FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%= s, %s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds t= he buffer array"); // From %s Line %d Value %s\n' % (Pcd.BaseDatumType, Fie= ldName, ValueSize, Pcd.BaseDatumType, FieldName, FieldList[FieldName][1], F= ieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (Field= Size > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, = ValueSize)=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + \=0D + ' FieldSize =3D __FIELD_SIZE(%s, %s);\n' % (= =0D + Pcd.BaseDatumType, FieldName)=0D + CApp =3D CApp + ' Value =3D %s; // From %s Li= ne %d Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), FieldList[FieldName][1], Fi= eldList[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%= s, %s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds t= he buffer array"); // From %s Line %d Value %s\n' % (=0D + Pcd.BaseDatumType, FieldName, ValueSize, Pcd.B= aseDatumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2], = FieldList[FieldName][0])=0D + CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (Field= Size > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (=0D + FieldName, ValueSize, ValueSize)=0D else:=0D if '[' in FieldName and ']' in FieldName:=0D Index =3D int(FieldName.split('[')[1].split(']= ')[0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARR= AY_SIZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds= the array number"); // From %s Line %d Index of %s\n' % (Index, FieldName.= split('[')[0], FieldName.split('[')[0], FieldList[FieldName][1], FieldList[= FieldName][2], FieldName)=0D + CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARR= AY_SIZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds= the array number"); // From %s Line %d Index of %s\n' % (=0D + Index, FieldName.split('[')[0], FieldName.= split('[')[0], FieldList[FieldName][1], FieldList[FieldName][2], FieldName)= =0D if ValueSize > 4:=0D - CApp =3D CApp + ' Pcd->%s =3D %dULL; // From = %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldL= ist[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %dULL; // From = %s Line %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1],= FieldList[FieldName][2], FieldList[FieldName][0])=0D else:=0D - CApp =3D CApp + ' Pcd->%s =3D %d; // From %s = Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList= [FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %d; // From %s = Line %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1],= FieldList[FieldName][2], FieldList[FieldName][0])=0D CApp =3D CApp + "}\n"=0D return CApp=0D =0D @staticmethod=0D def GenerateCommandLineValueStatement(Pcd):=0D - CApp =3D ' Assign_%s_%s_CommandLine_Value(Pcd);\n' % (Pcd.TokenSp= aceGuidCName, Pcd.TokenCName)=0D + CApp =3D ' Assign_%s_%s_CommandLine_Value(Pcd);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D return CApp=0D - def GenerateFdfValue(self,Pcd):=0D +=0D + def GenerateFdfValue(self, Pcd):=0D CApp =3D "// Value in Fdf\n"=0D - CApp =3D CApp + "void Assign_%s_%s_Fdf_Value(%s *Pcd){\n" % (Pcd.T= okenSpaceGuidCName, Pcd.TokenCName,Pcd.BaseDatumType)=0D + CApp =3D CApp + "void Assign_%s_%s_Fdf_Value(%s *Pcd){\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.BaseDatumType)=0D CApp =3D CApp + ' UINT32 FieldSize;\n'=0D CApp =3D CApp + ' CHAR8 *Value;\n'=0D =0D pcddefaultvalue =3D Pcd.PcdValueFromFdf=0D - for FieldList in [pcddefaultvalue,Pcd.PcdFieldValueFromFdf]:=0D + for FieldList in [pcddefaultvalue, Pcd.PcdFieldValueFromFdf]:=0D if not FieldList:=0D continue=0D if pcddefaultvalue and FieldList =3D=3D pcddefaultvalue:=0D IsArray =3D _IsFieldValueAnArray(FieldList)=0D if IsArray:=0D try:=0D - FieldList =3D ValueExpressionEx(FieldList, TAB_VOI= D)(True)=0D + FieldList =3D ValueExpressionEx(=0D + FieldList, TAB_VOID)(True)=0D except BadExpression:=0D EdkLogger.error("Build", FORMAT_INVALID, "Invalid = value format for %s.%s, from Fdf: %s" %=0D (Pcd.TokenSpaceGuidCName, Pcd.Toke= nCName, FieldList))=0D - Value, ValueSize =3D ParseFieldValue (FieldList)=0D + Value, ValueSize =3D ParseFieldValue(FieldList)=0D =0D if isinstance(Value, str):=0D CApp =3D CApp + ' Pcd =3D %s; // From Fdf \n' % (Valu= e)=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' Value =3D %s; // From Fdf .\n' = % (DscBuildData.IntToCString(Value, ValueSize))=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + \=0D + ' Value =3D %s; // From Fdf .\n' % (=0D + DscBuildData.IntToCString(Value, ValueSize))=0D CApp =3D CApp + ' memcpy (Pcd, Value, %d);\n' % (Valu= eSize)=0D continue=0D for FieldName in FieldList:=0D IsArray =3D _IsFieldValueAnArray(FieldList[FieldName][0])= =0D if IsArray:=0D try:=0D - FieldList[FieldName][0] =3D ValueExpressionEx(Fiel= dList[FieldName][0], TAB_VOID, self._GuidDict)(True)=0D + FieldList[FieldName][0] =3D ValueExpressionEx(=0D + FieldList[FieldName][0], TAB_VOID, self._GuidD= ict)(True)=0D except BadExpression:=0D EdkLogger.error('Build', FORMAT_INVALID, "Invalid = value format for %s. From %s Line %d " %=0D (".".join((Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, FieldName)), FieldList[FieldName][1], FieldList[FieldName= ][2]))=0D except:=0D print("error")=0D try:=0D - Value, ValueSize =3D ParseFieldValue (FieldList[FieldN= ame][0])=0D + Value, ValueSize =3D ParseFieldValue(FieldList[FieldNa= me][0])=0D except Exception:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join((Pcd.TokenSpaceGuidCName,Pcd= .TokenCName,FieldName)),FieldList[FieldName][1], FieldList[FieldName][2]))= =0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid valu= e format for %s. From %s Line %d " % (".".join(=0D + (Pcd.TokenSpaceGuidCName, Pcd.TokenCName, FieldNam= e)), FieldList[FieldName][1], FieldList[FieldName][2]))=0D if isinstance(Value, str):=0D - CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line %d = Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldNa= me][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %s; // From %s Line %d = Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], FieldLi= st[FieldName][2], FieldList[FieldName][0])=0D elif IsArray:=0D - #=0D - # Use memcpy() to copy value into field=0D - #=0D - CApp =3D CApp + ' FieldSize =3D __FIELD_SIZE(%s, %s);= \n' % (Pcd.BaseDatumType, FieldName)=0D - CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(Value, ValueSize), FieldList[Fie= ldName][1], FieldList[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (Pcd.BaseDatumType, FieldNa= me, ValueSize, Pcd.BaseDatumType, FieldName, FieldList[FieldName][1], Field= List[FieldName][2], FieldList[FieldName][0])=0D - CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (FieldName, ValueSize, Valu= eSize)=0D + #=0D + # Use memcpy() to copy value into field=0D + #=0D + CApp =3D CApp + \=0D + ' FieldSize =3D __FIELD_SIZE(%s, %s);\n' % (=0D + Pcd.BaseDatumType, FieldName)=0D + CApp =3D CApp + ' Value =3D %s; // From %s Line %= d Value %s\n' % (DscBuildData.IntToCString(=0D + Value, ValueSize), FieldList[FieldName][1], FieldL= ist[FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' __STATIC_ASSERT((__FIELD_SIZE(%s, %= s) >=3D %d) || (__FIELD_SIZE(%s, %s) =3D=3D 0), "Input buffer exceeds the b= uffer array"); // From %s Line %d Value %s\n' % (=0D + Pcd.BaseDatumType, FieldName, ValueSize, Pcd.BaseD= atumType, FieldName, FieldList[FieldName][1], FieldList[FieldName][2], Fiel= dList[FieldName][0])=0D + CApp =3D CApp + ' memcpy (&Pcd->%s, Value, (FieldSize= > 0 && FieldSize < %d) ? FieldSize : %d);\n' % (=0D + FieldName, ValueSize, ValueSize)=0D else:=0D if '[' in FieldName and ']' in FieldName:=0D Index =3D int(FieldName.split('[')[1].split(']')[0= ])=0D - CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (Index, FieldName.spli= t('[')[0], FieldName.split('[')[0], FieldList[FieldName][1], FieldList[Fiel= dName][2], FieldName)=0D + CApp =3D CApp + ' __STATIC_ASSERT((%d < __ARRAY_S= IZE(Pcd->%s)) || (__ARRAY_SIZE(Pcd->%s) =3D=3D 0), "array index exceeds the= array number"); // From %s Line %d Index of %s\n' % (=0D + Index, FieldName.split('[')[0], FieldName.spli= t('[')[0], FieldList[FieldName][1], FieldList[FieldName][2], FieldName)=0D if ValueSize > 4:=0D - CApp =3D CApp + ' Pcd->%s =3D %dULL; // From %s L= ine %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[= FieldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %dULL; // From %s L= ine %d Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D else:=0D - CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %s Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[Fie= ldName][2], FieldList[FieldName][0])=0D + CApp =3D CApp + ' Pcd->%s =3D %d; // From %s Line= %s Value %s\n' % (=0D + FieldName, Value, FieldList[FieldName][1], Fie= ldList[FieldName][2], FieldList[FieldName][0])=0D CApp =3D CApp + "}\n"=0D return CApp=0D =0D @staticmethod=0D def GenerateFdfValueStatement(Pcd):=0D - CApp =3D ' Assign_%s_%s_Fdf_Value(Pcd);\n' % (Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName)=0D + CApp =3D ' Assign_%s_%s_Fdf_Value(Pcd);\n' % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D return CApp=0D =0D @staticmethod=0D def GenerateModuleValueStatement(module_guid, Pcd):=0D - CApp =3D " Assign_%s_%s_%s_Value(Pcd);\n" % (Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName, module_guid)=0D + CApp =3D " Assign_%s_%s_%s_Value(Pcd);\n" % (=0D + Pcd.TokenSpaceGuidCName, Pcd.TokenCName, module_guid)=0D return CApp=0D - def GenerateModuleScopeInitializeFunc(self,SkuName, Pcd, InitByteValu= e, CApp):=0D +=0D + def GenerateModuleScopeInitializeFunc(self, SkuName, Pcd, InitByteVal= ue, CApp):=0D for module_guid in Pcd.PcdFiledValueFromDscComponent:=0D CApp =3D CApp + 'void\n'=0D - CApp =3D CApp + 'Initialize_%s_%s_%s_%s(\n' % (module_guid, TA= B_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + 'Initialize_%s_%s_%s_%s(\n' % (=0D + module_guid, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGui= dCName, Pcd.TokenCName)=0D CApp =3D CApp + ' void\n'=0D CApp =3D CApp + ' )\n'=0D CApp =3D CApp + '{\n'=0D @@ -2538,16 +2882,19 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' UINT32 OriginalSize;\n'=0D CApp =3D CApp + ' VOID *OriginalPcd;\n'=0D =0D - CApp =3D CApp + ' %s *Pcd; // From %s Line %d \n' % (Pc= d.BaseDatumType,Pcd.PkgPath, Pcd.PcdDefineLineNo)=0D + CApp =3D CApp + ' %s *Pcd; // From %s Line %d \n' % (=0D + Pcd.BaseDatumType, Pcd.PkgPath, Pcd.PcdDefineLineNo)=0D =0D CApp =3D CApp + '\n'=0D =0D PcdDefaultValue =3D StringToArray(Pcd.DefaultValueFromDec.stri= p())=0D - InitByteValue +=3D '%s.%s.%s.%s|%s|%s\n' % (module_guid, TAB_D= EFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumTy= pe, PcdDefaultValue)=0D + InitByteValue +=3D '%s.%s.%s.%s|%s|%s\n' % (module_guid, TAB_D= EFAULT_STORES_DEFAULT,=0D + Pcd.TokenSpaceGuidCN= ame, Pcd.TokenCName, Pcd.DatumType, PcdDefaultValue)=0D #=0D # Get current PCD value and size=0D #=0D - CApp =3D CApp + ' OriginalPcd =3D PcdGetPtr (%s, %s, %s, %s, = &OriginalSize);\n' % (module_guid, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpa= ceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + ' OriginalPcd =3D PcdGetPtr (%s, %s, %s, %s, = &OriginalSize);\n' % (=0D + module_guid, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGui= dCName, Pcd.TokenCName)=0D =0D #=0D # Determine the size of the PCD. For simple structures, sizeo= f(TYPE) provides=0D @@ -2557,18 +2904,25 @@ class DscBuildData(PlatformBuildClassObject): # in a structure. The size formula for this case is:=0D # OFFSET_OF(FlexbleArrayField) + sizeof(FlexibleArray[0]) * (H= ighestIndex + 1)=0D #=0D - CApp =3D CApp + DscBuildData.GenerateSizeStatments(Pcd,SkuName= ,TAB_DEFAULT_STORES_DEFAULT)=0D + CApp =3D CApp + \=0D + DscBuildData.GenerateSizeStatments(=0D + Pcd, SkuName, TAB_DEFAULT_STORES_DEFAULT)=0D if Pcd.IsArray() and Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + ' OriginalSize =3D OriginalSize < sizeof(= %s) * %d? OriginalSize:sizeof(%s) * %d; \n' % (Pcd.BaseDatumType,Pcd.PcdArr= aySize(),Pcd.BaseDatumType,Pcd.PcdArraySize())=0D - CApp =3D CApp + ' Size =3D sizeof(%s) * %d; \n' % (Pcd.Ba= seDatumType,Pcd.PcdArraySize())=0D + CApp =3D CApp + ' OriginalSize =3D OriginalSize < sizeof(= %s) * %d? OriginalSize:sizeof(%s) * %d; \n' % (=0D + Pcd.BaseDatumType, Pcd.PcdArraySize(), Pcd.BaseDatumTy= pe, Pcd.PcdArraySize())=0D + CApp =3D CApp + \=0D + ' Size =3D sizeof(%s) * %d; \n' % (Pcd.BaseDatumType,= =0D + Pcd.PcdArraySize())= =0D =0D #=0D # Allocate and zero buffer for the PCD=0D # Must handle cases where current value is smaller, larger, or= same size=0D # Always keep that larger one as the current size=0D #=0D - CApp =3D CApp + ' Size =3D (OriginalSize > Size ? OriginalSiz= e : Size);\n'=0D - CApp =3D CApp + ' Pcd =3D (%s *)malloc (Size);\n' % (Pcd.= BaseDatumType,)=0D + CApp =3D CApp + \=0D + ' Size =3D (OriginalSize > Size ? OriginalSize : Size);\n= '=0D + CApp =3D CApp + \=0D + ' Pcd =3D (%s *)malloc (Size);\n' % (Pcd.BaseDatumTyp= e,)=0D CApp =3D CApp + ' memset (Pcd, 0, Size);\n'=0D =0D #=0D @@ -2582,15 +2936,18 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + DscBuildData.GenerateDefaultValueAssignStateme= nt(Pcd)=0D =0D CApp =3D CApp + "// SkuName: %s, DefaultStoreName: STANDARD \= n" % self.SkuIdMgr.SystemSkuId=0D - CApp =3D CApp + DscBuildData.GenerateInitValueStatement(Pcd, s= elf.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT)=0D - CApp =3D CApp + DscBuildData.GenerateModuleValueStatement(modu= le_guid,Pcd)=0D + CApp =3D CApp + DscBuildData.GenerateInitValueStatement(=0D + Pcd, self.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT= )=0D + CApp =3D CApp + \=0D + DscBuildData.GenerateModuleValueStatement(module_guid, Pcd= )=0D CApp =3D CApp + DscBuildData.GenerateFdfValueStatement(Pcd)=0D CApp =3D CApp + DscBuildData.GenerateCommandLineValueStatement= (Pcd)=0D =0D #=0D # Set new PCD value and size=0D #=0D - CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (void *)Pc= d);\n' % (module_guid, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName,= Pcd.TokenCName)=0D + CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (void *)Pc= d);\n' % (=0D + module_guid, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGui= dCName, Pcd.TokenCName)=0D =0D #=0D # Free PCD=0D @@ -2598,17 +2955,18 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' free (Pcd);\n'=0D CApp =3D CApp + '}\n'=0D CApp =3D CApp + '\n'=0D - return InitByteValue,CApp=0D + return InitByteValue, CApp=0D =0D def GenerateInitializeFunc(self, SkuName, DefaultStore, Pcd, InitByteV= alue, CApp):=0D - OverrideValues =3D {DefaultStore:{}}=0D + OverrideValues =3D {DefaultStore: {}}=0D if Pcd.SkuOverrideValues:=0D OverrideValues =3D Pcd.SkuOverrideValues[SkuName]=0D if not OverrideValues:=0D - OverrideValues =3D {TAB_DEFAULT_STORES_DEFAULT:Pcd.DefaultValu= es}=0D + OverrideValues =3D {TAB_DEFAULT_STORES_DEFAULT: Pcd.DefaultVal= ues}=0D for DefaultStoreName in OverrideValues:=0D CApp =3D CApp + 'void\n'=0D - CApp =3D CApp + 'Initialize_%s_%s_%s_%s(\n' % (SkuName, Defaul= tStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + 'Initialize_%s_%s_%s_%s(\n' % (=0D + SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName)=0D CApp =3D CApp + ' void\n'=0D CApp =3D CApp + ' )\n'=0D CApp =3D CApp + '{\n'=0D @@ -2618,18 +2976,21 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + ' UINT32 OriginalSize;\n'=0D CApp =3D CApp + ' VOID *OriginalPcd;\n'=0D =0D - CApp =3D CApp + ' %s *Pcd; // From %s Line %d \n' % (Pc= d.BaseDatumType,Pcd.PkgPath, Pcd.PcdDefineLineNo)=0D + CApp =3D CApp + ' %s *Pcd; // From %s Line %d \n' % (=0D + Pcd.BaseDatumType, Pcd.PkgPath, Pcd.PcdDefineLineNo)=0D =0D CApp =3D CApp + '\n'=0D =0D PcdDefaultValue =3D StringToArray(Pcd.DefaultValueFromDec.stri= p())=0D =0D - InitByteValue +=3D '%s.%s.%s.%s|%s|%s\n' % (SkuName, DefaultSt= oreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName, Pcd.DatumType, PcdDefault= Value)=0D + InitByteValue +=3D '%s.%s.%s.%s|%s|%s\n' % (=0D + SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName, Pcd.DatumType, PcdDefaultValue)=0D =0D #=0D # Get current PCD value and size=0D #=0D - CApp =3D CApp + ' OriginalPcd =3D PcdGetPtr (%s, %s, %s, %s, = &OriginalSize);\n' % (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, P= cd.TokenCName)=0D + CApp =3D CApp + ' OriginalPcd =3D PcdGetPtr (%s, %s, %s, %s, = &OriginalSize);\n' % (=0D + SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName)=0D =0D #=0D # Determine the size of the PCD. For simple structures, sizeo= f(TYPE) provides=0D @@ -2639,18 +3000,25 @@ class DscBuildData(PlatformBuildClassObject): # in a structure. The size formula for this case is:=0D # OFFSET_OF(FlexbleArrayField) + sizeof(FlexibleArray[0]) * (H= ighestIndex + 1)=0D #=0D - CApp =3D CApp + DscBuildData.GenerateSizeStatments(Pcd,SkuName= ,DefaultStoreName)=0D + CApp =3D CApp + \=0D + DscBuildData.GenerateSizeStatments(=0D + Pcd, SkuName, DefaultStoreName)=0D if Pcd.IsArray() and Pcd.Capacity[-1] !=3D "-1":=0D - CApp =3D CApp + ' OriginalSize =3D OriginalSize < sizeof(= %s) * %d? OriginalSize:sizeof(%s) * %d; \n' % (Pcd.BaseDatumType,Pcd.PcdArr= aySize(),Pcd.BaseDatumType,Pcd.PcdArraySize())=0D - CApp =3D CApp + ' Size =3D sizeof(%s) * %d; \n' % (Pcd.Ba= seDatumType,Pcd.PcdArraySize())=0D + CApp =3D CApp + ' OriginalSize =3D OriginalSize < sizeof(= %s) * %d? OriginalSize:sizeof(%s) * %d; \n' % (=0D + Pcd.BaseDatumType, Pcd.PcdArraySize(), Pcd.BaseDatumTy= pe, Pcd.PcdArraySize())=0D + CApp =3D CApp + \=0D + ' Size =3D sizeof(%s) * %d; \n' % (Pcd.BaseDatumType,= =0D + Pcd.PcdArraySize())= =0D =0D #=0D # Allocate and zero buffer for the PCD=0D # Must handle cases where current value is smaller, larger, or= same size=0D # Always keep that larger one as the current size=0D #=0D - CApp =3D CApp + ' Size =3D (OriginalSize > Size ? OriginalSiz= e : Size);\n'=0D - CApp =3D CApp + ' Pcd =3D (%s *)malloc (Size);\n' % (Pcd.= BaseDatumType,)=0D + CApp =3D CApp + \=0D + ' Size =3D (OriginalSize > Size ? OriginalSize : Size);\n= '=0D + CApp =3D CApp + \=0D + ' Pcd =3D (%s *)malloc (Size);\n' % (Pcd.BaseDatumTyp= e,)=0D CApp =3D CApp + ' memset (Pcd, 0, Size);\n'=0D =0D #=0D @@ -2663,23 +3031,30 @@ class DscBuildData(PlatformBuildClassObject): #=0D CApp =3D CApp + DscBuildData.GenerateDefaultValueAssignStateme= nt(Pcd)=0D if Pcd.Type not in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_= BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]:=0D + self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE= _IN_MODULE]]:=0D for skuname in self.SkuIdMgr.GetSkuChain(SkuName):=0D - storeset =3D [DefaultStoreName] if DefaultStoreName = =3D=3D TAB_DEFAULT_STORES_DEFAULT else [TAB_DEFAULT_STORES_DEFAULT, Default= StoreName]=0D + storeset =3D [DefaultStoreName] if DefaultStoreName = =3D=3D TAB_DEFAULT_STORES_DEFAULT else [=0D + TAB_DEFAULT_STORES_DEFAULT, DefaultStoreName]=0D for defaultstorenameitem in storeset:=0D - CApp =3D CApp + "// SkuName: %s, DefaultStoreName= : %s \n" % (skuname, defaultstorenameitem)=0D - CApp =3D CApp + DscBuildData.GenerateInitValueStat= ement(Pcd, skuname, defaultstorenameitem)=0D + CApp =3D CApp + \=0D + "// SkuName: %s, DefaultStoreName: %s \n" % (= =0D + skuname, defaultstorenameitem)=0D + CApp =3D CApp + \=0D + DscBuildData.GenerateInitValueStatement(=0D + Pcd, skuname, defaultstorenameitem)=0D if skuname =3D=3D SkuName:=0D break=0D else:=0D CApp =3D CApp + "// SkuName: %s, DefaultStoreName: STANDA= RD \n" % self.SkuIdMgr.SystemSkuId=0D - CApp =3D CApp + DscBuildData.GenerateInitValueStatement(Pc= d, self.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT)=0D + CApp =3D CApp + DscBuildData.GenerateInitValueStatement(=0D + Pcd, self.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEF= AULT)=0D CApp =3D CApp + DscBuildData.GenerateFdfValueStatement(Pcd)=0D CApp =3D CApp + DscBuildData.GenerateCommandLineValueStatement= (Pcd)=0D #=0D # Set new PCD value and size=0D #=0D - CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (void *)Pc= d);\n' % (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e)=0D + CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (void *)Pc= d);\n' % (=0D + SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName)=0D =0D #=0D # Free PCD=0D @@ -2699,37 +3074,48 @@ class DscBuildData(PlatformBuildClassObject): =0D Value =3D Pcd.DefaultValueFromDec=0D if "{CODE(" in Pcd.DefaultValueFromDec:=0D - realvalue =3D Pcd.DefaultValueFromDec.strip()[6:-2] # "{CODE("= ).rstrip(")}"=0D - CApp +=3D "static %s %s_%s_INIT_Value%s =3D %s;\n" % (Pcd.Base= DatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,Demesion,realvalue)=0D + # "{CODE(").rstrip(")}"=0D + realvalue =3D Pcd.DefaultValueFromDec.strip()[6:-2]=0D + CApp +=3D "static %s %s_%s_INIT_Value%s =3D %s;\n" % (=0D + Pcd.BaseDatumType, Pcd.TokenSpaceGuidCName, Pcd.TokenCName= , Demesion, realvalue)=0D =0D if Pcd.Type in PCD_DYNAMIC_TYPE_SET | PCD_DYNAMIC_EX_TYPE_SET:=0D for skuname in Pcd.SkuInfoList:=0D skuinfo =3D Pcd.SkuInfoList[skuname]=0D if skuinfo.VariableName:=0D for defaultstore in skuinfo.DefaultStoreDict:=0D - pcddscrawdefaultvalue =3D self.GetPcdDscRawDefault= Value(Pcd, skuname, defaultstore)=0D + pcddscrawdefaultvalue =3D self.GetPcdDscRawDefault= Value(=0D + Pcd, skuname, defaultstore)=0D if pcddscrawdefaultvalue:=0D Value =3D skuinfo.DefaultStoreDict[defaultstor= e]=0D if "{CODE(" in Value:=0D - realvalue =3D Value.strip()[6:-2] # "{CODE= (").rstrip(")}"=0D - CApp +=3D "static %s %s_%s_%s_%s_Value%s = =3D %s;\n" % (Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,skun= ame,defaultstore,Demesion,realvalue)=0D + # "{CODE(").rstrip(")}"=0D + realvalue =3D Value.strip()[6:-2]=0D + CApp +=3D "static %s %s_%s_%s_%s_Value%s = =3D %s;\n" % (=0D + Pcd.BaseDatumType, Pcd.TokenSpaceGuidC= Name, Pcd.TokenCName, skuname, defaultstore, Demesion, realvalue)=0D else:=0D - pcddscrawdefaultvalue =3D self.GetPcdDscRawDefaultValu= e(Pcd, skuname, TAB_DEFAULT_STORES_DEFAULT)=0D + pcddscrawdefaultvalue =3D self.GetPcdDscRawDefaultValu= e(=0D + Pcd, skuname, TAB_DEFAULT_STORES_DEFAULT)=0D if pcddscrawdefaultvalue:=0D Value =3D skuinfo.DefaultValue=0D if "{CODE(" in Value:=0D - realvalue =3D Value.strip()[6:-2] # "{CODE(").= rstrip(")}"=0D - CApp +=3D "static %s %s_%s_%s_%s_Value%s =3D %= s;\n" % (Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,skuname,T= AB_DEFAULT_STORES_DEFAULT,Demesion,realvalue)=0D + # "{CODE(").rstrip(")}"=0D + realvalue =3D Value.strip()[6:-2]=0D + CApp +=3D "static %s %s_%s_%s_%s_Value%s =3D %= s;\n" % (=0D + Pcd.BaseDatumType, Pcd.TokenSpaceGuidCName= , Pcd.TokenCName, skuname, TAB_DEFAULT_STORES_DEFAULT, Demesion, realvalue)= =0D else:=0D - pcddscrawdefaultvalue =3D self.GetPcdDscRawDefaultValue(Pcd, T= AB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)=0D + pcddscrawdefaultvalue =3D self.GetPcdDscRawDefaultValue(=0D + Pcd, TAB_DEFAULT, TAB_DEFAULT_STORES_DEFAULT)=0D if pcddscrawdefaultvalue:=0D if "{CODE(" in Pcd.DefaultValue:=0D - realvalue =3D Pcd.DefaultValue.strip()[6:-2] # "{CODE(= ").rstrip(")}"=0D - CApp +=3D "static %s %s_%s_DEFAULT_STANDARD_Value%s = =3D %s;\n" % (Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,Deme= sion,realvalue)=0D + # "{CODE(").rstrip(")}"=0D + realvalue =3D Pcd.DefaultValue.strip()[6:-2]=0D + CApp +=3D "static %s %s_%s_DEFAULT_STANDARD_Value%s = =3D %s;\n" % (=0D + Pcd.BaseDatumType, Pcd.TokenSpaceGuidCName, Pcd.To= kenCName, Demesion, realvalue)=0D =0D return CApp=0D =0D - def SkuOverrideValuesEmpty(self,OverrideValues):=0D + def SkuOverrideValuesEmpty(self, OverrideValues):=0D if not OverrideValues:=0D return True=0D for key in OverrideValues:=0D @@ -2743,14 +3129,15 @@ class DscBuildData(PlatformBuildClassObject): i =3D 0=0D while i < len(ccflaglist):=0D item =3D ccflaglist[i].strip()=0D - if item in (r"/D", r"/U","-D","-U"):=0D - ccflags.add(" ".join((ccflaglist[i],ccflaglist[i+1])))=0D + if item in (r"/D", r"/U", "-D", "-U"):=0D + ccflags.add(" ".join((ccflaglist[i], ccflaglist[i+1])))=0D i =3D i+1=0D - elif item.startswith((r"/D", r"/U","-D","-U")):=0D + elif item.startswith((r"/D", r"/U", "-D", "-U")):=0D ccflags.add(item)=0D - i +=3D1=0D + i +=3D 1=0D return ccflags=0D - def GenerateByteArrayValue (self, StructuredPcds):=0D +=0D + def GenerateByteArrayValue(self, StructuredPcds):=0D #=0D # Generate/Compile/Run C application to determine if there are any= flexible array members=0D #=0D @@ -2773,10 +3160,10 @@ class DscBuildData(PlatformBuildClassObject): for PcdName in sorted(StructuredPcds.keys()):=0D Pcd =3D StructuredPcds[PcdName]=0D =0D - #create void void Cal_tocken_cname_Size functions=0D + # create void void Cal_tocken_cname_Size functions=0D CApp =3D CApp + self.GenerateSizeFunction(Pcd)=0D =0D - #create void Assign_ functions=0D + # create void Assign_ functions=0D =0D # From DEC=0D CApp =3D CApp + self.GenerateDefaultValueAssignFunction(Pcd)=0D @@ -2787,30 +3174,36 @@ class DscBuildData(PlatformBuildClassObject): =0D # From Dsc Global setting=0D if self.SkuOverrideValuesEmpty(Pcd.SkuOverrideValues) or Pcd.T= ype in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]:=0D - CApp =3D CApp + self.GenerateInitValueFunction(Pcd, self.S= kuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT)=0D + = self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:=0D + CApp =3D CApp + self.GenerateInitValueFunction(=0D + Pcd, self.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEF= AULT)=0D else:=0D for SkuName in self.SkuIdMgr.SkuOverrideOrder():=0D if SkuName not in Pcd.SkuOverrideValues:=0D continue=0D for DefaultStoreName in Pcd.SkuOverrideValues[SkuName]= :=0D - CApp =3D CApp + self.GenerateInitValueFunction(Pcd= , SkuName, DefaultStoreName)=0D + CApp =3D CApp + \=0D + self.GenerateInitValueFunction(=0D + Pcd, SkuName, DefaultStoreName)=0D =0D # From Dsc module scope setting=0D CApp =3D CApp + self.GenerateModuleScopeValue(Pcd)=0D =0D - #create Initialize_ functions=0D + # create Initialize_ functions=0D if self.SkuOverrideValuesEmpty(Pcd.SkuOverrideValues) or Pcd.T= ype in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODU= LE]]:=0D - InitByteValue, CApp =3D self.GenerateInitializeFunc(self.S= kuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT, Pcd, InitByteValue, CApp)= =0D - InitByteValue, CApp =3D self.GenerateModuleScopeInitializ= eFunc(self.SkuIdMgr.SystemSkuId,Pcd,InitByteValue,CApp)=0D + = self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:=0D + InitByteValue, CApp =3D self.GenerateInitializeFunc(=0D + self.SkuIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT,= Pcd, InitByteValue, CApp)=0D + InitByteValue, CApp =3D self.GenerateModuleScopeInitialize= Func(=0D + self.SkuIdMgr.SystemSkuId, Pcd, InitByteValue, CApp)=0D else:=0D for SkuName in self.SkuIdMgr.SkuOverrideOrder():=0D if SkuName not in Pcd.SkuOverrideValues:=0D continue=0D for DefaultStoreName in Pcd.DefaultStoreName:=0D Pcd =3D StructuredPcds[PcdName]=0D - InitByteValue, CApp =3D self.GenerateInitializeFun= c(SkuName, DefaultStoreName, Pcd, InitByteValue, CApp)=0D + InitByteValue, CApp =3D self.GenerateInitializeFun= c(=0D + SkuName, DefaultStoreName, Pcd, InitByteValue,= CApp)=0D =0D CApp =3D CApp + 'VOID\n'=0D CApp =3D CApp + 'PcdEntryPoint(\n'=0D @@ -2819,15 +3212,18 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + '{\n'=0D for Pcd in StructuredPcds.values():=0D if self.SkuOverrideValuesEmpty(Pcd.SkuOverrideValues) or Pcd.T= ype in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD], self._PCD_TYPE_ST= RING_[MODEL_PCD_PATCHABLE_IN_MODULE]]:=0D - CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % (self.Sk= uIdMgr.SystemSkuId, TAB_DEFAULT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pc= d.TokenCName)=0D + CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % (self.Sk= uIdMgr.SystemSkuId,=0D + TAB_DEFAU= LT_STORES_DEFAULT, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D for ModuleGuid in Pcd.PcdFiledValueFromDscComponent:=0D - CApp +=3D " Initialize_%s_%s_%s_%s();\n" % (ModuleGui= d,TAB_DEFAULT_STORES_DEFAULT ,Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp +=3D " Initialize_%s_%s_%s_%s();\n" % (ModuleGui= d, TAB_DEFAULT_STORES_DEFAULT,=0D + Pcd.TokenSp= aceGuidCName, Pcd.TokenCName)=0D else:=0D for SkuName in self.SkuIdMgr.SkuOverrideOrder():=0D if SkuName not in self.SkuIdMgr.AvailableSkuIdSet:=0D continue=0D for DefaultStoreName in Pcd.SkuOverrideValues[SkuName]= :=0D - CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % = (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCName)=0D + CApp =3D CApp + ' Initialize_%s_%s_%s_%s();\n' % = (SkuName, DefaultStoreName,=0D + P= cd.TokenSpaceGuidCName, Pcd.TokenCName)=0D CApp =3D CApp + '}\n'=0D =0D CApp =3D CApp + PcdMainCEntry + '\n'=0D @@ -2840,11 +3236,13 @@ class DscBuildData(PlatformBuildClassObject): # start generating makefile=0D MakeApp =3D PcdMakefileHeader=0D if sys.platform =3D=3D "win32":=0D - MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.joi= n(self.OutputPath, PcdValueCommonName)) + 'INC =3D '=0D + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (=0D + PcdValueInitName) + 'OBJECTS =3D %s\%s.obj %s.obj\n' % (se= lf.OutputPath, PcdValueInitName, os.path.join(self.OutputPath, PcdValueComm= onName)) + 'INC =3D '=0D else:=0D MakeApp =3D MakeApp + PcdGccMakefile=0D MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= , PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.join(self= .OutputPath, PcdValueCommonName)) + \=0D - 'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'TO= OL_INCLUDE +=3D'=0D + 'include $(MAKEROOT)/Makefiles/app.makefile\n' + \=0D + 'TOOL_INCLUDE +=3D'=0D =0D IncSearchList =3D []=0D PlatformInc =3D OrderedDict()=0D @@ -2854,15 +3252,19 @@ class DscBuildData(PlatformBuildClassObject): if Cache.Includes:=0D if str(Cache.MetaFile.Path) not in PlatformInc:=0D PlatformInc[str(Cache.MetaFile.Path)] =3D []=0D - PlatformInc[str(Cache.MetaFile.Path)].append (os.path.= dirname(Cache.MetaFile.Path))=0D - PlatformInc[str(Cache.MetaFile.Path)].extend (Cache.Co= mmonIncludes)=0D + PlatformInc[str(Cache.MetaFile.Path)].append(=0D + os.path.dirname(Cache.MetaFile.Path))=0D + PlatformInc[str(Cache.MetaFile.Path)].extend(=0D + Cache.CommonIncludes)=0D =0D PcdDependDEC =3D []=0D for Pcd in StructuredPcds.values():=0D for PackageDec in Pcd.PackageDecs:=0D - Package =3D os.path.normpath(mws.join(GlobalData.gWorkspac= e, PackageDec))=0D + Package =3D os.path.normpath(=0D + mws.join(GlobalData.gWorkspace, PackageDec))=0D if not os.path.exists(Package):=0D - EdkLogger.error('Build', RESOURCE_NOT_AVAILABLE, "The = dependent Package %s of PCD %s.%s is not exist." % (PackageDec, Pcd.TokenSp= aceGuidCName, Pcd.TokenCName))=0D + EdkLogger.error('Build', RESOURCE_NOT_AVAILABLE, "The = dependent Package %s of PCD %s.%s is not exist." % (=0D + PackageDec, Pcd.TokenSpaceGuidCName, Pcd.TokenCNam= e))=0D if Package not in PcdDependDEC:=0D PcdDependDEC.append(Package)=0D =0D @@ -2873,7 +3275,7 @@ class DscBuildData(PlatformBuildClassObject): #=0D # Get list of files in potential -I include path=0D #=0D - FileList =3D os.listdir (str(inc))=0D + FileList =3D os.listdir(str(inc))=0D #=0D # Skip -I include path if one of the include files= required=0D # by PcdValueInit.c are present in the include pat= hs from=0D @@ -2881,12 +3283,12 @@ class DscBuildData(PlatformBuildClassObject): # files from the host compiler.=0D #=0D if 'stdio.h' in FileList:=0D - continue=0D + continue=0D if 'stdlib.h' in FileList:=0D - continue=0D + continue=0D if 'string.h' in FileList:=0D - continue=0D - MakeApp +=3D '-I' + str(inc) + ' '=0D + continue=0D + MakeApp +=3D '-I' + str(inc) + ' '=0D IncSearchList.append(inc)=0D MakeApp =3D MakeApp + '\n'=0D =0D @@ -2910,52 +3312,71 @@ class DscBuildData(PlatformBuildClassObject): if 'COMMON' not in BuildOptions:=0D BuildOptions['COMMON'] =3D set()=0D if Arch =3D=3D TAB_STAR:=0D - BuildOptions['COMMON']|=3D self.ParseCCFlags(self.= BuildOptions[Options])=0D + BuildOptions['COMMON'] |=3D self.ParseCCFlags(=0D + self.BuildOptions[Options])=0D if Arch in self.SupArchList:=0D if Arch not in BuildOptions:=0D BuildOptions[Arch] =3D set()=0D - BuildOptions[Arch] |=3D self.ParseCCFlags(self.Bui= ldOptions[Options])=0D + BuildOptions[Arch] |=3D self.ParseCCFlags(=0D + self.BuildOptions[Options])=0D =0D if BuildOptions:=0D - ArchBuildOptions =3D {arch:flags for arch,flags in BuildOption= s.items() if arch !=3D 'COMMON'}=0D + ArchBuildOptions =3D {arch: flags for arch,=0D + flags in BuildOptions.items() if arch !=3D= 'COMMON'}=0D if len(ArchBuildOptions.keys()) =3D=3D 1:=0D BuildOptions['COMMON'] |=3D (list(ArchBuildOptions.values(= ))[0])=0D elif len(ArchBuildOptions.keys()) > 1:=0D - CommonBuildOptions =3D reduce(lambda x,y: x&y, ArchBuildOp= tions.values())=0D + CommonBuildOptions =3D reduce(=0D + lambda x, y: x & y, ArchBuildOptions.values())=0D BuildOptions['COMMON'] |=3D CommonBuildOptions=0D - ValueList =3D [item for item in BuildOptions['COMMON'] if item= .startswith((r"/U","-U"))]=0D - ValueList.extend([item for item in BuildOptions['COMMON'] if i= tem.startswith((r"/D", "-D"))])=0D + ValueList =3D [item for item in BuildOptions['COMMON']=0D + if item.startswith((r"/U", "-U"))]=0D + ValueList.extend(=0D + [item for item in BuildOptions['COMMON'] if item.startswit= h((r"/D", "-D"))])=0D CC_FLAGS +=3D " ".join(ValueList)=0D MakeApp +=3D CC_FLAGS=0D =0D if sys.platform =3D=3D "win32":=0D MakeApp =3D MakeApp + PcdMakefileEnd=0D - MakeApp =3D MakeApp + AppTarget % ("""\tcopy $(APPLICATION) $(= APPFILE) /y """)=0D + MakeApp =3D MakeApp + \=0D + AppTarget % ("""\tcopy $(APPLICATION) $(APPFILE) /y """)=0D else:=0D - MakeApp =3D MakeApp + AppTarget % ("""\tcp -p $(APPLICATION) $= (APPFILE) """)=0D + MakeApp =3D MakeApp + \=0D + AppTarget % ("""\tcp -p $(APPLICATION) $(APPFILE) """)=0D MakeApp =3D MakeApp + '\n'=0D IncludeFileFullPaths =3D []=0D for includefile in IncludeFiles:=0D for includepath in IncSearchList:=0D includefullpath =3D os.path.join(str(includepath), include= file)=0D if os.path.exists(includefullpath):=0D - IncludeFileFullPaths.append(os.path.normpath(includefu= llpath))=0D + IncludeFileFullPaths.append(=0D + os.path.normpath(includefullpath))=0D break=0D SearchPathList =3D []=0D - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Include")))=0D - SearchPathList.append(os.path.normpath(mws.join(GlobalData.gGlobal= Defines["EDK_TOOLS_PATH"], "BaseTools/Source/C/Common")))=0D + SearchPathList.append(os.path.normpath(mws.join(=0D + GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "BaseTools/Source= /C/Include")))=0D + SearchPathList.append(os.path.normpath(mws.join(=0D + GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "BaseTools/Source= /C/Common")))=0D SearchPathList.extend(str(item) for item in IncSearchList)=0D IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchPath= List)=0D for include_file in IncFileList:=0D MakeApp +=3D "$(OBJECTS) : %s\n" % include_file=0D if sys.platform =3D=3D "win32":=0D - PcdValueCommonPath =3D os.path.normpath(mws.join(GlobalData.gG= lobalDefines["EDK_TOOLS_PATH"], "Source\C\Common\PcdValueCommon.c"))=0D - MakeApp =3D MakeApp + '%s\PcdValueCommon.c : %s\n' % (self.Out= putPath, PcdValueCommonPath)=0D + PcdValueCommonPath =3D os.path.normpath(mws.join(=0D + GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source\C\Com= mon\PcdValueCommon.c"))=0D + MakeApp =3D MakeApp + \=0D + '%s\PcdValueCommon.c : %s\n' % (=0D + self.OutputPath, PcdValueCommonPath)=0D MakeApp =3D MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommonPat= h)=0D else:=0D - PcdValueCommonPath =3D os.path.normpath(mws.join(GlobalData.gG= lobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c"))=0D - MakeApp =3D MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.Out= putPath, PcdValueCommonPath)=0D - MakeApp =3D MakeApp + '\tcp -p -f %s %s/PcdValueCommon.c\n' % = (PcdValueCommonPath, self.OutputPath)=0D + PcdValueCommonPath =3D os.path.normpath(mws.join(=0D + GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Com= mon/PcdValueCommon.c"))=0D + MakeApp =3D MakeApp + \=0D + '%s/PcdValueCommon.c : %s\n' % (self.OutputPath,=0D + PcdValueCommonPath)=0D + MakeApp =3D MakeApp + \=0D + '\tcp -p -f %s %s/PcdValueCommon.c\n' % (=0D + PcdValueCommonPath, self.OutputPath)=0D MakeFileName =3D os.path.join(self.OutputPath, 'Makefile')=0D MakeApp +=3D "$(OBJECTS) : %s\n" % MakeFileName=0D SaveFileOnChange(MakeFileName, MakeApp, False)=0D @@ -2967,48 +3388,52 @@ class DscBuildData(PlatformBuildClassObject): =0D Dest_PcdValueInitExe =3D PcdValueInitName=0D if not sys.platform =3D=3D "win32":=0D - Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdValu= eInitName)=0D + Dest_PcdValueInitExe =3D os.path.join(=0D + self.OutputPath, PcdValueInitName)=0D else:=0D - Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdValu= eInitName) +".exe"=0D + Dest_PcdValueInitExe =3D os.path.join(=0D + self.OutputPath, PcdValueInitName) + ".exe"=0D =0D - #start building the structure pcd value tool=0D + # start building the structure pcd value tool=0D Messages =3D ''=0D if sys.platform =3D=3D "win32":=0D MakeCommand =3D 'nmake -f %s' % (MakeFileName)=0D - returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand)=0D + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand(=0D + MakeCommand)=0D Messages =3D StdOut=0D else:=0D MakeCommand =3D 'make -f %s' % (MakeFileName)=0D - returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Ma= keCommand)=0D + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand(=0D + MakeCommand)=0D Messages =3D StdErr=0D =0D - EdkLogger.verbose ('%s\n%s\n%s' % (MakeCommand, StdOut, StdErr))=0D + EdkLogger.verbose('%s\n%s\n%s' % (MakeCommand, StdOut, StdErr))=0D Messages =3D Messages.split('\n')=0D MessageGroup =3D []=0D if returncode !=3D 0:=0D CAppBaseFileName =3D os.path.join(self.OutputPath, PcdValueIni= tName)=0D - File =3D open (CAppBaseFileName + '.c', 'r')=0D + File =3D open(CAppBaseFileName + '.c', 'r')=0D FileData =3D File.readlines()=0D File.close()=0D for Message in Messages:=0D if " error" in Message or "warning" in Message:=0D try:=0D FileInfo =3D Message.strip().split('(')=0D - if len (FileInfo) > 1:=0D - FileName =3D FileInfo [0]=0D - FileLine =3D FileInfo [1].split (')')[0]=0D + if len(FileInfo) > 1:=0D + FileName =3D FileInfo[0]=0D + FileLine =3D FileInfo[1].split(')')[0]=0D else:=0D FileInfo =3D Message.strip().split(':')=0D if len(FileInfo) < 2:=0D continue=0D - FileName =3D FileInfo [0]=0D - FileLine =3D FileInfo [1]=0D + FileName =3D FileInfo[0]=0D + FileLine =3D FileInfo[1]=0D except:=0D continue=0D if "PcdValueInit.c" not in FileName:=0D continue=0D if FileLine.isdigit():=0D - error_line =3D FileData[int (FileLine) - 1]=0D + error_line =3D FileData[int(FileLine) - 1]=0D if r"//" in error_line:=0D c_line, dsc_line =3D error_line.split(r"//")=0D else:=0D @@ -3025,33 +3450,39 @@ class DscBuildData(PlatformBuildClassObject): Index =3D message_itmes.index(item)=0D message_itmes[Index] =3D dsc_line.stri= p()=0D break=0D - MessageGroup.append(":".join(message_itmes[Ind= ex:]).strip())=0D + MessageGroup.append(=0D + ":".join(message_itmes[Index:]).strip())=0D continue=0D else:=0D MessageGroup.append(Message)=0D if MessageGroup:=0D - EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "\n".joi= n(MessageGroup) )=0D + EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR,=0D + "\n".join(MessageGroup))=0D else:=0D - EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute= command: %s\n%s\n%s' % (MakeCommand, StdOut, StdErr))=0D + EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execute= command: %s\n%s\n%s' % (=0D + MakeCommand, StdOut, StdErr))=0D =0D - #start executing the structure pcd value tool=0D + # start executing the structure pcd value tool=0D if DscBuildData.NeedUpdateOutput(OutputValueFile, Dest_PcdValueIni= tExe, InputValueFile):=0D - Command =3D Dest_PcdValueInitExe + ' -i %s -o %s' % (InputValu= eFile, OutputValueFile)=0D - returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (Co= mmand)=0D - EdkLogger.verbose ('%s\n%s\n%s' % (Command, StdOut, StdErr))=0D + Command =3D Dest_PcdValueInitExe + \=0D + ' -i %s -o %s' % (InputValueFile, OutputValueFile)=0D + returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand(Com= mand)=0D + EdkLogger.verbose('%s\n%s\n%s' % (Command, StdOut, StdErr))=0D if returncode !=3D 0:=0D - EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect = output from command: %s\n%s\n%s\n' % (Command, StdOut, StdErr))=0D + EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect = output from command: %s\n%s\n%s\n' % (=0D + Command, StdOut, StdErr))=0D =0D - #start update structure pcd final value=0D - File =3D open (OutputValueFile, 'r')=0D + # start update structure pcd final value=0D + File =3D open(OutputValueFile, 'r')=0D FileBuffer =3D File.readlines()=0D File.close()=0D =0D StructurePcdSet =3D []=0D for Pcd in FileBuffer:=0D - PcdValue =3D Pcd.split ('|')=0D - PcdInfo =3D PcdValue[0].split ('.')=0D - StructurePcdSet.append((PcdInfo[0], PcdInfo[1], PcdInfo[2], Pc= dInfo[3], PcdValue[2].strip()))=0D + PcdValue =3D Pcd.split('|')=0D + PcdInfo =3D PcdValue[0].split('.')=0D + StructurePcdSet.append(=0D + (PcdInfo[0], PcdInfo[1], PcdInfo[2], PcdInfo[3], PcdValue[= 2].strip()))=0D return StructurePcdSet=0D =0D @staticmethod=0D @@ -3064,7 +3495,7 @@ class DscBuildData(PlatformBuildClassObject): return True=0D return False=0D =0D - ## Retrieve dynamic PCD settings=0D + # Retrieve dynamic PCD settings=0D #=0D # @param Type PCD type=0D #=0D @@ -3072,7 +3503,6 @@ class DscBuildData(PlatformBuildClassObject): #=0D def _GetDynamicPcd(self, Type):=0D =0D -=0D Pcds =3D OrderedDict()=0D #=0D # tdict is a special dict kind of type, used for selecting correct= =0D @@ -3084,13 +3514,12 @@ class DscBuildData(PlatformBuildClassObject): RecordList =3D self._RawData[Type, self._Arch]=0D AvailableSkuIdSet =3D copy.copy(self.SkuIds)=0D =0D -=0D for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dumm= y4, Dummy5 in RecordList:=0D SkuName =3D SkuName.upper()=0D SkuName =3D TAB_DEFAULT if SkuName =3D=3D TAB_COMMON else SkuN= ame=0D if SkuName not in AvailableSkuIdSet:=0D EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not= defined in [SkuIds] section' % SkuName,=0D - File=3Dself.MetaFile, Line=3DD= ummy5)=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if "." not in TokenSpaceGuid and "[" not in PcdCName and (PcdC= Name, TokenSpaceGuid, SkuName, Dummy5) not in PcdList:=0D PcdList.append((PcdCName, TokenSpaceGuid, SkuName, Dummy5)= )=0D PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] =3D Setting=0D @@ -3102,7 +3531,8 @@ class DscBuildData(PlatformBuildClassObject): if Setting is None:=0D continue=0D =0D - PcdValue, DatumType, MaxDatumSize =3D self._ValidatePcd(PcdCNa= me, TokenSpaceGuid, Setting, Type, Dummy4)=0D + PcdValue, DatumType, MaxDatumSize =3D self._ValidatePcd(=0D + PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)=0D if MaxDatumSize:=0D if int(MaxDatumSize, 0) > 0xFFFF:=0D EdkLogger.error('build', FORMAT_INVALID, "The size val= ue must not exceed the maximum value of 0xFFFF (UINT16) for %s." % ".".join= ((TokenSpaceGuid, PcdCName)),=0D @@ -3110,7 +3540,8 @@ class DscBuildData(PlatformBuildClassObject): if int(MaxDatumSize, 0) < 0:=0D EdkLogger.error('build', FORMAT_INVALID, "The size val= ue can't be set to negative value for %s." % ".".join((TokenSpaceGuid, PcdC= Name)),=0D File=3Dself.MetaFile, Line=3DDummy4)=0D - SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName][0], '',= '', '', '', '', PcdValue)=0D + SkuInfo =3D SkuInfoClass(=0D + SkuName, self.SkuIds[SkuName][0], '', '', '', '', '', PcdV= alue)=0D if (PcdCName, TokenSpaceGuid) in Pcds:=0D pcdObject =3D Pcds[PcdCName, TokenSpaceGuid]=0D pcdObject.SkuInfoList[SkuName] =3D SkuInfo=0D @@ -3126,33 +3557,36 @@ class DscBuildData(PlatformBuildClassObject): pcdObject.MaxDatumSize =3D str(CurrentMaxSize)=0D else:=0D Pcds[PcdCName, TokenSpaceGuid] =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - self._PCD_TYPE_STRING_= [Type],=0D - DatumType,=0D - PcdValue,=0D - '',=0D - MaxDatumSize,=0D - OrderedDict({SkuName := SkuInfo}),=0D - False,=0D - None,=0D - IsDsc=3DTrue)=0D + PcdCName,=0D + TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type],=0D + DatumType,=0D + PcdValue,=0D + '',=0D + MaxDatumSize,=0D + OrderedDict({SkuName: SkuInfo}),=0D + False,=0D + None,=0D + IsDsc=3DTrue)=0D =0D if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:= =0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] =3D {}= =0D Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = =3D {}=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAUL= T_STORES_DEFAULT] =3D PcdValue=0D - Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TAB_DE= FAULT_STORES_DEFAULT] =3D (self.MetaFile.File,Dummy4)=0D + Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TAB_DE= FAULT_STORES_DEFAULT] =3D (=0D + self.MetaFile.File, Dummy4)=0D =0D for pcd in Pcds.values():=0D - pcdDecObject =3D self._DecPcds[pcd.TokenCName, pcd.TokenSpaceG= uidCName]=0D + pcdDecObject =3D self._DecPcds[pcd.TokenCName,=0D + pcd.TokenSpaceGuidCName]=0D # Only fix the value while no value provided in DSC file.=0D for sku in pcd.SkuInfoList.values():=0D if not sku.DefaultValue:=0D sku.DefaultValue =3D pcdDecObject.DefaultValue=0D if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pc= d.SkuInfoList:=0D valuefromDec =3D pcdDecObject.DefaultValue=0D - SkuInfo =3D SkuInfoClass(TAB_DEFAULT, '0', '', '', '', '',= '', valuefromDec)=0D + SkuInfo =3D SkuInfoClass(=0D + TAB_DEFAULT, '0', '', '', '', '', '', valuefromDec)=0D pcd.SkuInfoList[TAB_DEFAULT] =3D SkuInfo=0D elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.= SkuInfoList:=0D pcd.SkuInfoList[TAB_DEFAULT] =3D pcd.SkuInfoList[TAB_COMMO= N]=0D @@ -3169,12 +3603,13 @@ class DscBuildData(PlatformBuildClassObject): if self.SkuIdMgr.SkuUsageType =3D=3D self.SkuIdMgr.SINGLE:=0D if TAB_DEFAULT in PcdObj.SkuInfoList and self.SkuIdMgr.SystemS= kuId not in PcdObj.SkuInfoList:=0D PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId] =3D PcdObj.S= kuInfoList[TAB_DEFAULT]=0D - PcdObj.SkuInfoList =3D {TAB_DEFAULT:PcdObj.SkuInfoList[self.Sk= uIdMgr.SystemSkuId]}=0D + PcdObj.SkuInfoList =3D {=0D + TAB_DEFAULT: PcdObj.SkuInfoList[self.SkuIdMgr.SystemSkuId]= }=0D PcdObj.SkuInfoList[TAB_DEFAULT].SkuIdName =3D TAB_DEFAULT=0D PcdObj.SkuInfoList[TAB_DEFAULT].SkuId =3D '0'=0D =0D elif self.SkuIdMgr.SkuUsageType =3D=3D self.SkuIdMgr.DEFAULT:=0D - PcdObj.SkuInfoList =3D {TAB_DEFAULT:PcdObj.SkuInfoList[TAB_DEF= AULT]}=0D + PcdObj.SkuInfoList =3D {TAB_DEFAULT: PcdObj.SkuInfoList[TAB_DE= FAULT]}=0D =0D return PcdObj=0D =0D @@ -3194,24 +3629,31 @@ class DscBuildData(PlatformBuildClassObject): def CompletePcdValues(self, PcdSet):=0D Pcds =3D OrderedDict()=0D DefaultStoreObj =3D DefaultStore(self._GetDefaultStores())=0D - SkuIds =3D {skuname:skuid for skuname, skuid in self.SkuIdMgr.Avai= lableSkuIdSet.items() if skuname !=3D TAB_COMMON}=0D - DefaultStores =3D set(storename for pcdobj in PcdSet.values() for = skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreD= ict)=0D + SkuIds =3D {skuname: skuid for skuname,=0D + skuid in self.SkuIdMgr.AvailableSkuIdSet.items() if skun= ame !=3D TAB_COMMON}=0D + DefaultStores =3D set(storename for pcdobj in PcdSet.values(=0D + ) for skuobj in pcdobj.SkuInfoList.values() for storename in skuob= j.DefaultStoreDict)=0D for PcdCName, TokenSpaceGuid in PcdSet:=0D PcdObj =3D PcdSet[(PcdCName, TokenSpaceGuid)]=0D =0D if PcdObj.Type not in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMI= C_DEFAULT],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_VPD],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_DEFAUL= T],=0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII],= =0D - self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_VPD]]:= =0D - Pcds[PcdCName, TokenSpaceGuid]=3D PcdObj=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC_HII],=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC_VPD],=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT],=0D + self._PCD_TYPE_STRING_[=0D + MODEL_PCD_DYNAMIC_EX_HII],=0D + self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMI= C_EX_VPD]]:=0D + Pcds[PcdCName, TokenSpaceGuid] =3D PcdObj=0D continue=0D PcdType =3D PcdObj.Type=0D if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], = self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D for skuid in PcdObj.SkuInfoList:=0D skuobj =3D PcdObj.SkuInfoList[skuid]=0D - mindefaultstorename =3D DefaultStoreObj.GetMin(set(def= aultstorename for defaultstorename in skuobj.DefaultStoreDict))=0D + mindefaultstorename =3D DefaultStoreObj.GetMin(=0D + set(defaultstorename for defaultstorename in skuob= j.DefaultStoreDict))=0D for defaultstorename in DefaultStores:=0D if defaultstorename not in skuobj.DefaultStoreDict= :=0D skuobj.DefaultStoreDict[defaultstorename] =3D = skuobj.DefaultStoreDict[mindefaultstorename]=0D @@ -3221,19 +3663,22 @@ class DscBuildData(PlatformBuildClassObject): nextskuid =3D self.SkuIdMgr.GetNextSkuId(skuname)=0D while nextskuid not in PcdObj.SkuInfoList:=0D nextskuid =3D self.SkuIdMgr.GetNextSkuId(nextskuid= )=0D - PcdObj.SkuInfoList[skuname] =3D copy.deepcopy(PcdObj.S= kuInfoList[nextskuid])=0D + PcdObj.SkuInfoList[skuname] =3D copy.deepcopy(=0D + PcdObj.SkuInfoList[nextskuid])=0D PcdObj.SkuInfoList[skuname].SkuId =3D skuid=0D PcdObj.SkuInfoList[skuname].SkuIdName =3D skuname=0D if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], = self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:=0D - PcdObj.DefaultValue =3D list(PcdObj.SkuInfoList.values())[= 0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType =3D=3D self.SkuIdMgr.SINGL= E else PcdObj.SkuInfoList[TAB_DEFAULT].HiiDefaultValue=0D - Pcds[PcdCName, TokenSpaceGuid]=3D PcdObj=0D + PcdObj.DefaultValue =3D list(PcdObj.SkuInfoList.values())[= =0D + 0].HiiDefaultValue if self.SkuIdMgr.SkuUsageType =3D= =3D self.SkuIdMgr.SINGLE else PcdObj.SkuInfoList[TAB_DEFAULT].HiiDefaultVal= ue=0D + Pcds[PcdCName, TokenSpaceGuid] =3D PcdObj=0D return Pcds=0D - ## Retrieve dynamic HII PCD settings=0D + # Retrieve dynamic HII PCD settings=0D #=0D # @param Type PCD type=0D #=0D # @retval a dict object contains settings of given PCD type=0D #=0D +=0D def _GetDynamicHiiPcd(self, Type):=0D =0D VariableAttrs =3D {}=0D @@ -3258,31 +3703,34 @@ class DscBuildData(PlatformBuildClassObject): if DefaultStore =3D=3D TAB_COMMON:=0D DefaultStore =3D TAB_DEFAULT_STORES_DEFAULT=0D else:=0D - #The end user define [DefaultStores] and [SKUID_IDENTIFIER= .Menufacturing] in DSC=0D + # The end user define [DefaultStores] and [SKUID_IDENTIFIE= R.Menufacturing] in DSC=0D UserDefinedDefaultStores.append((PcdCName, TokenSpaceGuid)= )=0D if SkuName not in AvailableSkuIdSet:=0D EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not= defined in [SkuIds] section' % SkuName,=0D - File=3Dself.MetaFile, Line=3DD= ummy5)=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if DefaultStore not in DefaultStoresDefine:=0D EdkLogger.error('build', PARAMETER_INVALID, 'DefaultStores= %s is not defined in [DefaultStores] section' % DefaultStore,=0D - File=3Dself.MetaFile, Line=3DD= ummy5)=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if "." not in TokenSpaceGuid and "[" not in PcdCName and (PcdC= Name, TokenSpaceGuid, SkuName, DefaultStore, Dummy5) not in PcdList:=0D - PcdList.append((PcdCName, TokenSpaceGuid, SkuName, Default= Store, Dummy5))=0D - PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid, DefaultStore]= =3D Setting=0D -=0D + PcdList.append((PcdCName, TokenSpaceGuid,=0D + SkuName, DefaultStore, Dummy5))=0D + PcdDict[Arch, SkuName, PcdCName,=0D + TokenSpaceGuid, DefaultStore] =3D Setting=0D =0D # Remove redundant PCD candidates, per the ARCH and SKU=0D - for index,(PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy4= ) in enumerate(PcdList):=0D + for index, (PcdCName, TokenSpaceGuid, SkuName, DefaultStore, Dummy= 4) in enumerate(PcdList):=0D =0D - Setting =3D PcdDict[self._Arch, SkuName, PcdCName, TokenSpaceG= uid, DefaultStore]=0D + Setting =3D PcdDict[self._Arch, SkuName,=0D + PcdCName, TokenSpaceGuid, DefaultStore]=0D if Setting is None:=0D continue=0D - VariableName, VariableGuid, VariableOffset, DefaultValue, VarA= ttribute =3D self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dum= my4)=0D + VariableName, VariableGuid, VariableOffset, DefaultValue, VarA= ttribute =3D self._ValidatePcd(=0D + PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)=0D =0D rt, Msg =3D VariableAttributes.ValidateVarAttributes(VarAttrib= ute)=0D if not rt:=0D EdkLogger.error("build", PCD_VARIABLE_ATTRIBUTES_ERROR, "V= ariable attributes settings for %s is incorrect.\n %s" % (".".join((TokenSp= aceGuid, PcdCName)), Msg),=0D - ExtraData=3D"[%s]" % VarAttribute)=0D + ExtraData=3D"[%s]" % VarAttribute)=0D ExceedMax =3D False=0D FormatCorrect =3D True=0D if VariableOffset.isdigit():=0D @@ -3301,42 +3749,49 @@ class DscBuildData(PlatformBuildClassObject): else:=0D FormatCorrect =3D False=0D if not FormatCorrect:=0D - EdkLogger.error('Build', FORMAT_INVALID, "Invalid syntax o= r format of the variable offset value is incorrect for %s." % ".".join((Tok= enSpaceGuid, PcdCName)))=0D + EdkLogger.error('Build', FORMAT_INVALID, "Invalid syntax o= r format of the variable offset value is incorrect for %s." % ".".join(=0D + (TokenSpaceGuid, PcdCName)))=0D =0D if ExceedMax:=0D - EdkLogger.error('Build', OPTION_VALUE_INVALID, "The variab= le offset value must not exceed the maximum value of 0xFFFF (UINT16) for %s= ." % ".".join((TokenSpaceGuid, PcdCName)))=0D + EdkLogger.error('Build', OPTION_VALUE_INVALID, "The variab= le offset value must not exceed the maximum value of 0xFFFF (UINT16) for %s= ." % ".".join(=0D + (TokenSpaceGuid, PcdCName)))=0D if (VariableName, VariableGuid) not in VariableAttrs:=0D VariableAttrs[(VariableName, VariableGuid)] =3D VarAttribu= te=0D else:=0D if not DscBuildData.CompareVarAttr(VariableAttrs[(Variable= Name, VariableGuid)], VarAttribute):=0D - EdkLogger.error('Build', PCD_VARIABLE_ATTRIBUTES_CONFL= ICT_ERROR, "The variable %s.%s for DynamicHii PCDs has conflicting attribut= es [%s] and [%s] " % (VariableGuid, VariableName, VarAttribute, VariableAtt= rs[(VariableName, VariableGuid)]))=0D + EdkLogger.error('Build', PCD_VARIABLE_ATTRIBUTES_CONFL= ICT_ERROR, "The variable %s.%s for DynamicHii PCDs has conflicting attribut= es [%s] and [%s] " % (=0D + VariableGuid, VariableName, VarAttribute, Variable= Attrs[(VariableName, VariableGuid)]))=0D =0D pcdDecObject =3D self._DecPcds[PcdCName, TokenSpaceGuid]=0D if (PcdCName, TokenSpaceGuid) in Pcds:=0D pcdObject =3D Pcds[PcdCName, TokenSpaceGuid]=0D if SkuName in pcdObject.SkuInfoList:=0D Skuitem =3D pcdObject.SkuInfoList[SkuName]=0D - Skuitem.DefaultStoreDict.update({DefaultStore:DefaultV= alue})=0D + Skuitem.DefaultStoreDict.update(=0D + {DefaultStore: DefaultValue})=0D else:=0D - SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName]= [0], VariableName, VariableGuid, VariableOffset, DefaultValue, VariableAttr= ibute=3DVarAttribute, DefaultStore=3D{DefaultStore:DefaultValue})=0D + SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName]= [0], VariableName, VariableGuid, VariableOffset,=0D + DefaultValue, VariableAttribute= =3DVarAttribute, DefaultStore=3D{DefaultStore: DefaultValue})=0D pcdObject.SkuInfoList[SkuName] =3D SkuInfo=0D else:=0D - SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName][0],= VariableName, VariableGuid, VariableOffset, DefaultValue, VariableAttribut= e=3DVarAttribute, DefaultStore=3D{DefaultStore:DefaultValue})=0D + SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName][0],= VariableName, VariableGuid, VariableOffset,=0D + DefaultValue, VariableAttribute=3DV= arAttribute, DefaultStore=3D{DefaultStore: DefaultValue})=0D PcdClassObj =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - self._PCD_TYPE_STRING_[Typ= e],=0D - '',=0D - DefaultValue,=0D - '',=0D - '',=0D - OrderedDict({SkuName : Sku= Info}),=0D - False,=0D - None,=0D - pcdDecObject.validaterange= s,=0D - pcdDecObject.validlists,=0D - pcdDecObject.expressions,= =0D - IsDsc=3DTrue)=0D + PcdCName,=0D + TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type],=0D + '',=0D + DefaultValue,=0D + '',=0D + '',=0D + OrderedDict(=0D + {SkuName: SkuInfo}),=0D + False,=0D + None,=0D + pcdDecObject.validateranges,=0D + pcdDecObject.validlists,=0D + pcdDecObject.expressions,=0D + IsDsc=3DTrue)=0D if (PcdCName, TokenSpaceGuid) in UserDefinedDefaultStores:= =0D PcdClassObj.UserDefinedDefaultStoresFlag =3D True=0D Pcds[PcdCName, TokenSpaceGuid] =3D PcdClassObj=0D @@ -3346,21 +3801,24 @@ class DscBuildData(PlatformBuildClassObject): Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] =3D {}= =0D Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = =3D {}=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][DefaultSto= re] =3D DefaultValue=0D - Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][Defaul= tStore] =3D (self.MetaFile.File,Dummy4)=0D + Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][Defaul= tStore] =3D (=0D + self.MetaFile.File, Dummy4)=0D for pcd in Pcds.values():=0D - pcdDecObject =3D self._DecPcds[pcd.TokenCName, pcd.TokenSpaceG= uidCName]=0D + pcdDecObject =3D self._DecPcds[pcd.TokenCName,=0D + pcd.TokenSpaceGuidCName]=0D pcd.DatumType =3D pcdDecObject.DatumType=0D # Only fix the value while no value provided in DSC file.=0D for sku in pcd.SkuInfoList.values():=0D if (sku.HiiDefaultValue =3D=3D "" or sku.HiiDefaultValue i= s None):=0D sku.HiiDefaultValue =3D pcdDecObject.DefaultValue=0D for default_store in sku.DefaultStoreDict:=0D - sku.DefaultStoreDict[default_store]=3DpcdDecObject= .DefaultValue=0D + sku.DefaultStoreDict[default_store] =3D pcdDecObje= ct.DefaultValue=0D pcd.DefaultValue =3D pcdDecObject.DefaultValue=0D if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pc= d.SkuInfoList:=0D SkuInfoObj =3D list(pcd.SkuInfoList.values())[0]=0D valuefromDec =3D pcdDecObject.DefaultValue=0D - SkuInfo =3D SkuInfoClass(TAB_DEFAULT, '0', SkuInfoObj.Vari= ableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec,= VariableAttribute=3DSkuInfoObj.VariableAttribute, DefaultStore=3D{DefaultS= tore:valuefromDec})=0D + SkuInfo =3D SkuInfoClass(TAB_DEFAULT, '0', SkuInfoObj.Vari= ableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset,=0D + valuefromDec, VariableAttribute=3DS= kuInfoObj.VariableAttribute, DefaultStore=3D{DefaultStore: valuefromDec})=0D pcd.SkuInfoList[TAB_DEFAULT] =3D SkuInfo=0D elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.= SkuInfoList:=0D pcd.SkuInfoList[TAB_DEFAULT] =3D pcd.SkuInfoList[TAB_COMMO= N]=0D @@ -3375,18 +3833,21 @@ class DscBuildData(PlatformBuildClassObject): if pcd.DatumType not in TAB_PCD_NUMERIC_TYPES:=0D for (_, skuobj) in pcd.SkuInfoList.items():=0D datalen =3D 0=0D - skuobj.HiiDefaultValue =3D StringToArray(skuobj.HiiDef= aultValue)=0D + skuobj.HiiDefaultValue =3D StringToArray(=0D + skuobj.HiiDefaultValue)=0D datalen =3D len(skuobj.HiiDefaultValue.split(","))=0D if datalen > MaxSize:=0D MaxSize =3D datalen=0D for defaultst in skuobj.DefaultStoreDict:=0D - skuobj.DefaultStoreDict[defaultst] =3D StringToArr= ay(skuobj.DefaultStoreDict[defaultst])=0D + skuobj.DefaultStoreDict[defaultst] =3D StringToArr= ay(=0D + skuobj.DefaultStoreDict[defaultst])=0D pcd.DefaultValue =3D StringToArray(pcd.DefaultValue)=0D pcd.MaxDatumSize =3D str(MaxSize)=0D rt, invalidhii =3D DscBuildData.CheckVariableNameAssignment(Pcds)= =0D if not rt:=0D invalidpcd =3D ",".join(invalidhii)=0D - EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR, Message=3D'T= he same HII PCD must map to the same EFI variable for all SKUs', File=3Dsel= f.MetaFile, ExtraData=3Dinvalidpcd)=0D + EdkLogger.error('build', PCD_VARIABLE_INFO_ERROR,=0D + Message=3D'The same HII PCD must map to the sa= me EFI variable for all SKUs', File=3Dself.MetaFile, ExtraData=3Dinvalidpcd= )=0D =0D list(map(self.FilterSkuSettings, Pcds.values()))=0D =0D @@ -3397,22 +3858,23 @@ class DscBuildData(PlatformBuildClassObject): invalidhii =3D []=0D for pcdname in Pcds:=0D pcd =3D Pcds[pcdname]=0D - varnameset =3D set(sku.VariableName for (skuid, sku) in pcd.Sk= uInfoList.items())=0D + varnameset =3D set(sku.VariableName for (=0D + skuid, sku) in pcd.SkuInfoList.items())=0D if len(varnameset) > 1:=0D invalidhii.append(".".join((pcdname[1], pcdname[0])))=0D if len(invalidhii):=0D return False, invalidhii=0D else:=0D return True, []=0D - ## Retrieve dynamic VPD PCD settings=0D + # Retrieve dynamic VPD PCD settings=0D #=0D # @param Type PCD type=0D #=0D # @retval a dict object contains settings of given PCD type=0D #=0D +=0D def _GetDynamicVpdPcd(self, Type):=0D =0D -=0D Pcds =3D OrderedDict()=0D #=0D # tdict is a special dict kind of type, used for selecting correct= =0D @@ -3430,7 +3892,7 @@ class DscBuildData(PlatformBuildClassObject): SkuName =3D TAB_DEFAULT if SkuName =3D=3D TAB_COMMON else SkuN= ame=0D if SkuName not in AvailableSkuIdSet:=0D EdkLogger.error('build', PARAMETER_INVALID, 'Sku %s is not= defined in [SkuIds] section' % SkuName,=0D - File=3Dself.MetaFile, Line=3DD= ummy5)=0D + File=3Dself.MetaFile, Line=3DDummy5)=0D if "." not in TokenSpaceGuid and "[" not in PcdCName and (PcdC= Name, TokenSpaceGuid, SkuName, Dummy5) not in PcdList:=0D PcdList.append((PcdCName, TokenSpaceGuid, SkuName, Dummy5)= )=0D PcdDict[Arch, SkuName, PcdCName, TokenSpaceGuid] =3D Setting=0D @@ -3446,7 +3908,8 @@ class DscBuildData(PlatformBuildClassObject): # At this point, we put all the data into the PcdClssObject fo= r we don't know the PCD's datumtype=0D # until the DEC parser has been called.=0D #=0D - VpdOffset, MaxDatumSize, InitialValue =3D self._ValidatePcd(Pc= dCName, TokenSpaceGuid, Setting, Type, Dummy4)=0D + VpdOffset, MaxDatumSize, InitialValue =3D self._ValidatePcd(=0D + PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)=0D if MaxDatumSize:=0D if int(MaxDatumSize, 0) > 0xFFFF:=0D EdkLogger.error('build', FORMAT_INVALID, "The size val= ue must not exceed the maximum value of 0xFFFF (UINT16) for %s." % ".".join= ((TokenSpaceGuid, PcdCName)),=0D @@ -3454,7 +3917,8 @@ class DscBuildData(PlatformBuildClassObject): if int(MaxDatumSize, 0) < 0:=0D EdkLogger.error('build', FORMAT_INVALID, "The size val= ue can't be set to negative value for %s." % ".".join((TokenSpaceGuid, PcdC= Name)),=0D File=3Dself.MetaFile, Line=3DDummy4)=0D - SkuInfo =3D SkuInfoClass(SkuName, self.SkuIds[SkuName][0], '',= '', '', '', VpdOffset, InitialValue)=0D + SkuInfo =3D SkuInfoClass(=0D + SkuName, self.SkuIds[SkuName][0], '', '', '', '', VpdOffse= t, InitialValue)=0D if (PcdCName, TokenSpaceGuid) in Pcds:=0D pcdObject =3D Pcds[PcdCName, TokenSpaceGuid]=0D pcdObject.SkuInfoList[SkuName] =3D SkuInfo=0D @@ -3470,25 +3934,28 @@ class DscBuildData(PlatformBuildClassObject): pcdObject.MaxDatumSize =3D str(CurrentMaxSize)=0D else:=0D Pcds[PcdCName, TokenSpaceGuid] =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - self._PCD_TYPE_STRING_[Typ= e],=0D - '',=0D - InitialValue,=0D - '',=0D - MaxDatumSize,=0D - OrderedDict({SkuName : Sku= Info}),=0D - False,=0D - None,=0D - IsDsc=3DTrue)=0D + PcdCName,=0D + TokenSpaceGuid,=0D + self._PCD_TYPE_STRING_[Type],=0D + '',=0D + InitialValue,=0D + '',=0D + MaxDatumSize,=0D + OrderedDict(=0D + {SkuName: SkuInfo}),=0D + False,=0D + None,=0D + IsDsc=3DTrue)=0D =0D if SkuName not in Pcds[PcdCName, TokenSpaceGuid].DscRawValue:= =0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName] =3D {}= =0D Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName] = =3D {}=0D Pcds[PcdCName, TokenSpaceGuid].DscRawValue[SkuName][TAB_DEFAUL= T_STORES_DEFAULT] =3D InitialValue=0D - Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TAB_DE= FAULT_STORES_DEFAULT] =3D (self.MetaFile.File,Dummy4)=0D + Pcds[PcdCName, TokenSpaceGuid].DscRawValueInfo[SkuName][TAB_DE= FAULT_STORES_DEFAULT] =3D (=0D + self.MetaFile.File, Dummy4)=0D for pcd in Pcds.values():=0D - pcdDecObject =3D self._DecPcds[pcd.TokenCName, pcd.TokenSpaceG= uidCName]=0D + pcdDecObject =3D self._DecPcds[pcd.TokenCName,=0D + pcd.TokenSpaceGuidCName]=0D pcd.DatumType =3D pcdDecObject.DatumType=0D # Only fix the value while no value provided in DSC file.=0D for sku in pcd.SkuInfoList.values():=0D @@ -3497,7 +3964,8 @@ class DscBuildData(PlatformBuildClassObject): if TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON not in pc= d.SkuInfoList:=0D SkuInfoObj =3D list(pcd.SkuInfoList.values())[0]=0D valuefromDec =3D pcdDecObject.DefaultValue=0D - SkuInfo =3D SkuInfoClass(TAB_DEFAULT, '0', '', '', '', '',= SkuInfoObj.VpdOffset, valuefromDec)=0D + SkuInfo =3D SkuInfoClass(=0D + TAB_DEFAULT, '0', '', '', '', '', SkuInfoObj.VpdOffset= , valuefromDec)=0D pcd.SkuInfoList[TAB_DEFAULT] =3D SkuInfo=0D elif TAB_DEFAULT not in pcd.SkuInfoList and TAB_COMMON in pcd.= SkuInfoList:=0D pcd.SkuInfoList[TAB_DEFAULT] =3D pcd.SkuInfoList[TAB_COMMO= N]=0D @@ -3505,20 +3973,22 @@ class DscBuildData(PlatformBuildClassObject): elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in pcd.SkuI= nfoList:=0D del pcd.SkuInfoList[TAB_COMMON]=0D =0D - #For the same one VOID* pcd, if the default value type of one SKU = is "Unicode string",=0D - #the other SKUs are "OtherVOID*"(ASCII string or byte array),Then = convert "Unicode string" to "byte array".=0D + # For the same one VOID* pcd, if the default value type of one SKU= is "Unicode string",=0D + # the other SKUs are "OtherVOID*"(ASCII string or byte array),Then= convert "Unicode string" to "byte array".=0D for pcd in Pcds.values():=0D PcdValueTypeSet =3D set()=0D for sku in pcd.SkuInfoList.values():=0D - PcdValueTypeSet.add("UnicodeString" if sku.DefaultValue.st= artswith(('L"',"L'")) else "OtherVOID*")=0D + PcdValueTypeSet.add("UnicodeString" if sku.DefaultValue.st= artswith(=0D + ('L"', "L'")) else "OtherVOID*")=0D if len(PcdValueTypeSet) > 1:=0D for sku in pcd.SkuInfoList.values():=0D - sku.DefaultValue =3D StringToArray(sku.DefaultValue) i= f sku.DefaultValue.startswith(('L"',"L'")) else sku.DefaultValue=0D + sku.DefaultValue =3D StringToArray(sku.DefaultValue) i= f sku.DefaultValue.startswith(=0D + ('L"', "L'")) else sku.DefaultValue=0D =0D list(map(self.FilterSkuSettings, Pcds.values()))=0D return Pcds=0D =0D - ## Add external modules=0D + # Add external modules=0D #=0D # The external modules are mostly those listed in FDF file, which do= n't=0D # need "build".=0D @@ -3537,13 +4007,16 @@ class DscBuildData(PlatformBuildClassObject): self._ToolChainFamily =3D TAB_COMPILER_MSFT=0D TargetObj =3D TargetTxtDict()=0D TargetTxt =3D TargetObj.Target=0D - BuildConfigurationFile =3D os.path.normpath(os.path.join(GlobalDat= a.gConfDirectory, gDefaultTargetTxtFile))=0D + BuildConfigurationFile =3D os.path.normpath(os.path.join(=0D + GlobalData.gConfDirectory, gDefaultTargetTxtFile))=0D if os.path.isfile(BuildConfigurationFile) =3D=3D True:=0D ToolDefinitionFile =3D TargetTxt.TargetTxtDictionary[DataType.= TAB_TAT_DEFINES_TOOL_CHAIN_CONF]=0D if ToolDefinitionFile =3D=3D '':=0D - ToolDefinitionFile =3D os.path.normpath(mws.join(self.Work= spaceDir, 'Conf', gDefaultToolsDefFile))=0D + ToolDefinitionFile =3D os.path.normpath(=0D + mws.join(self.WorkspaceDir, 'Conf', gDefaultToolsDefFi= le))=0D if os.path.isfile(ToolDefinitionFile) =3D=3D True:=0D - ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSP= ACE"), "Conf")))=0D + ToolDefObj =3D ToolDefDict(=0D + (os.path.join(os.getenv("WORKSPACE"), "Conf")))=0D ToolDefinition =3D ToolDefObj.ToolDef.ToolsDefTxtDatabase= =0D if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \=0D or self._Toolchain not in ToolDefinition[TAB_TOD_DEFINE= S_FAMILY] \=0D @@ -3553,7 +4026,7 @@ class DscBuildData(PlatformBuildClassObject): self._ToolChainFamily =3D ToolDefinition[TAB_TOD_DEFIN= ES_FAMILY][self._Toolchain]=0D return self._ToolChainFamily=0D =0D - ## Add external PCDs=0D + # Add external PCDs=0D #=0D # The external PCDs are mostly those listed in FDF file to specify a= ddress=0D # or offset information.=0D @@ -3564,7 +4037,8 @@ class DscBuildData(PlatformBuildClassObject): #=0D def AddPcd(self, Name, Guid, Value):=0D if (Name, Guid) not in self.Pcds:=0D - self.Pcds[Name, Guid] =3D PcdClassObject(Name, Guid, '', '', '= ', '', '', {}, False, None)=0D + self.Pcds[Name, Guid] =3D PcdClassObject(=0D + Name, Guid, '', '', '', '', '', {}, False, None)=0D self.Pcds[Name, Guid].DefaultValue =3D Value=0D =0D @property=0D @@ -3575,13 +4049,16 @@ class DscBuildData(PlatformBuildClassObject): FdfInfList =3D GlobalData.gFdfParser.Profile.InfList=0D PkgSet =3D set()=0D for Inf in FdfInfList:=0D - ModuleFile =3D PathClass(NormPath(Inf), GlobalData.gWorksp= ace, Arch=3Dself._Arch)=0D + ModuleFile =3D PathClass(=0D + NormPath(Inf), GlobalData.gWorkspace, Arch=3Dself._Arc= h)=0D if ModuleFile in self._Modules:=0D continue=0D - ModuleData =3D self._Bdb[ModuleFile, self._Arch, self._Tar= get, self._Toolchain]=0D + ModuleData =3D self._Bdb[ModuleFile,=0D + self._Arch, self._Target, self._Too= lchain]=0D PkgSet.update(ModuleData.Packages)=0D if self.Packages:=0D PkgSet.update(self.Packages)=0D - self._DecPcds, self._GuidDict =3D GetDeclaredPcd(self, self._B= db, self._Arch, self._Target, self._Toolchain, PkgSet)=0D + self._DecPcds, self._GuidDict =3D GetDeclaredPcd(=0D + self, self._Bdb, self._Arch, self._Target, self._Toolchain= , PkgSet)=0D self._GuidDict.update(GlobalData.gPlatformPcds)=0D return self._DecPcds=0D diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/= Source/Python/Workspace/InfBuildData.py index e4ff1c668666..4a28c0991c3a 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by build tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -16,7 +16,7 @@ from collections import OrderedDict from Workspace.BuildClassObject import ModuleBuildClassObject, LibraryClas= sObject, PcdClassObject=0D from Common.Expression import ValueExpressionEx, PcdPattern=0D =0D -## Get Protocol value from given packages=0D +# Get Protocol value from given packages=0D #=0D # @param CName The CName of the GUID=0D # @param PackageList List of packages looking-up in=0D @@ -25,17 +25,20 @@ from Common.Expression import ValueExpressionEx, PcdPat= tern # @retval GuidValue if the CName is found in any given package=0D # @retval None if the CName is not found in all given package= s=0D #=0D -def _ProtocolValue(CName, PackageList, Inffile =3D None):=0D +=0D +=0D +def _ProtocolValue(CName, PackageList, Inffile=3DNone):=0D for P in PackageList:=0D ProtocolKeys =3D list(P.Protocols.keys())=0D if Inffile and P._PrivateProtocols:=0D if not Inffile.startswith(P.MetaFile.Dir):=0D - ProtocolKeys =3D [x for x in P.Protocols if x not in P._Pr= ivateProtocols]=0D + ProtocolKeys =3D [=0D + x for x in P.Protocols if x not in P._PrivateProtocols= ]=0D if CName in ProtocolKeys:=0D return P.Protocols[CName]=0D return None=0D =0D -## Get PPI value from given packages=0D +# Get PPI value from given packages=0D #=0D # @param CName The CName of the GUID=0D # @param PackageList List of packages looking-up in=0D @@ -44,7 +47,9 @@ def _ProtocolValue(CName, PackageList, Inffile =3D None): # @retval GuidValue if the CName is found in any given package=0D # @retval None if the CName is not found in all given package= s=0D #=0D -def _PpiValue(CName, PackageList, Inffile =3D None):=0D +=0D +=0D +def _PpiValue(CName, PackageList, Inffile=3DNone):=0D for P in PackageList:=0D PpiKeys =3D list(P.Ppis.keys())=0D if Inffile and P._PrivatePpis:=0D @@ -54,11 +59,13 @@ def _PpiValue(CName, PackageList, Inffile =3D None): return P.Ppis[CName]=0D return None=0D =0D -## Module build information from INF file=0D +# Module build information from INF file=0D #=0D # This class is used to retrieve information stored in database and conve= rt them=0D # into ModuleBuildClassObject form for easier use for AutoGen.=0D #=0D +=0D +=0D class InfBuildData(ModuleBuildClassObject):=0D =0D # dict used to convert part of [Defines] to members of InfBuildData di= rectly=0D @@ -66,35 +73,35 @@ class InfBuildData(ModuleBuildClassObject): #=0D # Required Fields=0D #=0D - TAB_INF_DEFINES_BASE_NAME : "_BaseName",=0D - TAB_INF_DEFINES_FILE_GUID : "_Guid",=0D - TAB_INF_DEFINES_MODULE_TYPE : "_ModuleType",=0D + TAB_INF_DEFINES_BASE_NAME: "_BaseName",=0D + TAB_INF_DEFINES_FILE_GUID: "_Guid",=0D + TAB_INF_DEFINES_MODULE_TYPE: "_ModuleType",=0D #=0D # Optional Fields=0D #=0D # TAB_INF_DEFINES_INF_VERSION : "_AutoGenVersion",= =0D - TAB_INF_DEFINES_COMPONENT_TYPE : "_ComponentType",=0D - TAB_INF_DEFINES_MAKEFILE_NAME : "_MakefileName",=0D + TAB_INF_DEFINES_COMPONENT_TYPE: "_ComponentType",=0D + TAB_INF_DEFINES_MAKEFILE_NAME: "_MakefileName",=0D # TAB_INF_DEFINES_CUSTOM_MAKEFILE : "_CustomMakefile",= =0D - TAB_INF_DEFINES_DPX_SOURCE :"_DxsFile",=0D - TAB_INF_DEFINES_VERSION_NUMBER : "_Version",=0D - TAB_INF_DEFINES_VERSION_STRING : "_Version",=0D - TAB_INF_DEFINES_VERSION : "_Version",=0D - TAB_INF_DEFINES_PCD_IS_DRIVER : "_PcdIsDriver",=0D - TAB_INF_DEFINES_SHADOW : "_Shadow"=0D + TAB_INF_DEFINES_DPX_SOURCE: "_DxsFile",=0D + TAB_INF_DEFINES_VERSION_NUMBER: "_Version",=0D + TAB_INF_DEFINES_VERSION_STRING: "_Version",=0D + TAB_INF_DEFINES_VERSION: "_Version",=0D + TAB_INF_DEFINES_PCD_IS_DRIVER: "_PcdIsDriver",=0D + TAB_INF_DEFINES_SHADOW: "_Shadow"=0D }=0D =0D # regular expression for converting XXX_FLAGS in [nmake] section to ne= w type=0D - _NMAKE_FLAG_PATTERN_ =3D re.compile("(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|A= RCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)=0D + _NMAKE_FLAG_PATTERN_ =3D re.compile(=0D + "(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?",= re.UNICODE)=0D # dict used to convert old tool name used in [nmake] section to new on= es=0D _TOOL_CODE_ =3D {=0D - "C" : "CC",=0D - BINARY_FILE_TYPE_LIB : "SLINK",=0D - "LINK" : "DLINK",=0D + "C": "CC",=0D + BINARY_FILE_TYPE_LIB: "SLINK",=0D + "LINK": "DLINK",=0D }=0D =0D -=0D - ## Constructor of InfBuildData=0D + # Constructor of InfBuildData=0D #=0D # Initialize object of InfBuildData=0D #=0D @@ -105,6 +112,7 @@ class InfBuildData(ModuleBuildClassObject): # @param Platform The name of platform employing this mo= dule=0D # @param Macros Macros used for replacement in DSC fil= e=0D #=0D +=0D def __init__(self, FilePath, RawData, BuildDatabase, Arch=3DTAB_ARCH_C= OMMON, Target=3DNone, Toolchain=3DNone):=0D self.MetaFile =3D FilePath=0D self._ModuleDir =3D FilePath.Dir=0D @@ -145,7 +153,7 @@ class InfBuildData(ModuleBuildClassObject): self.LibInstances =3D []=0D self.ReferenceModules =3D set()=0D =0D - def SetReferenceModule(self,Module):=0D + def SetReferenceModule(self, Module):=0D self.ReferenceModules.add(Module)=0D return self=0D =0D @@ -157,22 +165,22 @@ class InfBuildData(ModuleBuildClassObject): def __getitem__(self, key):=0D return self.__dict__[self._PROPERTY_[key]]=0D =0D - ## "in" test support=0D + # "in" test support=0D def __contains__(self, key):=0D return key in self._PROPERTY_=0D =0D - ## Get current effective macros=0D + # Get current effective macros=0D @cached_property=0D def _Macros(self):=0D RetVal =3D {}=0D return RetVal=0D =0D - ## Get architecture=0D + # Get architecture=0D @cached_property=0D def Arch(self):=0D return self._Arch=0D =0D - ## Return the name of platform employing this module=0D + # Return the name of platform employing this module=0D @cached_property=0D def Platform(self):=0D return self._Platform=0D @@ -185,15 +193,17 @@ class InfBuildData(ModuleBuildClassObject): def TailComments(self):=0D return [a[0] for a in self._RawData[MODEL_META_DATA_TAIL_COMMENT]]= =0D =0D - ## Retrieve all information in [Defines] section=0D + # Retrieve all information in [Defines] section=0D #=0D # (Retrieving all [Defines] information in one-shot is just to save = time.)=0D #=0D @cached_class_function=0D def _GetHeaderInfo(self):=0D - RecordList =3D self._RawData[MODEL_META_DATA_HEADER, self._Arch, s= elf._Platform]=0D + RecordList =3D self._RawData[MODEL_META_DATA_HEADER,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D - Name, Value =3D Record[1], ReplaceMacro(Record[2], self._Macro= s, False)=0D + Name, Value =3D Record[1], ReplaceMacro(=0D + Record[2], self._Macros, False)=0D # items defined _PROPERTY_ don't need additional processing=0D if Name in self:=0D self[Name] =3D Value=0D @@ -208,7 +218,8 @@ class InfBuildData(ModuleBuildClassObject): self._Specification[Name] =3D GetHexVerValue(Value)=0D if self._Specification[Name] is None:=0D EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D - "'%s' format is not supported for %s" = % (Value, Name),=0D + "'%s' format is not supported for %s" = % (=0D + Value, Name),=0D File=3Dself.MetaFile, Line=3DRecord[-1= ])=0D elif Name =3D=3D 'LIBRARY_CLASS':=0D if self._LibraryClass is None:=0D @@ -219,7 +230,8 @@ class InfBuildData(ModuleBuildClassObject): SupModuleList =3D GetSplitValueList(ValueList[1], ' ')= =0D else:=0D SupModuleList =3D SUP_MODULE_LIST=0D - self._LibraryClass.append(LibraryClassObject(LibraryClass,= SupModuleList))=0D + self._LibraryClass.append(=0D + LibraryClassObject(LibraryClass, SupModuleList))=0D elif Name =3D=3D 'ENTRY_POINT':=0D if self._ModuleEntryPointList is None:=0D self._ModuleEntryPointList =3D []=0D @@ -266,38 +278,45 @@ class InfBuildData(ModuleBuildClassObject): EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,=0D "MODULE_TYPE is not given", File=3Dself.MetaFi= le)=0D if self._ModuleType not in SUP_MODULE_LIST:=0D - RecordList =3D self._RawData[MODEL_META_DATA_HEADER, self._Arc= h, self._Platform]=0D + RecordList =3D self._RawData[MODEL_META_DATA_HEADER,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D Name =3D Record[1]=0D if Name =3D=3D "MODULE_TYPE":=0D LineNo =3D Record[6]=0D break=0D EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D - "MODULE_TYPE %s is not supported for EDK II, v= alid values are:\n %s" % (self._ModuleType, ' '.join(l for l in SUP_MODULE_= LIST)),=0D + "MODULE_TYPE %s is not supported for EDK II, v= alid values are:\n %s" % (=0D + self._ModuleType, ' '.join(l for l in SUP_= MODULE_LIST)),=0D File=3Dself.MetaFile, Line=3DLineNo)=0D if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSION= ' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VER= SION'], 16) < 0x0001000A):=0D if self._ModuleType =3D=3D SUP_MODULE_SMM_CORE:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "SMM_CORE m= odule type can't be used in the module with PI_SPECIFICATION_VERSION less t= han 0x0001000A", File=3Dself.MetaFile)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "SMM_CORE module type can't be used in the= module with PI_SPECIFICATION_VERSION less than 0x0001000A", File=3Dself.Me= taFile)=0D if (self._Specification is None) or (not 'PI_SPECIFICATION_VERSION= ' in self._Specification) or (int(self._Specification['PI_SPECIFICATION_VER= SION'], 16) < 0x00010032):=0D if self._ModuleType =3D=3D SUP_MODULE_MM_CORE_STANDALONE:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_CORE_ST= ANDALONE module type can't be used in the module with PI_SPECIFICATION_VERS= ION less than 0x00010032", File=3Dself.MetaFile)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "MM_CORE_STANDALONE module type can't be u= sed in the module with PI_SPECIFICATION_VERSION less than 0x00010032", File= =3Dself.MetaFile)=0D if self._ModuleType =3D=3D SUP_MODULE_MM_STANDALONE:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "MM_STANDAL= ONE module type can't be used in the module with PI_SPECIFICATION_VERSION l= ess than 0x00010032", File=3Dself.MetaFile)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "MM_STANDALONE module type can't be used i= n the module with PI_SPECIFICATION_VERSION less than 0x00010032", File=3Dse= lf.MetaFile)=0D if 'PCI_DEVICE_ID' in self._Defs and 'PCI_VENDOR_ID' in self._Defs= \=0D and 'PCI_CLASS_CODE' in self._Defs and 'PCI_REVISION' in self._= Defs:=0D self._BuildType =3D 'UEFI_OPTIONROM'=0D if 'PCI_COMPRESS' in self._Defs:=0D if self._Defs['PCI_COMPRESS'] not in ('TRUE', 'FALSE'):=0D - EdkLogger.error("build", FORMAT_INVALID, "Expected TRU= E/FALSE for PCI_COMPRESS: %s" % self.MetaFile)=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, "Expected TRUE/FALSE for = PCI_COMPRESS: %s" % self.MetaFile)=0D =0D elif 'UEFI_HII_RESOURCE_SECTION' in self._Defs \=0D - and self._Defs['UEFI_HII_RESOURCE_SECTION'] =3D=3D 'TRUE':=0D + and self._Defs['UEFI_HII_RESOURCE_SECTION'] =3D=3D 'TRUE':= =0D self._BuildType =3D 'UEFI_HII'=0D else:=0D self._BuildType =3D self._ModuleType.upper()=0D =0D if self._DxsFile:=0D - File =3D PathClass(NormPath(self._DxsFile), self._ModuleDir, A= rch=3Dself._Arch)=0D + File =3D PathClass(NormPath(self._DxsFile),=0D + self._ModuleDir, Arch=3Dself._Arch)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate(".dxs", CaseSensitive= =3DFalse)=0D if ErrorCode !=3D 0:=0D @@ -307,11 +326,12 @@ class InfBuildData(ModuleBuildClassObject): self._DependencyFileList =3D []=0D self._DependencyFileList.append(File)=0D =0D - ## Retrieve file version=0D + # Retrieve file version=0D @cached_property=0D def AutoGenVersion(self):=0D RetVal =3D 0x00010000=0D - RecordList =3D self._RawData[MODEL_META_DATA_HEADER, self._Arch, s= elf._Platform]=0D + RecordList =3D self._RawData[MODEL_META_DATA_HEADER,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D if Record[1] =3D=3D TAB_INF_DEFINES_INF_VERSION:=0D if '.' in Record[2]:=0D @@ -324,16 +344,17 @@ class InfBuildData(ModuleBuildClassObject): break=0D return RetVal=0D =0D - ## Retrieve BASE_NAME=0D + # Retrieve BASE_NAME=0D @cached_property=0D def BaseName(self):=0D if self._BaseName is None:=0D self._GetHeaderInfo()=0D if self._BaseName is None:=0D - EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE, "No BASE= _NAME name", File=3Dself.MetaFile)=0D + EdkLogger.error('build', ATTRIBUTE_NOT_AVAILABLE,=0D + "No BASE_NAME name", File=3Dself.MetaFile)= =0D return self._BaseName=0D =0D - ## Retrieve DxsFile=0D + # Retrieve DxsFile=0D @cached_property=0D def DxsFile(self):=0D if self._DxsFile is None:=0D @@ -342,7 +363,7 @@ class InfBuildData(ModuleBuildClassObject): self._DxsFile =3D ''=0D return self._DxsFile=0D =0D - ## Retrieve MODULE_TYPE=0D + # Retrieve MODULE_TYPE=0D @cached_property=0D def ModuleType(self):=0D if self._ModuleType is None:=0D @@ -353,7 +374,7 @@ class InfBuildData(ModuleBuildClassObject): self._ModuleType =3D SUP_MODULE_USER_DEFINED=0D return self._ModuleType=0D =0D - ## Retrieve COMPONENT_TYPE=0D + # Retrieve COMPONENT_TYPE=0D @cached_property=0D def ComponentType(self):=0D if self._ComponentType is None:=0D @@ -362,7 +383,7 @@ class InfBuildData(ModuleBuildClassObject): self._ComponentType =3D SUP_MODULE_USER_DEFINED=0D return self._ComponentType=0D =0D - ## Retrieve "BUILD_TYPE"=0D + # Retrieve "BUILD_TYPE"=0D @cached_property=0D def BuildType(self):=0D if self._BuildType is None:=0D @@ -371,7 +392,7 @@ class InfBuildData(ModuleBuildClassObject): self._BuildType =3D SUP_MODULE_BASE=0D return self._BuildType=0D =0D - ## Retrieve file guid=0D + # Retrieve file guid=0D @cached_property=0D def Guid(self):=0D if self._Guid is None:=0D @@ -380,7 +401,7 @@ class InfBuildData(ModuleBuildClassObject): self._Guid =3D '00000000-0000-0000-0000-000000000000'=0D return self._Guid=0D =0D - ## Retrieve module version=0D + # Retrieve module version=0D @cached_property=0D def Version(self):=0D if self._Version is None:=0D @@ -389,7 +410,7 @@ class InfBuildData(ModuleBuildClassObject): self._Version =3D '0.0'=0D return self._Version=0D =0D - ## Retrieve PCD_IS_DRIVER=0D + # Retrieve PCD_IS_DRIVER=0D @cached_property=0D def PcdIsDriver(self):=0D if self._PcdIsDriver is None:=0D @@ -398,7 +419,7 @@ class InfBuildData(ModuleBuildClassObject): self._PcdIsDriver =3D ''=0D return self._PcdIsDriver=0D =0D - ## Retrieve SHADOW=0D + # Retrieve SHADOW=0D @cached_property=0D def Shadow(self):=0D if self._Shadow is None:=0D @@ -409,7 +430,7 @@ class InfBuildData(ModuleBuildClassObject): self._Shadow =3D False=0D return self._Shadow=0D =0D - ## Retrieve CUSTOM_MAKEFILE=0D + # Retrieve CUSTOM_MAKEFILE=0D @cached_property=0D def CustomMakefile(self):=0D if self._CustomMakefile is None:=0D @@ -418,7 +439,7 @@ class InfBuildData(ModuleBuildClassObject): self._CustomMakefile =3D {}=0D return self._CustomMakefile=0D =0D - ## Retrieve EFI_SPECIFICATION_VERSION=0D + # Retrieve EFI_SPECIFICATION_VERSION=0D @cached_property=0D def Specification(self):=0D if self._Specification is None:=0D @@ -427,7 +448,7 @@ class InfBuildData(ModuleBuildClassObject): self._Specification =3D {}=0D return self._Specification=0D =0D - ## Retrieve LIBRARY_CLASS=0D + # Retrieve LIBRARY_CLASS=0D @cached_property=0D def LibraryClass(self):=0D if self._LibraryClass is None:=0D @@ -436,7 +457,7 @@ class InfBuildData(ModuleBuildClassObject): self._LibraryClass =3D []=0D return self._LibraryClass=0D =0D - ## Retrieve ENTRY_POINT=0D + # Retrieve ENTRY_POINT=0D @cached_property=0D def ModuleEntryPointList(self):=0D if self._ModuleEntryPointList is None:=0D @@ -445,7 +466,7 @@ class InfBuildData(ModuleBuildClassObject): self._ModuleEntryPointList =3D []=0D return self._ModuleEntryPointList=0D =0D - ## Retrieve UNLOAD_IMAGE=0D + # Retrieve UNLOAD_IMAGE=0D @cached_property=0D def ModuleUnloadImageList(self):=0D if self._ModuleUnloadImageList is None:=0D @@ -454,7 +475,7 @@ class InfBuildData(ModuleBuildClassObject): self._ModuleUnloadImageList =3D []=0D return self._ModuleUnloadImageList=0D =0D - ## Retrieve CONSTRUCTOR=0D + # Retrieve CONSTRUCTOR=0D @cached_property=0D def ConstructorList(self):=0D if self._ConstructorList is None:=0D @@ -463,7 +484,7 @@ class InfBuildData(ModuleBuildClassObject): self._ConstructorList =3D []=0D return self._ConstructorList=0D =0D - ## Retrieve DESTRUCTOR=0D + # Retrieve DESTRUCTOR=0D @cached_property=0D def DestructorList(self):=0D if self._DestructorList is None:=0D @@ -472,17 +493,18 @@ class InfBuildData(ModuleBuildClassObject): self._DestructorList =3D []=0D return self._DestructorList=0D =0D - ## Retrieve definies other than above ones=0D + # Retrieve definies other than above ones=0D @cached_property=0D def Defines(self):=0D self._GetHeaderInfo()=0D return self._Defs=0D =0D - ## Retrieve binary files=0D + # Retrieve binary files=0D @cached_class_function=0D def _GetBinaries(self):=0D RetVal =3D []=0D - RecordList =3D self._RawData[MODEL_EFI_BINARY_FILE, self._Arch, se= lf._Platform]=0D + RecordList =3D self._RawData[MODEL_EFI_BINARY_FILE,=0D + self._Arch, self._Platform]=0D Macros =3D self._Macros=0D Macros['PROCESSOR'] =3D self._Arch=0D for Record in RecordList:=0D @@ -497,25 +519,28 @@ class InfBuildData(ModuleBuildClassObject): if len(TokenList) > 1:=0D FeatureFlag =3D Record[1:]=0D =0D - File =3D PathClass(NormPath(Record[1], Macros), self._ModuleDi= r, '', FileType, True, self._Arch, '', Target)=0D + File =3D PathClass(NormPath(=0D + Record[1], Macros), self._ModuleDir, '', FileType, True, s= elf._Arch, '', Target)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate()=0D if ErrorCode !=3D 0:=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInfo,= File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3Dself= .MetaFile, Line=3DLineNo)=0D RetVal.append(File)=0D return RetVal=0D =0D - ## Retrieve binary files with error check.=0D + # Retrieve binary files with error check.=0D @cached_property=0D def Binaries(self):=0D RetVal =3D self._GetBinaries()=0D if GlobalData.gIgnoreSource and not RetVal:=0D ErrorInfo =3D "The INF file does not contain any RetVal to use= in creating the image\n"=0D - EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, ExtraData=3DE= rrorInfo, File=3Dself.MetaFile)=0D + EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,=0D + ExtraData=3DErrorInfo, File=3Dself.MetaFile)=0D =0D return RetVal=0D =0D - ## Retrieve source files=0D + # Retrieve source files=0D @cached_property=0D def Sources(self):=0D self._GetHeaderInfo()=0D @@ -524,7 +549,8 @@ class InfBuildData(ModuleBuildClassObject): return []=0D =0D RetVal =3D []=0D - RecordList =3D self._RawData[MODEL_EFI_SOURCE_FILE, self._Arch, se= lf._Platform]=0D + RecordList =3D self._RawData[MODEL_EFI_SOURCE_FILE,=0D + self._Arch, self._Platform]=0D Macros =3D self._Macros=0D for Record in RecordList:=0D LineNo =3D Record[-1]=0D @@ -543,7 +569,8 @@ class InfBuildData(ModuleBuildClassObject): # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate()=0D if ErrorCode !=3D 0:=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInfo,= File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3Dself= .MetaFile, Line=3DLineNo)=0D =0D RetVal.append(File)=0D # add any previously found dependency files to the source list=0D @@ -551,11 +578,12 @@ class InfBuildData(ModuleBuildClassObject): RetVal.extend(self._DependencyFileList)=0D return RetVal=0D =0D - ## Retrieve library classes employed by this module=0D + # Retrieve library classes employed by this module=0D @cached_property=0D def LibraryClasses(self):=0D RetVal =3D OrderedDict()=0D - RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS, self._Arch, = self._Platform]=0D + RecordList =3D self._RawData[MODEL_EFI_LIBRARY_CLASS,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D Lib =3D Record[0]=0D Instance =3D Record[1]=0D @@ -566,11 +594,12 @@ class InfBuildData(ModuleBuildClassObject): RetVal[Lib] =3D None=0D return RetVal=0D =0D - ## Retrieve library names (for Edk.x style of modules)=0D + # Retrieve library names (for Edk.x style of modules)=0D @cached_property=0D def Libraries(self):=0D RetVal =3D []=0D - RecordList =3D self._RawData[MODEL_EFI_LIBRARY_INSTANCE, self._Arc= h, self._Platform]=0D + RecordList =3D self._RawData[MODEL_EFI_LIBRARY_INSTANCE,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D LibraryName =3D ReplaceMacro(Record[0], self._Macros, False)=0D # in case of name with '.lib' extension, which is unusual in E= dk.x inf=0D @@ -584,12 +613,13 @@ class InfBuildData(ModuleBuildClassObject): self.Protocols=0D return self._ProtocolComments=0D =0D - ## Retrieve protocols consumed/produced by this module=0D + # Retrieve protocols consumed/produced by this module=0D @cached_property=0D def Protocols(self):=0D RetVal =3D OrderedDict()=0D self._ProtocolComments =3D OrderedDict()=0D - RecordList =3D self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self.= _Platform]=0D + RecordList =3D self._RawData[MODEL_EFI_PROTOCOL,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D CName =3D Record[0]=0D Value =3D _ProtocolValue(CName, self.Packages, self.MetaFile.P= ath)=0D @@ -599,7 +629,8 @@ class InfBuildData(ModuleBuildClassObject): "Value of Protocol [%s] is not found under= [Protocols] section in" % CName,=0D ExtraData=3DPackageList, File=3Dself.MetaF= ile, Line=3DRecord[-1])=0D RetVal[CName] =3D Value=0D - CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT, self= ._Arch, self._Platform, Record[5]]=0D + CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT,=0D + self._Arch, self._Platform, Rec= ord[5]]=0D self._ProtocolComments[CName] =3D [a[0] for a in CommentRecord= s]=0D return RetVal=0D =0D @@ -608,7 +639,7 @@ class InfBuildData(ModuleBuildClassObject): self.Ppis=0D return self._PpiComments=0D =0D - ## Retrieve PPIs consumed/produced by this module=0D + # Retrieve PPIs consumed/produced by this module=0D @cached_property=0D def Ppis(self):=0D RetVal =3D OrderedDict()=0D @@ -623,7 +654,8 @@ class InfBuildData(ModuleBuildClassObject): "Value of PPI [%s] is not found under [Ppi= s] section in " % CName,=0D ExtraData=3DPackageList, File=3Dself.MetaF= ile, Line=3DRecord[-1])=0D RetVal[CName] =3D Value=0D - CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT, self= ._Arch, self._Platform, Record[5]]=0D + CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT,=0D + self._Arch, self._Platform, Rec= ord[5]]=0D self._PpiComments[CName] =3D [a[0] for a in CommentRecords]=0D return RetVal=0D =0D @@ -632,7 +664,7 @@ class InfBuildData(ModuleBuildClassObject): self.Guids=0D return self._GuidComments=0D =0D - ## Retrieve GUIDs consumed/produced by this module=0D + # Retrieve GUIDs consumed/produced by this module=0D @cached_property=0D def Guids(self):=0D RetVal =3D OrderedDict()=0D @@ -647,17 +679,20 @@ class InfBuildData(ModuleBuildClassObject): "Value of Guid [%s] is not found under [Gu= ids] section in" % CName,=0D ExtraData=3DPackageList, File=3Dself.MetaF= ile, Line=3DRecord[-1])=0D RetVal[CName] =3D Value=0D - CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT, self= ._Arch, self._Platform, Record[5]]=0D + CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT,=0D + self._Arch, self._Platform, Rec= ord[5]]=0D self._GuidComments[CName] =3D [a[0] for a in CommentRecords]=0D =0D - for Type in [MODEL_PCD_FIXED_AT_BUILD,MODEL_PCD_PATCHABLE_IN_MODUL= E,MODEL_PCD_FEATURE_FLAG,MODEL_PCD_DYNAMIC,MODEL_PCD_DYNAMIC_EX]:=0D + for Type in [MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODU= LE, MODEL_PCD_FEATURE_FLAG, MODEL_PCD_DYNAMIC, MODEL_PCD_DYNAMIC_EX]:=0D RecordList =3D self._RawData[Type, self._Arch, self._Platform]= =0D for TokenSpaceGuid, _, _, _, _, _, LineNo in RecordList:=0D # get the guid value=0D if TokenSpaceGuid not in RetVal:=0D - Value =3D GuidValue(TokenSpaceGuid, self.Packages, sel= f.MetaFile.Path)=0D + Value =3D GuidValue(=0D + TokenSpaceGuid, self.Packages, self.MetaFile.Path)= =0D if Value is None:=0D - PackageList =3D "\n\t".join(str(P) for P in self.P= ackages)=0D + PackageList =3D "\n\t".join(str(P)=0D + for P in self.Packages)= =0D EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,=0D "Value of Guid [%s] is not found u= nder [Guids] section in" % TokenSpaceGuid,=0D ExtraData=3DPackageList, File=3Dse= lf.MetaFile, Line=3DLineNo)=0D @@ -665,13 +700,15 @@ class InfBuildData(ModuleBuildClassObject): self._GuidsUsedByPcd[TokenSpaceGuid] =3D Value=0D return RetVal=0D =0D - ## Retrieve include paths necessary for this module (for Edk.x style o= f modules)=0D + # Retrieve include paths necessary for this module (for Edk.x style of= modules)=0D @cached_property=0D def Includes(self):=0D RetVal =3D []=0D Macros =3D self._Macros=0D - Macros['PROCESSOR'] =3D GlobalData.gEdkGlobal.get('PROCESSOR', sel= f._Arch)=0D - RecordList =3D self._RawData[MODEL_EFI_INCLUDE, self._Arch, self._= Platform]=0D + Macros['PROCESSOR'] =3D GlobalData.gEdkGlobal.get(=0D + 'PROCESSOR', self._Arch)=0D + RecordList =3D self._RawData[MODEL_EFI_INCLUDE,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D File =3D NormPath(Record[0], Macros)=0D if File[0] =3D=3D '.':=0D @@ -683,30 +720,34 @@ class InfBuildData(ModuleBuildClassObject): RetVal.append(File)=0D return RetVal=0D =0D - ## Retrieve packages this module depends on=0D + # Retrieve packages this module depends on=0D @cached_property=0D def Packages(self):=0D RetVal =3D []=0D - RecordList =3D self._RawData[MODEL_META_DATA_PACKAGE, self._Arch, = self._Platform]=0D + RecordList =3D self._RawData[MODEL_META_DATA_PACKAGE,=0D + self._Arch, self._Platform]=0D Macros =3D self._Macros=0D for Record in RecordList:=0D - File =3D PathClass(NormPath(Record[0], Macros), GlobalData.gWo= rkspace, Arch=3Dself._Arch)=0D + File =3D PathClass(=0D + NormPath(Record[0], Macros), GlobalData.gWorkspace, Arch= =3Dself._Arch)=0D # check the file validation=0D ErrorCode, ErrorInfo =3D File.Validate('.dec')=0D if ErrorCode !=3D 0:=0D LineNo =3D Record[-1]=0D - EdkLogger.error('build', ErrorCode, ExtraData=3DErrorInfo,= File=3Dself.MetaFile, Line=3DLineNo)=0D + EdkLogger.error(=0D + 'build', ErrorCode, ExtraData=3DErrorInfo, File=3Dself= .MetaFile, Line=3DLineNo)=0D # parse this package now. we need it to get protocol/ppi/guid = value=0D - RetVal.append(self._Bdb[File, self._Arch, self._Target, self._= Toolchain])=0D + RetVal.append(self._Bdb[File, self._Arch,=0D + self._Target, self._Toolchain])=0D return RetVal=0D =0D - ## Retrieve PCD comments=0D + # Retrieve PCD comments=0D @cached_property=0D def PcdComments(self):=0D self.Pcds=0D return self._PcdComments=0D =0D - ## Retrieve PCDs used in this module=0D + # Retrieve PCDs used in this module=0D @cached_property=0D def Pcds(self):=0D self._PcdComments =3D OrderedDict()=0D @@ -722,6 +763,7 @@ class InfBuildData(ModuleBuildClassObject): def ModulePcdList(self):=0D RetVal =3D self.Pcds=0D return RetVal=0D +=0D @cached_property=0D def LibraryPcdList(self):=0D if bool(self.LibraryClass):=0D @@ -737,21 +779,23 @@ class InfBuildData(ModuleBuildClassObject): PcdsInLibrary[Key] =3D copy.copy(Library.Pcds[Key])=0D RetVal[Library] =3D PcdsInLibrary=0D return RetVal=0D +=0D @cached_property=0D def PcdsName(self):=0D PcdsName =3D set()=0D - for Type in (MODEL_PCD_FIXED_AT_BUILD,MODEL_PCD_PATCHABLE_IN_MODUL= E,MODEL_PCD_FEATURE_FLAG,MODEL_PCD_DYNAMIC,MODEL_PCD_DYNAMIC_EX):=0D + for Type in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODU= LE, MODEL_PCD_FEATURE_FLAG, MODEL_PCD_DYNAMIC, MODEL_PCD_DYNAMIC_EX):=0D RecordList =3D self._RawData[Type, self._Arch, self._Platform]= =0D for TokenSpaceGuid, PcdCName, _, _, _, _, _ in RecordList:=0D PcdsName.add((PcdCName, TokenSpaceGuid))=0D return PcdsName=0D =0D - ## Retrieve build options specific to this module=0D + # Retrieve build options specific to this module=0D @cached_property=0D def BuildOptions(self):=0D if self._BuildOptions is None:=0D self._BuildOptions =3D OrderedDict()=0D - RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION, sel= f._Arch, self._Platform]=0D + RecordList =3D self._RawData[MODEL_META_DATA_BUILD_OPTION,=0D + self._Arch, self._Platform]=0D for Record in RecordList:=0D ToolChainFamily =3D Record[0]=0D ToolChain =3D Record[1]=0D @@ -761,10 +805,11 @@ class InfBuildData(ModuleBuildClassObject): else:=0D # concatenate the option string if they're for the sam= e tool=0D OptionString =3D self._BuildOptions[ToolChainFamily, T= oolChain]=0D - self._BuildOptions[ToolChainFamily, ToolChain] =3D Opt= ionString + " " + Option=0D + self._BuildOptions[ToolChainFamily,=0D + ToolChain] =3D OptionString + " " += Option=0D return self._BuildOptions=0D =0D - ## Retrieve dependency expression=0D + # Retrieve dependency expression=0D @cached_property=0D def Depex(self):=0D RetVal =3D tdict(False, 2)=0D @@ -777,8 +822,8 @@ class InfBuildData(ModuleBuildClassObject): # PEIM and DXE drivers must have a valid [Depex] section=0D if len(self.LibraryClass) =3D=3D 0 and len(RecordList) =3D=3D 0:=0D if self.ModuleType =3D=3D SUP_MODULE_DXE_DRIVER or self.Module= Type =3D=3D SUP_MODULE_PEIM or self.ModuleType =3D=3D SUP_MODULE_DXE_SMM_DR= IVER or \=0D - self.ModuleType =3D=3D SUP_MODULE_DXE_SAL_DRIVER or self.M= oduleType =3D=3D SUP_MODULE_DXE_RUNTIME_DRIVER:=0D - EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No [Depe= x] section or no valid expression in [Depex] section for [%s] module" \=0D + self.ModuleType =3D=3D SUP_MODULE_DXE_SAL_DRIVER or se= lf.ModuleType =3D=3D SUP_MODULE_DXE_RUNTIME_DRIVER:=0D + EdkLogger.error('build', RESOURCE_NOT_AVAILABLE, "No [Depe= x] section or no valid expression in [Depex] section for [%s] module"=0D % self.ModuleType, File=3Dself.MetaFile)=0D =0D if len(RecordList) !=3D 0 and (self.ModuleType =3D=3D SUP_MODULE_U= SER_DEFINED or self.ModuleType =3D=3D SUP_MODULE_HOST_APPLICATION):=0D @@ -811,21 +856,27 @@ class InfBuildData(ModuleBuildClassObject): # it use the Fixed PCD format=0D if '.' in Token:=0D if tuple(Token.split('.')[::-1]) not in self.Pcds:= =0D - EdkLogger.error('build', RESOURCE_NOT_AVAILABL= E, "PCD [{}] used in [Depex] section should be listed in module PCD section= ".format(Token), File=3Dself.MetaFile, Line=3DRecord[-1])=0D + EdkLogger.error('build', RESOURCE_NOT_AVAILABL= E, "PCD [{}] used in [Depex] section should be listed in module PCD section= ".format(=0D + Token), File=3Dself.MetaFile, Line=3DRecor= d[-1])=0D else:=0D if self.Pcds[tuple(Token.split('.')[::-1])].Da= tumType !=3D TAB_VOID:=0D - EdkLogger.error('build', FORMAT_INVALID, "= PCD [{}] used in [Depex] section should be VOID* datum type".format(Token),= File=3Dself.MetaFile, Line=3DRecord[-1])=0D + EdkLogger.error('build', FORMAT_INVALID, "= PCD [{}] used in [Depex] section should be VOID* datum type".format(=0D + Token), File=3Dself.MetaFile, Line=3DR= ecord[-1])=0D Value =3D Token=0D else:=0D # get the GUID value now=0D - Value =3D _ProtocolValue(Token, self.Packages, sel= f.MetaFile.Path)=0D + Value =3D _ProtocolValue(=0D + Token, self.Packages, self.MetaFile.Path)=0D if Value is None:=0D - Value =3D _PpiValue(Token, self.Packages, self= .MetaFile.Path)=0D + Value =3D _PpiValue(=0D + Token, self.Packages, self.MetaFile.Path)= =0D if Value is None:=0D - Value =3D GuidValue(Token, self.Packages, = self.MetaFile.Path)=0D + Value =3D GuidValue(=0D + Token, self.Packages, self.MetaFile.Pa= th)=0D =0D if Value is None:=0D - PackageList =3D "\n\t".join(str(P) for P in self.P= ackages)=0D + PackageList =3D "\n\t".join(str(P)=0D + for P in self.Packages)= =0D EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,=0D "Value of [%s] is not found in" % = Token,=0D ExtraData=3DPackageList, File=3Dse= lf.MetaFile, Line=3DRecord[-1])=0D @@ -834,7 +885,7 @@ class InfBuildData(ModuleBuildClassObject): RetVal[Arch, ModuleType] =3D TemporaryDictionary[Arch, ModuleT= ype]=0D return RetVal=0D =0D - ## Retrieve dependency expression=0D + # Retrieve dependency expression=0D @cached_property=0D def DepexExpression(self):=0D RetVal =3D tdict(False, 2)=0D @@ -848,36 +899,41 @@ class InfBuildData(ModuleBuildClassObject): if (Arch, ModuleType) not in TemporaryDictionary:=0D TemporaryDictionary[Arch, ModuleType] =3D ''=0D for Token in TokenList:=0D - TemporaryDictionary[Arch, ModuleType] =3D TemporaryDiction= ary[Arch, ModuleType] + Token.strip() + ' '=0D + TemporaryDictionary[Arch, ModuleType] =3D TemporaryDiction= ary[Arch,=0D + = ModuleType] + Token.strip() + ' '=0D for Arch, ModuleType in TemporaryDictionary:=0D RetVal[Arch, ModuleType] =3D TemporaryDictionary[Arch, ModuleT= ype]=0D return RetVal=0D +=0D def LocalPkg(self):=0D module_path =3D self.MetaFile.File=0D subdir =3D os.path.split(module_path)[0]=0D TopDir =3D ""=0D while subdir:=0D - subdir,TopDir =3D os.path.split(subdir)=0D + subdir, TopDir =3D os.path.split(subdir)=0D =0D - for file_name in os.listdir(os.path.join(self.MetaFile.Root,TopDir= )):=0D + for file_name in os.listdir(os.path.join(self.MetaFile.Root, TopDi= r)):=0D if file_name.upper().endswith("DEC"):=0D - pkg =3D os.path.join(TopDir,file_name)=0D + pkg =3D os.path.join(TopDir, file_name)=0D return pkg=0D +=0D @cached_class_function=0D def GetGuidsUsedByPcd(self):=0D self.Guid=0D return self._GuidsUsedByPcd=0D =0D - ## Retrieve PCD for given type=0D + # Retrieve PCD for given type=0D def _GetPcd(self, Type):=0D Pcds =3D OrderedDict()=0D PcdDict =3D tdict(True, 4)=0D PcdList =3D []=0D RecordList =3D self._RawData[Type, self._Arch, self._Platform]=0D for TokenSpaceGuid, PcdCName, Setting, Arch, Platform, Id, LineNo = in RecordList:=0D - PcdDict[Arch, Platform, PcdCName, TokenSpaceGuid] =3D (Setting= , LineNo)=0D + PcdDict[Arch, Platform, PcdCName,=0D + TokenSpaceGuid] =3D (Setting, LineNo)=0D PcdList.append((PcdCName, TokenSpaceGuid))=0D - CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT, self= ._Arch, self._Platform, Id]=0D + CommentRecords =3D self._RawData[MODEL_META_DATA_COMMENT,=0D + self._Arch, self._Platform, Id]= =0D Comments =3D []=0D for CmtRec in CommentRecords:=0D Comments.append(CmtRec[0])=0D @@ -887,23 +943,24 @@ class InfBuildData(ModuleBuildClassObject): _GuidDict =3D self.Guids.copy()=0D for PcdCName, TokenSpaceGuid in PcdList:=0D PcdRealName =3D PcdCName=0D - Setting, LineNo =3D PcdDict[self._Arch, self.Platform, PcdCNam= e, TokenSpaceGuid]=0D + Setting, LineNo =3D PcdDict[self._Arch,=0D + self.Platform, PcdCName, TokenSpaceG= uid]=0D if Setting is None:=0D continue=0D ValueList =3D AnalyzePcdData(Setting)=0D DefaultValue =3D ValueList[0]=0D Pcd =3D PcdClassObject(=0D - PcdCName,=0D - TokenSpaceGuid,=0D - '',=0D - '',=0D - DefaultValue,=0D - '',=0D - '',=0D - {},=0D - False,=0D - self.Guids[TokenSpaceGuid]=0D - )=0D + PcdCName,=0D + TokenSpaceGuid,=0D + '',=0D + '',=0D + DefaultValue,=0D + '',=0D + '',=0D + {},=0D + False,=0D + self.Guids[TokenSpaceGuid]=0D + )=0D if Type =3D=3D MODEL_PCD_PATCHABLE_IN_MODULE and ValueList[1]:= =0D # Patch PCD: TokenSpace.PcdCName|Value|Offset=0D Pcd.Offset =3D ValueList[1]=0D @@ -916,11 +973,13 @@ class InfBuildData(ModuleBuildClassObject): Pcd_Type =3D item[0].split('_')[-1]=0D if Pcd_Type =3D=3D Package.Pcds[key].Type:= =0D Value =3D Package.Pcds[key]=0D - Value.TokenCName =3D Package.Pcds[key]= .TokenCName + '_' + Pcd_Type=0D + Value.TokenCName =3D Package.Pcds[key]= .TokenCName + \=0D + '_' + Pcd_Type=0D if len(key) =3D=3D 2:=0D newkey =3D (Value.TokenCName, key[= 1])=0D elif len(key) =3D=3D 3:=0D - newkey =3D (Value.TokenCName, key[= 1], key[2])=0D + newkey =3D (Value.TokenCName,=0D + key[1], key[2])=0D del Package.Pcds[key]=0D Package.Pcds[newkey] =3D Value=0D break=0D @@ -971,7 +1030,8 @@ class InfBuildData(ModuleBuildClassObject): pass=0D =0D if (PcdCName, TokenSpaceGuid, PcdType) in Package.Pcds:=0D - PcdInPackage =3D Package.Pcds[PcdCName, TokenSpaceGuid= , PcdType]=0D + PcdInPackage =3D Package.Pcds[PcdCName,=0D + TokenSpaceGuid, PcdType]=0D Pcd.Type =3D PcdType=0D Pcd.TokenValue =3D PcdInPackage.TokenValue=0D =0D @@ -980,48 +1040,53 @@ class InfBuildData(ModuleBuildClassObject): #=0D if Pcd.TokenValue is None or Pcd.TokenValue =3D=3D "":= =0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "No TokenValue for PCD [%s.%s] in [%s]!" %= (TokenSpaceGuid, PcdRealName, str(Package)),=0D - File=3Dself.MetaFile, Line=3DLineNo,=0D - ExtraData=3DNone=0D - )=0D + 'build',=0D + FORMAT_INVALID,=0D + "No TokenValue for PCD [%s.%s] in [%s]!" % (=0D + TokenSpaceGuid, PcdRealName, str(Package))= ,=0D + File=3Dself.MetaFile, Line=3DLineNo,=0D + ExtraData=3DNone=0D + )=0D #=0D # Check hexadecimal token value length and format.=0D #=0D - ReIsValidPcdTokenValue =3D re.compile(r"^[0][x|X][0]*[= 0-9a-fA-F]{1,8}$", re.DOTALL)=0D + ReIsValidPcdTokenValue =3D re.compile(=0D + r"^[0][x|X][0]*[0-9a-fA-F]{1,8}$", re.DOTALL)=0D if Pcd.TokenValue.startswith("0x") or Pcd.TokenValue.s= tartswith("0X"):=0D if ReIsValidPcdTokenValue.match(Pcd.TokenValue) is= None:=0D EdkLogger.error(=0D + 'build',=0D + FORMAT_INVALID,=0D + "The format of TokenValue [%s] of PCD [%s.= %s] in [%s] is invalid:" % (=0D + Pcd.TokenValue, TokenSpaceGuid, PcdRea= lName, str(Package)),=0D + File=3Dself.MetaFile, Line=3DLineNo,=0D + ExtraData=3DNone=0D + )=0D +=0D + #=0D + # Check decimal token value length and format.=0D + #=0D + else:=0D + try:=0D + TokenValueInt =3D int(Pcd.TokenValue, 10)=0D + if (TokenValueInt < 0 or TokenValueInt > 42949= 67295):=0D + EdkLogger.error(=0D 'build',=0D FORMAT_INVALID,=0D - "The format of TokenValue [%s] of PCD = [%s.%s] in [%s] is invalid:" % (Pcd.TokenValue, TokenSpaceGuid, PcdRealName= , str(Package)),=0D + "The format of TokenValue [%s] of PCD = [%s.%s] in [%s] is invalid, as a decimal it should between: 0 - 4294967295!= " % (=0D + Pcd.TokenValue, TokenSpaceGuid, Pc= dRealName, str(Package)),=0D File=3Dself.MetaFile, Line=3DLineNo,=0D ExtraData=3DNone=0D - )=0D -=0D - #=0D - # Check decimal token value length and format.=0D - #=0D - else:=0D - try:=0D - TokenValueInt =3D int (Pcd.TokenValue, 10)=0D - if (TokenValueInt < 0 or TokenValueInt > 42949= 67295):=0D - EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "The format of TokenValue [%s]= of PCD [%s.%s] in [%s] is invalid, as a decimal it should between: 0 - 429= 4967295!" % (Pcd.TokenValue, TokenSpaceGuid, PcdRealName, str(Package)),=0D - File=3Dself.MetaFile, Line=3DL= ineNo,=0D - ExtraData=3DNone=0D - )=0D + )=0D except:=0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "The format of TokenValue [%s] of = PCD [%s.%s] in [%s] is invalid, it should be hexadecimal or decimal!" % (Pc= d.TokenValue, TokenSpaceGuid, PcdRealName, str(Package)),=0D - File=3Dself.MetaFile, Line=3DLineN= o,=0D - ExtraData=3DNone=0D - )=0D + 'build',=0D + FORMAT_INVALID,=0D + "The format of TokenValue [%s] of PCD [%s.= %s] in [%s] is invalid, it should be hexadecimal or decimal!" % (=0D + Pcd.TokenValue, TokenSpaceGuid, PcdRea= lName, str(Package)),=0D + File=3Dself.MetaFile, Line=3DLineNo,=0D + ExtraData=3DNone=0D + )=0D =0D Pcd.DatumType =3D PcdInPackage.DatumType=0D Pcd.MaxDatumSize =3D PcdInPackage.MaxDatumSize=0D @@ -1030,30 +1095,34 @@ class InfBuildData(ModuleBuildClassObject): Pcd.DefaultValue =3D PcdInPackage.DefaultValue=0D else:=0D try:=0D - Pcd.DefaultValue =3D ValueExpressionEx(Pcd.Def= aultValue, Pcd.DatumType, _GuidDict)(True)=0D + Pcd.DefaultValue =3D ValueExpressionEx(=0D + Pcd.DefaultValue, Pcd.DatumType, _GuidDict= )(True)=0D except BadExpression as Value:=0D - EdkLogger.error('Parser', FORMAT_INVALID, 'PCD= [%s.%s] Value "%s", %s' %(TokenSpaceGuid, PcdRealName, Pcd.DefaultValue, V= alue),=0D + EdkLogger.error('Parser', FORMAT_INVALID, 'PCD= [%s.%s] Value "%s", %s' % (TokenSpaceGuid, PcdRealName, Pcd.DefaultValue, = Value),=0D File=3Dself.MetaFile, Line=3DL= ineNo)=0D break=0D else:=0D EdkLogger.error(=0D - 'build',=0D - FORMAT_INVALID,=0D - "PCD [%s.%s] in [%s] is not found in dependent= packages:" % (TokenSpaceGuid, PcdRealName, self.MetaFile),=0D - File=3Dself.MetaFile, Line=3DLineNo,=0D - ExtraData=3D"\t%s" % '\n\t'.join(str(P) for P = in self.Packages)=0D - )=0D + 'build',=0D + FORMAT_INVALID,=0D + "PCD [%s.%s] in [%s] is not found in dependent package= s:" % (=0D + TokenSpaceGuid, PcdRealName, self.MetaFile),=0D + File=3Dself.MetaFile, Line=3DLineNo,=0D + ExtraData=3D"\t%s" % '\n\t'.join(=0D + str(P) for P in self.Packages)=0D + )=0D Pcds[PcdCName, TokenSpaceGuid] =3D Pcd=0D =0D return Pcds=0D =0D - ## check whether current module is binary module=0D + # check whether current module is binary module=0D @property=0D def IsBinaryModule(self):=0D if (self.Binaries and not self.Sources) or GlobalData.gIgnoreSourc= e:=0D return True=0D return False=0D - def CheckFeatureFlagPcd(self,Instance):=0D +=0D + def CheckFeatureFlagPcd(self, Instance):=0D Pcds =3D GlobalData.gPlatformFinalPcds.copy()=0D if PcdPattern.search(Instance):=0D PcdTuple =3D tuple(Instance.split('.')[::-1])=0D @@ -1064,7 +1133,7 @@ class InfBuildData(ModuleBuildClassObject): File=3Dstr(self), ExtraData=3DInstance= )=0D if not Instance in Pcds:=0D Pcds[Instance] =3D self.Pcds[PcdTuple].DefaultValue=0D - else: #if PcdTuple not in self.Pcds:=0D + else: # if PcdTuple not in self.Pcds:=0D EdkLogger.error('build', FORMAT_INVALID,=0D "\nFeatureFlagPcd must be defined in [Feat= urePcd] or [FixedPcd] of Inf file",=0D File=3Dstr(self), ExtraData=3DInstance)=0D @@ -1079,22 +1148,27 @@ class InfBuildData(ModuleBuildClassObject): return True=0D return False=0D except:=0D - EdkLogger.warn('build', FORMAT_INVALID,"The FeatureFlagExp= ression cannot be evaluated", File=3Dstr(self), ExtraData=3DInstance)=0D + EdkLogger.warn('build', FORMAT_INVALID, "The FeatureFlagEx= pression cannot be evaluated", File=3Dstr(=0D + self), ExtraData=3DInstance)=0D return False=0D else:=0D for Name, Guid in self.Pcds:=0D if self.Pcds[(Name, Guid)].Type =3D=3D 'FeatureFlag' or se= lf.Pcds[(Name, Guid)].Type =3D=3D 'FixedAtBuild':=0D - PcdFullName =3D '%s.%s' % (Guid, Name);=0D + PcdFullName =3D '%s.%s' % (Guid, Name)=0D if not PcdFullName in Pcds:=0D - Pcds[PcdFullName] =3D self.Pcds[(Name, Guid)].Defa= ultValue=0D + Pcds[PcdFullName] =3D self.Pcds[(=0D + Name, Guid)].DefaultValue=0D try:=0D Value =3D ValueExpression(Instance, Pcds)()=0D if Value =3D=3D True:=0D return True=0D return False=0D except:=0D - EdkLogger.warn('build', FORMAT_INVALID, "The FeatureFlagEx= pression cannot be evaluated", File=3Dstr(self), ExtraData=3DInstance)=0D + EdkLogger.warn('build', FORMAT_INVALID, "The FeatureFlagEx= pression cannot be evaluated", File=3Dstr(=0D + self), ExtraData=3DInstance)=0D return False=0D +=0D +=0D def ExtendCopyDictionaryLists(CopyToDict, CopyFromDict):=0D for Key in CopyFromDict:=0D CopyToDict[Key].extend(CopyFromDict[Key])=0D diff --git a/BaseTools/Source/Python/Workspace/MetaDataTable.py b/BaseTools= /Source/Python/Workspace/MetaDataTable.py index a20bd147846b..79d21c4140cd 100644 --- a/BaseTools/Source/Python/Workspace/MetaDataTable.py +++ b/BaseTools/Source/Python/Workspace/MetaDataTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase table for files=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -14,11 +14,13 @@ import Common.EdkLogger as EdkLogger from CommonDataClass import DataClass=0D from CommonDataClass.DataClass import FileClass=0D =0D -## Convert to SQL required string format=0D +# Convert to SQL required string format=0D +=0D +=0D def ConvertToSqlString(StringList):=0D return list(map(lambda s: "'" + s.replace("'", "''") + "'", StringList= ))=0D =0D -## TableFile=0D +# TableFile=0D #=0D # This class defined a common table=0D #=0D @@ -27,6 +29,8 @@ def ConvertToSqlString(StringList): # @param Cursor: Cursor of the database=0D # @param TableName: Name of the table=0D #=0D +=0D +=0D class Table(object):=0D _COLUMN_ =3D ''=0D _ID_STEP_ =3D 1=0D @@ -44,7 +48,7 @@ class Table(object): def __str__(self):=0D return self.Table=0D =0D - ## Create table=0D + # Create table=0D #=0D # Create a table=0D #=0D @@ -52,7 +56,7 @@ class Table(object): self.Db.CreateEmptyTable(self.Table)=0D self.ID =3D self.GetId()=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into a table=0D #=0D @@ -66,18 +70,17 @@ class Table(object): =0D return self.ID=0D =0D -=0D - ## Get count=0D + # Get count=0D #=0D # Get a count of all records of the table=0D #=0D # @retval Count: Total count of all records=0D #=0D +=0D def GetCount(self):=0D tab =3D self.Db.GetTable(self.Table)=0D return len(tab)=0D =0D -=0D def GetId(self):=0D tab =3D self.Db.GetTable(self.Table)=0D Id =3D max([int(item[0]) for item in tab])=0D @@ -85,14 +88,14 @@ class Table(object): Id =3D self.IdBase=0D return Id=0D =0D - ## Init the ID of the table=0D + # Init the ID of the table=0D #=0D # Init the ID of the table=0D #=0D def InitID(self):=0D self.ID =3D self.GetId()=0D =0D - ## Exec=0D + # Exec=0D #=0D # Exec Sql Command, return result=0D #=0D @@ -110,7 +113,6 @@ class Table(object): Tab =3D self.Db.GetTable(self.Table)=0D Tab.append(self._DUMMY_)=0D =0D -=0D def IsIntegral(self):=0D tab =3D self.Db.GetTable(self.Table)=0D Id =3D min([int(item[0]) for item in tab])=0D @@ -123,7 +125,7 @@ class Table(object): return tab=0D =0D =0D -## TableFile=0D +# TableFile=0D #=0D # This class defined a table used for file=0D #=0D @@ -140,10 +142,11 @@ class TableFile(Table): TimeStamp SINGLE NOT NULL,=0D FromItem REAL NOT NULL=0D '''=0D +=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor, 'File')=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table File=0D #=0D @@ -155,7 +158,8 @@ class TableFile(Table): # @param TimeStamp: TimeStamp of a File=0D #=0D def Insert(self, Name, ExtName, Path, FullPath, Model, TimeStamp, From= Item=3D0):=0D - (Name, ExtName, Path, FullPath) =3D ConvertToSqlString((Name, ExtN= ame, Path, FullPath))=0D + (Name, ExtName, Path, FullPath) =3D ConvertToSqlString(=0D + (Name, ExtName, Path, FullPath))=0D return Table.Insert(=0D self,=0D Name,=0D @@ -165,9 +169,9 @@ class TableFile(Table): Model,=0D TimeStamp,=0D FromItem=0D - )=0D + )=0D =0D - ## InsertFile=0D + # InsertFile=0D #=0D # Insert one file to table=0D #=0D @@ -179,76 +183,82 @@ class TableFile(Table): def InsertFile(self, File, Model, FromItem=3D''):=0D if FromItem:=0D return self.Insert(=0D - File.Name,=0D - File.Ext,=0D - File.Dir,=0D - File.Path,=0D - Model,=0D - File.TimeStamp,=0D - FromItem=0D - )=0D + File.Name,=0D + File.Ext,=0D + File.Dir,=0D + File.Path,=0D + Model,=0D + File.TimeStamp,=0D + FromItem=0D + )=0D return self.Insert(=0D - File.Name,=0D - File.Ext,=0D - File.Dir,=0D - File.Path,=0D - Model,=0D - File.TimeStamp=0D - )=0D + File.Name,=0D + File.Ext,=0D + File.Dir,=0D + File.Path,=0D + Model,=0D + File.TimeStamp=0D + )=0D =0D - ## Get type of a given file=0D + # Get type of a given file=0D #=0D # @param FileId ID of a file=0D #=0D # @retval file_type Model value of given file in the table=0D #=0D def GetFileType(self, FileId):=0D - QueryScript =3D "select Model from %s where ID =3D '%s'" % (self.T= able, FileId)=0D + QueryScript =3D "select Model from %s where ID =3D '%s'" % (=0D + self.Table, FileId)=0D RecordList =3D self.Exec(QueryScript)=0D if len(RecordList) =3D=3D 0:=0D return None=0D return RecordList[0][0]=0D =0D - ## Get file timestamp of a given file=0D + # Get file timestamp of a given file=0D #=0D # @param FileId ID of file=0D #=0D # @retval timestamp TimeStamp value of given file in the table=0D #=0D def GetFileTimeStamp(self, FileId):=0D - QueryScript =3D "select TimeStamp from %s where ID =3D '%s'" % (se= lf.Table, FileId)=0D + QueryScript =3D "select TimeStamp from %s where ID =3D '%s'" % (=0D + self.Table, FileId)=0D RecordList =3D self.Exec(QueryScript)=0D if len(RecordList) =3D=3D 0:=0D return None=0D return RecordList[0][0]=0D =0D - ## Update the timestamp of a given file=0D + # Update the timestamp of a given file=0D #=0D # @param FileId ID of file=0D # @param TimeStamp Time stamp of file=0D #=0D def SetFileTimeStamp(self, FileId, TimeStamp):=0D - self.Exec("update %s set TimeStamp=3D%s where ID=3D'%s'" % (self.T= able, TimeStamp, FileId))=0D + self.Exec("update %s set TimeStamp=3D%s where ID=3D'%s'" %=0D + (self.Table, TimeStamp, FileId))=0D =0D - ## Get list of file with given type=0D + # Get list of file with given type=0D #=0D # @param FileType Type value of file=0D #=0D # @retval file_list List of files with the given type=0D #=0D def GetFileList(self, FileType):=0D - RecordList =3D self.Exec("select FullPath from %s where Model=3D%s= " % (self.Table, FileType))=0D + RecordList =3D self.Exec(=0D + "select FullPath from %s where Model=3D%s" % (self.Table, File= Type))=0D if len(RecordList) =3D=3D 0:=0D return []=0D return [R[0] for R in RecordList]=0D =0D -## TableDataModel=0D +# TableDataModel=0D #=0D # This class defined a table used for data model=0D #=0D # @param object: Inherited from object class=0D #=0D #=0D +=0D +=0D class TableDataModel(Table):=0D _COLUMN_ =3D """=0D ID INTEGER PRIMARY KEY,=0D @@ -256,10 +266,11 @@ class TableDataModel(Table): Name VARCHAR NOT NULL,=0D Description VARCHAR=0D """=0D +=0D def __init__(self, Cursor):=0D Table.__init__(self, Cursor, 'DataModel')=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table DataModel=0D #=0D @@ -272,7 +283,7 @@ class TableDataModel(Table): (Name, Description) =3D ConvertToSqlString((Name, Description))=0D return Table.Insert(self, CrossIndex, Name, Description)=0D =0D - ## Init table=0D + # Init table=0D #=0D # Create all default records of table DataModel=0D #=0D @@ -288,7 +299,7 @@ class TableDataModel(Table): self.Insert(CrossIndex, Name, Description)=0D EdkLogger.verbose("Initialize table DataModel ... DONE!")=0D =0D - ## Get CrossIndex=0D + # Get CrossIndex=0D #=0D # Get a model's cross index from its name=0D #=0D @@ -303,4 +314,3 @@ class TableDataModel(Table): CrossIndex =3D Item[0]=0D =0D return CrossIndex=0D -=0D diff --git a/BaseTools/Source/Python/Workspace/MetaFileCommentParser.py b/B= aseTools/Source/Python/Workspace/MetaFileCommentParser.py index 3737ae3511c2..01363c10a96b 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileCommentParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileCommentParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to check format of comments=0D #=0D # Copyright (c) 2012, Intel Corporation. All rights reserved.
        =0D @@ -20,19 +20,24 @@ UsageList =3D ("PRODUCES", "PRODUCED", "ALWAYS_PRODUCES= ", "ALWAYS_PRODUCED", "SOME "SOMETIMES_PRODUCED", "CONSUMES", "CONSUMED", "ALWAYS_CONSUME= S", "ALWAYS_CONSUMED",=0D "SOMETIMES_CONSUMES", "SOMETIMES_CONSUMED", "SOMETIME_CONSUME= S")=0D ErrorMsgMap =3D {=0D - MODEL_EFI_GUID : "The usage for this GUID is not listed in this I= NF: %s[%d]:%s",=0D - MODEL_EFI_PPI : "The usage for this PPI is not listed in this IN= F: %s[%d]:%s.",=0D - MODEL_EFI_PROTOCOL : "The usage for this Protocol is not listed in th= is INF: %s[%d]:%s.",=0D - MODEL_PCD_DYNAMIC : "The usage for this PCD is not listed in this IN= F: %s[%d]:%s."=0D + MODEL_EFI_GUID: "The usage for this GUID is not listed in this INF: %s= [%d]:%s",=0D + MODEL_EFI_PPI: "The usage for this PPI is not listed in this INF: %s[%= d]:%s.",=0D + MODEL_EFI_PROTOCOL: "The usage for this Protocol is not listed in this= INF: %s[%d]:%s.",=0D + MODEL_PCD_DYNAMIC: "The usage for this PCD is not listed in this INF: = %s[%d]:%s."=0D }=0D =0D +=0D def CheckInfComment(SectionType, Comments, InfFile, LineNo, ValueList):=0D if SectionType in [MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_EX= , MODEL_PCD_DYNAMIC]:=0D - CheckUsage(Comments, UsageList, InfFile, LineNo, ValueList[0]+'.'+= ValueList[1], ErrorMsgMap[MODEL_PCD_DYNAMIC])=0D + CheckUsage(Comments, UsageList, InfFile, LineNo,=0D + ValueList[0]+'.'+ValueList[1], ErrorMsgMap[MODEL_PCD_DY= NAMIC])=0D elif SectionType in [MODEL_EFI_GUID, MODEL_EFI_PPI]:=0D - CheckUsage(Comments, UsageList, InfFile, LineNo, ValueList[0], Err= orMsgMap[SectionType])=0D + CheckUsage(Comments, UsageList, InfFile, LineNo,=0D + ValueList[0], ErrorMsgMap[SectionType])=0D elif SectionType =3D=3D MODEL_EFI_PROTOCOL:=0D - CheckUsage(Comments, UsageList + ("TO_START", "BY_START"), InfFile= , LineNo, ValueList[0], ErrorMsgMap[SectionType])=0D + CheckUsage(Comments, UsageList + ("TO_START", "BY_START"),=0D + InfFile, LineNo, ValueList[0], ErrorMsgMap[SectionType]= )=0D +=0D =0D def CheckUsage(Comments, Usages, InfFile, LineNo, Value, ErrorMsg):=0D for Comment in Comments:=0D diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index 3508591b281e..ea40cc5fcd41 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to parse meta files=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -32,12 +32,14 @@ from .MetaFileTable import MetaFileStorage from .MetaFileCommentParser import CheckInfComment=0D from Common.DataType import TAB_COMMENT_EDK_START, TAB_COMMENT_EDK_END=0D =0D -## RegEx for finding file versions=0D +# RegEx for finding file versions=0D hexVersionPattern =3D re.compile(r'0[xX][\da-f-A-F]{5,8}')=0D decVersionPattern =3D re.compile(r'\d+\.\d+')=0D CODEPattern =3D re.compile(r"{CODE\([a-fA-F0-9Xx\{\},\s]*\)}")=0D =0D -## A decorator used to parse macro definition=0D +# A decorator used to parse macro definition=0D +=0D +=0D def ParseMacro(Parser):=0D def MacroParser(self):=0D Match =3D GlobalData.gMacroDefPattern.match(self._CurrentLine)=0D @@ -46,7 +48,8 @@ def ParseMacro(Parser): Parser(self)=0D return=0D =0D - TokenList =3D GetSplitValueList(self._CurrentLine[Match.end(1):], = TAB_EQUAL_SPLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + self._CurrentLine[Match.end(1):], TAB_EQUAL_SPLIT, 1)=0D # Syntax check=0D if not TokenList[0]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No macro name given= ",=0D @@ -103,7 +106,7 @@ def ParseMacro(Parser): =0D return MacroParser=0D =0D -## Base class of parser=0D +# Base class of parser=0D #=0D # This class is used for derivation purpose. The specific parser for one = kind=0D # type file must derive this class and implement some public interfaces.=0D @@ -115,6 +118,8 @@ def ParseMacro(Parser): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INCLUDE= directive)=0D #=0D +=0D +=0D class MetaFileParser(object):=0D # data type (file content) for specific file type=0D DataType =3D {}=0D @@ -122,7 +127,7 @@ class MetaFileParser(object): # Parser objects used to implement singleton=0D MetaFiles =3D {}=0D =0D - ## Factory method=0D + # Factory method=0D #=0D # One file, one parser object. This factory method makes sure that the= re's=0D # only one object constructed for one meta file.=0D @@ -141,7 +146,7 @@ class MetaFileParser(object): Class.MetaFiles[FilePath] =3D ParserObject=0D return ParserObject=0D =0D - ## Constructor of MetaFileParser=0D + # Constructor of MetaFileParser=0D #=0D # Initialize object of MetaFileParser=0D #=0D @@ -152,7 +157,7 @@ class MetaFileParser(object): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INC= LUDE directive)=0D #=0D - def __init__(self, FilePath, FileType, Arch, Table, Owner=3D -1, From= =3D -1):=0D + def __init__(self, FilePath, FileType, Arch, Table, Owner=3D-1, From= =3D-1):=0D self._Table =3D Table=0D self._RawTable =3D Table=0D self._Arch =3D Arch=0D @@ -191,19 +196,19 @@ class MetaFileParser(object): self._PcdDataTypeCODE =3D False=0D self._CurrentPcdName =3D ""=0D =0D - ## Store the parsed data in table=0D + # Store the parsed data in table=0D def _Store(self, *Args):=0D return self._Table.Insert(*Args)=0D =0D - ## Virtual method for starting parse=0D + # Virtual method for starting parse=0D def Start(self):=0D raise NotImplementedError=0D =0D - ## Notify a post-process is needed=0D + # Notify a post-process is needed=0D def DoPostProcess(self):=0D self._PostProcessed =3D False=0D =0D - ## Set parsing complete flag in both class and table=0D + # Set parsing complete flag in both class and table=0D def _Done(self):=0D self._Finished =3D True=0D self._Table.SetEndFlag()=0D @@ -211,17 +216,17 @@ class MetaFileParser(object): def _PostProcess(self):=0D self._PostProcessed =3D True=0D =0D - ## Get the parse complete flag=0D + # Get the parse complete flag=0D @property=0D def Finished(self):=0D return self._Finished=0D =0D - ## Set the complete flag=0D + # Set the complete flag=0D @Finished.setter=0D def Finished(self, Value):=0D self._Finished =3D Value=0D =0D - ## Remove records that do not match given Filter Arch=0D + # Remove records that do not match given Filter Arch=0D def _FilterRecordList(self, RecordList, FilterArch):=0D NewRecordList =3D []=0D for Record in RecordList:=0D @@ -230,7 +235,7 @@ class MetaFileParser(object): NewRecordList.append(Record)=0D return NewRecordList=0D =0D - ## Use [] style to query data in table, just for readability=0D + # Use [] style to query data in table, just for readability=0D #=0D # DataInfo =3D [data_type, scope1(arch), scope2(platform/moduletype)= ]=0D #=0D @@ -259,18 +264,19 @@ class MetaFileParser(object): self._Table =3D self._RawTable=0D self._PostProcessed =3D False=0D self.Start()=0D - ## Data parser for the common format in different type of file=0D + # Data parser for the common format in different type of file=0D #=0D # The common format in the meatfile is like=0D #=0D # xxx1 | xxx2 | xxx3=0D #=0D +=0D @ParseMacro=0D def _CommonParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= )=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D - ## Data parser for the format in which there's path=0D + # Data parser for the format in which there's path=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -281,19 +287,20 @@ class MetaFileParser(object): # Don't do macro replacement for dsc file at this point=0D if not isinstance(self, DscParser):=0D Macros =3D self._Macros=0D - self._ValueList =3D [ReplaceMacro(Value, Macros) for Value in = self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, Macros)=0D + for Value in self._ValueList]=0D =0D - ## Skip unsupported data=0D + # Skip unsupported data=0D def _Skip(self):=0D EdkLogger.warn("Parser", "Unrecognized content", File=3Dself.MetaF= ile,=0D - Line=3Dself._LineIndex + 1, ExtraData=3Dself._Curr= entLine);=0D + Line=3Dself._LineIndex + 1, ExtraData=3Dself._Curre= ntLine)=0D self._ValueList[0:1] =3D [self._CurrentLine]=0D =0D - ## Skip unsupported data for UserExtension Section=0D + # Skip unsupported data for UserExtension Section=0D def _SkipUserExtension(self):=0D self._ValueList[0:1] =3D [self._CurrentLine]=0D =0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D @@ -353,14 +360,14 @@ class MetaFileParser(object): # If the section information is needed later, it should be stored = in database=0D self._ValueList[0] =3D self._SectionName=0D =0D - ## [packages] section parser=0D + # [packages] section parser=0D @ParseMacro=0D def _PackageParser(self):=0D self._CurrentLine =3D CleanString(self._CurrentLine)=0D self._Packages.append(self._CurrentLine)=0D self._ValueList[0] =3D self._CurrentLine=0D =0D - ## [defines] section parser=0D + # [defines] section parser=0D @ParseMacro=0D def _DefineParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -372,15 +379,18 @@ class MetaFileParser(object): EdkLogger.error('Parser', FORMAT_INVALID, "No value specified"= ,=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D =0D - self._ValueList =3D [ReplaceMacro(Value, self._Macros) for Value i= n self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, self._Macros)=0D + for Value in self._ValueList]=0D Name, Value =3D self._ValueList[1], self._ValueList[2]=0D MacroUsed =3D GlobalData.gMacroRefPattern.findall(Value)=0D if len(MacroUsed) !=3D 0:=0D for Macro in MacroUsed:=0D if Macro in GlobalData.gGlobalDefines:=0D - EdkLogger.error("Parser", FORMAT_INVALID, "Global macr= o %s is not permitted." % (Macro), ExtraData=3Dself._CurrentLine, File=3Dse= lf.MetaFile, Line=3Dself._LineIndex + 1)=0D + EdkLogger.error("Parser", FORMAT_INVALID, "Global macr= o %s is not permitted." % (=0D + Macro), ExtraData=3Dself._CurrentLine, File=3Dself= .MetaFile, Line=3Dself._LineIndex + 1)=0D else:=0D - EdkLogger.error("Parser", FORMAT_INVALID, "%s not defined"= % (Macro), ExtraData=3Dself._CurrentLine, File=3Dself.MetaFile, Line=3Dsel= f._LineIndex + 1)=0D + EdkLogger.error("Parser", FORMAT_INVALID, "%s not defined"= % (=0D + Macro), ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D # Sometimes, we need to make differences between EDK and EDK2 modu= les=0D if Name =3D=3D 'INF_VERSION':=0D if hexVersionPattern.match(Value):=0D @@ -402,7 +412,7 @@ class MetaFileParser(object): self._FileLocalMacros[Name] =3D Value=0D self._Defines[Name] =3D Value=0D =0D - ## [BuildOptions] section parser=0D + # [BuildOptions] section parser=0D @ParseMacro=0D def _BuildOptionParser(self):=0D self._CurrentLine =3D CleanString(self._CurrentLine, BuildOption= =3DTrue)=0D @@ -413,18 +423,20 @@ class MetaFileParser(object): self._ValueList[1] =3D TokenList2[1] # keys=0D else:=0D self._ValueList[1] =3D TokenList[0]=0D - if len(TokenList) =3D=3D 2 and not isinstance(self, DscParser): # = value=0D + if len(TokenList) =3D=3D 2 and not isinstance(self, DscParser): #= value=0D self._ValueList[2] =3D ReplaceMacro(TokenList[1], self._Macros= )=0D =0D if self._ValueList[1].count('_') !=3D 4:=0D EdkLogger.error(=0D 'Parser',=0D FORMAT_INVALID,=0D - "'%s' must be in format of ____FLAGS" % self._ValueList[1],=0D + "'%s' must be in format of ____FLAGS" % self._ValueList[=0D + 1],=0D ExtraData=3Dself._CurrentLine,=0D File=3Dself.MetaFile,=0D Line=3Dself._LineIndex + 1=0D - )=0D + )=0D +=0D def GetValidExpression(self, TokenSpaceGuid, PcdCName):=0D return self._Table.GetValidExpression(TokenSpaceGuid, PcdCName)=0D =0D @@ -435,7 +447,7 @@ class MetaFileParser(object): Macros.update(self._GetApplicableSectionMacro())=0D return Macros=0D =0D - ## Construct section Macro dict=0D + # Construct section Macro dict=0D def _ConstructSectionMacroDict(self, Name, Value):=0D ScopeKey =3D [(Scope[0], Scope[1], Scope[2]) for Scope in self._Sc= ope]=0D ScopeKey =3D tuple(ScopeKey)=0D @@ -450,8 +462,8 @@ class MetaFileParser(object): =0D self._SectionsMacroDict[SectionDictKey][Name] =3D Value=0D =0D - ## Get section Macros that are applicable to current line, which may c= ome from other sections=0D - ## that share the same name while scope is wider=0D + # Get section Macros that are applicable to current line, which may co= me from other sections=0D + # that share the same name while scope is wider=0D def _GetApplicableSectionMacro(self):=0D Macros =3D {}=0D =0D @@ -468,21 +480,24 @@ class MetaFileParser(object): continue=0D =0D for ActiveScope in self._Scope:=0D - Scope0, Scope1, Scope2=3D ActiveScope[0], ActiveScope[1], = ActiveScope[2]=0D + Scope0, Scope1, Scope2 =3D ActiveScope[0], ActiveScope[1],= ActiveScope[2]=0D if(Scope0, Scope1, Scope2) not in Scope:=0D break=0D else:=0D - SpeSpeMacroDict.update(self._SectionsMacroDict[(SectionTyp= e, Scope)])=0D + SpeSpeMacroDict.update(=0D + self._SectionsMacroDict[(SectionType, Scope)])=0D =0D for ActiveScope in self._Scope:=0D Scope0, Scope1, Scope2 =3D ActiveScope[0], ActiveScope[1],= ActiveScope[2]=0D if(Scope0, Scope1, Scope2) not in Scope and (Scope0, TAB_C= OMMON, TAB_COMMON) not in Scope and (TAB_COMMON, Scope1, TAB_COMMON) not in= Scope:=0D break=0D else:=0D - ComSpeMacroDict.update(self._SectionsMacroDict[(SectionTyp= e, Scope)])=0D + ComSpeMacroDict.update(=0D + self._SectionsMacroDict[(SectionType, Scope)])=0D =0D if (TAB_COMMON, TAB_COMMON, TAB_COMMON) in Scope:=0D - ComComMacroDict.update(self._SectionsMacroDict[(SectionTyp= e, Scope)])=0D + ComComMacroDict.update(=0D + self._SectionsMacroDict[(SectionType, Scope)])=0D =0D Macros.update(ComComMacroDict)=0D Macros.update(ComSpeMacroDict)=0D @@ -490,7 +505,7 @@ class MetaFileParser(object): =0D return Macros=0D =0D - def ProcessMultipleLineCODEValue(self,Content):=0D + def ProcessMultipleLineCODEValue(self, Content):=0D CODEBegin =3D False=0D CODELine =3D ""=0D continuelinecount =3D 0=0D @@ -499,7 +514,7 @@ class MetaFileParser(object): Line =3D Content[Index]=0D if CODEBegin:=0D CODELine =3D CODELine + Line=0D - continuelinecount +=3D1=0D + continuelinecount +=3D 1=0D if ")}" in Line:=0D newContent.append(CODELine)=0D for _ in range(continuelinecount):=0D @@ -525,40 +540,42 @@ class MetaFileParser(object): =0D _SectionParser =3D {}=0D =0D -## INF file parser class=0D +# INF file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D # @param Table Database used to retrieve module/package i= nformation=0D # @param Macros Macros used for replacement in file=0D #=0D +=0D +=0D class InfParser(MetaFileParser):=0D # INF file supported data types (one type per section)=0D DataType =3D {=0D - TAB_UNKNOWN.upper() : MODEL_UNKNOWN,=0D - TAB_INF_DEFINES.upper() : MODEL_META_DATA_HEADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DEFINE,=0D - TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BUILD_OPTION,=0D - TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,=0D - TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_INSTANCE,=0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_CLASS,=0D - TAB_PACKAGES.upper() : MODEL_META_DATA_PACKAGE,=0D - TAB_NMAKE.upper() : MODEL_META_DATA_NMAKE,=0D - TAB_INF_FIXED_PCD.upper() : MODEL_PCD_FIXED_AT_BUILD,=0D - TAB_INF_PATCH_PCD.upper() : MODEL_PCD_PATCHABLE_IN_MODULE,=0D - TAB_INF_FEATURE_PCD.upper() : MODEL_PCD_FEATURE_FLAG,=0D - TAB_INF_PCD_EX.upper() : MODEL_PCD_DYNAMIC_EX,=0D - TAB_INF_PCD.upper() : MODEL_PCD_DYNAMIC,=0D - TAB_SOURCES.upper() : MODEL_EFI_SOURCE_FILE,=0D - TAB_GUIDS.upper() : MODEL_EFI_GUID,=0D - TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL,=0D - TAB_PPIS.upper() : MODEL_EFI_PPI,=0D - TAB_DEPEX.upper() : MODEL_EFI_DEPEX,=0D - TAB_BINARIES.upper() : MODEL_EFI_BINARY_FILE,=0D - TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_USER_EXTENSION=0D + TAB_UNKNOWN.upper(): MODEL_UNKNOWN,=0D + TAB_INF_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_BUILD_OPTIONS.upper(): MODEL_META_DATA_BUILD_OPTION,=0D + TAB_INCLUDES.upper(): MODEL_EFI_INCLUDE,=0D + TAB_LIBRARIES.upper(): MODEL_EFI_LIBRARY_INSTANCE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_PACKAGES.upper(): MODEL_META_DATA_PACKAGE,=0D + TAB_NMAKE.upper(): MODEL_META_DATA_NMAKE,=0D + TAB_INF_FIXED_PCD.upper(): MODEL_PCD_FIXED_AT_BUILD,=0D + TAB_INF_PATCH_PCD.upper(): MODEL_PCD_PATCHABLE_IN_MODULE,=0D + TAB_INF_FEATURE_PCD.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_INF_PCD_EX.upper(): MODEL_PCD_DYNAMIC_EX,=0D + TAB_INF_PCD.upper(): MODEL_PCD_DYNAMIC,=0D + TAB_SOURCES.upper(): MODEL_EFI_SOURCE_FILE,=0D + TAB_GUIDS.upper(): MODEL_EFI_GUID,=0D + TAB_PROTOCOLS.upper(): MODEL_EFI_PROTOCOL,=0D + TAB_PPIS.upper(): MODEL_EFI_PPI,=0D + TAB_DEPEX.upper(): MODEL_EFI_DEPEX,=0D + TAB_BINARIES.upper(): MODEL_EFI_BINARY_FILE,=0D + TAB_USER_EXTENSIONS.upper(): MODEL_META_DATA_USER_EXTENSION=0D }=0D =0D - ## Constructor of InfParser=0D + # Constructor of InfParser=0D #=0D # Initialize object of InfParser=0D #=0D @@ -574,7 +591,7 @@ class InfParser(MetaFileParser): MetaFileParser.__init__(self, FilePath, FileType, Arch, Table)=0D self.PcdsDict =3D {}=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D NmakeLine =3D ''=0D Content =3D ''=0D @@ -582,7 +599,8 @@ class InfParser(MetaFileParser): with open(str(self.MetaFile), 'r') as File:=0D Content =3D File.readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D =0D # parse the file line by line=0D IsFindBlockComment =3D False=0D @@ -593,7 +611,8 @@ class InfParser(MetaFileParser): =0D for Index in range(0, len(Content)):=0D # skip empty, commented, block commented lines=0D - Line, Comment =3D CleanString2(Content[Index], AllowCppStyleCo= mment=3DTrue)=0D + Line, Comment =3D CleanString2(=0D + Content[Index], AllowCppStyleComment=3DTrue)=0D NextLine =3D ''=0D if Index + 1 < len(Content):=0D NextLine, NextComment =3D CleanString2(Content[Index + 1])= =0D @@ -642,13 +661,15 @@ class InfParser(MetaFileParser): MODEL_EFI_PPI,=0D MODEL_META_DATA_USER_EXTENSIO= N]:=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D - "Section [%s] is not allowed in in= f file without version" % (self._SectionName),=0D + "Section [%s] is not allowed in in= f file without version" % (=0D + self._SectionName),=0D ExtraData=3Dself._CurrentLine, Fil= e=3Dself.MetaFile, Line=3Dself._LineIndex + 1)=0D elif self._SectionType in [MODEL_EFI_INCLUDE,=0D MODEL_EFI_LIBRARY_INSTANCE,=0D MODEL_META_DATA_NMAKE]:=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D - "Section [%s] is not allowed in inf fi= le with version 0x%08x" % (self._SectionName, self._Version),=0D + "Section [%s] is not allowed in inf fi= le with version 0x%08x" % (=0D + self._SectionName, self._Version),= =0D ExtraData=3Dself._CurrentLine, File=3D= self.MetaFile, Line=3Dself._LineIndex + 1)=0D continue=0D # merge two lines specified by '\' in section NMAKE=0D @@ -679,25 +700,26 @@ class InfParser(MetaFileParser): if Comment:=0D Comments.append((Comment, Index + 1))=0D if GlobalData.gOptions and GlobalData.gOptions.CheckUsage:=0D - CheckInfComment(self._SectionType, Comments, str(self.Meta= File), Index + 1, self._ValueList)=0D + CheckInfComment(self._SectionType, Comments, str(=0D + self.MetaFile), Index + 1, self._ValueList)=0D #=0D # Model, Value1, Value2, Value3, Arch, Platform, BelongsToItem= =3D-1,=0D # LineBegin=3D-1, ColumnBegin=3D-1, LineEnd=3D-1, ColumnEnd=3D= -1, Enabled=3D-1=0D #=0D for Arch, Platform, _ in self._Scope:=0D LastItem =3D self._Store(self._SectionType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - Arch,=0D - Platform,=0D - self._Owner[-1],=0D - self._LineIndex + 1,=0D - - 1,=0D - self._LineIndex + 1,=0D - - 1,=0D - 0=0D - )=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + Arch,=0D + Platform,=0D + self._Owner[-1],=0D + self._LineIndex + 1,=0D + - 1,=0D + self._LineIndex + 1,=0D + - 1,=0D + 0=0D + )=0D for Comment, LineNo in Comments:=0D self._Store(MODEL_META_DATA_COMMENT, Comment, '', '', = Arch, Platform,=0D LastItem, LineNo, -1, LineNo, -1, 0)=0D @@ -711,10 +733,10 @@ class InfParser(MetaFileParser): # If there are tail comments in INF file, save to database whateve= r the comments are=0D for Comment in TailComments:=0D self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', = TAB_COMMON,=0D - TAB_COMMON, self._Owner[-1], -1, -1, -1, -= 1, 0)=0D + TAB_COMMON, self._Owner[-1], -1, -1, -1, -1, 0)=0D self._Done()=0D =0D - ## Data parser for the format in which there's path=0D + # Data parser for the format in which there's path=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -729,7 +751,7 @@ class InfParser(MetaFileParser): continue=0D self._ValueList[Index] =3D ReplaceMacro(Value, Macros)=0D =0D - ## Parse [Sources] section=0D + # Parse [Sources] section=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -745,12 +767,14 @@ class InfParser(MetaFileParser): # For Acpi tables, remove macro like ' TABLE_NAME=3DSata1'=0D if 'COMPONENT_TYPE' in Macros:=0D if self._Defines['COMPONENT_TYPE'].upper() =3D=3D 'ACPITABLE':= =0D - self._ValueList[0] =3D GetSplitValueList(self._ValueList[0= ], ' ', 1)[0]=0D + self._ValueList[0] =3D GetSplitValueList(=0D + self._ValueList[0], ' ', 1)[0]=0D if self._Defines['BASE_NAME'] =3D=3D 'Microcode':=0D pass=0D - self._ValueList =3D [ReplaceMacro(Value, Macros) for Value in self= ._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, Macros)=0D + for Value in self._ValueList]=0D =0D - ## Parse [Binaries] section=0D + # Parse [Binaries] section=0D #=0D # Only path can have macro used. So we need to replace them before u= se.=0D #=0D @@ -759,20 +783,23 @@ class InfParser(MetaFileParser): TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= , 2)=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file type or pat= h specified",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if not TokenList[0]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file type specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if not TokenList[1]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No file path specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( = | [| ])",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( | [| ])",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], self._Macr= os)=0D =0D - ## [nmake] section parser (Edk.x style only)=0D + # [nmake] section parser (Edk.x style only)=0D def _NmakeParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D @@ -781,70 +808,77 @@ class InfParser(MetaFileParser): # remove self-reference in macro setting=0D #self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], {self._Va= lueList[0]:''})=0D =0D - ## [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections pa= rser=0D + # [FixedPcd], [FeaturePcd], [PatchPcd], [Pcd] and [PcdEx] sections par= ser=0D @ParseMacro=0D def _PcdParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= , 1)=0D ValueList =3D GetSplitValueList(TokenList[0], TAB_SPLIT)=0D if len(ValueList) !=3D 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Illegal token space= GUID and PCD name format",=0D - ExtraData=3Dself._CurrentLine + " (.)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D self._ValueList[0:1] =3D ValueList=0D if len(TokenList) > 1:=0D self._ValueList[2] =3D TokenList[1]=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID= or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + " (.)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D =0D # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE'= , replace with integer 1 or 0.=0D if self._ValueList[2] !=3D '':=0D - InfPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_= SPLIT, 1)=0D + InfPcdValueList =3D GetSplitValueList(=0D + TokenList[1], TAB_VALUE_SPLIT, 1)=0D if InfPcdValueList[0] in ['True', 'true', 'TRUE']:=0D - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '1', 1)=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + InfPcdValueList[0], '1', 1)=0D elif InfPcdValueList[0] in ['False', 'false', 'FALSE']:=0D - self._ValueList[2] =3D TokenList[1].replace(InfPcdValueLis= t[0], '0', 1)=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + InfPcdValueList[0], '0', 1)=0D elif isinstance(InfPcdValueList[0], str) and InfPcdValueList[0= ].find('$(') >=3D 0:=0D - Value =3D ReplaceExprMacro(InfPcdValueList[0],self._Macros= )=0D + Value =3D ReplaceExprMacro(InfPcdValueList[0], self._Macro= s)=0D if Value !=3D '0':=0D self._ValueList[2] =3D Value=0D if (self._ValueList[0], self._ValueList[1]) not in self.PcdsDict:= =0D - self.PcdsDict[self._ValueList[0], self._ValueList[1]] =3D self= ._SectionType=0D + self.PcdsDict[self._ValueList[0],=0D + self._ValueList[1]] =3D self._SectionType=0D elif self.PcdsDict[self._ValueList[0], self._ValueList[1]] !=3D se= lf._SectionType:=0D EdkLogger.error('Parser', FORMAT_INVALID, "It is not permissib= le to list a specified PCD in different PCD type sections.",=0D - ExtraData=3Dself._CurrentLine + " (.)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D =0D - ## [depex] section parser=0D + # [depex] section parser=0D @ParseMacro=0D def _DepexParser(self):=0D self._ValueList[0:1] =3D [self._CurrentLine]=0D =0D _SectionParser =3D {=0D - MODEL_UNKNOWN : MetaFileParser._Skip,=0D - MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,= =0D - MODEL_META_DATA_BUILD_OPTION : MetaFileParser._BuildOptionPar= ser,=0D - MODEL_EFI_INCLUDE : _IncludeParser, # for Edk.x mo= dules=0D - MODEL_EFI_LIBRARY_INSTANCE : MetaFileParser._CommonParser, = # for Edk.x modules=0D - MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,=0D - MODEL_META_DATA_PACKAGE : MetaFileParser._PathParser,=0D - MODEL_META_DATA_NMAKE : _NmakeParser, # for Edk.x modu= les=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX : _PcdParser,=0D - MODEL_PCD_DYNAMIC : _PcdParser,=0D - MODEL_EFI_SOURCE_FILE : _SourceFileParser,=0D - MODEL_EFI_GUID : MetaFileParser._CommonParser,= =0D - MODEL_EFI_PROTOCOL : MetaFileParser._CommonParser,= =0D - MODEL_EFI_PPI : MetaFileParser._CommonParser,= =0D - MODEL_EFI_DEPEX : _DepexParser,=0D - MODEL_EFI_BINARY_FILE : _BinaryFileParser,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser._SkipUserExtens= ion,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_HEADER: MetaFileParser._DefineParser,=0D + MODEL_META_DATA_BUILD_OPTION: MetaFileParser._BuildOptionParser,= =0D + MODEL_EFI_INCLUDE: _IncludeParser, # for Edk.x modules=0D + MODEL_EFI_LIBRARY_INSTANCE: MetaFileParser._CommonParser, # for= Edk.x modules=0D + MODEL_EFI_LIBRARY_CLASS: MetaFileParser._PathParser,=0D + MODEL_META_DATA_PACKAGE: MetaFileParser._PathParser,=0D + MODEL_META_DATA_NMAKE: _NmakeParser, # for Edk.x modules=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX: _PcdParser,=0D + MODEL_PCD_DYNAMIC: _PcdParser,=0D + MODEL_EFI_SOURCE_FILE: _SourceFileParser,=0D + MODEL_EFI_GUID: MetaFileParser._CommonParser,=0D + MODEL_EFI_PROTOCOL: MetaFileParser._CommonParser,=0D + MODEL_EFI_PPI: MetaFileParser._CommonParser,=0D + MODEL_EFI_DEPEX: _DepexParser,=0D + MODEL_EFI_BINARY_FILE: _BinaryFileParser,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._SkipUserExtensio= n,=0D }=0D =0D -## DSC file parser class=0D +# DSC file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D @@ -853,37 +887,39 @@ class InfParser(MetaFileParser): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INCLUDE= directive)=0D #=0D +=0D +=0D class DscParser(MetaFileParser):=0D # DSC file supported data types (one type per section)=0D DataType =3D {=0D - TAB_SKUIDS.upper() : MODEL_EFI_SKU_ID,= =0D - TAB_DEFAULT_STORES.upper() : MODEL_EFI_DEFAULT_= STORES,=0D - TAB_LIBRARIES.upper() : MODEL_EFI_LIBRARY_= INSTANCE,=0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_= CLASS,=0D - TAB_BUILD_OPTIONS.upper() : MODEL_META_DATA_BU= ILD_OPTION,=0D - TAB_PACKAGES.upper() : MODEL_META_DATA_PA= CKAGE,=0D - TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT= _BUILD,=0D - TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABL= E_IN_MODULE,=0D - TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_= FLAG,=0D - TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_= DEFAULT,=0D - TAB_PCDS_DYNAMIC_HII_NULL.upper() : MODEL_PCD_DYNAMIC_= HII,=0D - TAB_PCDS_DYNAMIC_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_= VPD,=0D - TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_DEFAULT,=0D - TAB_PCDS_DYNAMIC_EX_HII_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_HII,=0D - TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper() : MODEL_PCD_DYNAMIC_= EX_VPD,=0D - TAB_COMPONENTS.upper() : MODEL_META_DATA_CO= MPONENT,=0D - TAB_DSC_DEFINES.upper() : MODEL_META_DATA_HE= ADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DE= FINE,=0D - TAB_DSC_DEFINES_EDKGLOBAL : MODEL_META_DATA_GL= OBAL_DEFINE,=0D - TAB_INCLUDE.upper() : MODEL_META_DATA_IN= CLUDE,=0D - TAB_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IF,=0D - TAB_IF_DEF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IFDEF,=0D - TAB_IF_N_DEF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_IFNDEF,=0D - TAB_ELSE_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ELSEIF,=0D - TAB_ELSE.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ELSE,=0D - TAB_END_IF.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ENDIF,=0D - TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_US= ER_EXTENSION,=0D - TAB_ERROR.upper() : MODEL_META_DATA_CO= NDITIONAL_STATEMENT_ERROR,=0D + TAB_SKUIDS.upper(): MODEL_EFI_SKU_ID,=0D + TAB_DEFAULT_STORES.upper(): MODEL_EFI_DEFAULT_STORES,=0D + TAB_LIBRARIES.upper(): MODEL_EFI_LIBRARY_INSTANCE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_BUILD_OPTIONS.upper(): MODEL_META_DATA_BUILD_OPTION,=0D + TAB_PACKAGES.upper(): MODEL_META_DATA_PACKAGE,=0D + TAB_PCDS_FIXED_AT_BUILD_NULL.upper(): MODEL_PCD_FIXED_AT_BUILD,= =0D + TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(): MODEL_PCD_PATCHABLE_I= N_MODULE,=0D + TAB_PCDS_FEATURE_FLAG_NULL.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_PCDS_DYNAMIC_DEFAULT_NULL.upper(): MODEL_PCD_DYNAMIC_DEFAULT= ,=0D + TAB_PCDS_DYNAMIC_HII_NULL.upper(): MODEL_PCD_DYNAMIC_HII,=0D + TAB_PCDS_DYNAMIC_VPD_NULL.upper(): MODEL_PCD_DYNAMIC_VPD,=0D + TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper(): MODEL_PCD_DYNAMIC_EX_D= EFAULT,=0D + TAB_PCDS_DYNAMIC_EX_HII_NULL.upper(): MODEL_PCD_DYNAMIC_EX_HII,= =0D + TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper(): MODEL_PCD_DYNAMIC_EX_VPD,= =0D + TAB_COMPONENTS.upper(): MODEL_META_DATA_COMPONENT,=0D + TAB_DSC_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_DSC_DEFINES_EDKGLOBAL: MODEL_META_DATA_GLOBAL_DEFINE,=0D + TAB_INCLUDE.upper(): MODEL_META_DATA_INCLUDE,=0D + TAB_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,=0D + TAB_IF_DEF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF,= =0D + TAB_IF_N_DEF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_IFND= EF,=0D + TAB_ELSE_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEI= F,=0D + TAB_ELSE.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE,=0D + TAB_END_IF.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF,= =0D + TAB_USER_EXTENSIONS.upper(): MODEL_META_DATA_USER_EXTENSION,=0D + TAB_ERROR.upper(): MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR,= =0D }=0D =0D # Valid names in define section=0D @@ -917,7 +953,7 @@ class DscParser(MetaFileParser): =0D IncludedFiles =3D set()=0D =0D - ## Constructor of DscParser=0D + # Constructor of DscParser=0D #=0D # Initialize object of DscParser=0D #=0D @@ -928,11 +964,12 @@ class DscParser(MetaFileParser): # @param Owner Owner ID (for sub-section parsing)=0D # @param From ID from which the data comes (for !INC= LUDE directive)=0D #=0D - def __init__(self, FilePath, FileType, Arch, Table, Owner=3D -1, From= =3D -1):=0D + def __init__(self, FilePath, FileType, Arch, Table, Owner=3D-1, From= =3D-1):=0D # prevent re-initialization=0D if hasattr(self, "_Table") and self._Table is Table:=0D return=0D - MetaFileParser.__init__(self, FilePath, FileType, Arch, Table, Own= er, From)=0D + MetaFileParser.__init__(self, FilePath, FileType,=0D + Arch, Table, Owner, From)=0D self._Version =3D 0x00010005 # Only EDK2 dsc file is supported=0D # to store conditional directive evaluation result=0D self._DirectiveStack =3D []=0D @@ -950,18 +987,19 @@ class DscParser(MetaFileParser): # Map the ID between the original table and new table to track=0D # the owner item=0D #=0D - self._IdMapping =3D {-1:-1}=0D + self._IdMapping =3D {-1: -1}=0D =0D self._Content =3D None=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D Content =3D ''=0D try:=0D with open(str(self.MetaFile), 'r') as File:=0D Content =3D File.readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D =0D OwnerId =3D {}=0D =0D @@ -1004,7 +1042,8 @@ class DscParser(MetaFileParser): self._DirectiveParser()=0D continue=0D if Line[0] =3D=3D TAB_OPTION_START and not self._InSubsection:= =0D - EdkLogger.error("Parser", FILE_READ_FAILURE, "Missing the = '{' before %s in Line %s" % (Line, Index+1), ExtraData=3Dself.MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE, "Missing the = '{' before %s in Line %s" % (=0D + Line, Index+1), ExtraData=3Dself.MetaFile)=0D =0D if self._InSubsection:=0D SectionType =3D self._SubsectionType=0D @@ -1030,21 +1069,21 @@ class DscParser(MetaFileParser): if self._SubsectionType !=3D MODEL_UNKNOWN and Arch in Own= erId:=0D Owner =3D OwnerId[Arch]=0D self._LastItem =3D self._Store(=0D - self._ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - Arch,=0D - ModuleType,=0D - DefaultStore,=0D - Owner,=0D - self._From,=0D - self._LineIndex + 1,=0D - - 1,=0D - self._LineIndex + 1,=0D - - 1,=0D - self._Enabled=0D - )=0D + self._ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + Arch,=0D + ModuleType,=0D + DefaultStore,=0D + Owner,=0D + self._From,=0D + self._LineIndex + 1,=0D + - 1,=0D + self._LineIndex + 1,=0D + - 1,=0D + self._Enabled=0D + )=0D if self._SubsectionType =3D=3D MODEL_UNKNOWN and self._InS= ubsection:=0D OwnerId[Arch] =3D self._LastItem=0D =0D @@ -1054,7 +1093,7 @@ class DscParser(MetaFileParser): ExtraData=3DText, File=3Dself.MetaFile, Line= =3DLine)=0D self._Done()=0D =0D - ## parser=0D + # parser=0D def _SubsectionHeaderParser(self):=0D self._SubsectionName =3D self._CurrentLine[1:-1].upper()=0D if self._SubsectionName in self.DataType:=0D @@ -1065,7 +1104,7 @@ class DscParser(MetaFileParser): Line=3Dself._LineIndex + 1, ExtraData=3Dself._C= urrentLine)=0D self._ValueList[0] =3D self._SubsectionName=0D =0D - ## Directive statement parser=0D + # Directive statement parser=0D def _DirectiveParser(self):=0D self._ValueList =3D ['', '', '']=0D TokenList =3D GetSplitValueList(self._CurrentLine, ' ', 1)=0D @@ -1115,7 +1154,8 @@ class DscParser(MetaFileParser): EdkLogger.error("Parser", FORMAT_INVALID, "'!elseif' after= '!else'",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1,=0D ExtraData=3Dself._CurrentLine)=0D - self._DirectiveStack.append((ItemType, self._LineIndex + 1, se= lf._CurrentLine))=0D + self._DirectiveStack.append(=0D + (ItemType, self._LineIndex + 1, self._CurrentLine))=0D =0D #=0D # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem= =3D-1, BelongsToFile=3D-1,=0D @@ -1123,23 +1163,23 @@ class DscParser(MetaFileParser): #=0D for Arch, ModuleType, DefaultStore in Scope:=0D self._LastItem =3D self._Store(=0D - ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - Arch,=0D - ModuleType,=0D - DefaultStore,=0D - self._Owner[-1],=0D - self._From,=0D - self._LineIndex + 1,=0D - - 1,=0D - self._LineIndex + 1,=0D - - 1,=0D - 0=0D - )=0D + ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + Arch,=0D + ModuleType,=0D + DefaultStore,=0D + self._Owner[-1],=0D + self._From,=0D + self._LineIndex + 1,=0D + - 1,=0D + self._LineIndex + 1,=0D + - 1,=0D + 0=0D + )=0D =0D - ## [defines] section parser=0D + # [defines] section parser=0D @ParseMacro=0D def _DefineParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D @@ -1153,7 +1193,7 @@ class DscParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "No value specified"= ,=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D if (not self._ValueList[1] in self.DefineKeywords and=0D - (self._InSubsection and self._ValueList[1] not in self.SubSect= ionDefineKeywords)):=0D + (self._InSubsection and self._ValueList[1] not in self.Sub= SectionDefineKeywords)):=0D EdkLogger.error('Parser', FORMAT_INVALID,=0D "Unknown keyword found: %s. "=0D "If this is a macro you must "=0D @@ -1170,6 +1210,7 @@ class DscParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "Correct format is '= |[|]'",=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D +=0D @ParseMacro=0D def _DefaultStoresParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= )=0D @@ -1178,15 +1219,14 @@ class DscParser(MetaFileParser): ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D - ## Parse Edk style of library modules=0D + # Parse Edk style of library modules=0D @ParseMacro=0D def _LibraryInstanceParser(self):=0D self._ValueList[0] =3D self._CurrentLine=0D =0D -=0D def _DecodeCODEData(self):=0D pass=0D - ## PCD sections parser=0D + # PCD sections parser=0D #=0D # [PcdsFixedAtBuild]=0D # [PcdsPatchableInModule]=0D @@ -1200,12 +1240,14 @@ class DscParser(MetaFileParser): # [PcdsDynamicVpd]=0D # [PcdsDynamicHii]=0D #=0D +=0D @ParseMacro=0D def _PcdParser(self):=0D if self._PcdDataTypeCODE:=0D self._PcdCodeValue =3D self._PcdCodeValue + "\n " + self._Curr= entLine=0D if self._CurrentLine.endswith(")}"):=0D - self._CurrentLine =3D "|".join((self._CurrentPcdName, self= ._PcdCodeValue))=0D + self._CurrentLine =3D "|".join(=0D + (self._CurrentPcdName, self._PcdCodeValue))=0D self._PcdDataTypeCODE =3D False=0D self._PcdCodeValue =3D ""=0D else:=0D @@ -1229,14 +1271,17 @@ class DscParser(MetaFileParser): if len(PcdNameTockens) =3D=3D 2:=0D self._ValueList[0], self._ValueList[1] =3D PcdNameTockens[0], = PcdNameTockens[1]=0D elif len(PcdNameTockens) =3D=3D 3:=0D - self._ValueList[0], self._ValueList[1] =3D ".".join((PcdNameTo= ckens[0], PcdNameTockens[1])), PcdNameTockens[2]=0D + self._ValueList[0], self._ValueList[1] =3D ".".join(=0D + (PcdNameTockens[0], PcdNameTockens[1])), PcdNameTockens[2]= =0D elif len(PcdNameTockens) > 3:=0D - self._ValueList[0], self._ValueList[1] =3D ".".join((PcdNameTo= ckens[0], PcdNameTockens[1])), ".".join(PcdNameTockens[2:])=0D + self._ValueList[0], self._ValueList[1] =3D ".".join(=0D + (PcdNameTockens[0], PcdNameTockens[1])), ".".join(PcdNameT= ockens[2:])=0D if len(TokenList) =3D=3D 2:=0D self._ValueList[2] =3D TokenList[1]=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space GUID= or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + " (.|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if self._ValueList[2] =3D=3D '':=0D #=0D @@ -1245,32 +1290,36 @@ class DscParser(MetaFileParser): if self._SectionType in (MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_P= ATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_EX_DEFAULT= ):=0D return=0D EdkLogger.error('Parser', FORMAT_INVALID, "No PCD value given"= ,=0D - ExtraData=3Dself._CurrentLine + " (.|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|)",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D =0D # Validate the datum type of Dynamic Defaul PCD and DynamicEx Defa= ult PCD=0D ValueList =3D GetSplitValueList(self._ValueList[2])=0D if len(ValueList) > 1 and ValueList[1] in [TAB_UINT8, TAB_UINT16, = TAB_UINT32, TAB_UINT64] \=0D - and self._ItemType in [MODEL_PCD_DYNAMIC_DEF= AULT, MODEL_PCD_DYNAMIC_EX_DEFAULT]:=0D + and self._ItemType in [MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PC= D_DYNAMIC_EX_DEFAULT]:=0D EdkLogger.error('Parser', FORMAT_INVALID, "The datum type '%s'= of PCD is wrong" % ValueList[1],=0D ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D =0D # Validate the VariableName of DynamicHii and DynamicExHii for PCD= Entry must not be an empty string=0D if self._ItemType in [MODEL_PCD_DYNAMIC_HII, MODEL_PCD_DYNAMIC_EX_= HII]:=0D - DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_= SPLIT, 1)=0D + DscPcdValueList =3D GetSplitValueList(=0D + TokenList[1], TAB_VALUE_SPLIT, 1)=0D if len(DscPcdValueList[0].replace('L', '').replace('"', '').st= rip()) =3D=3D 0:=0D EdkLogger.error('Parser', FORMAT_INVALID, "The VariableNam= e field in the HII format PCD entry must not be an empty string",=0D - ExtraData=3Dself._CurrentLine, File=3Dself.Met= aFile, Line=3Dself._LineIndex + 1)=0D + ExtraData=3Dself._CurrentLine, File=3Dself= .MetaFile, Line=3Dself._LineIndex + 1)=0D =0D # if value are 'True', 'true', 'TRUE' or 'False', 'false', 'FALSE'= , replace with integer 1 or 0.=0D DscPcdValueList =3D GetSplitValueList(TokenList[1], TAB_VALUE_SPLI= T, 1)=0D if DscPcdValueList[0] in ['True', 'true', 'TRUE']:=0D - self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0]= , '1', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + DscPcdValueList[0], '1', 1)=0D elif DscPcdValueList[0] in ['False', 'false', 'FALSE']:=0D - self._ValueList[2] =3D TokenList[1].replace(DscPcdValueList[0]= , '0', 1);=0D + self._ValueList[2] =3D TokenList[1].replace(=0D + DscPcdValueList[0], '0', 1)=0D =0D + # [components] section parser=0D =0D - ## [components] section parser=0D @ParseMacro=0D def _ComponentParser(self):=0D if self._CurrentLine[-1] =3D=3D '{':=0D @@ -1280,27 +1329,30 @@ class DscParser(MetaFileParser): else:=0D self._ValueList[0] =3D self._CurrentLine=0D =0D - ## [LibraryClasses] section=0D + # [LibraryClasses] section=0D @ParseMacro=0D def _LibraryClassParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT= )=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library class or= instance specified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if TokenList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library class sp= ecified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No library instance= specified",=0D - ExtraData=3Dself._CurrentLine + " (|)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (|)",= =0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D =0D self._ValueList[0:len(TokenList)] =3D TokenList=0D =0D + # [BuildOptions] section parser=0D =0D - ## [BuildOptions] section parser=0D @ParseMacro=0D def _BuildOptionParser(self):=0D self._CurrentLine =3D CleanString(self._CurrentLine, BuildOption= =3DTrue)=0D @@ -1318,13 +1370,14 @@ class DscParser(MetaFileParser): EdkLogger.error(=0D 'Parser',=0D FORMAT_INVALID,=0D - "'%s' must be in format of ____FLAGS" % self._ValueList[1],=0D + "'%s' must be in format of ____FLAGS" % self._ValueList[=0D + 1],=0D ExtraData=3Dself._CurrentLine,=0D File=3Dself.MetaFile,=0D Line=3Dself._LineIndex + 1=0D - )=0D + )=0D =0D - ## Override parent's method since we'll do all macro replacements in p= arser=0D + # Override parent's method since we'll do all macro replacements in pa= rser=0D @property=0D def _Macros(self):=0D Macros =3D {}=0D @@ -1347,40 +1400,41 @@ class DscParser(MetaFileParser): =0D def _PostProcess(self):=0D Processer =3D {=0D - MODEL_META_DATA_SECTION_HEADER : self.__Pro= cessSectionHeader,=0D - MODEL_META_DATA_SUBSECTION_HEADER : self.__Pro= cessSubsectionHeader,=0D - MODEL_META_DATA_HEADER : self.__Pro= cessDefine,=0D - MODEL_META_DATA_DEFINE : self.__Pro= cessDefine,=0D - MODEL_META_DATA_GLOBAL_DEFINE : self.__Pro= cessDefine,=0D - MODEL_META_DATA_INCLUDE : self.__Pro= cessDirective,=0D - MODEL_META_DATA_PACKAGE : self.__Pro= cessPackages,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF : self.__Pro= cessDirective,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF : self.__Pro= cessDirective,=0D - MODEL_EFI_SKU_ID : self.__Pro= cessSkuId,=0D - MODEL_EFI_DEFAULT_STORES : self.__Pro= cessDefaultStores,=0D - MODEL_EFI_LIBRARY_INSTANCE : self.__Pro= cessLibraryInstance,=0D - MODEL_EFI_LIBRARY_CLASS : self.__Pro= cessLibraryClass,=0D - MODEL_PCD_FIXED_AT_BUILD : self.__Pro= cessPcd,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : self.__Pro= cessPcd,=0D - MODEL_PCD_FEATURE_FLAG : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_DEFAULT : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_HII : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_VPD : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_HII : self.__Pro= cessPcd,=0D - MODEL_PCD_DYNAMIC_EX_VPD : self.__Pro= cessPcd,=0D - MODEL_META_DATA_COMPONENT : self.__Pro= cessComponent,=0D - MODEL_META_DATA_BUILD_OPTION : self.__Pro= cessBuildOption,=0D - MODEL_UNKNOWN : self._Skip= ,=0D - MODEL_META_DATA_USER_EXTENSION : self._Skip= UserExtension,=0D - MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR : self._Proc= essError,=0D + MODEL_META_DATA_SECTION_HEADER: self.__ProcessSectionHeader,= =0D + MODEL_META_DATA_SUBSECTION_HEADER: self.__ProcessSubsectionH= eader,=0D + MODEL_META_DATA_HEADER: self.__ProcessDefine,=0D + MODEL_META_DATA_DEFINE: self.__ProcessDefine,=0D + MODEL_META_DATA_GLOBAL_DEFINE: self.__ProcessDefine,=0D + MODEL_META_DATA_INCLUDE: self.__ProcessDirective,=0D + MODEL_META_DATA_PACKAGE: self.__ProcessPackages,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IF: self.__ProcessDire= ctive,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE: self.__ProcessDi= rective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF: self.__ProcessD= irective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF: self.__Process= Directive,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF: self.__ProcessD= irective,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF: self.__Process= Directive,=0D + MODEL_EFI_SKU_ID: self.__ProcessSkuId,=0D + MODEL_EFI_DEFAULT_STORES: self.__ProcessDefaultStores,=0D + MODEL_EFI_LIBRARY_INSTANCE: self.__ProcessLibraryInstance,=0D + MODEL_EFI_LIBRARY_CLASS: self.__ProcessLibraryClass,=0D + MODEL_PCD_FIXED_AT_BUILD: self.__ProcessPcd,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: self.__ProcessPcd,=0D + MODEL_PCD_FEATURE_FLAG: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_DEFAULT: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_HII: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_VPD: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_HII: self.__ProcessPcd,=0D + MODEL_PCD_DYNAMIC_EX_VPD: self.__ProcessPcd,=0D + MODEL_META_DATA_COMPONENT: self.__ProcessComponent,=0D + MODEL_META_DATA_BUILD_OPTION: self.__ProcessBuildOption,=0D + MODEL_UNKNOWN: self._Skip,=0D + MODEL_META_DATA_USER_EXTENSION: self._SkipUserExtension,=0D + MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR: self._ProcessEr= ror,=0D }=0D =0D - self._Table =3D MetaFileStorage(self._RawTable.DB, self.MetaFile, = MODEL_FILE_DSC, True)=0D + self._Table =3D MetaFileStorage(=0D + self._RawTable.DB, self.MetaFile, MODEL_FILE_DSC, True)=0D self._DirectiveStack =3D []=0D self._DirectiveEvalStack =3D []=0D self._FileWithError =3D self.MetaFile=0D @@ -1393,7 +1447,7 @@ class DscParser(MetaFileParser): self._Content =3D self._RawTable.GetAll()=0D self._ContentIndex =3D 0=0D self._InSubsection =3D False=0D - while self._ContentIndex < len(self._Content) :=0D + while self._ContentIndex < len(self._Content):=0D Id, self._ItemType, V1, V2, V3, S1, S2, S3, Owner, self._From,= \=0D LineStart, ColStart, LineEnd, ColEnd, Enabled =3D self._Co= ntent[self._ContentIndex]=0D =0D @@ -1438,52 +1492,60 @@ class DscParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "Cannot = use this PCD (%s) in an expression as"=0D " it must be defined in a [PcdsFix= edAtBuild] or [PcdsFeatureFlag] section"=0D " of the DSC file, and it is curre= ntly defined in this section:"=0D - " %s, line #: %d." % (Excpt.Pcd, I= nfo[0], Info[1]),=0D - File=3Dself._FileWithError, ExtraData= =3D' '.join(self._ValueList),=0D - Line=3Dself._LineIndex + 1)=0D + " %s, line #: %d." % (=0D + Excpt.Pcd, Info[0], Info[1]),= =0D + File=3Dself._FileWithError, ExtraD= ata=3D' '.join(=0D + self._ValueList),=0D + Line=3Dself._LineIndex + 1)=0D else:=0D EdkLogger.error('Parser', FORMAT_INVALID, "PCD (%s= ) is not defined in DSC file" % Excpt.Pcd,=0D - File=3Dself._FileWithError, ExtraData= =3D' '.join(self._ValueList),=0D - Line=3Dself._LineIndex + 1)=0D + File=3Dself._FileWithError, ExtraD= ata=3D' '.join(=0D + self._ValueList),=0D + Line=3Dself._LineIndex + 1)=0D else:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid exp= ression: %s" % str(Excpt),=0D - File=3Dself._FileWithError, ExtraData= =3D' '.join(self._ValueList),=0D + File=3Dself._FileWithError, ExtraData= =3D' '.join(=0D + self._ValueList),=0D Line=3Dself._LineIndex + 1)=0D except MacroException as Excpt:=0D EdkLogger.error('Parser', FORMAT_INVALID, str(Excpt),=0D - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=0D + File=3Dself._FileWithError, ExtraData=3D' = '.join(=0D + self._ValueList),=0D Line=3Dself._LineIndex + 1)=0D =0D if self._ValueList is None:=0D continue=0D =0D NewOwner =3D self._IdMapping.get(Owner, -1)=0D - self._Enabled =3D int((not self._DirectiveEvalStack) or (False= not in self._DirectiveEvalStack))=0D + self._Enabled =3D int((not self._DirectiveEvalStack) or (=0D + False not in self._DirectiveEvalStack))=0D self._LastItem =3D self._Store(=0D - self._ItemType,=0D - self._ValueList[0],=0D - self._ValueList[1],=0D - self._ValueList[2],=0D - S1,=0D - S2,=0D - S3,=0D - NewOwner,=0D - self._From,=0D - self._LineIndex + 1,=0D - - 1,=0D - self._LineIndex + 1,=0D - - 1,=0D - self._Enabled=0D - )=0D + self._ItemType,=0D + self._ValueList[0],=0D + self._ValueList[1],=0D + self._ValueList[2],=0D + S1,=0D + S2,=0D + S3,=0D + NewOwner,=0D + self._From,=0D + self._LineIndex + 1,=0D + - 1,=0D + self._LineIndex + 1,=0D + - 1,=0D + self._Enabled=0D + )=0D self._IdMapping[Id] =3D self._LastItem=0D =0D GlobalData.gPlatformDefines.update(self._FileLocalMacros)=0D self._PostProcessed =3D True=0D self._Content =3D None=0D +=0D def _ProcessError(self):=0D if not self._Enabled:=0D return=0D - EdkLogger.error('Parser', ERROR_STATEMENT, self._ValueList[1], Fil= e=3Dself.MetaFile, Line=3Dself._LineIndex + 1)=0D + EdkLogger.error('Parser', ERROR_STATEMENT,=0D + self._ValueList[1], File=3Dself.MetaFile, Line=3Ds= elf._LineIndex + 1)=0D =0D def __ProcessSectionHeader(self):=0D self._SectionName =3D self._ValueList[0]=0D @@ -1504,20 +1566,22 @@ class DscParser(MetaFileParser): with open(str(self.MetaFile), 'r') as File:=0D Content =3D File.readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D =0D GlobalData.gPlatformOtherPcds['DSCFILE'] =3D str(self.MetaFile)=0D for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, MODEL_PCD_DYNAMIC_D= EFAULT, MODEL_PCD_DYNAMIC_HII,=0D MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAUL= T, MODEL_PCD_DYNAMIC_EX_HII,=0D MODEL_PCD_DYNAMIC_EX_VPD):=0D - Records =3D self._RawTable.Query(PcdType, BelongsToItem=3D -1.= 0)=0D + Records =3D self._RawTable.Query(PcdType, BelongsToItem=3D-1.0= )=0D for TokenSpaceGuid, PcdName, Value, Dummy2, Dummy3, Dummy4, ID= , Line in Records:=0D Name =3D TokenSpaceGuid + '.' + PcdName=0D if Name not in GlobalData.gPlatformOtherPcds:=0D PcdLine =3D Line=0D while not Content[Line - 1].lstrip().startswith(TAB_SE= CTION_START):=0D Line -=3D 1=0D - GlobalData.gPlatformOtherPcds[Name] =3D (CleanString(C= ontent[Line - 1]), PcdLine, PcdType)=0D + GlobalData.gPlatformOtherPcds[Name] =3D (=0D + CleanString(Content[Line - 1]), PcdLine, PcdType)= =0D =0D def __ProcessDefine(self):=0D if not self._Enabled:=0D @@ -1557,7 +1621,8 @@ class DscParser(MetaFileParser): try:=0D Result =3D ValueExpression(self._ValueList[1], Macros)()=0D except SymbolNotFound as Exc:=0D - EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc), self._ValueLi= st[1])=0D + EdkLogger.debug(EdkLogger.DEBUG_5, str(Exc),=0D + self._ValueList[1])=0D Result =3D False=0D except WrnExpression as Excpt:=0D #=0D @@ -1565,8 +1630,9 @@ class DscParser(MetaFileParser): # the precise number of line and return the evaluation res= ult=0D #=0D EdkLogger.warn('Parser', "Suspicious expression: %s" % str= (Excpt),=0D - File=3Dself._FileWithError, ExtraData=3D' = '.join(self._ValueList),=0D - Line=3Dself._LineIndex + 1)=0D + File=3Dself._FileWithError, ExtraData=3D' '= .join(=0D + self._ValueList),=0D + Line=3Dself._LineIndex + 1)=0D Result =3D Excpt.result=0D =0D if self._ItemType in [MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,=0D @@ -1577,7 +1643,8 @@ class DscParser(MetaFileParser): Result =3D bool(Result)=0D else:=0D Macro =3D self._ValueList[1]=0D - Macro =3D Macro[2:-1] if (Macro.startswith("$(") and Macro= .endswith(")")) else Macro=0D + Macro =3D Macro[2:-1] if (Macro.startswith("$(")=0D + and Macro.endswith(")")) else Macr= o=0D Result =3D Macro in self._Macros=0D if self._ItemType =3D=3D MODEL_META_DATA_CONDITIONAL_STATE= MENT_IFNDEF:=0D Result =3D not Result=0D @@ -1611,7 +1678,8 @@ class DscParser(MetaFileParser): #=0D __IncludeMacros.update(self._Macros)=0D =0D - IncludedFile =3D NormPath(ReplaceMacro(self._ValueList[1], __I= ncludeMacros, RaiseError=3DTrue))=0D + IncludedFile =3D NormPath(ReplaceMacro(=0D + self._ValueList[1], __IncludeMacros, RaiseError=3DTrue))=0D #=0D # First search the include file under the same directory as DS= C file=0D #=0D @@ -1622,7 +1690,8 @@ class DscParser(MetaFileParser): #=0D # Also search file under the WORKSPACE directory=0D #=0D - IncludedFile1 =3D PathClass(IncludedFile, GlobalData.g= Workspace)=0D + IncludedFile1 =3D PathClass(=0D + IncludedFile, GlobalData.gWorkspace)=0D ErrorCode, ErrorInfo2 =3D IncludedFile1.Validate()=0D if ErrorCode !=3D 0:=0D EdkLogger.error('parser', ErrorCode, File=3Dself._= FileWithError,=0D @@ -1635,11 +1704,12 @@ class DscParser(MetaFileParser): Owner =3D self._Content[self._ContentIndex - 1][8]=0D else:=0D Owner =3D self._Content[self._ContentIndex - 1][0]=0D - IncludedFileTable =3D MetaFileStorage(self._RawTable.DB, I= ncludedFile1, MODEL_FILE_DSC, False, FromItem=3DFromItem)=0D + IncludedFileTable =3D MetaFileStorage(=0D + self._RawTable.DB, IncludedFile1, MODEL_FILE_DSC, Fals= e, FromItem=3DFromItem)=0D Parser =3D DscParser(IncludedFile1, self._FileType, self._= Arch, IncludedFileTable,=0D Owner=3DOwner, From=3DFromItem)=0D =0D - self.IncludedFiles.add (IncludedFile1)=0D + self.IncludedFiles.add(IncludedFile1)=0D =0D # set the parser status with current status=0D Parser._SectionName =3D self._SectionName=0D @@ -1664,22 +1734,27 @@ class DscParser(MetaFileParser): def __ProcessSkuId(self):=0D self._ValueList =3D [ReplaceMacro(Value, self._Macros, RaiseError= =3DTrue)=0D for Value in self._ValueList]=0D +=0D def __ProcessDefaultStores(self):=0D self._ValueList =3D [ReplaceMacro(Value, self._Macros, RaiseError= =3DTrue)=0D for Value in self._ValueList]=0D =0D def __ProcessLibraryInstance(self):=0D - self._ValueList =3D [ReplaceMacro(Value, self._Macros) for Value i= n self._ValueList]=0D + self._ValueList =3D [ReplaceMacro(Value, self._Macros)=0D + for Value in self._ValueList]=0D =0D def __ProcessLibraryClass(self):=0D - self._ValueList[1] =3D ReplaceMacro(self._ValueList[1], self._Macr= os, RaiseError=3DTrue)=0D + self._ValueList[1] =3D ReplaceMacro(=0D + self._ValueList[1], self._Macros, RaiseError=3DTrue)=0D =0D def __ProcessPcd(self):=0D if self._ItemType not in [MODEL_PCD_FEATURE_FLAG, MODEL_PCD_FIXED_= AT_BUILD]:=0D - self._ValueList[2] =3D ReplaceMacro(self._ValueList[2], self._= Macros, RaiseError=3DTrue)=0D + self._ValueList[2] =3D ReplaceMacro(=0D + self._ValueList[2], self._Macros, RaiseError=3DTrue)=0D return=0D =0D - ValList, Valid, Index =3D AnalyzeDscPcd(self._ValueList[2], self._= ItemType)=0D + ValList, Valid, Index =3D AnalyzeDscPcd(=0D + self._ValueList[2], self._ItemType)=0D if not Valid:=0D if self._ItemType in (MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYN= AMIC_EX_DEFAULT, MODEL_PCD_FIXED_AT_BUILD, MODEL_PCD_PATCHABLE_IN_MODULE):= =0D if ValList[1] !=3D TAB_VOID and StructPattern.match(ValLis= t[1]) is None and ValList[2]:=0D @@ -1702,7 +1777,8 @@ class DscParser(MetaFileParser): ValList[Index] =3D '0'=0D =0D if (not self._DirectiveEvalStack) or (False not in self._Directive= EvalStack):=0D - GlobalData.gPlatformPcds[TAB_SPLIT.join(self._ValueList[0:2])]= =3D PcdValue=0D + GlobalData.gPlatformPcds[TAB_SPLIT.join(=0D + self._ValueList[0:2])] =3D PcdValue=0D self._Symbols[TAB_SPLIT.join(self._ValueList[0:2])] =3D PcdVal= ue=0D try:=0D self._ValueList[2] =3D '|'.join(ValList)=0D @@ -1716,61 +1792,63 @@ class DscParser(MetaFileParser): self._ValueList =3D [ReplaceMacro(Value, self._Macros, RaiseError= =3DFalse)=0D for Value in self._ValueList]=0D =0D - def DisableOverrideComponent(self,module_id):=0D + def DisableOverrideComponent(self, module_id):=0D for ori_id in self._IdMapping:=0D if self._IdMapping[ori_id] =3D=3D module_id:=0D self._RawTable.DisableComponent(ori_id)=0D =0D _SectionParser =3D {=0D - MODEL_META_DATA_HEADER : _DefineParser,= =0D - MODEL_EFI_SKU_ID : _SkuIdParser,= =0D - MODEL_EFI_DEFAULT_STORES : _DefaultStores= Parser,=0D - MODEL_EFI_LIBRARY_INSTANCE : _LibraryInstan= ceParser,=0D - MODEL_EFI_LIBRARY_CLASS : _LibraryClassP= arser,=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC_DEFAULT : _PcdParser,=0D - MODEL_PCD_DYNAMIC_HII : _PcdParser,=0D - MODEL_PCD_DYNAMIC_VPD : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_DEFAULT : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_HII : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX_VPD : _PcdParser,=0D - MODEL_META_DATA_COMPONENT : _ComponentPars= er,=0D - MODEL_META_DATA_BUILD_OPTION : _BuildOptionPa= rser,=0D - MODEL_UNKNOWN : MetaFileParser= ._Skip,=0D - MODEL_META_DATA_PACKAGE : MetaFileParser= ._PackageParser,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser= ._SkipUserExtension,=0D - MODEL_META_DATA_SECTION_HEADER : MetaFileParser= ._SectionHeaderParser,=0D - MODEL_META_DATA_SUBSECTION_HEADER : _SubsectionHea= derParser,=0D + MODEL_META_DATA_HEADER: _DefineParser,=0D + MODEL_EFI_SKU_ID: _SkuIdParser,=0D + MODEL_EFI_DEFAULT_STORES: _DefaultStoresParser,=0D + MODEL_EFI_LIBRARY_INSTANCE: _LibraryInstanceParser,=0D + MODEL_EFI_LIBRARY_CLASS: _LibraryClassParser,=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC_DEFAULT: _PcdParser,=0D + MODEL_PCD_DYNAMIC_HII: _PcdParser,=0D + MODEL_PCD_DYNAMIC_VPD: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_DEFAULT: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_HII: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX_VPD: _PcdParser,=0D + MODEL_META_DATA_COMPONENT: _ComponentParser,=0D + MODEL_META_DATA_BUILD_OPTION: _BuildOptionParser,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_PACKAGE: MetaFileParser._PackageParser,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._SkipUserExtensio= n,=0D + MODEL_META_DATA_SECTION_HEADER: MetaFileParser._SectionHeaderPar= ser,=0D + MODEL_META_DATA_SUBSECTION_HEADER: _SubsectionHeaderParser,=0D }=0D =0D -## DEC file parser class=0D +# DEC file parser class=0D #=0D # @param FilePath The path of platform description file=0D # @param FileType The raw data of DSC file=0D # @param Table Database used to retrieve module/package i= nformation=0D # @param Macros Macros used for replacement in file=0D #=0D +=0D +=0D class DecParser(MetaFileParser):=0D # DEC file supported data types (one type per section)=0D DataType =3D {=0D - TAB_DEC_DEFINES.upper() : MODEL_META_DATA_HE= ADER,=0D - TAB_DSC_DEFINES_DEFINE : MODEL_META_DATA_DE= FINE,=0D - TAB_INCLUDES.upper() : MODEL_EFI_INCLUDE,= =0D - TAB_LIBRARY_CLASSES.upper() : MODEL_EFI_LIBRARY_= CLASS,=0D - TAB_GUIDS.upper() : MODEL_EFI_GUID,=0D - TAB_PPIS.upper() : MODEL_EFI_PPI,=0D - TAB_PROTOCOLS.upper() : MODEL_EFI_PROTOCOL= ,=0D - TAB_PCDS_FIXED_AT_BUILD_NULL.upper() : MODEL_PCD_FIXED_AT= _BUILD,=0D - TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper() : MODEL_PCD_PATCHABL= E_IN_MODULE,=0D - TAB_PCDS_FEATURE_FLAG_NULL.upper() : MODEL_PCD_FEATURE_= FLAG,=0D - TAB_PCDS_DYNAMIC_NULL.upper() : MODEL_PCD_DYNAMIC,= =0D - TAB_PCDS_DYNAMIC_EX_NULL.upper() : MODEL_PCD_DYNAMIC_= EX,=0D - TAB_USER_EXTENSIONS.upper() : MODEL_META_DATA_US= ER_EXTENSION,=0D + TAB_DEC_DEFINES.upper(): MODEL_META_DATA_HEADER,=0D + TAB_DSC_DEFINES_DEFINE: MODEL_META_DATA_DEFINE,=0D + TAB_INCLUDES.upper(): MODEL_EFI_INCLUDE,=0D + TAB_LIBRARY_CLASSES.upper(): MODEL_EFI_LIBRARY_CLASS,=0D + TAB_GUIDS.upper(): MODEL_EFI_GUID,=0D + TAB_PPIS.upper(): MODEL_EFI_PPI,=0D + TAB_PROTOCOLS.upper(): MODEL_EFI_PROTOCOL,=0D + TAB_PCDS_FIXED_AT_BUILD_NULL.upper(): MODEL_PCD_FIXED_AT_BUILD,= =0D + TAB_PCDS_PATCHABLE_IN_MODULE_NULL.upper(): MODEL_PCD_PATCHABLE_I= N_MODULE,=0D + TAB_PCDS_FEATURE_FLAG_NULL.upper(): MODEL_PCD_FEATURE_FLAG,=0D + TAB_PCDS_DYNAMIC_NULL.upper(): MODEL_PCD_DYNAMIC,=0D + TAB_PCDS_DYNAMIC_EX_NULL.upper(): MODEL_PCD_DYNAMIC_EX,=0D + TAB_USER_EXTENSIONS.upper(): MODEL_META_DATA_USER_EXTENSION,=0D }=0D =0D - ## Constructor of DecParser=0D + # Constructor of DecParser=0D #=0D # Initialize object of DecParser=0D #=0D @@ -1786,7 +1864,7 @@ class DecParser(MetaFileParser): MetaFileParser.__init__(self, FilePath, FileType, Arch, Table, -1)= =0D self._Comments =3D []=0D self._Version =3D 0x00010005 # Only EDK2 dec file is supported=0D - self._AllPCDs =3D [] # Only for check duplicate PCD=0D + self._AllPCDs =3D [] # Only for check duplicate PCD=0D self._AllPcdDict =3D {}=0D =0D self._CurrentStructurePcdName =3D ""=0D @@ -1795,14 +1873,15 @@ class DecParser(MetaFileParser): =0D self._RestofValue =3D ""=0D =0D - ## Parser starter=0D + # Parser starter=0D def Start(self):=0D Content =3D ''=0D try:=0D with open(str(self.MetaFile), 'r') as File:=0D Content =3D File.readlines()=0D except:=0D - EdkLogger.error("Parser", FILE_READ_FAILURE, ExtraData=3Dself.= MetaFile)=0D + EdkLogger.error("Parser", FILE_READ_FAILURE,=0D + ExtraData=3Dself.MetaFile)=0D =0D Content =3D self.ProcessMultipleLineCODEValue(Content)=0D =0D @@ -1829,7 +1908,7 @@ class DecParser(MetaFileParser): if self._SectionType =3D=3D MODEL_UNKNOWN:=0D EdkLogger.error("Parser", FORMAT_INVALID,=0D ""=0D - "Not able to determine \"%s\" in which sec= tion."%self._CurrentLine,=0D + "Not able to determine \"%s\" in which sec= tion." % self._CurrentLine,=0D self.MetaFile, self._LineIndex + 1)=0D elif len(self._SectionType) =3D=3D 0:=0D self._Comments =3D []=0D @@ -1861,7 +1940,7 @@ class DecParser(MetaFileParser): self._LineIndex + 1,=0D - 1,=0D 0=0D - )=0D + )=0D for Comment, LineNo in self._Comments:=0D self._Store(=0D MODEL_META_DATA_COMMENT,=0D @@ -1876,21 +1955,23 @@ class DecParser(MetaFileParser): LineNo,=0D - 1,=0D 0=0D - )=0D + )=0D self._Comments =3D []=0D if self._DefinesCount > 1:=0D - EdkLogger.error('Parser', FORMAT_INVALID, 'Multiple [Defines] = section is exist.', self.MetaFile )=0D + EdkLogger.error('Parser', FORMAT_INVALID,=0D + 'Multiple [Defines] section is exist.', self.M= etaFile)=0D if self._DefinesCount =3D=3D 0:=0D - EdkLogger.error('Parser', FORMAT_INVALID, 'No [Defines] sectio= n exist.', self.MetaFile)=0D + EdkLogger.error('Parser', FORMAT_INVALID,=0D + 'No [Defines] section exist.', self.MetaFile)= =0D self._Done()=0D =0D -=0D - ## Section header parser=0D + # Section header parser=0D #=0D # The section header is always in following format:=0D #=0D # [section_name.arch<.platform|module_type>]=0D #=0D +=0D def _SectionHeaderParser(self):=0D self._Scope =3D []=0D self._SectionName =3D ''=0D @@ -1919,13 +2000,13 @@ class DecParser(MetaFileParser): =0D if MODEL_PCD_FEATURE_FLAG in self._SectionType and len(self._S= ectionType) > 1:=0D EdkLogger.error(=0D - 'Parser',=0D - FORMAT_INVALID,=0D - "%s must not be in the same section of other t= ypes of PCD" % TAB_PCDS_FEATURE_FLAG_NULL,=0D - File=3Dself.MetaFile,=0D - Line=3Dself._LineIndex + 1,=0D - ExtraData=3Dself._CurrentLine=0D - )=0D + 'Parser',=0D + FORMAT_INVALID,=0D + "%s must not be in the same section of other types of = PCD" % TAB_PCDS_FEATURE_FLAG_NULL,=0D + File=3Dself.MetaFile,=0D + Line=3Dself._LineIndex + 1,=0D + ExtraData=3Dself._CurrentLine=0D + )=0D # S1 is always Arch=0D if len(ItemList) > 1:=0D S1 =3D ItemList[1].upper()=0D @@ -1956,33 +2037,36 @@ class DecParser(MetaFileParser): EdkLogger.error('Parser', FORMAT_INVALID, "Can't mix section t= ags without the Private attribute with section tags with the Private attrib= ute",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1, ExtraData=3Dself._CurrentLine)=0D =0D - ## [guids], [ppis] and [protocols] section parser=0D + # [guids], [ppis] and [protocols] section parser=0D @ParseMacro=0D def _GuidParser(self):=0D TokenList =3D GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT= , 1)=0D if len(TokenList) < 2:=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name or val= ue specified",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if TokenList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID name specif= ied",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No GUID value speci= fied",=0D - ExtraData=3Dself._CurrentLine + " ( =3D= )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D if TokenList[1][0] !=3D '{' or TokenList[1][-1] !=3D '}' or GuidSt= ructureStringToGuidString(TokenList[1]) =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid GUID value = format",=0D - ExtraData=3Dself._CurrentLine + \=0D - " ( =3D )",=0D + ExtraData=3Dself._CurrentLine +=0D + " ( =3D )",=0D File=3Dself.MetaFile, Line=3Dself._LineIndex += 1)=0D self._ValueList[0] =3D TokenList[0]=0D self._ValueList[1] =3D TokenList[1]=0D if self._ValueList[0] not in self._GuidDict:=0D self._GuidDict[self._ValueList[0]] =3D self._ValueList[1]=0D =0D - def ParsePcdName(self,namelist):=0D + def ParsePcdName(self, namelist):=0D if "[" in namelist[1]:=0D pcdname =3D namelist[1][:namelist[1].index("[")]=0D arrayindex =3D namelist[1][namelist[1].index("["):]=0D @@ -1990,10 +2074,10 @@ class DecParser(MetaFileParser): if len(namelist) =3D=3D 2:=0D namelist.append(arrayindex)=0D else:=0D - namelist[2] =3D ".".join((arrayindex,namelist[2]))=0D + namelist[2] =3D ".".join((arrayindex, namelist[2]))=0D return namelist=0D =0D - ## PCD sections parser=0D + # PCD sections parser=0D #=0D # [PcdsFixedAtBuild]=0D # [PcdsPatchableInModule]=0D @@ -2020,10 +2104,12 @@ class DecParser(MetaFileParser): return=0D =0D if self._include_flag:=0D - self._ValueList[1] =3D "_" + md5(self._Cu= rrentLine.encode('utf-8')).hexdigest()=0D + self._ValueList[1] =3D "_" + \=0D + md5(self._CurrentLine.encode('utf-8')).hexdigest()= =0D self._ValueList[2] =3D self._CurrentLine=0D if self._package_flag and "}" !=3D self._CurrentLine:=0D - self._ValueList[1] =3D "_" + md5(self._Curre= ntLine.encode('utf-8')).hexdigest()=0D + self._ValueList[1] =3D "_" + \=0D + md5(self._CurrentLine.encode('utf-8')).hexdigest()= =0D self._ValueList[2] =3D self._CurrentLine=0D if self._CurrentLine =3D=3D "}":=0D self._package_flag =3D False=0D @@ -2037,7 +2123,8 @@ class DecParser(MetaFileParser): if PcdNames[1].strip().endswith("]"):=0D PcdName =3D PcdNames[1][:PcdNames[1].index('[')]=0D Index =3D PcdNames[1][PcdNames[1].index('['):]=0D - self._ValueList[0] =3D TAB_SPLIT.join((PcdNames[0]= ,PcdName))=0D + self._ValueList[0] =3D TAB_SPLIT.join(=0D + (PcdNames[0], PcdName))=0D self._ValueList[1] =3D Index=0D self._ValueList[2] =3D PcdTockens[1]=0D else:=0D @@ -2045,22 +2132,24 @@ class DecParser(MetaFileParser): else:=0D if self._CurrentStructurePcdName !=3D TAB_SPLIT.join(P= cdNames[:2]):=0D EdkLogger.error('Parser', FORMAT_INVALID, "Pcd Nam= e does not match: %s and %s " % (self._CurrentStructurePcdName, TAB_SPLIT.j= oin(PcdNames[:2])),=0D - File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D + File=3Dself.MetaFile, Line=3Dself.= _LineIndex + 1)=0D self._ValueList[1] =3D TAB_SPLIT.join(PcdNames[2:])=0D self._ValueList[2] =3D PcdTockens[1]=0D if not self._CurrentStructurePcdName:=0D if self._PcdDataTypeCODE:=0D if ")}" in self._CurrentLine:=0D - ValuePart,RestofValue =3D self._CurrentLine.split(")}"= )=0D + ValuePart, RestofValue =3D self._CurrentLine.split(")}= ")=0D self._PcdCodeValue =3D self._PcdCodeValue + "\n " + Va= luePart=0D - self._CurrentLine =3D "|".join((self._CurrentPcdName, = self._PcdCodeValue,RestofValue))=0D + self._CurrentLine =3D "|".join(=0D + (self._CurrentPcdName, self._PcdCodeValue, RestofV= alue))=0D self._PcdDataTypeCODE =3D False=0D self._PcdCodeValue =3D ""=0D else:=0D self._PcdCodeValue =3D self._PcdCodeValue + "\n " + se= lf._CurrentLine=0D self._ValueList =3D None=0D return=0D - TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_S= PLIT, 1)=0D + TokenList =3D GetSplitValueList(=0D + self._CurrentLine, TAB_VALUE_SPLIT, 1)=0D self._CurrentPcdName =3D TokenList[0]=0D if len(TokenList) =3D=3D 2 and TokenList[1].strip().startswith= ("{CODE"):=0D if ")}" in self._CurrentLine:=0D @@ -2077,29 +2166,28 @@ class DecParser(MetaFileParser): # check PCD information=0D if self._ValueList[0] =3D=3D '' or self._ValueList[1] =3D=3D '= ':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No token space = GUID or PCD name specified",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check format of token space GUID CName=0D if not ValueRe.match(self._ValueList[0]):=0D EdkLogger.error('Parser', FORMAT_INVALID, "The format of t= he token space GUID CName is invalid. The correct format is '(a-zA-Z_)[a-zA= -Z0-9_]*'",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check format of PCD CName=0D if not ValueRe.match(self._ValueList[1]):=0D EdkLogger.error('Parser', FORMAT_INVALID, "The format of t= he PCD CName is invalid. The correct format is '(a-zA-Z_)[a-zA-Z0-9_]*'",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check PCD datum information=0D if len(TokenList) < 2 or TokenList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "No PCD Datum in= formation given",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D =0D -=0D ValueRe =3D re.compile(r'^\s*L?\".*\|.*\"')=0D PtrValue =3D ValueRe.findall(TokenList[1])=0D =0D @@ -2111,39 +2199,40 @@ class DecParser(MetaFileParser): else:=0D ValueList =3D AnalyzePcdExpression(TokenList[1])=0D =0D -=0D # check if there's enough datum information given=0D if len(ValueList) !=3D 3:=0D EdkLogger.error('Parser', FORMAT_INVALID, "Invalid PCD Dat= um information given",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check default value=0D if ValueList[0] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing Default= Value in PCD Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check datum type=0D if ValueList[1] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing DatumTy= pe in PCD Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D # check token of the PCD=0D if ValueList[2] =3D=3D '':=0D EdkLogger.error('Parser', FORMAT_INVALID, "Missing Token i= n PCD Datum information",=0D - ExtraData=3Dself._CurrentLine + \=0D - " (.|||)",=0D + ExtraData=3Dself._CurrentLine +=0D + " (.|||)",=0D File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D =0D PcdValue =3D ValueList[0]=0D if PcdValue:=0D try:=0D self._GuidDict.update(self._AllPcdDict)=0D - ValueList[0] =3D ValueExpressionEx(ValueList[0], Value= List[1], self._GuidDict)(True)=0D + ValueList[0] =3D ValueExpressionEx(=0D + ValueList[0], ValueList[1], self._GuidDict)(True)= =0D except BadExpression as Value:=0D - EdkLogger.error('Parser', FORMAT_INVALID, Value, Extra= Data=3Dself._CurrentLine, File=3Dself.MetaFile, Line=3Dself._LineIndex + 1)= =0D + EdkLogger.error('Parser', FORMAT_INVALID, Value, Extra= Data=3Dself._CurrentLine,=0D + File=3Dself.MetaFile, Line=3Dself._Lin= eIndex + 1)=0D # check format of default value against the datum type=0D IsValid, Cause =3D CheckPcdDatum(ValueList[1], ValueList[0])=0D if not IsValid:=0D @@ -2151,7 +2240,8 @@ class DecParser(MetaFileParser): File=3Dself.MetaFile, Line=3Dself._LineInd= ex + 1)=0D =0D if Cause =3D=3D "StructurePcd":=0D - self._CurrentStructurePcdName =3D TAB_SPLIT.join(self._Val= ueList[0:2])=0D + self._CurrentStructurePcdName =3D TAB_SPLIT.join(=0D + self._ValueList[0:2])=0D self._ValueList[0] =3D self._CurrentStructurePcdName=0D self._ValueList[1] =3D ValueList[1].strip()=0D =0D @@ -2166,27 +2256,31 @@ class DecParser(MetaFileParser): "The same PCD name and GUID have been alre= ady defined",=0D ExtraData=3Dself._CurrentLine, File=3Dself= .MetaFile, Line=3Dself._LineIndex + 1)=0D else:=0D - self._AllPCDs.append((self._Scope[0], self._ValueList[0], = self._ValueList[1]))=0D - self._AllPcdDict[TAB_SPLIT.join(self._ValueList[0:2])] =3D= ValueList[0]=0D + self._AllPCDs.append(=0D + (self._Scope[0], self._ValueList[0], self._ValueList[1= ]))=0D + self._AllPcdDict[TAB_SPLIT.join(=0D + self._ValueList[0:2])] =3D ValueList[0]=0D =0D - self._ValueList[2] =3D ValueList[0].strip() + '|' + ValueList[= 1].strip() + '|' + ValueList[2].strip()=0D + self._ValueList[2] =3D ValueList[0].strip(=0D + ) + '|' + ValueList[1].strip() + '|' + ValueList[2].strip()=0D =0D _SectionParser =3D {=0D - MODEL_META_DATA_HEADER : MetaFileParser._DefineParser,= =0D - MODEL_EFI_INCLUDE : MetaFileParser._PathParser,=0D - MODEL_EFI_LIBRARY_CLASS : MetaFileParser._PathParser,=0D - MODEL_EFI_GUID : _GuidParser,=0D - MODEL_EFI_PPI : _GuidParser,=0D - MODEL_EFI_PROTOCOL : _GuidParser,=0D - MODEL_PCD_FIXED_AT_BUILD : _PcdParser,=0D - MODEL_PCD_PATCHABLE_IN_MODULE : _PcdParser,=0D - MODEL_PCD_FEATURE_FLAG : _PcdParser,=0D - MODEL_PCD_DYNAMIC : _PcdParser,=0D - MODEL_PCD_DYNAMIC_EX : _PcdParser,=0D - MODEL_UNKNOWN : MetaFileParser._Skip,=0D - MODEL_META_DATA_USER_EXTENSION : MetaFileParser._SkipUserExtens= ion,=0D + MODEL_META_DATA_HEADER: MetaFileParser._DefineParser,=0D + MODEL_EFI_INCLUDE: MetaFileParser._PathParser,=0D + MODEL_EFI_LIBRARY_CLASS: MetaFileParser._PathParser,=0D + MODEL_EFI_GUID: _GuidParser,=0D + MODEL_EFI_PPI: _GuidParser,=0D + MODEL_EFI_PROTOCOL: _GuidParser,=0D + MODEL_PCD_FIXED_AT_BUILD: _PcdParser,=0D + MODEL_PCD_PATCHABLE_IN_MODULE: _PcdParser,=0D + MODEL_PCD_FEATURE_FLAG: _PcdParser,=0D + MODEL_PCD_DYNAMIC: _PcdParser,=0D + MODEL_PCD_DYNAMIC_EX: _PcdParser,=0D + MODEL_UNKNOWN: MetaFileParser._Skip,=0D + MODEL_META_DATA_USER_EXTENSION: MetaFileParser._SkipUserExtensio= n,=0D }=0D =0D +=0D ##=0D #=0D # This acts like the main() function for the script, unless it is 'import'= ed into another=0D @@ -2194,4 +2288,3 @@ class DecParser(MetaFileParser): #=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/Workspace/MetaFileTable.py b/BaseTools= /Source/Python/Workspace/MetaFileTable.py index bebf9062e8e5..307a709fb57d 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileTable.py +++ b/BaseTools/Source/Python/Workspace/MetaFileTable.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create/update/query/erase a meta file table=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -15,15 +15,16 @@ import Common.EdkLogger as EdkLogger from Common.BuildToolError import FORMAT_INVALID=0D =0D from CommonDataClass.DataClass import MODEL_FILE_DSC, MODEL_FILE_DEC, MODE= L_FILE_INF, \=0D - MODEL_FILE_OTHERS=0D + MODEL_FILE_OTHERS=0D from Common.DataType import *=0D =0D +=0D class MetaFileTable():=0D # TRICK: use file ID as the part before '.'=0D _ID_STEP_ =3D 1=0D _ID_MAX_ =3D 99999999=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, DB, MetaFile, FileType, Temporary, FromItem=3DNone)= :=0D self.MetaFile =3D MetaFile=0D self.TableName =3D ""=0D @@ -32,16 +33,17 @@ class MetaFileTable(): =0D self.CurrentContent =3D []=0D DB.TblFile.append([MetaFile.Name,=0D - MetaFile.Ext,=0D - MetaFile.Dir,=0D - MetaFile.Path,=0D - FileType,=0D - MetaFile.TimeStamp,=0D - FromItem])=0D + MetaFile.Ext,=0D + MetaFile.Dir,=0D + MetaFile.Path,=0D + FileType,=0D + MetaFile.TimeStamp,=0D + FromItem])=0D self.FileId =3D len(DB.TblFile)=0D self.ID =3D self.FileId * 10**8=0D if Temporary:=0D - self.TableName =3D "_%s_%s_%s" % (FileType, len(DB.TblFile), u= uid.uuid4().hex)=0D + self.TableName =3D "_%s_%s_%s" % (=0D + FileType, len(DB.TblFile), uuid.uuid4().hex)=0D else:=0D self.TableName =3D "_%s_%s" % (FileType, len(DB.TblFile))=0D =0D @@ -62,9 +64,11 @@ class MetaFileTable(): self.CurrentContent.append(self._DUMMY_)=0D =0D def GetAll(self):=0D - return [item for item in self.CurrentContent if item[0] >=3D 0 and= item[-1]>=3D0]=0D + return [item for item in self.CurrentContent if item[0] >=3D 0 and= item[-1] >=3D 0]=0D +=0D +# Python class representation of table storing module data=0D +=0D =0D -## Python class representation of table storing module data=0D class ModuleTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -82,13 +86,14 @@ class ModuleTable(MetaFileTable): Enabled INTEGER DEFAULT 0=0D '''=0D # used as table end flag, in case the changes to database is not commi= tted to db file=0D - _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1]=0D + _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D',=0D + '=3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1]=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Db, MetaFile, Temporary):=0D MetaFileTable.__init__(self, Db, MetaFile, MODEL_FILE_INF, Tempora= ry)=0D =0D - ## Insert a record into table Inf=0D + # Insert a record into table Inf=0D #=0D # @param Model: Model of a Inf item=0D # @param Value1: Value1 of a Inf item=0D @@ -106,29 +111,30 @@ class ModuleTable(MetaFileTable): def Insert(self, Model, Value1, Value2, Value3, Scope1=3DTAB_ARCH_COMM= ON, Scope2=3DTAB_COMMON,=0D BelongsToItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLi= ne=3D-1, EndColumn=3D-1, Enabled=3D0):=0D =0D - (Value1, Value2, Value3, Scope1, Scope2) =3D (Value1.strip(), Valu= e2.strip(), Value3.strip(), Scope1.strip(), Scope2.strip())=0D + (Value1, Value2, Value3, Scope1, Scope2) =3D (Value1.strip(),=0D + Value2.strip(), Value3= .strip(), Scope1.strip(), Scope2.strip())=0D self.ID =3D self.ID + self._ID_STEP_=0D if self.ID >=3D (MODEL_FILE_INF + self._ID_MAX_):=0D self.ID =3D MODEL_FILE_INF + self._ID_STEP_=0D =0D - row =3D [ self.ID,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Scope1,=0D - Scope2,=0D - BelongsToItem,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - ]=0D + row =3D [self.ID,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Scope1,=0D + Scope2,=0D + BelongsToItem,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + ]=0D self.CurrentContent.append(row)=0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Arch: The Arch attribute of Record=0D @@ -139,7 +145,8 @@ class ModuleTable(MetaFileTable): def Query(self, Model, Arch=3DNone, Platform=3DNone, BelongsToItem=3DN= one):=0D =0D QueryTab =3D self.CurrentContent=0D - result =3D [item for item in QueryTab if item[1] =3D=3D Model and = item[-1]>=3D0 ]=0D + result =3D [item for item in QueryTab if item[1]=0D + =3D=3D Model and item[-1] >=3D 0]=0D =0D if Arch is not None and Arch !=3D TAB_ARCH_COMMON:=0D ArchList =3D set(['COMMON'])=0D @@ -147,17 +154,19 @@ class ModuleTable(MetaFileTable): result =3D [item for item in result if item[5] in ArchList]=0D =0D if Platform is not None and Platform !=3D TAB_COMMON:=0D - Platformlist =3D set( ['COMMON','DEFAULT'])=0D + Platformlist =3D set(['COMMON', 'DEFAULT'])=0D Platformlist.add(Platform)=0D result =3D [item for item in result if item[6] in Platformlist= ]=0D =0D if BelongsToItem is not None:=0D result =3D [item for item in result if item[7] =3D=3D BelongsT= oItem]=0D =0D - result =3D [ [r[2],r[3],r[4],r[5],r[6],r[0],r[8]] for r in result = ]=0D + result =3D [[r[2], r[3], r[4], r[5], r[6], r[0], r[8]] for r in re= sult]=0D return result=0D =0D -## Python class representation of table storing package data=0D +# Python class representation of table storing package data=0D +=0D +=0D class PackageTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -175,13 +184,15 @@ class PackageTable(MetaFileTable): Enabled INTEGER DEFAULT 0=0D '''=0D # used as table end flag, in case the changes to database is not commi= tted to db file=0D - _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1]=0D + _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D',=0D + '=3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1]=0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Cursor, MetaFile, Temporary):=0D - MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DEC, Tem= porary)=0D + MetaFileTable.__init__(self, Cursor, MetaFile,=0D + MODEL_FILE_DEC, Temporary)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dec=0D #=0D @@ -200,27 +211,28 @@ class PackageTable(MetaFileTable): #=0D def Insert(self, Model, Value1, Value2, Value3, Scope1=3DTAB_ARCH_COMM= ON, Scope2=3DTAB_COMMON,=0D BelongsToItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLi= ne=3D-1, EndColumn=3D-1, Enabled=3D0):=0D - (Value1, Value2, Value3, Scope1, Scope2) =3D (Value1.strip(), Valu= e2.strip(), Value3.strip(), Scope1.strip(), Scope2.strip())=0D + (Value1, Value2, Value3, Scope1, Scope2) =3D (Value1.strip(),=0D + Value2.strip(), Value3= .strip(), Scope1.strip(), Scope2.strip())=0D self.ID =3D self.ID + self._ID_STEP_=0D =0D - row =3D [ self.ID,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Scope1,=0D - Scope2,=0D - BelongsToItem,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - ]=0D + row =3D [self.ID,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Scope1,=0D + Scope2,=0D + BelongsToItem,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + ]=0D self.CurrentContent.append(row)=0D return self.ID=0D =0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Arch: The Arch attribute of Record=0D @@ -230,7 +242,8 @@ class PackageTable(MetaFileTable): def Query(self, Model, Arch=3DNone):=0D =0D QueryTab =3D self.CurrentContent=0D - result =3D [item for item in QueryTab if item[1] =3D=3D Model and = item[-1]>=3D0 ]=0D + result =3D [item for item in QueryTab if item[1]=0D + =3D=3D Model and item[-1] >=3D 0]=0D =0D if Arch is not None and Arch !=3D TAB_ARCH_COMMON:=0D ArchList =3D set(['COMMON'])=0D @@ -242,7 +255,8 @@ class PackageTable(MetaFileTable): def GetValidExpression(self, TokenSpaceGuid, PcdCName):=0D =0D QueryTab =3D self.CurrentContent=0D - result =3D [[item[2], item[8]] for item in QueryTab if item[3] =3D= =3D TokenSpaceGuid and item[4] =3D=3D PcdCName]=0D + result =3D [[item[2], item[8]] for item in QueryTab if item[3]=0D + =3D=3D TokenSpaceGuid and item[4] =3D=3D PcdCName]=0D validateranges =3D []=0D validlists =3D []=0D expressions =3D []=0D @@ -276,7 +290,9 @@ class PackageTable(MetaFileTable): return set(), set(), set()=0D return set(validateranges), set(validlists), set(expressions)=0D =0D -## Python class representation of table storing platform data=0D +# Python class representation of table storing platform data=0D +=0D +=0D class PlatformTable(MetaFileTable):=0D _COLUMN_ =3D '''=0D ID REAL PRIMARY KEY,=0D @@ -296,13 +312,15 @@ class PlatformTable(MetaFileTable): Enabled INTEGER DEFAULT 0=0D '''=0D # used as table end flag, in case the changes to database is not commi= tted to db file=0D - _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D', '=3D=3D=3D=3D','=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1, -1]=0D + _DUMMY_ =3D [-1, -1, '=3D=3D=3D=3D', '=3D=3D=3D=3D', '=3D=3D=3D=3D', '= =3D=3D=3D=3D',=0D + '=3D=3D=3D=3D', '=3D=3D=3D=3D', -1, -1, -1, -1, -1, -1, -1]= =0D =0D - ## Constructor=0D + # Constructor=0D def __init__(self, Cursor, MetaFile, Temporary, FromItem=3D0):=0D - MetaFileTable.__init__(self, Cursor, MetaFile, MODEL_FILE_DSC, Tem= porary, FromItem)=0D + MetaFileTable.__init__(self, Cursor, MetaFile,=0D + MODEL_FILE_DSC, Temporary, FromItem)=0D =0D - ## Insert table=0D + # Insert table=0D #=0D # Insert a record into table Dsc=0D #=0D @@ -320,32 +338,32 @@ class PlatformTable(MetaFileTable): # @param EndColumn: EndColumn of a Dsc item=0D # @param Enabled: If this item enabled=0D #=0D - def Insert(self, Model, Value1, Value2, Value3, Scope1=3DTAB_ARCH_COMM= ON, Scope2=3DTAB_COMMON, Scope3=3DTAB_DEFAULT_STORES_DEFAULT,BelongsToItem= =3D-1,=0D + def Insert(self, Model, Value1, Value2, Value3, Scope1=3DTAB_ARCH_COMM= ON, Scope2=3DTAB_COMMON, Scope3=3DTAB_DEFAULT_STORES_DEFAULT, BelongsToItem= =3D-1,=0D FromItem=3D-1, StartLine=3D-1, StartColumn=3D-1, EndLine=3D= -1, EndColumn=3D-1, Enabled=3D1):=0D - (Value1, Value2, Value3, Scope1, Scope2, Scope3) =3D (Value1.strip= (), Value2.strip(), Value3.strip(), Scope1.strip(), Scope2.strip(), Scope3.= strip())=0D + (Value1, Value2, Value3, Scope1, Scope2, Scope3) =3D (Value1.strip= (), Value2.strip(=0D + ), Value3.strip(), Scope1.strip(), Scope2.strip(), Scope3.strip())= =0D self.ID =3D self.ID + self._ID_STEP_=0D =0D - row =3D [ self.ID,=0D - Model,=0D - Value1,=0D - Value2,=0D - Value3,=0D - Scope1,=0D - Scope2,=0D - Scope3,=0D - BelongsToItem,=0D - FromItem,=0D - StartLine,=0D - StartColumn,=0D - EndLine,=0D - EndColumn,=0D - Enabled=0D - ]=0D + row =3D [self.ID,=0D + Model,=0D + Value1,=0D + Value2,=0D + Value3,=0D + Scope1,=0D + Scope2,=0D + Scope3,=0D + BelongsToItem,=0D + FromItem,=0D + StartLine,=0D + StartColumn,=0D + EndLine,=0D + EndColumn,=0D + Enabled=0D + ]=0D self.CurrentContent.append(row)=0D return self.ID=0D =0D -=0D - ## Query table=0D + # Query table=0D #=0D # @param Model: The Model of Record=0D # @param Scope1: Arch of a Dsc item=0D @@ -355,15 +373,17 @@ class PlatformTable(MetaFileTable): #=0D # @retval: A recordSet of all found records=0D #=0D +=0D def Query(self, Model, Scope1=3DNone, Scope2=3DNone, BelongsToItem=3DN= one, FromItem=3DNone):=0D =0D QueryTab =3D self.CurrentContent=0D - result =3D [item for item in QueryTab if item[1] =3D=3D Model and = item[-1]>0 ]=0D + result =3D [item for item in QueryTab if item[1]=0D + =3D=3D Model and item[-1] > 0]=0D if Scope1 is not None and Scope1 !=3D TAB_ARCH_COMMON:=0D Sc1 =3D set(['COMMON'])=0D Sc1.add(Scope1)=0D result =3D [item for item in result if item[5] in Sc1]=0D - Sc2 =3D set( ['COMMON','DEFAULT'])=0D + Sc2 =3D set(['COMMON', 'DEFAULT'])=0D if Scope2 and Scope2 !=3D TAB_COMMON:=0D if '.' in Scope2:=0D Index =3D Scope2.index('.')=0D @@ -379,33 +399,37 @@ class PlatformTable(MetaFileTable): if FromItem is not None:=0D result =3D [item for item in result if item[9] =3D=3D FromItem= ]=0D =0D - result =3D [ [r[2],r[3],r[4],r[5],r[6],r[7],r[0],r[10]] for r in r= esult ]=0D + result =3D [[r[2], r[3], r[4], r[5], r[6], r[7], r[0], r[10]]=0D + for r in result]=0D return result=0D =0D - def DisableComponent(self,comp_id):=0D + def DisableComponent(self, comp_id):=0D for item in self.CurrentContent:=0D if item[0] =3D=3D comp_id or item[8] =3D=3D comp_id:=0D item[-1] =3D -1=0D =0D -## Factory class to produce different storage for different type of meta-f= ile=0D +# Factory class to produce different storage for different type of meta-fi= le=0D +=0D +=0D class MetaFileStorage(object):=0D _FILE_TABLE_ =3D {=0D - MODEL_FILE_INF : ModuleTable,=0D - MODEL_FILE_DEC : PackageTable,=0D - MODEL_FILE_DSC : PlatformTable,=0D - MODEL_FILE_OTHERS : MetaFileTable,=0D + MODEL_FILE_INF: ModuleTable,=0D + MODEL_FILE_DEC: PackageTable,=0D + MODEL_FILE_DSC: PlatformTable,=0D + MODEL_FILE_OTHERS: MetaFileTable,=0D }=0D =0D _FILE_TYPE_ =3D {=0D - ".inf" : MODEL_FILE_INF,=0D - ".dec" : MODEL_FILE_DEC,=0D - ".dsc" : MODEL_FILE_DSC,=0D + ".inf": MODEL_FILE_INF,=0D + ".dec": MODEL_FILE_DEC,=0D + ".dsc": MODEL_FILE_DSC,=0D }=0D _ObjectCache =3D {}=0D - ## Constructor=0D + # Constructor=0D +=0D def __new__(Class, Cursor, MetaFile, FileType=3DNone, Temporary=3DFals= e, FromItem=3DNone):=0D # no type given, try to find one=0D - key =3D (MetaFile.Path, FileType,Temporary,FromItem)=0D + key =3D (MetaFile.Path, FileType, Temporary, FromItem)=0D if key in Class._ObjectCache:=0D return Class._ObjectCache[key]=0D if not FileType:=0D @@ -427,4 +451,3 @@ class MetaFileStorage(object): if not Temporary:=0D Class._ObjectCache[key] =3D reval=0D return reval=0D -=0D diff --git a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py b/BaseToo= ls/Source/Python/Workspace/WorkspaceCommon.py index 9e506fc646b1..c14bf28d812e 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceCommon.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceCommon.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Common routines used by workspace=0D #=0D # Copyright (c) 2012 - 2020, Intel Corporation. All rights reserved.
        =0D @@ -17,6 +17,7 @@ from Common.BuildToolError import OPTION_MISSING from Common.BuildToolError import BUILD_ERROR=0D import Common.EdkLogger as EdkLogger=0D =0D +=0D class OrderedListDict(OrderedDict):=0D def __init__(self, *args, **kwargs):=0D super(OrderedListDict, self).__init__(*args, **kwargs)=0D @@ -26,7 +27,7 @@ class OrderedListDict(OrderedDict): self[key] =3D Value =3D self.default_factory()=0D return Value=0D =0D -## Get all packages from platform for specified arch, target and toolchain= =0D +# Get all packages from platform for specified arch, target and toolchain= =0D #=0D # @param Platform: DscBuildData instance=0D # @param BuildDatabase: The database saves all data for all metafiles=0D @@ -35,6 +36,8 @@ class OrderedListDict(OrderedDict): # @param Toolchain: Current toolchain=0D # @retval: List of packages which are DecBuildData instances=0D #=0D +=0D +=0D def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain):=0D PkgSet =3D set()=0D if Platform.Packages:=0D @@ -46,7 +49,7 @@ def GetPackageList(Platform, BuildDatabase, Arch, Target,= Toolchain): PkgSet.update(Lib.Packages)=0D return list(PkgSet)=0D =0D -## Get all declared PCD from platform for specified arch, target and toolc= hain=0D +# Get all declared PCD from platform for specified arch, target and toolch= ain=0D #=0D # @param Platform: DscBuildData instance=0D # @param BuildDatabase: The database saves all data for all metafiles=0D @@ -56,6 +59,8 @@ def GetPackageList(Platform, BuildDatabase, Arch, Target,= Toolchain): # @retval: A dictionary contains instances of PcdClassObject with key (Pc= dCName, TokenSpaceGuid)=0D # @retval: A dictionary contains real GUIDs of TokenSpaceGuid=0D #=0D +=0D +=0D def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain, addit= ionalPkgs):=0D PkgList =3D GetPackageList(Platform, BuildDatabase, Arch, Target, Tool= chain)=0D PkgList =3D set(PkgList)=0D @@ -77,7 +82,7 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target,= Toolchain, additionalP DecPcds[PcdCName, PcdTokenName] =3D Pkg.Pcds[Pcd]=0D return DecPcds, GuidDict=0D =0D -## Get all dependent libraries for a module=0D +# Get all dependent libraries for a module=0D #=0D # @param Module: InfBuildData instance=0D # @param Platform: DscBuildData instance=0D @@ -87,10 +92,13 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Targe= t, Toolchain, additionalP # @param Toolchain: Current toolchain=0D # @retval: List of dependent libraries which are InfBuildData instances=0D #=0D +=0D +=0D def GetLiabraryInstances(Module, Platform, BuildDatabase, Arch, Target, To= olchain):=0D - return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Ta= rget, Toolchain,Platform.MetaFile,EdkLogger)=0D + return GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Ta= rget, Toolchain, Platform.MetaFile, EdkLogger)=0D =0D -def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, T= oolchain, FileName =3D '', EdkLogger =3D None):=0D +=0D +def GetModuleLibInstances(Module, Platform, BuildDatabase, Arch, Target, T= oolchain, FileName=3D'', EdkLogger=3DNone):=0D if Module.LibInstances:=0D return Module.LibInstances=0D ModuleType =3D Module.ModuleType=0D @@ -103,12 +111,14 @@ def GetModuleLibInstances(Module, Platform, BuildData= base, Arch, Target, Toolcha if Module.ModuleType !=3D SUP_MODULE_USER_DEFINED:=0D for LibraryClass in Platform.LibraryClasses.GetKeys():=0D if LibraryClass.startswith("NULL") and Platform.LibraryClasses= [LibraryClass, Module.ModuleType]:=0D - Module.LibraryClasses[LibraryClass] =3D Platform.LibraryCl= asses[LibraryClass, Module.ModuleType]=0D + Module.LibraryClasses[LibraryClass] =3D Platform.LibraryCl= asses[LibraryClass,=0D + = Module.ModuleType]=0D =0D # add forced library instances (specified in module overrides)=0D for LibraryClass in Platform.Modules[str(Module)].LibraryClasses:=0D if LibraryClass.startswith("NULL"):=0D - Module.LibraryClasses[LibraryClass] =3D Platform.Modules[str(M= odule)].LibraryClasses[LibraryClass]=0D + Module.LibraryClasses[LibraryClass] =3D Platform.Modules[str(= =0D + Module)].LibraryClasses[LibraryClass]=0D =0D # EdkII module=0D LibraryConsumerList =3D [Module]=0D @@ -118,14 +128,16 @@ def GetModuleLibInstances(Module, Platform, BuildData= base, Arch, Target, Toolcha =0D if not Module.LibraryClass:=0D EdkLogger.verbose("")=0D - EdkLogger.verbose("Library instances of module [%s] [%s]:" % (str(= Module), Arch))=0D + EdkLogger.verbose(=0D + "Library instances of module [%s] [%s]:" % (str(Module), Arch)= )=0D =0D while len(LibraryConsumerList) > 0:=0D M =3D LibraryConsumerList.pop()=0D for LibraryClassName in M.LibraryClasses:=0D if LibraryClassName not in LibraryInstance:=0D # override library instance for this module=0D - LibraryPath =3D Platform.Modules[str(Module)].LibraryClass= es.get(LibraryClassName,Platform.LibraryClasses[LibraryClassName, ModuleTyp= e])=0D + LibraryPath =3D Platform.Modules[str(Module)].LibraryClass= es.get(=0D + LibraryClassName, Platform.LibraryClasses[LibraryClass= Name, ModuleType])=0D if LibraryPath is None:=0D LibraryPath =3D M.LibraryClasses.get(LibraryClassName)= =0D if LibraryPath is None:=0D @@ -137,20 +149,22 @@ def GetModuleLibInstances(Module, Platform, BuildData= base, Arch, Target, Toolcha else:=0D return []=0D =0D - LibraryModule =3D BuildDatabase[LibraryPath, Arch, Target,= Toolchain]=0D + LibraryModule =3D BuildDatabase[LibraryPath,=0D + Arch, Target, Toolchain]=0D # for those forced library instance (NULL library), add a = fake library class=0D if LibraryClassName.startswith("NULL"):=0D - LibraryModule.LibraryClass.append(LibraryClassObject(L= ibraryClassName, [ModuleType]))=0D + LibraryModule.LibraryClass.append(=0D + LibraryClassObject(LibraryClassName, [ModuleType])= )=0D elif LibraryModule.LibraryClass is None \=0D - or len(LibraryModule.LibraryClass) =3D=3D 0 \=0D - or (ModuleType !=3D SUP_MODULE_USER_DEFINED and Modul= eType !=3D SUP_MODULE_HOST_APPLICATION=0D - and ModuleType not in LibraryModule.LibraryClass[= 0].SupModList):=0D + or len(LibraryModule.LibraryClass) =3D=3D 0 \=0D + or (ModuleType !=3D SUP_MODULE_USER_DEFINED and Module= Type !=3D SUP_MODULE_HOST_APPLICATION=0D + and ModuleType not in LibraryModule.LibraryClass[0= ].SupModList):=0D # only USER_DEFINED can link against any library insta= nce despite of its SupModList=0D if not Module.LibraryClass:=0D EdkLogger.error("build", OPTION_MISSING,=0D - "Module type [%s] is not supported= by library instance [%s]" \=0D + "Module type [%s] is not supported= by library instance [%s]"=0D % (ModuleType, LibraryPath), File= =3DFileName,=0D - ExtraData=3D"consumed by library i= nstance [%s] which is consumed by module [%s]" \=0D + ExtraData=3D"consumed by library i= nstance [%s] which is consumed by module [%s]"=0D % (str(M), str(Module))=0D )=0D else:=0D @@ -159,7 +173,8 @@ def GetModuleLibInstances(Module, Platform, BuildDataba= se, Arch, Target, Toolcha LibraryInstance[LibraryClassName] =3D LibraryModule=0D LibraryConsumerList.append(LibraryModule)=0D if not Module.LibraryClass:=0D - EdkLogger.verbose("\t" + str(LibraryClassName) + " : "= + str(LibraryModule))=0D + EdkLogger.verbose(=0D + "\t" + str(LibraryClassName) + " : " + str(Library= Module))=0D else:=0D LibraryModule =3D LibraryInstance[LibraryClassName]=0D =0D @@ -181,7 +196,7 @@ def GetModuleLibInstances(Module, Platform, BuildDataba= se, Arch, Target, Toolcha #=0D # Q <- Set of all nodes with no incoming edges=0D #=0D - LibraryList =3D [] #LibraryInstance.values()=0D + LibraryList =3D [] # LibraryInstance.values()=0D Q =3D []=0D for LibraryClassName in LibraryInstance:=0D M =3D LibraryInstance[LibraryClassName]=0D @@ -240,7 +255,9 @@ def GetModuleLibInstances(Module, Platform, BuildDataba= se, Arch, Target, Toolcha for Item in LibraryList:=0D if ConsumedByList[Item] and Item in Constructor and len(Constructo= r) > 1:=0D if not Module.LibraryClass:=0D - ErrorMessage =3D "\tconsumed by " + "\n\tconsumed by ".joi= n(str(L) for L in ConsumedByList[Item])=0D + ErrorMessage =3D "\tconsumed by " + \=0D + "\n\tconsumed by ".join(str(L)=0D + for L in ConsumedByList[Item])= =0D EdkLogger.error("build", BUILD_ERROR, 'Library [%s] with c= onstructors has a cycle' % str(Item),=0D ExtraData=3DErrorMessage, File=3DFileName)= =0D else:=0D @@ -254,5 +271,6 @@ def GetModuleLibInstances(Module, Platform, BuildDataba= se, Arch, Target, Toolcha #=0D SortedLibraryList.reverse()=0D Module.LibInstances =3D SortedLibraryList=0D - SortedLibraryList =3D [lib.SetReferenceModule(Module) for lib in Sorte= dLibraryList]=0D + SortedLibraryList =3D [lib.SetReferenceModule(=0D + Module) for lib in SortedLibraryList]=0D return SortedLibraryList=0D diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseT= ools/Source/Python/Workspace/WorkspaceDatabase.py index d955c78b258f..09e235b23bc5 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # This file is used to create a database used by build tool=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        =0D @@ -23,7 +23,7 @@ from Workspace.DecBuildData import DecBuildData from Workspace.DscBuildData import DscBuildData=0D from Workspace.InfBuildData import InfBuildData=0D =0D -## Database=0D +# Database=0D #=0D # This class defined the build database for all modules, packages and pl= atform.=0D # It will call corresponding parser for the given file if it cannot find i= t in=0D @@ -33,6 +33,8 @@ from Workspace.InfBuildData import InfBuildData # @param GlobalMacros Global macros used for replacement during file= parsing=0D # @param RenewDb=3DFalse Create new database file if it's already the= re=0D #=0D +=0D +=0D class WorkspaceDatabase(object):=0D =0D #=0D @@ -42,26 +44,27 @@ class WorkspaceDatabase(object): class BuildObjectFactory(object):=0D =0D _FILE_TYPE_ =3D {=0D - ".inf" : MODEL_FILE_INF,=0D - ".dec" : MODEL_FILE_DEC,=0D - ".dsc" : MODEL_FILE_DSC,=0D + ".inf": MODEL_FILE_INF,=0D + ".dec": MODEL_FILE_DEC,=0D + ".dsc": MODEL_FILE_DSC,=0D }=0D =0D # file parser=0D _FILE_PARSER_ =3D {=0D - MODEL_FILE_INF : InfParser,=0D - MODEL_FILE_DEC : DecParser,=0D - MODEL_FILE_DSC : DscParser,=0D + MODEL_FILE_INF: InfParser,=0D + MODEL_FILE_DEC: DecParser,=0D + MODEL_FILE_DSC: DscParser,=0D }=0D =0D # convert to xxxBuildData object=0D _GENERATOR_ =3D {=0D - MODEL_FILE_INF : InfBuildData,=0D - MODEL_FILE_DEC : DecBuildData,=0D - MODEL_FILE_DSC : DscBuildData,=0D + MODEL_FILE_INF: InfBuildData,=0D + MODEL_FILE_DEC: DecBuildData,=0D + MODEL_FILE_DSC: DscBuildData,=0D }=0D =0D _CACHE_ =3D {} # (FilePath, Arch) : =0D +=0D def GetCache(self):=0D return self._CACHE_=0D =0D @@ -101,10 +104,12 @@ class WorkspaceDatabase(object): return self._CACHE_[Key]=0D =0D # check file type=0D - BuildObject =3D self.CreateBuildObject(FilePath, Arch, Target,= Toolchain)=0D + BuildObject =3D self.CreateBuildObject(=0D + FilePath, Arch, Target, Toolchain)=0D self._CACHE_[Key] =3D BuildObject=0D return BuildObject=0D - def CreateBuildObject(self,FilePath, Arch, Target, Toolchain):=0D +=0D + def CreateBuildObject(self, FilePath, Arch, Target, Toolchain):=0D Ext =3D FilePath.Type=0D if Ext not in self._FILE_TYPE_:=0D return None=0D @@ -114,22 +119,22 @@ class WorkspaceDatabase(object): =0D # get the parser ready for this file=0D MetaFile =3D self._FILE_PARSER_[FileType](=0D - FilePath,=0D - FileType,=0D - Arch,=0D - MetaFileStorage(self.WorkspaceDb, FilePath= , FileType)=0D - )=0D + FilePath,=0D + FileType,=0D + Arch,=0D + MetaFileStorage(self.WorkspaceDb, FilePath, FileType)=0D + )=0D # always do post-process, in case of macros change=0D MetaFile.DoPostProcess()=0D # object the build is based on=0D BuildObject =3D self._GENERATOR_[FileType](=0D - FilePath,=0D - MetaFile,=0D - self,=0D - Arch,=0D - Target,=0D - Toolchain=0D - )=0D + FilePath,=0D + MetaFile,=0D + self,=0D + Arch,=0D + Target,=0D + Toolchain=0D + )=0D return BuildObject=0D =0D # placeholder for file format conversion=0D @@ -141,7 +146,7 @@ class WorkspaceDatabase(object): def __getitem__(self, Key):=0D pass=0D =0D - ## Constructor of WorkspaceDatabase=0D + # Constructor of WorkspaceDatabase=0D #=0D # @param DbPath Path of database file=0D # @param GlobalMacros Global macros used for replacement during = file parsing=0D @@ -158,8 +163,8 @@ class WorkspaceDatabase(object): self.BuildObject =3D WorkspaceDatabase.BuildObjectFactory(self)=0D self.TransformObject =3D WorkspaceDatabase.TransformObjectFactory(= self)=0D =0D + # Summarize all packages in the database=0D =0D - ## Summarize all packages in the database=0D def GetPackageList(self, Platform, Arch, TargetName, ToolChainTag):=0D self.Platform =3D Platform=0D PackageList =3D []=0D @@ -168,7 +173,8 @@ class WorkspaceDatabase(object): # Get Package related to Modules=0D #=0D for Module in Pa.Modules:=0D - ModuleObj =3D self.BuildObject[Module, Arch, TargetName, ToolC= hainTag]=0D + ModuleObj =3D self.BuildObject[Module,=0D + Arch, TargetName, ToolChainTag]=0D for Package in ModuleObj.Packages:=0D if Package not in PackageList:=0D PackageList.append(Package)=0D @@ -190,9 +196,11 @@ class WorkspaceDatabase(object): def MapPlatform(self, Dscfile):=0D Platform =3D self.BuildObject[PathClass(Dscfile), TAB_COMMON]=0D if Platform is None:=0D - EdkLogger.error('build', PARSER_ERROR, "Failed to parser DSC f= ile: %s" % Dscfile)=0D + EdkLogger.error('build', PARSER_ERROR,=0D + "Failed to parser DSC file: %s" % Dscfile)=0D return Platform=0D =0D +=0D BuildDB =3D WorkspaceDatabase()=0D ##=0D #=0D @@ -201,4 +209,3 @@ BuildDB =3D WorkspaceDatabase() #=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/Workspace/__init__.py b/BaseTools/Sour= ce/Python/Workspace/__init__.py index 85ae9937c43f..400adb76a0aa 100644 --- a/BaseTools/Source/Python/Workspace/__init__.py +++ b/BaseTools/Source/Python/Workspace/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'Workspace' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 468772930ca1..673ef7528150 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Routines for generating build report.=0D #=0D # This module contains the functionality to generate build report after=0D @@ -8,7 +8,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D =0D -## Import Modules=0D +# Import Modules=0D #=0D import Common.LongFilePathOs as os=0D import re=0D @@ -42,86 +42,91 @@ import collections from Common.Expression import *=0D from GenFds.AprioriSection import DXE_APRIORI_GUID, PEI_APRIORI_GUID=0D =0D -## Pattern to extract contents in EDK DXS files=0D -gDxsDependencyPattern =3D re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END"= , re.DOTALL)=0D +# Pattern to extract contents in EDK DXS files=0D +gDxsDependencyPattern =3D re.compile(=0D + r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)=0D =0D -## Pattern to find total FV total size, occupied size in flash report inte= rmediate file=0D +# Pattern to find total FV total size, occupied size in flash report inter= mediate file=0D gFvTotalSizePattern =3D re.compile(r"EFI_FV_TOTAL_SIZE =3D (0x[0-9a-fA-F]+= )")=0D gFvTakenSizePattern =3D re.compile(r"EFI_FV_TAKEN_SIZE =3D (0x[0-9a-fA-F]+= )")=0D =0D -## Pattern to find module size and time stamp in module summary report int= ermediate file=0D +# Pattern to find module size and time stamp in module summary report inte= rmediate file=0D gModuleSizePattern =3D re.compile(r"MODULE_SIZE =3D (\d+)")=0D -gTimeStampPattern =3D re.compile(r"TIME_STAMP =3D (\d+)")=0D +gTimeStampPattern =3D re.compile(r"TIME_STAMP =3D (\d+)")=0D =0D -## Pattern to find GUID value in flash description files=0D +# Pattern to find GUID value in flash description files=0D gPcdGuidPattern =3D re.compile(r"PCD\((\w+)[.](\w+)\)")=0D =0D -## Pattern to collect offset, GUID value pair in the flash report intermed= iate file=0D +# Pattern to collect offset, GUID value pair in the flash report intermedi= ate file=0D gOffsetGuidPattern =3D re.compile(r"(0x[0-9A-Fa-f]+) ([-A-Fa-f0-9]+)")=0D =0D -## Pattern to find module base address and entry point in fixed flash map = file=0D +# Pattern to find module base address and entry point in fixed flash map f= ile=0D gModulePattern =3D r"\n[-\w]+\s*\(([^,]+),\s*BaseAddress=3D%(Address)s,\s*= EntryPoint=3D%(Address)s,\s*Type=3D\w+\)\s*\(GUID=3D([-0-9A-Fa-f]+)[^)]*\)"= =0D -gMapFileItemPattern =3D re.compile(gModulePattern % {"Address" : "(-?0[xX]= [0-9A-Fa-f]+)"})=0D +gMapFileItemPattern =3D re.compile(=0D + gModulePattern % {"Address": "(-?0[xX][0-9A-Fa-f]+)"})=0D =0D -## Pattern to find all module referenced header files in source files=0D -gIncludePattern =3D re.compile(r'#include\s*["<]([^">]+)[">]')=0D +# Pattern to find all module referenced header files in source files=0D +gIncludePattern =3D re.compile(r'#include\s*["<]([^">]+)[">]')=0D gIncludePattern2 =3D re.compile(r"#include\s+EFI_([A-Z_]+)\s*[(]\s*(\w+)\s= *[)]")=0D =0D -## Pattern to find the entry point for EDK module using EDKII Glue library= =0D -gGlueLibEntryPoint =3D re.compile(r"__EDKII_GLUE_MODULE_ENTRY_POINT__\s*= =3D\s*(\w+)")=0D +# Pattern to find the entry point for EDK module using EDKII Glue library= =0D +gGlueLibEntryPoint =3D re.compile(=0D + r"__EDKII_GLUE_MODULE_ENTRY_POINT__\s*=3D\s*(\w+)")=0D =0D -## Tags for MaxLength of line in report=0D +# Tags for MaxLength of line in report=0D gLineMaxLength =3D 120=0D =0D -## Tags for end of line in report=0D +# Tags for end of line in report=0D gEndOfLine =3D "\r\n"=0D =0D -## Tags for section start, end and separator=0D +# Tags for section start, end and separator=0D gSectionStart =3D ">" + "=3D" * (gLineMaxLength - 2) + "<"=0D gSectionEnd =3D "<" + "=3D" * (gLineMaxLength - 2) + ">" + "\n"=0D gSectionSep =3D "=3D" * gLineMaxLength=0D =0D -## Tags for subsection start, end and separator=0D +# Tags for subsection start, end and separator=0D gSubSectionStart =3D ">" + "-" * (gLineMaxLength - 2) + "<"=0D gSubSectionEnd =3D "<" + "-" * (gLineMaxLength - 2) + ">"=0D gSubSectionSep =3D "-" * gLineMaxLength=0D =0D =0D -## The look up table to map PCD type to pair of report display type and DE= C type=0D +# The look up table to map PCD type to pair of report display type and DEC= type=0D gPcdTypeMap =3D {=0D - TAB_PCDS_FIXED_AT_BUILD : ('FIXED', TAB_PCDS_FIXED_AT_BUILD),=0D - TAB_PCDS_PATCHABLE_IN_MODULE: ('PATCH', TAB_PCDS_PATCHABLE_IN_MODULE),= =0D - TAB_PCDS_FEATURE_FLAG : ('FLAG', TAB_PCDS_FEATURE_FLAG),=0D - TAB_PCDS_DYNAMIC : ('DYN', TAB_PCDS_DYNAMIC),=0D - TAB_PCDS_DYNAMIC_HII : ('DYNHII', TAB_PCDS_DYNAMIC),=0D - TAB_PCDS_DYNAMIC_VPD : ('DYNVPD', TAB_PCDS_DYNAMIC),=0D - TAB_PCDS_DYNAMIC_EX : ('DEX', TAB_PCDS_DYNAMIC_EX),=0D - TAB_PCDS_DYNAMIC_EX_HII : ('DEXHII', TAB_PCDS_DYNAMIC_EX),=0D - TAB_PCDS_DYNAMIC_EX_VPD : ('DEXVPD', TAB_PCDS_DYNAMIC_EX),=0D - }=0D + TAB_PCDS_FIXED_AT_BUILD: ('FIXED', TAB_PCDS_FIXED_AT_BUILD),=0D + TAB_PCDS_PATCHABLE_IN_MODULE: ('PATCH', TAB_PCDS_PATCHABLE_IN_MODULE)= ,=0D + TAB_PCDS_FEATURE_FLAG: ('FLAG', TAB_PCDS_FEATURE_FLAG),=0D + TAB_PCDS_DYNAMIC: ('DYN', TAB_PCDS_DYNAMIC),=0D + TAB_PCDS_DYNAMIC_HII: ('DYNHII', TAB_PCDS_DYNAMIC),=0D + TAB_PCDS_DYNAMIC_VPD: ('DYNVPD', TAB_PCDS_DYNAMIC),=0D + TAB_PCDS_DYNAMIC_EX: ('DEX', TAB_PCDS_DYNAMIC_EX),=0D + TAB_PCDS_DYNAMIC_EX_HII: ('DEXHII', TAB_PCDS_DYNAMIC_EX),=0D + TAB_PCDS_DYNAMIC_EX_VPD: ('DEXVPD', TAB_PCDS_DYNAMIC_EX),=0D +}=0D =0D -## The look up table to map module type to driver type=0D +# The look up table to map module type to driver type=0D gDriverTypeMap =3D {=0D - SUP_MODULE_SEC : '0x3 (SECURITY_CORE)',=0D - SUP_MODULE_PEI_CORE : '0x4 (PEI_CORE)',=0D - SUP_MODULE_PEIM : '0x6 (PEIM)',=0D - SUP_MODULE_DXE_CORE : '0x5 (DXE_CORE)',=0D - SUP_MODULE_DXE_DRIVER : '0x7 (DRIVER)',=0D - SUP_MODULE_DXE_SAL_DRIVER : '0x7 (DRIVER)',=0D - SUP_MODULE_DXE_SMM_DRIVER : '0x7 (DRIVER)',=0D - SUP_MODULE_DXE_RUNTIME_DRIVER: '0x7 (DRIVER)',=0D - SUP_MODULE_UEFI_DRIVER : '0x7 (DRIVER)',=0D - SUP_MODULE_UEFI_APPLICATION : '0x9 (APPLICATION)',=0D - SUP_MODULE_SMM_CORE : '0xD (SMM_CORE)',=0D - 'SMM_DRIVER' : '0xA (SMM)', # Extension of module type to support= PI 1.1 SMM drivers=0D - SUP_MODULE_MM_STANDALONE : '0xE (MM_STANDALONE)',=0D - SUP_MODULE_MM_CORE_STANDALONE : '0xF (MM_CORE_STANDALONE)'=0D - }=0D + SUP_MODULE_SEC: '0x3 (SECURITY_CORE)',=0D + SUP_MODULE_PEI_CORE: '0x4 (PEI_CORE)',=0D + SUP_MODULE_PEIM: '0x6 (PEIM)',=0D + SUP_MODULE_DXE_CORE: '0x5 (DXE_CORE)',=0D + SUP_MODULE_DXE_DRIVER: '0x7 (DRIVER)',=0D + SUP_MODULE_DXE_SAL_DRIVER: '0x7 (DRIVER)',=0D + SUP_MODULE_DXE_SMM_DRIVER: '0x7 (DRIVER)',=0D + SUP_MODULE_DXE_RUNTIME_DRIVER: '0x7 (DRIVER)',=0D + SUP_MODULE_UEFI_DRIVER: '0x7 (DRIVER)',=0D + SUP_MODULE_UEFI_APPLICATION: '0x9 (APPLICATION)',=0D + SUP_MODULE_SMM_CORE: '0xD (SMM_CORE)',=0D + # Extension of module type to support PI 1.1 SMM drivers=0D + 'SMM_DRIVER': '0xA (SMM)',=0D + SUP_MODULE_MM_STANDALONE: '0xE (MM_STANDALONE)',=0D + SUP_MODULE_MM_CORE_STANDALONE: '0xF (MM_CORE_STANDALONE)'=0D +}=0D =0D -## The look up table of the supported opcode in the dependency expression = binaries=0D -gOpCodeList =3D ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "TRUE", "F= ALSE", "END", "SOR"]=0D +# The look up table of the supported opcode in the dependency expression b= inaries=0D +gOpCodeList =3D ["BEFORE", "AFTER", "PUSH", "AND",=0D + "OR", "NOT", "TRUE", "FALSE", "END", "SOR"]=0D =0D -## Save VPD Pcd=0D +# Save VPD Pcd=0D VPDPcdList =3D []=0D =0D ##=0D @@ -134,11 +139,14 @@ VPDPcdList =3D [] # @String The string to be written to the file=0D # @Wrapper Indicates whether to wrap the string=0D #=0D +=0D +=0D def FileWrite(File, String, Wrapper=3DFalse):=0D if Wrapper:=0D String =3D textwrap.fill(String, 120)=0D File.append(String + gEndOfLine)=0D =0D +=0D def ByteArrayForamt(Value):=0D IsByteArray =3D False=0D SplitNum =3D 16=0D @@ -157,7 +165,7 @@ def ByteArrayForamt(Value): Id =3D 0=0D while (Id <=3D Len):=0D End =3D min(SplitNum*(Id+1), len(ValueList))=0D - Str =3D ','.join(ValueList[SplitNum*Id : End])=0D + Str =3D ','.join(ValueList[SplitNum*Id: End])=0D if End =3D=3D len(ValueList):=0D Str +=3D '}'=0D ArrayList.append(Str)=0D @@ -181,6 +189,8 @@ def ByteArrayForamt(Value): # @IncludePathList The list of include path to find the source f= ile.=0D # @IncludeFiles The dictionary of current found include files= .=0D #=0D +=0D +=0D def FindIncludeFiles(Source, IncludePathList, IncludeFiles):=0D FileContents =3D open(Source).read()=0D #=0D @@ -191,7 +201,8 @@ def FindIncludeFiles(Source, IncludePathList, IncludeFi= les): for Dir in [os.path.dirname(Source)] + IncludePathList:=0D FullFileName =3D os.path.normpath(os.path.join(Dir, FileName))= =0D if os.path.exists(FullFileName):=0D - IncludeFiles[FullFileName.lower().replace("\\", "/")] =3D = FullFileName=0D + IncludeFiles[FullFileName.lower().replace(=0D + "\\", "/")] =3D FullFileName=0D break=0D =0D #=0D @@ -201,22 +212,23 @@ def FindIncludeFiles(Source, IncludePathList, Include= Files): Key =3D Match.group(2)=0D Type =3D Match.group(1)=0D if "ARCH_PROTOCOL" in Type:=0D - FileName =3D "ArchProtocol/%(Key)s/%(Key)s.h" % {"Key" : Key}= =0D + FileName =3D "ArchProtocol/%(Key)s/%(Key)s.h" % {"Key": Key}=0D elif "PROTOCOL" in Type:=0D - FileName =3D "Protocol/%(Key)s/%(Key)s.h" % {"Key" : Key}=0D + FileName =3D "Protocol/%(Key)s/%(Key)s.h" % {"Key": Key}=0D elif "PPI" in Type:=0D - FileName =3D "Ppi/%(Key)s/%(Key)s.h" % {"Key" : Key}=0D + FileName =3D "Ppi/%(Key)s/%(Key)s.h" % {"Key": Key}=0D elif TAB_GUID in Type:=0D - FileName =3D "Guid/%(Key)s/%(Key)s.h" % {"Key" : Key}=0D + FileName =3D "Guid/%(Key)s/%(Key)s.h" % {"Key": Key}=0D else:=0D continue=0D for Dir in IncludePathList:=0D FullFileName =3D os.path.normpath(os.path.join(Dir, FileName))= =0D if os.path.exists(FullFileName):=0D - IncludeFiles[FullFileName.lower().replace("\\", "/")] =3D = FullFileName=0D + IncludeFiles[FullFileName.lower().replace(=0D + "\\", "/")] =3D FullFileName=0D break=0D =0D -## Split each lines in file=0D +# Split each lines in file=0D #=0D # This method is used to split the lines in file to make the length of ea= ch line=0D # less than MaxLength.=0D @@ -224,6 +236,8 @@ def FindIncludeFiles(Source, IncludePathList, IncludeFi= les): # @param Content The content of file=0D # @param MaxLength The Max Length of the line=0D #=0D +=0D +=0D def FileLinesSplit(Content=3DNone, MaxLength=3DNone):=0D ContentList =3D Content.split(TAB_LINE_BREAK)=0D NewContent =3D ''=0D @@ -234,7 +248,8 @@ def FileLinesSplit(Content=3DNone, MaxLength=3DNone): LineSlashIndex =3D Line.rfind(TAB_SLASH, 0, MaxLength)=0D LineBackSlashIndex =3D Line.rfind(TAB_BACK_SLASH, 0, MaxLength= )=0D if max(LineSpaceIndex, LineSlashIndex, LineBackSlashIndex) > 0= :=0D - LineBreakIndex =3D max(LineSpaceIndex, LineSlashIndex, Lin= eBackSlashIndex)=0D + LineBreakIndex =3D max(=0D + LineSpaceIndex, LineSlashIndex, LineBackSlashIndex)=0D else:=0D LineBreakIndex =3D MaxLength=0D NewContentList.append(Line[:LineBreakIndex])=0D @@ -244,11 +259,11 @@ def FileLinesSplit(Content=3DNone, MaxLength=3DNone): for NewLine in NewContentList:=0D NewContent +=3D NewLine + TAB_LINE_BREAK=0D =0D - NewContent =3D NewContent.replace(gEndOfLine, TAB_LINE_BREAK).replace(= '\r\r\n', gEndOfLine)=0D + NewContent =3D NewContent.replace(=0D + gEndOfLine, TAB_LINE_BREAK).replace('\r\r\n', gEndOfLine)=0D return NewContent=0D =0D =0D -=0D ##=0D # Parse binary dependency expression section=0D #=0D @@ -270,19 +285,23 @@ class DepexParser(object): for Pa in Wa.AutoGenObjectList:=0D for Package in Pa.PackageList:=0D for Protocol in Package.Protocols:=0D - GuidValue =3D GuidStructureStringToGuidString(Package.= Protocols[Protocol])=0D + GuidValue =3D GuidStructureStringToGuidString(=0D + Package.Protocols[Protocol])=0D self._GuidDb[GuidValue.upper()] =3D Protocol=0D for Ppi in Package.Ppis:=0D - GuidValue =3D GuidStructureStringToGuidString(Package.= Ppis[Ppi])=0D + GuidValue =3D GuidStructureStringToGuidString(=0D + Package.Ppis[Ppi])=0D self._GuidDb[GuidValue.upper()] =3D Ppi=0D for Guid in Package.Guids:=0D - GuidValue =3D GuidStructureStringToGuidString(Package.= Guids[Guid])=0D + GuidValue =3D GuidStructureStringToGuidString(=0D + Package.Guids[Guid])=0D self._GuidDb[GuidValue.upper()] =3D Guid=0D for Ma in Pa.ModuleAutoGenList:=0D for Pcd in Ma.FixedVoidTypePcds:=0D PcdValue =3D Ma.FixedVoidTypePcds[Pcd]=0D if len(PcdValue.split(',')) =3D=3D 16:=0D - GuidValue =3D GuidStructureByteArrayToGuidString(P= cdValue)=0D + GuidValue =3D GuidStructureByteArrayToGuidString(= =0D + PcdValue)=0D self._GuidDb[GuidValue.upper()] =3D Pcd=0D ##=0D # Parse the binary dependency expression files.=0D @@ -293,6 +312,7 @@ class DepexParser(object): # @param self The object pointer=0D # @param DepexFileName The file name of binary dependency expression= file.=0D #=0D +=0D def ParseDepexFile(self, DepexFileName):=0D DepexFile =3D open(DepexFileName, "rb")=0D DepexStatement =3D []=0D @@ -301,7 +321,8 @@ class DepexParser(object): Statement =3D gOpCodeList[struct.unpack("B", OpCode)[0]]=0D if Statement in ["BEFORE", "AFTER", "PUSH"]:=0D GuidValue =3D "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02= X%02X" % \=0D - struct.unpack(PACK_PATTERN_GUID, DepexFile.rea= d(16))=0D + struct.unpack(PACK_PATTERN_GUID,=0D + DepexFile.read(16))=0D GuidString =3D self._GuidDb.get(GuidValue, GuidValue)=0D Statement =3D "%s %s" % (Statement, GuidString)=0D DepexStatement.append(Statement)=0D @@ -314,6 +335,8 @@ class DepexParser(object): #=0D # This class reports the module library subsection in the build report fil= e.=0D #=0D +=0D +=0D class LibraryReport(object):=0D ##=0D # Constructor function for class LibraryReport=0D @@ -337,7 +360,8 @@ class LibraryReport(object): if LibInfPath =3D=3D LibAutoGen.MetaFile.Path:=0D LibTime =3D LibAutoGen.BuildTime=0D break=0D - self.LibraryList.append((LibInfPath, LibClassList, LibConstruc= torList, LibDesstructorList, LibDepexList, LibTime))=0D + self.LibraryList.append(=0D + (LibInfPath, LibClassList, LibConstructorList, LibDesstruc= torList, LibDepexList, LibTime))=0D =0D ##=0D # Generate report for module library information=0D @@ -383,6 +407,8 @@ class LibraryReport(object): #=0D # This class reports the module dependency expression subsection in the bu= ild report file.=0D #=0D +=0D +=0D class DepexReport(object):=0D ##=0D # Constructor function for class DepexReport=0D @@ -398,7 +424,8 @@ class DepexReport(object): #=0D def __init__(self, M):=0D self.Depex =3D ""=0D - self._DepexFileName =3D os.path.join(M.BuildDir, "OUTPUT", M.Modul= e.BaseName + ".depex")=0D + self._DepexFileName =3D os.path.join(=0D + M.BuildDir, "OUTPUT", M.Module.BaseName + ".depex")=0D ModuleType =3D M.ModuleType=0D if not ModuleType:=0D ModuleType =3D COMPONENT_TO_MODULE_MAP_DICT.get(M.ComponentTyp= e, "")=0D @@ -415,13 +442,15 @@ class DepexReport(object): break=0D else:=0D self.Depex =3D M.DepexExpressionDict.get(M.ModuleType, "")=0D - self.ModuleDepex =3D " ".join(M.Module.DepexExpression[M.Arch,= M.ModuleType])=0D + self.ModuleDepex =3D " ".join(=0D + M.Module.DepexExpression[M.Arch, M.ModuleType])=0D if not self.ModuleDepex:=0D self.ModuleDepex =3D "(None)"=0D =0D LibDepexList =3D []=0D for Lib in M.DependentLibraryList:=0D - LibDepex =3D " ".join(Lib.DepexExpression[M.Arch, M.Module= Type]).strip()=0D + LibDepex =3D " ".join(=0D + Lib.DepexExpression[M.Arch, M.ModuleType]).strip()=0D if LibDepex !=3D "":=0D LibDepexList.append("(" + LibDepex + ")")=0D self.LibraryDepex =3D " AND ".join(LibDepexList)=0D @@ -444,13 +473,16 @@ class DepexReport(object): FileWrite(File, gSubSectionStart)=0D if os.path.isfile(self._DepexFileName):=0D try:=0D - DepexStatements =3D GlobalDepexParser.ParseDepexFile(self.= _DepexFileName)=0D - FileWrite(File, "Final Dependency Expression (DEPEX) Instr= uctions")=0D + DepexStatements =3D GlobalDepexParser.ParseDepexFile(=0D + self._DepexFileName)=0D + FileWrite(=0D + File, "Final Dependency Expression (DEPEX) Instruction= s")=0D for DepexStatement in DepexStatements:=0D FileWrite(File, " %s" % DepexStatement)=0D FileWrite(File, gSubSectionSep)=0D except:=0D - EdkLogger.warn(None, "Dependency expression file is corrup= ted", self._DepexFileName)=0D + EdkLogger.warn(=0D + None, "Dependency expression file is corrupted", self.= _DepexFileName)=0D =0D FileWrite(File, "Dependency Expression (DEPEX) from %s" % self.Sou= rce)=0D =0D @@ -468,6 +500,8 @@ class DepexReport(object): #=0D # This class reports the module build flags subsection in the build report= file.=0D #=0D +=0D +=0D class BuildFlagsReport(object):=0D ##=0D # Constructor function for class BuildFlagsReport=0D @@ -516,7 +550,8 @@ class BuildFlagsReport(object): self.ToolChainTag =3D M.ToolChain=0D self.BuildFlags =3D {}=0D for Tool in BuildOptions:=0D - self.BuildFlags[Tool + "_FLAGS"] =3D M.BuildOption.get(Tool, {= }).get("FLAGS", "")=0D + self.BuildFlags[Tool +=0D + "_FLAGS"] =3D M.BuildOption.get(Tool, {}).get(= "FLAGS", "")=0D =0D ##=0D # Generate report for module build flags information=0D @@ -567,17 +602,21 @@ class ModuleReport(object): if not M.IsLibrary:=0D ModuleType =3D M.ModuleType=0D if not ModuleType:=0D - ModuleType =3D COMPONENT_TO_MODULE_MAP_DICT.get(M.Componen= tType, "")=0D + ModuleType =3D COMPONENT_TO_MODULE_MAP_DICT.get(=0D + M.ComponentType, "")=0D #=0D # If a module complies to PI 1.1, promote Module type to "SMM_= DRIVER"=0D #=0D if ModuleType =3D=3D SUP_MODULE_DXE_SMM_DRIVER:=0D - PiSpec =3D M.Module.Specification.get("PI_SPECIFICATION_VE= RSION", "0x00010000")=0D + PiSpec =3D M.Module.Specification.get(=0D + "PI_SPECIFICATION_VERSION", "0x00010000")=0D if int(PiSpec, 0) >=3D 0x0001000A:=0D ModuleType =3D "SMM_DRIVER"=0D self.DriverType =3D gDriverTypeMap.get(ModuleType, "0x2 (FREE_= FORM)")=0D - self.UefiSpecVersion =3D M.Module.Specification.get("UEFI_SPECIFIC= ATION_VERSION", "")=0D - self.PiSpecVersion =3D M.Module.Specification.get("PI_SPECIFICATIO= N_VERSION", "")=0D + self.UefiSpecVersion =3D M.Module.Specification.get(=0D + "UEFI_SPECIFICATION_VERSION", "")=0D + self.PiSpecVersion =3D M.Module.Specification.get(=0D + "PI_SPECIFICATION_VERSION", "")=0D self.PciDeviceId =3D M.Module.Defines.get("PCI_DEVICE_ID", "")=0D self.PciVendorId =3D M.Module.Defines.get("PCI_VENDOR_ID", "")=0D self.PciClassCode =3D M.Module.Defines.get("PCI_CLASS_CODE", "")=0D @@ -591,7 +630,8 @@ class ModuleReport(object): # It also saves module INF default values of them in case they= exist.=0D #=0D for Pcd in M.ModulePcdList + M.LibraryPcdList:=0D - self.ModulePcdSet.setdefault((Pcd.TokenCName, Pcd.TokenSpa= ceGuidCName, Pcd.Type), (Pcd.InfDefaultValue, Pcd.DefaultValue))=0D + self.ModulePcdSet.setdefault(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Pcd.Type), (= Pcd.InfDefaultValue, Pcd.DefaultValue))=0D =0D self.LibraryReport =3D None=0D if "LIBRARY" in ReportType:=0D @@ -604,7 +644,6 @@ class ModuleReport(object): if "BUILD_FLAGS" in ReportType:=0D self.BuildFlagsReport =3D BuildFlagsReport(M)=0D =0D -=0D ##=0D # Generate report for module information=0D #=0D @@ -618,10 +657,12 @@ class ModuleReport(object): # @param GlobalDepexParser The platform global Dependency express= ion parser object=0D # @param ReportType The kind of report items in the final = report file=0D #=0D +=0D def GenerateReport(self, File, GlobalPcdReport, GlobalPredictionReport= , GlobalDepexParser, ReportType):=0D FileWrite(File, gSectionStart)=0D =0D - FwReportFileName =3D os.path.join(self._BuildDir, "OUTPUT", self.M= oduleName + ".txt")=0D + FwReportFileName =3D os.path.join(=0D + self._BuildDir, "OUTPUT", self.ModuleName + ".txt")=0D if os.path.isfile(FwReportFileName):=0D try:=0D FileContents =3D open(FwReportFileName).read()=0D @@ -631,25 +672,32 @@ class ModuleReport(object): =0D Match =3D gTimeStampPattern.search(FileContents)=0D if Match:=0D - self.BuildTimeStamp =3D datetime.utcfromtimestamp(int(= Match.group(1)))=0D + self.BuildTimeStamp =3D datetime.utcfromtimestamp(=0D + int(Match.group(1)))=0D except IOError:=0D - EdkLogger.warn(None, "Fail to read report file", FwReportF= ileName)=0D + EdkLogger.warn(None, "Fail to read report file",=0D + FwReportFileName)=0D =0D if "HASH" in ReportType:=0D OutputDir =3D os.path.join(self._BuildDir, "OUTPUT")=0D DefaultEFIfile =3D os.path.join(OutputDir, self.ModuleName + "= .efi")=0D if os.path.isfile(DefaultEFIfile):=0D - Tempfile =3D os.path.join(OutputDir, self.ModuleName + "_h= ash.tmp")=0D + Tempfile =3D os.path.join(=0D + OutputDir, self.ModuleName + "_hash.tmp")=0D # rebase the efi image since its base address may not zero= =0D - cmd =3D ["GenFw", "--rebase", str(0), "-o", Tempfile, Defa= ultEFIfile]=0D + cmd =3D ["GenFw", "--rebase",=0D + str(0), "-o", Tempfile, DefaultEFIfile]=0D try:=0D - PopenObject =3D subprocess.Popen(' '.join(cmd), stdout= =3Dsubprocess.PIPE, stderr=3Dsubprocess.PIPE, shell=3DTrue)=0D + PopenObject =3D subprocess.Popen(=0D + ' '.join(cmd), stdout=3Dsubprocess.PIPE, stderr=3D= subprocess.PIPE, shell=3DTrue)=0D except Exception as X:=0D - EdkLogger.error("GenFw", COMMAND_FAILURE, ExtraData=3D= "%s: %s" % (str(X), cmd[0]))=0D + EdkLogger.error("GenFw", COMMAND_FAILURE,=0D + ExtraData=3D"%s: %s" % (str(X), cmd[0]= ))=0D EndOfProcedure =3D threading.Event()=0D EndOfProcedure.clear()=0D if PopenObject.stderr:=0D - StdErrThread =3D threading.Thread(target=3DReadMessage= , args=3D(PopenObject.stderr, EdkLogger.quiet, EndOfProcedure))=0D + StdErrThread =3D threading.Thread(target=3DReadMessage= , args=3D(=0D + PopenObject.stderr, EdkLogger.quiet, EndOfProcedur= e))=0D StdErrThread.setName("STDERR-Redirector")=0D StdErrThread.setDaemon(False)=0D StdErrThread.start()=0D @@ -658,7 +706,8 @@ class ModuleReport(object): if PopenObject.stderr:=0D StdErrThread.join()=0D if PopenObject.returncode !=3D 0:=0D - EdkLogger.error("GenFw", COMMAND_FAILURE, "Failed to g= enerate firmware hash image for %s" % (DefaultEFIfile))=0D + EdkLogger.error(=0D + "GenFw", COMMAND_FAILURE, "Failed to generate firm= ware hash image for %s" % (DefaultEFIfile))=0D if os.path.isfile(Tempfile):=0D self.Hash =3D hashlib.sha1()=0D buf =3D open(Tempfile, 'rb').read()=0D @@ -673,9 +722,11 @@ class ModuleReport(object): FileWrite(File, "Module INF Path: %s" % self.ModuleInfPath)=0D FileWrite(File, "File GUID: %s" % self.FileGuid)=0D if self.Size:=0D - FileWrite(File, "Size: 0x%X (%.2fK)" % (self.S= ize, self.Size / 1024.0))=0D + FileWrite(File, "Size: 0x%X (%.2fK)" %=0D + (self.Size, self.Size / 1024.0))=0D if self.Hash:=0D - FileWrite(File, "SHA1 HASH: %s *%s" % (self.Hash, s= elf.ModuleName + ".efi"))=0D + FileWrite(File, "SHA1 HASH: %s *%s" %=0D + (self.Hash, self.ModuleName + ".efi"))=0D if self.BuildTimeStamp:=0D FileWrite(File, "Build Time Stamp: %s" % self.BuildTimeSta= mp)=0D if self.BuildTime:=0D @@ -696,7 +747,8 @@ class ModuleReport(object): FileWrite(File, gSectionSep)=0D =0D if "PCD" in ReportType:=0D - GlobalPcdReport.GenerateReport(File, self.ModulePcdSet,self.Fi= leGuid)=0D + GlobalPcdReport.GenerateReport(=0D + File, self.ModulePcdSet, self.FileGuid)=0D =0D if "LIBRARY" in ReportType:=0D self.LibraryReport.GenerateReport(File)=0D @@ -712,6 +764,7 @@ class ModuleReport(object): =0D FileWrite(File, gSectionEnd)=0D =0D +=0D def ReadMessage(From, To, ExitFlag):=0D while True:=0D # read one line a time=0D @@ -730,6 +783,8 @@ def ReadMessage(From, To, ExitFlag): # This class reports the platform PCD section and module PCD subsection=0D # in the build report file.=0D #=0D +=0D +=0D class PcdReport(object):=0D ##=0D # Constructor function for class PcdReport=0D @@ -767,7 +822,8 @@ class PcdReport(object): # GUID C Names=0D #=0D for Pcd in Pa.AllPcdList:=0D - PcdList =3D self.AllPcds.setdefault(Pcd.TokenSpaceGuidCNam= e, {}).setdefault(Pcd.Type, [])=0D + PcdList =3D self.AllPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])= =0D if Pcd not in PcdList:=0D PcdList.append(Pcd)=0D if len(Pcd.TokenCName) > self.MaxLen:=0D @@ -776,11 +832,13 @@ class PcdReport(object): # Collect the PCD defined in DSC/FDF file, but not used in mod= ule=0D #=0D UnusedPcdFullList =3D []=0D - StructPcdDict =3D GlobalData.gStructurePcd.get(self.Arch, coll= ections.OrderedDict())=0D + StructPcdDict =3D GlobalData.gStructurePcd.get(=0D + self.Arch, collections.OrderedDict())=0D for Name, Guid in StructPcdDict:=0D if (Name, Guid) not in Pa.Platform.Pcds:=0D Pcd =3D StructPcdDict[(Name, Guid)]=0D - PcdList =3D self.AllPcds.setdefault(Guid, {}).setdefau= lt(Pcd.Type, [])=0D + PcdList =3D self.AllPcds.setdefault(=0D + Guid, {}).setdefault(Pcd.Type, [])=0D if Pcd not in PcdList and Pcd not in UnusedPcdFullList= :=0D UnusedPcdFullList.append(Pcd)=0D for item in Pa.Platform.Pcds:=0D @@ -788,7 +846,8 @@ class PcdReport(object): if not Pcd.Type:=0D # check the Pcd in FDF file, whether it is used in mod= ule first=0D for T in PCD_TYPE_LIST:=0D - PcdList =3D self.AllPcds.setdefault(Pcd.TokenSpace= GuidCName, {}).setdefault(T, [])=0D + PcdList =3D self.AllPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(T, [])= =0D if Pcd in PcdList:=0D Pcd.Type =3D T=0D break=0D @@ -800,7 +859,8 @@ class PcdReport(object): Pcd.Type =3D T=0D PcdTypeFlag =3D True=0D if not Pcd.DatumType:=0D - Pcd.DatumType =3D package.Pcds[(Pcd.To= kenCName, Pcd.TokenSpaceGuidCName, T)].DatumType=0D + Pcd.DatumType =3D package.Pcds[(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuid= CName, T)].DatumType=0D break=0D if PcdTypeFlag:=0D break=0D @@ -813,11 +873,14 @@ class PcdReport(object): PcdType =3D TAB_PCDS_DYNAMIC=0D for package in Pa.PackageList:=0D if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, PcdTy= pe) in package.Pcds:=0D - Pcd.DatumType =3D package.Pcds[(Pcd.TokenCName= , Pcd.TokenSpaceGuidCName, PcdType)].DatumType=0D + Pcd.DatumType =3D package.Pcds[(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuidCName, P= cdType)].DatumType=0D break=0D =0D - PcdList =3D self.AllPcds.setdefault(Pcd.TokenSpaceGuidCNam= e, {}).setdefault(Pcd.Type, [])=0D - UnusedPcdList =3D self.UnusedPcds.setdefault(Pcd.TokenSpac= eGuidCName, {}).setdefault(Pcd.Type, [])=0D + PcdList =3D self.AllPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])= =0D + UnusedPcdList =3D self.UnusedPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])= =0D if Pcd in UnusedPcdList:=0D UnusedPcdList.remove(Pcd)=0D if Pcd not in PcdList and Pcd not in UnusedPcdFullList:=0D @@ -830,8 +893,10 @@ class PcdReport(object): if '.' in PcdItem:=0D (TokenSpaceGuidCName, TokenCName) =3D PcdItem.spli= t('.')=0D if (TokenCName, TokenSpaceGuidCName) in Pa.Platfor= m.Pcds:=0D - Pcd =3D Pa.Platform.Pcds[(TokenCName, TokenSpa= ceGuidCName)]=0D - PcdList =3D self.ConditionalPcds.setdefault(Pc= d.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])=0D + Pcd =3D Pa.Platform.Pcds[(=0D + TokenCName, TokenSpaceGuidCName)]=0D + PcdList =3D self.ConditionalPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(Pc= d.Type, [])=0D if Pcd not in PcdList:=0D PcdList.append(Pcd)=0D =0D @@ -843,7 +908,8 @@ class PcdReport(object): UnusedPcdList.append(Pcd)=0D =0D for Pcd in UnusedPcdList:=0D - PcdList =3D self.UnusedPcds.setdefault(Pcd.TokenSpaceGuidC= Name, {}).setdefault(Pcd.Type, [])=0D + PcdList =3D self.UnusedPcds.setdefault(=0D + Pcd.TokenSpaceGuidCName, {}).setdefault(Pcd.Type, [])= =0D if Pcd not in PcdList:=0D PcdList.append(Pcd)=0D =0D @@ -856,8 +922,8 @@ class PcdReport(object): TokenSpaceGuid =3D ModulePcd.TokenSpaceGuidCName=0D ModuleDefault =3D ModulePcd.DefaultValue=0D ModulePath =3D os.path.basename(Module.M.MetaFile.File= )=0D - self.ModulePcdOverride.setdefault((TokenCName, TokenSp= aceGuid), {})[ModulePath] =3D ModuleDefault=0D -=0D + self.ModulePcdOverride.setdefault((TokenCName, TokenSp= aceGuid), {})[=0D + ModulePath] =3D ModuleDefault=0D =0D #=0D # Collect PCD DEC default value.=0D @@ -869,19 +935,23 @@ class PcdReport(object): Guids =3D Package.Guids=0D self._GuidDict.update(Guids)=0D for (TokenCName, TokenSpaceGuidCName, DecType) in Package.= Pcds:=0D - DecDefaultValue =3D Package.Pcds[TokenCName, TokenSpac= eGuidCName, DecType].DefaultValue=0D - self.DecPcdDefault.setdefault((TokenCName, TokenSpaceG= uidCName, DecType), DecDefaultValue)=0D + DecDefaultValue =3D Package.Pcds[TokenCName,=0D + TokenSpaceGuidCName, De= cType].DefaultValue=0D + self.DecPcdDefault.setdefault(=0D + (TokenCName, TokenSpaceGuidCName, DecType), DecDef= aultValue)=0D #=0D # Collect PCDs defined in DSC common section=0D #=0D self.DscPcdDefault =3D {}=0D for Pa in Wa.AutoGenObjectList:=0D for (TokenCName, TokenSpaceGuidCName) in Pa.Platform.Pcds:=0D - DscDefaultValue =3D Pa.Platform.Pcds[(TokenCName, TokenSpa= ceGuidCName)].DscDefaultValue=0D + DscDefaultValue =3D Pa.Platform.Pcds[(=0D + TokenCName, TokenSpaceGuidCName)].DscDefaultValue=0D if DscDefaultValue:=0D - self.DscPcdDefault[(TokenCName, TokenSpaceGuidCName)] = =3D DscDefaultValue=0D + self.DscPcdDefault[(=0D + TokenCName, TokenSpaceGuidCName)] =3D DscDefaultVa= lue=0D =0D - def GenerateReport(self, File, ModulePcdSet,ModuleGuid=3DNone):=0D + def GenerateReport(self, File, ModulePcdSet, ModuleGuid=3DNone):=0D if not ModulePcdSet:=0D if self.ConditionalPcds:=0D self.GenerateReportDetail(File, ModulePcdSet, 1)=0D @@ -897,7 +967,7 @@ class PcdReport(object): break=0D if not IsEmpty:=0D self.GenerateReportDetail(File, ModulePcdSet, 2)=0D - self.GenerateReportDetail(File, ModulePcdSet,ModuleGuid =3D Module= Guid)=0D + self.GenerateReportDetail(File, ModulePcdSet, ModuleGuid=3DModuleG= uid)=0D =0D ##=0D # Generate report for PCD information=0D @@ -913,7 +983,7 @@ class PcdReport(object): # directives section report, 2 means Unused Pcd= s section report=0D # @param DscOverridePcds Module DSC override PCDs set=0D #=0D - def GenerateReportDetail(self, File, ModulePcdSet, ReportSubType =3D 0= ,ModuleGuid=3DNone):=0D + def GenerateReportDetail(self, File, ModulePcdSet, ReportSubType=3D0, = ModuleGuid=3DNone):=0D PcdDict =3D self.AllPcds=0D if ReportSubType =3D=3D 1:=0D PcdDict =3D self.ConditionalPcds=0D @@ -923,9 +993,11 @@ class PcdReport(object): if not ModulePcdSet:=0D FileWrite(File, gSectionStart)=0D if ReportSubType =3D=3D 1:=0D - FileWrite(File, "Conditional Directives used by the build = system")=0D + FileWrite(=0D + File, "Conditional Directives used by the build system= ")=0D elif ReportSubType =3D=3D 2:=0D - FileWrite(File, "PCDs not used by modules or in conditiona= l directives")=0D + FileWrite(=0D + File, "PCDs not used by modules or in conditional dire= ctives")=0D else:=0D FileWrite(File, "Platform Configuration Database Report")= =0D =0D @@ -971,8 +1043,10 @@ class PcdReport(object): #=0D # Get PCD default value and their override relationship=0D #=0D - DecDefaultValue =3D self.DecPcdDefault.get((Pcd.TokenCName= , Pcd.TokenSpaceGuidCName, DecType))=0D - DscDefaultValue =3D self.DscPcdDefault.get((Pcd.TokenCName= , Pcd.TokenSpaceGuidCName))=0D + DecDefaultValue =3D self.DecPcdDefault.get(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, DecType))=0D + DscDefaultValue =3D self.DscPcdDefault.get(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName))=0D DscDefaultValBak =3D DscDefaultValue=0D Field =3D ''=0D for (CName, Guid, Field) in self.FdfPcdSet:=0D @@ -981,32 +1055,37 @@ class PcdReport(object): break=0D if DscDefaultValue !=3D DscDefaultValBak:=0D try:=0D - DscDefaultValue =3D ValueExpressionEx(DscDefaultVa= lue, Pcd.DatumType, self._GuidDict)(True)=0D + DscDefaultValue =3D ValueExpressionEx(=0D + DscDefaultValue, Pcd.DatumType, self._GuidDict= )(True)=0D except BadExpression as DscDefaultValue:=0D - EdkLogger.error('BuildReport', FORMAT_INVALID, "PC= D Value: %s, Type: %s" %(DscDefaultValue, Pcd.DatumType))=0D + EdkLogger.error('BuildReport', FORMAT_INVALID, "PC= D Value: %s, Type: %s" % (=0D + DscDefaultValue, Pcd.DatumType))=0D =0D InfDefaultValue =3D None=0D =0D PcdValue =3D DecDefaultValue=0D if DscDefaultValue:=0D PcdValue =3D DscDefaultValue=0D - #The DefaultValue of StructurePcd already be the latest, n= o need to update.=0D + # The DefaultValue of StructurePcd already be the latest, = no need to update.=0D if not self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceG= uidCName):=0D Pcd.DefaultValue =3D PcdValue=0D PcdComponentValue =3D None=0D if ModulePcdSet is not None:=0D if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not= in ModulePcdSet:=0D continue=0D - InfDefaultValue, PcdComponentValue =3D ModulePcdSet[Pc= d.TokenCName, Pcd.TokenSpaceGuidCName, Type]=0D + InfDefaultValue, PcdComponentValue =3D ModulePcdSet[Pc= d.TokenCName,=0D + Pcd.= TokenSpaceGuidCName, Type]=0D PcdValue =3D PcdComponentValue=0D - #The DefaultValue of StructurePcd already be the lates= t, no need to update.=0D + # The DefaultValue of StructurePcd already be the late= st, no need to update.=0D if not self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSp= aceGuidCName):=0D Pcd.DefaultValue =3D PcdValue=0D if InfDefaultValue:=0D try:=0D - InfDefaultValue =3D ValueExpressionEx(InfDefau= ltValue, Pcd.DatumType, self._GuidDict)(True)=0D + InfDefaultValue =3D ValueExpressionEx(=0D + InfDefaultValue, Pcd.DatumType, self._Guid= Dict)(True)=0D except BadExpression as InfDefaultValue:=0D - EdkLogger.error('BuildReport', FORMAT_INVALID,= "PCD Value: %s, Type: %s" % (InfDefaultValue, Pcd.DatumType))=0D + EdkLogger.error('BuildReport', FORMAT_INVALID,= "PCD Value: %s, Type: %s" % (=0D + InfDefaultValue, Pcd.DatumType))=0D if InfDefaultValue =3D=3D "":=0D InfDefaultValue =3D None=0D =0D @@ -1017,7 +1096,7 @@ class PcdReport(object): if pcd[2]:=0D continue=0D PcdValue =3D pcd[3]=0D - #The DefaultValue of StructurePcd already be t= he latest, no need to update.=0D + # The DefaultValue of StructurePcd already be = the latest, no need to update.=0D if not self.IsStructurePcd(Pcd.TokenCName, Pcd= .TokenSpaceGuidCName):=0D Pcd.DefaultValue =3D PcdValue=0D BuildOptionMatch =3D True=0D @@ -1029,7 +1108,6 @@ class PcdReport(object): FileWrite(File, Key)=0D First =3D False=0D =0D -=0D if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES:=0D if PcdValue.startswith('0') and not PcdValue.lower().s= tartswith('0x') and \=0D len(PcdValue) > 1 and PcdValue.lstrip('0'):=0D @@ -1065,26 +1143,31 @@ class PcdReport(object): if DecDefaultValue is None:=0D DecMatch =3D True=0D else:=0D - DecMatch =3D (DecDefaultValue.strip() =3D=3D PcdVa= lue.strip())=0D + DecMatch =3D (DecDefaultValue.strip()=0D + =3D=3D PcdValue.strip())=0D =0D if InfDefaultValue is None:=0D InfMatch =3D True=0D else:=0D - InfMatch =3D (InfDefaultValue.strip() =3D=3D PcdVa= lue.strip())=0D + InfMatch =3D (InfDefaultValue.strip()=0D + =3D=3D PcdValue.strip())=0D =0D if DscDefaultValue is None:=0D DscMatch =3D True=0D else:=0D - DscMatch =3D (DscDefaultValue.strip() =3D=3D PcdVa= lue.strip())=0D + DscMatch =3D (DscDefaultValue.strip()=0D + =3D=3D PcdValue.strip())=0D =0D IsStructure =3D False=0D if self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceGuidC= Name):=0D IsStructure =3D True=0D if TypeName in ('DYNVPD', 'DEXVPD'):=0D SkuInfoList =3D Pcd.SkuInfoList=0D - Pcd =3D GlobalData.gStructurePcd[self.Arch][(Pcd.Token= CName, Pcd.TokenSpaceGuidCName)]=0D + Pcd =3D GlobalData.gStructurePcd[self.Arch][(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuidCName)]=0D if ModulePcdSet and ModulePcdSet.get((Pcd.TokenCName, = Pcd.TokenSpaceGuidCName, Type)):=0D - InfDefaultValue, PcdComponentValue =3D ModulePcdSe= t[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]=0D + InfDefaultValue, PcdComponentValue =3D ModulePcdSe= t[Pcd.TokenCName,=0D + = Pcd.TokenSpaceGuidCName, Type]=0D DscDefaultValBak =3D Pcd.DefaultValue=0D Pcd.DefaultValue =3D PcdComponentValue=0D =0D @@ -1116,18 +1199,23 @@ class PcdReport(object): for Data in OverrideValues.val= ues():=0D Struct =3D list(Data.value= s())=0D if Struct:=0D - DscOverride =3D self.P= arseStruct(Struct[0])=0D + DscOverride =3D self.P= arseStruct(=0D + Struct[0])=0D break=0D else:=0D - SkuList =3D sorted(Pcd.SkuInfoList= .keys())=0D + SkuList =3D sorted(=0D + Pcd.SkuInfoList.keys())=0D for Sku in SkuList:=0D SkuInfo =3D Pcd.SkuInfoList[Sk= u]=0D if SkuInfo.DefaultStoreDict:=0D - DefaultStoreList =3D sorte= d(SkuInfo.DefaultStoreDict.keys())=0D + DefaultStoreList =3D sorte= d(=0D + SkuInfo.DefaultStoreDi= ct.keys())=0D for DefaultStore in Defaul= tStoreList:=0D - OverrideValues =3D Pcd= .SkuOverrideValues.get(Sku)=0D + OverrideValues =3D Pcd= .SkuOverrideValues.get(=0D + Sku)=0D if OverrideValues:=0D - DscOverride =3D se= lf.ParseStruct(OverrideValues[DefaultStore])=0D + DscOverride =3D se= lf.ParseStruct(=0D + OverrideValues= [DefaultStore])=0D if DscOverride:=0D break=0D if DscOverride:=0D @@ -1139,7 +1227,7 @@ class PcdReport(object): else:=0D DecMatch =3D True=0D else:=0D - if Pcd.DscRawValue or (ModuleGuid and ModuleGu= id.replace("-","S") in Pcd.PcdValueFromComponents):=0D + if Pcd.DscRawValue or (ModuleGuid and ModuleGu= id.replace("-", "S") in Pcd.PcdValueFromComponents):=0D DscDefaultValue =3D True=0D DscMatch =3D True=0D DecMatch =3D False=0D @@ -1160,20 +1248,25 @@ class PcdReport(object): if Pcd.DefaultValue:=0D Pcd.DefaultValue =3D str(int(Pcd.DefaultValue, 0))= =0D if DecMatch:=0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue, ' ')=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch,=0D + DscDefaultValBak, InfMatch, InfDefa= ultValue, DecMatch, DecDefaultValue, ' ')=0D elif InfDefaultValue and InfMatch:=0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue, '*M')=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch,=0D + DscDefaultValBak, InfMatch, InfDefa= ultValue, DecMatch, DecDefaultValue, '*M')=0D elif BuildOptionMatch:=0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue, '*B')=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch,=0D + DscDefaultValBak, InfMatch, InfDefa= ultValue, DecMatch, DecDefaultValue, '*B')=0D else:=0D if PcdComponentValue:=0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeN= ame, IsStructure, DscMatch, DscDefaultValBak, InfMatch, PcdComponentValue, = DecMatch, DecDefaultValue, '*M', ModuleGuid)=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeN= ame, IsStructure, DscMatch, DscDefaultValBak,=0D + InfMatch, PcdComponentValue, De= cMatch, DecDefaultValue, '*M', ModuleGuid)=0D elif DscDefaultValue and DscMatch:=0D if (Pcd.TokenCName, Key, Field) in self.FdfPcdSet:= =0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, T= ypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue= , DecMatch, DecDefaultValue, '*F')=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, T= ypeName, IsStructure, DscMatch,=0D + DscDefaultValBak, InfMatch,= InfDefaultValue, DecMatch, DecDefaultValue, '*F')=0D else:=0D - self.PrintPcdValue(File, Pcd, PcdTokenCName, T= ypeName, IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue= , DecMatch, DecDefaultValue, '*P')=0D -=0D + self.PrintPcdValue(File, Pcd, PcdTokenCName, T= ypeName, IsStructure, DscMatch,=0D + DscDefaultValBak, InfMatch,= InfDefaultValue, DecMatch, DecDefaultValue, '*P')=0D =0D if ModulePcdSet is None:=0D if IsStructure:=0D @@ -1181,34 +1274,44 @@ class PcdReport(object): if not TypeName in ('PATCH', 'FLAG', 'FIXED'):=0D continue=0D if not BuildOptionMatch:=0D - ModuleOverride =3D self.ModulePcdOverride.get((Pcd= .TokenCName, Pcd.TokenSpaceGuidCName), {})=0D + ModuleOverride =3D self.ModulePcdOverride.get(=0D + (Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})= =0D for ModulePath in ModuleOverride:=0D ModuleDefault =3D ModuleOverride[ModulePath]=0D if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES:=0D if ModuleDefault.startswith('0') and not M= oduleDefault.lower().startswith('0x') and \=0D len(ModuleDefault) > 1 and ModuleD= efault.lstrip('0'):=0D ModuleDefault =3D ModuleDefault.lstrip= ('0')=0D - ModulePcdDefaultValueNumber =3D int(Module= Default.strip(), 0)=0D - Match =3D (ModulePcdDefaultValueNumber =3D= =3D PcdValueNumber)=0D + ModulePcdDefaultValueNumber =3D int(=0D + ModuleDefault.strip(), 0)=0D + Match =3D (ModulePcdDefaultValueNumber =3D= =3D=0D + PcdValueNumber)=0D if Pcd.DatumType =3D=3D 'BOOLEAN':=0D - ModuleDefault =3D str(ModulePcdDefault= ValueNumber)=0D + ModuleDefault =3D str(=0D + ModulePcdDefaultValueNumber)=0D else:=0D - Match =3D (ModuleDefault.strip() =3D=3D Pc= dValue.strip())=0D + Match =3D (ModuleDefault.strip()=0D + =3D=3D PcdValue.strip())=0D if Match:=0D continue=0D - IsByteArray, ArrayList =3D ByteArrayForamt(Mod= uleDefault.strip())=0D + IsByteArray, ArrayList =3D ByteArrayForamt(=0D + ModuleDefault.strip())=0D if IsByteArray:=0D - FileWrite(File, ' *M %-*s =3D %s' % (s= elf.MaxLen + 15, ModulePath, '{'))=0D + FileWrite(File, ' *M %-*s =3D %s' %=0D + (self.MaxLen + 15, ModulePath, '= {'))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D - Value =3D ModuleDefault.strip()=0D + Value =3D ModuleDefault.strip()=0D if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_= TYPES:=0D if Value.startswith(('0x', '0X')):=0D - Value =3D '{} ({:d})'.format(Value= , int(Value, 0))=0D + Value =3D '{} ({:d})'.format(=0D + Value, int(Value, 0))=0D else:=0D - Value =3D "0x{:X} ({})".format(int= (Value, 0), Value)=0D - FileWrite(File, ' *M %-*s =3D %s' % (s= elf.MaxLen + 15, ModulePath, Value))=0D + Value =3D "0x{:X} ({})".format(=0D + int(Value, 0), Value)=0D + FileWrite(File, ' *M %-*s =3D %s' %=0D + (self.MaxLen + 15, ModulePath, V= alue))=0D =0D if ModulePcdSet is None:=0D FileWrite(File, gSectionEnd)=0D @@ -1233,7 +1336,8 @@ class PcdReport(object): Value =3D DscDefaultValue.strip()=0D IsByteArray, ArrayList =3D ByteArrayForamt(Value)=0D if IsByteArray:=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'DSC= DEFAULT', "{"))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'DSC DEFAULT', "{"))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D @@ -1242,12 +1346,14 @@ class PcdReport(object): Value =3D '{} ({:d})'.format(Value, int(Value, 0))= =0D else:=0D Value =3D "0x{:X} ({})".format(int(Value, 0), Valu= e)=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'DSC= DEFAULT', Value))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'DSC DEFAULT', Value))=0D if not InfMatch and InfDefaultValue is not None:=0D Value =3D InfDefaultValue.strip()=0D IsByteArray, ArrayList =3D ByteArrayForamt(Value)=0D if IsByteArray:=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'INF= DEFAULT', "{"))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'INF DEFAULT', "{"))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D @@ -1256,13 +1362,15 @@ class PcdReport(object): Value =3D '{} ({:d})'.format(Value, int(Value, 0))= =0D else:=0D Value =3D "0x{:X} ({})".format(int(Value, 0), Valu= e)=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'INF= DEFAULT', Value))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'INF DEFAULT', Value))=0D =0D if not DecMatch and DecDefaultValue is not None:=0D Value =3D DecDefaultValue.strip()=0D IsByteArray, ArrayList =3D ByteArrayForamt(Value)=0D if IsByteArray:=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'DEC= DEFAULT', "{"))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'DEC DEFAULT', "{"))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D @@ -1271,7 +1379,8 @@ class PcdReport(object): Value =3D '{} ({:d})'.format(Value, int(Value, 0))= =0D else:=0D Value =3D "0x{:X} ({})".format(int(Value, 0), Valu= e)=0D - FileWrite(File, ' %*s =3D %s' % (self.MaxLen + 19, 'DEC= DEFAULT', Value))=0D + FileWrite(File, ' %*s =3D %s' %=0D + (self.MaxLen + 19, 'DEC DEFAULT', Value))=0D if IsStructure:=0D for filedvalues in Pcd.DefaultValues.values():=0D self.PrintStructureInfo(File, filedvalues)=0D @@ -1279,12 +1388,13 @@ class PcdReport(object): for filedvalues in Pcd.DefaultValues.values():=0D self.PrintStructureInfo(File, filedvalues)=0D =0D - def PrintPcdValue(self, File, Pcd, PcdTokenCName, TypeName, IsStructur= e, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefau= ltValue, Flag =3D ' ',ModuleGuid=3DNone):=0D + def PrintPcdValue(self, File, Pcd, PcdTokenCName, TypeName, IsStructur= e, DscMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefau= ltValue, Flag=3D' ', ModuleGuid=3DNone):=0D if not Pcd.SkuInfoList:=0D Value =3D Pcd.DefaultValue=0D IsByteArray, ArrayList =3D ByteArrayForamt(Value)=0D if IsByteArray:=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag +=0D + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumTy= pe + ')', '{'))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D @@ -1295,11 +1405,13 @@ class PcdReport(object): Value =3D '{} ({:d})'.format(Value, int(Value, 0))= =0D else:=0D Value =3D "0x{:X} ({})".format(int(Value, 0), Valu= e)=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value))= =0D + FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag +=0D + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumTy= pe + ')', Value))=0D if IsStructure:=0D FiledOverrideFlag =3D False=0D - if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) in GlobalData.= gPcdSkuOverrides:=0D - OverrideValues =3D GlobalData.gPcdSkuOverrides[(Pcd.To= kenCName,Pcd.TokenSpaceGuidCName)]=0D + if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData= .gPcdSkuOverrides:=0D + OverrideValues =3D GlobalData.gPcdSkuOverrides[(=0D + Pcd.TokenCName, Pcd.TokenSpaceGuidCName)]=0D else:=0D OverrideValues =3D Pcd.SkuOverrideValues=0D FieldOverrideValues =3D None=0D @@ -1310,16 +1422,19 @@ class PcdReport(object): FieldOverrideValues =3D Struct[0]=0D FiledOverrideFlag =3D True=0D break=0D - if Pcd.PcdFiledValueFromDscComponent and ModuleGuid and Mo= duleGuid.replace("-","S") in Pcd.PcdFiledValueFromDscComponent:=0D - FieldOverrideValues =3D Pcd.PcdFiledValueFromDscCompon= ent[ModuleGuid.replace("-","S")]=0D + if Pcd.PcdFiledValueFromDscComponent and ModuleGuid and Mo= duleGuid.replace("-", "S") in Pcd.PcdFiledValueFromDscComponent:=0D + FieldOverrideValues =3D Pcd.PcdFiledValueFromDscCompon= ent[ModuleGuid.replace(=0D + "-", "S")]=0D if FieldOverrideValues:=0D - OverrideFieldStruct =3D self.OverrideFieldValue(Pcd, F= ieldOverrideValues)=0D + OverrideFieldStruct =3D self.OverrideFieldValue(=0D + Pcd, FieldOverrideValues)=0D self.PrintStructureInfo(File, OverrideFieldStruct)=0D =0D if not FiledOverrideFlag and (Pcd.PcdFieldValueFromComm or= Pcd.PcdFieldValueFromFdf):=0D OverrideFieldStruct =3D self.OverrideFieldValue(Pcd, {= })=0D self.PrintStructureInfo(File, OverrideFieldStruct)=0D - self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefa= ultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)=0D + self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch, DscDefa= ultValue,=0D + InfMatch, InfDefaultValue, DecMatch, DecD= efaultValue)=0D else:=0D FirstPrint =3D True=0D SkuList =3D sorted(Pcd.SkuInfoList.keys())=0D @@ -1328,7 +1443,8 @@ class PcdReport(object): SkuIdName =3D SkuInfo.SkuIdName=0D if TypeName in ('DYNHII', 'DEXHII'):=0D if SkuInfo.DefaultStoreDict:=0D - DefaultStoreList =3D sorted(SkuInfo.DefaultStoreDi= ct.keys())=0D + DefaultStoreList =3D sorted(=0D + SkuInfo.DefaultStoreDict.keys())=0D for DefaultStore in DefaultStoreList:=0D Value =3D SkuInfo.DefaultStoreDict[DefaultStor= e]=0D IsByteArray, ArrayList =3D ByteArrayForamt(Val= ue)=0D @@ -1338,62 +1454,86 @@ class PcdReport(object): FirstPrint =3D False=0D if IsByteArray:=0D if self.DefaultStoreSingle and self.Sk= uSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.D= atumType + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (=0D + self.MaxLen, Flag + ' ' + PcdT= okenCName, TypeName, '(' + Pcd.DatumType + ')', '{'))=0D elif self.DefaultStoreSingle and not s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + = Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName,= '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))=0D elif not self.DefaultStoreSingle and s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + = Pcd.DatumType + ')', '(' + DefaultStore + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName,= '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', '{'))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '= (' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', = '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName,=0D + TypeName, '(' + Pcd.Datu= mType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', '{'))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D if Pcd.DatumType in TAB_PCD_CLEAN_NUME= RIC_TYPES:=0D if Value.startswith(('0x', '0X')):= =0D - Value =3D '{} ({:d})'.format(V= alue, int(Value, 0))=0D + Value =3D '{} ({:d})'.format(= =0D + Value, int(Value, 0))=0D else:=0D - Value =3D "0x{:X} ({})".format= (int(Value, 0), Value)=0D + Value =3D "0x{:X} ({})".format= (=0D + int(Value, 0), Value)=0D if self.DefaultStoreSingle and self.Sk= uSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.D= atumType + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (=0D + self.MaxLen, Flag + ' ' + PcdT= okenCName, TypeName, '(' + Pcd.DatumType + ')', Value))=0D elif self.DefaultStoreSingle and not s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + = Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName,= '(' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))=0D elif not self.DefaultStoreSingle and s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + = Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName,= '(' + Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '= (' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', = Value))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName,=0D + TypeName, '(' + Pcd.Datu= mType + ')', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value))=0D else:=0D if IsByteArray:=0D if self.DefaultStoreSingle and self.Sk= uSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', '{'))=0D elif self.DefaultStoreSingle and not s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(= ' + SkuIdName + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', '(' + SkuIdName + ')', '{'))=0D elif not self.DefaultStoreSingle and s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(= ' + DefaultStore + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', '(' + DefaultStore + ')', '{'))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')= ', '(' + SkuIdName + ')', '(' + DefaultStore + ')', '{'))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, ' ', TypeName,=0D + '(' + Pcd.DatumType + ')= ', '(' + SkuIdName + ')', '(' + DefaultStore + ')', '{'))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D if Pcd.DatumType in TAB_PCD_CLEAN_NUME= RIC_TYPES:=0D if Value.startswith(('0x', '0X')):= =0D - Value =3D '{} ({:d})'.format(V= alue, int(Value, 0))=0D + Value =3D '{} ({:d})'.format(= =0D + Value, int(Value, 0))=0D else:=0D - Value =3D "0x{:X} ({})".format= (int(Value, 0), Value)=0D + Value =3D "0x{:X} ({})".format= (=0D + int(Value, 0), Value)=0D if self.DefaultStoreSingle and self.Sk= uSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', Value)= )=0D + FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', Value))=0D elif self.DefaultStoreSingle and not s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(= ' + SkuIdName + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', '(' + SkuIdName + ')', Value))=0D elif not self.DefaultStoreSingle and s= elf.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(= ' + DefaultStore + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s =3D %s' % (=0D + self.MaxLen, ' ', TypeName, '(= ' + Pcd.DatumType + ')', '(' + DefaultStore + ')', Value))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')= ', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value))=0D - FileWrite(File, '%*s: %s: %s' % (self.MaxLen += 4, SkuInfo.VariableGuid, SkuInfo.VariableName, SkuInfo.VariableOffset))=0D + FileWrite(File, ' %-*s : %6s %10= s %10s %10s =3D %s' % (self.MaxLen, ' ', TypeName,=0D + '(' + Pcd.DatumType + ')= ', '(' + SkuIdName + ')', '(' + DefaultStore + ')', Value))=0D + FileWrite(File, '%*s: %s: %s' % (self.MaxLen += 4, SkuInfo.VariableGuid,=0D + SkuInfo.VariableName, SkuInfo.Variab= leOffset))=0D if IsStructure:=0D OverrideValues =3D Pcd.SkuOverrideValues.g= et(Sku)=0D if OverrideValues:=0D - OverrideFieldStruct =3D self.OverrideF= ieldValue(Pcd, OverrideValues[DefaultStore])=0D - self.PrintStructureInfo(File, Override= FieldStruct)=0D - self.PrintPcdDefault(File, Pcd, IsStructure, D= scMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultVa= lue)=0D + OverrideFieldStruct =3D self.OverrideF= ieldValue(=0D + Pcd, OverrideValues[DefaultStore])= =0D + self.PrintStructureInfo(=0D + File, OverrideFieldStruct)=0D + self.PrintPcdDefault(=0D + File, Pcd, IsStructure, DscMatch, DscDefau= ltValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)=0D else:=0D Value =3D SkuInfo.DefaultValue=0D IsByteArray, ArrayList =3D ByteArrayForamt(Value)=0D @@ -1403,44 +1543,59 @@ class PcdReport(object): FirstPrint =3D False=0D if IsByteArray:=0D if self.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType= + ')', "{"))=0D + FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, Flag +=0D + ' ' + PcdTokenCName, TypeName, '= (' + Pcd.DatumType + ')', "{"))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.Dat= umType + ')', '(' + SkuIdName + ')', "{"))=0D + FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName, '(' + P= cd.DatumType + ')', '(' + SkuIdName + ')', "{"))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPE= S:=0D if Value.startswith(('0x', '0X')):=0D - Value =3D '{} ({:d})'.format(Value, in= t(Value, 0))=0D + Value =3D '{} ({:d})'.format(=0D + Value, int(Value, 0))=0D else:=0D - Value =3D "0x{:X} ({})".format(int(Val= ue, 0), Value)=0D + Value =3D "0x{:X} ({})".format(=0D + int(Value, 0), Value)=0D if self.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType= + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, Flag +=0D + ' ' + PcdTokenCName, TypeName, '= (' + Pcd.DatumType + ')', Value))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.Dat= umType + ')', '(' + SkuIdName + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, Flag + ' ' +=0D + PcdTokenCName, TypeName, '(' + P= cd.DatumType + ')', '(' + SkuIdName + ')', Value))=0D else:=0D if IsByteArray:=0D if self.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', "{"))=0D + FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen,=0D + ' ', TypeName, '(' + Pcd.DatumTy= pe + ')', "{"))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + Sku= IdName + ')', "{"))=0D + FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, ' ',=0D + TypeName, '(' + Pcd.DatumType + = ')', '(' + SkuIdName + ')', "{"))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPE= S:=0D if Value.startswith(('0x', '0X')):=0D - Value =3D '{} ({:d})'.format(Value, in= t(Value, 0))=0D + Value =3D '{} ({:d})'.format(=0D + Value, int(Value, 0))=0D else:=0D - Value =3D "0x{:X} ({})".format(int(Val= ue, 0), Value)=0D + Value =3D "0x{:X} ({})".format(=0D + int(Value, 0), Value)=0D if self.SkuSingle:=0D - FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen,=0D + ' ', TypeName, '(' + Pcd.DatumTy= pe + ')', Value))=0D else:=0D - FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, ' ', TypeName, '(' + Pcd.DatumType + ')', '(' + Sku= IdName + ')', Value))=0D + FileWrite(File, ' %-*s : %6s %10s %10s = =3D %s' % (self.MaxLen, ' ',=0D + TypeName, '(' + Pcd.DatumType + = ')', '(' + SkuIdName + ')', Value))=0D if TypeName in ('DYNVPD', 'DEXVPD'):=0D - FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.= VpdOffset))=0D - VPDPcdItem =3D (Pcd.TokenSpaceGuidCName + '.' + Pc= dTokenCName, SkuIdName, SkuInfo.VpdOffset, Pcd.MaxDatumSize, SkuInfo.Defaul= tValue)=0D + FileWrite(File, '%*s' %=0D + (self.MaxLen + 4, SkuInfo.VpdOffset))=0D + VPDPcdItem =3D (Pcd.TokenSpaceGuidCName + '.' + Pc= dTokenCName, SkuIdName,=0D + SkuInfo.VpdOffset, Pcd.MaxDatumSize,= SkuInfo.DefaultValue)=0D if VPDPcdItem not in VPDPcdList:=0D - PcdGuidList =3D self.UnusedPcds.get(Pcd.TokenS= paceGuidCName)=0D + PcdGuidList =3D self.UnusedPcds.get(=0D + Pcd.TokenSpaceGuidCName)=0D if PcdGuidList:=0D PcdList =3D PcdGuidList.get(Pcd.Type)=0D if not PcdList:=0D @@ -1455,19 +1610,22 @@ class PcdReport(object): OverrideValues =3D Pcd.SkuOverrideValues.get(Sku)= =0D if OverrideValues:=0D Keys =3D list(OverrideValues.keys())=0D - OverrideFieldStruct =3D self.OverrideFieldValu= e(Pcd, OverrideValues[Keys[0]])=0D + OverrideFieldStruct =3D self.OverrideFieldValu= e(=0D + Pcd, OverrideValues[Keys[0]])=0D self.PrintStructureInfo(File, OverrideFieldStr= uct)=0D FiledOverrideFlag =3D True=0D if not FiledOverrideFlag and (Pcd.PcdFieldValueFro= mComm or Pcd.PcdFieldValueFromFdf):=0D - OverrideFieldStruct =3D self.OverrideFieldValu= e(Pcd, {})=0D + OverrideFieldStruct =3D self.OverrideFieldValu= e(=0D + Pcd, {})=0D self.PrintStructureInfo(File, OverrideFieldStr= uct)=0D - self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch,= DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultValue)=0D + self.PrintPcdDefault(File, Pcd, IsStructure, DscMatch,= DscDefaultValue,=0D + InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue)=0D =0D def OverrideFieldValue(self, Pcd, OverrideStruct):=0D OverrideFieldStruct =3D collections.OrderedDict()=0D if OverrideStruct:=0D for _, Values in OverrideStruct.items():=0D - for Key,value in Values.items():=0D + for Key, value in Values.items():=0D if value[1] and value[1].endswith('.dsc'):=0D OverrideFieldStruct[Key] =3D value=0D if Pcd.PcdFieldValueFromFdf:=0D @@ -1485,11 +1643,14 @@ class PcdReport(object): def PrintStructureInfo(self, File, Struct):=0D for Key, Value in sorted(Struct.items(), key=3Dlambda x: x[0]):=0D if Value[1] and 'build command options' in Value[1]:=0D - FileWrite(File, ' *B %-*s =3D %s' % (self.MaxLen + 4, = '.' + Key, Value[0]))=0D + FileWrite(File, ' *B %-*s =3D %s' %=0D + (self.MaxLen + 4, '.' + Key, Value[0]))=0D elif Value[1] and Value[1].endswith('.fdf'):=0D - FileWrite(File, ' *F %-*s =3D %s' % (self.MaxLen + 4, = '.' + Key, Value[0]))=0D + FileWrite(File, ' *F %-*s =3D %s' %=0D + (self.MaxLen + 4, '.' + Key, Value[0]))=0D else:=0D - FileWrite(File, ' %-*s =3D %s' % (self.MaxLen + 4, = '.' + Key, Value[0]))=0D + FileWrite(File, ' %-*s =3D %s' %=0D + (self.MaxLen + 4, '.' + Key, Value[0]))=0D =0D def StrtoHex(self, value):=0D try:=0D @@ -1533,6 +1694,8 @@ class PcdReport(object): # This class reports the platform execution order prediction section and=0D # module load fixed address prediction subsection in the build report file= .=0D #=0D +=0D +=0D class PredictionReport(object):=0D ##=0D # Constructor function for class PredictionReport=0D @@ -1575,24 +1738,28 @@ class PredictionReport(object): for Source in Module.SourceFileList:=0D if os.path.splitext(str(Source))[1].lower() =3D=3D ".c= ":=0D self._SourceList.append(" " + str(Source))=0D - FindIncludeFiles(Source.Path, Module.IncludePathLi= st, IncludeList)=0D + FindIncludeFiles(=0D + Source.Path, Module.IncludePathList, IncludeLi= st)=0D for IncludeFile in IncludeList.values():=0D self._SourceList.append(" " + IncludeFile)=0D =0D for Guid in Module.PpiList:=0D - self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(Module.PpiList[Guid])=0D + self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(=0D + Module.PpiList[Guid])=0D for Guid in Module.ProtocolList:=0D - self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(Module.ProtocolList[Guid])=0D + self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(=0D + Module.ProtocolList[Guid])=0D for Guid in Module.GuidList:=0D - self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(Module.GuidList[Guid])=0D + self._GuidMap[Guid] =3D GuidStructureStringToGuidStrin= g(=0D + Module.GuidList[Guid])=0D =0D if Module.Guid and not Module.IsLibrary:=0D EntryPoint =3D " ".join(Module.Module.ModuleEntryPoint= List)=0D =0D RealEntryPoint =3D "_ModuleEntryPoint"=0D =0D - self._FfsEntryPoint[Module.Guid.upper()] =3D (EntryPoi= nt, RealEntryPoint)=0D -=0D + self._FfsEntryPoint[Module.Guid.upper()] =3D (=0D + EntryPoint, RealEntryPoint)=0D =0D #=0D # Collect platform firmware volume list as the input of EOT.=0D @@ -1617,7 +1784,6 @@ class PredictionReport(object): except AttributeError:=0D pass=0D =0D -=0D ##=0D # Parse platform fixed address map files=0D #=0D @@ -1627,6 +1793,7 @@ class PredictionReport(object): #=0D # @param self: The object pointer=0D #=0D +=0D def _ParseMapFile(self):=0D if self._MapFileParsed:=0D return=0D @@ -1643,7 +1810,8 @@ class PredictionReport(object): List.append((AddressType, BaseAddress, "*I"))=0D List.append((AddressType, EntryPoint, "*E"))=0D except:=0D - EdkLogger.warn(None, "Cannot open file to read", self._Map= FileName)=0D + EdkLogger.warn(None, "Cannot open file to read",=0D + self._MapFileName)=0D =0D ##=0D # Invokes EOT tool to get the predicted the execution order.=0D @@ -1693,7 +1861,8 @@ class PredictionReport(object): Eot(CommandLineOption=3DFalse, SourceFileList=3DSourceList, Gu= idList=3DGuidList,=0D FvFileList=3D' '.join(FvFileList), Dispatch=3DDispatchList= , IsInit=3DTrue)=0D EotEndTime =3D time.time()=0D - EotDuration =3D time.strftime("%H:%M:%S", time.gmtime(int(roun= d(EotEndTime - EotStartTime))))=0D + EotDuration =3D time.strftime("%H:%M:%S", time.gmtime(=0D + int(round(EotEndTime - EotStartTime))))=0D EdkLogger.quiet("EOT run time: %s\n" % EotDuration)=0D =0D #=0D @@ -1708,9 +1877,10 @@ class PredictionReport(object): self.MaxLen =3D len(Symbol)=0D self.ItemList.append((Phase, Symbol, FilePath))=0D except:=0D - EdkLogger.quiet("(Python %s on %s\n%s)" % (platform.python_ver= sion(), sys.platform, traceback.format_exc()))=0D - EdkLogger.warn(None, "Failed to generate execution order predi= ction report, for some error occurred in executing EOT.")=0D -=0D + EdkLogger.quiet("(Python %s on %s\n%s)" % (=0D + platform.python_version(), sys.platform, traceback.format_= exc()))=0D + EdkLogger.warn(=0D + None, "Failed to generate execution order prediction repor= t, for some error occurred in executing EOT.")=0D =0D ##=0D # Generate platform execution order report=0D @@ -1720,6 +1890,7 @@ class PredictionReport(object): # @param self The object pointer=0D # @param File The file object for report=0D #=0D +=0D def _GenerateExecutionOrderReport(self, File):=0D self._InvokeEotTool()=0D if len(self.ItemList) =3D=3D 0:=0D @@ -1731,10 +1902,12 @@ class PredictionReport(object): FileWrite(File, "*E Module INF entry point name")=0D FileWrite(File, "*N Module notification function name")=0D =0D - FileWrite(File, "Type %-*s %s" % (self.MaxLen, "Symbol", "Module I= NF Path"))=0D + FileWrite(File, "Type %-*s %s" %=0D + (self.MaxLen, "Symbol", "Module INF Path"))=0D FileWrite(File, gSectionSep)=0D for Item in self.ItemList:=0D - FileWrite(File, "*%sE %-*s %s" % (Item[0], self.MaxLen, Item[= 1], Item[2]))=0D + FileWrite(File, "*%sE %-*s %s" %=0D + (Item[0], self.MaxLen, Item[1], Item[2]))=0D =0D FileWrite(File, gSectionStart)=0D =0D @@ -1774,7 +1947,8 @@ class PredictionReport(object): if Symbol =3D=3D "*I":=0D Name =3D "(Image Base)"=0D elif Symbol =3D=3D "*E":=0D - Name =3D self._FfsEntryPoint.get(Guid, ["", "_ModuleEntryP= oint"])[1]=0D + Name =3D self._FfsEntryPoint.get(=0D + Guid, ["", "_ModuleEntryPoint"])[1]=0D elif Symbol in NotifyList:=0D Name =3D Symbol=0D Symbol =3D "*N"=0D @@ -1823,6 +1997,8 @@ class PredictionReport(object): # If there are nesting FVs, the nested FVs will list immediate after=0D # this FD region subsection=0D #=0D +=0D +=0D class FdRegionReport(object):=0D ##=0D # Discover all the nested FV name list.=0D @@ -1836,7 +2012,7 @@ class FdRegionReport(object): # @param Wa Workspace context information=0D #=0D def _DiscoverNestedFvList(self, FvName, Wa):=0D - FvDictKey=3DFvName.upper()=0D + FvDictKey =3D FvName.upper()=0D if FvDictKey in Wa.FdfProfile.FvDict:=0D for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:=0D for Section in Ffs.SectionList:=0D @@ -1844,7 +2020,8 @@ class FdRegionReport(object): for FvSection in Section.SectionList:=0D if FvSection.FvName in self.FvList:=0D continue=0D - self._GuidsDb[Ffs.NameGuid.upper()] =3D FvSect= ion.FvName=0D + self._GuidsDb[Ffs.NameGuid.upper()=0D + ] =3D FvSection.FvName=0D self.FvList.append(FvSection.FvName)=0D self.FvInfo[FvSection.FvName] =3D ("Nested FV"= , 0, 0)=0D self._DiscoverNestedFvList(FvSection.FvName, W= a)=0D @@ -1897,15 +2074,19 @@ class FdRegionReport(object): for Pa in Wa.AutoGenObjectList:=0D for Package in Pa.PackageList:=0D for (TokenCName, TokenSpaceGuidCName, DecType) in Package.= Pcds:=0D - DecDefaultValue =3D Package.Pcds[TokenCName, TokenSpac= eGuidCName, DecType].DefaultValue=0D - PlatformPcds[(TokenCName, TokenSpaceGuidCName)] =3D De= cDefaultValue=0D + DecDefaultValue =3D Package.Pcds[TokenCName,=0D + TokenSpaceGuidCName, De= cType].DefaultValue=0D + PlatformPcds[(TokenCName, TokenSpaceGuidCName)=0D + ] =3D DecDefaultValue=0D #=0D # Collect PCDs defined in DSC file=0D #=0D for Pa in Wa.AutoGenObjectList:=0D for (TokenCName, TokenSpaceGuidCName) in Pa.Platform.Pcds:=0D - DscDefaultValue =3D Pa.Platform.Pcds[(TokenCName, TokenSpa= ceGuidCName)].DefaultValue=0D - PlatformPcds[(TokenCName, TokenSpaceGuidCName)] =3D DscDef= aultValue=0D + DscDefaultValue =3D Pa.Platform.Pcds[(=0D + TokenCName, TokenSpaceGuidCName)].DefaultValue=0D + PlatformPcds[(TokenCName, TokenSpaceGuidCName)=0D + ] =3D DscDefaultValue=0D =0D #=0D # Add PEI and DXE a priori files GUIDs defined in PI specification= .=0D @@ -1921,13 +2102,14 @@ class FdRegionReport(object): for ModuleKey in Pa.Platform.Modules:=0D M =3D Pa.Platform.Modules[ModuleKey].M=0D InfPath =3D mws.join(Wa.WorkspaceDir, M.MetaFile.File)=0D - self._GuidsDb[M.Guid.upper()] =3D "%s (%s)" % (M.Module.Ba= seName, InfPath)=0D + self._GuidsDb[M.Guid.upper()] =3D "%s (%s)" % (=0D + M.Module.BaseName, InfPath)=0D =0D #=0D # Collect the GUID map in the FV firmware volume=0D #=0D for FvName in self.FvList:=0D - FvDictKey=3DFvName.upper()=0D + FvDictKey =3D FvName.upper()=0D if FvDictKey in Wa.FdfProfile.FvDict:=0D for Ffs in Wa.FdfProfile.FvDict[FvName.upper()].FfsList:=0D try:=0D @@ -1940,18 +2122,20 @@ class FdRegionReport(object): PcdTokenspace =3D Match.group(1)=0D PcdToken =3D Match.group(2)=0D if (PcdToken, PcdTokenspace) in PlatformPcds:= =0D - GuidValue =3D PlatformPcds[(PcdToken, PcdT= okenspace)]=0D - Guid =3D GuidStructureByteArrayToGuidStrin= g(GuidValue).upper()=0D + GuidValue =3D PlatformPcds[(=0D + PcdToken, PcdTokenspace)]=0D + Guid =3D GuidStructureByteArrayToGuidStrin= g(=0D + GuidValue).upper()=0D for Section in Ffs.SectionList:=0D try:=0D - ModuleSectFile =3D mws.join(Wa.WorkspaceDi= r, Section.SectFileName)=0D + ModuleSectFile =3D mws.join(=0D + Wa.WorkspaceDir, Section.SectFileName)= =0D self._GuidsDb[Guid] =3D ModuleSectFile=0D except AttributeError:=0D pass=0D except AttributeError:=0D pass=0D =0D -=0D ##=0D # Internal worker function to generate report for the FD region=0D #=0D @@ -1965,6 +2149,7 @@ class FdRegionReport(object): # @param Size The size of the FD region=0D # @param FvName The FV name if the FD region is a firmware vo= lume=0D #=0D +=0D def _GenerateReport(self, File, Title, Type, BaseAddress, Size=3D0, Fv= Name=3DNone):=0D FileWrite(File, gSubSectionStart)=0D FileWrite(File, Title)=0D @@ -1974,7 +2159,7 @@ class FdRegionReport(object): if self.Type =3D=3D BINARY_FILE_TYPE_FV:=0D FvTotalSize =3D 0=0D FvTakenSize =3D 0=0D - FvFreeSize =3D 0=0D + FvFreeSize =3D 0=0D if FvName.upper().endswith('.FV'):=0D FileExt =3D FvName + ".txt"=0D else:=0D @@ -1999,10 +2184,14 @@ class FdRegionReport(object): #=0D # Write size information to the report file.=0D #=0D - FileWrite(File, "Size: 0x%X (%.0fK)" % (FvTo= talSize, FvTotalSize / 1024.0))=0D - FileWrite(File, "Fv Name: %s (%.1f%% Full)" % (= FvName, FvTakenSize * 100.0 / FvTotalSize))=0D - FileWrite(File, "Occupied Size: 0x%X (%.0fK)" % (FvTa= kenSize, FvTakenSize / 1024.0))=0D - FileWrite(File, "Free Size: 0x%X (%.0fK)" % (FvFr= eeSize, FvFreeSize / 1024.0))=0D + FileWrite(File, "Size: 0x%X (%.0fK)" %=0D + (FvTotalSize, FvTotalSize / 1024.0))=0D + FileWrite(File, "Fv Name: %s (%.1f%% Full)" %=0D + (FvName, FvTakenSize * 100.0 / FvTotalSize))=0D + FileWrite(File, "Occupied Size: 0x%X (%.0fK)" %=0D + (FvTakenSize, FvTakenSize / 1024.0))=0D + FileWrite(File, "Free Size: 0x%X (%.0fK)" %=0D + (FvFreeSize, FvFreeSize / 1024.0))=0D FileWrite(File, "Offset Module")=0D FileWrite(File, gSubSectionSep)=0D #=0D @@ -2014,11 +2203,13 @@ class FdRegionReport(object): OffsetInfo[Match.group(1)] =3D self._GuidsDb.get(Guid,= Guid)=0D OffsetList =3D sorted(OffsetInfo.keys())=0D for Offset in OffsetList:=0D - FileWrite (File, "%s %s" % (Offset, OffsetInfo[Offset]= ))=0D + FileWrite(File, "%s %s" % (Offset, OffsetInfo[Offset])= )=0D except IOError:=0D - EdkLogger.warn(None, "Fail to read report file", FvReportF= ileName)=0D + EdkLogger.warn(None, "Fail to read report file",=0D + FvReportFileName)=0D else:=0D - FileWrite(File, "Size: 0x%X (%.0fK)" % (Size, Si= ze / 1024.0))=0D + FileWrite(File, "Size: 0x%X (%.0fK)" %=0D + (Size, Size / 1024.0))=0D FileWrite(File, gSubSectionEnd)=0D =0D ##=0D @@ -2033,9 +2224,11 @@ class FdRegionReport(object): if (len(self.FvList) > 0):=0D for FvItem in self.FvList:=0D Info =3D self.FvInfo[FvItem]=0D - self._GenerateReport(File, Info[0], TAB_FV_DIRECTORY, Info= [1], Info[2], FvItem)=0D + self._GenerateReport(=0D + File, Info[0], TAB_FV_DIRECTORY, Info[1], Info[2], FvI= tem)=0D else:=0D - self._GenerateReport(File, "FD Region", self.Type, self.BaseAd= dress, self.Size)=0D + self._GenerateReport(File, "FD Region", self.Type,=0D + self.BaseAddress, self.Size)=0D =0D ##=0D # Reports FD information=0D @@ -2043,6 +2236,8 @@ class FdRegionReport(object): # This class reports the FD section in the build report file.=0D # It collects flash device information for a platform.=0D #=0D +=0D +=0D class FdReport(object):=0D ##=0D # Constructor function for class FdReport=0D @@ -2058,7 +2253,8 @@ class FdReport(object): self.FdName =3D Fd.FdUiName=0D self.BaseAddress =3D Fd.BaseAddress=0D self.Size =3D Fd.Size=0D - self.FdRegionList =3D [FdRegionReport(FdRegion, Wa) for FdRegion i= n Fd.RegionList]=0D + self.FdRegionList =3D [FdRegionReport(=0D + FdRegion, Wa) for FdRegion in Fd.RegionList]=0D self.FvPath =3D os.path.join(Wa.BuildDir, TAB_FV_DIRECTORY)=0D self.VPDBaseAddress =3D 0=0D self.VPDSize =3D 0=0D @@ -2081,7 +2277,8 @@ class FdReport(object): FileWrite(File, "Firmware Device (FD)")=0D FileWrite(File, "FD Name: %s" % self.FdName)=0D FileWrite(File, "Base Address: %s" % self.BaseAddress)=0D - FileWrite(File, "Size: 0x%X (%.0fK)" % (self.Size, s= elf.Size / 1024.0))=0D + FileWrite(File, "Size: 0x%X (%.0fK)" %=0D + (self.Size, self.Size / 1024.0))=0D if len(self.FdRegionList) > 0:=0D FileWrite(File, gSectionSep)=0D for FdRegionItem in self.FdRegionList:=0D @@ -2092,26 +2289,28 @@ class FdReport(object): FileWrite(File, gSubSectionStart)=0D FileWrite(File, "FD VPD Region")=0D FileWrite(File, "Base Address: 0x%X" % self.VPDBaseAddre= ss)=0D - FileWrite(File, "Size: 0x%X (%.0fK)" % (self.VPD= Size, self.VPDSize / 1024.0))=0D + FileWrite(File, "Size: 0x%X (%.0fK)" %=0D + (self.VPDSize, self.VPDSize / 1024.0))=0D FileWrite(File, gSubSectionSep)=0D for item in VPDPcdList:=0D # Add BaseAddress for offset=0D Offset =3D '0x%08X' % (int(item[2], 16) + self.VPDBaseAddr= ess)=0D IsByteArray, ArrayList =3D ByteArrayForamt(item[-1])=0D Skuinfo =3D item[1]=0D - if len(GlobalData.gSkuids) =3D=3D 1 :=0D + if len(GlobalData.gSkuids) =3D=3D 1:=0D Skuinfo =3D GlobalData.gSkuids[0]=0D if IsByteArray:=0D - FileWrite(File, "%s | %s | %s | %s | %s" % (item[0], S= kuinfo, Offset, item[3], '{'))=0D + FileWrite(File, "%s | %s | %s | %s | %s" %=0D + (item[0], Skuinfo, Offset, item[3], '{'))=0D for Array in ArrayList:=0D FileWrite(File, Array)=0D else:=0D - FileWrite(File, "%s | %s | %s | %s | %s" % (item[0], S= kuinfo, Offset, item[3], item[-1]))=0D + FileWrite(File, "%s | %s | %s | %s | %s" %=0D + (item[0], Skuinfo, Offset, item[3], item[-1]= ))=0D FileWrite(File, gSubSectionEnd)=0D FileWrite(File, gSectionEnd)=0D =0D =0D -=0D ##=0D # Reports platform information=0D #=0D @@ -2146,7 +2345,8 @@ class PlatformReport(object): self.FdReportList =3D []=0D if "FLASH" in ReportType and Wa.FdfProfile and MaList is None:=0D for Fd in Wa.FdfProfile.FdDict:=0D - self.FdReportList.append(FdReport(Wa.FdfProfile.FdDict[Fd]= , Wa))=0D + self.FdReportList.append(=0D + FdReport(Wa.FdfProfile.FdDict[Fd], Wa))=0D =0D self.PredictionReport =3D None=0D if "FIXED_ADDRESS" in ReportType or "EXECUTION_ORDER" in ReportTyp= e:=0D @@ -2171,16 +2371,17 @@ class PlatformReport(object): if Pa.Arch in GlobalData.gFdfParser.Profile.InfDict:=0D INFList =3D GlobalData.gFdfParser.Profile.InfDict[= Pa.Arch]=0D for InfName in INFList:=0D - InfClass =3D PathClass(NormPath(InfName), Wa.W= orkspaceDir, Pa.Arch)=0D - Ma =3D ModuleAutoGen(Wa, InfClass, Pa.BuildTar= get, Pa.ToolChain, Pa.Arch, Wa.MetaFile, Pa.DataPipe)=0D + InfClass =3D PathClass(=0D + NormPath(InfName), Wa.WorkspaceDir, Pa.Arc= h)=0D + Ma =3D ModuleAutoGen(=0D + Wa, InfClass, Pa.BuildTarget, Pa.ToolChain= , Pa.Arch, Wa.MetaFile, Pa.DataPipe)=0D if Ma is None:=0D continue=0D if Ma not in ModuleAutoGenList:=0D ModuleAutoGenList.append(Ma)=0D for MGen in ModuleAutoGenList:=0D - self.ModuleReportList.append(ModuleReport(MGen, Report= Type))=0D -=0D -=0D + self.ModuleReportList.append(=0D + ModuleReport(MGen, ReportType))=0D =0D ##=0D # Generate report for the whole platform.=0D @@ -2197,6 +2398,7 @@ class PlatformReport(object): # @param GenFdsTime The total time of GenFds Phase=0D # @param ReportType The kind of report items in the final report = file=0D #=0D +=0D def GenerateReport(self, File, BuildDuration, AutoGenTime, MakeTime, G= enFdsTime, ReportType):=0D FileWrite(File, "Platform Summary")=0D FileWrite(File, "Platform Name: %s" % self.PlatformName)=0D @@ -2205,9 +2407,11 @@ class PlatformReport(object): FileWrite(File, "Tool Chain: %s" % self.ToolChain)=0D FileWrite(File, "Target: %s" % self.Target)=0D if GlobalData.gSkuids:=0D - FileWrite(File, "SKUID: %s" % " ".join(GlobalDa= ta.gSkuids))=0D + FileWrite(File, "SKUID: %s" %=0D + " ".join(GlobalData.gSkuids))=0D if GlobalData.gDefaultStores:=0D - FileWrite(File, "DefaultStore: %s" % " ".join(GlobalDa= ta.gDefaultStores))=0D + FileWrite(File, "DefaultStore: %s" %=0D + " ".join(GlobalData.gDefaultStores))=0D FileWrite(File, "Output Path: %s" % self.OutputPath)=0D FileWrite(File, "Build Environment: %s" % self.BuildEnvironment= )=0D FileWrite(File, "Build Duration: %s" % BuildDuration)=0D @@ -2236,17 +2440,20 @@ class PlatformReport(object): FdReportListItem.GenerateReport(File)=0D =0D for ModuleReportItem in self.ModuleReportList:=0D - ModuleReportItem.GenerateReport(File, self.PcdReport, self.Pre= dictionReport, self.DepexParser, ReportType)=0D + ModuleReportItem.GenerateReport(=0D + File, self.PcdReport, self.PredictionReport, self.DepexPar= ser, ReportType)=0D =0D if not self._IsModuleBuild:=0D if "EXECUTION_ORDER" in ReportType:=0D self.PredictionReport.GenerateReport(File, None)=0D =0D -## BuildReport class=0D +# BuildReport class=0D #=0D # This base class contain the routines to collect data and then=0D # applies certain format to the output report=0D #=0D +=0D +=0D class BuildReport(object):=0D ##=0D # Constructor function for class BuildReport=0D @@ -2269,7 +2476,8 @@ class BuildReport(object): if ReportTypeItem not in self.ReportType:=0D self.ReportType.append(ReportTypeItem)=0D else:=0D - self.ReportType =3D ["PCD", "LIBRARY", "BUILD_FLAGS", "DEP= EX", "HASH", "FLASH", "FIXED_ADDRESS"]=0D + self.ReportType =3D ["PCD", "LIBRARY", "BUILD_FLAGS",=0D + "DEPEX", "HASH", "FLASH", "FIXED_ADDRES= S"]=0D ##=0D # Adds platform report to the list=0D #=0D @@ -2279,6 +2487,7 @@ class BuildReport(object): # @param Wa Workspace context information=0D # @param MaList The list of modules in the platform build=0D #=0D +=0D def AddPlatformReport(self, Wa, MaList=3DNone):=0D if self.ReportFile:=0D self.ReportList.append((Wa, MaList))=0D @@ -2300,17 +2509,22 @@ class BuildReport(object): try:=0D File =3D []=0D for (Wa, MaList) in self.ReportList:=0D - PlatformReport(Wa, MaList, self.ReportType).GenerateRe= port(File, BuildDuration, AutoGenTime, MakeTime, GenFdsTime, self.ReportTyp= e)=0D + PlatformReport(Wa, MaList, self.ReportType).GenerateRe= port(=0D + File, BuildDuration, AutoGenTime, MakeTime, GenFds= Time, self.ReportType)=0D Content =3D FileLinesSplit(''.join(File), gLineMaxLength)= =0D SaveFileOnChange(self.ReportFile, Content, False)=0D - EdkLogger.quiet("Build report can be found at %s" % os.pat= h.abspath(self.ReportFile))=0D + EdkLogger.quiet("Build report can be found at %s" %=0D + os.path.abspath(self.ReportFile))=0D except IOError:=0D - EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=3Dself= .ReportFile)=0D + EdkLogger.error(None, FILE_WRITE_FAILURE,=0D + ExtraData=3Dself.ReportFile)=0D except:=0D - EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal = error when generating build report", ExtraData=3Dself.ReportFile, RaiseErro= r=3DFalse)=0D - EdkLogger.quiet("(Python %s on %s\n%s)" % (platform.python= _version(), sys.platform, traceback.format_exc()))=0D + EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal = error when generating build report",=0D + ExtraData=3Dself.ReportFile, RaiseError=3D= False)=0D + EdkLogger.quiet("(Python %s on %s\n%s)" % (=0D + platform.python_version(), sys.platform, traceback.for= mat_exc()))=0D +=0D =0D # This acts like the main() function for the script, unless it is 'import'= ed into another script.=0D if __name__ =3D=3D '__main__':=0D pass=0D -=0D diff --git a/BaseTools/Source/Python/build/__init__.py b/BaseTools/Source/P= ython/build/__init__.py index 41a3808ae9ee..e2c52cf372a2 100644 --- a/BaseTools/Source/Python/build/__init__.py +++ b/BaseTools/Source/Python/build/__init__.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Python 'build' package initialization file.=0D #=0D # This file is required to make Python interpreter treat the directory=0D diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 07187c03618a..00f8bf490dd3 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # build a platform or a module=0D #=0D # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
        =0D @@ -23,16 +23,16 @@ import time import platform=0D import traceback=0D import multiprocessing=0D -from threading import Thread,Event,BoundedSemaphore=0D +from threading import Thread, Event, BoundedSemaphore=0D import threading=0D from linecache import getlines=0D -from subprocess import Popen,PIPE, STDOUT=0D +from subprocess import Popen, PIPE, STDOUT=0D from collections import OrderedDict, defaultdict=0D =0D from AutoGen.PlatformAutoGen import PlatformAutoGen=0D from AutoGen.ModuleAutoGen import ModuleAutoGen=0D from AutoGen.WorkspaceAutoGen import WorkspaceAutoGen=0D -from AutoGen.AutoGenWorker import AutoGenWorkerInProcess,AutoGenManager,\= =0D +from AutoGen.AutoGenWorker import AutoGenWorkerInProcess, AutoGenManager,\= =0D LogAgent=0D from AutoGen import GenMake=0D from Common import Misc as Utils=0D @@ -40,7 +40,7 @@ from Common import Misc as Utils from Common.TargetTxtClassObject import TargetTxtDict=0D from Common.ToolDefClassObject import ToolDefDict=0D from buildoptions import MyOptionParser=0D -from Common.Misc import PathClass,SaveFileOnChange,RemoveDirectory=0D +from Common.Misc import PathClass, SaveFileOnChange, RemoveDirectory=0D from Common.StringUtils import NormPath=0D from Common.MultipleWorkspace import MultipleWorkspace as mws=0D from Common.BuildToolError import *=0D @@ -50,7 +50,7 @@ import Common.EdkLogger as EdkLogger from Workspace.WorkspaceDatabase import BuildDB=0D =0D from BuildReport import BuildReport=0D -from GenPatchPcdTable.GenPatchPcdTable import PeImageClass,parsePcdInfoFro= mMapFile=0D +from GenPatchPcdTable.GenPatchPcdTable import PeImageClass, parsePcdInfoFr= omMapFile=0D from PatchPcdValue.PatchPcdValue import PatchBinaryFile=0D =0D import Common.GlobalData as GlobalData=0D @@ -64,17 +64,20 @@ from AutoGen.IncludesAutoGen import IncludesAutoGen from GenFds.GenFds import resetFdsGlobalVariable=0D from AutoGen.AutoGen import CalculatePriorityValue=0D =0D -## standard targets of build command=0D -gSupportedTarget =3D ['all', 'genc', 'genmake', 'modules', 'libraries', 'f= ds', 'clean', 'cleanall', 'cleanlib', 'run']=0D +# standard targets of build command=0D +gSupportedTarget =3D ['all', 'genc', 'genmake', 'modules',=0D + 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', '= run']=0D =0D TemporaryTablePattern =3D re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$')=0D TmpTableDict =3D {}=0D =0D -## Check environment PATH variable to make sure the specified tool is foun= d=0D +# Check environment PATH variable to make sure the specified tool is found= =0D #=0D # If the tool is found in the PATH, then True is returned=0D # Otherwise, False is returned=0D #=0D +=0D +=0D def IsToolInPath(tool):=0D if 'PATHEXT' in os.environ:=0D extns =3D os.environ['PATHEXT'].split(os.path.pathsep)=0D @@ -86,7 +89,7 @@ def IsToolInPath(tool): return True=0D return False=0D =0D -## Check environment variables=0D +# Check environment variables=0D #=0D # Check environment variables that must be set for build. Currently they = are=0D #=0D @@ -97,6 +100,8 @@ def IsToolInPath(tool): # If any of above environment variable is not set or has error, the buil= d=0D # will be broken.=0D #=0D +=0D +=0D def CheckEnvVariable():=0D # check WORKSPACE=0D if "WORKSPACE" not in os.environ:=0D @@ -105,7 +110,8 @@ def CheckEnvVariable(): =0D WorkspaceDir =3D os.path.normcase(os.path.normpath(os.environ["WORKSPA= CE"]))=0D if not os.path.exists(WorkspaceDir):=0D - EdkLogger.error("build", FILE_NOT_FOUND, "WORKSPACE doesn't exist"= , ExtraData=3DWorkspaceDir)=0D + EdkLogger.error("build", FILE_NOT_FOUND,=0D + "WORKSPACE doesn't exist", ExtraData=3DWorkspaceDi= r)=0D elif ' ' in WorkspaceDir:=0D EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowe= d in WORKSPACE path",=0D ExtraData=3DWorkspaceDir)=0D @@ -117,12 +123,14 @@ def CheckEnvVariable(): if mws.PACKAGES_PATH:=0D for Path in mws.PACKAGES_PATH:=0D if not os.path.exists(Path):=0D - EdkLogger.error("build", FILE_NOT_FOUND, "One Path in PACK= AGES_PATH doesn't exist", ExtraData=3DPath)=0D + EdkLogger.error(=0D + "build", FILE_NOT_FOUND, "One Path in PACKAGES_PATH do= esn't exist", ExtraData=3DPath)=0D elif ' ' in Path:=0D - EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space i= s allowed in PACKAGES_PATH", ExtraData=3DPath)=0D + EdkLogger.error("build", FORMAT_NOT_SUPPORTED,=0D + "No space is allowed in PACKAGES_PATH", Ex= traData=3DPath)=0D =0D -=0D - os.environ["EDK_TOOLS_PATH"] =3D os.path.normcase(os.environ["EDK_TOOL= S_PATH"])=0D + os.environ["EDK_TOOLS_PATH"] =3D os.path.normcase(=0D + os.environ["EDK_TOOLS_PATH"])=0D =0D # check EDK_TOOLS_PATH=0D if "EDK_TOOLS_PATH" not in os.environ:=0D @@ -136,10 +144,10 @@ def CheckEnvVariable(): =0D GlobalData.gWorkspace =3D WorkspaceDir=0D =0D - GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir=0D + GlobalData.gGlobalDefines["WORKSPACE"] =3D WorkspaceDir=0D GlobalData.gGlobalDefines["EDK_TOOLS_PATH"] =3D os.environ["EDK_TOOLS_= PATH"]=0D =0D -## Get normalized file path=0D +# Get normalized file path=0D #=0D # Convert the path to be local format, and remove the WORKSPACE path at th= e=0D # beginning if the file path is given in full path.=0D @@ -149,6 +157,8 @@ def CheckEnvVariable(): #=0D # @retval string The normalized file path=0D #=0D +=0D +=0D def NormFile(FilePath, Workspace):=0D # check if the path is absolute or relative=0D if os.path.isabs(FilePath):=0D @@ -159,7 +169,8 @@ def NormFile(FilePath, Workspace): =0D # check if the file path exists or not=0D if not os.path.isfile(FileFullPath):=0D - EdkLogger.error("build", FILE_NOT_FOUND, ExtraData=3D"\t%s (Please= give file in absolute path or relative to WORKSPACE)" % FileFullPath)=0D + EdkLogger.error("build", FILE_NOT_FOUND,=0D + ExtraData=3D"\t%s (Please give file in absolute pa= th or relative to WORKSPACE)" % FileFullPath)=0D =0D # remove workspace directory from the beginning part of the file path= =0D if Workspace[-1] in ["\\", "/"]:=0D @@ -167,7 +178,7 @@ def NormFile(FilePath, Workspace): else:=0D return FileFullPath[(len(Workspace) + 1):]=0D =0D -## Get the output of an external program=0D +# Get the output of an external program=0D #=0D # This is the entrance method of thread reading output of an external prog= ram and=0D # putting them in STDOUT/STDERR of current program.=0D @@ -176,7 +187,9 @@ def NormFile(FilePath, Workspace): # @param To The stream message put on=0D # @param ExitFlag The flag used to indicate stopping reading=0D #=0D -def ReadMessage(From, To, ExitFlag,MemTo=3DNone):=0D +=0D +=0D +def ReadMessage(From, To, ExitFlag, MemTo=3DNone):=0D while True:=0D # read one line a time=0D Line =3D From.readline()=0D @@ -184,7 +197,7 @@ def ReadMessage(From, To, ExitFlag,MemTo=3DNone): if Line is not None and Line !=3D b"":=0D LineStr =3D Line.rstrip().decode(encoding=3D'utf-8', errors=3D= 'ignore')=0D if MemTo is not None:=0D - if "Note: including file:" =3D=3D LineStr.lstrip()[:21]:= =0D + if "Note: including file:" =3D=3D LineStr.lstrip()[:21]:=0D MemTo.append(LineStr)=0D else:=0D To(LineStr)=0D @@ -196,12 +209,13 @@ def ReadMessage(From, To, ExitFlag,MemTo=3DNone): if ExitFlag.is_set():=0D break=0D =0D +=0D class MakeSubProc(Popen):=0D - def __init__(self,*args, **argv):=0D - super(MakeSubProc,self).__init__(*args, **argv)=0D + def __init__(self, *args, **argv):=0D + super(MakeSubProc, self).__init__(*args, **argv)=0D self.ProcOut =3D []=0D =0D -## Launch an external program=0D +# Launch an external program=0D #=0D # This method will call subprocess.Popen to execute an external program wi= th=0D # given options in specified directory. Because of the dead-lock issue dur= ing=0D @@ -211,7 +225,9 @@ class MakeSubProc(Popen): # @param Command A list or string containing the call of th= e program=0D # @param WorkingDir The directory in which the program will be= running=0D #=0D -def LaunchCommand(Command, WorkingDir,ModuleAuto =3D None):=0D +=0D +=0D +def LaunchCommand(Command, WorkingDir, ModuleAuto=3DNone):=0D BeginTime =3D time.time()=0D # if working directory doesn't exist, Popen() will raise an exception= =0D if not os.path.isdir(WorkingDir):=0D @@ -230,29 +246,32 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D = None): EndOfProcedure =3D None=0D try:=0D # launch the command=0D - Proc =3D MakeSubProc(Command, stdout=3DPIPE, stderr=3DSTDOUT, env= =3Dos.environ, cwd=3DWorkingDir, bufsize=3D-1, shell=3DTrue)=0D + Proc =3D MakeSubProc(Command, stdout=3DPIPE, stderr=3DSTDOUT,=0D + env=3Dos.environ, cwd=3DWorkingDir, bufsize=3D-= 1, shell=3DTrue)=0D =0D # launch two threads to read the STDOUT and STDERR=0D EndOfProcedure =3D Event()=0D EndOfProcedure.clear()=0D if Proc.stdout:=0D - StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc.std= out, EdkLogger.info, EndOfProcedure,Proc.ProcOut))=0D + StdOutThread =3D Thread(target=3DReadMessage, args=3D(=0D + Proc.stdout, EdkLogger.info, EndOfProcedure, Proc.ProcOut)= )=0D StdOutThread.name =3D "STDOUT-Redirector"=0D StdOutThread.daemon =3D False=0D StdOutThread.start()=0D =0D -=0D # waiting for program exit=0D Proc.wait()=0D - except: # in case of aborting=0D + except: # in case of aborting=0D # terminate the threads redirecting the program output=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(),= sys.platform) + traceback.format_exc())=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.format_ex= c())=0D if EndOfProcedure is not None:=0D EndOfProcedure.set()=0D if Proc is None:=0D if not isinstance(Command, type("")):=0D Command =3D " ".join(Command)=0D - EdkLogger.error("build", COMMAND_FAILURE, "Failed to start com= mand", ExtraData=3D"%s [%s]" % (Command, WorkingDir))=0D + EdkLogger.error("build", COMMAND_FAILURE, "Failed to start com= mand",=0D + ExtraData=3D"%s [%s]" % (Command, WorkingDir))= =0D =0D if Proc.stdout:=0D StdOutThread.join()=0D @@ -269,9 +288,10 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D N= one): f.close()=0D EdkLogger.info(RespContent)=0D =0D - EdkLogger.error("build", COMMAND_FAILURE, ExtraData=3D"%s [%s]" % = (Command, WorkingDir))=0D + EdkLogger.error("build", COMMAND_FAILURE,=0D + ExtraData=3D"%s [%s]" % (Command, WorkingDir))=0D if ModuleAuto:=0D - iau =3D IncludesAutoGen(WorkingDir,ModuleAuto)=0D + iau =3D IncludesAutoGen(WorkingDir, ModuleAuto)=0D if ModuleAuto.ToolChainFamily =3D=3D TAB_COMPILER_MSFT:=0D iau.CreateDepsFileForMsvc(Proc.ProcOut)=0D else:=0D @@ -282,7 +302,7 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D No= ne): iau.CreateDepsTarget()=0D return "%dms" % (int(round((time.time() - BeginTime) * 1000)))=0D =0D -## The smallest unit that can be built in multi-thread build mode=0D +# The smallest unit that can be built in multi-thread build mode=0D #=0D # This is the base class of build unit. The "Obj" parameter must provide=0D # __str__(), __eq__() and __hash__() methods. Otherwise there could be bui= ld units=0D @@ -290,8 +310,10 @@ def LaunchCommand(Command, WorkingDir,ModuleAuto =3D N= one): #=0D # Currently the "Obj" should be only ModuleAutoGen or PlatformAutoGen obje= cts.=0D #=0D +=0D +=0D class BuildUnit:=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Obj The object the build is working on=0D @@ -309,20 +331,20 @@ class BuildUnit: EdkLogger.error("build", OPTION_MISSING,=0D "No build command found for this module. "=0D "Please check your setting of %s_%s_%s_MAKE_PA= TH in Conf/tools_def.txt file." %=0D - (Obj.BuildTarget, Obj.ToolChain, Obj.Arch)= ,=0D + (Obj.BuildTarget, Obj.ToolChain, Obj.Arch),=0D ExtraData=3Dstr(Obj))=0D =0D -=0D - ## str() method=0D + # str() method=0D #=0D # It just returns the string representation of self.BuildObject=0D #=0D # @param self The object pointer=0D #=0D +=0D def __str__(self):=0D return str(self.BuildObject)=0D =0D - ## "=3D=3D" operator method=0D + # "=3D=3D" operator method=0D #=0D # It just compares self.BuildObject with "Other". So self.BuildObjec= t must=0D # provide its own __eq__() method.=0D @@ -332,10 +354,10 @@ class BuildUnit: #=0D def __eq__(self, Other):=0D return Other and self.BuildObject =3D=3D Other.BuildObject \=0D - and Other.BuildObject \=0D - and self.BuildObject.Arch =3D=3D Other.BuildObject.Arch=0D + and Other.BuildObject \=0D + and self.BuildObject.Arch =3D=3D Other.BuildObject.Arch=0D =0D - ## hash() method=0D + # hash() method=0D #=0D # It just returns the hash value of self.BuildObject which must be h= ashable.=0D #=0D @@ -347,7 +369,7 @@ class BuildUnit: def __repr__(self):=0D return repr(self.BuildObject)=0D =0D -## The smallest module unit that can be built by nmake/make command in mul= ti-thread build mode=0D +# The smallest module unit that can be built by nmake/make command in mult= i-thread build mode=0D #=0D # This class is for module build by nmake/make build system. The "Obj" par= ameter=0D # must provide __str__(), __eq__() and __hash__() methods. Otherwise there= could=0D @@ -355,20 +377,24 @@ class BuildUnit: #=0D # Currently the "Obj" should be only ModuleAutoGen object.=0D #=0D +=0D +=0D class ModuleMakeUnit(BuildUnit):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Obj The ModuleAutoGen object the build is working = on=0D # @param Target The build target name, one of gSupportedTarget= =0D #=0D - def __init__(self, Obj, BuildCommand,Target):=0D - Dependency =3D [ModuleMakeUnit(La, BuildCommand,Target) for La in = Obj.LibraryAutoGenList]=0D - BuildUnit.__init__(self, Obj, BuildCommand, Target, Dependency, Ob= j.MakeFileDir)=0D + def __init__(self, Obj, BuildCommand, Target):=0D + Dependency =3D [ModuleMakeUnit(La, BuildCommand, Target)=0D + for La in Obj.LibraryAutoGenList]=0D + BuildUnit.__init__(self, Obj, BuildCommand, Target,=0D + Dependency, Obj.MakeFileDir)=0D if Target in [None, "", "all"]:=0D self.Target =3D "tbuild"=0D =0D -## The smallest platform unit that can be built by nmake/make command in m= ulti-thread build mode=0D +# The smallest platform unit that can be built by nmake/make command in mu= lti-thread build mode=0D #=0D # This class is for platform build by nmake/make build system. The "Obj" p= arameter=0D # must provide __str__(), __eq__() and __hash__() methods. Otherwise there= could=0D @@ -376,23 +402,30 @@ class ModuleMakeUnit(BuildUnit): #=0D # Currently the "Obj" should be only PlatformAutoGen object.=0D #=0D +=0D +=0D class PlatformMakeUnit(BuildUnit):=0D - ## The constructor=0D + # The constructor=0D #=0D # @param self The object pointer=0D # @param Obj The PlatformAutoGen object the build is workin= g on=0D # @param Target The build target name, one of gSupportedTarget= =0D #=0D def __init__(self, Obj, BuildCommand, Target):=0D - Dependency =3D [ModuleMakeUnit(Lib, BuildCommand, Target) for Lib = in self.BuildObject.LibraryAutoGenList]=0D - Dependency.extend([ModuleMakeUnit(Mod, BuildCommand,Target) for Mo= d in self.BuildObject.ModuleAutoGenList])=0D - BuildUnit.__init__(self, Obj, BuildCommand, Target, Dependency, Ob= j.MakeFileDir)=0D + Dependency =3D [ModuleMakeUnit(Lib, BuildCommand, Target)=0D + for Lib in self.BuildObject.LibraryAutoGenList]=0D + Dependency.extend([ModuleMakeUnit(Mod, BuildCommand, Target)=0D + for Mod in self.BuildObject.ModuleAutoGenList])= =0D + BuildUnit.__init__(self, Obj, BuildCommand, Target,=0D + Dependency, Obj.MakeFileDir)=0D =0D -## The class representing the task of a module build or platform build=0D +# The class representing the task of a module build or platform build=0D #=0D # This class manages the build tasks in multi-thread build mode. Its jobs = include=0D # scheduling thread running, catching thread error, monitor the thread sta= tus, etc.=0D #=0D +=0D +=0D class BuildTask:=0D # queue for tasks waiting for schedule=0D _PendingQueue =3D OrderedDict()=0D @@ -421,14 +454,15 @@ class BuildTask: _SchedulerStopped =3D threading.Event()=0D _SchedulerStopped.set()=0D =0D - ## Start the task scheduler thread=0D + # Start the task scheduler thread=0D #=0D # @param MaxThreadNumber The maximum thread number=0D # @param ExitFlag Flag used to end the scheduler=0D #=0D @staticmethod=0D def StartScheduler(MaxThreadNumber, ExitFlag):=0D - SchedulerThread =3D Thread(target=3DBuildTask.Scheduler, args=3D(M= axThreadNumber, ExitFlag))=0D + SchedulerThread =3D Thread(=0D + target=3DBuildTask.Scheduler, args=3D(MaxThreadNumber, ExitFla= g))=0D SchedulerThread.name =3D "Build-Task-Scheduler"=0D SchedulerThread.daemon =3D False=0D SchedulerThread.start()=0D @@ -436,7 +470,7 @@ class BuildTask: while not BuildTask.IsOnGoing():=0D time.sleep(0.01)=0D =0D - ## Scheduler method=0D + # Scheduler method=0D #=0D # @param MaxThreadNumber The maximum thread number=0D # @param ExitFlag Flag used to end the scheduler=0D @@ -451,7 +485,7 @@ class BuildTask: # scheduling loop, which will exits when no pending/ready task= and=0D # indicated to do so, or there's error in running thread=0D #=0D - while (len(BuildTask._PendingQueue) > 0 or len(BuildTask._Read= yQueue) > 0 \=0D + while (len(BuildTask._PendingQueue) > 0 or len(BuildTask._Read= yQueue) > 0=0D or not ExitFlag.is_set()) and not BuildTask._ErrorFlag.= is_set():=0D EdkLogger.debug(EdkLogger.DEBUG_8, "Pending Queue (%d), Re= ady Queue (%d)"=0D % (len(BuildTask._PendingQueue), len(Build= Task._ReadyQueue)))=0D @@ -466,7 +500,8 @@ class BuildTask: for BuildObject in BuildObjectList:=0D Bt =3D BuildTask._PendingQueue[BuildObject]=0D if Bt.IsReady():=0D - BuildTask._ReadyQueue[BuildObject] =3D BuildTask._= PendingQueue.pop(BuildObject)=0D + BuildTask._ReadyQueue[BuildObject] =3D BuildTask._= PendingQueue.pop(=0D + BuildObject)=0D BuildTask._PendingQueueLock.release()=0D =0D # launch build thread until the maximum number of threads = is reached=0D @@ -498,8 +533,10 @@ class BuildTask: EdkLogger.quiet("\nWaiting for all build threads exit...")= =0D # while not BuildTask._ErrorFlag.is_set() and \=0D while len(BuildTask._RunningQueue) > 0:=0D - EdkLogger.verbose("Waiting for thread ending...(%d)" % len= (BuildTask._RunningQueue))=0D - EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin(Th.name for Th in threading.enumerate()))=0D + EdkLogger.verbose("Waiting for thread ending...(%d)" %=0D + len(BuildTask._RunningQueue))=0D + EdkLogger.debug(EdkLogger.DEBUG_8, "Threads [%s]" % ", ".j= oin(=0D + Th.name for Th in threading.enumerate()))=0D # avoid tense loop=0D time.sleep(0.1)=0D except BaseException as X:=0D @@ -509,7 +546,8 @@ class BuildTask: #=0D EdkLogger.SetLevel(EdkLogger.ERROR)=0D BuildTask._ErrorFlag.set()=0D - BuildTask._ErrorMessage =3D "build thread scheduler error\n\t%= s" % str(X)=0D + BuildTask._ErrorMessage =3D "build thread scheduler error\n\t%= s" % str(=0D + X)=0D =0D BuildTask._PendingQueue.clear()=0D BuildTask._ReadyQueue.clear()=0D @@ -517,26 +555,26 @@ class BuildTask: BuildTask._TaskQueue.clear()=0D BuildTask._SchedulerStopped.set()=0D =0D - ## Wait for all running method exit=0D + # Wait for all running method exit=0D #=0D @staticmethod=0D def WaitForComplete():=0D BuildTask._SchedulerStopped.wait()=0D =0D - ## Check if the scheduler is running or not=0D + # Check if the scheduler is running or not=0D #=0D @staticmethod=0D def IsOnGoing():=0D return not BuildTask._SchedulerStopped.is_set()=0D =0D - ## Abort the build=0D + # Abort the build=0D @staticmethod=0D def Abort():=0D if BuildTask.IsOnGoing():=0D BuildTask._ErrorFlag.set()=0D BuildTask.WaitForComplete()=0D =0D - ## Check if there's error in running thread=0D + # Check if there's error in running thread=0D #=0D # Since the main thread cannot catch exceptions in other thread, we = have to=0D # use threading.Event to communicate this formation to main thread.= =0D @@ -545,7 +583,7 @@ class BuildTask: def HasError():=0D return BuildTask._ErrorFlag.is_set()=0D =0D - ## Get error message in running thread=0D + # Get error message in running thread=0D #=0D # Since the main thread cannot catch exceptions in other thread, we = have to=0D # use a static variable to communicate this message to main thread.= =0D @@ -554,7 +592,7 @@ class BuildTask: def GetErrorMessage():=0D return BuildTask._ErrorMessage=0D =0D - ## Factory method to create a BuildTask object=0D + # Factory method to create a BuildTask object=0D #=0D # This method will check if a module is building or has been built. = And if=0D # true, just return the associated BuildTask object in the _TaskQueu= e. If=0D @@ -580,7 +618,7 @@ class BuildTask: =0D return Bt=0D =0D - ## The real constructor of BuildTask=0D + # The real constructor of BuildTask=0D #=0D # @param BuildItem A BuildUnit object representing a build ob= ject=0D # @param Dependency The dependent build object of BuildItem=0D @@ -597,7 +635,7 @@ class BuildTask: # flag indicating build completes, used to avoid unnecessary re-bu= ild=0D self.CompleteFlag =3D False=0D =0D - ## Check if all dependent build tasks are completed or not=0D + # Check if all dependent build tasks are completed or not=0D #=0D def IsReady(self):=0D ReadyFlag =3D True=0D @@ -609,23 +647,25 @@ class BuildTask: =0D return ReadyFlag=0D =0D - ## Add dependent build task=0D + # Add dependent build task=0D #=0D # @param Dependency The list of dependent build objects=0D #=0D def AddDependency(self, Dependency):=0D for Dep in Dependency:=0D if not Dep.BuildObject.IsBinaryModule and not Dep.BuildObject.= CanSkipbyCache(GlobalData.gModuleCacheHit):=0D - self.DependencyList.append(BuildTask.New(Dep)) # BuildT= ask list=0D + self.DependencyList.append(=0D + BuildTask.New(Dep)) # BuildTask list=0D =0D - ## The thread wrapper of LaunchCommand function=0D + # The thread wrapper of LaunchCommand function=0D #=0D # @param Command A list or string contains the call of = the command=0D # @param WorkingDir The directory in which the program wil= l be running=0D #=0D def _CommandThread(self, Command, WorkingDir):=0D try:=0D - self.BuildItem.BuildObject.BuildTime =3D LaunchCommand(Command= , WorkingDir,self.BuildItem.BuildObject)=0D + self.BuildItem.BuildObject.BuildTime =3D LaunchCommand(=0D + Command, WorkingDir, self.BuildItem.BuildObject)=0D self.CompleteFlag =3D True=0D =0D # Run hash operation post dependency to account for libs=0D @@ -645,11 +685,12 @@ class BuildTask: self.Bui= ldItem.BuildObject.Arch,=0D self.Bui= ldItem.BuildObject.ToolChain,=0D self.Bui= ldItem.BuildObject.BuildTarget=0D - )=0D + )=0D EdkLogger.SetLevel(EdkLogger.ERROR)=0D BuildTask._ErrorFlag.set()=0D BuildTask._ErrorMessage =3D "%s broken\n %s [%s]" % \=0D - (threading.current_thread().name, Co= mmand, WorkingDir)=0D + (threading.current_thread().name,=0D + Command, WorkingDir)=0D =0D # indicate there's a thread is available for another build task=0D BuildTask._RunningQueueLock.acquire()=0D @@ -657,20 +698,23 @@ class BuildTask: BuildTask._RunningQueueLock.release()=0D BuildTask._Thread.release()=0D =0D - ## Start build task thread=0D + # Start build task thread=0D #=0D def Start(self):=0D EdkLogger.quiet("Building ... %s" % repr(self.BuildItem))=0D Command =3D self.BuildItem.BuildCommand + [self.BuildItem.Target]= =0D - self.BuildTread =3D Thread(target=3Dself._CommandThread, args=3D(C= ommand, self.BuildItem.WorkingDir))=0D + self.BuildTread =3D Thread(target=3Dself._CommandThread, args=3D(= =0D + Command, self.BuildItem.WorkingDir))=0D self.BuildTread.name =3D "build thread"=0D self.BuildTread.daemon =3D False=0D self.BuildTread.start()=0D =0D -## The class contains the information related to EFI image=0D +# The class contains the information related to EFI image=0D #=0D +=0D +=0D class PeImageInfo():=0D - ## Constructor=0D + # Constructor=0D #=0D # Constructor will load all required image information.=0D #=0D @@ -682,15 +726,15 @@ class PeImageInfo(): # @param ImageClass PeImage Information=0D #=0D def __init__(self, BaseName, Guid, Arch, OutputDir, DebugDir, ImageCla= ss):=0D - self.BaseName =3D BaseName=0D - self.Guid =3D Guid=0D - self.Arch =3D Arch=0D - self.OutputDir =3D OutputDir=0D - self.DebugDir =3D DebugDir=0D - self.Image =3D ImageClass=0D - self.Image.Size =3D (self.Image.Size // 0x1000 + 1) * 0x1000= =0D + self.BaseName =3D BaseName=0D + self.Guid =3D Guid=0D + self.Arch =3D Arch=0D + self.OutputDir =3D OutputDir=0D + self.DebugDir =3D DebugDir=0D + self.Image =3D ImageClass=0D + self.Image.Size =3D (self.Image.Size // 0x1000 + 1) * 0x1000=0D =0D -## The class implementing the EDK2 build process=0D +# The class implementing the EDK2 build process=0D #=0D # The build process includes:=0D # 1. Load configuration from target.txt and tools_def.txt in $(WORKS= PACE)/Conf=0D @@ -700,8 +744,10 @@ class PeImageInfo(): # 5. Create AutoGen files (C code file, depex file, makefile) if nec= essary=0D # 6. Call build command=0D #=0D +=0D +=0D class Build():=0D - ## Constructor=0D + # Constructor=0D #=0D # Constructor will load all necessary configurations, parse platform, = modules=0D # and packages and the establish a database for AutoGen.=0D @@ -710,53 +756,58 @@ class Build(): # @param WorkspaceDir The directory of workspace=0D # @param BuildOptions Build options passed from command line= =0D #=0D - def __init__(self, Target, WorkspaceDir, BuildOptions,log_q):=0D - self.WorkspaceDir =3D WorkspaceDir=0D - self.Target =3D Target=0D - self.PlatformFile =3D BuildOptions.PlatformFile=0D - self.ModuleFile =3D BuildOptions.ModuleFile=0D - self.ArchList =3D BuildOptions.TargetArch=0D - self.ToolChainList =3D BuildOptions.ToolChain=0D - self.BuildTargetList=3D BuildOptions.BuildTarget=0D - self.Fdf =3D BuildOptions.FdfFile=0D - self.FdList =3D BuildOptions.RomImage=0D - self.FvList =3D BuildOptions.FvImage=0D - self.CapList =3D BuildOptions.CapName=0D - self.SilentMode =3D BuildOptions.SilentMode=0D - self.ThreadNumber =3D 1=0D - self.SkipAutoGen =3D BuildOptions.SkipAutoGen=0D - self.Reparse =3D BuildOptions.Reparse=0D - self.SkuId =3D BuildOptions.SkuId=0D + def __init__(self, Target, WorkspaceDir, BuildOptions, log_q):=0D + self.WorkspaceDir =3D WorkspaceDir=0D + self.Target =3D Target=0D + self.PlatformFile =3D BuildOptions.PlatformFile=0D + self.ModuleFile =3D BuildOptions.ModuleFile=0D + self.ArchList =3D BuildOptions.TargetArch=0D + self.ToolChainList =3D BuildOptions.ToolChain=0D + self.BuildTargetList =3D BuildOptions.BuildTarget=0D + self.Fdf =3D BuildOptions.FdfFile=0D + self.FdList =3D BuildOptions.RomImage=0D + self.FvList =3D BuildOptions.FvImage=0D + self.CapList =3D BuildOptions.CapName=0D + self.SilentMode =3D BuildOptions.SilentMode=0D + self.ThreadNumber =3D 1=0D + self.SkipAutoGen =3D BuildOptions.SkipAutoGen=0D + self.Reparse =3D BuildOptions.Reparse=0D + self.SkuId =3D BuildOptions.SkuId=0D if self.SkuId:=0D GlobalData.gSKUID_CMD =3D self.SkuId=0D self.ConfDirectory =3D BuildOptions.ConfDirectory=0D - self.SpawnMode =3D True=0D - self.BuildReport =3D BuildReport(BuildOptions.ReportFile, Build= Options.ReportType)=0D - self.AutoGenTime =3D 0=0D - self.MakeTime =3D 0=0D - self.GenFdsTime =3D 0=0D - self.MakeFileName =3D ""=0D + self.SpawnMode =3D True=0D + self.BuildReport =3D BuildReport(=0D + BuildOptions.ReportFile, BuildOptions.ReportType)=0D + self.AutoGenTime =3D 0=0D + self.MakeTime =3D 0=0D + self.GenFdsTime =3D 0=0D + self.MakeFileName =3D ""=0D TargetObj =3D TargetTxtDict()=0D - ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSPACE"),"C= onf")))=0D + ToolDefObj =3D ToolDefDict(=0D + (os.path.join(os.getenv("WORKSPACE"), "Conf")))=0D self.TargetTxt =3D TargetObj.Target=0D self.ToolDef =3D ToolDefObj.ToolDef=0D - GlobalData.BuildOptionPcd =3D BuildOptions.OptionPcd if BuildO= ptions.OptionPcd else []=0D - #Set global flag for build mode=0D + GlobalData.BuildOptionPcd =3D BuildOptions.OptionPcd if BuildOptio= ns.OptionPcd else []=0D + # Set global flag for build mode=0D GlobalData.gIgnoreSource =3D BuildOptions.IgnoreSources=0D GlobalData.gUseHashCache =3D BuildOptions.UseHashCache=0D - GlobalData.gBinCacheDest =3D BuildOptions.BinCacheDest=0D + GlobalData.gBinCacheDest =3D BuildOptions.BinCacheDest=0D GlobalData.gBinCacheSource =3D BuildOptions.BinCacheSource=0D GlobalData.gEnableGenfdsMultiThread =3D not BuildOptions.NoGenfdsM= ultiThread=0D GlobalData.gDisableIncludePathCheck =3D BuildOptions.DisableInclud= ePathCheck=0D =0D if GlobalData.gBinCacheDest and not GlobalData.gUseHashCache:=0D - EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData=3D"--= binary-destination must be used together with --hash.")=0D + EdkLogger.error("build", OPTION_NOT_SUPPORTED,=0D + ExtraData=3D"--binary-destination must be used= together with --hash.")=0D =0D if GlobalData.gBinCacheSource and not GlobalData.gUseHashCache:=0D - EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData=3D"--= binary-source must be used together with --hash.")=0D + EdkLogger.error("build", OPTION_NOT_SUPPORTED,=0D + ExtraData=3D"--binary-source must be used toge= ther with --hash.")=0D =0D if GlobalData.gBinCacheDest and GlobalData.gBinCacheSource:=0D - EdkLogger.error("build", OPTION_NOT_SUPPORTED, ExtraData=3D"--= binary-destination can not be used together with --binary-source.")=0D + EdkLogger.error("build", OPTION_NOT_SUPPORTED,=0D + ExtraData=3D"--binary-destination can not be u= sed together with --binary-source.")=0D =0D if GlobalData.gBinCacheSource:=0D BinCacheSource =3D os.path.normpath(GlobalData.gBinCacheSource= )=0D @@ -765,7 +816,8 @@ class Build(): GlobalData.gBinCacheSource =3D BinCacheSource=0D else:=0D if GlobalData.gBinCacheSource is not None:=0D - EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData= =3D"Invalid value of option --binary-source.")=0D + EdkLogger.error("build", OPTION_VALUE_INVALID,=0D + ExtraData=3D"Invalid value of option --bin= ary-source.")=0D =0D if GlobalData.gBinCacheDest:=0D BinCacheDest =3D os.path.normpath(GlobalData.gBinCacheDest)=0D @@ -774,9 +826,11 @@ class Build(): GlobalData.gBinCacheDest =3D BinCacheDest=0D else:=0D if GlobalData.gBinCacheDest is not None:=0D - EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData= =3D"Invalid value of option --binary-destination.")=0D + EdkLogger.error("build", OPTION_VALUE_INVALID,=0D + ExtraData=3D"Invalid value of option --bin= ary-destination.")=0D =0D - GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(GlobalD= ata.gConfDirectory, GlobalData.gDatabasePath))=0D + GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(=0D + GlobalData.gConfDirectory, GlobalData.gDatabasePath))=0D if not os.path.exists(os.path.join(GlobalData.gConfDirectory, '.ca= che')):=0D os.makedirs(os.path.join(GlobalData.gConfDirectory, '.cache'))= =0D self.Db =3D BuildDB=0D @@ -784,12 +838,13 @@ class Build(): self.Platform =3D None=0D self.ToolChainFamily =3D None=0D self.LoadFixAddress =3D 0=0D - self.UniFlag =3D BuildOptions.Flag=0D + self.UniFlag =3D BuildOptions.Flag=0D self.BuildModules =3D []=0D self.HashSkipModules =3D []=0D self.Db_Flag =3D False=0D self.LaunchPrebuildFlag =3D False=0D - self.PlatformBuildPath =3D os.path.join(GlobalData.gConfDirectory,= '.cache', '.PlatformBuild')=0D + self.PlatformBuildPath =3D os.path.join(=0D + GlobalData.gConfDirectory, '.cache', '.PlatformBuild')=0D if BuildOptions.CommandLength:=0D GlobalData.gCommandMaxLength =3D BuildOptions.CommandLength=0D =0D @@ -799,19 +854,24 @@ class Build(): EdkLogger.quiet("%-16s =3D %s" % ("WORKSPACE", os.environ["WORKSPA= CE"]))=0D if "PACKAGES_PATH" in os.environ:=0D # WORKSPACE env has been converted before. Print the same path= style with WORKSPACE env.=0D - EdkLogger.quiet("%-16s =3D %s" % ("PACKAGES_PATH", os.path.nor= mcase(os.path.normpath(os.environ["PACKAGES_PATH"]))))=0D - EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_PATH", os.environ["ED= K_TOOLS_PATH"]))=0D + EdkLogger.quiet("%-16s =3D %s" % ("PACKAGES_PATH",=0D + os.path.normcase(os.path.normpath(os.environ["= PACKAGES_PATH"]))))=0D + EdkLogger.quiet("%-16s =3D %s" %=0D + ("EDK_TOOLS_PATH", os.environ["EDK_TOOLS_PATH"]))= =0D if "EDK_TOOLS_BIN" in os.environ:=0D # Print the same path style with WORKSPACE env.=0D - EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_BIN", os.path.nor= mcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"]))))=0D - EdkLogger.quiet("%-16s =3D %s" % ("CONF_PATH", GlobalData.gConfDir= ectory))=0D + EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_BIN",=0D + os.path.normcase(os.path.normpath(os.environ["= EDK_TOOLS_BIN"]))))=0D + EdkLogger.quiet("%-16s =3D %s" %=0D + ("CONF_PATH", GlobalData.gConfDirectory))=0D if "PYTHON3_ENABLE" in os.environ:=0D PYTHON3_ENABLE =3D os.environ["PYTHON3_ENABLE"]=0D if PYTHON3_ENABLE !=3D "TRUE":=0D PYTHON3_ENABLE =3D "FALSE"=0D EdkLogger.quiet("%-16s =3D %s" % ("PYTHON3_ENABLE", PYTHON3_EN= ABLE))=0D if "PYTHON_COMMAND" in os.environ:=0D - EdkLogger.quiet("%-16s =3D %s" % ("PYTHON_COMMAND", os.environ= ["PYTHON_COMMAND"]))=0D + EdkLogger.quiet("%-16s =3D %s" %=0D + ("PYTHON_COMMAND", os.environ["PYTHON_COMMAND"= ]))=0D self.InitPreBuild()=0D self.InitPostBuild()=0D if self.Prebuild:=0D @@ -821,7 +881,8 @@ class Build(): if self.Prebuild:=0D self.LaunchPrebuild()=0D TargetObj =3D TargetTxtDict()=0D - ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSPACE"= ), "Conf")))=0D + ToolDefObj =3D ToolDefDict(=0D + (os.path.join(os.getenv("WORKSPACE"), "Conf")))=0D self.TargetTxt =3D TargetObj.Target=0D self.ToolDef =3D ToolDefObj.ToolDef=0D if not (self.LaunchPrebuildFlag and os.path.exists(self.PlatformBu= ildPath)):=0D @@ -831,7 +892,7 @@ class Build(): EdkLogger.info("")=0D os.chdir(self.WorkspaceDir)=0D self.log_q =3D log_q=0D - GlobalData.file_lock =3D mp.Lock()=0D + GlobalData.file_lock =3D mp.Lock()=0D # Init cache data for local only=0D GlobalData.gPackageHashFile =3D dict()=0D GlobalData.gModulePreMakeCacheStatus =3D dict()=0D @@ -843,18 +904,20 @@ class Build(): GlobalData.gModuleAllCacheStatus =3D set()=0D GlobalData.gModuleCacheHit =3D set()=0D =0D - def StartAutoGen(self,mqueue, DataPipe,SkipAutoGen,PcdMaList,cqueue):= =0D + def StartAutoGen(self, mqueue, DataPipe, SkipAutoGen, PcdMaList, cqueu= e):=0D try:=0D if SkipAutoGen:=0D - return True,0=0D + return True, 0=0D feedback_q =3D mp.Queue()=0D error_event =3D mp.Event()=0D FfsCmd =3D DataPipe.Get("FfsCommand")=0D if FfsCmd is None:=0D FfsCmd =3D {}=0D GlobalData.FfsCmd =3D FfsCmd=0D - auto_workers =3D [AutoGenWorkerInProcess(mqueue,DataPipe.dump_= file,feedback_q,GlobalData.file_lock,cqueue,self.log_q,error_event) for _ i= n range(self.ThreadNumber)]=0D - self.AutoGenMgr =3D AutoGenManager(auto_workers,feedback_q,err= or_event)=0D + auto_workers =3D [AutoGenWorkerInProcess(=0D + mqueue, DataPipe.dump_file, feedback_q, GlobalData.file_lo= ck, cqueue, self.log_q, error_event) for _ in range(self.ThreadNumber)]=0D + self.AutoGenMgr =3D AutoGenManager(=0D + auto_workers, feedback_q, error_event)=0D self.AutoGenMgr.start()=0D for w in auto_workers:=0D w.start()=0D @@ -866,14 +929,17 @@ class Build(): RetVal =3D PcdMa.SourceFileList=0D # Force cache miss for PCD driver=0D if GlobalData.gUseHashCache and not GlobalData.gBinCac= heDest and self.Target in [None, "", "all"]:=0D - cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "PreM= akeCache", False))=0D + cqueue.put(=0D + (PcdMa.MetaFile.Path, PcdMa.Arch, "PreMakeCach= e", False))=0D =0D PcdMa.CreateCodeFile(False)=0D - PcdMa.CreateMakeFile(False,GenFfsList =3D DataPipe.Get= ("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[]))=0D + PcdMa.CreateMakeFile(False, GenFfsList=3DDataPipe.Get(= =0D + "FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch= ), []))=0D PcdMa.CreateAsBuiltInf()=0D # Force cache miss for PCD driver=0D if GlobalData.gBinCacheSource and self.Target in [None= , "", "all"]:=0D - cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "Make= Cache", False))=0D + cqueue.put(=0D + (PcdMa.MetaFile.Path, PcdMa.Arch, "MakeCache",= False))=0D =0D self.AutoGenMgr.join()=0D rt =3D self.AutoGenMgr.Status=0D @@ -886,50 +952,56 @@ class Build(): except:=0D return False, UNKNOWN_ERROR=0D =0D - ## Add TOOLCHAIN and FAMILY declared in DSC [BuildOptions] to ToolsDef= TxtDatabase.=0D + # Add TOOLCHAIN and FAMILY declared in DSC [BuildOptions] to ToolsDefT= xtDatabase.=0D #=0D # Loop through the set of build targets, tool chains, and archs provid= ed on either=0D # the command line or in target.txt to discover FAMILY and TOOLCHAIN d= elclarations=0D # in [BuildOptions] sections that may be within !if expressions that m= ay use=0D # $(TARGET), $(TOOLCHAIN), $(TOOLCHAIN_TAG), or $(ARCH) operands.=0D #=0D - def GetToolChainAndFamilyFromDsc (self, File):=0D + def GetToolChainAndFamilyFromDsc(self, File):=0D SavedGlobalDefines =3D GlobalData.gGlobalDefines.copy()=0D for BuildTarget in self.BuildTargetList:=0D GlobalData.gGlobalDefines['TARGET'] =3D BuildTarget=0D for BuildToolChain in self.ToolChainList:=0D - GlobalData.gGlobalDefines['TOOLCHAIN'] =3D BuildToolC= hain=0D + GlobalData.gGlobalDefines['TOOLCHAIN'] =3D BuildToolChain= =0D GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] =3D BuildToolC= hain=0D for BuildArch in self.ArchList:=0D GlobalData.gGlobalDefines['ARCH'] =3D BuildArch=0D dscobj =3D self.BuildDatabase[File, BuildArch]=0D for KeyFamily, Key, KeyCodeBase in dscobj.BuildOptions= :=0D try:=0D - Target, ToolChain, Arch, Tool, Attr =3D Key.sp= lit('_')=0D + Target, ToolChain, Arch, Tool, Attr =3D Key.sp= lit(=0D + '_')=0D except:=0D continue=0D if ToolChain =3D=3D TAB_STAR or Attr !=3D TAB_TOD_= DEFINES_FAMILY:=0D continue=0D try:=0D - Family =3D dscobj.BuildOptions[(KeyFamily, Key= , KeyCodeBase)]=0D + Family =3D dscobj.BuildOptions[(=0D + KeyFamily, Key, KeyCodeBase)]=0D Family =3D Family.strip().strip('=3D').strip()= =0D except:=0D continue=0D if TAB_TOD_DEFINES_FAMILY not in self.ToolDef.Tool= sDefTxtDatabase:=0D - self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_FAMILY] =3D {}=0D + self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_FAMILY] =3D {=0D + }=0D if ToolChain not in self.ToolDef.ToolsDefTxtDataba= se[TAB_TOD_DEFINES_FAMILY]:=0D self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_FAMILY][ToolChain] =3D Family=0D if TAB_TOD_DEFINES_BUILDRULEFAMILY not in self.Too= lDef.ToolsDefTxtDatabase:=0D - self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_BUILDRULEFAMILY] =3D {}=0D + self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_BUILDRULEFAMILY] =3D {=0D + }=0D if ToolChain not in self.ToolDef.ToolsDefTxtDataba= se[TAB_TOD_DEFINES_BUILDRULEFAMILY]:=0D self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_BUILDRULEFAMILY][ToolChain] =3D Family=0D if TAB_TOD_DEFINES_TOOL_CHAIN_TAG not in self.Tool= Def.ToolsDefTxtDatabase:=0D - self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_TOOL_CHAIN_TAG] =3D []=0D + self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_TOOL_CHAIN_TAG] =3D [=0D + ]=0D if ToolChain not in self.ToolDef.ToolsDefTxtDataba= se[TAB_TOD_DEFINES_TOOL_CHAIN_TAG]:=0D - self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_TOOL_CHAIN_TAG].append(ToolChain)=0D + self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_DEFIN= ES_TOOL_CHAIN_TAG].append(=0D + ToolChain)=0D GlobalData.gGlobalDefines =3D SavedGlobalDefines=0D =0D - ## Load configuration=0D + # Load configuration=0D #=0D # This method will parse target.txt and get the build configurations= .=0D #=0D @@ -948,14 +1020,16 @@ class Build(): if not self.ToolChainList:=0D self.ToolChainList =3D self.TargetTxt.TargetTxtDictionary[TAB_= TAT_DEFINES_TOOL_CHAIN_TAG]=0D if self.ToolChainList is None or len(self.ToolChainList) =3D= =3D 0:=0D - EdkLogger.error("build", RESOURCE_NOT_AVAILABLE, ExtraData= =3D"No toolchain given. Don't know how to build.\n")=0D + EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,=0D + ExtraData=3D"No toolchain given. Don't kno= w how to build.\n")=0D =0D if not self.PlatformFile:=0D PlatformFile =3D self.TargetTxt.TargetTxtDictionary[TAB_TAT_DE= FINES_ACTIVE_PLATFORM]=0D if not PlatformFile:=0D # Try to find one in current directory=0D WorkingDirectory =3D os.getcwd()=0D - FileList =3D glob.glob(os.path.normpath(os.path.join(Worki= ngDirectory, '*.dsc')))=0D + FileList =3D glob.glob(os.path.normpath(=0D + os.path.join(WorkingDirectory, '*.dsc')))=0D FileNum =3D len(FileList)=0D if FileNum >=3D 2:=0D EdkLogger.error("build", OPTION_MISSING,=0D @@ -966,15 +1040,17 @@ class Build(): EdkLogger.error("build", RESOURCE_NOT_AVAILABLE,=0D ExtraData=3D"No active platform specif= ied in target.txt or command line! Nothing can be built.\n")=0D =0D - self.PlatformFile =3D PathClass(NormFile(PlatformFile, self.Wo= rkspaceDir), self.WorkspaceDir)=0D + self.PlatformFile =3D PathClass(=0D + NormFile(PlatformFile, self.WorkspaceDir), self.WorkspaceD= ir)=0D =0D - self.GetToolChainAndFamilyFromDsc (self.PlatformFile)=0D + self.GetToolChainAndFamilyFromDsc(self.PlatformFile)=0D =0D # check if the tool chains are defined or not=0D NewToolChainList =3D []=0D for ToolChain in self.ToolChainList:=0D if ToolChain not in self.ToolDef.ToolsDefTxtDatabase[TAB_TOD_D= EFINES_TOOL_CHAIN_TAG]:=0D - EdkLogger.warn("build", "Tool chain [%s] is not defined" %= ToolChain)=0D + EdkLogger.warn(=0D + "build", "Tool chain [%s] is not defined" % ToolChain)= =0D else:=0D NewToolChainList.append(ToolChain)=0D # if no tool chain available, break the build=0D @@ -989,18 +1065,21 @@ class Build(): for Tool in self.ToolChainList:=0D if TAB_TOD_DEFINES_FAMILY not in ToolDefinition or Tool not in= ToolDefinition[TAB_TOD_DEFINES_FAMILY] \=0D or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool]:=0D - EdkLogger.warn("build", "No tool chain family found in con= figuration for %s. Default to MSFT." % Tool)=0D + EdkLogger.warn(=0D + "build", "No tool chain family found in configuration = for %s. Default to MSFT." % Tool)=0D ToolChainFamily.append(TAB_COMPILER_MSFT)=0D else:=0D - ToolChainFamily.append(ToolDefinition[TAB_TOD_DEFINES_FAMI= LY][Tool])=0D + ToolChainFamily.append(=0D + ToolDefinition[TAB_TOD_DEFINES_FAMILY][Tool])=0D self.ToolChainFamily =3D ToolChainFamily=0D =0D - self.ThreadNumber =3D ThreadNum()=0D - ## Initialize build configuration=0D + self.ThreadNumber =3D ThreadNum()=0D + # Initialize build configuration=0D #=0D # This method will parse DSC file and merge the configurations from= =0D # command line and target.txt, then get the final build configuratio= ns.=0D #=0D +=0D def InitBuild(self):=0D # parse target.txt, tools_def.txt, and platform file=0D self.LoadConfiguration()=0D @@ -1010,7 +1089,6 @@ class Build(): if ErrorCode !=3D 0:=0D EdkLogger.error("build", ErrorCode, ExtraData=3DErrorInfo)=0D =0D -=0D def InitPreBuild(self):=0D self.LoadConfiguration()=0D ErrorCode, ErrorInfo =3D self.PlatformFile.Validate(".dsc", False)= =0D @@ -1026,7 +1104,7 @@ class Build(): if self.ToolChainFamily:=0D GlobalData.gGlobalDefines['FAMILY'] =3D self.ToolChainFamily[0= ]=0D if 'PREBUILD' in GlobalData.gCommandLineDefines:=0D - self.Prebuild =3D GlobalData.gCommandLineDefines.get('PREBUI= LD')=0D + self.Prebuild =3D GlobalData.gCommandLineDefines.get('PREBUILD= ')=0D else:=0D self.Db_Flag =3D True=0D Platform =3D self.Db.MapPlatform(str(self.PlatformFile))=0D @@ -1043,7 +1121,7 @@ class Build(): #=0D # Do not modify Arg if it looks like a flag or an absolute= file path=0D #=0D - if Arg.startswith('-') or os.path.isabs(Arg):=0D + if Arg.startswith('-') or os.path.isabs(Arg):=0D PrebuildList.append(Arg)=0D continue=0D #=0D @@ -1061,8 +1139,9 @@ class Build(): if os.path.isfile(Temp):=0D Arg =3D Temp=0D PrebuildList.append(Arg)=0D - self.Prebuild =3D ' '.join(PrebuildList)=0D - self.Prebuild +=3D self.PassCommandOption(self.BuildTargetList= , self.ArchList, self.ToolChainList, self.PlatformFile, self.Target)=0D + self.Prebuild =3D ' '.join(PrebuildList)=0D + self.Prebuild +=3D self.PassCommandOption(=0D + self.BuildTargetList, self.ArchList, self.ToolChainList, s= elf.PlatformFile, self.Target)=0D =0D def InitPostBuild(self):=0D if 'POSTBUILD' in GlobalData.gCommandLineDefines:=0D @@ -1082,7 +1161,7 @@ class Build(): #=0D # Do not modify Arg if it looks like a flag or an absolute= file path=0D #=0D - if Arg.startswith('-') or os.path.isabs(Arg):=0D + if Arg.startswith('-') or os.path.isabs(Arg):=0D PostbuildList.append(Arg)=0D continue=0D #=0D @@ -1100,8 +1179,9 @@ class Build(): if os.path.isfile(Temp):=0D Arg =3D Temp=0D PostbuildList.append(Arg)=0D - self.Postbuild =3D ' '.join(PostbuildList)=0D - self.Postbuild +=3D self.PassCommandOption(self.BuildTargetLis= t, self.ArchList, self.ToolChainList, self.PlatformFile, self.Target)=0D + self.Postbuild =3D ' '.join(PostbuildList)=0D + self.Postbuild +=3D self.PassCommandOption(=0D + self.BuildTargetList, self.ArchList, self.ToolChainList, s= elf.PlatformFile, self.Target)=0D =0D def PassCommandOption(self, BuildTarget, TargetArch, ToolChain, Platfo= rmFile, Target):=0D BuildStr =3D ''=0D @@ -1156,7 +1236,8 @@ class Build(): # and preserve them for the rest of the main build step, becau= se the child process environment will=0D # evaporate as soon as it exits, we cannot get it in build ste= p.=0D #=0D - PrebuildEnvFile =3D os.path.join(GlobalData.gConfDirectory, '.= cache', '.PrebuildEnv')=0D + PrebuildEnvFile =3D os.path.join(=0D + GlobalData.gConfDirectory, '.cache', '.PrebuildEnv')=0D if os.path.isfile(PrebuildEnvFile):=0D os.remove(PrebuildEnvFile)=0D if os.path.isfile(self.PlatformBuildPath):=0D @@ -1172,13 +1253,15 @@ class Build(): EndOfProcedure =3D Event()=0D EndOfProcedure.clear()=0D if Process.stdout:=0D - StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stdout, EdkLogger.info, EndOfProcedure))=0D + StdOutThread =3D Thread(target=3DReadMessage, args=3D(=0D + Process.stdout, EdkLogger.info, EndOfProcedure))=0D StdOutThread.name =3D "STDOUT-Redirector"=0D StdOutThread.daemon =3D False=0D StdOutThread.start()=0D =0D if Process.stderr:=0D - StdErrThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stderr, EdkLogger.quiet, EndOfProcedure))=0D + StdErrThread =3D Thread(target=3DReadMessage, args=3D(=0D + Process.stderr, EdkLogger.quiet, EndOfProcedure))=0D StdErrThread.name =3D "STDERR-Redirector"=0D StdErrThread.daemon =3D False=0D StdErrThread.start()=0D @@ -1189,15 +1272,17 @@ class Build(): StdOutThread.join()=0D if Process.stderr:=0D StdErrThread.join()=0D - if Process.returncode !=3D 0 :=0D - EdkLogger.error("Prebuild", PREBUILD_ERROR, 'Prebuild proc= ess is not success!')=0D + if Process.returncode !=3D 0:=0D + EdkLogger.error("Prebuild", PREBUILD_ERROR,=0D + 'Prebuild process is not success!')=0D =0D if os.path.exists(PrebuildEnvFile):=0D f =3D open(PrebuildEnvFile)=0D envs =3D f.readlines()=0D f.close()=0D - envs =3D [l.split("=3D", 1) for l in envs ]=0D - envs =3D [[I.strip() for I in item] for item in envs if le= n(item) =3D=3D 2]=0D + envs =3D [l.split("=3D", 1) for l in envs]=0D + envs =3D [[I.strip() for I in item]=0D + for item in envs if len(item) =3D=3D 2]=0D os.environ.update(dict(envs))=0D EdkLogger.info("\n- Prebuild Done -\n")=0D =0D @@ -1205,20 +1290,24 @@ class Build(): if self.Postbuild:=0D EdkLogger.info("\n- Postbuild Start -\n")=0D if sys.platform =3D=3D "win32":=0D - Process =3D Popen(self.Postbuild, stdout=3DPIPE, stderr=3D= PIPE, shell=3DTrue)=0D + Process =3D Popen(self.Postbuild, stdout=3DPIPE,=0D + stderr=3DPIPE, shell=3DTrue)=0D else:=0D - Process =3D Popen(self.Postbuild, stdout=3DPIPE, stderr=3D= PIPE, shell=3DTrue)=0D + Process =3D Popen(self.Postbuild, stdout=3DPIPE,=0D + stderr=3DPIPE, shell=3DTrue)=0D # launch two threads to read the STDOUT and STDERR=0D EndOfProcedure =3D Event()=0D EndOfProcedure.clear()=0D if Process.stdout:=0D - StdOutThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stdout, EdkLogger.info, EndOfProcedure))=0D + StdOutThread =3D Thread(target=3DReadMessage, args=3D(=0D + Process.stdout, EdkLogger.info, EndOfProcedure))=0D StdOutThread.name =3D "STDOUT-Redirector"=0D StdOutThread.daemon =3D False=0D StdOutThread.start()=0D =0D if Process.stderr:=0D - StdErrThread =3D Thread(target=3DReadMessage, args=3D(Proc= ess.stderr, EdkLogger.quiet, EndOfProcedure))=0D + StdErrThread =3D Thread(target=3DReadMessage, args=3D(=0D + Process.stderr, EdkLogger.quiet, EndOfProcedure))=0D StdErrThread.name =3D "STDERR-Redirector"=0D StdErrThread.daemon =3D False=0D StdErrThread.start()=0D @@ -1229,11 +1318,12 @@ class Build(): StdOutThread.join()=0D if Process.stderr:=0D StdErrThread.join()=0D - if Process.returncode !=3D 0 :=0D - EdkLogger.error("Postbuild", POSTBUILD_ERROR, 'Postbuild p= rocess is not success!')=0D + if Process.returncode !=3D 0:=0D + EdkLogger.error("Postbuild", POSTBUILD_ERROR,=0D + 'Postbuild process is not success!')=0D EdkLogger.info("\n- Postbuild Done -\n")=0D =0D - ## Build a module or platform=0D + # Build a module or platform=0D #=0D # Create autogen code and makefile for a module or platform, and the l= aunch=0D # "make" command to build it=0D @@ -1260,21 +1350,30 @@ class Build(): mqueue =3D mp.Queue()=0D for m in AutoGenObject.GetAllModuleInfo:=0D mqueue.put(m)=0D - mqueue.put((None,None,None,None,None,None,None))=0D - AutoGenObject.DataPipe.DataContainer =3D {"CommandTarget": sel= f.Target}=0D - AutoGenObject.DataPipe.DataContainer =3D {"Workspace_timestamp= ": AutoGenObject.Workspace._SrcTimeStamp}=0D + mqueue.put((None, None, None, None, None, None, None))=0D + AutoGenObject.DataPipe.DataContainer =3D {=0D + "CommandTarget": self.Target}=0D + AutoGenObject.DataPipe.DataContainer =3D {=0D + "Workspace_timestamp": AutoGenObject.Workspace._SrcTimeSta= mp}=0D AutoGenObject.CreateLibModuelDirs()=0D - AutoGenObject.DataPipe.DataContainer =3D {"LibraryBuildDirecto= ryList":AutoGenObject.LibraryBuildDirectoryList}=0D - AutoGenObject.DataPipe.DataContainer =3D {"ModuleBuildDirector= yList":AutoGenObject.ModuleBuildDirectoryList}=0D - AutoGenObject.DataPipe.DataContainer =3D {"FdsCommandDict": Au= toGenObject.Workspace.GenFdsCommandDict}=0D + AutoGenObject.DataPipe.DataContainer =3D {=0D + "LibraryBuildDirectoryList": AutoGenObject.LibraryBuildDir= ectoryList}=0D + AutoGenObject.DataPipe.DataContainer =3D {=0D + "ModuleBuildDirectoryList": AutoGenObject.ModuleBuildDirec= toryList}=0D + AutoGenObject.DataPipe.DataContainer =3D {=0D + "FdsCommandDict": AutoGenObject.Workspace.GenFdsCommandDic= t}=0D self.Progress.Start("Generating makefile and code")=0D - data_pipe_file =3D os.path.join(AutoGenObject.BuildDir, "Globa= lVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch))=0D + data_pipe_file =3D os.path.join(AutoGenObject.BuildDir, "Globa= lVar_%s_%s.bin" % (=0D + str(AutoGenObject.Guid), AutoGenObject.Arch))=0D AutoGenObject.DataPipe.dump(data_pipe_file)=0D cqueue =3D mp.Queue()=0D - autogen_rt,errorcode =3D self.StartAutoGen(mqueue, AutoGenObje= ct.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)=0D - AutoGenIdFile =3D os.path.join(GlobalData.gConfDirectory,".Aut= oGenIdFile.txt")=0D - with open(AutoGenIdFile,"w") as fw:=0D - fw.write("Arch=3D%s\n" % "|".join((AutoGenObject.Workspace= .ArchList)))=0D + autogen_rt, errorcode =3D self.StartAutoGen(=0D + mqueue, AutoGenObject.DataPipe, self.SkipAutoGen, PcdMaLis= t, cqueue)=0D + AutoGenIdFile =3D os.path.join(=0D + GlobalData.gConfDirectory, ".AutoGenIdFile.txt")=0D + with open(AutoGenIdFile, "w") as fw:=0D + fw.write("Arch=3D%s\n" % "|".join(=0D + (AutoGenObject.Workspace.ArchList)))=0D fw.write("BuildDir=3D%s\n" % AutoGenObject.Workspace.Build= Dir)=0D fw.write("PlatformGuid=3D%s\n" % str(AutoGenObject.Guid))= =0D self.Progress.Stop("done!")=0D @@ -1297,7 +1396,8 @@ class Build(): EdkLogger.error("build", OPTION_MISSING,=0D "No build command found for this module. "=0D "Please check your setting of %s_%s_%s_MAKE_PA= TH in Conf/tools_def.txt file." %=0D - (AutoGenObject.BuildTarget, AutoGenObject.= ToolChain, AutoGenObject.Arch),=0D + (AutoGenObject.BuildTarget,=0D + AutoGenObject.ToolChain, AutoGenObject.Arch),= =0D ExtraData=3Dstr(AutoGenObject))=0D =0D # run=0D @@ -1325,10 +1425,14 @@ class Build(): DirList =3D []=0D for Lib in AutoGenObject.LibraryAutoGenList:=0D if not Lib.IsBinaryModule:=0D - DirList.append((os.path.join(AutoGenObject.BuildDir, L= ib.BuildDir),Lib))=0D + DirList.append(=0D + (os.path.join(AutoGenObject.BuildDir, Lib.BuildDir= ), Lib))=0D for Lib, LibAutoGen in DirList:=0D - NewBuildCommand =3D BuildCommand + ['-f', os.path.normpath= (os.path.join(Lib, self.MakeFileName)), 'pbuild']=0D - LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,L= ibAutoGen)=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', os.path.normpath(os.path.join(Lib,=0D + self.MakeFileName)), 'pbuild']= =0D + LaunchCommand(NewBuildCommand,=0D + AutoGenObject.MakeFileDir, LibAutoGen)=0D return True=0D =0D # build module=0D @@ -1336,18 +1440,26 @@ class Build(): DirList =3D []=0D for Lib in AutoGenObject.LibraryAutoGenList:=0D if not Lib.IsBinaryModule:=0D - DirList.append((os.path.join(AutoGenObject.BuildDir, L= ib.BuildDir),Lib))=0D + DirList.append(=0D + (os.path.join(AutoGenObject.BuildDir, Lib.BuildDir= ), Lib))=0D for Lib, LibAutoGen in DirList:=0D - NewBuildCommand =3D BuildCommand + ['-f', os.path.normpath= (os.path.join(Lib, self.MakeFileName)), 'pbuild']=0D - LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,L= ibAutoGen)=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', os.path.normpath(os.path.join(Lib,=0D + self.MakeFileName)), 'pbuild']= =0D + LaunchCommand(NewBuildCommand,=0D + AutoGenObject.MakeFileDir, LibAutoGen)=0D =0D DirList =3D []=0D for ModuleAutoGen in AutoGenObject.ModuleAutoGenList:=0D if not ModuleAutoGen.IsBinaryModule:=0D - DirList.append((os.path.join(AutoGenObject.BuildDir, M= oduleAutoGen.BuildDir),ModuleAutoGen))=0D - for Mod,ModAutoGen in DirList:=0D - NewBuildCommand =3D BuildCommand + ['-f', os.path.normpath= (os.path.join(Mod, self.MakeFileName)), 'pbuild']=0D - LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,M= odAutoGen)=0D + DirList.append(=0D + (os.path.join(AutoGenObject.BuildDir, ModuleAutoGe= n.BuildDir), ModuleAutoGen))=0D + for Mod, ModAutoGen in DirList:=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', os.path.normpath(os.path.join(Mod,=0D + self.MakeFileName)), 'pbuild']= =0D + LaunchCommand(NewBuildCommand,=0D + AutoGenObject.MakeFileDir, ModAutoGen)=0D self.CreateAsBuiltInf()=0D if GlobalData.gBinCacheDest:=0D self.GenDestCache()=0D @@ -1361,36 +1473,42 @@ class Build(): # cleanlib=0D if Target =3D=3D 'cleanlib':=0D for Lib in AutoGenObject.LibraryBuildDirectoryList:=0D - LibMakefile =3D os.path.normpath(os.path.join(Lib, self.Ma= keFileName))=0D + LibMakefile =3D os.path.normpath(=0D + os.path.join(Lib, self.MakeFileName))=0D if os.path.exists(LibMakefile):=0D - NewBuildCommand =3D BuildCommand + ['-f', LibMakefile,= 'cleanall']=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', LibMakefile, 'cleanall']=0D LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileD= ir)=0D return True=0D =0D # clean=0D if Target =3D=3D 'clean':=0D for Mod in AutoGenObject.ModuleBuildDirectoryList:=0D - ModMakefile =3D os.path.normpath(os.path.join(Mod, self.Ma= keFileName))=0D + ModMakefile =3D os.path.normpath(=0D + os.path.join(Mod, self.MakeFileName))=0D if os.path.exists(ModMakefile):=0D - NewBuildCommand =3D BuildCommand + ['-f', ModMakefile,= 'cleanall']=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', ModMakefile, 'cleanall']=0D LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileD= ir)=0D for Lib in AutoGenObject.LibraryBuildDirectoryList:=0D - LibMakefile =3D os.path.normpath(os.path.join(Lib, self.Ma= keFileName))=0D + LibMakefile =3D os.path.normpath(=0D + os.path.join(Lib, self.MakeFileName))=0D if os.path.exists(LibMakefile):=0D - NewBuildCommand =3D BuildCommand + ['-f', LibMakefile,= 'cleanall']=0D + NewBuildCommand =3D BuildCommand + \=0D + ['-f', LibMakefile, 'cleanall']=0D LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileD= ir)=0D return True=0D =0D # cleanall=0D if Target =3D=3D 'cleanall':=0D try:=0D - #os.rmdir(AutoGenObject.BuildDir)=0D + # os.rmdir(AutoGenObject.BuildDir)=0D RemoveDirectory(AutoGenObject.BuildDir, True)=0D except WindowsError as X:=0D EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=3D= str(X))=0D return True=0D =0D - ## Build a module or platform=0D + # Build a module or platform=0D #=0D # Create autogen code and makefile for a module or platform, and the l= aunch=0D # "make" command to build it=0D @@ -1423,7 +1541,7 @@ class Build(): if not self.SkipAutoGen or Target =3D=3D 'genmake':=0D self.Progress.Start("Generating makefile")=0D AutoGenObject.CreateMakeFile(CreateDepsMakeFile)=0D - #AutoGenObject.CreateAsBuiltInf()=0D + # AutoGenObject.CreateAsBuiltInf()=0D self.Progress.Stop("done!")=0D if Target =3D=3D "genmake":=0D return True=0D @@ -1440,14 +1558,16 @@ class Build(): EdkLogger.error("build", OPTION_MISSING,=0D "No build command found for this module. "=0D "Please check your setting of %s_%s_%s_MAKE_PA= TH in Conf/tools_def.txt file." %=0D - (AutoGenObject.BuildTarget, AutoGenObject.= ToolChain, AutoGenObject.Arch),=0D + (AutoGenObject.BuildTarget,=0D + AutoGenObject.ToolChain, AutoGenObject.Arch),= =0D ExtraData=3Dstr(AutoGenObject))=0D =0D # build modules=0D if BuildModule:=0D if Target !=3D 'fds':=0D BuildCommand =3D BuildCommand + [Target]=0D - AutoGenObject.BuildTime =3D LaunchCommand(BuildCommand, AutoGe= nObject.MakeFileDir)=0D + AutoGenObject.BuildTime =3D LaunchCommand(=0D + BuildCommand, AutoGenObject.MakeFileDir)=0D self.CreateAsBuiltInf()=0D if GlobalData.gBinCacheDest:=0D self.GenDestCache()=0D @@ -1477,42 +1597,46 @@ class Build(): =0D # not build modules=0D =0D -=0D # cleanall=0D if Target =3D=3D 'cleanall':=0D try:=0D - #os.rmdir(AutoGenObject.BuildDir)=0D + # os.rmdir(AutoGenObject.BuildDir)=0D RemoveDirectory(AutoGenObject.BuildDir, True)=0D except WindowsError as X:=0D EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=3D= str(X))=0D return True=0D =0D - ## Rebase module image and Get function address for the input module l= ist.=0D + # Rebase module image and Get function address for the input module li= st.=0D #=0D - def _RebaseModule (self, MapBuffer, BaseAddress, ModuleList, AddrIsOff= set =3D True, ModeIsSmm =3D False):=0D + def _RebaseModule(self, MapBuffer, BaseAddress, ModuleList, AddrIsOffs= et=3DTrue, ModeIsSmm=3DFalse):=0D if ModeIsSmm:=0D AddrIsOffset =3D False=0D for InfFile in ModuleList:=0D - sys.stdout.write (".")=0D + sys.stdout.write(".")=0D sys.stdout.flush()=0D ModuleInfo =3D ModuleList[InfFile]=0D ModuleName =3D ModuleInfo.BaseName=0D ModuleOutputImage =3D ModuleInfo.Image.FileName=0D - ModuleDebugImage =3D os.path.join(ModuleInfo.DebugDir, Module= Info.BaseName + '.efi')=0D - ## for SMM module in SMRAM, the SMRAM will be allocated from b= ase to top.=0D + ModuleDebugImage =3D os.path.join(=0D + ModuleInfo.DebugDir, ModuleInfo.BaseName + '.efi')=0D + # for SMM module in SMRAM, the SMRAM will be allocated from ba= se to top.=0D if not ModeIsSmm:=0D BaseAddress =3D BaseAddress - ModuleInfo.Image.Size=0D #=0D # Update Image to new BaseAddress by GenFw tool=0D #=0D - LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r"= , ModuleOutputImage], ModuleInfo.OutputDir)=0D - LaunchCommand(["GenFw", "--rebase", str(BaseAddress), "-r"= , ModuleDebugImage], ModuleInfo.DebugDir)=0D + LaunchCommand(["GenFw", "--rebase", str(BaseAddress),=0D + "-r", ModuleOutputImage], ModuleInfo.OutputD= ir)=0D + LaunchCommand(["GenFw", "--rebase", str(BaseAddress),=0D + "-r", ModuleDebugImage], ModuleInfo.DebugDir= )=0D else:=0D #=0D # Set new address to the section header only for SMM drive= r.=0D #=0D - LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r= ", ModuleOutputImage], ModuleInfo.OutputDir)=0D - LaunchCommand(["GenFw", "--address", str(BaseAddress), "-r= ", ModuleDebugImage], ModuleInfo.DebugDir)=0D + LaunchCommand(["GenFw", "--address", str(BaseAddress),=0D + "-r", ModuleOutputImage], ModuleInfo.OutputD= ir)=0D + LaunchCommand(["GenFw", "--address", str(BaseAddress),=0D + "-r", ModuleDebugImage], ModuleInfo.DebugDir= )=0D #=0D # Collect function address from Map file=0D #=0D @@ -1522,32 +1646,37 @@ class Build(): OrigImageBaseAddress =3D 0=0D ImageMap =3D open(ImageMapTable, 'r')=0D for LinStr in ImageMap:=0D - if len (LinStr.strip()) =3D=3D 0:=0D + if len(LinStr.strip()) =3D=3D 0:=0D continue=0D #=0D # Get the preferred address set on link time.=0D #=0D - if LinStr.find ('Preferred load address is') !=3D -1:= =0D + if LinStr.find('Preferred load address is') !=3D -1:=0D StrList =3D LinStr.split()=0D - OrigImageBaseAddress =3D int (StrList[len(StrList)= - 1], 16)=0D + OrigImageBaseAddress =3D int(=0D + StrList[len(StrList) - 1], 16)=0D =0D StrList =3D LinStr.split()=0D - if len (StrList) > 4:=0D + if len(StrList) > 4:=0D if StrList[3] =3D=3D 'f' or StrList[3] =3D=3D 'F':= =0D Name =3D StrList[1]=0D - RelativeAddress =3D int (StrList[2], 16) - Ori= gImageBaseAddress=0D - FunctionList.append ((Name, RelativeAddress))= =0D + RelativeAddress =3D int(=0D + StrList[2], 16) - OrigImageBaseAddress=0D + FunctionList.append((Name, RelativeAddress))=0D =0D ImageMap.close()=0D #=0D # Add general information.=0D #=0D if ModeIsSmm:=0D - MapBuffer.append('\n\n%s (Fixed SMRAM Offset, BaseAddres= s=3D0x%010X, EntryPoint=3D0x%010X)\n' % (ModuleName, BaseAddress, BaseAddr= ess + ModuleInfo.Image.EntryPoint))=0D + MapBuffer.append('\n\n%s (Fixed SMRAM Offset, BaseAddres= s=3D0x%010X, EntryPoint=3D0x%010X)\n' % (=0D + ModuleName, BaseAddress, BaseAddress + ModuleInfo.Imag= e.EntryPoint))=0D elif AddrIsOffset:=0D - MapBuffer.append('\n\n%s (Fixed Memory Offset, BaseAddres= s=3D-0x%010X, EntryPoint=3D-0x%010X)\n' % (ModuleName, 0 - BaseAddress, 0 -= (BaseAddress + ModuleInfo.Image.EntryPoint)))=0D + MapBuffer.append('\n\n%s (Fixed Memory Offset, BaseAddres= s=3D-0x%010X, EntryPoint=3D-0x%010X)\n' %=0D + (ModuleName, 0 - BaseAddress, 0 - (BaseAd= dress + ModuleInfo.Image.EntryPoint)))=0D else:=0D - MapBuffer.append('\n\n%s (Fixed Memory Address, BaseAddres= s=3D0x%010X, EntryPoint=3D0x%010X)\n' % (ModuleName, BaseAddress, BaseAddr= ess + ModuleInfo.Image.EntryPoint))=0D + MapBuffer.append('\n\n%s (Fixed Memory Address, BaseAddres= s=3D0x%010X, EntryPoint=3D0x%010X)\n' % (=0D + ModuleName, BaseAddress, BaseAddress + ModuleInfo.Imag= e.EntryPoint))=0D #=0D # Add guid and general seciton section.=0D #=0D @@ -1559,9 +1688,11 @@ class Build(): elif SectionHeader[0] in ['.data', '.sdata']:=0D DataSectionAddress =3D SectionHeader[1]=0D if AddrIsOffset:=0D - MapBuffer.append('(GUID=3D%s, .textbaseaddress=3D-0x%010X,= .databaseaddress=3D-0x%010X)\n' % (ModuleInfo.Guid, 0 - (BaseAddress + Tex= tSectionAddress), 0 - (BaseAddress + DataSectionAddress)))=0D + MapBuffer.append('(GUID=3D%s, .textbaseaddress=3D-0x%010X,= .databaseaddress=3D-0x%010X)\n' % (=0D + ModuleInfo.Guid, 0 - (BaseAddress + TextSectionAddress= ), 0 - (BaseAddress + DataSectionAddress)))=0D else:=0D - MapBuffer.append('(GUID=3D%s, .textbaseaddress=3D0x%010X, = .databaseaddress=3D0x%010X)\n' % (ModuleInfo.Guid, BaseAddress + TextSectio= nAddress, BaseAddress + DataSectionAddress))=0D + MapBuffer.append('(GUID=3D%s, .textbaseaddress=3D0x%010X, = .databaseaddress=3D0x%010X)\n' % (=0D + ModuleInfo.Guid, BaseAddress + TextSectionAddress, Bas= eAddress + DataSectionAddress))=0D #=0D # Add debug image full path.=0D #=0D @@ -1571,9 +1702,11 @@ class Build(): #=0D for Function in FunctionList:=0D if AddrIsOffset:=0D - MapBuffer.append(' -0x%010X %s\n' % (0 - (BaseAddr= ess + Function[1]), Function[0]))=0D + MapBuffer.append(' -0x%010X %s\n' %=0D + (0 - (BaseAddress + Function[1]), Fun= ction[0]))=0D else:=0D - MapBuffer.append(' 0x%010X %s\n' % (BaseAddress + = Function[1], Function[0]))=0D + MapBuffer.append(' 0x%010X %s\n' %=0D + (BaseAddress + Function[1], Function[= 0]))=0D ImageMap.close()=0D =0D #=0D @@ -1582,9 +1715,9 @@ class Build(): if ModeIsSmm:=0D BaseAddress =3D BaseAddress + ModuleInfo.Image.Size=0D =0D - ## Collect MAP information of all FVs=0D + # Collect MAP information of all FVs=0D #=0D - def _CollectFvMapBuffer (self, MapBuffer, Wa, ModuleList):=0D + def _CollectFvMapBuffer(self, MapBuffer, Wa, ModuleList):=0D if self.Fdf:=0D # First get the XIP base address for FV map file.=0D GuidPattern =3D re.compile("[-a-fA-F0-9]+")=0D @@ -1594,7 +1727,7 @@ class Build(): if not os.path.exists(FvMapBuffer):=0D continue=0D FvMap =3D open(FvMapBuffer, 'r')=0D - #skip FV size information=0D + # skip FV size information=0D FvMap.readline()=0D FvMap.readline()=0D FvMap.readline()=0D @@ -1607,7 +1740,8 @@ class Build(): #=0D GuidString =3D MatchGuid.group()=0D if GuidString.upper() in ModuleList:=0D - Line =3D Line.replace(GuidString, ModuleList[G= uidString.upper()].Name)=0D + Line =3D Line.replace(=0D + GuidString, ModuleList[GuidString.upper()]= .Name)=0D MapBuffer.append(Line)=0D #=0D # Add the debug image full path.=0D @@ -1616,28 +1750,30 @@ class Build(): if MatchGuid is not None:=0D GuidString =3D MatchGuid.group().split("=3D")[1]=0D if GuidString.upper() in ModuleList:=0D - MapBuffer.append('(IMAGE=3D%s)\n' % (os.path.j= oin(ModuleList[GuidString.upper()].DebugDir, ModuleList[GuidString.upper()]= .Name + '.efi')))=0D + MapBuffer.append('(IMAGE=3D%s)\n' % (os.path.j= oin(ModuleList[GuidString.upper(=0D + )].DebugDir, ModuleList[GuidString.upper()].Na= me + '.efi')))=0D =0D FvMap.close()=0D =0D - ## Collect MAP information of all modules=0D + # Collect MAP information of all modules=0D #=0D - def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):=0D - sys.stdout.write ("Generate Load Module At Fix Address Map")=0D + def _CollectModuleMapBuffer(self, MapBuffer, ModuleList):=0D + sys.stdout.write("Generate Load Module At Fix Address Map")=0D sys.stdout.flush()=0D PatchEfiImageList =3D []=0D - PeiModuleList =3D {}=0D - BtModuleList =3D {}=0D - RtModuleList =3D {}=0D - SmmModuleList =3D {}=0D + PeiModuleList =3D {}=0D + BtModuleList =3D {}=0D + RtModuleList =3D {}=0D + SmmModuleList =3D {}=0D PeiSize =3D 0=0D - BtSize =3D 0=0D - RtSize =3D 0=0D + BtSize =3D 0=0D + RtSize =3D 0=0D # reserve 4K size in SMRAM to make SMM module address not from 0.= =0D SmmSize =3D 0x1000=0D for ModuleGuid in ModuleList:=0D Module =3D ModuleList[ModuleGuid]=0D - GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (Module.Met= aFile, Module.Arch, Module.ToolChain, Module.BuildTarget)=0D + GlobalData.gProcessingFile =3D "%s [%s, %s, %s]" % (=0D + Module.MetaFile, Module.Arch, Module.ToolChain, Module.Bui= ldTarget)=0D =0D OutputImageFile =3D ''=0D for ResultFile in Module.CodaTargetList:=0D @@ -1645,11 +1781,14 @@ class Build(): #=0D # module list for PEI, DXE, RUNTIME and SMM=0D #=0D - OutputImageFile =3D os.path.join(Module.OutputDir, Mod= ule.Name + '.efi')=0D - ImageClass =3D PeImageClass (OutputImageFile)=0D + OutputImageFile =3D os.path.join(=0D + Module.OutputDir, Module.Name + '.efi')=0D + ImageClass =3D PeImageClass(OutputImageFile)=0D if not ImageClass.IsValid:=0D - EdkLogger.error("build", FILE_PARSE_FAILURE, Extra= Data=3DImageClass.ErrorInfo)=0D - ImageInfo =3D PeImageInfo(Module.Name, Module.Guid, Mo= dule.Arch, Module.OutputDir, Module.DebugDir, ImageClass)=0D + EdkLogger.error("build", FILE_PARSE_FAILURE,=0D + ExtraData=3DImageClass.ErrorInfo)= =0D + ImageInfo =3D PeImageInfo(=0D + Module.Name, Module.Guid, Module.Arch, Module.Outp= utDir, Module.DebugDir, ImageClass)=0D if Module.ModuleType in [SUP_MODULE_PEI_CORE, SUP_MODU= LE_PEIM, EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER, EDK_COMPONENT_TYPE_PIC_PE= IM, EDK_COMPONENT_TYPE_RELOCATABLE_PEIM, SUP_MODULE_DXE_CORE]:=0D PeiModuleList[Module.MetaFile] =3D ImageInfo=0D PeiSize +=3D ImageInfo.Image.Size=0D @@ -1663,7 +1802,8 @@ class Build(): SmmModuleList[Module.MetaFile] =3D ImageInfo=0D SmmSize +=3D ImageInfo.Image.Size=0D if Module.ModuleType =3D=3D SUP_MODULE_DXE_SMM_DRI= VER:=0D - PiSpecVersion =3D Module.Module.Specification.= get('PI_SPECIFICATION_VERSION', '0x00000000')=0D + PiSpecVersion =3D Module.Module.Specification.= get(=0D + 'PI_SPECIFICATION_VERSION', '0x00000000')= =0D # for PI specification < PI1.1, DXE_SMM_DRIVER= also runs as BOOT time driver.=0D if int(PiSpecVersion, 16) < 0x0001000A:=0D BtModuleList[Module.MetaFile] =3D ImageInf= o=0D @@ -1691,7 +1831,7 @@ class Build(): # Module includes the patchable load fix address PCDs.=0D # It will be fixed up later.=0D #=0D - PatchEfiImageList.append (OutputImageFile)=0D + PatchEfiImageList.append(OutputImageFile)=0D =0D #=0D # Get Top Memory address=0D @@ -1703,7 +1843,8 @@ class Build(): else:=0D TopMemoryAddress =3D self.LoadFixAddress=0D if TopMemoryAddress < RtSize + BtSize + PeiSize:=0D - EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS is too low to load driver")=0D + EdkLogger.error("build", PARAMETER_INVALID,=0D + "FIX_LOAD_TOP_MEMORY_ADDRESS is too low to= load driver")=0D =0D #=0D # Patch FixAddress related PCDs into EFI image=0D @@ -1722,37 +1863,50 @@ class Build(): for PcdInfo in PcdTable:=0D ReturnValue =3D 0=0D if PcdInfo[0] =3D=3D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_P= EI_PAGE_SIZE:=0D - ReturnValue, ErrorInfo =3D PatchBinaryFile (EfiImage, = PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, st= r (PeiSize // 0x1000))=0D + ReturnValue, ErrorInfo =3D PatchBinaryFile(=0D + EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_= ADDRESS_PEI_PAGE_SIZE_DATA_TYPE, str(PeiSize // 0x1000))=0D elif PcdInfo[0] =3D=3D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS= _DXE_PAGE_SIZE:=0D - ReturnValue, ErrorInfo =3D PatchBinaryFile (EfiImage, = PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, st= r (BtSize // 0x1000))=0D + ReturnValue, ErrorInfo =3D PatchBinaryFile(=0D + EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_= ADDRESS_DXE_PAGE_SIZE_DATA_TYPE, str(BtSize // 0x1000))=0D elif PcdInfo[0] =3D=3D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS= _RUNTIME_PAGE_SIZE:=0D - ReturnValue, ErrorInfo =3D PatchBinaryFile (EfiImage, = PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE= , str (RtSize // 0x1000))=0D - elif PcdInfo[0] =3D=3D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS= _SMM_PAGE_SIZE and len (SmmModuleList) > 0:=0D - ReturnValue, ErrorInfo =3D PatchBinaryFile (EfiImage, = PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, st= r (SmmSize // 0x1000))=0D + ReturnValue, ErrorInfo =3D PatchBinaryFile(=0D + EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_= ADDRESS_RUNTIME_PAGE_SIZE_DATA_TYPE, str(RtSize // 0x1000))=0D + elif PcdInfo[0] =3D=3D TAB_PCDS_PATCHABLE_LOAD_FIX_ADDRESS= _SMM_PAGE_SIZE and len(SmmModuleList) > 0:=0D + ReturnValue, ErrorInfo =3D PatchBinaryFile(=0D + EfiImage, PcdInfo[1], TAB_PCDS_PATCHABLE_LOAD_FIX_= ADDRESS_SMM_PAGE_SIZE_DATA_TYPE, str(SmmSize // 0x1000))=0D if ReturnValue !=3D 0:=0D - EdkLogger.error("build", PARAMETER_INVALID, "Patch PCD= value failed", ExtraData=3DErrorInfo)=0D + EdkLogger.error("build", PARAMETER_INVALID,=0D + "Patch PCD value failed", ExtraData=3D= ErrorInfo)=0D =0D - MapBuffer.append('PEI_CODE_PAGE_NUMBER =3D 0x%x\n' % (PeiSize= // 0x1000))=0D - MapBuffer.append('BOOT_CODE_PAGE_NUMBER =3D 0x%x\n' % (BtSize = // 0x1000))=0D - MapBuffer.append('RUNTIME_CODE_PAGE_NUMBER =3D 0x%x\n' % (RtSize = // 0x1000))=0D - if len (SmmModuleList) > 0:=0D - MapBuffer.append('SMM_CODE_PAGE_NUMBER =3D 0x%x\n' % (Smm= Size // 0x1000))=0D + MapBuffer.append('PEI_CODE_PAGE_NUMBER =3D 0x%x\n' %=0D + (PeiSize // 0x1000))=0D + MapBuffer.append('BOOT_CODE_PAGE_NUMBER =3D 0x%x\n' %=0D + (BtSize // 0x1000))=0D + MapBuffer.append('RUNTIME_CODE_PAGE_NUMBER =3D 0x%x\n' %=0D + (RtSize // 0x1000))=0D + if len(SmmModuleList) > 0:=0D + MapBuffer.append('SMM_CODE_PAGE_NUMBER =3D 0x%x\n' %=0D + (SmmSize // 0x1000))=0D =0D PeiBaseAddr =3D TopMemoryAddress - RtSize - BtSize=0D - BtBaseAddr =3D TopMemoryAddress - RtSize=0D - RtBaseAddr =3D TopMemoryAddress - ReservedRuntimeMemorySize=0D + BtBaseAddr =3D TopMemoryAddress - RtSize=0D + RtBaseAddr =3D TopMemoryAddress - ReservedRuntimeMemorySize=0D =0D - self._RebaseModule (MapBuffer, PeiBaseAddr, PeiModuleList, TopMemo= ryAddress =3D=3D 0)=0D - self._RebaseModule (MapBuffer, BtBaseAddr, BtModuleList, TopMemory= Address =3D=3D 0)=0D - self._RebaseModule (MapBuffer, RtBaseAddr, RtModuleList, TopMemory= Address =3D=3D 0)=0D - self._RebaseModule (MapBuffer, 0x1000, SmmModuleList, AddrIsOffset= =3DFalse, ModeIsSmm=3DTrue)=0D + self._RebaseModule(MapBuffer, PeiBaseAddr,=0D + PeiModuleList, TopMemoryAddress =3D=3D 0)=0D + self._RebaseModule(MapBuffer, BtBaseAddr,=0D + BtModuleList, TopMemoryAddress =3D=3D 0)=0D + self._RebaseModule(MapBuffer, RtBaseAddr,=0D + RtModuleList, TopMemoryAddress =3D=3D 0)=0D + self._RebaseModule(MapBuffer, 0x1000, SmmModuleList,=0D + AddrIsOffset=3DFalse, ModeIsSmm=3DTrue)=0D MapBuffer.append('\n\n')=0D - sys.stdout.write ("\n")=0D + sys.stdout.write("\n")=0D sys.stdout.flush()=0D =0D - ## Save platform Map file=0D + # Save platform Map file=0D #=0D - def _SaveMapFile (self, MapBuffer, Wa):=0D + def _SaveMapFile(self, MapBuffer, Wa):=0D #=0D # Map file path is got.=0D #=0D @@ -1762,13 +1916,15 @@ class Build(): #=0D SaveFileOnChange(MapFilePath, ''.join(MapBuffer), False)=0D if self.LoadFixAddress !=3D 0:=0D - sys.stdout.write ("\nLoad Module At Fix Address Map file can b= e found at %s\n" % (MapFilePath))=0D + sys.stdout.write(=0D + "\nLoad Module At Fix Address Map file can be found at %s\= n" % (MapFilePath))=0D sys.stdout.flush()=0D =0D - ## Build active platform for different build targets and different too= l chains=0D + # Build active platform for different build targets and different tool= chains=0D #=0D def _BuildPlatform(self):=0D - SaveFileOnChange(self.PlatformBuildPath, '# DO NOT EDIT \n# FILE a= uto-generated\n', False)=0D + SaveFileOnChange(self.PlatformBuildPath,=0D + '# DO NOT EDIT \n# FILE auto-generated\n', False)= =0D for BuildTarget in self.BuildTargetList:=0D GlobalData.gGlobalDefines['TARGET'] =3D BuildTarget=0D index =3D 0=0D @@ -1778,22 +1934,22 @@ class Build(): GlobalData.gGlobalDefines['FAMILY'] =3D self.ToolChainFami= ly[index]=0D index +=3D 1=0D Wa =3D WorkspaceAutoGen(=0D - self.WorkspaceDir,=0D - self.PlatformFile,=0D - BuildTarget,=0D - ToolChain,=0D - self.ArchList,=0D - self.BuildDatabase,=0D - self.TargetTxt,=0D - self.ToolDef,=0D - self.Fdf,=0D - self.FdList,=0D - self.FvList,=0D - self.CapList,=0D - self.SkuId,=0D - self.UniFlag,=0D - self.Progress=0D - )=0D + self.WorkspaceDir,=0D + self.PlatformFile,=0D + BuildTarget,=0D + ToolChain,=0D + self.ArchList,=0D + self.BuildDatabase,=0D + self.TargetTxt,=0D + self.ToolDef,=0D + self.Fdf,=0D + self.FdList,=0D + self.FvList,=0D + self.CapList,=0D + self.SkuId,=0D + self.UniFlag,=0D + self.Progress=0D + )=0D self.Fdf =3D Wa.FdfFile=0D self.LoadFixAddress =3D Wa.Platform.LoadFixAddress=0D self.BuildReport.AddPlatformReport(Wa)=0D @@ -1805,12 +1961,14 @@ class Build(): CmdListDict =3D self._GenFfsCmd(Wa.ArchList)=0D =0D for Arch in Wa.ArchList:=0D - PcdMaList =3D []=0D + PcdMaList =3D []=0D GlobalData.gGlobalDefines['ARCH'] =3D Arch=0D - Pa =3D PlatformAutoGen(Wa, self.PlatformFile, BuildTar= get, ToolChain, Arch)=0D + Pa =3D PlatformAutoGen(=0D + Wa, self.PlatformFile, BuildTarget, ToolChain, Arc= h)=0D for Module in Pa.Platform.Modules:=0D # Get ModuleAutoGen object to generate C code file= and makefile=0D - Ma =3D ModuleAutoGen(Wa, Module, BuildTarget, Tool= Chain, Arch, self.PlatformFile,Pa.DataPipe)=0D + Ma =3D ModuleAutoGen(=0D + Wa, Module, BuildTarget, ToolChain, Arch, self= .PlatformFile, Pa.DataPipe)=0D if Ma is None:=0D continue=0D if Ma.PcdIsDriver:=0D @@ -1818,9 +1976,11 @@ class Build(): Ma.Workspace =3D Wa=0D PcdMaList.append(Ma)=0D self.BuildModules.append(Ma)=0D - Pa.DataPipe.DataContainer =3D {"FfsCommand":CmdListDic= t}=0D - Pa.DataPipe.DataContainer =3D {"Workspace_timestamp": = Wa._SrcTimeStamp}=0D - self._BuildPa(self.Target, Pa, FfsCommand=3DCmdListDic= t,PcdMaList=3DPcdMaList)=0D + Pa.DataPipe.DataContainer =3D {"FfsCommand": CmdListDi= ct}=0D + Pa.DataPipe.DataContainer =3D {=0D + "Workspace_timestamp": Wa._SrcTimeStamp}=0D + self._BuildPa(self.Target, Pa,=0D + FfsCommand=3DCmdListDict, PcdMaList=3DPc= dMaList)=0D =0D # Create MAP file when Load Fix Address is enabled.=0D if self.Target in ["", "all", "fds"]:=0D @@ -1830,7 +1990,8 @@ class Build(): # Check whether the set fix address is above 4G fo= r 32bit image.=0D #=0D if (Arch =3D=3D 'IA32' or Arch =3D=3D 'ARM') and s= elf.LoadFixAddress !=3D 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >=3D 0x1= 00000000:=0D - EdkLogger.error("build", PARAMETER_INVALID, "F= IX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for t= he platform with IA32 or ARM arch modules")=0D + EdkLogger.error(=0D + "build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platform = with IA32 or ARM arch modules")=0D #=0D # Get Module List=0D #=0D @@ -1860,10 +2021,10 @@ class Build(): #=0D # Save MAP buffer into MAP file.=0D #=0D - self._SaveMapFile (MapBuffer, Wa)=0D + self._SaveMapFile(MapBuffer, Wa)=0D self.CreateGuidedSectionToolsFile(Wa)=0D =0D - ## Build active module for different build targets, different tool cha= ins and different archs=0D + # Build active module for different build targets, different tool chai= ns and different archs=0D #=0D def _BuildModule(self):=0D for BuildTarget in self.BuildTargetList:=0D @@ -1880,23 +2041,23 @@ class Build(): # AutoGen first=0D #=0D Wa =3D WorkspaceAutoGen(=0D - self.WorkspaceDir,=0D - self.PlatformFile,=0D - BuildTarget,=0D - ToolChain,=0D - self.ArchList,=0D - self.BuildDatabase,=0D - self.TargetTxt,=0D - self.ToolDef,=0D - self.Fdf,=0D - self.FdList,=0D - self.FvList,=0D - self.CapList,=0D - self.SkuId,=0D - self.UniFlag,=0D - self.Progress,=0D - self.ModuleFile=0D - )=0D + self.WorkspaceDir,=0D + self.PlatformFile,=0D + BuildTarget,=0D + ToolChain,=0D + self.ArchList,=0D + self.BuildDatabase,=0D + self.TargetTxt,=0D + self.ToolDef,=0D + self.Fdf,=0D + self.FdList,=0D + self.FvList,=0D + self.CapList,=0D + self.SkuId,=0D + self.UniFlag,=0D + self.Progress,=0D + self.ModuleFile=0D + )=0D self.Fdf =3D Wa.FdfFile=0D self.LoadFixAddress =3D Wa.Platform.LoadFixAddress=0D Wa.CreateMakeFile(False)=0D @@ -1912,14 +2073,17 @@ class Build(): MaList =3D []=0D ExitFlag =3D threading.Event()=0D ExitFlag.clear()=0D - self.AutoGenTime +=3D int(round((time.time() - WorkspaceAu= toGenTime)))=0D + self.AutoGenTime +=3D int(round((time.time() -=0D + WorkspaceAutoGenTime)))=0D for Arch in Wa.ArchList:=0D AutoGenStart =3D time.time()=0D GlobalData.gGlobalDefines['ARCH'] =3D Arch=0D - Pa =3D PlatformAutoGen(Wa, self.PlatformFile, BuildTar= get, ToolChain, Arch)=0D + Pa =3D PlatformAutoGen(=0D + Wa, self.PlatformFile, BuildTarget, ToolChain, Arc= h)=0D for Module in Pa.Platform.Modules:=0D if self.ModuleFile.Dir =3D=3D Module.Dir and self.= ModuleFile.Name =3D=3D Module.Name:=0D - Ma =3D ModuleAutoGen(Wa, Module, BuildTarget, = ToolChain, Arch, self.PlatformFile,Pa.DataPipe)=0D + Ma =3D ModuleAutoGen(=0D + Wa, Module, BuildTarget, ToolChain, Arch, = self.PlatformFile, Pa.DataPipe)=0D if Ma is None:=0D continue=0D if Ma.PcdIsDriver:=0D @@ -1945,7 +2109,8 @@ class Build(): if not self.SkipAutoGen or self.Target =3D= =3D 'genmake':=0D self.Progress.Start("Generating makefi= le")=0D if CmdListDict and self.Fdf and (Modul= e.Path, Arch) in CmdListDict:=0D - Ma.CreateMakeFile(True, CmdListDic= t[Module.Path, Arch])=0D + Ma.CreateMakeFile(=0D + True, CmdListDict[Module.Path,= Arch])=0D del CmdListDict[Module.Path, Arch]= =0D else:=0D Ma.CreateMakeFile(True)=0D @@ -1964,22 +2129,26 @@ class Build(): MakeStart =3D time.time()=0D for Ma in self.BuildModules:=0D if not Ma.IsBinaryModule:=0D - Bt =3D BuildTask.New(ModuleMakeUnit(Ma, Pa.Bui= ldCommand,self.Target))=0D + Bt =3D BuildTask.New(ModuleMakeUnit(=0D + Ma, Pa.BuildCommand, self.Target))=0D # Break build if any build thread has error=0D if BuildTask.HasError():=0D # we need a full version of makefile for platf= orm=0D ExitFlag.set()=0D BuildTask.WaitForComplete()=0D Pa.CreateMakeFile(False)=0D - EdkLogger.error("build", BUILD_ERROR, "Failed = to build module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build mod= ule", ExtraData=3DGlobalData.gBuildingModule)=0D # Start task scheduler=0D if not BuildTask.IsOnGoing():=0D - BuildTask.StartScheduler(self.ThreadNumber, Ex= itFlag)=0D + BuildTask.StartScheduler(=0D + self.ThreadNumber, ExitFlag)=0D =0D # in case there's an interruption. we need a full vers= ion of makefile for platform=0D Pa.CreateMakeFile(False)=0D if BuildTask.HasError():=0D - EdkLogger.error("build", BUILD_ERROR, "Failed to b= uild module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build module"= , ExtraData=3DGlobalData.gBuildingModule)=0D self.MakeTime +=3D int(round((time.time() - MakeStart)= ))=0D =0D MakeContiue =3D time.time()=0D @@ -1995,19 +2164,20 @@ class Build(): self.BuildModules =3D []=0D self.MakeTime +=3D int(round((time.time() - MakeContiue)))= =0D if BuildTask.HasError():=0D - EdkLogger.error("build", BUILD_ERROR, "Failed to build= module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build module", Ex= traData=3DGlobalData.gBuildingModule)=0D =0D self.BuildReport.AddPlatformReport(Wa, MaList)=0D if MaList =3D=3D []:=0D EdkLogger.error(=0D - 'build',=0D - BUILD_ERROR,=0D - "Module for [%s] is not a component of act= ive platform."\=0D - " Please make sure that the ARCH and inf f= ile path are"\=0D - " given in the same as in [%s]" % \=0D - (', '.join(Wa.ArchList), self.Platform= File),=0D - ExtraData=3Dself.ModuleFile=0D - )=0D + 'build',=0D + BUILD_ERROR,=0D + "Module for [%s] is not a component of active plat= form."=0D + " Please make sure that the ARCH and inf file path= are"=0D + " given in the same as in [%s]" %=0D + (', '.join(Wa.ArchList), self.PlatformFile),=0D + ExtraData=3Dself.ModuleFile=0D + )=0D # Create MAP file when Load Fix Address is enabled.=0D if self.Target =3D=3D "fds" and self.Fdf:=0D for Arch in Wa.ArchList:=0D @@ -2015,7 +2185,8 @@ class Build(): # Check whether the set fix address is above 4G fo= r 32bit image.=0D #=0D if (Arch =3D=3D 'IA32' or Arch =3D=3D 'ARM') and s= elf.LoadFixAddress !=3D 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >=3D 0x1= 00000000:=0D - EdkLogger.error("build", PARAMETER_INVALID, "F= IX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for t= he platorm with IA32 or ARM arch modules")=0D + EdkLogger.error(=0D + "build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm w= ith IA32 or ARM arch modules")=0D #=0D # Get Module List=0D #=0D @@ -2046,19 +2217,22 @@ class Build(): #=0D # Save MAP buffer into MAP file.=0D #=0D - self._SaveMapFile (MapBuffer, Wa)=0D + self._SaveMapFile(MapBuffer, Wa)=0D =0D - def _GenFfsCmd(self,ArchList):=0D + def _GenFfsCmd(self, ArchList):=0D # convert dictionary of Cmd:(Inf,Arch)=0D # to a new dictionary of (Inf,Arch):Cmd,Cmd,Cmd...=0D CmdSetDict =3D defaultdict(set)=0D - GenFfsDict =3D GenFds.GenFfsMakefile('', GlobalData.gFdfParser, se= lf, ArchList, GlobalData)=0D + GenFfsDict =3D GenFds.GenFfsMakefile(=0D + '', GlobalData.gFdfParser, self, ArchList, GlobalData)=0D for Cmd in GenFfsDict:=0D tmpInf, tmpArch =3D GenFfsDict[Cmd]=0D CmdSetDict[tmpInf, tmpArch].add(Cmd)=0D return CmdSetDict=0D +=0D def VerifyAutoGenFiles(self):=0D - AutoGenIdFile =3D os.path.join(GlobalData.gConfDirectory,".AutoGen= IdFile.txt")=0D + AutoGenIdFile =3D os.path.join(=0D + GlobalData.gConfDirectory, ".AutoGenIdFile.txt")=0D try:=0D with open(AutoGenIdFile) as fd:=0D lines =3D fd.readlines()=0D @@ -2073,7 +2247,8 @@ class Build(): PlatformGuid =3D line.split("=3D")[1].strip()=0D GlobalVarList =3D []=0D for arch in ArchList:=0D - global_var =3D os.path.join(BuildDir, "GlobalVar_%s_%s.bin" % = (str(PlatformGuid),arch))=0D + global_var =3D os.path.join(=0D + BuildDir, "GlobalVar_%s_%s.bin" % (str(PlatformGuid), arch= ))=0D if not os.path.exists(global_var):=0D return None=0D GlobalVarList.append(global_var)=0D @@ -2088,26 +2263,30 @@ class Build(): workspacedir =3D data_pipe.Get("P_Info").get("WorkspaceDir")=0D PackagesPath =3D os.getenv("PACKAGES_PATH")=0D mws.setWs(workspacedir, PackagesPath)=0D - LibraryBuildDirectoryList =3D data_pipe.Get("LibraryBuildDirec= toryList")=0D - ModuleBuildDirectoryList =3D data_pipe.Get("ModuleBuildDirecto= ryList")=0D + LibraryBuildDirectoryList =3D data_pipe.Get(=0D + "LibraryBuildDirectoryList")=0D + ModuleBuildDirectoryList =3D data_pipe.Get(=0D + "ModuleBuildDirectoryList")=0D =0D for m_build_dir in LibraryBuildDirectoryList:=0D - if not os.path.exists(os.path.join(m_build_dir,self.MakeFi= leName)):=0D + if not os.path.exists(os.path.join(m_build_dir, self.MakeF= ileName)):=0D return None=0D for m_build_dir in ModuleBuildDirectoryList:=0D - if not os.path.exists(os.path.join(m_build_dir,self.MakeFi= leName)):=0D + if not os.path.exists(os.path.join(m_build_dir, self.MakeF= ileName)):=0D return None=0D Wa =3D WorkSpaceInfo(=0D - workspacedir,active_p,target,toolchain,archlist=0D - )=0D - Pa =3D PlatformInfo(Wa, active_p, target, toolchain, Arch,data= _pipe)=0D + workspacedir, active_p, target, toolchain, archlist=0D + )=0D + Pa =3D PlatformInfo(Wa, active_p, target, toolchain, Arch, dat= a_pipe)=0D Wa.AutoGenObjectList.append(Pa)=0D return Wa=0D - def SetupMakeSetting(self,Wa):=0D +=0D + def SetupMakeSetting(self, Wa):=0D BuildModules =3D []=0D for Pa in Wa.AutoGenObjectList:=0D for m in Pa._MbList:=0D - ma =3D ModuleAutoGen(Wa,m.MetaFile, Pa.BuildTarget, Wa.Too= lChain, Pa.Arch, Pa.MetaFile,Pa.DataPipe)=0D + ma =3D ModuleAutoGen(Wa, m.MetaFile, Pa.BuildTarget,=0D + Wa.ToolChain, Pa.Arch, Pa.MetaFile, Pa.= DataPipe)=0D BuildModules.append(ma)=0D fdf_file =3D Wa.FlashDefinition=0D if fdf_file:=0D @@ -2119,34 +2298,35 @@ class Build(): for FdRegion in FdDict.RegionList:=0D if str(FdRegion.RegionType) =3D=3D 'FILE' and self.Pla= tform.VpdToolGuid in str(FdRegion.RegionDataList):=0D if int(FdRegion.Offset) % 8 !=3D 0:=0D - EdkLogger.error("build", FORMAT_INVALID, 'The = VPD Base Address %s must be 8-byte aligned.' % (FdRegion.Offset))=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, 'The VPD Base Add= ress %s must be 8-byte aligned.' % (FdRegion.Offset))=0D Wa.FdfProfile =3D Fdf.Profile=0D self.Fdf =3D Fdf=0D else:=0D self.Fdf =3D None=0D return BuildModules=0D =0D - ## Build a platform in multi-thread mode=0D + # Build a platform in multi-thread mode=0D #=0D - def PerformAutoGen(self,BuildTarget,ToolChain):=0D + def PerformAutoGen(self, BuildTarget, ToolChain):=0D WorkspaceAutoGenTime =3D time.time()=0D Wa =3D WorkspaceAutoGen(=0D - self.WorkspaceDir,=0D - self.PlatformFile,=0D - BuildTarget,=0D - ToolChain,=0D - self.ArchList,=0D - self.BuildDatabase,=0D - self.TargetTxt,=0D - self.ToolDef,=0D - self.Fdf,=0D - self.FdList,=0D - self.FvList,=0D - self.CapList,=0D - self.SkuId,=0D - self.UniFlag,=0D - self.Progress=0D - )=0D + self.WorkspaceDir,=0D + self.PlatformFile,=0D + BuildTarget,=0D + ToolChain,=0D + self.ArchList,=0D + self.BuildDatabase,=0D + self.TargetTxt,=0D + self.ToolDef,=0D + self.Fdf,=0D + self.FdList,=0D + self.FvList,=0D + self.CapList,=0D + self.SkuId,=0D + self.UniFlag,=0D + self.Progress=0D + )=0D self.Fdf =3D Wa.FdfFile=0D self.LoadFixAddress =3D Wa.Platform.LoadFixAddress=0D self.BuildReport.AddPlatformReport(Wa)=0D @@ -2160,10 +2340,11 @@ class Build(): self.AutoGenTime +=3D int(round((time.time() - WorkspaceAutoGenTim= e)))=0D BuildModules =3D []=0D for Arch in Wa.ArchList:=0D - PcdMaList =3D []=0D + PcdMaList =3D []=0D AutoGenStart =3D time.time()=0D GlobalData.gGlobalDefines['ARCH'] =3D Arch=0D - Pa =3D PlatformAutoGen(Wa, self.PlatformFile, BuildTarget, Too= lChain, Arch)=0D + Pa =3D PlatformAutoGen(Wa, self.PlatformFile,=0D + BuildTarget, ToolChain, Arch)=0D if Pa is None:=0D continue=0D ModuleList =3D []=0D @@ -2176,26 +2357,33 @@ class Build(): if Inf in Pa.Platform.Modules:=0D continue=0D ModuleList.append(Inf)=0D - Pa.DataPipe.DataContainer =3D {"FfsCommand":CmdListDict}=0D - Pa.DataPipe.DataContainer =3D {"Workspace_timestamp": Wa._SrcT= imeStamp}=0D + Pa.DataPipe.DataContainer =3D {"FfsCommand": CmdListDict}=0D + Pa.DataPipe.DataContainer =3D {=0D + "Workspace_timestamp": Wa._SrcTimeStamp}=0D Pa.DataPipe.DataContainer =3D {"CommandTarget": self.Target}=0D Pa.CreateLibModuelDirs()=0D # Fetch the MakeFileName.=0D self.MakeFileName =3D Pa.MakeFileName=0D =0D - Pa.DataPipe.DataContainer =3D {"LibraryBuildDirectoryList":Pa.= LibraryBuildDirectoryList}=0D - Pa.DataPipe.DataContainer =3D {"ModuleBuildDirectoryList":Pa.M= oduleBuildDirectoryList}=0D - Pa.DataPipe.DataContainer =3D {"FdsCommandDict": Wa.GenFdsComm= andDict}=0D + Pa.DataPipe.DataContainer =3D {=0D + "LibraryBuildDirectoryList": Pa.LibraryBuildDirectoryList}= =0D + Pa.DataPipe.DataContainer =3D {=0D + "ModuleBuildDirectoryList": Pa.ModuleBuildDirectoryList}=0D + Pa.DataPipe.DataContainer =3D {=0D + "FdsCommandDict": Wa.GenFdsCommandDict}=0D # Prepare the cache share data for multiprocessing=0D - Pa.DataPipe.DataContainer =3D {"gPlatformHashFile":GlobalData.= gPlatformHashFile}=0D + Pa.DataPipe.DataContainer =3D {=0D + "gPlatformHashFile": GlobalData.gPlatformHashFile}=0D ModuleCodaFile =3D {}=0D for ma in Pa.ModuleAutoGenList:=0D - ModuleCodaFile[(ma.MetaFile.File,ma.MetaFile.Root,ma.Arch,= ma.MetaFile.Path)] =3D [item.Target for item in ma.CodaTargetList]=0D - Pa.DataPipe.DataContainer =3D {"ModuleCodaFile":ModuleCodaFile= }=0D + ModuleCodaFile[(ma.MetaFile.File, ma.MetaFile.Root, ma.Arc= h, ma.MetaFile.Path)] =3D [=0D + item.Target for item in ma.CodaTargetList]=0D + Pa.DataPipe.DataContainer =3D {"ModuleCodaFile": ModuleCodaFil= e}=0D # ModuleList contains all driver modules only=0D for Module in ModuleList:=0D # Get ModuleAutoGen object to generate C code file and mak= efile=0D - Ma =3D ModuleAutoGen(Wa, Module, BuildTarget, ToolChain, A= rch, self.PlatformFile,Pa.DataPipe)=0D + Ma =3D ModuleAutoGen(=0D + Wa, Module, BuildTarget, ToolChain, Arch, self.Platfor= mFile, Pa.DataPipe)=0D if Ma is None:=0D continue=0D if Ma.PcdIsDriver:=0D @@ -2209,16 +2397,18 @@ class Build(): cqueue =3D mp.Queue()=0D for m in Pa.GetAllModuleInfo:=0D mqueue.put(m)=0D - module_file,module_root,module_path,module_basename,\=0D - module_originalpath,module_arch,IsLib =3D m=0D - Ma =3D ModuleAutoGen(Wa, PathClass(module_path, Wa), Build= Target,\=0D - ToolChain, Arch, self.PlatformFile,Pa.Da= taPipe)=0D + module_file, module_root, module_path, module_basename,\=0D + module_originalpath, module_arch, IsLib =3D m=0D + Ma =3D ModuleAutoGen(Wa, PathClass(module_path, Wa), Build= Target,=0D + ToolChain, Arch, self.PlatformFile, Pa.= DataPipe)=0D self.AllModules.add(Ma)=0D - data_pipe_file =3D os.path.join(Pa.BuildDir, "GlobalVar_%s_%s.= bin" % (str(Pa.Guid),Pa.Arch))=0D + data_pipe_file =3D os.path.join(=0D + Pa.BuildDir, "GlobalVar_%s_%s.bin" % (str(Pa.Guid), Pa.Arc= h))=0D Pa.DataPipe.dump(data_pipe_file)=0D =0D - mqueue.put((None,None,None,None,None,None,None))=0D - autogen_rt, errorcode =3D self.StartAutoGen(mqueue, Pa.DataPip= e, self.SkipAutoGen, PcdMaList, cqueue)=0D + mqueue.put((None, None, None, None, None, None, None))=0D + autogen_rt, errorcode =3D self.StartAutoGen(=0D + mqueue, Pa.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)= =0D =0D if not autogen_rt:=0D self.AutoGenMgr.TerminateWorkers()=0D @@ -2228,8 +2418,8 @@ class Build(): if GlobalData.gUseHashCache:=0D for item in GlobalData.gModuleAllCacheStatus:=0D (MetaFilePath, Arch, CacheStr, Status) =3D item=0D - Ma =3D ModuleAutoGen(Wa, PathClass(MetaFilePath, Wa), = BuildTarget,\=0D - ToolChain, Arch, self.PlatformFile,P= a.DataPipe)=0D + Ma =3D ModuleAutoGen(Wa, PathClass(MetaFilePath, Wa), = BuildTarget,=0D + ToolChain, Arch, self.PlatformFile,= Pa.DataPipe)=0D if CacheStr =3D=3D "PreMakeCache" and Status =3D=3D Fa= lse:=0D self.PreMakeCacheMiss.add(Ma)=0D if CacheStr =3D=3D "PreMakeCache" and Status =3D=3D Tr= ue:=0D @@ -2241,8 +2431,9 @@ class Build(): self.MakeCacheHit.add(Ma)=0D GlobalData.gModuleCacheHit.add(Ma)=0D self.AutoGenTime +=3D int(round((time.time() - AutoGenStart)))= =0D - AutoGenIdFile =3D os.path.join(GlobalData.gConfDirectory,".AutoGen= IdFile.txt")=0D - with open(AutoGenIdFile,"w") as fw:=0D + AutoGenIdFile =3D os.path.join(=0D + GlobalData.gConfDirectory, ".AutoGenIdFile.txt")=0D + with open(AutoGenIdFile, "w") as fw:=0D fw.write("Arch=3D%s\n" % "|".join((Wa.ArchList)))=0D fw.write("BuildDir=3D%s\n" % Wa.BuildDir)=0D fw.write("PlatformGuid=3D%s\n" % str(Wa.AutoGenObjectList[0].G= uid))=0D @@ -2258,7 +2449,8 @@ class Build(): return Wa, BuildModules=0D =0D def _MultiThreadBuildPlatform(self):=0D - SaveFileOnChange(self.PlatformBuildPath, '# DO NOT EDIT \n# FILE a= uto-generated\n', False)=0D + SaveFileOnChange(self.PlatformBuildPath,=0D + '# DO NOT EDIT \n# FILE auto-generated\n', False)= =0D for BuildTarget in self.BuildTargetList:=0D GlobalData.gGlobalDefines['TARGET'] =3D BuildTarget=0D index =3D 0=0D @@ -2274,41 +2466,50 @@ class Build(): Wa =3D self.VerifyAutoGenFiles()=0D if Wa is None:=0D self.SkipAutoGen =3D False=0D - Wa, self.BuildModules =3D self.PerformAutoGen(Buil= dTarget,ToolChain)=0D + Wa, self.BuildModules =3D self.PerformAutoGen(=0D + BuildTarget, ToolChain)=0D else:=0D GlobalData.gAutoGenPhase =3D True=0D self.BuildModules =3D self.SetupMakeSetting(Wa)=0D else:=0D - Wa, self.BuildModules =3D self.PerformAutoGen(BuildTar= get,ToolChain)=0D + Wa, self.BuildModules =3D self.PerformAutoGen(=0D + BuildTarget, ToolChain)=0D Pa =3D Wa.AutoGenObjectList[0]=0D GlobalData.gAutoGenPhase =3D False=0D =0D if GlobalData.gBinCacheSource:=0D - EdkLogger.quiet("[cache Summary]: Total module num: %s= " % len(self.AllModules))=0D - EdkLogger.quiet("[cache Summary]: PreMakecache miss nu= m: %s " % len(self.PreMakeCacheMiss))=0D - EdkLogger.quiet("[cache Summary]: Makecache miss num: = %s " % len(self.MakeCacheMiss))=0D + EdkLogger.quiet(=0D + "[cache Summary]: Total module num: %s" % len(self= .AllModules))=0D + EdkLogger.quiet("[cache Summary]: PreMakecache miss nu= m: %s " % len(=0D + self.PreMakeCacheMiss))=0D + EdkLogger.quiet(=0D + "[cache Summary]: Makecache miss num: %s " % len(s= elf.MakeCacheMiss))=0D =0D for Arch in Wa.ArchList:=0D MakeStart =3D time.time()=0D for Ma in set(self.BuildModules):=0D # Generate build task for the module=0D if not Ma.IsBinaryModule:=0D - Bt =3D BuildTask.New(ModuleMakeUnit(Ma, Pa.Bui= ldCommand,self.Target))=0D + Bt =3D BuildTask.New(ModuleMakeUnit(=0D + Ma, Pa.BuildCommand, self.Target))=0D # Break build if any build thread has error=0D if BuildTask.HasError():=0D # we need a full version of makefile for platf= orm=0D ExitFlag.set()=0D BuildTask.WaitForComplete()=0D Pa.CreateMakeFile(False)=0D - EdkLogger.error("build", BUILD_ERROR, "Failed = to build module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build mod= ule", ExtraData=3DGlobalData.gBuildingModule)=0D # Start task scheduler=0D if not BuildTask.IsOnGoing():=0D - BuildTask.StartScheduler(self.ThreadNumber, Ex= itFlag)=0D + BuildTask.StartScheduler(=0D + self.ThreadNumber, ExitFlag)=0D =0D # in case there's an interruption. we need a full vers= ion of makefile for platform=0D =0D if BuildTask.HasError():=0D - EdkLogger.error("build", BUILD_ERROR, "Failed to b= uild module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build module"= , ExtraData=3DGlobalData.gBuildingModule)=0D self.MakeTime +=3D int(round((time.time() - MakeStart)= ))=0D =0D MakeContiue =3D time.time()=0D @@ -2336,7 +2537,8 @@ class Build(): # has been signaled.=0D #=0D if BuildTask.HasError():=0D - EdkLogger.error("build", BUILD_ERROR, "Failed to build= module", ExtraData=3DGlobalData.gBuildingModule)=0D + EdkLogger.error(=0D + "build", BUILD_ERROR, "Failed to build module", Ex= traData=3DGlobalData.gBuildingModule)=0D =0D # Create MAP file when Load Fix Address is enabled.=0D if self.Target in ["", "all", "fds"]:=0D @@ -2345,7 +2547,8 @@ class Build(): # Check whether the set fix address is above 4G fo= r 32bit image.=0D #=0D if (Arch =3D=3D 'IA32' or Arch =3D=3D 'ARM') and s= elf.LoadFixAddress !=3D 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >=3D 0x1= 00000000:=0D - EdkLogger.error("build", PARAMETER_INVALID, "F= IX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for t= he platorm with IA32 or ARM arch modules")=0D + EdkLogger.error(=0D + "build", PARAMETER_INVALID, "FIX_LOAD_TOP_= MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm w= ith IA32 or ARM arch modules")=0D =0D #=0D # Rebase module to the preferred memory address before= GenFds=0D @@ -2376,13 +2579,14 @@ class Build(): self._SaveMapFile(MapBuffer, Wa)=0D self.CreateGuidedSectionToolsFile(Wa)=0D =0D - ## GetFreeSizeThreshold()=0D + # GetFreeSizeThreshold()=0D #=0D # @retval int Threshold value=0D #=0D def GetFreeSizeThreshold(self):=0D Threshold =3D None=0D - Threshold_Str =3D GlobalData.gCommandLineDefines.get('FV_SPARE_SPA= CE_THRESHOLD')=0D + Threshold_Str =3D GlobalData.gCommandLineDefines.get(=0D + 'FV_SPARE_SPACE_THRESHOLD')=0D if Threshold_Str:=0D try:=0D if Threshold_Str.lower().startswith('0x'):=0D @@ -2390,7 +2594,8 @@ class Build(): else:=0D Threshold =3D int(Threshold_Str)=0D except:=0D - EdkLogger.warn("build", 'incorrect value for FV_SPARE_SPAC= E_THRESHOLD %s.Only decimal or hex format is allowed.' % Threshold_Str)=0D + EdkLogger.warn(=0D + "build", 'incorrect value for FV_SPARE_SPACE_THRESHOLD= %s.Only decimal or hex format is allowed.' % Threshold_Str)=0D return Threshold=0D =0D def CheckFreeSizeThreshold(self, Threshold=3DNone, FvDir=3DNone):=0D @@ -2399,10 +2604,12 @@ class Build(): if not isinstance(FvDir, str) or not FvDir:=0D return=0D FdfParserObject =3D GlobalData.gFdfParser=0D - FvRegionNameList =3D [FvName for FvName in FdfParserObject.Profile= .FvDict if FdfParserObject.Profile.FvDict[FvName].FvRegionInFD]=0D + FvRegionNameList =3D [=0D + FvName for FvName in FdfParserObject.Profile.FvDict if FdfPars= erObject.Profile.FvDict[FvName].FvRegionInFD]=0D for FvName in FdfParserObject.Profile.FvDict:=0D if FvName in FvRegionNameList:=0D - FvSpaceInfoFileName =3D os.path.join(FvDir, FvName.upper()= + '.Fv.map')=0D + FvSpaceInfoFileName =3D os.path.join(=0D + FvDir, FvName.upper() + '.Fv.map')=0D if os.path.exists(FvSpaceInfoFileName):=0D FileLinesList =3D getlines(FvSpaceInfoFileName)=0D for Line in FileLinesList:=0D @@ -2415,9 +2622,9 @@ class Build(): FvName, FreeSizeValue,= Threshold))=0D break=0D =0D - ## Generate GuidedSectionTools.txt in the FV directories.=0D + # Generate GuidedSectionTools.txt in the FV directories.=0D #=0D - def CreateGuidedSectionToolsFile(self,Wa):=0D + def CreateGuidedSectionToolsFile(self, Wa):=0D for BuildTarget in self.BuildTargetList:=0D for ToolChain in self.ToolChainList:=0D FvDir =3D Wa.FvDir=0D @@ -2434,13 +2641,14 @@ class Build(): continue=0D if Platform.Arch !=3D Arch:=0D continue=0D - if hasattr (Platform, 'BuildOption'):=0D + if hasattr(Platform, 'BuildOption'):=0D for Tool in Platform.BuildOption:=0D if 'GUID' in Platform.BuildOption[Tool]:=0D if 'PATH' in Platform.BuildOption[Tool= ]:=0D value =3D Platform.BuildOption[Too= l]['GUID']=0D if value in guidList:=0D - EdkLogger.error("build", FORMA= T_INVALID, "Duplicate GUID value %s used with Tool %s in DSC [BuildOptions]= ." % (value, Tool))=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, "= Duplicate GUID value %s used with Tool %s in DSC [BuildOptions]." % (value,= Tool))=0D path =3D Platform.BuildOption[Tool= ]['PATH']=0D guidList.append(value)=0D guidAttribs.append((value, Tool, p= ath))=0D @@ -2449,7 +2657,8 @@ class Build(): if 'PATH' in Platform.ToolDefinition[Tool]= :=0D value =3D Platform.ToolDefinition[Tool= ]['GUID']=0D if value in tooldefguidList:=0D - EdkLogger.error("build", FORMAT_IN= VALID, "Duplicate GUID value %s used with Tool %s in tools_def.txt." % (val= ue, Tool))=0D + EdkLogger.error(=0D + "build", FORMAT_INVALID, "Dupl= icate GUID value %s used with Tool %s in tools_def.txt." % (value, Tool))=0D tooldefguidList.append(value)=0D if value in guidList:=0D # Already added by platform=0D @@ -2458,7 +2667,7 @@ class Build(): guidList.append(value)=0D guidAttribs.append((value, Tool, path)= )=0D # Sort by GuidTool name=0D - guidAttribs =3D sorted (guidAttribs, key=3Dlambda x: x= [1])=0D + guidAttribs =3D sorted(guidAttribs, key=3Dlambda x: x[= 1])=0D # Write out GuidedSecTools.txt=0D toolsFile =3D os.path.join(FvDir, 'GuidedSectionTools.= txt')=0D toolsFile =3D open(toolsFile, 'wt')=0D @@ -2466,14 +2675,14 @@ class Build(): print(' '.join(guidedSectionTool), file=3DtoolsFil= e)=0D toolsFile.close()=0D =0D - ## Returns the real path of the tool.=0D + # Returns the real path of the tool.=0D #=0D - def GetRealPathOfTool (self, tool):=0D + def GetRealPathOfTool(self, tool):=0D if os.path.exists(tool):=0D return os.path.realpath(tool)=0D return tool=0D =0D - ## Launch the module or platform build=0D + # Launch the module or platform build=0D #=0D def Launch(self):=0D self.AllDrivers =3D set()=0D @@ -2509,7 +2718,7 @@ class Build(): for Module in self.PreMakeCacheMiss:=0D Module.GenPreMakefileHashList()=0D =0D - ## Do some clean-up works when error occurred=0D + # Do some clean-up works when error occurred=0D def Relinquish(self):=0D OldLogLevel =3D EdkLogger.GetLevel()=0D EdkLogger.SetLevel(EdkLogger.ERROR)=0D @@ -2518,6 +2727,7 @@ class Build(): BuildTask.Abort()=0D EdkLogger.SetLevel(OldLogLevel)=0D =0D +=0D def ParseDefines(DefineList=3D[]):=0D DefineDict =3D {}=0D if DefineList is not None:=0D @@ -2535,18 +2745,20 @@ def ParseDefines(DefineList=3D[]): return DefineDict=0D =0D =0D -=0D def LogBuildTime(Time):=0D if Time:=0D TimeDurStr =3D ''=0D TimeDur =3D time.gmtime(Time)=0D if TimeDur.tm_yday > 1:=0D - TimeDurStr =3D time.strftime("%H:%M:%S", TimeDur) + ", %d day(= s)" % (TimeDur.tm_yday - 1)=0D + TimeDurStr =3D time.strftime(=0D + "%H:%M:%S", TimeDur) + ", %d day(s)" % (TimeDur.tm_yday - = 1)=0D else:=0D TimeDurStr =3D time.strftime("%H:%M:%S", TimeDur)=0D return TimeDurStr=0D else:=0D return None=0D +=0D +=0D def ThreadNum():=0D OptionParser =3D MyOptionParser()=0D if not OptionParser.BuildOption and not OptionParser.BuildTarget:=0D @@ -2556,7 +2768,8 @@ def ThreadNum(): GlobalData.gCmdConfDir =3D BuildOption.ConfDirectory=0D if ThreadNumber is None:=0D TargetObj =3D TargetTxtDict()=0D - ThreadNumber =3D TargetObj.Target.TargetTxtDictionary[TAB_TAT_DEFI= NES_MAX_CONCURRENT_THREAD_NUMBER]=0D + ThreadNumber =3D TargetObj.Target.TargetTxtDictionary[=0D + TAB_TAT_DEFINES_MAX_CONCURRENT_THREAD_NUMBER]=0D if ThreadNumber =3D=3D '':=0D ThreadNumber =3D 0=0D else:=0D @@ -2568,7 +2781,9 @@ def ThreadNum(): except (ImportError, NotImplementedError):=0D ThreadNumber =3D 1=0D return ThreadNumber=0D -## Tool entrance method=0D +=0D +=0D +# Tool entrance method=0D #=0D # This method mainly dispatch specific methods per the command line option= s.=0D # If no error found, return zero value so the caller of this tool can know= =0D @@ -2578,6 +2793,8 @@ def ThreadNum(): # @retval 1 Tool failed=0D #=0D LogQMaxSize =3D ThreadNum() * 10=0D +=0D +=0D def Main():=0D StartTime =3D time.time()=0D =0D @@ -2614,7 +2831,7 @@ def Main(): =0D if Option.WarningAsError =3D=3D True:=0D EdkLogger.SetWarningAsError()=0D - Log_Agent =3D LogAgent(LogQ,LogLevel,Option.LogFile)=0D + Log_Agent =3D LogAgent(LogQ, LogLevel, Option.LogFile)=0D Log_Agent.start()=0D =0D if platform.platform().find("Windows") >=3D 0:=0D @@ -2623,7 +2840,8 @@ def Main(): GlobalData.gIsWindows =3D False=0D =0D EdkLogger.quiet("Build environment: %s" % platform.platform())=0D - EdkLogger.quiet(time.strftime("Build start time: %H:%M:%S, %b.%d %Y\n"= , time.localtime()));=0D + EdkLogger.quiet(time.strftime(=0D + "Build start time: %H:%M:%S, %b.%d %Y\n", time.localtime()))=0D ReturnCode =3D 0=0D MyBuild =3D None=0D BuildError =3D True=0D @@ -2654,7 +2872,8 @@ def Main(): =0D WorkingDirectory =3D os.getcwd()=0D if not Option.ModuleFile:=0D - FileList =3D glob.glob(os.path.normpath(os.path.join(WorkingDi= rectory, '*.inf')))=0D + FileList =3D glob.glob(os.path.normpath(=0D + os.path.join(WorkingDirectory, '*.inf')))=0D FileNum =3D len(FileList)=0D if FileNum >=3D 2:=0D EdkLogger.error("build", OPTION_NOT_SUPPORTED, "There are = %d INF files in %s." % (FileNum, WorkingDirectory),=0D @@ -2663,33 +2882,37 @@ def Main(): Option.ModuleFile =3D NormFile(FileList[0], Workspace)=0D =0D if Option.ModuleFile:=0D - if os.path.isabs (Option.ModuleFile):=0D - if os.path.normcase (os.path.normpath(Option.ModuleFile)).= find (Workspace) =3D=3D 0:=0D - Option.ModuleFile =3D NormFile(os.path.normpath(Option= .ModuleFile), Workspace)=0D + if os.path.isabs(Option.ModuleFile):=0D + if os.path.normcase(os.path.normpath(Option.ModuleFile)).f= ind(Workspace) =3D=3D 0:=0D + Option.ModuleFile =3D NormFile(=0D + os.path.normpath(Option.ModuleFile), Workspace)=0D Option.ModuleFile =3D PathClass(Option.ModuleFile, Workspace)= =0D ErrorCode, ErrorInfo =3D Option.ModuleFile.Validate(".inf", Fa= lse)=0D if ErrorCode !=3D 0:=0D EdkLogger.error("build", ErrorCode, ExtraData=3DErrorInfo)= =0D =0D if Option.PlatformFile is not None:=0D - if os.path.isabs (Option.PlatformFile):=0D - if os.path.normcase (os.path.normpath(Option.PlatformFile)= ).find (Workspace) =3D=3D 0:=0D - Option.PlatformFile =3D NormFile(os.path.normpath(Opti= on.PlatformFile), Workspace)=0D + if os.path.isabs(Option.PlatformFile):=0D + if os.path.normcase(os.path.normpath(Option.PlatformFile))= .find(Workspace) =3D=3D 0:=0D + Option.PlatformFile =3D NormFile(=0D + os.path.normpath(Option.PlatformFile), Workspace)= =0D Option.PlatformFile =3D PathClass(Option.PlatformFile, Workspa= ce)=0D =0D if Option.FdfFile is not None:=0D - if os.path.isabs (Option.FdfFile):=0D - if os.path.normcase (os.path.normpath(Option.FdfFile)).fin= d (Workspace) =3D=3D 0:=0D - Option.FdfFile =3D NormFile(os.path.normpath(Option.Fd= fFile), Workspace)=0D + if os.path.isabs(Option.FdfFile):=0D + if os.path.normcase(os.path.normpath(Option.FdfFile)).find= (Workspace) =3D=3D 0:=0D + Option.FdfFile =3D NormFile(=0D + os.path.normpath(Option.FdfFile), Workspace)=0D Option.FdfFile =3D PathClass(Option.FdfFile, Workspace)=0D ErrorCode, ErrorInfo =3D Option.FdfFile.Validate(".fdf", False= )=0D if ErrorCode !=3D 0:=0D EdkLogger.error("build", ErrorCode, ExtraData=3DErrorInfo)= =0D =0D if Option.Flag is not None and Option.Flag not in ['-c', '-s']:=0D - EdkLogger.error("build", OPTION_VALUE_INVALID, "UNI flag must = be one of -c or -s")=0D + EdkLogger.error("build", OPTION_VALUE_INVALID,=0D + "UNI flag must be one of -c or -s")=0D =0D - MyBuild =3D Build(Target, Workspace, Option,LogQ)=0D + MyBuild =3D Build(Target, Workspace, Option, LogQ)=0D GlobalData.gCommandLineDefines['ARCH'] =3D ' '.join(MyBuild.ArchLi= st)=0D if not (MyBuild.LaunchPrebuildFlag and os.path.exists(MyBuild.Plat= formBuildPath)):=0D MyBuild.Launch()=0D @@ -2703,7 +2926,8 @@ def Main(): # for multi-thread build exits safely=0D MyBuild.Relinquish()=0D if Option is not None and Option.debug is not None:=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_versio= n(), sys.platform) + traceback.format_exc())=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.forma= t_exc())=0D ReturnCode =3D X.args[0]=0D except Warning as X:=0D # error from Fdf parser=0D @@ -2711,9 +2935,11 @@ def Main(): # for multi-thread build exits safely=0D MyBuild.Relinquish()=0D if Option is not None and Option.debug is not None:=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_versio= n(), sys.platform) + traceback.format_exc())=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.forma= t_exc())=0D else:=0D - EdkLogger.error(X.ToolName, FORMAT_INVALID, File=3DX.FileName,= Line=3DX.LineNumber, ExtraData=3DX.Message, RaiseError=3DFalse)=0D + EdkLogger.error(X.ToolName, FORMAT_INVALID, File=3DX.FileName,= =0D + Line=3DX.LineNumber, ExtraData=3DX.Message, Ra= iseError=3DFalse)=0D ReturnCode =3D FORMAT_INVALID=0D except KeyboardInterrupt:=0D if MyBuild is not None:=0D @@ -2722,7 +2948,8 @@ def Main(): MyBuild.Relinquish()=0D ReturnCode =3D ABORT_ERROR=0D if Option is not None and Option.debug is not None:=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_versio= n(), sys.platform) + traceback.format_exc())=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.forma= t_exc())=0D except:=0D if MyBuild is not None:=0D # for multi-thread build exits safely=0D @@ -2736,13 +2963,14 @@ def Main(): MetaFile =3D Tb.tb_frame.f_locals['self'].MetaFile=0D Tb =3D Tb.tb_next=0D EdkLogger.error(=0D - "\nbuild",=0D - CODE_ERROR,=0D - "Unknown fatal error when processing [%s]" % MetaFile,= =0D - ExtraData=3D"\n(Please send email to %s for help, atta= ching following call stack trace!)\n" % MSG_EDKII_MAIL_ADDR,=0D - RaiseError=3DFalse=0D - )=0D - EdkLogger.quiet("(Python %s on %s) " % (platform.python_version(),= sys.platform) + traceback.format_exc())=0D + "\nbuild",=0D + CODE_ERROR,=0D + "Unknown fatal error when processing [%s]" % MetaFile,=0D + ExtraData=3D"\n(Please send email to %s for help, attaching fo= llowing call stack trace!)\n" % MSG_EDKII_MAIL_ADDR,=0D + RaiseError=3DFalse=0D + )=0D + EdkLogger.quiet("(Python %s on %s) " % (=0D + platform.python_version(), sys.platform) + traceback.format_ex= c())=0D ReturnCode =3D CODE_ERROR=0D finally:=0D Utils.Progressor.Abort()=0D @@ -2763,27 +2991,32 @@ def Main(): BuildDuration =3D time.gmtime(int(round(FinishTime - StartTime)))=0D BuildDurationStr =3D ""=0D if BuildDuration.tm_yday > 1:=0D - BuildDurationStr =3D time.strftime("%H:%M:%S", BuildDuration) + ",= %d day(s)" % (BuildDuration.tm_yday - 1)=0D + BuildDurationStr =3D time.strftime(=0D + "%H:%M:%S", BuildDuration) + ", %d day(s)" % (BuildDuration.tm= _yday - 1)=0D else:=0D BuildDurationStr =3D time.strftime("%H:%M:%S", BuildDuration)=0D if MyBuild is not None:=0D if not BuildError:=0D - MyBuild.BuildReport.GenerateReport(BuildDurationStr, LogBuildT= ime(MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogBuildTime(MyBu= ild.GenFdsTime))=0D + MyBuild.BuildReport.GenerateReport(BuildDurationStr, LogBuildT= ime(=0D + MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogB= uildTime(MyBuild.GenFdsTime))=0D =0D EdkLogger.SetLevel(EdkLogger.QUIET)=0D EdkLogger.quiet("\n- %s -" % Conclusion)=0D - EdkLogger.quiet(time.strftime("Build end time: %H:%M:%S, %b.%d %Y", ti= me.localtime()))=0D + EdkLogger.quiet(time.strftime(=0D + "Build end time: %H:%M:%S, %b.%d %Y", time.localtime()))=0D EdkLogger.quiet("Build total time: %s\n" % BuildDurationStr)=0D Log_Agent.kill()=0D Log_Agent.join()=0D return ReturnCode=0D =0D +=0D if __name__ =3D=3D '__main__':=0D try:=0D mp.set_start_method('spawn')=0D except:=0D pass=0D r =3D Main()=0D - ## 0-127 is a safe return range, and 1 is a standard default error=0D - if r < 0 or r > 127: r =3D 1=0D + # 0-127 is a safe return range, and 1 is a standard default error=0D + if r < 0 or r > 127:=0D + r =3D 1=0D sys.exit(r)=0D diff --git a/BaseTools/Source/Python/build/buildoptions.py b/BaseTools/Sour= ce/Python/build/buildoptions.py index 39d92cff209d..c662b833c049 100644 --- a/BaseTools/Source/Python/build/buildoptions.py +++ b/BaseTools/Source/Python/build/buildoptions.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # build a platform or a module=0D #=0D # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
        =0D @@ -16,12 +16,15 @@ __version__ =3D "%prog Version " + VersionNumber __copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s reserved."=0D =0D gParamCheck =3D []=0D +=0D +=0D def SingleCheckCallback(option, opt_str, value, parser):=0D if option not in gParamCheck:=0D setattr(parser.values, option.dest, value)=0D gParamCheck.append(option)=0D else:=0D - parser.error("Option %s only allows one instance in command line!"= % option)=0D + parser.error(=0D + "Option %s only allows one instance in command line!" % option= )=0D =0D =0D class MyOptionParser():=0D @@ -39,67 +42,89 @@ class MyOptionParser(): self.BuildTarget =3D None=0D =0D def GetOption(self):=0D - Parser =3D OptionParser(description=3D__copyright__, version=3D__v= ersion__, prog=3D"build.exe", usage=3D"%prog [options] [all|fds|genc|genmak= e|clean|cleanall|cleanlib|modules|libraries|run]")=0D + Parser =3D OptionParser(description=3D__copyright__, version=3D__v= ersion__, prog=3D"build.exe",=0D + usage=3D"%prog [options] [all|fds|genc|genma= ke|clean|cleanall|cleanlib|modules|libraries|run]")=0D Parser.add_option("-a", "--arch", action=3D"append", dest=3D"Targe= tArch",=0D - help=3D"ARCHS is one of list: IA32, X64, ARM, AARCH64, RISCV64= or EBC, which overrides target.txt's TARGET_ARCH definition. To specify mo= re archs, please repeat this option.")=0D + help=3D"ARCHS is one of list: IA32, X64, ARM, AA= RCH64, RISCV64 or EBC, which overrides target.txt's TARGET_ARCH definition.= To specify more archs, please repeat this option.")=0D Parser.add_option("-p", "--platform", action=3D"callback", type=3D= "string", dest=3D"PlatformFile", callback=3DSingleCheckCallback,=0D - help=3D"Build the platform specified by the DSC file name argu= ment, overriding target.txt's ACTIVE_PLATFORM definition.")=0D + help=3D"Build the platform specified by the DSC = file name argument, overriding target.txt's ACTIVE_PLATFORM definition.")=0D Parser.add_option("-m", "--module", action=3D"callback", type=3D"s= tring", dest=3D"ModuleFile", callback=3DSingleCheckCallback,=0D - help=3D"Build the module specified by the INF file name argume= nt.")=0D + help=3D"Build the module specified by the INF fi= le name argument.")=0D Parser.add_option("-b", "--buildtarget", type=3D"string", dest=3D"= BuildTarget", help=3D"Using the TARGET to build the platform, overriding ta= rget.txt's TARGET definition.",=0D action=3D"append")=0D Parser.add_option("-t", "--tagname", action=3D"append", type=3D"st= ring", dest=3D"ToolChain",=0D - help=3D"Using the Tool Chain Tagname to build the platform, ov= erriding target.txt's TOOL_CHAIN_TAG definition.")=0D + help=3D"Using the Tool Chain Tagname to build th= e platform, overriding target.txt's TOOL_CHAIN_TAG definition.")=0D Parser.add_option("-x", "--sku-id", action=3D"callback", type=3D"s= tring", dest=3D"SkuId", callback=3DSingleCheckCallback,=0D - help=3D"Using this name of SKU ID to build the platform, overr= iding SKUID_IDENTIFIER in DSC file.")=0D + help=3D"Using this name of SKU ID to build the p= latform, overriding SKUID_IDENTIFIER in DSC file.")=0D =0D Parser.add_option("-n", action=3D"callback", type=3D"int", dest=3D= "ThreadNumber", callback=3DSingleCheckCallback,=0D - help=3D"Build the platform using multi-threaded compiler. The = value overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. When value is se= t to 0, tool automatically detect number of "\=0D - "processor threads, set value to 1 means disable multi-th= read build, and set value to more than 1 means user specify the threads num= ber to build.")=0D + help=3D"Build the platform using multi-threaded = compiler. The value overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. Wh= en value is set to 0, tool automatically detect number of "=0D + "processor threads, set value to 1 means disable= multi-thread build, and set value to more than 1 means user specify the th= reads number to build.")=0D =0D Parser.add_option("-f", "--fdf", action=3D"callback", type=3D"stri= ng", dest=3D"FdfFile", callback=3DSingleCheckCallback,=0D - help=3D"The name of the FDF file to use, which overrides the s= etting in the DSC file.")=0D + help=3D"The name of the FDF file to use, which o= verrides the setting in the DSC file.")=0D Parser.add_option("-r", "--rom-image", action=3D"append", type=3D"= string", dest=3D"RomImage", default=3D[],=0D - help=3D"The name of FD to be generated. The name must be from = [FD] section in FDF file.")=0D + help=3D"The name of FD to be generated. The name= must be from [FD] section in FDF file.")=0D Parser.add_option("-i", "--fv-image", action=3D"append", type=3D"s= tring", dest=3D"FvImage", default=3D[],=0D - help=3D"The name of FV to be generated. The name must be from = [FV] section in FDF file.")=0D + help=3D"The name of FV to be generated. The name= must be from [FV] section in FDF file.")=0D Parser.add_option("-C", "--capsule-image", action=3D"append", type= =3D"string", dest=3D"CapName", default=3D[],=0D - help=3D"The name of Capsule to be generated. The name must be = from [Capsule] section in FDF file.")=0D - Parser.add_option("-u", "--skip-autogen", action=3D"store_true", d= est=3D"SkipAutoGen", help=3D"Skip AutoGen step.")=0D - Parser.add_option("-e", "--re-parse", action=3D"store_true", dest= =3D"Reparse", help=3D"Re-parse all meta-data files.")=0D + help=3D"The name of Capsule to be generated. The= name must be from [Capsule] section in FDF file.")=0D + Parser.add_option("-u", "--skip-autogen", action=3D"store_true",=0D + dest=3D"SkipAutoGen", help=3D"Skip AutoGen step.= ")=0D + Parser.add_option("-e", "--re-parse", action=3D"store_true",=0D + dest=3D"Reparse", help=3D"Re-parse all meta-data= files.")=0D =0D - Parser.add_option("-c", "--case-insensitive", action=3D"store_true= ", dest=3D"CaseInsensitive", default=3DFalse, help=3D"Don't check case of f= ile name.")=0D + Parser.add_option("-c", "--case-insensitive", action=3D"store_true= ",=0D + dest=3D"CaseInsensitive", default=3DFalse, help= =3D"Don't check case of file name.")=0D =0D - Parser.add_option("-w", "--warning-as-error", action=3D"store_true= ", dest=3D"WarningAsError", help=3D"Treat warning in tools as error.")=0D - Parser.add_option("-j", "--log", action=3D"store", dest=3D"LogFile= ", help=3D"Put log in specified file as well as on console.")=0D + Parser.add_option("-w", "--warning-as-error", action=3D"store_true= ",=0D + dest=3D"WarningAsError", help=3D"Treat warning i= n tools as error.")=0D + Parser.add_option("-j", "--log", action=3D"store", dest=3D"LogFile= ",=0D + help=3D"Put log in specified file as well as on = console.")=0D =0D Parser.add_option("-s", "--silent", action=3D"store_true", type=3D= None, dest=3D"SilentMode",=0D - help=3D"Make use of silent mode of (n)make.")=0D - Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DN= one, help=3D"Disable all messages except FATAL ERRORS.")=0D - Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "\=0D - = "including library instances selected, final dependency expression= , "\=0D - = "and warning messages, etc.")=0D - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= help=3D"Enable debug messages at specified level.")=0D - Parser.add_option("-D", "--define", action=3D"append", type=3D"str= ing", dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\".")=0D + help=3D"Make use of silent mode of (n)make.")=0D + Parser.add_option("-q", "--quiet", action=3D"store_true",=0D + type=3DNone, help=3D"Disable all messages except= FATAL ERRORS.")=0D + Parser.add_option("-v", "--verbose", action=3D"store_true", type= =3DNone, help=3D"Turn on verbose output with informational messages printed= , "=0D + "including library instances selected, final dep= endency expression, "=0D + "and warning messages, etc.")=0D + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int",= =0D + help=3D"Enable debug messages at specified level= .")=0D + Parser.add_option("-D", "--define", action=3D"append", type=3D"str= ing",=0D + dest=3D"Macros", help=3D"Macro: \"Name [=3D Valu= e]\".")=0D =0D - Parser.add_option("-y", "--report-file", action=3D"store", dest=3D= "ReportFile", help=3D"Create/overwrite the report to the specified filename= .")=0D + Parser.add_option("-y", "--report-file", action=3D"store", dest=3D= "ReportFile",=0D + help=3D"Create/overwrite the report to the speci= fied filename.")=0D Parser.add_option("-Y", "--report-type", action=3D"append", type= =3D"choice", choices=3D['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', = 'FIXED_ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest=3D"ReportType", default= =3D[],=0D - help=3D"Flags that control the type of build report to generat= e. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS= , HASH, EXECUTION_ORDER]. "\=0D - "To specify more than one flag, repeat this option on the= command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH= , BUILD_FLAGS, FIXED_ADDRESS]")=0D + help=3D"Flags that control the type of build rep= ort to generate. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS,= FIXED_ADDRESS, HASH, EXECUTION_ORDER]. "=0D + "To specify more than one flag, repeat this opti= on on the command line and the default flag set is [PCD, LIBRARY, FLASH, DE= PEX, HASH, BUILD_FLAGS, FIXED_ADDRESS]")=0D Parser.add_option("-F", "--flag", action=3D"store", type=3D"string= ", dest=3D"Flag",=0D - help=3D"Specify the specific option to parse EDK UNI file. Mus= t be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK = UEFI UNI file. "\=0D - "This option can also be specified by setting *_*_*_BUILD= _FLAGS in [BuildOptions] section of platform DSC. If they are both specifie= d, this value "\=0D - "will override the setting in [BuildOptions] section of p= latform DSC.")=0D - Parser.add_option("-N", "--no-cache", action=3D"store_true", dest= =3D"DisableCache", default=3DFalse, help=3D"Disable build cache mechanism")= =0D - Parser.add_option("--conf", action=3D"store", type=3D"string", des= t=3D"ConfDirectory", help=3D"Specify the customized Conf directory.")=0D - Parser.add_option("--check-usage", action=3D"store_true", dest=3D"= CheckUsage", default=3DFalse, help=3D"Check usage content of entries listed= in INF file.")=0D - Parser.add_option("--ignore-sources", action=3D"store_true", dest= =3D"IgnoreSources", default=3DFalse, help=3D"Focus to a binary build and ig= nore all source files")=0D - Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd", = help=3D"Set PCD value by command line. Format: \"PcdName=3DValue\" ")=0D - Parser.add_option("-l", "--cmd-len", action=3D"store", type=3D"int= ", dest=3D"CommandLength", help=3D"Specify the maximum line length of build= command. Default is 4096.")=0D - Parser.add_option("--hash", action=3D"store_true", dest=3D"UseHash= Cache", default=3DFalse, help=3D"Enable hash-based caching during build pro= cess.")=0D - Parser.add_option("--binary-destination", action=3D"store", type= =3D"string", dest=3D"BinCacheDest", help=3D"Generate a cache of binary file= s in the specified directory.")=0D - Parser.add_option("--binary-source", action=3D"store", type=3D"str= ing", dest=3D"BinCacheSource", help=3D"Consume a cache of binary files from= the specified directory.")=0D - Parser.add_option("--genfds-multi-thread", action=3D"store_true", = dest=3D"GenfdsMultiThread", default=3DTrue, help=3D"Enable GenFds multi thr= ead to generate ffs file.")=0D - Parser.add_option("--no-genfds-multi-thread", action=3D"store_true= ", dest=3D"NoGenfdsMultiThread", default=3DFalse, help=3D"Disable GenFds mu= lti thread to generate ffs file.")=0D - Parser.add_option("--disable-include-path-check", action=3D"store_= true", dest=3D"DisableIncludePathCheck", default=3DFalse, help=3D"Disable t= he include path check for outside of package.")=0D + help=3D"Specify the specific option to parse EDK= UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and = -s is for EDK UEFI UNI file. "=0D + "This option can also be specified by setting *_= *_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both= specified, this value "=0D + "will override the setting in [BuildOptions] sec= tion of platform DSC.")=0D + Parser.add_option("-N", "--no-cache", action=3D"store_true",=0D + dest=3D"DisableCache", default=3DFalse, help=3D"= Disable build cache mechanism")=0D + Parser.add_option("--conf", action=3D"store", type=3D"string",=0D + dest=3D"ConfDirectory", help=3D"Specify the cust= omized Conf directory.")=0D + Parser.add_option("--check-usage", action=3D"store_true", dest=3D"= CheckUsage",=0D + default=3DFalse, help=3D"Check usage content of = entries listed in INF file.")=0D + Parser.add_option("--ignore-sources", action=3D"store_true", dest= =3D"IgnoreSources",=0D + default=3DFalse, help=3D"Focus to a binary build= and ignore all source files")=0D + Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd",= =0D + help=3D"Set PCD value by command line. Format: \= "PcdName=3DValue\" ")=0D + Parser.add_option("-l", "--cmd-len", action=3D"store", type=3D"int= ", dest=3D"CommandLength",=0D + help=3D"Specify the maximum line length of build= command. Default is 4096.")=0D + Parser.add_option("--hash", action=3D"store_true", dest=3D"UseHash= Cache",=0D + default=3DFalse, help=3D"Enable hash-based cachi= ng during build process.")=0D + Parser.add_option("--binary-destination", action=3D"store", type= =3D"string", dest=3D"BinCacheDest",=0D + help=3D"Generate a cache of binary files in the = specified directory.")=0D + Parser.add_option("--binary-source", action=3D"store", type=3D"str= ing", dest=3D"BinCacheSource",=0D + help=3D"Consume a cache of binary files from the= specified directory.")=0D + Parser.add_option("--genfds-multi-thread", action=3D"store_true", = dest=3D"GenfdsMultiThread",=0D + default=3DTrue, help=3D"Enable GenFds multi thre= ad to generate ffs file.")=0D + Parser.add_option("--no-genfds-multi-thread", action=3D"store_true= ", dest=3D"NoGenfdsMultiThread",=0D + default=3DFalse, help=3D"Disable GenFds multi th= read to generate ffs file.")=0D + Parser.add_option("--disable-include-path-check", action=3D"store_= true", dest=3D"DisableIncludePathCheck",=0D + default=3DFalse, help=3D"Disable the include pat= h check for outside of package.")=0D self.BuildOption, self.BuildTarget =3D Parser.parse_args()=0D diff --git a/BaseTools/Source/Python/sitecustomize.py b/BaseTools/Source/Py= thon/sitecustomize.py index 50783e1b3af0..a0bc2546bc92 100644 --- a/BaseTools/Source/Python/sitecustomize.py +++ b/BaseTools/Source/Python/sitecustomize.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D #=0D #=0D # Copyright (c) 2009 - 2014, Apple Inc. All rights reserved.
        =0D @@ -8,8 +8,7 @@ import sys import locale=0D =0D if sys.platform =3D=3D "darwin" and sys.version_info[0] < 3:=0D - DefaultLocal =3D locale.getdefaultlocale()[1]=0D - if DefaultLocal is None:=0D - DefaultLocal =3D 'UTF8'=0D - sys.setdefaultencoding(DefaultLocal)=0D -=0D + DefaultLocal =3D locale.getdefaultlocale()[1]=0D + if DefaultLocal is None:=0D + DefaultLocal =3D 'UTF8'=0D + sys.setdefaultencoding(DefaultLocal)=0D diff --git a/BaseTools/Source/Python/tests/Split/test_split.py b/BaseTools/= Source/Python/tests/Split/test_split.py index e4866be390b3..4a7a23ba6464 100644 --- a/BaseTools/Source/Python/tests/Split/test_split.py +++ b/BaseTools/Source/Python/tests/Split/test_split.py @@ -59,15 +59,15 @@ class TestSplit(unittest.TestCase): "Binary.bin",=0D "Binary1.bin",=0D r"output/Binary1.bin",=0D - os.path.abspath( r"output/Binary1.bin")=0D - ]=0D + os.path.abspath(r"output/Binary1.bin")=0D + ]=0D expected_output =3D [=0D - os.path.join(os.path.dirname(self.binary_file),"Binary.bin1" )= ,=0D - os.path.join(os.getcwd(),"Binary.bin"),=0D - os.path.join(os.getcwd(),"Binary1.bin"),=0D - os.path.join(os.getcwd(),r"output/Binary1.bin"),=0D - os.path.join(os.path.abspath( r"output/Binary1.bin"))=0D - ]=0D + os.path.join(os.path.dirname(self.binary_file), "Binary.bin1")= ,=0D + os.path.join(os.getcwd(), "Binary.bin"),=0D + os.path.join(os.getcwd(), "Binary1.bin"),=0D + os.path.join(os.getcwd(), r"output/Binary1.bin"),=0D + os.path.join(os.path.abspath(r"output/Binary1.bin"))=0D + ]=0D for index, o in enumerate(output):=0D try:=0D sp.splitFile(self.binary_file, 123, outputfile1=3Do)=0D @@ -84,26 +84,27 @@ class TestSplit(unittest.TestCase): r"output1/output2",=0D os.path.abspath("output"),=0D "output"=0D - ]=0D + ]=0D output =3D [=0D None,=0D None,=0D "Binary1.bin",=0D r"output/Binary1.bin",=0D - os.path.abspath( r"output_1/Binary1.bin")=0D - ]=0D + os.path.abspath(r"output_1/Binary1.bin")=0D + ]=0D =0D expected_output =3D [=0D - os.path.join(os.path.dirname(self.binary_file),"Binary.bin1" )= ,=0D - os.path.join(os.getcwd(),"output", "Binary.bin1"),=0D - os.path.join(os.getcwd(), r"output1/output2" , "Binary1.bin"),= =0D - os.path.join(os.getcwd(),r"output", "output/Binary1.bin"),=0D - os.path.join(os.path.abspath( r"output/Binary1.bin"))=0D - ]=0D + os.path.join(os.path.dirname(self.binary_file), "Binary.bin1")= ,=0D + os.path.join(os.getcwd(), "output", "Binary.bin1"),=0D + os.path.join(os.getcwd(), r"output1/output2", "Binary1.bin"),= =0D + os.path.join(os.getcwd(), r"output", "output/Binary1.bin"),=0D + os.path.join(os.path.abspath(r"output/Binary1.bin"))=0D + ]=0D =0D for index, o in enumerate(outputfolder):=0D try:=0D - sp.splitFile(self.binary_file, 123, outputdir=3Do,outputfi= le1=3Doutput[index])=0D + sp.splitFile(self.binary_file, 123, outputdir=3Do,=0D + outputfile1=3Doutput[index])=0D except Exception as e:=0D self.assertTrue(False, msg=3D"splitFile function error")=0D =0D diff --git a/BaseTools/Tests/CToolsTests.py b/BaseTools/Tests/CToolsTests.py index 2bc1b62d40ba..b487dc4f7f05 100644 --- a/BaseTools/Tests/CToolsTests.py +++ b/BaseTools/Tests/CToolsTests.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for C based BaseTools=0D #=0D # Copyright (c) 2008, Intel Corporation. All rights reserved.
        =0D @@ -16,14 +16,14 @@ import unittest import TianoCompress=0D modules =3D (=0D TianoCompress,=0D - )=0D +)=0D =0D =0D def TheTestSuite():=0D suites =3D list(map(lambda module: module.TheTestSuite(), modules))=0D return unittest.TestSuite(suites)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D allTests =3D TheTestSuite()=0D unittest.TextTestRunner().run(allTests)=0D -=0D diff --git a/BaseTools/Tests/CheckPythonSyntax.py b/BaseTools/Tests/CheckPy= thonSyntax.py index 099920721f5a..cf37e452d8f3 100644 --- a/BaseTools/Tests/CheckPythonSyntax.py +++ b/BaseTools/Tests/CheckPythonSyntax.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for checking syntax of Python source code=0D #=0D # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -15,6 +15,7 @@ import py_compile =0D import TestTools=0D =0D +=0D class Tests(TestTools.BaseToolsTest):=0D =0D def setUp(self):=0D @@ -26,6 +27,7 @@ class Tests(TestTools.BaseToolsTest): except Exception as e:=0D self.fail('syntax error: %s, Error is %s' % (filename, str(e))= )=0D =0D +=0D def MakePythonSyntaxCheckTests():=0D def GetAllPythonSourceFiles():=0D pythonSourceFiles =3D []=0D @@ -33,8 +35,8 @@ def MakePythonSyntaxCheckTests(): for filename in files:=0D if filename.lower().endswith('.py'):=0D pythonSourceFiles.append(=0D - os.path.join(root, filename)=0D - )=0D + os.path.join(root, filename)=0D + )=0D return pythonSourceFiles=0D =0D def MakeTestName(filename):=0D @@ -46,16 +48,17 @@ def MakePythonSyntaxCheckTests(): =0D def MakeNewTest(filename):=0D test =3D MakeTestName(filename)=0D - newmethod =3D lambda self: self.SingleFileTest(filename)=0D + def newmethod(self): return self.SingleFileTest(filename)=0D setattr(=0D Tests,=0D test,=0D newmethod=0D - )=0D + )=0D =0D for filename in GetAllPythonSourceFiles():=0D MakeNewTest(filename)=0D =0D +=0D MakePythonSyntaxCheckTests()=0D del MakePythonSyntaxCheckTests=0D =0D @@ -64,5 +67,3 @@ TheTestSuite =3D TestTools.MakeTheTestSuite(locals()) if __name__ =3D=3D '__main__':=0D allTests =3D TheTestSuite()=0D unittest.TextTestRunner().run(allTests)=0D -=0D -=0D diff --git a/BaseTools/Tests/CheckUnicodeSourceFiles.py b/BaseTools/Tests/C= heckUnicodeSourceFiles.py index 1502402619e1..ede49af0e2b1 100644 --- a/BaseTools/Tests/CheckUnicodeSourceFiles.py +++ b/BaseTools/Tests/CheckUnicodeSourceFiles.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for AutoGen.UniClassObject=0D #=0D # Copyright (c) 2015, Intel Corporation. All rights reserved.
        =0D @@ -22,6 +22,7 @@ import AutoGen.UniClassObject as BtUni from Common import EdkLogger=0D EdkLogger.InitializeForUnitTest()=0D =0D +=0D class Tests(TestTools.BaseToolsTest):=0D =0D SampleData =3D u'''=0D @@ -168,6 +169,7 @@ class Tests(TestTools.BaseToolsTest): =0D self.CheckFile(encoding=3DNone, shouldPass=3DFalse, string=3Ddata)= =0D =0D +=0D TheTestSuite =3D TestTools.MakeTheTestSuite(locals())=0D =0D if __name__ =3D=3D '__main__':=0D diff --git a/BaseTools/Tests/PythonTest.py b/BaseTools/Tests/PythonTest.py index ec44c7947086..f5480eb6b611 100644 --- a/BaseTools/Tests/PythonTest.py +++ b/BaseTools/Tests/PythonTest.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Test whether PYTHON_COMMAND is available=0D #=0D # Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
        =0D diff --git a/BaseTools/Tests/PythonToolsTests.py b/BaseTools/Tests/PythonTo= olsTests.py index 05b27ab03335..3258c8aa4d27 100644 --- a/BaseTools/Tests/PythonToolsTests.py +++ b/BaseTools/Tests/PythonToolsTests.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for Python based BaseTools=0D #=0D # Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
        = =0D @@ -22,7 +22,7 @@ def TheTestSuite(): suites.append(CheckUnicodeSourceFiles.TheTestSuite())=0D return unittest.TestSuite(suites)=0D =0D +=0D if __name__ =3D=3D '__main__':=0D allTests =3D TheTestSuite()=0D unittest.TextTestRunner().run(allTests)=0D -=0D diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py index 934683a44654..ae16599bb45f 100644 --- a/BaseTools/Tests/RunTests.py +++ b/BaseTools/Tests/RunTests.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for BaseTools utilities=0D #=0D # Copyright (c) 2008, Intel Corporation. All rights reserved.
        =0D @@ -15,18 +15,21 @@ import unittest =0D import TestTools=0D =0D +=0D def GetCTestSuite():=0D import CToolsTests=0D return CToolsTests.TheTestSuite()=0D =0D +=0D def GetPythonTestSuite():=0D import PythonToolsTests=0D return PythonToolsTests.TheTestSuite()=0D =0D +=0D def GetAllTestsSuite():=0D return unittest.TestSuite([GetCTestSuite(), GetPythonTestSuite()])=0D =0D +=0D if __name__ =3D=3D '__main__':=0D allTests =3D GetAllTestsSuite()=0D unittest.TextTestRunner(verbosity=3D2).run(allTests)=0D -=0D diff --git a/BaseTools/Tests/TestRegularExpression.py b/BaseTools/Tests/Tes= tRegularExpression.py index 3e6c5f446383..3b6190978714 100644 --- a/BaseTools/Tests/TestRegularExpression.py +++ b/BaseTools/Tests/TestRegularExpression.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Routines for generating Pcd Database=0D #=0D # Copyright (c) 2018, Intel Corporation. All rights reserved.
        =0D @@ -8,6 +8,7 @@ import unittest from Common.Misc import RemoveCComments=0D from Workspace.BuildClassObject import ArrayIndex=0D =0D +=0D class TestRe(unittest.TestCase):=0D def test_ccomments(self):=0D TestStr1 =3D """ {0x01,0x02} """=0D @@ -42,7 +43,9 @@ class TestRe(unittest.TestCase): self.assertEquals(['[1]'], ArrayIndex.findall(TestStr1))=0D =0D TestStr2 =3D """[1][2][0x1][0x01][]"""=0D - self.assertEquals(['[1]','[2]','[0x1]','[0x01]','[]'], ArrayIndex.= findall(TestStr2))=0D + self.assertEquals(['[1]', '[2]', '[0x1]', '[0x01]',=0D + '[]'], ArrayIndex.findall(TestStr2))=0D +=0D =0D if __name__ =3D=3D '__main__':=0D unittest.main()=0D diff --git a/BaseTools/Tests/TestTools.py b/BaseTools/Tests/TestTools.py index 1099fd4eeaea..3ff294721aef 100644 --- a/BaseTools/Tests/TestTools.py +++ b/BaseTools/Tests/TestTools.py @@ -1,5 +1,5 @@ from __future__ import print_function=0D -## @file=0D +# @file=0D # Utility functions and classes for BaseTools unit tests=0D #=0D # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
        = =0D @@ -33,6 +33,7 @@ if PythonSourceDir not in sys.path: #=0D sys.path.append(PythonSourceDir)=0D =0D +=0D def MakeTheTestSuite(localItems):=0D tests =3D []=0D for name, item in localItems.items():=0D @@ -43,26 +44,30 @@ def MakeTheTestSuite(localItems): tests.append(item())=0D return lambda: unittest.TestSuite(tests)=0D =0D +=0D def GetBaseToolsPaths():=0D if sys.platform in ('win32', 'win64'):=0D - return [ os.path.join(BaseToolsDir, 'Bin', sys.platform.title()) ]= =0D + return [os.path.join(BaseToolsDir, 'Bin', sys.platform.title())]=0D else:=0D uname =3D os.popen('uname -sm').read().strip()=0D for char in (' ', '/'):=0D uname =3D uname.replace(char, '-')=0D return [=0D - os.path.join(BaseToolsDir, 'Bin', uname),=0D - os.path.join(BaseToolsDir, 'BinWrappers', uname),=0D - os.path.join(BaseToolsDir, 'BinWrappers', 'PosixLike')=0D - ]=0D + os.path.join(BaseToolsDir, 'Bin', uname),=0D + os.path.join(BaseToolsDir, 'BinWrappers', uname),=0D + os.path.join(BaseToolsDir, 'BinWrappers', 'PosixLike')=0D + ]=0D +=0D =0D BaseToolsBinPaths =3D GetBaseToolsPaths()=0D =0D +=0D class BaseToolsTest(unittest.TestCase):=0D =0D def cleanOutDir(self, dir):=0D for dirItem in os.listdir(dir):=0D - if dirItem in ('.', '..'): continue=0D + if dirItem in ('.', '..'):=0D + continue=0D dirItem =3D os.path.join(dir, dirItem)=0D self.RemoveFileOrDir(dirItem)=0D =0D @@ -103,12 +108,17 @@ class BaseToolsTest(unittest.TestCase): return bin=0D =0D def RunTool(self, *args, **kwd):=0D - if 'toolName' in kwd: toolName =3D kwd['toolName']=0D - else: toolName =3D None=0D - if 'logFile' in kwd: logFile =3D kwd['logFile']=0D - else: logFile =3D None=0D + if 'toolName' in kwd:=0D + toolName =3D kwd['toolName']=0D + else:=0D + toolName =3D None=0D + if 'logFile' in kwd:=0D + logFile =3D kwd['logFile']=0D + else:=0D + logFile =3D None=0D =0D - if toolName is None: toolName =3D self.toolName=0D + if toolName is None:=0D + toolName =3D self.toolName=0D bin =3D self.FindToolBin(toolName)=0D if logFile is not None:=0D logFile =3D open(os.path.join(self.testDir, logFile), 'w')=0D @@ -121,7 +131,7 @@ class BaseToolsTest(unittest.TestCase): Proc =3D subprocess.Popen(=0D args, executable=3Dbin,=0D stdout=3DpopenOut, stderr=3Dsubprocess.STDOUT=0D - )=0D + )=0D =0D if logFile is None:=0D Proc.stdout.read()=0D @@ -131,7 +141,7 @@ class BaseToolsTest(unittest.TestCase): def GetTmpFilePath(self, fileName):=0D return os.path.join(self.testDir, fileName)=0D =0D - def OpenTmpFile(self, fileName, mode =3D 'r'):=0D + def OpenTmpFile(self, fileName, mode=3D'r'):=0D return open(os.path.join(self.testDir, fileName), mode)=0D =0D def ReadTmpFile(self, fileName):=0D @@ -148,19 +158,22 @@ class BaseToolsTest(unittest.TestCase): with codecs.open(self.GetTmpFilePath(fileName), 'w', encoding= =3D'utf-8') as f:=0D f.write(data)=0D =0D - def GenRandomFileData(self, fileName, minlen =3D None, maxlen =3D None= ):=0D - if maxlen is None: maxlen =3D minlen=0D + def GenRandomFileData(self, fileName, minlen=3DNone, maxlen=3DNone):=0D + if maxlen is None:=0D + maxlen =3D minlen=0D f =3D self.OpenTmpFile(fileName, 'w')=0D f.write(self.GetRandomString(minlen, maxlen))=0D f.close()=0D =0D - def GetRandomString(self, minlen =3D None, maxlen =3D None):=0D - if minlen is None: minlen =3D 1024=0D - if maxlen is None: maxlen =3D minlen=0D + def GetRandomString(self, minlen=3DNone, maxlen=3DNone):=0D + if minlen is None:=0D + minlen =3D 1024=0D + if maxlen is None:=0D + maxlen =3D minlen=0D return ''.join(=0D [chr(random.randint(0, 255))=0D for x in range(random.randint(minlen, maxlen))=0D - ])=0D + ])=0D =0D def setUp(self):=0D self.savedEnvPath =3D os.environ['PATH']=0D @@ -181,4 +194,3 @@ class BaseToolsTest(unittest.TestCase): =0D os.environ['PATH'] =3D self.savedEnvPath=0D sys.path =3D self.savedSysPath=0D -=0D diff --git a/BaseTools/Tests/TianoCompress.py b/BaseTools/Tests/TianoCompre= ss.py index 685968b18fb3..ffe0ae61a11f 100644 --- a/BaseTools/Tests/TianoCompress.py +++ b/BaseTools/Tests/TianoCompress.py @@ -1,4 +1,4 @@ -## @file=0D +# @file=0D # Unit tests for TianoCompress utility=0D #=0D # Copyright (c) 2008, Intel Corporation. All rights reserved.
        =0D @@ -17,6 +17,7 @@ import unittest =0D import TestTools=0D =0D +=0D class Tests(TestTools.BaseToolsTest):=0D =0D def setUp(self):=0D @@ -25,7 +26,7 @@ class Tests(TestTools.BaseToolsTest): =0D def testHelp(self):=0D result =3D self.RunTool('--help', logFile=3D'help')=0D - #self.DisplayFile('help')=0D + # self.DisplayFile('help')=0D self.assertTrue(result =3D=3D 0)=0D =0D def compressionTestCycle(self, data):=0D @@ -35,13 +36,13 @@ class Tests(TestTools.BaseToolsTest): '-e',=0D '-o', self.GetTmpFilePath('output1'),=0D self.GetTmpFilePath('input')=0D - )=0D + )=0D self.assertTrue(result =3D=3D 0)=0D result =3D self.RunTool(=0D '-d',=0D '-o', self.GetTmpFilePath('output2'),=0D self.GetTmpFilePath('output1')=0D - )=0D + )=0D self.assertTrue(result =3D=3D 0)=0D start =3D self.ReadTmpFile('input')=0D finish =3D self.ReadTmpFile('output2')=0D @@ -50,7 +51,8 @@ class Tests(TestTools.BaseToolsTest): print()=0D print('Original data did not match decompress(compress(data))'= )=0D self.DisplayBinaryData('original data', start)=0D - self.DisplayBinaryData('after compression', self.ReadTmpFile('= output1'))=0D + self.DisplayBinaryData('after compression',=0D + self.ReadTmpFile('output1'))=0D self.DisplayBinaryData('after decompression', finish)=0D self.assertTrue(startEqualsFinish)=0D =0D @@ -60,10 +62,9 @@ class Tests(TestTools.BaseToolsTest): self.compressionTestCycle(data)=0D self.CleanUpTmpDir()=0D =0D +=0D TheTestSuite =3D TestTools.MakeTheTestSuite(locals())=0D =0D if __name__ =3D=3D '__main__':=0D allTests =3D TheTestSuite()=0D unittest.TextTestRunner().run(allTests)=0D -=0D -=0D --=20 2.37.3