Updated to use the new parser interface

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@470 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa 2008-06-06 15:11:41 +00:00
parent fd91a1cfe4
commit bf335843b4
3 changed files with 77 additions and 82 deletions

View File

@ -1,7 +1,7 @@
object formImport: TformImport
Left = 431
Left = 669
Height = 538
Top = 153
Top = 142
Width = 526
HorzScrollBar.Page = 525
VertScrollBar.Page = 537
@ -10,6 +10,7 @@ object formImport: TformImport
Caption = 'WSDL Importer'
ClientHeight = 538
ClientWidth = 526
LCLVersion = '0.9.25'
object Panel2: TPanel
Height = 490
Width = 526
@ -80,9 +81,9 @@ object formImport: TformImport
end
object edtAddToProject: TCheckBox
Left = 9
Height = 13
Height = 19
Top = 128
Width = 176
Width = 182
Caption = 'Add the generated files to project'
TabOrder = 4
end
@ -118,9 +119,9 @@ object formImport: TformImport
TabOrder = 1
object edtOptionIntf: TCheckBox
Left = 9
Height = 13
Height = 19
Top = 8
Width = 78
Width = 84
Caption = 'Interface file'
Checked = True
OnClick = edtOptionIntfClick
@ -129,9 +130,9 @@ object formImport: TformImport
end
object edtOptionProxy: TCheckBox
Left = 9
Height = 13
Height = 19
Top = 56
Width = 62
Width = 68
Caption = 'Proxy file'
Checked = True
State = cbChecked
@ -139,25 +140,25 @@ object formImport: TformImport
end
object edtOptionBinder: TCheckBox
Left = 294
Height = 13
Height = 19
Top = 8
Width = 105
Width = 111
Caption = 'Service Binder file'
TabOrder = 3
end
object edtOptionImp: TCheckBox
Left = 294
Height = 13
Height = 19
Top = 56
Width = 152
Width = 158
Caption = 'Implementation Skeleton file'
TabOrder = 4
end
object edtOptionIntfALL: TCheckBox
Left = 30
Height = 13
Height = 19
Top = 32
Width = 88
Width = 94
Caption = 'Parse all types'
OnClick = edtOptionIntfALLClick
TabOrder = 1
@ -217,7 +218,6 @@ object formImport: TformImport
end
end
object OD: TOpenDialog
Title = 'Ouvrir un fichier existant'
Filter = 'WSDL Files ( *.wsdl )|*.wsdl'
FilterIndex = 0
Options = [ofFileMustExist, ofEnableSizing, ofViewDetail]
@ -225,7 +225,6 @@ object formImport: TformImport
top = 32
end
object SDD: TSelectDirectoryDialog
Title = 'Choisir un répertoire'
FilterIndex = 0
left = 224
top = 176

View File

@ -1,65 +1,64 @@
{ Ceci est un fichier ressource généré automatiquement par Lazarus }
LazarusResources.Add('TformImport','FORMDATA',[
'TPF0'#11'TformImport'#10'formImport'#4'Left'#3#175#1#6'Height'#3#26#2#3'Top'
+#3#153#0#5'Width'#3#14#2#18'HorzScrollBar.Page'#3#13#2#18'VertScrollBar.Page'
'TPF0'#11'TformImport'#10'formImport'#4'Left'#3#157#2#6'Height'#3#26#2#3'Top'
+#3#142#0#5'Width'#3#14#2#18'HorzScrollBar.Page'#3#13#2#18'VertScrollBar.Page'
+#3#25#2#13'ActiveControl'#7#7'Button1'#11'BorderStyle'#7#13'bsSizeToolWin'#7
+'Caption'#6#13'WSDL Importer'#12'ClientHeight'#3#26#2#11'ClientWidth'#3#14#2
+#0#6'TPanel'#6'Panel2'#6'Height'#3#234#1#5'Width'#3#14#2#5'Align'#7#8'alClie'
+'nt'#12'ClientHeight'#3#234#1#11'ClientWidth'#3#14#2#8'TabOrder'#2#1#0#9'TGr'
+'oupBox'#9'GroupBox1'#4'Left'#2#8#6'Height'#3#168#0#3'Top'#2#8#5'Width'#3#250
+#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#12'ClientHeight'#3#150#0#11
+'ClientWidth'#3#246#1#8'TabOrder'#2#0#0#6'TLabel'#6'Label1'#4'Left'#2#9#6'He'
+'ight'#2#14#3'Top'#2#4#5'Width'#3#186#0#7'Caption'#6'&Web Services Descripti'
+'on File ( WSDL )'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#9#6'H'
+'eight'#2#14#3'Top'#2'E'#5'Width'#2'Q'#7'Caption'#6#16'Output directory'#11
+'ParentColor'#8#0#0#5'TEdit'#12'edtInputFile'#4'Left'#2#9#6'Height'#2#23#3'T'
+'op'#2#31#5'Width'#3#148#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'T'
+'abOrder'#2#0#0#0#7'TButton'#7'Button2'#4'Left'#3#175#1#6'Height'#2#25#3'Top'
+#2#31#5'Width'#2'('#6'Action'#7#11'actOpenFile'#7'Anchors'#11#5'akTop'#7'akR'
+'ight'#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#1#0#0#5'TEdit'#12'e'
+'dtOutputDir'#4'Left'#2#9#6'Height'#2#23#3'Top'#2'X'#5'Width'#3#148#1#7'Anch'
+'ors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0#0#7'TButton'#7'Bu'
+'tton3'#4'Left'#3#175#1#6'Height'#2#25#3'Top'#2'X'#5'Width'#2'('#6'Action'#7
+#10'actOpenDir'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBo'
+'rder'#2#4#8'TabOrder'#2#3#0#0#9'TCheckBox'#15'edtAddToProject'#4'Left'#2#9#6
+'Height'#2#13#3'Top'#3#128#0#5'Width'#3#176#0#7'Caption'#6'"Add the generate'
+'d files to project'#8'TabOrder'#2#4#0#0#0#9'TGroupBox'#9'GroupBox2'#4'Left'
+#2#8#6'Height'#3#162#0#3'Top'#3'@'#1#5'Width'#3#250#1#7'Anchors'#11#5'akTop'
+#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#12' Messages '#12'ClientH'
+'eight'#3#144#0#11'ClientWidth'#3#246#1#8'TabOrder'#2#2#0#5'TMemo'#6'mmoLog'
+#6'Height'#3#144#0#5'Width'#3#246#1#5'Align'#7#8'alClient'#8'ReadOnly'#9#10
+'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#0#0#0#0#9'TGroupBox'#9'GroupBox3'#4'L'
+'eft'#2#8#6'Height'#2'x'#3'Top'#3#184#0#5'Width'#3#250#1#7'Anchors'#11#5'akT'
+'op'#6'akLeft'#7'akRight'#0#7'Caption'#6#11' Options '#12'ClientHeight'#2
+'f'#11'ClientWidth'#3#246#1#8'TabOrder'#2#1#0#9'TCheckBox'#13'edtOptionIntf'
+#4'Left'#2#9#6'Height'#2#13#3'Top'#2#8#5'Width'#2'N'#7'Caption'#6#14'Interfa'
+'ce file'#7'Checked'#9#7'OnClick'#7#18'edtOptionIntfClick'#5'State'#7#9'cbCh'
+'ecked'#8'TabOrder'#2#0#0#0#9'TCheckBox'#14'edtOptionProxy'#4'Left'#2#9#6'He'
+'ight'#2#13#3'Top'#2'8'#5'Width'#2'>'#7'Caption'#6#10'Proxy file'#7'Checked'
+#9#5'State'#7#9'cbChecked'#8'TabOrder'#2#2#0#0#9'TCheckBox'#15'edtOptionBind'
+'er'#4'Left'#3'&'#1#6'Height'#2#13#3'Top'#2#8#5'Width'#2'i'#7'Caption'#6#19
+'Service Binder file'#8'TabOrder'#2#3#0#0#9'TCheckBox'#12'edtOptionImp'#4'Le'
+'ft'#3'&'#1#6'Height'#2#13#3'Top'#2'8'#5'Width'#3#152#0#7'Caption'#6#28'Impl'
+'ementation Skeleton file'#8'TabOrder'#2#4#0#0#9'TCheckBox'#16'edtOptionIntf'
+'ALL'#4'Left'#2#30#6'Height'#2#13#3'Top'#2' '#5'Width'#2'X'#7'Caption'#6#15
+'Parse all types'#7'OnClick'#7#21'edtOptionIntfALLClick'#8'TabOrder'#2#1#0#0
+#0#0#6'TPanel'#6'Panel1'#6'Height'#2'0'#3'Top'#3#234#1#5'Width'#3#14#2#5'Ali'
+'gn'#7#8'alBottom'#12'ClientHeight'#2'0'#11'ClientWidth'#3#14#2#8'TabOrder'#2
+#0#0#7'TButton'#7'Button1'#4'Left'#3'_'#1#6'Height'#2#25#3'Top'#2#8#5'Width'
+#2'K'#6'Action'#7#5'actOK'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'BorderSpac'
+'ing.InnerBorder'#2#4#7'Default'#9#8'TabOrder'#2#0#0#0#7'TButton'#7'Button4'
+#4'Left'#3#183#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#7'Anchors'#11#5'akT'
+'op'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6
+#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#0#11'TActionList'#2'AL'#4
+'left'#2'h'#3'top'#3'H'#1#0#7'TAction'#5'actOK'#7'Caption'#6#2'OK'#18'Disabl'
+'eIfNoHandler'#9#9'OnExecute'#7#12'actOKExecute'#8'OnUpdate'#7#11'actOKUpdat'
+'e'#0#0#7'TAction'#11'actOpenFile'#7'Caption'#6#3'...'#18'DisableIfNoHandler'
+#9#9'OnExecute'#7#18'actOpenFileExecute'#0#0#7'TAction'#10'actOpenDir'#7'Cap'
+'tion'#6#3'...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#17'actOpenDirExecute'
+#0#0#0#11'TOpenDialog'#2'OD'#5'Title'#6#26'Ouvrir un fichier existant'#6'Fil'
+'ter'#6#28'WSDL Files ( *.wsdl )|*.wsdl'#11'FilterIndex'#2#0#7'Options'#11#15
+'ofFileMustExist'#14'ofEnableSizing'#12'ofViewDetail'#0#4'left'#3#16#1#3'top'
+#2' '#0#0#22'TSelectDirectoryDialog'#3'SDD'#5'Title'#6#21'Choisir un r'#233
+'pertoire'#11'FilterIndex'#2#0#4'left'#3#224#0#3'top'#3#176#0#0#0#0
+#10'LCLVersion'#6#6'0.9.25'#0#6'TPanel'#6'Panel2'#6'Height'#3#234#1#5'Width'
+#3#14#2#5'Align'#7#8'alClient'#12'ClientHeight'#3#234#1#11'ClientWidth'#3#14
+#2#8'TabOrder'#2#1#0#9'TGroupBox'#9'GroupBox1'#4'Left'#2#8#6'Height'#3#168#0
+#3'Top'#2#8#5'Width'#3#250#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#12
+'ClientHeight'#3#150#0#11'ClientWidth'#3#246#1#8'TabOrder'#2#0#0#6'TLabel'#6
+'Label1'#4'Left'#2#9#6'Height'#2#14#3'Top'#2#4#5'Width'#3#186#0#7'Caption'#6
+'&Web Services Description File ( WSDL )'#11'ParentColor'#8#0#0#6'TLabel'#6
+'Label2'#4'Left'#2#9#6'Height'#2#14#3'Top'#2'E'#5'Width'#2'Q'#7'Caption'#6#16
+'Output directory'#11'ParentColor'#8#0#0#5'TEdit'#12'edtInputFile'#4'Left'#2
+#9#6'Height'#2#23#3'Top'#2#31#5'Width'#3#148#1#7'Anchors'#11#5'akTop'#6'akLe'
+'ft'#7'akRight'#0#8'TabOrder'#2#0#0#0#7'TButton'#7'Button2'#4'Left'#3#175#1#6
+'Height'#2#25#3'Top'#2#31#5'Width'#2'('#6'Action'#7#11'actOpenFile'#7'Anchor'
+'s'#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2
+#1#0#0#5'TEdit'#12'edtOutputDir'#4'Left'#2#9#6'Height'#2#23#3'Top'#2'X'#5'Wi'
+'dth'#3#148#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#2#0
+#0#7'TButton'#7'Button3'#4'Left'#3#175#1#6'Height'#2#25#3'Top'#2'X'#5'Width'
+#2'('#6'Action'#7#10'actOpenDir'#7'Anchors'#11#5'akTop'#7'akRight'#0#25'Bord'
+'erSpacing.InnerBorder'#2#4#8'TabOrder'#2#3#0#0#9'TCheckBox'#15'edtAddToProj'
+'ect'#4'Left'#2#9#6'Height'#2#19#3'Top'#3#128#0#5'Width'#3#182#0#7'Caption'#6
+'"Add the generated files to project'#8'TabOrder'#2#4#0#0#0#9'TGroupBox'#9'G'
+'roupBox2'#4'Left'#2#8#6'Height'#3#162#0#3'Top'#3'@'#1#5'Width'#3#250#1#7'An'
+'chors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#12' Mes'
+'sages '#12'ClientHeight'#3#144#0#11'ClientWidth'#3#246#1#8'TabOrder'#2#2#0
+#5'TMemo'#6'mmoLog'#6'Height'#3#144#0#5'Width'#3#246#1#5'Align'#7#8'alClient'
+#8'ReadOnly'#9#10'ScrollBars'#7#6'ssBoth'#8'TabOrder'#2#0#0#0#0#9'TGroupBox'
+#9'GroupBox3'#4'Left'#2#8#6'Height'#2'x'#3'Top'#3#184#0#5'Width'#3#250#1#7'A'
+'nchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#7'Caption'#6#11' Options '#12
+'ClientHeight'#2'f'#11'ClientWidth'#3#246#1#8'TabOrder'#2#1#0#9'TCheckBox'#13
+'edtOptionIntf'#4'Left'#2#9#6'Height'#2#19#3'Top'#2#8#5'Width'#2'T'#7'Captio'
+'n'#6#14'Interface file'#7'Checked'#9#7'OnClick'#7#18'edtOptionIntfClick'#5
+'State'#7#9'cbChecked'#8'TabOrder'#2#0#0#0#9'TCheckBox'#14'edtOptionProxy'#4
+'Left'#2#9#6'Height'#2#19#3'Top'#2'8'#5'Width'#2'D'#7'Caption'#6#10'Proxy fi'
+'le'#7'Checked'#9#5'State'#7#9'cbChecked'#8'TabOrder'#2#2#0#0#9'TCheckBox'#15
+'edtOptionBinder'#4'Left'#3'&'#1#6'Height'#2#19#3'Top'#2#8#5'Width'#2'o'#7'C'
+'aption'#6#19'Service Binder file'#8'TabOrder'#2#3#0#0#9'TCheckBox'#12'edtOp'
+'tionImp'#4'Left'#3'&'#1#6'Height'#2#19#3'Top'#2'8'#5'Width'#3#158#0#7'Capti'
+'on'#6#28'Implementation Skeleton file'#8'TabOrder'#2#4#0#0#9'TCheckBox'#16
+'edtOptionIntfALL'#4'Left'#2#30#6'Height'#2#19#3'Top'#2' '#5'Width'#2'^'#7'C'
+'aption'#6#15'Parse all types'#7'OnClick'#7#21'edtOptionIntfALLClick'#8'TabO'
+'rder'#2#1#0#0#0#0#6'TPanel'#6'Panel1'#6'Height'#2'0'#3'Top'#3#234#1#5'Width'
+#3#14#2#5'Align'#7#8'alBottom'#12'ClientHeight'#2'0'#11'ClientWidth'#3#14#2#8
+'TabOrder'#2#0#0#7'TButton'#7'Button1'#4'Left'#3'_'#1#6'Height'#2#25#3'Top'#2
+#8#5'Width'#2'K'#6'Action'#7#5'actOK'#7'Anchors'#11#5'akTop'#7'akRight'#0#25
+'BorderSpacing.InnerBorder'#2#4#7'Default'#9#8'TabOrder'#2#0#0#0#7'TButton'#7
+'Button4'#4'Left'#3#183#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#7'Anchors'
+#11#5'akTop'#7'akRight'#0#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Ca'
+'ption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#0#11'TActionList'
+#2'AL'#4'left'#2'h'#3'top'#3'H'#1#0#7'TAction'#5'actOK'#7'Caption'#6#2'OK'#18
+'DisableIfNoHandler'#9#9'OnExecute'#7#12'actOKExecute'#8'OnUpdate'#7#11'actO'
+'KUpdate'#0#0#7'TAction'#11'actOpenFile'#7'Caption'#6#3'...'#18'DisableIfNoH'
+'andler'#9#9'OnExecute'#7#18'actOpenFileExecute'#0#0#7'TAction'#10'actOpenDi'
+'r'#7'Caption'#6#3'...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#17'actOpenDi'
+'rExecute'#0#0#0#11'TOpenDialog'#2'OD'#6'Filter'#6#28'WSDL Files ( *.wsdl )|'
+'*.wsdl'#11'FilterIndex'#2#0#7'Options'#11#15'ofFileMustExist'#14'ofEnableSi'
+'zing'#12'ofViewDetail'#0#4'left'#3#16#1#3'top'#2' '#0#0#22'TSelectDirectory'
+'Dialog'#3'SDD'#11'FilterIndex'#2#0#4'left'#3#224#0#3'top'#3#176#0#0#0#0
]);

View File

@ -66,7 +66,7 @@ var
formImport: TformImport;
implementation
uses DOM, XMLRead, pastree, pascal_parser_intf, wsdl2pas_imp, source_utils,
uses DOM, XMLRead, pastree, pascal_parser_intf, wsdl_parser, source_utils,
generator, metadata_generator, binary_streamer, wst_resources_utils
{$IFDEF WST_IDE},LazIDEIntf{$ENDIF};
@ -80,7 +80,7 @@ function ParseWsdlFile(
):TwstPasTreeContainer;
var
locDoc : TXMLDocument;
prsr : TWsdlParser;
prsr : IParser;
symName : string;
begin
Result := nil;
@ -89,20 +89,17 @@ begin
if ( symName[Length(symName)] = '.' ) then begin
Delete(symName,Length(symName),1);
end;
prsr := nil;
ReadXMLFile(locDoc,AFileName);
try
Result := TwstPasTreeContainer.Create();
try
prsr := TWsdlParser.Create(locDoc,Result);
prsr.OnMessage := ANotifier;
prsr.Parse(pmAllTypes,symName);
prsr := TWsdlParser.Create(locDoc,Result,ANotifier);
prsr.Execute(pmAllTypes,symName);
except
FreeAndNil(Result);
raise;
end;
finally
FreeAndNil(prsr);
FreeAndNil(locDoc);
end;
end;