class RbGCCXML::SAXParser

Use SAX to parse the generated xml file. This will end up building the full tree of RbGCCXML::Nodes that fit the parsed C++ code.

Public Class Methods

new(xml_file) click to toggle source
# File lib/rbgccxml/sax_parser.rb, line 7
def initialize(xml_file)
  @file = xml_file
  @parser = Nokogiri::XML::SAX::Parser.new(ParserEventHandler.new)
end

Public Instance Methods

parse() click to toggle source

Kick off the process. When the parsing finishes, we take the root node of the tree and return it

# File lib/rbgccxml/sax_parser.rb, line 14
def parse
  @parser.parse(::File.open(@file))
  NodeCache.root
end