Class: Tomlrb::Parser

Inherits:
GeneratedParser show all
Defined in:
lib/tomlrb/parser.rb

Constant Summary

Constants inherited from GeneratedParser

GeneratedParser::Racc_arg, GeneratedParser::Racc_debug_parser, GeneratedParser::Racc_token_to_s_table

Instance Method Summary collapse

Methods inherited from GeneratedParser

#_reduce_none

Constructor Details

#initialize(tokenizer, **options) ⇒ Parser

Returns a new instance of Parser.


5
6
7
8
9
# File 'lib/tomlrb/parser.rb', line 5

def initialize(tokenizer, **options)
  @tokenizer = tokenizer
  @handler   = Tomlrb::Handler.new(**options)
  super()
end

Instance Method Details

#next_tokenObject


11
12
13
# File 'lib/tomlrb/parser.rb', line 11

def next_token
  @tokenizer.next_token
end

#parseObject


15
16
17
18
# File 'lib/tomlrb/parser.rb', line 15

def parse
  do_parse
  @handler
end