def method_missing(method, *args, &block)
if Parser::PROPERTIES.include?(method)
self.class.class_eval "def \#{method}(*args, &block)\nif property_supported?(:\#{method})\nparser.\#{method}(*args, &block)\nelse\nnil\nend\nend\n", __FILE__, __LINE__ + 1
send(method, *args, &block)
elsif Parser::METHODS.include?(method)
self.class.class_eval "def \#{method}(*args, &block)\nif parser.respond_to?(:\#{method})\nparser.\#{method}(*args, &block)\nend\nend\n", __FILE__, __LINE__ + 1
send(method, *args, &block)
elsif method.to_s =~ /([a-z_]+)\?/ and (Parser::PROPERTIES + Parser::METHODS).include?($1.to_sym)
self.class.class_eval "def \#{$1}?\n!\#{$1}.nil?\nend\n", __FILE__, __LINE__ + 1
send($1)
else
super
end
end