Sha256: 5b078ff821a2a5cf1f0864bc80c179899e1b76eab710f63be586ee6e4660d3b4

Contents?: true

Size: 822 Bytes

Versions: 1

Compression:

Stored size: 822 Bytes

Contents

module Pione
  module Transformer
    class DocumentTransformer < Parslet::Transform
      include LiteralTransformer
      include FeatureExprTransformer
      include ExprTransformer
      include FlowElementTransformer
      include BlockTransformer
      include RuleDefinitionTransformer

      def initialize(package_name="main")
        super()
        @current_package_name = package_name
        Thread.current[:current_package_name] = @current_package_name
      end

      def apply(*args)
        res = super
        return res
      end

      def check_model_type(data, type)
        data.pione_model_type == type
      end

      #
      # statement
      #

      # package
      rule(:package => subtree(:tree)) {
        @current_package = Package.new(tree[:package_name].to_s)
      }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pione-0.1.0 lib/pione/transformer/document-transformer.rb