/[marvin]/marvin/src/libnn/xml/xmlVisitor.ml
ViewVC logotype

Diff of /marvin/src/libnn/xml/xmlVisitor.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by matthieu, Sun Sep 7 22:10:04 2003 UTC revision 1.8 by srv89, Mon Sep 8 12:45:49 2003 UTC
# Line 44  Line 44 
44  *)  *)
45    
46  open Sys  open Sys
47    open Pxp_yacc
48    
49  open DefaultVisitor  open DefaultVisitor
50  open Nn  open Nn
# Line 62  open TdNN Line 63  open TdNN
63  exception FileExists  exception FileExists
64    
65  (**  (**
66      
67    *)
68    class warner =
69    object
70      method warn w =
71        print_endline ("WARNING: " ^ w)
72    end
73      
74    (**
75    The abstract XML export visitor.    The abstract XML export visitor.
76    This object exports a neural network as an XML file.    This object exports a neural network as an XML file.
77    @raise FileExists Thrown if _overwriteFile is false, and someone tries to    @raise FileExists Thrown if _overwriteFile is false, and someone tries to
# Line 70  exception FileExists Line 80  exception FileExists
80  class virtual ['a] xmlVisitor =  class virtual ['a] xmlVisitor =
81  object (this)  object (this)
82    inherit ['a] defaultVisitor    inherit ['a] defaultVisitor
83        
84    (**    (**
85      The XML file's header. Contains the DTD.      The XML file's header. Contains the DTD.
86      @see <http://www.w3schools.com/dtd/dtd_intro.asp> How to get a DTD      @see <http://www.w3schools.com/dtd/dtd_intro.asp> How to get a DTD
# Line 351  tdnn_time_nb,tdnn_field_size)> Line 361  tdnn_time_nb,tdnn_field_size)>
361      close_out _outChannel      close_out _outChannel
362    
363    (**    (**
364        Parses an XML file and creates a nn object out of it.
365      *)
366      method private xmlParse =
367        let document2Nn doc =
368          ((new mlpNN) :> nn)
369        in
370          try
371            let config =
372              { default_config with warner = new warner }
373            in
374            let d =
375              parse_document_entity config (from_file "doc.xml") default_spec
376            in
377              document2Nn d
378          with
379              e ->
380                print_endline (Pxp_types.string_of_exn e); ((new mlpNN) :> nn)
381    
382              
383      (**
384      The generic visit method.      The generic visit method.
385    *)    *)
386    method virtual visit : 'a -> unit    method virtual visit : 'a -> unit

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26