BaseTools: Various typo
Various typo in BaseTools. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
committed by
Liming Gao
parent
325ad62260
commit
fb0b35e05f
@ -23,7 +23,7 @@ options {
|
||||
## @file
|
||||
# The file defines the Lexer for C source files.
|
||||
#
|
||||
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
|
||||
# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.
|
||||
# This file is generated by running:
|
||||
# java org.antlr.Tool C.g
|
||||
#
|
||||
@ -44,7 +44,7 @@ options {
|
||||
## @file
|
||||
# The file defines the parser for C source files.
|
||||
#
|
||||
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
|
||||
# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.
|
||||
# This file is generated by running:
|
||||
# java org.antlr.Tool C.g
|
||||
#
|
||||
@ -653,11 +653,11 @@ UnicodeEscape
|
||||
WS : (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;}
|
||||
;
|
||||
|
||||
// ingore '\' of line concatenation
|
||||
// ignore '\' of line concatenation
|
||||
BS : ('\\') {$channel=HIDDEN;}
|
||||
;
|
||||
|
||||
// ingore function modifiers
|
||||
// ignore function modifiers
|
||||
//FUNC_MODIFIERS : 'EFIAPI' {$channel=HIDDEN;}
|
||||
// ;
|
||||
|
||||
|
@ -6,7 +6,7 @@ from antlr3.compat import set, frozenset
|
||||
## @file
|
||||
# The file defines the Lexer for C source files.
|
||||
#
|
||||
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
|
||||
# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.
|
||||
# This file is generated by running:
|
||||
# java org.antlr.Tool C.g
|
||||
#
|
||||
|
@ -8,7 +8,7 @@ from antlr3.compat import set, frozenset
|
||||
## @file
|
||||
# The file defines the parser for C source files.
|
||||
#
|
||||
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
|
||||
# THIS FILE IS AUTO-GENERATED. PLEASE DO NOT MODIFY THIS FILE.
|
||||
# This file is generated by running:
|
||||
# java org.antlr.Tool C.g
|
||||
#
|
||||
|
@ -1403,7 +1403,7 @@ class Check(object):
|
||||
# Check whether only capital letters are used for #define declarations
|
||||
def NamingConventionCheckDefineStatement(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckDefineStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of #define statement ...")
|
||||
EdkLogger.quiet("Checking naming convention of #define statement ...")
|
||||
|
||||
SqlCommand = """select ID, Value from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_MACRO_DEFINE)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
@ -1418,7 +1418,7 @@ class Check(object):
|
||||
# Check whether only capital letters are used for typedef declarations
|
||||
def NamingConventionCheckTypedefStatement(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckTypedefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of #typedef statement ...")
|
||||
EdkLogger.quiet("Checking naming convention of #typedef statement ...")
|
||||
|
||||
SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_TYPEDEF)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
@ -1438,7 +1438,7 @@ class Check(object):
|
||||
# Check whether the #ifndef at the start of an include file uses both prefix and postfix underscore characters, '_'.
|
||||
def NamingConventionCheckIfndefStatement(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckIfndefStatement == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of #ifndef statement ...")
|
||||
EdkLogger.quiet("Checking naming convention of #ifndef statement ...")
|
||||
|
||||
SqlCommand = """select ID, Value from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_MACRO_IFNDEF)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
@ -1455,7 +1455,7 @@ class Check(object):
|
||||
# Check whether the path name followed the rule
|
||||
def NamingConventionCheckPathName(self):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckPathName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of file path name ...")
|
||||
EdkLogger.quiet("Checking naming convention of file path name ...")
|
||||
Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
|
||||
SqlCommand = """select ID, Name from File"""
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
@ -1472,7 +1472,7 @@ class Check(object):
|
||||
# Check whether the variable name followed the rule
|
||||
def NamingConventionCheckVariableName(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckVariableName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of variable name ...")
|
||||
EdkLogger.quiet("Checking naming convention of variable name ...")
|
||||
Pattern = re.compile(r'^[A-Zgm]+\S*[a-z]\S*$')
|
||||
|
||||
SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
|
||||
@ -1492,7 +1492,7 @@ class Check(object):
|
||||
# Check whether the function name followed the rule
|
||||
def NamingConventionCheckFunctionName(self):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckFunctionName == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of function name ...")
|
||||
EdkLogger.quiet("Checking naming convention of function name ...")
|
||||
Pattern = re.compile(r'^[A-Z]+\S*[a-z]\S*$')
|
||||
SqlCommand = """select ID, Name from Function"""
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
@ -1504,7 +1504,7 @@ class Check(object):
|
||||
# Check whether NO use short variable name with single character
|
||||
def NamingConventionCheckSingleCharacterVariable(self, FileTable):
|
||||
if EccGlobalData.gConfig.NamingConventionCheckSingleCharacterVariable == '1' or EccGlobalData.gConfig.NamingConventionCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':
|
||||
EdkLogger.quiet("Checking naming covention of single character variable name ...")
|
||||
EdkLogger.quiet("Checking naming convention of single character variable name ...")
|
||||
|
||||
SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)
|
||||
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)
|
||||
|
@ -39,7 +39,7 @@ DATABASE_PATH = "Ecc.db"
|
||||
|
||||
## Database
|
||||
#
|
||||
# This class defined the ECC databse
|
||||
# This class defined the ECC database
|
||||
# During the phase of initialization, the database will create all tables and
|
||||
# insert all records of table DataModel
|
||||
#
|
||||
@ -83,7 +83,7 @@ class Database(object):
|
||||
self.Conn = sqlite3.connect(self.DbPath, isolation_level = 'DEFERRED')
|
||||
self.Conn.execute("PRAGMA page_size=4096")
|
||||
self.Conn.execute("PRAGMA synchronous=OFF")
|
||||
# to avoid non-ascii charater conversion error
|
||||
# to avoid non-ascii character conversion error
|
||||
self.Conn.text_factory = str
|
||||
self.Cur = self.Conn.cursor()
|
||||
|
||||
@ -214,7 +214,7 @@ class Database(object):
|
||||
|
||||
## UpdateIdentifierBelongsToFunction
|
||||
#
|
||||
# Update the field "BelongsToFunction" for each Indentifier
|
||||
# Update the field "BelongsToFunction" for each Identifier
|
||||
#
|
||||
#
|
||||
def UpdateIdentifierBelongsToFunction_disabled(self):
|
||||
@ -267,7 +267,7 @@ class Database(object):
|
||||
|
||||
## UpdateIdentifierBelongsToFunction
|
||||
#
|
||||
# Update the field "BelongsToFunction" for each Indentifier
|
||||
# Update the field "BelongsToFunction" for each Identifier
|
||||
#
|
||||
#
|
||||
def UpdateIdentifierBelongsToFunction(self):
|
||||
|
@ -209,7 +209,7 @@ class Ecc(object):
|
||||
Op.write("%s\r" % Filename)
|
||||
#Dsc(Filename, True, True, EccGlobalData.gWorkspace, EccGlobalData.gDb)
|
||||
self.MetaFile = DscParser(PathClass(Filename, Root), MODEL_FILE_DSC, MetaFileStorage(EccGlobalData.gDb.TblDsc.Cur, Filename, MODEL_FILE_DSC, True))
|
||||
# alwasy do post-process, in case of macros change
|
||||
# always do post-process, in case of macros change
|
||||
self.MetaFile.DoPostProcess()
|
||||
self.MetaFile.Start()
|
||||
self.MetaFile._PostProcess()
|
||||
@ -307,7 +307,7 @@ class Ecc(object):
|
||||
if Options.Workspace:
|
||||
os.environ["WORKSPACE"] = Options.Workspace
|
||||
|
||||
# Check workspace envirnoment
|
||||
# Check workspace environment
|
||||
if "WORKSPACE" not in os.environ:
|
||||
EdkLogger.error("ECC", BuildToolError.ATTRIBUTE_NOT_AVAILABLE, "Environment variable not found",
|
||||
ExtraData="WORKSPACE")
|
||||
|
@ -1,5 +1,5 @@
|
||||
## @file
|
||||
# Standardized Error Hanlding infrastructures.
|
||||
# Standardized Error Handling infrastructures.
|
||||
#
|
||||
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
@ -152,7 +152,7 @@ gEccErrorMessage = {
|
||||
ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_2 : "The #ifndef must be the first line of code following the file header comment",
|
||||
ERROR_INCLUDE_FILE_CHECK_IFNDEF_STATEMENT_3 : "The #endif must appear on the last line in the file",
|
||||
ERROR_INCLUDE_FILE_CHECK_DATA : "Include files should contain only public or only private data and cannot contain code or define data variables",
|
||||
ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the inlcude file with same names",
|
||||
ERROR_INCLUDE_FILE_CHECK_NAME : "No permission for the include file with same names",
|
||||
|
||||
ERROR_DECLARATION_DATA_TYPE_CHECK_ALL : "",
|
||||
ERROR_DECLARATION_DATA_TYPE_CHECK_NO_USE_C_TYPE : "There should be no use of int, unsigned, char, void, static, long in any .c, .h or .asl files",
|
||||
|
@ -18,7 +18,7 @@ from Ecc.EccToolError import *
|
||||
from Common.MultipleWorkspace import MultipleWorkspace as mws
|
||||
from Ecc import EccGlobalData
|
||||
import re
|
||||
## Get the inlcude path list for a source file
|
||||
## Get the include path list for a source file
|
||||
#
|
||||
# 1. Find the source file belongs to which inf file
|
||||
# 2. Find the inf's package
|
||||
|
@ -733,7 +733,7 @@ def SplitPredicateByOp(Str, Op, IsFuncCalling=False):
|
||||
|
||||
while not LBFound and (Str[Index].isalnum() or Str[Index] == '_'):
|
||||
Index += 1
|
||||
# maybe type-cast at the begining, skip it.
|
||||
# maybe type-cast at the beginning, skip it.
|
||||
RemainingStr = Str[Index:].lstrip()
|
||||
if RemainingStr.startswith(')') and not LBFound:
|
||||
Index += 1
|
||||
@ -834,7 +834,7 @@ def GetDataTypeFromModifier(ModifierStr):
|
||||
for M in MList:
|
||||
if M in EccGlobalData.gConfig.ModifierSet:
|
||||
continue
|
||||
# remove array sufix
|
||||
# remove array suffix
|
||||
if M.startswith('[') or M.endswith(']'):
|
||||
continue
|
||||
ReturnType += M + ' '
|
||||
@ -1019,7 +1019,7 @@ def GetFinalTypeValue(Type, FieldName, TypedefDict, SUDict):
|
||||
Type = GetDataTypeFromModifier(Field[0:Index])
|
||||
return Type.strip()
|
||||
else:
|
||||
# For the condition that the field in struct is an array with [] sufixes...
|
||||
# For the condition that the field in struct is an array with [] suffixes...
|
||||
if not Field[Index + len(FieldName)].isalnum():
|
||||
Type = GetDataTypeFromModifier(Field[0:Index])
|
||||
return Type.strip()
|
||||
@ -1629,7 +1629,7 @@ def CheckMemberVariableFormat(Name, Value, FileTable, TdId, ModelId):
|
||||
Field = Field.strip()
|
||||
if Field == '':
|
||||
continue
|
||||
# For the condition that the field in struct is an array with [] sufixes...
|
||||
# For the condition that the field in struct is an array with [] suffixes...
|
||||
if Field[-1] == ']':
|
||||
LBPos = Field.find('[')
|
||||
Field = Field[0:LBPos]
|
||||
|
Reference in New Issue
Block a user