Class: Protopuffs::Parser::ProtocolBufferDescriptor
- Inherits:
-
Object
- Object
- Protopuffs::Parser::ProtocolBufferDescriptor
- Defined in:
- lib/protopuffs/parser/parser.rb
Instance Method Summary collapse
-
#initialize ⇒ ProtocolBufferDescriptor
constructor
A new instance of ProtocolBufferDescriptor.
- #parse(input) ⇒ Object
Constructor Details
#initialize ⇒ ProtocolBufferDescriptor
Returns a new instance of ProtocolBufferDescriptor.
9 10 11 12 |
# File 'lib/protopuffs/parser/parser.rb', line 9 def initialize Treetop.load File.join(File.dirname(__FILE__), "protocol_buffer") @parser = Protopuffs::ProtocolBufferParser.new end |
Instance Method Details
#parse(input) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/protopuffs/parser/parser.rb', line 14 def parse(input) parse_tree = @parser.parse(input) parse_tree.build parse_tree rescue raise ParseError end |