summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/Eot/CodeFragment.py
blob: db5f40a6a4ed51e1f73933a46ed2b338298efc3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
## @file
# fragments of source file
#
#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
#
#  This program and the accompanying materials
#  are licensed and made available under the terms and conditions of the BSD License
#  which accompanies this distribution.  The full text of the license may be found at
#  http://opensource.org/licenses/bsd-license.php
#
#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#


## The description of comment contents and start & end position
#
#
class Comment :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #   @param  CommentType The type of comment (T_COMMENT_TWO_SLASH or T_COMMENT_SLASH_STAR).
    #
    def __init__(self, Str, Begin, End, CommentType):
        self.Content = Str
        self.StartPos = Begin
        self.EndPos = End
        self.Type = CommentType

## The description of preprocess directives and start & end position
#
#
class PP_Directive :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Str, Begin, End):
        self.Content = Str
        self.StartPos = Begin
        self.EndPos = End

## The description of assignment expression and start & end position
#
#
class AssignmentExpression :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Lvalue, Op, Exp, Begin, End):
        self.Name = Lvalue
        self.Operator = Op
        self.Value = Exp
        self.StartPos = Begin
        self.EndPos = End

## The description of predicate expression and start & end position
#
#
class PredicateExpression :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Str, Begin, End):
        self.Content = Str
        self.StartPos = Begin
        self.EndPos = End

## The description of function definition and start & end position
#
#
class FunctionDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #   @param  LBPos       The left brace position tuple.
    #
    def __init__(self, ModifierStr, DeclStr, Begin, End, LBPos, NamePos):
        self.Modifier = ModifierStr
        self.Declarator = DeclStr
        self.StartPos = Begin
        self.EndPos = End
        self.LeftBracePos = LBPos
        self.NamePos = NamePos

## The description of variable declaration and start & end position
#
#
class VariableDeclaration :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, ModifierStr, DeclStr, Begin, End):
        self.Modifier = ModifierStr
        self.Declarator = DeclStr
        self.StartPos = Begin
        self.EndPos = End

## The description of enum definition and start & end position
#
#
class EnumerationDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Str, Begin, End):
        self.Content = Str
        self.StartPos = Begin
        self.EndPos = End

## The description of struct/union definition and start & end position
#
#
class StructUnionDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Str, Begin, End):
        self.Content = Str
        self.StartPos = Begin
        self.EndPos = End

## The description of 'Typedef' definition and start & end position
#
#
class TypedefDefinition :
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, FromStr, ToStr, Begin, End):
        self.FromType = FromStr
        self.ToType = ToStr
        self.StartPos = Begin
        self.EndPos = End

## The description of function calling definition and start & end position
#
#
class FunctionCalling:
    ## The constructor
    #
    #   @param  self        The object pointer
    #   @param  Str         The message to record
    #   @param  Begin       The start position tuple.
    #   @param  End         The end position tuple.
    #
    def __init__(self, Name, Param, Begin, End):
        self.FuncName = Name
        self.ParamList = Param
        self.StartPos = Begin
        self.EndPos = End