]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Ecc/CodeFragment.py
2 # fragments of source file
4 # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
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
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.
16 ## The description of comment contents and start & end position
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).
28 def __init__(self
, Str
, Begin
, End
, CommentType
):
32 self
.Type
= CommentType
34 ## The description of preprocess directives and start & end position
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.
45 def __init__(self
, Str
, Begin
, End
):
50 ## The description of predicate expression and start & end position
53 class PredicateExpression
:
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.
61 def __init__(self
, Str
, Begin
, End
):
66 ## The description of function definition and start & end position
69 class FunctionDefinition
:
72 # @param self The object pointer
73 # @param Str The message to record
74 # @param Begin The start position tuple.
75 # @param End The end position tuple.
76 # @param LBPos The left brace position tuple.
78 def __init__(self
, ModifierStr
, DeclStr
, Begin
, End
, LBPos
, NamePos
):
79 self
.Modifier
= ModifierStr
80 self
.Declarator
= DeclStr
83 self
.LeftBracePos
= LBPos
84 self
.NamePos
= NamePos
86 ## The description of variable declaration and start & end position
89 class VariableDeclaration
:
92 # @param self The object pointer
93 # @param Str The message to record
94 # @param Begin The start position tuple.
95 # @param NamePos The name position tuple.
97 def __init__(self
, ModifierStr
, DeclStr
, Begin
, NamePos
):
98 self
.Modifier
= ModifierStr
99 self
.Declarator
= DeclStr
100 self
.StartPos
= Begin
101 self
.NameStartPos
= NamePos
103 ## The description of enum definition and start & end position
106 class EnumerationDefinition
:
109 # @param self The object pointer
110 # @param Str The message to record
111 # @param Begin The start position tuple.
112 # @param End The end position tuple.
114 def __init__(self
, Str
, Begin
, End
):
116 self
.StartPos
= Begin
119 ## The description of struct/union definition and start & end position
122 class StructUnionDefinition
:
125 # @param self The object pointer
126 # @param Str The message to record
127 # @param Begin The start position tuple.
128 # @param End The end position tuple.
130 def __init__(self
, Str
, Begin
, End
):
132 self
.StartPos
= Begin
135 ## The description of 'Typedef' definition and start & end position
138 class TypedefDefinition
:
141 # @param self The object pointer
142 # @param Str The message to record
143 # @param Begin The start position tuple.
144 # @param End The end position tuple.
146 def __init__(self
, FromStr
, ToStr
, Begin
, End
):
147 self
.FromType
= FromStr
149 self
.StartPos
= Begin
152 class FunctionCalling
:
155 # @param self The object pointer
156 # @param Str The message to record
157 # @param Begin The start position tuple.
158 # @param End The end position tuple.
160 def __init__(self
, Name
, Param
, Begin
, End
):
162 self
.ParamList
= Param
163 self
.StartPos
= Begin