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.48.3 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.48.2 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.48.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.48.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.47.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.46.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.46.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.45.4 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.45.3 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.45.2 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.45.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.45.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.44.1 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.44.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.43.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.42.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.41.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.40.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.31.0 lib/origen_testers/atp/ast/extractor.rb
origen_testers-0.30.0 lib/origen_testers/atp/ast/extractor.rb