InfPpiObject.py revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
## @file
# This file is used to define class objects of INF file [Ppis] 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.
'''
InfPpiObject
'''
PreNotify = None
PreUsage = None
PreHelpText = ''
BlockFlag = -1
CommentInsList = []
Count = 0
for CommentItem in CommentsList:
['PPI'],
#
# To avoid PyLint error
#
pass
if CommentItemHelpText == None:
CommentItemHelpText = ''
#
# For the Last comment Item, set BlockFlag.
#
BlockFlag = 4
else:
BlockFlag = 3
elif BlockFlag == -1:
BlockFlag = 4
#
# Comment USAGE and NOTIFY information are "UNDEFINED"
#
if BlockFlag == -1:
BlockFlag = 1
elif BlockFlag == 1:
BlockFlag = 2
else:
BlockFlag = 3
#
# An item have Usage or Notify information and the first time get this information
#
elif BlockFlag == -1:
BlockFlag = 4
#
# Combine two comment line if they are generic comment
#
#
# Store this information for next line may still need combine operation.
#
if BlockFlag == 4:
BlockFlag = -1
PreUsage = None
PreNotify = None
PreHelpText = ''
elif BlockFlag == 3:
#
# Add previous help string
#
#
# Add Current help string
#
BlockFlag = -1
PreUsage = None
PreNotify = None
PreHelpText = ''
else:
return InfPpiItemObj
class InfPpiItemCommentContent():
#
# ## SOMETIMES_CONSUMES ## HelpString
#
#
# Help String
#
self.CommentList = []
def GetHelpStringItem(self):
return self.HelpStringItem
class InfPpiItem():
self.SupArchList = []
self.CommentList = []
def GetSupArchList(self):
return self.SupArchList
def GetCommentList(self):
return self.CommentList
def GetFeatureFlagExp(self):
return self.FeatureFlagExp
##
#
#
#
class InfPpiObject():
#
# Macro defined in this section should be only used in this section.
#
__SupArchList = []
#
# Validate Arch
#
ArchItem = 'COMMON'
#
# Get Comment content of this protocol
#
CommentsList = None
#
# Only CName contained
#
else:
#
# Have FeatureFlag information
#
#
# Contained CName and Feature Flag Express
# <statements> ::= <CName> ["|" <FeatureFlagExpress>]
# Item[1] should not be empty
#
#
# Validate Feature Flag Express for PPI entry
# Item[1] contain FFE information
#
if not FeatureFlagRtv[0]:
#
# Invalid format of Ppi statement
#
#
#
else:
#
# Determine PPI name duplicate. Follow below rule:
#
# A PPI must not be duplicated within a [Ppis] section.
# A PPI may appear in multiple architectural [Ppis]
# sections. A PPI listed in an architectural [Ppis]
# section must not be listed in the common architectural
# [Ppis] section.
#
# NOTE: This check will not report error now.
#
for ItemArch in ItemSupArchList:
for PpiItemObjArch in __SupArchList:
if ItemArch == PpiItemObjArch:
#
# ST.ERR_INF_PARSER_ITEM_DUPLICATE
#
pass
#
# ST.ERR_INF_PARSER_ITEM_DUPLICATE_COMMON
#
pass
else:
PpiList = []
return True