diff --git a/wst/trunk/ws_helper/command_line_parser.pas b/wst/trunk/ws_helper/command_line_parser.pas index 2ab8ea0c2..3f7253aa8 100644 --- a/wst/trunk/ws_helper/command_line_parser.pas +++ b/wst/trunk/ws_helper/command_line_parser.pas @@ -30,7 +30,7 @@ Type cloInterface, cloProxy, cloImp, cloBinder, cloWsdl, cloXsd, cloOutPutDirRelative, cloOutPutDirAbsolute, cloHandleWrappedParameters, cloGenerateDocAsComments, cloGenerateObjectCollection, - cloFileRenaming, cloPrefixEnum + cloFileRenaming, cloPrefixEnum, cloParserCaseSensitive ); TComandLineOptions = set of TComandLineOption; @@ -55,7 +55,7 @@ begin AAppOptions := []; c := #0; repeat - c := GetOpt('u:pibo:a:wxydg:f:'); + c := GetOpt('u:pibo:a:wxydg:f:c:'); case c of 'u' : begin @@ -93,7 +93,12 @@ begin begin Include(AAppOptions,cloFileRenaming); OptionsArgsMAP[cloFileRenaming] := OptArg; - end; + end; + 'c' : + begin + Include(AAppOptions,cloParserCaseSensitive); + OptionsArgsMAP[cloParserCaseSensitive] := OptArg; + end; end; until ( c = EndOfOptions ); Result := OptInd; diff --git a/wst/trunk/ws_helper/pascal_parser_intf.pas b/wst/trunk/ws_helper/pascal_parser_intf.pas index ea452e0be..2df03cc75 100644 --- a/wst/trunk/ws_helper/pascal_parser_intf.pas +++ b/wst/trunk/ws_helper/pascal_parser_intf.pas @@ -101,6 +101,7 @@ type FCurrentModule: TPasModule; FBindingList : TObjectList; FProperties : TPropertyHolder; + FCaseSensitive : Boolean; private function GetBinding(AIndex : Integer): TwstBinding; function GetBindingCount: Integer; @@ -163,6 +164,8 @@ type function IsInitNeed(AType: TPasType): Boolean; function IsOfType(AType: TPasType; AClass: TClass): Boolean; + + property CaseSensitive : Boolean read FCaseSensitive write FCaseSensitive; end; TPasNativeModule = class(TPasModule) @@ -751,18 +754,37 @@ begin decs := AModule.InterfaceSection.Declarations; c := decs.Count; if ( elkDeclaredName in ANameKinds ) then begin - for i := 0 to Pred(c) do begin - if AnsiSameText(AName, GetExternalName(TPasElement(decs[i]))) then begin - Result := TPasElement(decs[i]); - Exit; + if FCaseSensitive then begin + for i := 0 to Pred(c) do begin + if AnsiSameStr(AName, GetExternalName(TPasElement(decs[i]))) then begin + Result := TPasElement(decs[i]); + Exit; + end; + end; + end else begin + for i := 0 to Pred(c) do begin + if AnsiSameText(AName, GetExternalName(TPasElement(decs[i]))) then begin + Result := TPasElement(decs[i]); + Exit; + end; end; end; end; + if ( Result = nil ) and ( elkName in ANameKinds ) then begin - for i := 0 to Pred(c) do begin - if AnsiSameText(AName, TPasElement(decs[i]).Name) then begin - Result := TPasElement(decs[i]); - Exit; + if FCaseSensitive then begin + for i := 0 to Pred(c) do begin + if AnsiSameStr(AName, TPasElement(decs[i]).Name) then begin + Result := TPasElement(decs[i]); + Exit; + end; + end; + end else begin + for i := 0 to Pred(c) do begin + if AnsiSameText(AName, TPasElement(decs[i]).Name) then begin + Result := TPasElement(decs[i]); + Exit; + end; end; end; end; diff --git a/wst/trunk/ws_helper/ws_helper_prog.inc b/wst/trunk/ws_helper/ws_helper_prog.inc index 284e8d02d..537398ec9 100644 --- a/wst/trunk/ws_helper/ws_helper_prog.inc +++ b/wst/trunk/ws_helper/ws_helper_prog.inc @@ -16,7 +16,10 @@ resourcestring ' -w Generate WSDL file; Can be used to get wsdl from pascal' + sNEW_LINE + ' -x Generate XSD file; Can be used to get xsd from pascal' + sNEW_LINE + ' -y Generate easy access interface for wrapped parameters' + sNEW_LINE + - ' -d Generate documentation as comment in the interface file' + sNEW_LINE + + ' -d Generate documentation as comment in the interface file' + sNEW_LINE + + ' -c Indicate the parser''s case sensitivity : ' + sNEW_LINE + + ' S : the paser is case sensitive' + sNEW_LINE + + ' I : the paser is not case sensitive' + sNEW_LINE + ' -f Specify unit(s) renaming option : oldName= NewName(;oldName= NewName)* '; sCOPYRIGHT = 'ws_helper, Web Service Toolkit 0.6 Copyright (c) 2006, 2007, 2008, 2009, 2010,2011 by Inoussa OUEDRAOGO'; @@ -76,6 +79,10 @@ var if ( sourceType = sftXsd ) then begin AppOptions := AppOptions - [ cloProxy, cloImp, cloBinder, cloWsdl ]; end; + if AnsiSameText('S',Trim(GetOptionArg(cloParserCaseSensitive))) then + Include(AppOptions,cloParserCaseSensitive); + if AnsiSameText('I',Trim(GetOptionArg(cloParserCaseSensitive))) then + Exclude(AppOptions,cloParserCaseSensitive); end; function GenerateSymbolTable() : Boolean ; @@ -145,6 +152,8 @@ var begin try WriteLn('Parsing the file : ', inFileName); + if symtable.CaseSensitive then + WriteLn('The parser is case sensitive'); case sourceType of sftPascal : ParsePascalFile(); sftWSDL : ParseWsdlFile(); @@ -356,6 +365,7 @@ begin Error(errStr); end; symtable := TwstPasTreeContainer.Create(); + symtable.CaseSensitive := cloParserCaseSensitive in AppOptions; srcMngr := CreateSourceManager(); if not GenerateSymbolTable() then begin