Class: Tomlrb::Parser

Inherits:
GeneratedParser show all
Defined in:
lib/llm/shell/internal/tomlrb/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.



7
8
9
10
11
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/parser.rb', line 7

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

Instance Method Details

#next_tokenObject



13
14
15
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/parser.rb', line 13

def next_token
  @tokenizer.next_token
end

#parseObject



17
18
19
20
# File 'lib/llm/shell/internal/tomlrb/lib/tomlrb/parser.rb', line 17

def parse
  do_parse
  @handler
end