]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/Python/Ecc/CodeFragment.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / CodeFragment.py
CommitLineData
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## The description of comment contents and start & end position\r
17#\r
18#\r
19class Comment :\r
20 ## The constructor\r
21 #\r
22 # @param self The object pointer\r
23 # @param Str The message to record\r
24 # @param Begin The start position tuple.\r
25 # @param End The end position tuple.\r
26 # @param CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).\r
27 #\r
28 def __init__(self, Str, Begin, End, CommentType):\r
29 self.Content = Str\r
30 self.StartPos = Begin\r
31 self.EndPos = End\r
32 self.Type = CommentType\r
33\r
34## The description of preprocess directives and start & end position\r
35#\r
36#\r
37class PP_Directive :\r
38 ## The constructor\r
39 #\r
40 # @param self The object pointer\r
41 # @param Str The message to record\r
42 # @param Begin The start position tuple.\r
43 # @param End The end position tuple.\r
44 #\r
45 def __init__(self, Str, Begin, End):\r
46 self.Content = Str\r
47 self.StartPos = Begin\r
48 self.EndPos = End\r
49\r
50## The description of predicate expression and start & end position\r
51#\r
52#\r
53class PredicateExpression :\r
54 ## The constructor\r
55 #\r
56 # @param self The object pointer\r
57 # @param Str The message to record\r
58 # @param Begin The start position tuple.\r
59 # @param End The end position tuple.\r
60 #\r
61 def __init__(self, Str, Begin, End):\r
62 self.Content = Str\r
63 self.StartPos = Begin\r
64 self.EndPos = End\r
65\r
66## The description of function definition and start & end position\r
67#\r
68#\r
69class FunctionDefinition :\r
70 ## The constructor\r
71 #\r
72 # @param self The object pointer\r
73 # @param Str The message to record\r
74 # @param Begin The start position tuple.\r
75 # @param End The end position tuple.\r
76 # @param LBPos The left brace position tuple.\r
77 #\r
78 def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):\r
79 self.Modifier = ModifierStr\r
80 self.Declarator = DeclStr\r
81 self.StartPos = Begin\r
82 self.EndPos = End\r
83 self.LeftBracePos = LBPos\r
84 self.NamePos = NamePos\r
85\r
86## The description of variable declaration and start & end position\r
87#\r
88#\r
89class VariableDeclaration :\r
90 ## The constructor\r
91 #\r
92 # @param self The object pointer\r
93 # @param Str The message to record\r
94 # @param Begin The start position tuple.\r
95 # @param NamePos The name position tuple.\r
96 #\r
97 def __init__(self, ModifierStr, DeclStr, Begin, NamePos):\r
98 self.Modifier = ModifierStr\r
99 self.Declarator = DeclStr\r
100 self.StartPos = Begin\r
101 self.NameStartPos = NamePos\r
102\r
103## The description of enum definition and start & end position\r
104#\r
105#\r
106class EnumerationDefinition :\r
107 ## The constructor\r
108 #\r
109 # @param self The object pointer\r
110 # @param Str The message to record\r
111 # @param Begin The start position tuple.\r
112 # @param End The end position tuple.\r
113 #\r
114 def __init__(self, Str, Begin, End):\r
115 self.Content = Str\r
116 self.StartPos = Begin\r
117 self.EndPos = End\r
118\r
119## The description of struct/union definition and start & end position\r
120#\r
121#\r
122class StructUnionDefinition :\r
123 ## The constructor\r
124 #\r
125 # @param self The object pointer\r
126 # @param Str The message to record\r
127 # @param Begin The start position tuple.\r
128 # @param End The end position tuple.\r
129 #\r
130 def __init__(self, Str, Begin, End):\r
131 self.Content = Str\r
132 self.StartPos = Begin\r
133 self.EndPos = End\r
134\r
135## The description of 'Typedef' definition and start & end position\r
136#\r
137#\r
138class TypedefDefinition :\r
139 ## The constructor\r
140 #\r
141 # @param self The object pointer\r
142 # @param Str The message to record\r
143 # @param Begin The start position tuple.\r
144 # @param End The end position tuple.\r
145 #\r
146 def __init__(self, FromStr, ToStr, Begin, End):\r
147 self.FromType = FromStr\r
148 self.ToType = ToStr\r
149 self.StartPos = Begin\r
150 self.EndPos = End\r
151\r
152class FunctionCalling:\r
153 ## The constructor\r
154 #\r
155 # @param self The object pointer\r
156 # @param Str The message to record\r
157 # @param Begin The start position tuple.\r
158 # @param End The end position tuple.\r
159 #\r
160 def __init__(self, Name, Param, Begin, End):\r
161 self.FuncName = Name\r
162 self.ParamList = Param\r
163 self.StartPos = Begin\r
164 self.EndPos = End \r
165