]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/Python/Ecc/CodeFragment.py
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / CodeFragment.py
CommitLineData
30fdf114
LG
1## @file\r
2# fragments of source file\r
3#\r
f7496d71 4# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
30fdf114 5#\r
2e351cbe 6# SPDX-License-Identifier: BSD-2-Clause-Patent\r
30fdf114
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 predicate expression and start & end position\r
45#\r
46#\r
47class PredicateExpression :\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, Str, Begin, End):\r
56 self.Content = Str\r
57 self.StartPos = Begin\r
58 self.EndPos = End\r
59\r
60## The description of function definition and start & end position\r
61#\r
62#\r
63class FunctionDefinition :\r
64 ## The constructor\r
65 #\r
66 # @param self The object pointer\r
67 # @param Str The message to record\r
68 # @param Begin The start position tuple.\r
69 # @param End The end position tuple.\r
70 # @param LBPos The left brace position tuple.\r
71 #\r
72 def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):\r
73 self.Modifier = ModifierStr\r
74 self.Declarator = DeclStr\r
75 self.StartPos = Begin\r
76 self.EndPos = End\r
77 self.LeftBracePos = LBPos\r
78 self.NamePos = NamePos\r
79\r
80## The description of variable declaration and start & end position\r
81#\r
82#\r
83class VariableDeclaration :\r
84 ## The constructor\r
85 #\r
86 # @param self The object pointer\r
87 # @param Str The message to record\r
88 # @param Begin The start position tuple.\r
89 # @param NamePos The name position tuple.\r
90 #\r
91 def __init__(self, ModifierStr, DeclStr, Begin, NamePos):\r
92 self.Modifier = ModifierStr\r
93 self.Declarator = DeclStr\r
94 self.StartPos = Begin\r
95 self.NameStartPos = NamePos\r
96\r
97## The description of enum definition and start & end position\r
98#\r
99#\r
100class EnumerationDefinition :\r
101 ## The constructor\r
102 #\r
103 # @param self The object pointer\r
104 # @param Str The message to record\r
105 # @param Begin The start position tuple.\r
106 # @param End The end position tuple.\r
107 #\r
108 def __init__(self, Str, Begin, End):\r
109 self.Content = Str\r
110 self.StartPos = Begin\r
111 self.EndPos = End\r
112\r
113## The description of struct/union definition and start & end position\r
114#\r
115#\r
116class StructUnionDefinition :\r
117 ## The constructor\r
118 #\r
119 # @param self The object pointer\r
120 # @param Str The message to record\r
121 # @param Begin The start position tuple.\r
122 # @param End The end position tuple.\r
123 #\r
124 def __init__(self, Str, Begin, End):\r
125 self.Content = Str\r
126 self.StartPos = Begin\r
127 self.EndPos = End\r
128\r
129## The description of 'Typedef' definition and start & end position\r
130#\r
131#\r
132class TypedefDefinition :\r
133 ## The constructor\r
134 #\r
135 # @param self The object pointer\r
136 # @param Str The message to record\r
137 # @param Begin The start position tuple.\r
138 # @param End The end position tuple.\r
139 #\r
140 def __init__(self, FromStr, ToStr, Begin, End):\r
141 self.FromType = FromStr\r
142 self.ToType = ToStr\r
143 self.StartPos = Begin\r
144 self.EndPos = End\r
145\r
146class FunctionCalling:\r
147 ## The constructor\r
148 #\r
149 # @param self The object pointer\r
150 # @param Str The message to record\r
151 # @param Begin The start position tuple.\r
152 # @param End The end position tuple.\r
153 #\r
154 def __init__(self, Name, Param, Begin, End):\r
155 self.FuncName = Name\r
156 self.ParamList = Param\r
157 self.StartPos = Begin\r
f7496d71
LG
158 self.EndPos = End\r
159\r