## @file
# This file contained the parser for define sections in INF file
#
# 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.
#
'''
InfDefineSectionParser
'''
##
# Import Modules
#
import re
## __GetValidateArchList
#
#
TempArch = ''
ArchList = []
NewArchList = []
if IsValidArch(Arch):
return ArchList
if SectionComment:
pass
#
# Parser Defines section content and fill self._ContentList dict.
#
HeaderComments = []
SectionContent = ''
ArchList = []
_ContentList = []
_ValueList = []
#
# Add WORKSPACE to global Marco dict.
#
for Line in SectionString:
TailComments = ''
LineComment = None
continue
#
# The first time encountered VALIDATE_ARCHITECHERS will be considered as support arch list.
#
if not ArchList:
#
# Parser Comment
#
#
# Last line is comments, and this line go on.
#
if StillCommentFalg:
continue
#
# First time encounter comment
#
else:
#
# Clear original data
#
HeaderComments = []
continue
else:
LineCommentContent = ''
for Item in HeaderComments:
#
# Find Tail comment.
#
if LineComment == None:
#
# Find Macro
#
if Name != None:
continue
#
# Replace with [Defines] section Macro
#
None, True)
if not _ValueList[0]:
if not _ValueList[1]:
if (LineComment != None):
HeaderComments = []
TailComments = ''
#
# Current Define section archs
#
if not ArchList:
ArchList = ['COMMON']