]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Ecc/CodeFragment.py
BaseTools: Replace StandardError with Expression
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / CodeFragment.py
1 ## @file
2 # fragments of source file
3 #
4 # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14
15
16 ## The description of comment contents and start & end position
17 #
18 #
19 class Comment :
20 ## The constructor
21 #
22 # @param self The object pointer
23 # @param Str The message to record
24 # @param Begin The start position tuple.
25 # @param End The end position tuple.
26 # @param CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).
27 #
28 def __init__(self, Str, Begin, End, CommentType):
29 self.Content = Str
30 self.StartPos = Begin
31 self.EndPos = End
32 self.Type = CommentType
33
34 ## The description of preprocess directives and start & end position
35 #
36 #
37 class PP_Directive :
38 ## The constructor
39 #
40 # @param self The object pointer
41 # @param Str The message to record
42 # @param Begin The start position tuple.
43 # @param End The end position tuple.
44 #
45 def __init__(self, Str, Begin, End):
46 self.Content = Str
47 self.StartPos = Begin
48 self.EndPos = End
49
50 ## The description of predicate expression and start & end position
51 #
52 #
53 class PredicateExpression :
54 ## The constructor
55 #
56 # @param self The object pointer
57 # @param Str The message to record
58 # @param Begin The start position tuple.
59 # @param End The end position tuple.
60 #
61 def __init__(self, Str, Begin, End):
62 self.Content = Str
63 self.StartPos = Begin
64 self.EndPos = End
65
66 ## The description of function definition and start & end position
67 #
68 #
69 class FunctionDefinition :
70 ## The constructor
71 #
72 # @param self The object pointer
73 # @param Str The message to record
74 # @param Begin The start position tuple.
75 # @param End The end position tuple.
76 # @param LBPos The left brace position tuple.
77 #
78 def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):
79 self.Modifier = ModifierStr
80 self.Declarator = DeclStr
81 self.StartPos = Begin
82 self.EndPos = End
83 self.LeftBracePos = LBPos
84 self.NamePos = NamePos
85
86 ## The description of variable declaration and start & end position
87 #
88 #
89 class VariableDeclaration :
90 ## The constructor
91 #
92 # @param self The object pointer
93 # @param Str The message to record
94 # @param Begin The start position tuple.
95 # @param NamePos The name position tuple.
96 #
97 def __init__(self, ModifierStr, DeclStr, Begin, NamePos):
98 self.Modifier = ModifierStr
99 self.Declarator = DeclStr
100 self.StartPos = Begin
101 self.NameStartPos = NamePos
102
103 ## The description of enum definition and start & end position
104 #
105 #
106 class EnumerationDefinition :
107 ## The constructor
108 #
109 # @param self The object pointer
110 # @param Str The message to record
111 # @param Begin The start position tuple.
112 # @param End The end position tuple.
113 #
114 def __init__(self, Str, Begin, End):
115 self.Content = Str
116 self.StartPos = Begin
117 self.EndPos = End
118
119 ## The description of struct/union definition and start & end position
120 #
121 #
122 class StructUnionDefinition :
123 ## The constructor
124 #
125 # @param self The object pointer
126 # @param Str The message to record
127 # @param Begin The start position tuple.
128 # @param End The end position tuple.
129 #
130 def __init__(self, Str, Begin, End):
131 self.Content = Str
132 self.StartPos = Begin
133 self.EndPos = End
134
135 ## The description of 'Typedef' definition and start & end position
136 #
137 #
138 class TypedefDefinition :
139 ## The constructor
140 #
141 # @param self The object pointer
142 # @param Str The message to record
143 # @param Begin The start position tuple.
144 # @param End The end position tuple.
145 #
146 def __init__(self, FromStr, ToStr, Begin, End):
147 self.FromType = FromStr
148 self.ToType = ToStr
149 self.StartPos = Begin
150 self.EndPos = End
151
152 class FunctionCalling:
153 ## The constructor
154 #
155 # @param self The object pointer
156 # @param Str The message to record
157 # @param Begin The start position tuple.
158 # @param End The end position tuple.
159 #
160 def __init__(self, Name, Param, Begin, End):
161 self.FuncName = Name
162 self.ParamList = Param
163 self.StartPos = Begin
164 self.EndPos = End
165