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