Skip to content

Instantly share code, notes, and snippets.

@oeN
oeN / parser.rb
Last active August 29, 2015 14:19 — forked from nicolaracco/parser.rb
basic tokenizer and parser with an approach of Polish notation for calcs
require 'tokenizer'
class Parser
attr_reader :tokens, :prioritize
GRAMMAR = {
number: "insert_operand",
operator: "insert_operator",
open_bracket: "open_bracket",