Class: BCDice::CommonCommand::BarabaraDice::Parser

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(source) ⇒ Object



20
21
22
# File 'lib/bcdice/common_command/barabara_dice/parser.rb', line 20

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

Instance Method Details

#parse(source) ⇒ Object



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

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