Class: Evergreen::IDL::IDLSaxParser

Inherits:
Object
  • Object
show all
Defined in:
lib/evergreen/idl.rb

Overview

A wrapper around the SAX parser

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ IDLSaxParser

Returns a new instance of IDLSaxParser.



35
36
37
38
# File 'lib/evergreen/idl.rb', line 35

def initialize(file)
  @parser = REXML::Parsers::SAX2Parser.new(file)
  @handler = IDLSaxHandler.new
end

Instance Method Details

#parseObject



40
41
42
43
44
# File 'lib/evergreen/idl.rb', line 40

def parse
  @parser.listen(@handler)
  @parser.parse
  @handler.idl_fields
end