Sha256: 3a99c4f4cb0906fa6d1f590a27106a2237b0ac1219e7455afd0e7e345392b30a

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

module Protopuffs

  # The Protopuffs::Parser module holds wrapper classes that parse input
  # strings using Treetop. They also set off the building of an abstract
  # syntax tree from Treetop's parse tree.
  module Parser

    class ProtocolBufferDescriptor
      def initialize
        Treetop.load File.join(File.dirname(__FILE__), "protocol_buffer")
        @parser = Protopuffs::ProtocolBufferParser.new
      end

      def parse(input)
        parse_tree = @parser.parse(input)
        parse_tree.build
        parse_tree
      rescue
        raise ParseError
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
chrisk-protopuffs-0.2.1 lib/protopuffs/parser/parser.rb
chrisk-protopuffs-0.3.0 lib/protopuffs/parser/parser.rb
protopuffs-0.3.0 lib/protopuffs/parser/parser.rb