## @file
# This file contained the parser for [Pcds] 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.
#
'''
InfPcdSectionParser
'''
##
# Import Modules
#
## Section PCD related parser
#
# For 5 types of PCD list below, all use this function.
# 'FixedPcd', 'FeaturePcd', 'PatchPcd', 'Pcd', 'PcdEx'
#
# This is a INF independent parser, the validation in this parser only
# cover
#
KeysList = []
PcdList = []
CommentsList = []
ValueList = []
#
# Current section archs
#
LineIndex = -1
#
# For Common INF file
#
if not GlobalData.gIS_BINARY_INF:
#
# Macro defined in this section
#
SectionMacros = {}
for Line in SectionString:
CommentsList = []
continue
continue
else:
#
# Encounter a PCD entry
#
if PcdLineContent != '':
#
# Find Macro
#
if Name != None:
ValueList = []
CommentsList = []
continue
if not PcdEntryReturn[1]:
TokenList = ['']
else:
#
# Replace with Local section Macro and [Defines] section Macro.
#
ValueList = []
CommentsList = []
continue
#
# For Binary INF file
#
else:
for Line in SectionString:
if LineContent == '':
CommentsList = []
continue
continue
#
# Have comments at tail.
#
if CommentIndex > -1:
#
# PatchablePcd
# TokenSpace.CName | Value | Offset
#
#
ValueList = []
CommentsList = []
continue