## @file GenDecFile.py
#
# This file contained the logical of transfer package object to DEC files.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
'''
GenDEC
'''
#
# generate [Pcd] section
# <TokenSpcCName>.<TokenCName>|<Value>|<DatumType>|<Token>
#
ValidUsageDict = {}
#
# Generate generic comment
#
if PcdErrList:
if ValidUsage == 'FeaturePcd':
ValidUsage = 'PcdsFeatureFlag'
elif ValidUsage == 'PatchPcd':
ValidUsage = 'PcdsPatchableInModule'
elif ValidUsage == 'FixedPcd':
ValidUsage = 'PcdsFixedAtBuild'
elif ValidUsage == 'Pcd':
ValidUsage = 'PcdsDynamic'
elif ValidUsage == 'PcdEx':
ValidUsage = 'PcdsDynamicEx'
if ValidUsage in ValidUsageDict:
else:
NewSectionDict = {}
#
# generate tail comment
#
if Pcd.GetSupModuleList():
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
for ValidUsage in ValidUsageDict:
return Content
#
# generate [Guids] section
#
NewSectionDict = {}
#
# Generate generic comment
#
#
# generate tail comment
#
if Guid.GetSupModuleList():
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
#
# generate [Protocols] section
#
NewSectionDict = {}
#
# Generate generic comment
#
#
# generate tail comment
#
if Protocol.GetSupModuleList():
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
#
# generate [Ppis] section
#
NewSectionDict = {}
#
# Generate generic comment
#
#
# generate tail comment
#
if Ppi.GetSupModuleList():
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
return Content
## Transfer Package Object to Dec files
#
# Transfer all contents of a standard Package Object to a Dec file
#
# @param Package: A Package
#
#
# Init global information for the file
#
Content = ''
#
# generate header comment section
#
Package.GetDescription(), \
Package.GetCopyright(), \
#
# for each section, maintain a dict, sorted arch will be its key,
#statement list will be its data
# { 'Arch1 Arch2 Arch3': [statement1, statement2],
# 'Arch1' : [statement1, statement3]
# }
#
#
# generate [Defines] section
#
NewSectionDict = {TAB_ARCH_COMMON : []}
SpecialItemList = []
for SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
#
# generate [Includes] section
#
NewSectionDict = {}
if IncludeArchList:
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
#
# generate [LibraryClasses] section
#
NewSectionDict = {}
#
# Generate generic comment
#
if HelpStr:
#
# generate tail comment
#
if LibraryClass.GetSupModuleList():
Statement += \
if SortedArch in NewSectionDict:
NewSectionDict[SortedArch] = \
else:
#
# generate [UserExtensions] section
#
NewSectionDict = {}
if not Statement:
continue
SectionList = []
SectionName = 'UserExtensions'
if UserId:
if '.' in UserId:
if UserExtension.GetIdentifier():
if not UserExtension.GetSupArchList():
else:
return ContainerFile
## GenPcdErrComment
#
# @param PcdErrObject: PcdErrorObject
#
# @retval CommentStr: Generated comment lines, with prefix "#"
#
EndOfLine = "\n"
if ValidValueRange:
if ValidValue:
ValidValueList = \
CommentStr = \
if Expression:
return CommentStr