Class: BCDice::CommonCommand::AddDice::Parser

Inherits:
Racc::Parser
  • Object
show all
Defined in:
lib/bcdice/common_command/add_dice/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(source) ⇒ Object



19
20
21
# File 'lib/bcdice/common_command/add_dice/parser.rb', line 19

def self.parse(source)
  new.parse(source)
end

Instance Method Details

#parse(source) ⇒ Object



23
24
25
26
27
28
# File 'lib/bcdice/common_command/add_dice/parser.rb', line 23

def parse(source)
  @lexer = Lexer.new(source)
  do_parse()
rescue ParseError
  nil
end