2 # fragments of source file
4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
13 from __future__
import absolute_import
15 import Common
.LongFilePathOs
as os
16 from Ecc
.ParserWarning
import Warning
17 from Common
.LongFilePathSupport
import OpenLongFilePath
as open
21 PredicateExpressionList
= []
22 FunctionDefinitionList
= []
23 VariableDeclarationList
= []
24 EnumerationDefinitionList
= []
25 StructUnionDefinitionList
= []
26 TypedefDefinitionList
= []
27 FunctionCallingList
= []
29 ## record file data when parsing source
31 # May raise Exception when opening file.
37 # @param self The object pointer
38 # @param FileName The file that to be parsed
40 def __init__(self
, FileName
):
41 self
.FileLinesList
= []
42 self
.FileLinesListFromFile
= []
44 fsock
= open(FileName
, "r")
46 self
.FileLinesListFromFile
= fsock
.readlines()
51 raise Warning("Error when opening file %s" % FileName
)