]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/Python/Eot/CodeFragment.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / Eot / CodeFragment.py
CommitLineData
52302d4d
LG
1## @file\r
2# fragments of source file\r
3#\r
40d841f6 4# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
52302d4d 5#\r
2e351cbe 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
52302d4d
LG
7#\r
8\r
9\r
10## The description of comment contents and start & end position\r
11#\r
12#\r
13class Comment :\r
14 ## The constructor\r
15 #\r
16 # @param self The object pointer\r
17 # @param Str The message to record\r
18 # @param Begin The start position tuple.\r
19 # @param End The end position tuple.\r
20 # @param CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).\r
21 #\r
22 def __init__(self, Str, Begin, End, CommentType):\r
23 self.Content = Str\r
24 self.StartPos = Begin\r
25 self.EndPos = End\r
26 self.Type = CommentType\r
27\r
28## The description of preprocess directives and start & end position\r
29#\r
30#\r
31class PP_Directive :\r
32 ## The constructor\r
33 #\r
34 # @param self The object pointer\r
35 # @param Str The message to record\r
36 # @param Begin The start position tuple.\r
37 # @param End The end position tuple.\r
38 #\r
39 def __init__(self, Str, Begin, End):\r
40 self.Content = Str\r
41 self.StartPos = Begin\r
42 self.EndPos = End\r
43\r
44## The description of assignment expression and start & end position\r
45#\r
46#\r
47class AssignmentExpression :\r
48 ## The constructor\r
49 #\r
50 # @param self The object pointer\r
51 # @param Str The message to record\r
52 # @param Begin The start position tuple.\r
53 # @param End The end position tuple.\r
54 #\r
55 def __init__(self, Lvalue, Op, Exp, Begin, End):\r
56 self.Name = Lvalue\r
57 self.Operator = Op\r
58 self.Value = Exp\r
59 self.StartPos = Begin\r
60 self.EndPos = End\r
61\r
62## The description of predicate expression and start & end position\r
63#\r
64#\r
65class PredicateExpression :\r
66 ## The constructor\r
67 #\r
68 # @param self The object pointer\r
69 # @param Str The message to record\r
70 # @param Begin The start position tuple.\r
71 # @param End The end position tuple.\r
72 #\r
73 def __init__(self, Str, Begin, End):\r
74 self.Content = Str\r
75 self.StartPos = Begin\r
76 self.EndPos = End\r
77\r
78## The description of function definition and start & end position\r
79#\r
80#\r
81class FunctionDefinition :\r
82 ## The constructor\r
83 #\r
84 # @param self The object pointer\r
85 # @param Str The message to record\r
86 # @param Begin The start position tuple.\r
87 # @param End The end position tuple.\r
88 # @param LBPos The left brace position tuple.\r
89 #\r
90 def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):\r
91 self.Modifier = ModifierStr\r
92 self.Declarator = DeclStr\r
93 self.StartPos = Begin\r
94 self.EndPos = End\r
95 self.LeftBracePos = LBPos\r
96 self.NamePos = NamePos\r
97\r
98## The description of variable declaration and start & end position\r
99#\r
100#\r
101class VariableDeclaration :\r
102 ## The constructor\r
103 #\r
104 # @param self The object pointer\r
105 # @param Str The message to record\r
106 # @param Begin The start position tuple.\r
107 # @param End The end position tuple.\r
108 #\r
109 def __init__(self, ModifierStr, DeclStr, Begin, End):\r
110 self.Modifier = ModifierStr\r
111 self.Declarator = DeclStr\r
112 self.StartPos = Begin\r
113 self.EndPos = End\r
114\r
115## The description of enum definition and start & end position\r
116#\r
117#\r
118class EnumerationDefinition :\r
119 ## The constructor\r
120 #\r
121 # @param self The object pointer\r
122 # @param Str The message to record\r
123 # @param Begin The start position tuple.\r
124 # @param End The end position tuple.\r
125 #\r
126 def __init__(self, Str, Begin, End):\r
127 self.Content = Str\r
128 self.StartPos = Begin\r
129 self.EndPos = End\r
130\r
131## The description of struct/union definition and start & end position\r
132#\r
133#\r
134class StructUnionDefinition :\r
135 ## The constructor\r
136 #\r
137 # @param self The object pointer\r
138 # @param Str The message to record\r
139 # @param Begin The start position tuple.\r
140 # @param End The end position tuple.\r
141 #\r
142 def __init__(self, Str, Begin, End):\r
143 self.Content = Str\r
144 self.StartPos = Begin\r
145 self.EndPos = End\r
146\r
147## The description of 'Typedef' definition and start & end position\r
148#\r
149#\r
150class TypedefDefinition :\r
151 ## The constructor\r
152 #\r
153 # @param self The object pointer\r
154 # @param Str The message to record\r
155 # @param Begin The start position tuple.\r
156 # @param End The end position tuple.\r
157 #\r
158 def __init__(self, FromStr, ToStr, Begin, End):\r
159 self.FromType = FromStr\r
160 self.ToType = ToStr\r
161 self.StartPos = Begin\r
162 self.EndPos = End\r
163\r
164## The description of function calling definition and start & end position\r
165#\r
166#\r
167class FunctionCalling:\r
168 ## The constructor\r
169 #\r
170 # @param self The object pointer\r
171 # @param Str The message to record\r
172 # @param Begin The start position tuple.\r
173 # @param End The end position tuple.\r
174 #\r
175 def __init__(self, Name, Param, Begin, End):\r
176 self.FuncName = Name\r
177 self.ParamList = Param\r
178 self.StartPos = Begin\r
179 self.EndPos = End\r