]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Ecc/CodeFragment.py
2 # fragments of source file
4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 # SPDX-License-Identifier: BSD-2-Clause-Patent
10 ## The description of comment contents and start & end position
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).
22 def __init__(self
, Str
, Begin
, End
, CommentType
):
26 self
.Type
= CommentType
28 ## The description of preprocess directives and start & end position
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.
39 def __init__(self
, Str
, Begin
, End
):
44 ## The description of predicate expression and start & end position
47 class PredicateExpression
:
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.
55 def __init__(self
, Str
, Begin
, End
):
60 ## The description of function definition and start & end position
63 class FunctionDefinition
:
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.
72 def __init__(self
, ModifierStr
, DeclStr
, Begin
, End
, LBPos
, NamePos
):
73 self
.Modifier
= ModifierStr
74 self
.Declarator
= DeclStr
77 self
.LeftBracePos
= LBPos
78 self
.NamePos
= NamePos
80 ## The description of variable declaration and start & end position
83 class VariableDeclaration
:
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.
91 def __init__(self
, ModifierStr
, DeclStr
, Begin
, NamePos
):
92 self
.Modifier
= ModifierStr
93 self
.Declarator
= DeclStr
95 self
.NameStartPos
= NamePos
97 ## The description of enum definition and start & end position
100 class EnumerationDefinition
:
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.
108 def __init__(self
, Str
, Begin
, End
):
110 self
.StartPos
= Begin
113 ## The description of struct/union definition and start & end position
116 class StructUnionDefinition
:
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.
124 def __init__(self
, Str
, Begin
, End
):
126 self
.StartPos
= Begin
129 ## The description of 'Typedef' definition and start & end position
132 class TypedefDefinition
:
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.
140 def __init__(self
, FromStr
, ToStr
, Begin
, End
):
141 self
.FromType
= FromStr
143 self
.StartPos
= Begin
146 class FunctionCalling
:
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.
154 def __init__(self
, Name
, Param
, Begin
, End
):
156 self
.ParamList
= Param
157 self
.StartPos
= Begin