]>
Commit | Line | Data |
---|---|---|
30fdf114 LG |
1 | ## @file\r |
2 | # fragments of source file\r | |
3 | #\r | |
40d841f6 | 4 | # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r |
30fdf114 | 5 | #\r |
40d841f6 | 6 | # This program and the accompanying materials\r |
30fdf114 LG |
7 | # are licensed and made available under the terms and conditions of the BSD License\r |
8 | # which accompanies this distribution. The full text of the license may be found at\r | |
9 | # http://opensource.org/licenses/bsd-license.php\r | |
10 | #\r | |
11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | #\r | |
14 | \r | |
15 | ##\r | |
16 | # Import Modules\r | |
17 | #\r | |
18 | \r | |
19 | import re\r | |
20 | import os\r | |
21 | from ParserWarning import Warning\r | |
22 | \r | |
23 | CommentList = []\r | |
24 | PPDirectiveList = []\r | |
25 | PredicateExpressionList = []\r | |
26 | FunctionDefinitionList = []\r | |
27 | VariableDeclarationList = []\r | |
28 | EnumerationDefinitionList = []\r | |
29 | StructUnionDefinitionList = []\r | |
30 | TypedefDefinitionList = []\r | |
31 | FunctionCallingList = []\r | |
32 | \r | |
33 | ## record file data when parsing source\r | |
34 | #\r | |
35 | # May raise Exception when opening file.\r | |
36 | #\r | |
37 | class FileProfile :\r | |
38 | \r | |
39 | ## The constructor\r | |
40 | #\r | |
41 | # @param self The object pointer\r | |
42 | # @param FileName The file that to be parsed\r | |
43 | #\r | |
44 | def __init__(self, FileName):\r | |
45 | self.FileLinesList = []\r | |
46 | self.FileLinesListFromFile = []\r | |
47 | try:\r | |
48 | fsock = open(FileName, "rb", 0)\r | |
49 | try:\r | |
50 | self.FileLinesListFromFile = fsock.readlines()\r | |
51 | finally:\r | |
52 | fsock.close()\r | |
53 | \r | |
54 | except IOError:\r | |
55 | raise Warning("Error when opening file %s" % FileName)\r | |
56 | \r | |
57 |