Sha256: 57185c8280df659e2fa483acb40f183aac9858747cc4c58f0b934b6c58eea36d

Contents?: true

Size: 587 Bytes

Versions: 40

Compression:

Stored size: 587 Bytes

Contents

require 'ast'
module OrigenTesters::ATP
  module AST
    class Extractor
      include ::AST::Processor::Mixin

      attr_reader :types
      attr_reader :results

      def process(node, types = nil)
        if types
          @types = types
          @results = []
          # node = AST::Node.new(:wrapper, node) unless node.respond_to?(:to_ast)
        end
        super(node) if node.respond_to?(:to_ast)
        results
      end

      def handler_missing(node)
        @results << node if types.include?(node.type)
        process_all(node.children)
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
origen_testers-0.52.8 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.7 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.6 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.5 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.4 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.3 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.52.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.5 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.4 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.3 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.2 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.51.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.50.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.49.4 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.49.3 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.49.2 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.49.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.49.0 lib/origen_testers/atp/ast/extractor.rb