Files
edk2-upstream/BaseTools/Source/Python/Eot/CodeFragment.py
Pierre Gondois 3c2f04a3c7 BaseTools: Eot: Remove unnecessary code
Running the vulture tool on the Eot folder gave the following
report. Remove the unnecessary code.

- Eot/CodeFragment.py:47:
  unused class 'AssignmentExpression' (60% confidence)
- Eot/CodeFragmentCollector.py:75:
  unused attribute '__Token' (60% confidence)
- Eot/CodeFragmentCollector.py:76:
  unused attribute '__SkippedChars' (60% confidence)
- Eot/CodeFragmentCollector.py:104:
  unused method '__EndOfLine' (60% confidence)
- Eot/CodeFragmentCollector.py:129:
  unused method '__UndoOneChar' (60% confidence)
- Eot/CodeFragmentCollector.py:215:
  unused method '__InsertComma' (60% confidence)
- Eot/Database.py:81:
  unused attribute 'text_factory' (60% confidence)
- Eot/EotMain.py:1012:
  unused method 'SetFreeSpace' (60% confidence)
- Eot/Identification.py:36:
  unused method 'GetFileFullPath' (60% confidence)
- Eot/Identification.py:43:
  unused method 'GetFileRelativePath' (60% confidence)
- Eot/Parser.py:119:
  unused function 'AddToGlobalMacro' (60% confidence)
- Eot/Parser.py:238:
  unused function 'GetAllSourceFiles' (60% confidence)
- Eot/Parser.py:257:
  unused function 'ParseConditionalStatementMacros' (60% confidence)
- Eot/Parser.py:267:
  unused function 'GetAllFiles' (60% confidence)
- Eot/Parser.py:291:
  unused function 'ParseConditionalStatement' (60% confidence)
- Eot/Parser.py:367:
  unused function 'GetConditionalStatementStatus' (60% confidence)
- Eot/Parser.py:722:
  unused function 'ConvertGuid' (60% confidence)
- Eot/Parser.py:857:
  unused function 'ConvertGuid2' (60% confidence)
- Eot/Report.py:161:
  unused method 'GeneratePpi' (60% confidence)
- Eot/Report.py:173:
  unused method 'GenerateProtocol' (60% confidence)

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-01 09:51:38 +08:00

162 lines
4.8 KiB
Python

## @file
# fragments of source file
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
## 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 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