]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Eot/CodeFragment.py
BaseTools: Remove unused code from Misc
[mirror_edk2.git] / BaseTools / Source / Python / Eot / CodeFragment.py
1 ## @file
2 # fragments of source file
3 #
4 # Copyright (c) 2007 - 2010, 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 assignment expression and start & end position
51 #
52 #
53 class AssignmentExpression :
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, Lvalue, Op, Exp, Begin, End):
62 self.Name = Lvalue
63 self.Operator = Op
64 self.Value = Exp
65 self.StartPos = Begin
66 self.EndPos = End
67
68 ## The description of predicate expression and start & end position
69 #
70 #
71 class PredicateExpression :
72 ## The constructor
73 #
74 # @param self The object pointer
75 # @param Str The message to record
76 # @param Begin The start position tuple.
77 # @param End The end position tuple.
78 #
79 def __init__(self, Str, Begin, End):
80 self.Content = Str
81 self.StartPos = Begin
82 self.EndPos = End
83
84 ## The description of function definition and start & end position
85 #
86 #
87 class FunctionDefinition :
88 ## The constructor
89 #
90 # @param self The object pointer
91 # @param Str The message to record
92 # @param Begin The start position tuple.
93 # @param End The end position tuple.
94 # @param LBPos The left brace position tuple.
95 #
96 def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):
97 self.Modifier = ModifierStr
98 self.Declarator = DeclStr
99 self.StartPos = Begin
100 self.EndPos = End
101 self.LeftBracePos = LBPos
102 self.NamePos = NamePos
103
104 ## The description of variable declaration and start & end position
105 #
106 #
107 class VariableDeclaration :
108 ## The constructor
109 #
110 # @param self The object pointer
111 # @param Str The message to record
112 # @param Begin The start position tuple.
113 # @param End The end position tuple.
114 #
115 def __init__(self, ModifierStr, DeclStr, Begin, End):
116 self.Modifier = ModifierStr
117 self.Declarator = DeclStr
118 self.StartPos = Begin
119 self.EndPos = End
120
121 ## The description of enum definition and start & end position
122 #
123 #
124 class EnumerationDefinition :
125 ## The constructor
126 #
127 # @param self The object pointer
128 # @param Str The message to record
129 # @param Begin The start position tuple.
130 # @param End The end position tuple.
131 #
132 def __init__(self, Str, Begin, End):
133 self.Content = Str
134 self.StartPos = Begin
135 self.EndPos = End
136
137 ## The description of struct/union definition and start & end position
138 #
139 #
140 class StructUnionDefinition :
141 ## The constructor
142 #
143 # @param self The object pointer
144 # @param Str The message to record
145 # @param Begin The start position tuple.
146 # @param End The end position tuple.
147 #
148 def __init__(self, Str, Begin, End):
149 self.Content = Str
150 self.StartPos = Begin
151 self.EndPos = End
152
153 ## The description of 'Typedef' definition and start & end position
154 #
155 #
156 class TypedefDefinition :
157 ## The constructor
158 #
159 # @param self The object pointer
160 # @param Str The message to record
161 # @param Begin The start position tuple.
162 # @param End The end position tuple.
163 #
164 def __init__(self, FromStr, ToStr, Begin, End):
165 self.FromType = FromStr
166 self.ToType = ToStr
167 self.StartPos = Begin
168 self.EndPos = End
169
170 ## The description of function calling definition and start & end position
171 #
172 #
173 class FunctionCalling:
174 ## The constructor
175 #
176 # @param self The object pointer
177 # @param Str The message to record
178 # @param Begin The start position tuple.
179 # @param End The end position tuple.
180 #
181 def __init__(self, Name, Param, Begin, End):
182 self.FuncName = Name
183 self.ParamList = Param
184 self.StartPos = Begin
185 self.EndPos = End