home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / exml.lha / exml / compiler_specific / se / xml_parser.e < prev    next >
Text File  |  1999-04-13  |  2KB  |  76 lines

  1. class
  2.     XML_PARSER
  3. inherit
  4.     XML_PARSER_ABS
  5.     C_STRING_HELPER
  6. creation
  7.     make
  8. feature
  9.  
  10.     set_base_imp (a_base: STRING) is
  11.             -- sets the base to be used for resolving URIs in system identifiers
  12.             -- in declarations. 
  13.         do
  14.             set_base (item, a_base.to_external)
  15.         end
  16.  
  17.     get_base_imp: STRING is
  18.             -- returns the base
  19.         do
  20.             create_copy_of_string_from_zstring (get_base (item))
  21.             Result := last_string
  22.                 --TODO: make sure the C-string does not need to be freed!
  23.         end
  24.  
  25.     parse_string_imp  (data: STRING): INTEGER is
  26.             -- function has side effect !!!
  27.         require
  28.             data_not_void: data /= Void
  29.         do
  30.                 -- TODO: Should I copy the string first?
  31.             Result := parse (item, data.to_external, data.count, 0)
  32.         end
  33.  
  34.     set_eiffel_object_as_user_data is
  35.             -- expat hooks receive a user defineble integer as
  36.             -- additional parameter. we set this to the Eiffel
  37.             -- parser object.
  38.         do
  39.             set_user_data (item, Current.to_pointer)
  40.         end
  41.  
  42.  
  43.     last_error_description: STRING is 
  44.         do
  45.             create_copy_of_string_from_zstring (error_string (last_error))
  46.             Result := last_string
  47.         end
  48.  
  49.     last_line_number: INTEGER is 
  50.         do
  51.             Result := get_current_line_number (item)
  52.         end
  53.     last_column_number: INTEGER is 
  54.         do
  55.             Result := get_current_column_number (item)
  56.         end
  57.     last_byte_index: INTEGER is 
  58.         do
  59.             Result := get_current_byte_index (item)
  60.         end
  61.  
  62. end -- class XML_PARSER
  63. --|-------------------------------------------------------------------------
  64. --| eXML, Eiffel XML Parser Toolkit
  65. --| Copyright (C) 1999  Andreas Leitner
  66. --| See the file forum.txt included in this package for licensing info.
  67. --|
  68. --| Comments, Questions, Additions to this library? please contact:
  69. --|
  70. --| Andreas Leitner
  71. --| Arndtgasse 1/3/5
  72. --| 8010 Graz
  73. --| Austria
  74. --| email: andreas.leitner@teleweb.at
  75. --| web: http://exml.dhs.org
  76. --|-------------------------------------------------------------------------