InfGuidObject.py revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
## @file
# This file is used to define class objects of INF file [Guids] section.
# It will consumed by InfParser.
#
# 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.
'''
InfGuidObject
'''
class InfGuidItemCommentContent():
#
# ## SOMETIMES_CONSUMES ## Variable:L"MemoryTypeInformation"
# TailString.
#
#
# SOMETIMES_CONSUMES
#
#
# Variable
#
#
# MemoryTypeInformation
#
#
# TailString
#
def GetUsageItem(self):
def GetGuidTypeItem(self):
return self.GuidTypeItem
def GetVariableNameItem(self):
return self.VariableNameItem
def GetHelpStringItem(self):
return self.HelpStringItem
class InfGuidItem():
#
# A list contain instance of InfGuidItemCommentContent
#
self.CommentList = []
self.SupArchList = []
def GetFeatureFlagExp(self):
return self.FeatureFlagExp
def GetCommentList(self):
return self.CommentList
def GetSupArchList(self):
return self.SupArchList
## ParseComment
#
# ParseComment
#
#
#
CommentInsList = []
PreUsage = None
PreGuidType = None
PreHelpText = ''
BlockFlag = -1
Count = 0
for CommentItem in CommentsList:
[],
True)
if CommentItemHelpText == None:
CommentItemHelpText = ''
BlockFlag = 4
else:
BlockFlag = 3
if BlockFlag == -1:
BlockFlag = 4
if BlockFlag == -1:
BlockFlag = 1
elif BlockFlag == 1:
BlockFlag = 2
else:
BlockFlag = 3
elif BlockFlag == -1:
BlockFlag = 4
#
# Combine two comment line if they are generic comment
#
if BlockFlag == 4:
BlockFlag = -1
PreUsage = None
PreGuidType = None
PreHelpText = ''
elif BlockFlag == 3:
#
# Add previous help string
#
#
# Add Current help string
#
BlockFlag = -1
PreUsage = None
PreGuidType = None
PreHelpText = ''
else:
else:
#
#
return InfGuidItemObj
## InfGuidObject
#
# InfGuidObject
#
class InfGuidObject():
#
# Macro defined in this section should be only used in this section.
#
__SupportArchList = []
#
# Validate Arch
#
ArchItem = 'COMMON'
#
# Get Comment content of this protocol
#
CommentsList = None
#
# Only GuildName contained
#
else:
#
# Contained CName and Feature Flag Express
# <statements> ::= <CName> ["|" <FeatureFlagExpress>]
# For GUID entry.
#
#
# Validate Feature Flag Express
#
if not FeatureFlagRtv[0]:
#
# Invalid format of GUID statement
#
#
# Determine GUID name duplicate. Follow below rule:
#
# A GUID must not be duplicated within a [Guids] section.
# A GUID may appear in multiple architectural [Guids]
# sections. A GUID listed in an architectural [Guids]
# section must not be listed in the common architectural
# [Guids] section.
#
# NOTE: This check will not report error now.
#
for ItemArch in ItemSupArchList:
for GuidItemObjArch in __SupportArchList:
if ItemArch == GuidItemObjArch:
#
# ST.ERR_INF_PARSER_ITEM_DUPLICATE
#
pass
#
# ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
#
pass
else:
GuidList = []
return True