ws_helper : nested type definition parsing

Example :
	        <xs:element name="NestedType">
	                <xs:complexType>
	                        <xs:sequence>
	                                <xs:element name="Property_1" type="xs:string"/>
	                                <xs:element name="Property_2" minOccurs="0" maxOccurs="unbounded">
      		                              <xs:complexType>
      	                                          <xs:sequence>
      	                                                 <xs:element name="Name" type="xs:string"/>
      	                                                 <xs:element name="Value" type="xs:string"/>
      	                                          </xs:sequence>
      	                                </xs:complexType>
	                                </xs:element>
	                        </xs:sequence>
	                </xs:complexType>
	        </xs:element>

ws_helper : Soap Binding Style are now recorded in the metadata registration subroutine generated by ws_helper


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@144 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2007-04-12 00:48:00 +00:00
parent 98a3f13377
commit bbeed9acfd
9 changed files with 652 additions and 364 deletions

View File

@ -35,6 +35,8 @@ type
{ standart data types defines } { standart data types defines }
anyURI = type string; anyURI = type string;
token = type string; token = type string;
nonNegativeInteger = type LongWord;
positiveInteger = type nonNegativeInteger;
float = Single; float = Single;
TScopeType = Integer; TScopeType = Integer;
@ -1121,6 +1123,9 @@ begin
r := GetTypeRegistry(); r := GetTypeRegistry();
r.Register(sXSD_NS,TypeInfo(Integer),'int').AddPascalSynonym('Integer'); r.Register(sXSD_NS,TypeInfo(Integer),'int').AddPascalSynonym('Integer');
r.Register(sXSD_NS,TypeInfo(LongWord),'unsignedInt'); r.Register(sXSD_NS,TypeInfo(LongWord),'unsignedInt');
r.Register(sXSD_NS,TypeInfo(positiveInteger),'positiveInteger');
r.Register(sXSD_NS,TypeInfo(nonNegativeInteger),'nonNegativeInteger');
r.Register(sXSD_NS,TypeInfo(string),'string').AddPascalSynonym('string'); r.Register(sXSD_NS,TypeInfo(string),'string').AddPascalSynonym('string');
r.Register(sXSD_NS,TypeInfo(AnsiString),'ansistring').AddPascalSynonym('ansistring'); r.Register(sXSD_NS,TypeInfo(AnsiString),'ansistring').AddPascalSynonym('ansistring');

View File

@ -7,7 +7,7 @@
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=".exe"/> <TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="3"/> <ActiveEditorIndexAtStart Value="0"/>
</General> </General>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -33,7 +33,7 @@
<UnitName Value="test_ebay_gui"/> <UnitName Value="test_ebay_gui"/>
<CursorPos X="5" Y="8"/> <CursorPos X="5" Y="8"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="127"/> <UsageCount Value="128"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="umain.pas"/> <Filename Value="umain.pas"/>
@ -41,10 +41,10 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ResourceFilename Value="umain.lrs"/> <ResourceFilename Value="umain.lrs"/>
<UnitName Value="umain"/> <UnitName Value="umain"/>
<CursorPos X="40" Y="9"/> <CursorPos X="36" Y="69"/>
<TopLine Value="4"/> <TopLine Value="1"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="127"/> <UsageCount Value="128"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
@ -53,32 +53,34 @@
<UnitName Value="synapse_http_protocol"/> <UnitName Value="synapse_http_protocol"/>
<CursorPos X="1" Y="162"/> <CursorPos X="1" Y="162"/>
<TopLine Value="149"/> <TopLine Value="149"/>
<UsageCount Value="127"/> <UsageCount Value="128"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="..\..\base_service_intf.pas"/> <Filename Value="..\..\base_service_intf.pas"/>
<UnitName Value="base_service_intf"/> <UnitName Value="base_service_intf"/>
<CursorPos X="13" Y="3058"/> <CursorPos X="68" Y="109"/>
<TopLine Value="3056"/> <TopLine Value="21"/>
<EditorIndex Value="7"/> <EditorIndex Value="9"/>
<UsageCount Value="63"/> <UsageCount Value="64"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="..\..\service_intf.pas"/> <Filename Value="..\..\service_intf.pas"/>
<UnitName Value="service_intf"/> <UnitName Value="service_intf"/>
<CursorPos X="1" Y="253"/> <CursorPos X="32" Y="78"/>
<TopLine Value="239"/> <TopLine Value="67"/>
<EditorIndex Value="2"/> <EditorIndex Value="3"/>
<UsageCount Value="28"/> <UsageCount Value="29"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="..\..\soap_formatter.pas"/> <Filename Value="..\..\soap_formatter.pas"/>
<UnitName Value="soap_formatter"/> <UnitName Value="soap_formatter"/>
<CursorPos X="1" Y="146"/> <CursorPos X="3" Y="93"/>
<TopLine Value="132"/> <TopLine Value="87"/>
<UsageCount Value="20"/> <EditorIndex Value="1"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<Filename Value="..\..\imp_utils.pas"/> <Filename Value="..\..\imp_utils.pas"/>
@ -90,10 +92,10 @@
<Unit7> <Unit7>
<Filename Value="..\..\base_soap_formatter.pas"/> <Filename Value="..\..\base_soap_formatter.pas"/>
<UnitName Value="base_soap_formatter"/> <UnitName Value="base_soap_formatter"/>
<CursorPos X="1" Y="1625"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1611"/> <TopLine Value="219"/>
<EditorIndex Value="4"/> <EditorIndex Value="6"/>
<UsageCount Value="56"/> <UsageCount Value="57"/>
<Bookmarks Count="2"> <Bookmarks Count="2">
<Item0 X="14" Y="670" ID="1"/> <Item0 X="14" Y="670" ID="1"/>
<Item1 X="1" Y="437" ID="2"/> <Item1 X="1" Y="437" ID="2"/>
@ -111,10 +113,10 @@
<Filename Value="ebay.pas"/> <Filename Value="ebay.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ebay"/> <UnitName Value="ebay"/>
<CursorPos X="49" Y="126"/> <CursorPos X="3" Y="237"/>
<TopLine Value="124"/> <TopLine Value="226"/>
<EditorIndex Value="1"/> <EditorIndex Value="2"/>
<UsageCount Value="111"/> <UsageCount Value="112"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
@ -129,8 +131,8 @@
<UnitName Value="metadata_repository"/> <UnitName Value="metadata_repository"/>
<CursorPos X="3" Y="112"/> <CursorPos X="3" Y="112"/>
<TopLine Value="9"/> <TopLine Value="9"/>
<EditorIndex Value="5"/> <EditorIndex Value="7"/>
<UsageCount Value="19"/> <UsageCount Value="20"/>
<Bookmarks Count="1"> <Bookmarks Count="1">
<Item0 X="1" Y="91" ID="3"/> <Item0 X="1" Y="91" ID="3"/>
</Bookmarks> </Bookmarks>
@ -140,10 +142,10 @@
<Filename Value="ebay_proxy.pas"/> <Filename Value="ebay_proxy.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ebay_proxy"/> <UnitName Value="ebay_proxy"/>
<CursorPos X="1" Y="75"/> <CursorPos X="44" Y="16"/>
<TopLine Value="61"/> <TopLine Value="5"/>
<EditorIndex Value="6"/> <EditorIndex Value="8"/>
<UsageCount Value="111"/> <UsageCount Value="112"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
@ -244,26 +246,28 @@
</Unit27> </Unit27>
<Unit28> <Unit28>
<Filename Value="..\..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpash.inc"/> <Filename Value="..\..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpash.inc"/>
<CursorPos X="8" Y="116"/> <CursorPos X="50" Y="190"/>
<TopLine Value="102"/> <TopLine Value="179"/>
<UsageCount Value="6"/> <EditorIndex Value="4"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
</Unit28> </Unit28>
<Unit29> <Unit29>
<Filename Value="..\..\binary_streamer.pas"/> <Filename Value="..\..\binary_streamer.pas"/>
<UnitName Value="binary_streamer"/> <UnitName Value="binary_streamer"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="55"/> <TopLine Value="55"/>
<EditorIndex Value="8"/> <EditorIndex Value="10"/>
<UsageCount Value="31"/> <UsageCount Value="32"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit29> </Unit29>
<Unit30> <Unit30>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="..\files\eBayWSDL.pas"/>
<UnitName Value="eBayWSDL"/> <UnitName Value="eBayWSDL"/>
<CursorPos X="48" Y="10961"/> <CursorPos X="1" Y="1"/>
<TopLine Value="10947"/> <TopLine Value="1"/>
<EditorIndex Value="3"/> <EditorIndex Value="5"/>
<UsageCount Value="18"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit30> </Unit30>
<Unit31> <Unit31>
@ -316,31 +320,47 @@
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit37> </Unit37>
</Units> </Units>
<JumpHistory Count="6" HistoryIndex="5"> <JumpHistory Count="10" HistoryIndex="9">
<Position1> <Position1>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="umain.pas"/>
<Caret Line="33919" Column="45" TopLine="33905"/> <Caret Line="77" Column="14" TopLine="64"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="umain.pas"/>
<Caret Line="32893" Column="23" TopLine="32867"/> <Caret Line="54" Column="20" TopLine="43"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="umain.pas"/>
<Caret Line="12" Column="53" TopLine="1"/> <Caret Line="45" Column="70" TopLine="39"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="..\..\service_intf.pas"/>
<Caret Line="32726" Column="1" TopLine="32699"/> <Caret Line="245" Column="15" TopLine="239"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="..\..\service_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/> <Caret Line="23" Column="12" TopLine="21"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="..\files\eBayWSDL.pas"/> <Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="503" Column="3" TopLine="489"/> <Caret Line="1" Column="1" TopLine="1"/>
</Position6> </Position6>
<Position7>
<Filename Value="umain.pas"/>
<Caret Line="45" Column="27" TopLine="39"/>
</Position7>
<Position8>
<Filename Value="umain.pas"/>
<Caret Line="69" Column="36" TopLine="56"/>
</Position8>
<Position9>
<Filename Value="ebay_proxy.pas"/>
<Caret Line="16" Column="44" TopLine="5"/>
</Position9>
<Position10>
<Filename Value="..\..\service_intf.pas"/>
<Caret Line="78" Column="32" TopLine="67"/>
</Position10>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -80,12 +80,13 @@
<Filename Value="..\..\base_service_intf.pas"/> <Filename Value="..\..\base_service_intf.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="base_service_intf"/> <UnitName Value="base_service_intf"/>
<CursorPos X="3" Y="119"/> <CursorPos X="1" Y="1"/>
<TopLine Value="132"/> <TopLine Value="28"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Bookmarks Count="1"> <Bookmarks Count="2">
<Item0 X="5" Y="1175" ID="1"/> <Item0 X="33" Y="1126" ID="0"/>
<Item1 X="5" Y="1180" ID="1"/>
</Bookmarks> </Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit5> </Unit5>
@ -330,11 +331,39 @@
<UsageCount Value="8"/> <UsageCount Value="8"/>
</Unit37> </Unit37>
</Units> </Units>
<JumpHistory Count="1" HistoryIndex="0"> <JumpHistory Count="8" HistoryIndex="7">
<Position1> <Position1>
<Filename Value="..\..\base_service_intf.pas"/> <Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="587" Column="29" TopLine="571"/> <Caret Line="119" Column="3" TopLine="132"/>
</Position1> </Position1>
<Position2>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="825" Column="90" TopLine="817"/>
</Position2>
<Position3>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="3944" Column="90" TopLine="3937"/>
</Position3>
<Position4>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="1125" Column="66" TopLine="1112"/>
</Position5>
<Position6>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="36" Column="9" TopLine="25"/>
</Position6>
<Position7>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="1129" Column="37" TopLine="1115"/>
</Position7>
<Position8>
<Filename Value="..\..\base_service_intf.pas"/>
<Caret Line="1127" Column="72" TopLine="1113"/>
</Position8>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -1814,6 +1814,17 @@ procedure TInftGenerator.GenerateCustomMetadatas();
Indent();WriteLn(');'); Indent();WriteLn(');');
end; end;
if ( AIntf.BindingStyle = bsRPC ) then begin
Indent();WriteLn('mm.SetServiceCustomData(');
IncIndent();
Indent(); WriteLn('%s,',[sUNIT_NAME]);
Indent(); WriteLn('%s,',[QuotedStr(AIntf.Name)]);
Indent(); WriteLn('%s,',[QuotedStr('SoapStyle')]);
Indent(); WriteLn('%s' ,[QuotedStr('rpc')]);
DecIndent();
Indent();WriteLn(');');
end;
for k := 0 to Pred(AIntf.MethodCount) do begin for k := 0 to Pred(AIntf.MethodCount) do begin
WriteOperationDatas(AIntf,AIntf.Method[k]); WriteOperationDatas(AIntf,AIntf.Method[k]);
end; end;

View File

@ -330,6 +330,8 @@ Type
property Properties : TStrings read FProperties; property Properties : TStrings read FProperties;
End; End;
TBindingStyle = ( bsDocument, bsRPC, bsUnknown );
{ TInterfaceDefinition } { TInterfaceDefinition }
TInterfaceDefinition = class(TAbstractSymbolDefinition) TInterfaceDefinition = class(TAbstractSymbolDefinition)
@ -338,6 +340,7 @@ Type
FMethodList : TObjectList; FMethodList : TObjectList;
private private
FAddress: string; FAddress: string;
FBindingStyle: TBindingStyle;
function GetMethod(Index: Integer): TMethodDefinition; function GetMethod(Index: Integer): TMethodDefinition;
function GetMethodCount: Integer; function GetMethodCount: Integer;
protected protected
@ -359,6 +362,7 @@ Type
Property Method[Index:Integer] : TMethodDefinition Read GetMethod; Property Method[Index:Integer] : TMethodDefinition Read GetMethod;
property InterfaceGUID : string read FInterfaceGUID write FInterfaceGUID; property InterfaceGUID : string read FInterfaceGUID write FInterfaceGUID;
property Address : string read FAddress write FAddress; property Address : string read FAddress write FAddress;
property BindingStyle : TBindingStyle read FBindingStyle write FBindingStyle;
End; End;
{ TSymbolTable } { TSymbolTable }
@ -442,9 +446,11 @@ const LANGAGE_TOKEN : array[0..107] of string = (
'THEN', 'TO', 'TRY', 'TYPE', 'UNIT', 'UNTIL', 'USES', 'THEN', 'TO', 'TRY', 'TYPE', 'UNIT', 'UNTIL', 'USES',
'VAR', 'VARARGS', 'VARIANT', 'VIRTUAL', 'WHILE', 'WIDECHAR', 'WITH', 'WORD', 'WRITE', 'XOR' 'VAR', 'VARARGS', 'VARIANT', 'VIRTUAL', 'WHILE', 'WIDECHAR', 'WITH', 'WORD', 'WRITE', 'XOR'
); );
const WST_RESERVED_TOKEN : array[0..1] of string = ( 'Item', 'Item' );
function IsReservedKeyWord(const AValue : string):Boolean ; function IsReservedKeyWord(const AValue : string):Boolean ;
begin begin
Result := AnsiMatchText(AValue,LANGAGE_TOKEN); Result := AnsiMatchText(AValue,LANGAGE_TOKEN) or
AnsiMatchText(AValue,WST_RESERVED_TOKEN);
end; end;
{ TAbstractSymbolDefinition } { TAbstractSymbolDefinition }
@ -791,7 +797,7 @@ begin
then then
locNeedFix := True locNeedFix := True
else else
raise ESymbolException.CreateFmt('Duplicated symbol name : %s',[ASym.Name]); raise ESymbolException.CreateFmt('Duplicated symbol name %s : ( %s/%s ), ( %s/%s )',[ASym.Name,Item[i].ClassName,Item[i].ExternalName,ASym.ClassName,ASym.ExternalName]);
end; end;
NotifyChange(Self,ASym,stcAdding); NotifyChange(Self,ASym,stcAdding);
Result := FList.Add(ASym); Result := FList.Add(ASym);
@ -1229,6 +1235,10 @@ begin
Result.Add(locTyp); Result.Add(locTyp);
locTyp := TTypeAliasDefinition.Create('float',Result.ByName('Single') as TTypeDefinition); locTyp := TTypeAliasDefinition.Create('float',Result.ByName('Single') as TTypeDefinition);
Result.Add(locTyp); Result.Add(locTyp);
locTyp := TTypeAliasDefinition.Create('nonNegativeInteger',Result.ByName('LongWord') as TTypeDefinition);
Result.Add(locTyp);
locTyp := TTypeAliasDefinition.Create('positiveInteger',Result.ByName('nonNegativeInteger') as TTypeDefinition);
Result.Add(locTyp);
locTyp := TTypeAliasDefinition.Create('base64Binary',Result.ByName('string') as TTypeDefinition); locTyp := TTypeAliasDefinition.Create('base64Binary',Result.ByName('string') as TTypeDefinition);
Result.Add(locTyp); Result.Add(locTyp);

View File

@ -30,6 +30,7 @@ const
sNEW_LINE = {$ifndef Unix}#13#10{$else}#10{$endif}; sNEW_LINE = {$ifndef Unix}#13#10{$else}#10{$endif};
function IsStrEmpty(Const AStr : String):Boolean; function IsStrEmpty(Const AStr : String):Boolean;
function ExtractIdentifier(const AValue : string) : string ;
implementation implementation
@ -38,5 +39,30 @@ begin
Result := ( Length(Trim(AStr)) = 0 ); Result := ( Length(Trim(AStr)) = 0 );
end; end;
function ExtractIdentifier(const AValue : string) : string ;
var
i, c : Integer;
s : string;
begin
Result := '';
s := Trim(AValue);
c := Length(s);
if ( c > 0 ) then begin
if not ( s[1] in ['A'..'Z', 'a'..'z', '_'] ) then begin
Result := '_';
end;
for i := 1 to c do begin
if ( s[i] in ['A'..'Z', 'a'..'z', '0'..'9', '_'] ) then begin
Result := Result + s[i];
end else begin
if ( Length(Result) > 0 ) and ( Result[Length(Result)] <> '_' ) then begin
Result := Result + '_';
end;
end;
end;
end;
end;
end. end.

View File

@ -12,7 +12,7 @@
<MainUnit Value="0"/> <MainUnit Value="0"/>
<IconPath Value="./"/> <IconPath Value="./"/>
<TargetFileExt Value=""/> <TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="0"/> <ActiveEditorIndexAtStart Value="8"/>
</General> </General>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
@ -24,7 +24,7 @@
<RunParams> <RunParams>
<local> <local>
<FormatVersion Value="1"/> <FormatVersion Value="1"/>
<CommandLineParams Value="-u -i -p -b -a&quot;C:\Programmes\lazarus\wst\tests\files&quot; &quot;C:\Programmes\lazarus\wst\tests\files\MathService.wsdl&quot;"/> <CommandLineParams Value="-u -i -p -b -a&quot;C:\Programmes\lazarus\wst\tests\files&quot; &quot;C:\Programmes\lazarus\wst\tests\files\free\AWSECommerceService.wsdl&quot;"/>
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
@ -33,14 +33,14 @@
<PackageName Value="FCL"/> <PackageName Value="FCL"/>
</Item1> </Item1>
</RequiredPackages> </RequiredPackages>
<Units Count="49"> <Units Count="46">
<Unit0> <Unit0>
<Filename Value="ws_helper.pas"/> <Filename Value="ws_helper.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ws_helper"/> <UnitName Value="ws_helper"/>
<CursorPos X="9" Y="77"/> <CursorPos X="1" Y="122"/>
<TopLine Value="195"/> <TopLine Value="1"/>
<EditorIndex Value="1"/> <EditorIndex Value="8"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
@ -49,8 +49,8 @@
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ws_parser"/> <UnitName Value="ws_parser"/>
<CursorPos X="1" Y="437"/> <CursorPos X="1" Y="437"/>
<TopLine Value="423"/> <TopLine Value="417"/>
<EditorIndex Value="9"/> <EditorIndex Value="7"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit1> </Unit1>
@ -58,15 +58,14 @@
<Filename Value="generator.pas"/> <Filename Value="generator.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="generator"/> <UnitName Value="generator"/>
<CursorPos X="53" Y="1766"/> <CursorPos X="50" Y="1823"/>
<TopLine Value="1756"/> <TopLine Value="1798"/>
<EditorIndex Value="0"/> <EditorIndex Value="0"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Bookmarks Count="4"> <Bookmarks Count="3">
<Item0 X="43" Y="722" ID="0"/> <Item0 X="69" Y="859" ID="1"/>
<Item1 X="69" Y="859" ID="1"/> <Item1 X="17" Y="219" ID="2"/>
<Item2 X="17" Y="219" ID="2"/> <Item2 X="23" Y="1831" ID="4"/>
<Item3 X="23" Y="1820" ID="4"/>
</Bookmarks> </Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
@ -74,19 +73,22 @@
<Filename Value="parserdefs.pas"/> <Filename Value="parserdefs.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="parserdefs"/> <UnitName Value="parserdefs"/>
<CursorPos X="15" Y="312"/> <CursorPos X="48" Y="365"/>
<TopLine Value="298"/> <TopLine Value="353"/>
<EditorIndex Value="7"/> <EditorIndex Value="5"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Bookmarks Count="1">
<Item0 X="69" Y="1238" ID="0"/>
</Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="parserutils.pas"/> <Filename Value="parserutils.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="parserutils"/> <UnitName Value="parserutils"/>
<CursorPos X="1" Y="39"/> <CursorPos X="1" Y="40"/>
<TopLine Value="1"/> <TopLine Value="19"/>
<EditorIndex Value="8"/> <EditorIndex Value="6"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit4> </Unit4>
@ -94,7 +96,7 @@
<Filename Value="ws_helper.lpi"/> <Filename Value="ws_helper.lpi"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="7"/> <UsageCount Value="10"/>
<SyntaxHighlighter Value="None"/> <SyntaxHighlighter Value="None"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
@ -102,42 +104,42 @@
<UnitName Value="Classes"/> <UnitName Value="Classes"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="7"/> <UsageCount Value="10"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="usr\share\fpcsrc\rtl\objpas\strutils.pp"/> <Filename Value="usr\share\fpcsrc\rtl\objpas\strutils.pp"/>
<UnitName Value="strutils"/> <UnitName Value="strutils"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="7"/> <UsageCount Value="10"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
<Filename Value="usr\share\fpcsrc\rtl\unix\sysutils.pp"/> <Filename Value="usr\share\fpcsrc\rtl\unix\sysutils.pp"/>
<UnitName Value="sysutils"/> <UnitName Value="sysutils"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="7"/> <UsageCount Value="10"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\lazarus\IdDsnCoreResourceStrings.pas"/> <Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\lazarus\IdDsnCoreResourceStrings.pas"/>
<UnitName Value="IdDsnCoreResourceStrings"/> <UnitName Value="IdDsnCoreResourceStrings"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="8"/> <UsageCount Value="1"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\lazarus\IdDsnPropEdBinding.pas"/> <Filename Value="D:\Lazarus\others_package\indy\indy-10.2.0.1\lazarus\IdDsnPropEdBinding.pas"/>
<UnitName Value="IdDsnPropEdBinding"/> <UnitName Value="IdDsnPropEdBinding"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="8"/> <UsageCount Value="1"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="D:\Lazarus\ide\lazarus.pp"/> <Filename Value="D:\Lazarus\ide\lazarus.pp"/>
<UnitName Value="Lazarus"/> <UnitName Value="Lazarus"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="8"/> <UsageCount Value="1"/>
</Unit11> </Unit11>
<Unit12> <Unit12>
<Filename Value="source_utils.pas"/> <Filename Value="source_utils.pas"/>
@ -148,266 +150,275 @@
<UsageCount Value="201"/> <UsageCount Value="201"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\inc\getopts.pp"/>
<UnitName Value="getopts"/>
<CursorPos X="16" Y="45"/>
<TopLine Value="33"/>
<UsageCount Value="3"/>
</Unit13>
<Unit14>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\strutils.pp"/> <Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\strutils.pp"/>
<UnitName Value="strutils"/> <UnitName Value="strutils"/>
<CursorPos X="23" Y="246"/> <CursorPos X="23" Y="246"/>
<TopLine Value="246"/> <TopLine Value="246"/>
<UsageCount Value="2"/> <UsageCount Value="5"/>
</Unit14> </Unit13>
<Unit15> <Unit14>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\sysutils\sysstrh.inc"/> <Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\sysutils\sysstrh.inc"/>
<CursorPos X="10" Y="74"/> <CursorPos X="10" Y="74"/>
<TopLine Value="70"/> <TopLine Value="70"/>
<UsageCount Value="2"/> <UsageCount Value="5"/>
</Unit15> </Unit14>
<Unit16> <Unit15>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\sysutils\sysstr.inc"/> <Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\sysutils\sysstr.inc"/>
<CursorPos X="3" Y="185"/> <CursorPos X="3" Y="185"/>
<TopLine Value="180"/> <TopLine Value="180"/>
<UsageCount Value="2"/> <UsageCount Value="5"/>
</Unit16> </Unit15>
<Unit17> <Unit16>
<Filename Value="command_line_parser.pas"/> <Filename Value="command_line_parser.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="command_line_parser"/> <UnitName Value="command_line_parser"/>
<CursorPos X="38" Y="63"/> <CursorPos X="38" Y="63"/>
<TopLine Value="43"/> <TopLine Value="42"/>
<EditorIndex Value="2"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> </Unit16>
</Unit17> <Unit17>
<Unit18>
<Filename Value="metadata_generator.pas"/> <Filename Value="metadata_generator.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="metadata_generator"/> <UnitName Value="metadata_generator"/>
<CursorPos X="3" Y="96"/> <CursorPos X="3" Y="96"/>
<TopLine Value="69"/> <TopLine Value="69"/>
<EditorIndex Value="3"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
<Loaded Value="True"/> </Unit17>
</Unit18> <Unit18>
<Unit19>
<Filename Value="..\binary_streamer.pas"/> <Filename Value="..\binary_streamer.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="binary_streamer"/> <UnitName Value="binary_streamer"/>
<CursorPos X="32" Y="344"/> <CursorPos X="32" Y="344"/>
<TopLine Value="328"/> <TopLine Value="328"/>
<UsageCount Value="200"/> <UsageCount Value="200"/>
</Unit19> </Unit18>
<Unit20> <Unit19>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\sysutils\finah.inc"/>
<CursorPos X="11" Y="27"/>
<TopLine Value="1"/>
<UsageCount Value="1"/>
</Unit20>
<Unit21>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\sysutils\fina.inc"/>
<CursorPos X="3" Y="26"/>
<TopLine Value="23"/>
<UsageCount Value="1"/>
</Unit21>
<Unit22>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\classes\classesh.inc"/> <Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="17" Y="662"/> <CursorPos X="17" Y="662"/>
<TopLine Value="652"/> <TopLine Value="652"/>
<UsageCount Value="8"/>
</Unit22>
<Unit23>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\sysutils\filutilh.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="54"/>
<UsageCount Value="1"/> <UsageCount Value="1"/>
</Unit23> </Unit19>
<Unit24> <Unit20>
<Filename Value="D:\Lazarus\lcl\lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="15" Y="590"/>
<TopLine Value="586"/>
<UsageCount Value="4"/>
</Unit24>
<Unit25>
<Filename Value="D:\Lazarus\fpcsrc\rtl\win\sysutils.pp"/>
<UnitName Value="sysutils"/>
<CursorPos X="12" Y="33"/>
<TopLine Value="11"/>
<UsageCount Value="1"/>
</Unit25>
<Unit26>
<Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\sysutils\sysutilh.inc"/>
<CursorPos X="11" Y="221"/>
<TopLine Value="194"/>
<UsageCount Value="1"/>
</Unit26>
<Unit27>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\win32\classes.pp"/>
<UnitName Value="Classes"/>
<CursorPos X="1" Y="47"/>
<TopLine Value="25"/>
<UsageCount Value="1"/>
</Unit27>
<Unit28>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="30" Y="1183"/>
<TopLine Value="1171"/>
<UsageCount Value="3"/>
</Unit28>
<Unit29>
<Filename Value="D:\lazarusClean\fpcsrc\rtl\objpas\classes\parser.inc"/>
<CursorPos X="3" Y="303"/>
<TopLine Value="299"/>
<UsageCount Value="3"/>
</Unit29>
<Unit30>
<Filename Value="wst_resources_utils.pas"/> <Filename Value="wst_resources_utils.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="wst_resources_utils"/> <UnitName Value="wst_resources_utils"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<UsageCount Value="117"/> <UsageCount Value="184"/>
</Unit30> </Unit20>
<Unit31> <Unit21>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\win32\classes.pp"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\win32\classes.pp"/>
<UnitName Value="Classes"/> <UnitName Value="Classes"/>
<CursorPos X="1" Y="47"/> <CursorPos X="1" Y="47"/>
<TopLine Value="20"/> <TopLine Value="5"/>
<UsageCount Value="8"/> <UsageCount Value="12"/>
</Unit31> </Unit21>
<Unit32> <Unit22>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\win32\sysutils.pp"/>
<UnitName Value="sysutils"/>
<CursorPos X="15" Y="33"/>
<TopLine Value="1"/>
<UsageCount Value="5"/>
</Unit32>
<Unit33>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysutilh.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysutilh.inc"/>
<CursorPos X="13" Y="178"/> <CursorPos X="13" Y="178"/>
<TopLine Value="163"/> <TopLine Value="163"/>
<UsageCount Value="10"/> <UsageCount Value="3"/>
</Unit33> </Unit22>
<Unit34> <Unit23>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\osutilsh.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="1"/>
<UsageCount Value="5"/>
</Unit34>
<Unit35>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\finah.inc"/>
<CursorPos X="10" Y="30"/>
<TopLine Value="16"/>
<UsageCount Value="5"/>
</Unit35>
<Unit36>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\fina.inc"/>
<CursorPos X="15" Y="102"/>
<TopLine Value="78"/>
<UsageCount Value="5"/>
</Unit36>
<Unit37>
<Filename Value="..\wsdl_to_pascal\wsdl2pas_imp.pas"/> <Filename Value="..\wsdl_to_pascal\wsdl2pas_imp.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="wsdl2pas_imp"/> <UnitName Value="wsdl2pas_imp"/>
<CursorPos X="29" Y="1641"/> <CursorPos X="29" Y="1641"/>
<TopLine Value="1633"/> <TopLine Value="1633"/>
<UsageCount Value="109"/> <UsageCount Value="176"/>
</Unit37> </Unit23>
<Unit38> <Unit24>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\fexpand.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="124"/>
<UsageCount Value="5"/>
</Unit38>
<Unit39>
<Filename Value="..\wst_rtti_filter\rtti_filters.pas"/> <Filename Value="..\wst_rtti_filter\rtti_filters.pas"/>
<UnitName Value="rtti_filters"/> <UnitName Value="rtti_filters"/>
<CursorPos X="1" Y="571"/> <CursorPos X="1" Y="209"/>
<TopLine Value="557"/> <TopLine Value="198"/>
<UsageCount Value="10"/> <EditorIndex Value="2"/>
</Unit39> <UsageCount Value="44"/>
<Unit40> <Loaded Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\wst_rtti_filter\dom_cursors.pas"/> <Filename Value="..\wst_rtti_filter\dom_cursors.pas"/>
<UnitName Value="dom_cursors"/> <UnitName Value="dom_cursors"/>
<CursorPos X="3" Y="110"/> <CursorPos X="1" Y="172"/>
<TopLine Value="108"/> <TopLine Value="161"/>
<EditorIndex Value="5"/> <EditorIndex Value="3"/>
<UsageCount Value="36"/> <UsageCount Value="70"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit40> </Unit25>
<Unit41> <Unit26>
<Filename Value="..\wst_rtti_filter\cursor_intf.pas"/> <Filename Value="..\wst_rtti_filter\cursor_intf.pas"/>
<UnitName Value="cursor_intf"/> <UnitName Value="cursor_intf"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="98"/>
<TopLine Value="1"/> <TopLine Value="87"/>
<EditorIndex Value="6"/> <EditorIndex Value="4"/>
<UsageCount Value="38"/> <UsageCount Value="72"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit41> </Unit26>
<Unit42> <Unit27>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysstrh.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysstrh.inc"/>
<CursorPos X="41" Y="69"/> <CursorPos X="10" Y="100"/>
<TopLine Value="67"/> <TopLine Value="86"/>
<UsageCount Value="6"/> <UsageCount Value="26"/>
</Unit42> </Unit27>
<Unit43> <Unit28>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\fcl\xml\dom.pp"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\fcl\xml\dom.pp"/>
<UnitName Value="DOM"/> <UnitName Value="DOM"/>
<CursorPos X="14" Y="232"/> <CursorPos X="3" Y="1387"/>
<TopLine Value="215"/> <TopLine Value="1385"/>
<UsageCount Value="9"/> <UsageCount Value="3"/>
</Unit43> </Unit28>
<Unit44> <Unit29>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpash.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpash.inc"/>
<CursorPos X="26" Y="139"/> <CursorPos X="26" Y="139"/>
<TopLine Value="125"/> <TopLine Value="125"/>
<UsageCount Value="8"/> <UsageCount Value="1"/>
</Unit44> </Unit29>
<Unit45> <Unit30>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpas.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\inc\objpas.inc"/>
<CursorPos X="11" Y="360"/> <CursorPos X="11" Y="360"/>
<TopLine Value="354"/> <TopLine Value="354"/>
<UsageCount Value="8"/> <UsageCount Value="1"/>
</Unit45> </Unit30>
<Unit46> <Unit31>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\classes\classesh.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="14" Y="219"/> <CursorPos X="14" Y="151"/>
<TopLine Value="183"/> <TopLine Value="137"/>
<UsageCount Value="9"/> <UsageCount Value="5"/>
</Unit46> </Unit31>
<Unit47> <Unit32>
<Filename Value="wsdl2pas_imp.pas"/> <Filename Value="wsdl2pas_imp.pas"/>
<UnitName Value="wsdl2pas_imp"/> <UnitName Value="wsdl2pas_imp"/>
<CursorPos X="3" Y="543"/> <CursorPos X="16" Y="543"/>
<TopLine Value="447"/> <TopLine Value="532"/>
<EditorIndex Value="4"/> <EditorIndex Value="1"/>
<UsageCount Value="29"/> <UsageCount Value="63"/>
<Bookmarks Count="1"> <Bookmarks Count="1">
<Item0 X="21" Y="665" ID="3"/> <Item0 X="21" Y="659" ID="3"/>
</Bookmarks> </Bookmarks>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit47> </Unit32>
<Unit48> <Unit33>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysutils.inc"/> <Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysutils.inc"/>
<CursorPos X="3" Y="567"/> <CursorPos X="3" Y="567"/>
<TopLine Value="565"/> <TopLine Value="565"/>
<UsageCount Value="3"/>
</Unit33>
<Unit34>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\fcl\xml\xmlread.pp"/>
<UnitName Value="XMLRead"/>
<CursorPos X="3" Y="954"/>
<TopLine Value="928"/>
<UsageCount Value="3"/>
</Unit34>
<Unit35>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\win32\classes.pp"/>
<UnitName Value="Classes"/>
<CursorPos X="11" Y="43"/>
<TopLine Value="20"/>
<UsageCount Value="3"/>
</Unit35>
<Unit36>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\win\wininc\messages.inc"/>
<CursorPos X="6" Y="1219"/>
<TopLine Value="639"/>
<UsageCount Value="3"/>
</Unit36>
<Unit37>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\objpas\classes\classes.inc"/>
<CursorPos X="24" Y="20"/>
<TopLine Value="13"/>
<UsageCount Value="3"/>
</Unit37>
<Unit38>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\objpas\classes\classesh.inc"/>
<CursorPos X="26" Y="301"/>
<TopLine Value="286"/>
<UsageCount Value="3"/>
</Unit38>
<Unit39>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\inc\objpash.inc"/>
<CursorPos X="1" Y="1"/>
<TopLine Value="319"/>
<UsageCount Value="3"/>
</Unit39>
<Unit40>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\rtl\inc\getopts.pp"/>
<UnitName Value="getopts"/>
<CursorPos X="49" Y="203"/>
<TopLine Value="10"/>
<UsageCount Value="10"/> <UsageCount Value="10"/>
</Unit48> </Unit40>
<Unit41>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\packages\fcl-xml\src\dom.pp"/>
<UnitName Value="DOM"/>
<CursorPos X="27" Y="41"/>
<TopLine Value="1"/>
<UsageCount Value="9"/>
</Unit41>
<Unit42>
<Filename Value="..\..\..\..\lazarus211\fpc\2.1.1\source\packages\fcl-base\src\inc\avl_tree.pp"/>
<UnitName Value="AVL_Tree"/>
<CursorPos X="54" Y="156"/>
<TopLine Value="332"/>
<UsageCount Value="5"/>
</Unit42>
<Unit43>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\fcl\inc\contnrs.pp"/>
<UnitName Value="contnrs"/>
<CursorPos X="30" Y="685"/>
<TopLine Value="683"/>
<UsageCount Value="5"/>
</Unit43>
<Unit44>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\classes\lists.inc"/>
<CursorPos X="3" Y="29"/>
<TopLine Value="27"/>
<UsageCount Value="5"/>
</Unit44>
<Unit45>
<Filename Value="..\..\..\..\lazarusClean\fpc\2.0.4\source\rtl\objpas\sysutils\sysstr.inc"/>
<CursorPos X="1" Y="689"/>
<TopLine Value="686"/>
<UsageCount Value="26"/>
</Unit45>
</Units> </Units>
<JumpHistory Count="2" HistoryIndex="1"> <JumpHistory Count="9" HistoryIndex="8">
<Position1> <Position1>
<Filename Value="generator.pas"/> <Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="427" Column="75" TopLine="414"/> <Caret Line="1159" Column="12" TopLine="1136"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="generator.pas"/> <Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="1" Column="1" TopLine="1"/> <Caret Line="427" Column="11" TopLine="413"/>
</Position2> </Position2>
<Position3>
<Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="533" Column="32" TopLine="497"/>
</Position3>
<Position4>
<Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="627" Column="22" TopLine="615"/>
</Position4>
<Position5>
<Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="541" Column="52" TopLine="525"/>
</Position5>
<Position6>
<Filename Value="parserdefs.pas"/>
<Caret Line="333" Column="35" TopLine="312"/>
</Position6>
<Position7>
<Filename Value="parserdefs.pas"/>
<Caret Line="343" Column="34" TopLine="342"/>
</Position7>
<Position8>
<Filename Value="wsdl2pas_imp.pas"/>
<Caret Line="656" Column="66" TopLine="641"/>
</Position8>
<Position9>
<Filename Value="generator.pas"/>
<Caret Line="1837" Column="16" TopLine="1822"/>
</Position9>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -15,6 +15,7 @@ type
TWsdlParser = class; TWsdlParser = class;
TAbstractTypeParserClass = class of TAbstractTypeParser;
{ TAbstractTypeParser } { TAbstractTypeParser }
TAbstractTypeParser = class TAbstractTypeParser = class
@ -32,6 +33,16 @@ type
const ATypeName : string; const ATypeName : string;
const AEmbededDef : Boolean const AEmbededDef : Boolean
); );
class function ExtractEmbeddedTypeFromElement(
AOwner : TWsdlParser;
AEltNode : TDOMNode;
ASymbols : TSymbolTable;
const ATypeName : string
) : TTypeDefinition;
class function GetParserSupportedStyle():string;virtual;abstract;
class procedure RegisterParser(AParserClass : TAbstractTypeParserClass);
class function GetRegisteredParserCount() : Integer;
class function GetRegisteredParser(const AIndex : Integer):TAbstractTypeParserClass;
function Parse():TTypeDefinition;virtual;abstract; function Parse():TTypeDefinition;virtual;abstract;
end; end;
@ -59,6 +70,7 @@ type
function ParseSimpleContent(const ATypeName : string):TTypeDefinition; function ParseSimpleContent(const ATypeName : string):TTypeDefinition;
function ParseEmptyContent(const ATypeName : string):TTypeDefinition; function ParseEmptyContent(const ATypeName : string):TTypeDefinition;
public public
class function GetParserSupportedStyle():string;override;
function Parse():TTypeDefinition;override; function Parse():TTypeDefinition;override;
end; end;
@ -74,10 +86,11 @@ type
private private
procedure CreateNodeCursors(); procedure CreateNodeCursors();
procedure ExtractTypeName(); procedure ExtractTypeName();
procedure ExtractContentType(); function ExtractContentType() : Boolean;
function ParseEnumContent():TTypeDefinition; function ParseEnumContent():TTypeDefinition;
function ParseOtherContent():TTypeDefinition; function ParseOtherContent():TTypeDefinition;
public public
class function GetParserSupportedStyle():string;override;
function Parse():TTypeDefinition;override; function Parse():TTypeDefinition;override;
end; end;
@ -101,15 +114,6 @@ type
FTypesCursor : IObjectCursor; FTypesCursor : IObjectCursor;
FSchemaCursor : IObjectCursor; FSchemaCursor : IObjectCursor;
private private
procedure CreateWsdlNameFilter(
AFltrCreator : TRttiFilterCreator;
const AName : WideString
);overload;
procedure CreateXsNameFilter(
AFltrCreator : TRttiFilterCreator;
const AName : WideString
);
function CreateWsdlNameFilter(const AName : WideString):IObjectFilter; function CreateWsdlNameFilter(const AName : WideString):IObjectFilter;
function FindNamedNode(AList : IObjectCursor; const AName : WideString):TDOMNode; function FindNamedNode(AList : IObjectCursor; const AName : WideString):TDOMNode;
procedure Prepare(); procedure Prepare();
@ -165,6 +169,7 @@ const
s_port : WideString = 'port'; s_port : WideString = 'port';
s_portType : WideString = 'portType'; s_portType : WideString = 'portType';
s_prohibited : WideString = 'prohibited'; s_prohibited : WideString = 'prohibited';
s_ref : WideString = 'ref';
s_required : WideString = 'required'; s_required : WideString = 'required';
s_restriction : WideString = 'restriction'; s_restriction : WideString = 'restriction';
//s_return : WideString = 'return'; //s_return : WideString = 'return';
@ -222,28 +227,6 @@ begin
Result := Copy(Result,( i + 1 ), MaxInt); Result := Copy(Result,( i + 1 ), MaxInt);
end; end;
procedure CreateQualifiedNameFilter(
AFltrCreator : TRttiFilterCreator;
const AName : WideString;
APrefixList : TStrings
);
var
k : Integer;
locStr : string;
locWStr : WideString;
begin
AFltrCreator.Clear(clrFreeObjects);
for k := 0 to Pred(APrefixList.Count) do begin
if IsStrEmpty(APrefixList[k]) then
locWStr := ''
else
locWStr := APrefixList[k] + ':';
locWStr := locWStr + AName;
locStr := s_NODE_NAME;
AFltrCreator.AddCondition(locStr,sfoEqualCaseInsensitive,locWStr,fcOr);
end;
end;
function CreateQualifiedNameFilterStr( function CreateQualifiedNameFilterStr(
const AName : WideString; const AName : WideString;
APrefixList : TStrings APrefixList : TStrings
@ -254,31 +237,27 @@ var
locWStr : WideString; locWStr : WideString;
begin begin
Result := ''; Result := '';
if ( APrefixList.Count > 0 ) then begin
for k := 0 to Pred(APrefixList.Count) do begin for k := 0 to Pred(APrefixList.Count) do begin
if IsStrEmpty(APrefixList[k]) then if IsStrEmpty(APrefixList[k]) then begin
locWStr := '' locWStr := ''
else end else begin
locWStr := APrefixList[k] + ':'; locWStr := APrefixList[k] + ':';
end;
locWStr := locWStr + AName; locWStr := locWStr + AName;
locStr := s_NODE_NAME; locStr := s_NODE_NAME;
Result := Result + ' or ' + locStr + ' = ' + QuotedStr(locWStr); Result := Result + ' or ' + locStr + ' = ' + QuotedStr(locWStr);
end; end;
if ( Length(Result) > 0 ) then if ( Length(Result) > 0 ) then begin
Delete(Result,1,Length(' or')); Delete(Result,1,Length(' or'));
end;
end else begin
Result := Format('%s = %s',[s_NODE_NAME,QuotedStr(AName)]);
end;
end; end;
{ TWsdlParser } { TWsdlParser }
procedure TWsdlParser.CreateWsdlNameFilter(AFltrCreator : TRttiFilterCreator; const AName : WideString);
begin
CreateQualifiedNameFilter(AFltrCreator,AName,FWsdlShortNames);
end;
procedure TWsdlParser.CreateXsNameFilter(AFltrCreator: TRttiFilterCreator;const AName: WideString);
begin
CreateQualifiedNameFilter(AFltrCreator,AName,FXSShortNames);
end;
function TWsdlParser.CreateWsdlNameFilter(const AName: WideString): IObjectFilter; function TWsdlParser.CreateWsdlNameFilter(const AName: WideString): IObjectFilter;
begin begin
Result := ParseFilter(CreateQualifiedNameFilterStr(AName,FWsdlShortNames),TDOMNodeRttiExposer); Result := ParseFilter(CreateQualifiedNameFilterStr(AName,FWsdlShortNames),TDOMNodeRttiExposer);
@ -330,6 +309,7 @@ begin
if AClearBefore then begin if AClearBefore then begin
AResList.Clear(); AResList.Clear();
end; end;
AAttribCursor.Reset();
crs := CreateCursorOn(AAttribCursor,ParseFilter(Format('%s=%s',[s_NODE_VALUE,QuotedStr(ANameSpace)]),TDOMNodeRttiExposer)); crs := CreateCursorOn(AAttribCursor,ParseFilter(Format('%s=%s',[s_NODE_VALUE,QuotedStr(ANameSpace)]),TDOMNodeRttiExposer));
crs.Reset(); crs.Reset();
if crs.MoveNext() then begin if crs.MoveNext() then begin
@ -384,7 +364,7 @@ begin
ExtractNameSpaceShortNames(locAttCursor,FWsdlShortNames,s_wsdl,nfaRaiseException,True); ExtractNameSpaceShortNames(locAttCursor,FWsdlShortNames,s_wsdl,nfaRaiseException,True);
ExtractNameSpaceShortNames(locAttCursor,FSoapShortNames,s_soap,nfaRaiseException,False); ExtractNameSpaceShortNames(locAttCursor,FSoapShortNames,s_soap,nfaRaiseException,False);
ExtractNameSpaceShortNames(locAttCursor,FXSShortNames,s_xs,nfaRaiseException,True); ExtractNameSpaceShortNames(locAttCursor,FXSShortNames,s_xs,nfaNone,True);
FServiceCursor := CreateCursorOn( FServiceCursor := CreateCursorOn(
FChildCursor.Clone() as IObjectCursor, FChildCursor.Clone() as IObjectCursor,
@ -558,6 +538,19 @@ begin
end; end;
end; end;
function StrToBindingStyle(const AStr : string):TBindingStyle;
begin
if IsStrEmpty(AStr) then begin
Result := bsDocument;
end else if AnsiSameText(AStr,s_document) then begin
Result := bsDocument;
end else if AnsiSameText(AStr,s_rpc) then begin
Result := bsRPC;
end else begin
Result := bsUnknown;
end;
end;
function TWsdlParser.ParsePortType(ANode, ABindingNode : TDOMNode) : TInterfaceDefinition; function TWsdlParser.ParsePortType(ANode, ABindingNode : TDOMNode) : TInterfaceDefinition;
function ExtractSoapBindingStyle(out AName : WideString):Boolean ; function ExtractSoapBindingStyle(out AName : WideString):Boolean ;
@ -660,6 +653,7 @@ begin
locOpCursor.Reset(); locOpCursor.Reset();
ExtractSoapBindingStyle(locWStrBuffer); ExtractSoapBindingStyle(locWStrBuffer);
locSoapBindingStyle := locWStrBuffer; locSoapBindingStyle := locWStrBuffer;
locIntf.BindingStyle := StrToBindingStyle(locSoapBindingStyle);
locBindingOperationCursor := ExtractBindingOperationCursor(); locBindingOperationCursor := ExtractBindingOperationCursor();
while locOpCursor.MoveNext() do begin while locOpCursor.MoveNext() do begin
locObj := locOpCursor.GetCurrent() as TDOMNodeRttiExposer; locObj := locOpCursor.GetCurrent() as TDOMNodeRttiExposer;
@ -1038,8 +1032,6 @@ end;
procedure TWsdlParser.ParseTypes(); procedure TWsdlParser.ParseTypes();
var var
locTypeCrs : IObjectCursor;
locObj : TDOMNodeRttiExposer;
nd : TDOMNodeRttiExposer; nd : TDOMNodeRttiExposer;
schmCrsr, crsSchemaChild, typTmpCrs : IObjectCursor; schmCrsr, crsSchemaChild, typTmpCrs : IObjectCursor;
typFilterStr : string; typFilterStr : string;
@ -1208,6 +1200,107 @@ begin
FEmbededDef := AEmbededDef; FEmbededDef := AEmbededDef;
end; end;
class function TAbstractTypeParser.ExtractEmbeddedTypeFromElement(
AOwner : TWsdlParser;
AEltNode : TDOMNode;
ASymbols : TSymbolTable;
const ATypeName : string
): TTypeDefinition;
function ExtractTypeName() : string;
var
locCrs : IObjectCursor;
begin
locCrs := CreateCursorOn(
CreateAttributesCursor(AEltNode,cetRttiNode),
ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)
);
locCrs.Reset();
if not locCrs.MoveNext() then
raise EWslParserException.Create('Unable to find the <name> tag in the type/element node attributes.');
Result := (locCrs.GetCurrent() as TDOMNodeRttiExposer).NodeValue;
if IsStrEmpty(Result) then begin
raise EWslParserException.Create('Invalid type/element name( the name is empty ).');
end;
end;
function FindParser(out AFoundTypeNode : TDOMNode):TAbstractTypeParserClass;
var
k : Integer;
locPrsClss : TAbstractTypeParserClass;
locFilter : string;
locCrs : IObjectCursor;
begin
Result := nil;
AFoundTypeNode := nil;
for k := 0 to Pred(GetRegisteredParserCount()) do begin
locPrsClss := GetRegisteredParser(k);
locFilter := locPrsClss.GetParserSupportedStyle();
if not IsStrEmpty(locFilter) then begin
locFilter := CreateQualifiedNameFilterStr(locFilter,AOwner.FXSShortNames);
locCrs := CreateCursorOn(CreateChildrenCursor(AEltNode,cetRttiNode),ParseFilter(locFilter,TDOMNodeRttiExposer));
locCrs.Reset();
if locCrs.MoveNext() then begin
AFoundTypeNode := (locCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject;
Result := locPrsClss;
Break;
end;
end;
end;
end;
var
typName : string;
prsClss : TAbstractTypeParserClass;
prs : TAbstractTypeParser;
typNode : TDOMNode;
begin
if not AEltNode.HasChildNodes() then begin;
raise EWslParserException.Create('Invalid type definition, this element must have children.');
end;
Result := nil;
typName := ATypeName;
if IsStrEmpty(typName) then begin
typName := ExtractTypeName();
end;
prsClss := FindParser(typNode);
if ( prsClss = nil ) then begin;
raise EWslParserException.CreateFmt('This type style is not supported : "%s".',[typName]);
end;
prs := prsClss.Create(AOwner,typNode,ASymbols,typName,True);
try
Result := prs.Parse();
finally
FreeAndNil(prs);
end;
end;
var
FTypeParserList : TClassList = nil;
class procedure TAbstractTypeParser.RegisterParser(AParserClass: TAbstractTypeParserClass);
begin
if ( FTypeParserList = nil ) then begin
FTypeParserList := TClassList.Create();
end;
if ( FTypeParserList.IndexOf(AParserClass) < 0 ) then begin
FTypeParserList.Add(AParserClass);
end;
end;
class function TAbstractTypeParser.GetRegisteredParserCount(): Integer;
begin
if Assigned(FTypeParserList) then begin
Result := FTypeParserList.Count;
end else begin
Result := 0;
end;
end;
class function TAbstractTypeParser.GetRegisteredParser(const AIndex: Integer): TAbstractTypeParserClass;
begin
Result := TAbstractTypeParserClass(FTypeParserList[AIndex]);
end;
{ TComplexTypeParser } { TComplexTypeParser }
@ -1273,7 +1366,7 @@ procedure TComplexTypeParser.ExtractBaseType();
var var
locContentChildCrs, locCrs : IObjectCursor; locContentChildCrs, locCrs : IObjectCursor;
locSymbol : TAbstractSymbolDefinition; locSymbol : TAbstractSymbolDefinition;
locBaseTypeName, locFilterStr : string; locBaseTypeName, locBaseTypeInternalName, locFilterStr : string;
begin begin
locFilterStr := CreateQualifiedNameFilterStr(s_extension,FOwner.FXSShortNames); locFilterStr := CreateQualifiedNameFilterStr(s_extension,FOwner.FXSShortNames);
locContentChildCrs := CreateChildrenCursor(FContentNode,cetRttiNode); locContentChildCrs := CreateChildrenCursor(FContentNode,cetRttiNode);
@ -1313,6 +1406,9 @@ begin
if Assigned(locSymbol) then begin if Assigned(locSymbol) then begin
if locSymbol.InheritsFrom(TTypeDefinition) then begin if locSymbol.InheritsFrom(TTypeDefinition) then begin
FBaseType := locSymbol as TTypeDefinition; FBaseType := locSymbol as TTypeDefinition;
while Assigned(FBaseType) and FBaseType.InheritsFrom(TTypeAliasDefinition) do begin
FBaseType := (FBaseType as TTypeAliasDefinition).BaseType;
end;
if FBaseType.InheritsFrom(TNativeSimpleTypeDefinition) then begin if FBaseType.InheritsFrom(TNativeSimpleTypeDefinition) then begin
Assert(Assigned(TNativeSimpleTypeDefinition(FBaseType).BoxedType)); Assert(Assigned(TNativeSimpleTypeDefinition(FBaseType).BoxedType));
FBaseType := TNativeSimpleTypeDefinition(FBaseType).BoxedType; FBaseType := TNativeSimpleTypeDefinition(FBaseType).BoxedType;
@ -1321,7 +1417,12 @@ begin
raise EWslParserException.CreateFmt('"%s" was expected to be a type definition.',[locSymbol.Name]); raise EWslParserException.CreateFmt('"%s" was expected to be a type definition.',[locSymbol.Name]);
end; end;
end else begin end else begin
FBaseType := TForwardTypeDefinition.Create(locBaseTypeName); locBaseTypeInternalName := ExtractIdentifier(locBaseTypeName);
if IsReservedKeyWord(locBaseTypeInternalName) then
locBaseTypeInternalName := '_' + locBaseTypeInternalName ;
FBaseType := TForwardTypeDefinition.Create(locBaseTypeInternalName);
if not AnsiSameText(locBaseTypeInternalName,locBaseTypeName) then
FBaseType.RegisterExternalAlias(locBaseTypeName);
FSymbols.Add(FBaseType); FSymbols.Add(FBaseType);
end; end;
end; end;
@ -1388,7 +1489,7 @@ var
procedure ParseElement(AElement : TDOMNode); procedure ParseElement(AElement : TDOMNode);
var var
locAttCursor, locPartCursor : IObjectCursor; locAttCursor, locPartCursor : IObjectCursor;
locName, locTypeName : string; locName, locTypeName, locTypeInternalName : string;
locType : TAbstractSymbolDefinition; locType : TAbstractSymbolDefinition;
locInternalEltName : string; locInternalEltName : string;
locProp : TPropertyDefinition; locProp : TPropertyDefinition;
@ -1396,25 +1497,54 @@ var
locMinOccur, locMaxOccur : Integer; locMinOccur, locMaxOccur : Integer;
locMaxOccurUnbounded : Boolean; locMaxOccurUnbounded : Boolean;
locStrBuffer : string; locStrBuffer : string;
locIsRefElement : Boolean;
begin begin
locType := nil;
locTypeName := '';
locAttCursor := CreateAttributesCursor(AElement,cetRttiNode); locAttCursor := CreateAttributesCursor(AElement,cetRttiNode);
locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer)); locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_name)]),TDOMNodeRttiExposer));
locPartCursor.Reset(); locPartCursor.Reset();
if not locPartCursor.MoveNext() then locIsRefElement := False;
raise EWslParserException.Create('Invalid <element> definition : missing "name" attribute.'); if not locPartCursor.MoveNext() then begin
locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_ref)]),TDOMNodeRttiExposer));
locPartCursor.Reset();
if not locPartCursor.MoveNext() then begin
raise EWslParserException.Create('Invalid <element> definition : missing "name" or "ref" attribute.');
end;
locIsRefElement := True;
end;
locName := (locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue; locName := (locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue;
if locIsRefElement then begin
locName := ExtractNameFromQName(locName);
end;
if IsStrEmpty(locName) then if IsStrEmpty(locName) then
raise EWslParserException.Create('Invalid <element> definition : empty "name".'); raise EWslParserException.Create('Invalid <element> definition : empty "name".');
if locIsRefElement then begin
locTypeName := locName;
end else begin
locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer)); locPartCursor := CreateCursorOn(locAttCursor.Clone() as IObjectCursor,ParseFilter(Format('%s = %s',[s_NODE_NAME,QuotedStr(s_type)]),TDOMNodeRttiExposer));
locPartCursor.Reset(); locPartCursor.Reset();
if not locPartCursor.MoveNext() then if locPartCursor.MoveNext() then begin
raise EWslParserException.Create('Invalid <element> definition : missing "type" attribute.');
locTypeName := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue); locTypeName := ExtractNameFromQName((locPartCursor.GetCurrent() as TDOMNodeRttiExposer).NodeValue);
end else begin
locTypeName := Format('%s_%s_Type',[FTypeName,locName]);
locType := TAbstractTypeParser.ExtractEmbeddedTypeFromElement(FOwner,AElement,FSymbols,locTypeName);
if ( locType = nil ) then begin
raise EWslParserException.CreateFmt('Invalid <element> definition : unable to determine the type.'#13'Type name : "%s"; Element name :"%s".',[FTypeName,locName]);
end;
FSymbols.Add(locType);
end;
end;
if IsStrEmpty(locTypeName) then if IsStrEmpty(locTypeName) then
raise EWslParserException.Create('Invalid <element> definition : empty "type".'); raise EWslParserException.Create('Invalid <element> definition : empty "type".');
locType := FSymbols.Find(locTypeName); locType := FSymbols.Find(locTypeName);
if not Assigned(locType) then begin if not Assigned(locType) then begin
locType := TForwardTypeDefinition.Create(locTypeName); locTypeInternalName := locTypeName;
if IsReservedKeyWord(locTypeInternalName) then
locTypeInternalName := '_' + locTypeInternalName;
locType := TForwardTypeDefinition.Create(locTypeInternalName);
if not AnsiSameText(locTypeInternalName,locTypeName) then
locType.RegisterExternalAlias(locTypeName);
FSymbols.Add(locType); FSymbols.Add(locType);
end; end;
@ -1467,12 +1597,17 @@ var
var var
locPropTyp : TPropertyDefinition; locPropTyp : TPropertyDefinition;
k : Integer; k : Integer;
locString : string;
locSym : TAbstractSymbolDefinition;
begin begin
for k := 0 to Pred(AArrayPropList.Count) do begin for k := 0 to Pred(AArrayPropList.Count) do begin
locPropTyp := AArrayPropList[k] as TPropertyDefinition; locPropTyp := AArrayPropList[k] as TPropertyDefinition;
locString := Format('%s_%sArray',[AClassName,locPropTyp.Name]);
locSym := FSymbols.Find(locString);
if ( locSym = nil ) then begin
FSymbols.Add( FSymbols.Add(
TArrayDefinition.Create( TArrayDefinition.Create(
Format('%s_%sArray',[AClassName,locPropTyp.Name]), locString,
locPropTyp.DataType, locPropTyp.DataType,
locPropTyp.Name, locPropTyp.Name,
locPropTyp.ExternalName, locPropTyp.ExternalName,
@ -1481,6 +1616,7 @@ var
); );
end; end;
end; end;
end;
function ExtractSoapArray(const AInternalName : string; const AHasInternalName : Boolean) : TArrayDefinition; function ExtractSoapArray(const AInternalName : string; const AHasInternalName : Boolean) : TArrayDefinition;
var var
@ -1558,12 +1694,19 @@ begin
ExtractBaseType(); ExtractBaseType();
eltCrs := ExtractElementCursor(); eltCrs := ExtractElementCursor();
internalName := ATypeName; internalName := ExtractIdentifier(ATypeName);
hasInternalName := IsReservedKeyWord(internalName) or { while IsReservedKeyWord(internalName) or ( FSymbols.IndexOf(internalName) <> -1 ) do begin
( not IsValidIdent(internalName) );{ or
( FSymbols.IndexOf(internalName) <> -1 );}
if hasInternalName then
internalName := Format('_%s',[internalName]); internalName := Format('_%s',[internalName]);
end;
hasInternalName := ( not AnsiSameText(internalName,ATypeName) );
}
hasInternalName := IsReservedKeyWord(internalName) or
( not IsValidIdent(internalName) ) or
//( FSymbols.IndexOf(internalName) <> -1 ) or
( not AnsiSameText(internalName,ATypeName) );
if hasInternalName then begin
internalName := Format('_%s',[internalName]);
end;
if ( FDerivationMode = dmRestriction ) and FBaseType.SameName(s_array) then begin if ( FDerivationMode = dmRestriction ) and FBaseType.SameName(s_array) then begin
Result := ExtractSoapArray(internalName,hasInternalName); Result := ExtractSoapArray(internalName,hasInternalName);
@ -1789,6 +1932,11 @@ begin
); );
end; end;
function TComplexTypeParser.GetParserSupportedStyle(): string;
begin
Result := s_complexType;
end;
function TComplexTypeParser.Parse() : TTypeDefinition; function TComplexTypeParser.Parse() : TTypeDefinition;
var var
locSym : TAbstractSymbolDefinition; locSym : TAbstractSymbolDefinition;
@ -1846,7 +1994,7 @@ begin
raise EWslParserException.Create('Invalid type name( the name is empty ).'); raise EWslParserException.Create('Invalid type name( the name is empty ).');
end; end;
procedure TSimpleTypeParser.ExtractContentType(); function TSimpleTypeParser.ExtractContentType() : Boolean;
var var
locCrs, locAttCrs : IObjectCursor; locCrs, locAttCrs : IObjectCursor;
tmpNode : TDOMNode; tmpNode : TDOMNode;
@ -1890,8 +2038,10 @@ begin
raise EWslParserException.CreateFmt('Base type is not specified for the simple type, parsing : "%s".',[FTypeName]); raise EWslParserException.CreateFmt('Base type is not specified for the simple type, parsing : "%s".',[FTypeName]);
FIsEnum := False FIsEnum := False
end; end;
Result := True;
end else begin end else begin
raise EWslParserException.CreateFmt('The parser only support "Restriction" mode simple type derivation, parsing : "%s".',[FTypeName]); //raise EWslParserException.CreateFmt('The parser only support "Restriction" mode simple type derivation, parsing : "%s".',[FTypeName]);
Result := False;
end; end;
end; end;
@ -1916,6 +2066,7 @@ var
locCrs : IObjectCursor; locCrs : IObjectCursor;
locItem : TEnumItemDefinition; locItem : TEnumItemDefinition;
locHasInternalName : Boolean; locHasInternalName : Boolean;
locBuffer : string;
begin begin
locCrs := CreateCursorOn(CreateAttributesCursor(AItemNode,cetRttiNode),ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_value)]),TDOMNodeRttiExposer)) as IObjectCursor; locCrs := CreateCursorOn(CreateAttributesCursor(AItemNode,cetRttiNode),ParseFilter(Format('%s=%s',[s_NODE_NAME,QuotedStr(s_value)]),TDOMNodeRttiExposer)) as IObjectCursor;
if not Assigned(locCrs) then if not Assigned(locCrs) then
@ -1928,12 +2079,19 @@ var
if IsStrEmpty(locItemName) then if IsStrEmpty(locItemName) then
raise EWslParserException.CreateFmt('Invalid "enum" item node : the value attribute is empty, type = "%s".',[FTypeName]); raise EWslParserException.CreateFmt('Invalid "enum" item node : the value attribute is empty, type = "%s".',[FTypeName]);
locInternalItemName := locItemName; locInternalItemName := ExtractIdentifier(locItemName);
locHasInternalName := IsReservedKeyWord(locInternalItemName) or locHasInternalName := IsReservedKeyWord(locInternalItemName) or
( not IsValidIdent(locInternalItemName) ) or ( not IsValidIdent(locInternalItemName) ) or
( FSymbols.IndexOf(locInternalItemName) <> -1 ); ( FSymbols.IndexOf(locInternalItemName) <> -1 ) or
if locHasInternalName then ( not AnsiSameText(locInternalItemName,locItemName) );
locInternalItemName := Format('%s_%s',[locRes.ExternalName,locInternalItemName]); if locHasInternalName then begin
locBuffer := ExtractIdentifier(locRes.ExternalName);
if IsStrEmpty(locBuffer) and ( locBuffer[Length(locBuffer)] <> '_' ) then begin
locInternalItemName := Format('%s_%s',[locBuffer,locInternalItemName]);
end else begin
locInternalItemName := Format('%s%s',[locBuffer,locInternalItemName]);
end;
end;
locItem := TEnumItemDefinition.Create(locInternalItemName,locRes,locOrder); locItem := TEnumItemDefinition.Create(locInternalItemName,locRes,locOrder);
if locHasInternalName then if locHasInternalName then
locItem.RegisterExternalAlias(locItemName); locItem.RegisterExternalAlias(locItemName);
@ -1951,7 +2109,7 @@ begin
intrName := FTypeName; intrName := FTypeName;
hasIntrnName := IsReservedKeyWord(FTypeName) or hasIntrnName := IsReservedKeyWord(FTypeName) or
( FSymbols.IndexOf(intrName) < 0 ); ( ( FSymbols.IndexOf(intrName) >= 0 ) and ( not FSymbols.ByName(intrName).InheritsFrom(TForwardTypeDefinition) ) );
if hasIntrnName then if hasIntrnName then
intrName := '_' + intrName; intrName := '_' + intrName;
@ -1978,6 +2136,11 @@ begin // todo : implement TSimpleTypeParser.ParseOtherContent
Result := TTypeAliasDefinition.Create(FTypeName,FSymbols.ByName(FBaseName) as TTypeDefinition); Result := TTypeAliasDefinition.Create(FTypeName,FSymbols.ByName(FBaseName) as TTypeDefinition);
end; end;
function TSimpleTypeParser.GetParserSupportedStyle(): string;
begin
Result := s_simpleType;
end;
function TSimpleTypeParser.Parse(): TTypeDefinition; function TSimpleTypeParser.Parse(): TTypeDefinition;
var var
locSym : TAbstractSymbolDefinition; locSym : TAbstractSymbolDefinition;
@ -1998,14 +2161,25 @@ begin
end; end;
end; end;
if locContinue then begin if locContinue then begin
ExtractContentType(); if ExtractContentType() then begin
if FIsEnum then begin if FIsEnum then begin
Result := ParseEnumContent() Result := ParseEnumContent()
end else begin end else begin
Result := ParseOtherContent(); Result := ParseOtherContent();
end; end;
end else begin
FBaseName := 'string';
Result := ParseOtherContent();
end;
end; end;
end; end;
end.
initialization
TAbstractTypeParser.RegisterParser(TSimpleTypeParser);
TAbstractTypeParser.RegisterParser(TComplexTypeParser);
finalization
FreeAndNil(FTypeParserList);
end.

View File

@ -1,7 +1,9 @@
unit dom_cursors; unit dom_cursors;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
//{$define FPC_211} {$IF (FPC_VERSION = 2) and (FPC_RELEASE > 0)}
{$define FPC_211}
{$ENDIF}
interface interface
uses uses