Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.3 KiB
Python
Raw Permalink Normal View History

## @file
# fragments of source file
#
2018-07-05 17:40:04 +08:00
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
2018-07-13 18:18:42 +08:00
from __future__ import absolute_import
import re
import Common.LongFilePathOs as os
2018-08-08 11:18:06 +08:00
from Ecc.ParserWarning import Warning
from Common.LongFilePathSupport import OpenLongFilePath as open
CommentList = []
PPDirectiveList = []
PredicateExpressionList = []
FunctionDefinitionList = []
VariableDeclarationList = []
EnumerationDefinitionList = []
StructUnionDefinitionList = []
TypedefDefinitionList = []
FunctionCallingList = []
## record file data when parsing source
#
# May raise Exception when opening file.
#
class FileProfile :
2018-07-05 17:40:04 +08:00
## The constructor
#
# @param self The object pointer
# @param FileName The file that to be parsed
#
def __init__(self, FileName):
self.FileLinesList = []
self.FileLinesListFromFile = []
try:
2019-01-04 17:35:10 +08:00
fsock = open(FileName, "r")
try:
self.FileLinesListFromFile = fsock.readlines()
finally:
fsock.close()
except IOError:
raise Warning("Error when opening file %s" % FileName)