You've already forked lazarus-ccr
Parser's "CaseSensitive" implementation. To got the parser Case-Sensitive, provide the "-cS" argument at command line when using ws_helper.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1931 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -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
|
||||
@ -94,6 +94,11 @@ begin
|
||||
Include(AAppOptions,cloFileRenaming);
|
||||
OptionsArgsMAP[cloFileRenaming] := OptArg;
|
||||
end;
|
||||
'c' :
|
||||
begin
|
||||
Include(AAppOptions,cloParserCaseSensitive);
|
||||
OptionsArgsMAP[cloParserCaseSensitive] := OptArg;
|
||||
end;
|
||||
end;
|
||||
until ( c = EndOfOptions );
|
||||
Result := OptInd;
|
||||
|
@ -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;
|
||||
|
@ -17,6 +17,9 @@ resourcestring
|
||||
' -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 +
|
||||
' -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
|
||||
|
Reference in New Issue
Block a user