2 # fragments of source file
4 # Copyright (c) 2007 - 2014, 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 .ParserWarning
import Warning
17 from Common
.LongFilePathSupport
import OpenLongFilePath
as open
19 # Profile contents of a file
21 AssignmentExpressionList
= []
22 PredicateExpressionList
= []
23 FunctionDefinitionList
= []
24 VariableDeclarationList
= []
25 EnumerationDefinitionList
= []
26 StructUnionDefinitionList
= []
27 TypedefDefinitionList
= []
28 FunctionCallingList
= []
32 # record file data when parsing source
34 # May raise Exception when opening file.
40 # @param self: The object pointer
41 # @param FileName: The file that to be parsed
43 def __init__(self
, FileName
):
44 self
.FileLinesList
= []
45 self
.FileLinesListFromFile
= []
47 fsock
= open(FileName
, "rb", 0)
49 self
.FileLinesListFromFile
= fsock
.readlines()
54 raise Warning("Error when opening file %s" % FileName
)