Skip to content

Commit

Permalink
1. Add two columns in table Function
Browse files Browse the repository at this point in the history
2. Ignore 'Build' directory when ECC tool parses workspace 

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1237 7335b38e-4728-0410-8992-fb3ffe349368
  • Loading branch information
hche10x committed May 21, 2008
1 parent d287317 commit f350fad
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 31 deletions.
5 changes: 4 additions & 1 deletion Source/Python/CommonDataClass/DataClass.py
Expand Up @@ -196,7 +196,8 @@ class FunctionClass(object):
def __init__(self, ID = -1, Header = '', Modifier = '', Name = '', ReturnStatement = '', \
StartLine = -1, StartColumn = -1, EndLine = -1, EndColumn = -1, \
BodyStartLine = -1, BodyStartColumn = -1, BelongsToFile = -1, \
IdentifierList = [], PcdList = []):
IdentifierList = [], PcdList = [], \
FunNameStartLine = -1, FunNameStartColumn = -1):
self.ID = ID
self.Header = Header
self.Modifier = Modifier
Expand All @@ -209,6 +210,8 @@ def __init__(self, ID = -1, Header = '', Modifier = '', Name = '', ReturnStateme
self.BodyStartLine = BodyStartLine
self.BodyStartColumn = BodyStartColumn
self.BelongsToFile = BelongsToFile
self.FunNameStartLine = FunNameStartLine
self.FunNameStartColumn = FunNameStartColumn

self.IdentifierList = IdentifierList
self.PcdList = PcdList
Expand Down
3 changes: 2 additions & 1 deletion Source/Python/Ecc/Database.py
Expand Up @@ -181,7 +181,8 @@ def InsertOneFile(self, File):
for Function in File.FunctionList:
FunctionID = self.TblFunction.Insert(Function.Header, Function.Modifier, Function.Name, Function.ReturnStatement, \
Function.StartLine, Function.StartColumn, Function.EndLine, Function.EndColumn, \
Function.BodyStartLine, Function.BodyStartColumn, FileID)
Function.BodyStartLine, Function.BodyStartColumn, FileID, \
Function.FunNameStartLine, Function.FunNameStartLine)
#
# Insert Identifier of function
#
Expand Down
2 changes: 2 additions & 0 deletions Source/Python/Ecc/Ecc.py
Expand Up @@ -119,6 +119,8 @@ def BuildMetaDataFileDatabase(self):
Dirs.remove('CVS')
if ".svn" in Dirs:
Dirs.remove('.svn')
if "Build" in Dirs:
Dirs.remove('Build')
if "EdkCompatibilityPkg" in Dirs:
Dirs.remove('EdkCompatibilityPkg')

Expand Down
64 changes: 35 additions & 29 deletions Source/Python/Table/TableFunction.py
Expand Up @@ -33,18 +33,20 @@ def __init__(self, Cursor):
#
# Create table Function
#
# @param ID: ID of a Function
# @param Header: Header of a Function
# @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
# @param StartColumn: StartColumn of a Function
# @param EndLine: EndLine of a Function
# @param EndColumn: EndColumn of a Function
# @param BodyStartLine: StartLine of a Function body
# @param BodyStartColumn: StartColumn of a Function body
# @param BelongsToFile: The Function belongs to which file
# @param ID: ID of a Function
# @param Header: Header of a Function
# @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
# @param StartColumn: StartColumn of a Function
# @param EndLine: EndLine of a Function
# @param EndColumn: EndColumn of a Function
# @param BodyStartLine: StartLine of a Function body
# @param BodyStartColumn: StartColumn of a Function body
# @param BelongsToFile: The Function belongs to which file
# @param FunNameStartLine: StartLine of a Function name
# @param FunNameStartColumn: StartColumn of a Function name
#
def Create(self):
SqlCommand = """create table IF NOT EXISTS %s (ID INTEGER PRIMARY KEY,
Expand All @@ -58,32 +60,36 @@ def Create(self):
EndColumn INTEGER NOT NULL,
BodyStartLine INTEGER NOT NULL,
BodyStartColumn INTEGER NOT NULL,
BelongsToFile SINGLE NOT NULL
BelongsToFile SINGLE NOT NULL,
FunNameStartLine INTEGER NOT NULL,
FunNameStartColumn INTEGER NOT NULL
)""" % self.Table
Table.Create(self, SqlCommand)

## Insert table
#
# Insert a record into table Function
#
# @param ID: ID of a Function
# @param Header: Header of a Function
# @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
# @param StartColumn: StartColumn of a Function
# @param EndLine: EndLine of a Function
# @param EndColumn: EndColumn of a Function
# @param BodyStartLine: StartLine of a Function body
# @param BodyStartColumn: StartColumn of a Function body
# @param BelongsToFile: The Function belongs to which file
# @param ID: ID of a Function
# @param Header: Header of a Function
# @param Modifier: Modifier of a Function
# @param Name: Name of a Function
# @param ReturnStatement: ReturnStatement of a Funciont
# @param StartLine: StartLine of a Function
# @param StartColumn: StartColumn of a Function
# @param EndLine: EndLine of a Function
# @param EndColumn: EndColumn of a Function
# @param BodyStartLine: StartLine of a Function body
# @param BodyStartColumn: StartColumn of a Function body
# @param BelongsToFile: The Function belongs to which file
# @param FunNameStartLine: StartLine of a Function name
# @param FunNameStartColumn: StartColumn of a Function name
#
def Insert(self, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile):
def Insert(self, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile, FunNameStartLine, FunNameStartColumn):
self.ID = self.ID + 1
(Header, Modifier, Name, ReturnStatement) = ConvertToSqlString((Header, Modifier, Name, ReturnStatement))
SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile)
SqlCommand = """insert into %s values(%s, '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s, %s, %s)""" \
% (self.Table, self.ID, Header, Modifier, Name, ReturnStatement, StartLine, StartColumn, EndLine, EndColumn, BodyStartLine, BodyStartColumn, BelongsToFile, FunNameStartLine, FunNameStartColumn)
Table.Insert(self, SqlCommand)

return self.ID
return self.ID

0 comments on commit f350fad

Please sign in to comment.